GSTT-CSC / hazen

Quality assurance framework for Magnetic Resonance Imaging
https://github.com/GSTT-CSC/hazen
Apache License 2.0
20 stars 6 forks source link

Opening enhanced DICOM with __init__.py removes some DICOM metadata #210

Open YassineAzma opened 2 years ago

YassineAzma commented 2 years ago

Describe the bug In order to access slice-specific metadata, it is necessary to access the PerFrameFunctionalGroupsSequence. When using the DICOM loading procedure used in Hazen, this field disappears, making it impossible to access frame/slice-specific metadata. Please see #87 where I discuss this further.

To Reproduce Use enhanced DICOM data. An example can be found below. 16 - T1W_SE_AX.zip

Expected behaviour The PerFrameFunctionalGroupsSequence field should appear. I've managed to achieve this by removing the is_dicom_file and EXCLUDED_FILES exceptions/conditions in lines 336-337 of init.py.

Screenshots See my comment in #87.

Desktop (please complete the following information):

Additional context This makes it impossible to perform analysis of ACR data with enhanced DICOM and an interleaved slice order. It's necessary to sort the slices prior to any analysis in such a case.

For those unaware, enhanced DICOM involves taking the slices from a single imaging series and putting them into a single file, rather than having one file per slice. This results in changes to the DICOM header information's presentation.

laurencejackson commented 2 years ago

Thanks for reporting this bug Yassine. I will look into it, could you confirm which version of hazen you're using?

YassineAzma commented 2 years ago

Sorry for the delay. The hazen version I'm using is 0.5.2.

Lucrezia-Cester commented 1 year ago

Hi @YassineRMH, could you please provide a single DICOM with the required field PerFrameFunctionalGroupsSequence? When I unzip the folder you sent it groups all the images in one single image.

YassineAzma commented 1 year ago

That is what enhanced/multi-frame DICOM is. All images/frames from a single series are placed within a single DICOM file. It’s meant to conserve space.

Best wishes, Yassine

tomaroberts commented 1 year ago

hazen weekly w/ Sophie – think this boils down to utils.is_dicom_file() and possible utils.is_enhanced_dicom() being too stringent. TODO: investigate.

sophie22 commented 10 months ago

Discovered ACR phantom enhanced DICOMs not opening in hazen currently. Following error:

AttributeError: 'FileDataset' object has no attribute 'ImagePositionPatient'

Further investigation of Enhanced DICOM header shows that this tag is buried in a Sequence group. Need to update hazen to perform enhanced DICOM check and then pull tag from adjusted tag location.