fli-iam / shanoir-ng

Shanoir (SHAring iN vivO Imaging Resources)
GNU General Public License v3.0
21 stars 21 forks source link

ZIP Import: issue with multi-frame DICOM #1774

Open michaelkain opened 1 year ago

michaelkain commented 1 year ago
michaelkain commented 1 year ago

first analysis: probably: multi-exam import checkbox has been used

michaelkain commented 1 year ago

My further findings: The MultiframeExtractor throws a NullPointerException on the last line of the following lines of code: String frameType3 = sf.getString(Tag.ImageType, 2); // get the 3 value after the second \ if ("ANGIO".equals(frameType3)) sf.setString(Tag.AngioFlag, VR.CS, "Y"); if (frameType3.startsWith("CARD")) // NPE thrown here, because frameType3 is empty

The reason is the below attribute, has the below content for 2 series out of all series: (0008,0008) CS [ORIGINAL\PRIMARY] ImageType frameType3 gets the third part of the string separated by backslash from ImageType, what is null in the two error series

For all other series, they have the following values: (0008,0008) CS [ORIGINAL\PRIMARY\ T1 \NONE] ImageType frameType3 becomes T1 here, and no error occurs or (0008,0008) CS [ORIGINAL\PRIMARY\ DIFFUSION \NONE] ImageType frameType3 becomes DIFFUSION here, and no error occurs

michaelkain commented 1 year ago

from the DICOM Enhance MR Image specification:

C.8.16.1 Image Type and Frame Type

Image Type (0008,0008) and associated Image Type related Attributes provide a high level description of a multi-frame SOP Instance. These Attributes describe properties that provide key summary information to users of the SOP Instance. Image Type (0008,0008) contains the highest level summary of what is in the SOP Instance.

Frame Type (0008,9007) mirrors the corresponding Image Type Attribute and applies to the frame level rather than to the image level.

Image Type (0008,0008) and Frame Type (0008,9007) shall consist of four values.

2 series of the above error provide one two values instead of four values!!!

C.8.16.1.3 Image Flavor

Value 3 is an overall representation of the image type. This value may be a summary of several other Attributes or a duplication of one of the other Attributes to indicate the most important aspect of this image. Value 3 Image Flavor is to be used with Value 4 Derived Pixel Contrast to indicate the nature of the image set. Note

For example Value 3 = DIFFUSION together with Value 4 = NONE indicates that the image set was originally collected for DIFFUSION.

If Value 3 = DIFFUSION together with Value 4 = DIFFUSION this indicates that the object contains DIFFUSION weighted post processed images.

Value 3 of Image Type (0008,0008) shall not be zero length. The 2 error series have an Image Flavor value of null, what shall not be the case.

Value 3 of Frame Type (0008,9007) may have the same value as found in Value 3 of Image Type (0008,0008), or may have a different value.

michaelkain commented 1 year ago

the two problem series are: MP2RAGE_SAG_BSC_INV2_ND MP2RAGE_SAG_BSC_INV2