moloney / dcmstack

DICOM to Nifti conversion with meta data preservation
Other
72 stars 51 forks source link

incorrect grouping from same set of sequences #40

Closed satra closed 7 years ago

satra commented 8 years ago

@moloney - we have a dataset that's collected on a siemens trio with vb17 that's giving https://github.com/nipy/heudiconv some trouble.

specifically, all we need is dcmstack's parse and group functionality and then we hand over the conversion to any converter in batches.

https://github.com/nipy/heudiconv/blob/master/bin/heudiconv#L67

however in our dataset 2 of the 28 participants are showing the following patterns for some sequences:

  1. slices = slices * timepoints
e.g. slices = 128 * 10
5042    somefile.IMA    15-DIFFUSION_HighRes_PA_B0      -       -       -       128     128     
1280    1       9.72    84.0    DIFFUSION_HighRes_PA_B0 False
  1. timepoints = 2 * timepoints (either for structural or functional - so sequence independent behavior)
timepoints = 176 * 2 or 183 * 2
1766    somefile.IMA    3-MEMPRAGE_4e_p2_1mm_iso        -       -       -       256     256     
 352     1      2.53    2.1     MEMPRAGE_4e_p2_1mm_iso  False 
6232    somefile.IMA    22-localizer_ge_func_3.1x3.1x3.1_PACE   -       -       -       64      64      32     
 366     2.06    30.0    localizer_ge_func_3.1x3.1x3.1_PACE      False

and the 2 participants are not sequential.

any ideas as to what could be causing this?

and more generally we would like to simply have that functionality be an api call in dcmstack, without any nifti conversion. it should simply give us a list of series with grouped dicomfiles and their metadata.

moloney commented 8 years ago

I am not sure I understand the problem. Things are being grouped together by parse_and_group that you think should be separate?

The parse_and_group method just groups based on the values corresponding to keys provided by the group_by argument. By default those keys are: 'SeriesInstanceUID', 'SeriesNumber', 'ProtocolName', and 'ImageOrientationPatient'. If that default isn't working you can override it.

moloney commented 8 years ago

Also, I do np.allclose tests on 'ImageOrientationPatient' to allow slightly different values. Maybe the threshold there needs to be adjusted?

satra commented 8 years ago

@moloney - i'll take a closer look this weekend.

moloney commented 7 years ago

Can this one be closed?