heudiconv icon indicating copy to clipboard operation
heudiconv copied to clipboard

Add an examplar of dcm_file path in seqinfo

Open bpinsard opened this issue 5 years ago • 8 comments

Add an examplar of a dicom file in seqinfo to allow access more information in infotodict.

bpinsard avatar Apr 17 '19 14:04 bpinsard

Codecov Report

Merging #333 (1137713) into master (80a6538) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #333   +/-   ##
=======================================
  Coverage   77.64%   77.64%           
=======================================
  Files          41       41           
  Lines        3167     3167           
=======================================
  Hits         2459     2459           
  Misses        708      708           
Impacted Files Coverage Δ
heudiconv/dicoms.py 82.11% <ø> (ø)
heudiconv/utils.py 90.03% <ø> (ø)
heudiconv/parser.py 92.70% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 80a6538...1137713. Read the comment docs.

codecov-io avatar Apr 17 '19 14:04 codecov-io

@bpinsard - i think this is a good start. it would be nice to add a test, an example heuristic that uses the dicom info from the file.

@yarikoptic @mgxd what do you think?

more generally would it be useful to pass paths to all files in a group? obviously we can't store this in the dicominfo.tsv, but we are storing this in the filegroup.json, so could we simply pass that along with seqinfo?

satra avatar Apr 18 '19 00:04 satra

I am worrying of storing full paths there, since then it would prevent any relocation etc. This sounds like a workaround for some specific use-case of missing information in the seqinfo. So what was it @bpinsard ?

yarikoptic avatar Apr 18 '19 14:04 yarikoptic

@bpinsard could you please followup with description of the problem/use-case you are trying to address here?

yarikoptic avatar Nov 22 '19 16:11 yarikoptic

At the acquisition center we store information in the following dicom tags:

  • ReferringPhysicianName
  • StudyDescription
  • PatientName Which I use to find the subject_id, as well as research group, study, to build the locator in infotoids.

And I also extract information from:

  • dcm.csa_header['tags']['PhaseEncodingDirectionPositive']['items'][0]
  • dcm.dcm_data.InPlanePhaseEncodingDirection
  • dcm.dcm_data.ImageComments to identify the sequence, if it is a sbref, and phase-encoding direction more reliably than from the ProtocoleName or else.

I don't know if this is relevant to other people. If not we can close that.

bpinsard avatar Nov 22 '19 16:11 bpinsard

hold on -- we are already storing a filename and a directory for the file:

        info = SeqInfo(
            total,
            op.split(series_files[0])[1],
            series_id,
            op.basename(op.dirname(series_files[0])),

But why don't we also extend the SeqInfo record with found to be useful additional fields to contain the ones you desire so there is no need to re-load the dicom?

yarikoptic avatar Dec 02 '19 19:12 yarikoptic

SeqInfo does include filename and the folder but the later is only the name of the last folder in the path that contains the dicom, not the full path. Is there a specific reason for that? If we remove the basename call, I think this leaves the opportunity to reread a single dicom per series, even if not optimal, and extract any kind of information without creating a very large SeqInfo structure.

bpinsard avatar Dec 07 '19 01:12 bpinsard

SeqInfo does include filename and the folder but the later is only the name of the last folder in the path that contains the dicom, not the full path.

oh, right -- I was too fast in misreading that code. Thanks for the explanation ;)

Is there a specific reason for that?

probably again just to not leak absolute paths there, and provide minimal sufficient (someone might want to use filename, some name of the immediate directory with dicoms) information for the heuristic.

yarikoptic avatar Dec 07 '19 02:12 yarikoptic