-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
acq_time filled with n/a when dicoms missing AcquisitionDate (other fields appear valid) #612
Comments
Thanks for the thorough report! indeed #537 is related but different ( I need to find some quality time for heudiconv to address both and possibly look at other locations where access May be you would be interested to prepare PR? ;) |
Sure, happy to take a look later this week. Though, as a warning, I'll probably need to ping you with design questions :) |
For testing, should I include a phantom dicom that was collected with XA30 (or more specifically, one with the Also, I'm wondering about use of the timestamp when storing compressed dicoms. In cases where all datetime information has been stripped from the header, could Lines 369 to 373 in a5e6718
def _assign_dicom_time(ti):
# Reset the date to match the one of the last commit, not from the
# filesystem since git doesn't track those at all
if dcm_time is not None:
ti.mtime = dcm_time
return ti |
I just put a datalad dataset from @jmatthews-rotman (ref: ReproNim/reproin#58) at http://datasets.datalad.org/?dir=/dicoms/jmatthews-rotman/siemens-VA30A-1 . But those seems to have
do you have some shareable dicoms -- I could also share them from datasets.datalad.org (we don't want to "abuse" git in this repo)? for the 2nd question -- we need to figure out smth to make it reproducible, most likely some other date/time from dicoms. Anything in mind? |
I'm not following why files from that dataset wouldn't work -- don't they match this issue of not having the
This seems comparable to the case that I was working with, which is one where the files don't have If that's true, then how about one of the small ones, like MRI_102TD_PHA_S.MR.Chen_Matthews_1.4.1.2022.11.16.15.50.20.357.31204552.dcm ? For assigning |
I think I am in rush mixed up what was missing ;) smaller one is good. re |
I'm seeing
That lack of many instances of |
from a quick grep for |
That does sound like confusion worth avoiding. I'd suggest pulling something like Am I correct in thinking that |
AFAIK not at all. If anything, datalad with its
So that rerunning conversion doesn't produce unexpected difference, especially for large files such as dicom tarballs we are storing within dcm_time = get_dicom_series_time(dicom_list)
def _assign_dicom_time(ti):
# Reset the date to match the one from the dicom, not from the
# filesystem so we could sort reproducibly
ti.mtime = dcm_time
return ti Another place where date/timestamps are used -- are populated in
may be, may be ... but again -- where do we have a use case where there is completely no date and time available - do you have an example? above we talked about where it just becomes two separate fields (for Date and Time). If no Date available, we can just choose date which BIDS assumes for annonymization if dates are prior 1925 so year could be produced reproducibly from smth like |
Allowing loss of sortability would be easier. Though, ofc, I don't want to accidentally cause some unexpected issue in code/workflows that rely on this behavior.
That was my understanding of the related case, #537 (specifically, this comment) Though, I suppose, even in cases of anonymization, To avoid issues with epoch/
Thanks for bringing this up. I had been assuming that setting |
ok
if it is now -- then there is slight preference to keep it as that, but i do not really see such a need. those tar mtimes AFAIK are really just for reproducible tar generation. |
Great, thanks for working through all this. I should be able to update the pull request by the end of the week, including elements in this discussion and the other requested revisions (e.g., python version, docstring style, etc) |
🚀 Issue was released in |
Summary
I'm trying to use heudiconv to produce a bids folder from scans collected on a Siemens scanner that was recently upgraded to XA30. It's my impression that, to fill the
acq_time
column in the*scans.tsv
files, heudiconv uses the dicom tagAcquisitionDate
(here?). In the scans that I have, that tag isn't available.Here's a snippet from the logs, which shows a warning about the missing
AcquisitionDate
This is only a warning, and conversion proceeds. The main issue is that the
scans.tsv
file no longer has usable entries in theacq_time
column (rows filled withn/a
).Fortunately, there is an
AcquisitionDateTime
that could presumably fill the same role, although the formatting may need work.The fields used in get_dicom_series_time would also work (
SeriesDate
/SeriesTime
).Here is an example phantom scan with
AcquisitionDateTime
but notAcquisitionDate
: sub-sh_ses-221108_T1w.zipThis is perhaps related to #537, although again I'm only seeing a warning and not an error/crash
Platform details:
Choose one:
env.yml
psadil/heudiconv:221121 https://hub.docker.com/repository/docker/psadil/heudiconv
0.11.6
heuristic: reproin.py + a few entries in
protocols2fix
and hits fromfilter_dicom
The text was updated successfully, but these errors were encountered: