moloney / dcmstack

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

confusion about AcquisitionTime #3

Closed bpinsard closed 11 years ago

bpinsard commented 11 years ago

There is a confusion possible about AcquisitionTime label as it seems that it stores only one value per volume (first slice) and does not store slice AcquisitionTime in ext['time']['slices'].

I was expecting that nii.get_meta('AcquisitionTime', (0,0,0,0)) and nii.get_meta('AcquisitionTime', (0,0,1,0)) would give different time values corresponding to the slice acquisition time.

How could I get such value stored into the nifti extension without storing it in 2D?

moloney commented 11 years ago

Are you sure the original DICOM data sets had different acquisition times for different slices? Many acquisitions will write out the same acquisition time for every slice in a volume.

bpinsard commented 11 years ago

yes I checked it using pydicom it seems that this reduction is done here: https://github.com/moloney/dcmstack/blob/master/src/dcmstack/dcmstack.py#L886

moloney commented 11 years ago

That piece of code is trying to set the relative slice timing in the Nifti header. It does not affect the meta data extension at all.

A couple of other things:

1) If the AcquisitionTime is varying in every slice it will end up in ext['global']['slices'].

2) Doing nii.get_meta('AcquisitionTime', (0,0,0,0)) and nii.get_meta('AcquisitionTime', (0,0,1,0)) will only give different results if the index of the slice dimension is 2.

If you are still convinced that dcmstack is losing some of the AcquisitionTime values perhaps you can create a test case demonstrating the problem (or send me some of the data to try).

bpinsard commented 11 years ago

Sorry I realised I mixed everything while double checking for that, so I close this issue. BTW, do you know where can I find the slice specific acquisition time? TriggerTime seems to be scanner/configuration specific dependent. Siemens mosaic has MosaicRefAcqTime, some GE has TriggerTime being slice dependent, others miss the tag and have an RTIA_timer tag (0021,105e), for Philips it is only by guessing from slice ordering.

moloney commented 11 years ago

Sorry, I don't know of any other tags for per-slice acquisition times besides the ones you mentioned.