Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

splitting 4D too much #373

Closed
lamaresh opened this issue Feb 9, 2020 · 7 comments
Closed

splitting 4D too much #373

lamaresh opened this issue Feb 9, 2020 · 7 comments

Comments

@lamaresh
Copy link

lamaresh commented Feb 9, 2020

I report a bug similar to #355

when I try to convert a GE 3D phase-contrast brain venography made by anatomical + angiographic images, each volume is split in 2, resulting in a 4D nii made by 4 volumes instead of 2.
I'm using last development build.

@neurolabusc
Copy link
Collaborator

I believe this is a replication of issue 336 and 365. You are using the new GE multi-band (hyper-band) sequences.

On MacOS and Linux you can build the developmental branch with these commands:

git clone --branch development https://github.com/rordenlab/dcm2niix.git
cd dcm2niix/console
make
./dcm2niix

Windows users should be able to get a compiled version from AppVeyor.

Please use the developmental branch until the next stable release. Vendors are continually tweaking their interpretation of DICOM, so we need to constantly update our conversion to support their latest features.

@lamaresh
Copy link
Author

lamaresh commented Feb 10, 2020

I'm already using last development build and the bug still happens, but only with 3D phase contrast venography

@neurolabusc
Copy link
Collaborator

Can you send me a link to a sample dataset via Box, DropBox or GoogleDrive (use the email in my avatar).

@halfSpinDoctor
Copy link

halfSpinDoctor commented Feb 14, 2020

This may be related: I have the same issue (that is, instead of a single volume with matirx 256x256x120x1, the image is being split into into 256x256x60x2) with 3D fat/water series that have slice zero pad interpolation enabled (ZIP2). This is a big impact for me since the GE PET/MR system uses this protocol for MR-based attenuation correction (MRAC).

In this case, d.locationsInAcquisition = 480 and imagesInAcquisition = 480, because the series outputs 120 slices x 4 images (Water, Fat, InPhase, OutPhase), but these four contrasts are split into separate DICOM series.

Furthermore, locationsInAcqusitionGE = 60 (0020,1002), because 60 slices were acquired, even though 120 per DICOM series are reconstructed. This check does not work, because neither 60 nor 480 are the correct number of slices:

if (isVerbose) printMessage("Check number of slices, discrepancy between tags (0020,1002; 0021,104F; 0054,0081) (%d vs %d) %s\n", locationsInAcquisitionGE, d.locationsInAcquisition, fname);

The check for interpolated slices does not work, because both d.locationsInAcquisition and imagesInAcquisition are incorrectly set to 480:

d.locationsInAcquisition = imagesInAcquisition; //e.g. if 72 slices acquired but interpolated as 144

d.locationsInAcquisition: 480
imagesInAcquisition: 480

@halfSpinDoctor
Copy link

halfSpinDoctor commented Feb 14, 2020

I have a MATLAB based converter that I use as a test bed for replicating problems. In this code, I compare SliceThickness to SpacingBetweenSlices as a test to see if ZIP2 is enabled. I have re-implemented this in nii_dicom.cpp and verified that it works for my test data. The check goes within the if statement block for checking locationsInAcqusition for GE:

    if ((d.manufacturer == kMANUFACTURER_GE) && (d.locationsInAcquisition > 0)  &&  (locationsInAcquisitionGE > 0) && (d.locationsInAcquisition != locationsInAcquisitionGE) ) {
    	if (isVerbose)
    		printMessage("Check number of slices, discrepancy between tags (0020,1002; 0021,104F; 0054,0081) (%d vs %d) %s\n", locationsInAcquisitionGE, d.locationsInAcquisition, fname);
    	/* SAH.start: Fix for ZIP2 */
    	int zipFactor = (int) roundf(d.xyzMM[3] / d.zSpacing);
    	if (zipFactor > 1) {
    		printMessage("Check for ZIP2: SliceThickness+SliceGap: %f, SpacingBetweenSlices: %f \n", d.xyzMM[3], d.zSpacing);
    		printMessage("Slice ZIP factor: %d  \n", zipFactor);
    		locationsInAcquisitionGE *= zipFactor; // Multiply number of slices by ZIP factor. Do this prior to checking for conflict below (?).
    	}
    	/* SAH.end */
    	if (locationsInAcquisitionGE < d.locationsInAcquisition) {
    		d.locationsInAcquisitionConflict = d.locationsInAcquisition;
    		d.locationsInAcquisition = locationsInAcquisitionGE;
    	} else
    		d.locationsInAcquisitionConflict = locationsInAcquisitionGE;
    }

neurolabusc added a commit that referenced this issue Feb 14, 2020
@neurolabusc
Copy link
Collaborator

@halfSpinDoctor that looks like an elegant solution, and a clear explanation of the issue. I have committed it to the developmental branch. Hopefully GE users can validate this patch for unintended consequences.

@lamaresh does this resolve your issue?

@lamaresh
Copy link
Author

Yes, it works properly now.

yarikoptic added a commit to neurodebian/dcm2niix that referenced this issue May 6, 2020
* tag 'v1.0.20200331': (52 commits)
  Update submodules
  Update dcm_qa submodule.
  UIH 3D sequence quirk
  New release, EstimatedTotalReadoutTime/EstimatedEffectiveEchoSpacing (rordenlab#377)
  Philips TotalReadoutTime (rordenlab#377)
  Cleanup
  Experimental Canon DICOM support (rordenlab#388)
  Experimental solution for issue 384 (rordenlab#384)
  Detect catastrophic anonymization (rordenlab#383)
  Only report "multiple inversion times" if 0018,9079 values differ (e.g. Bangalore data in https://github.com/neurolabusc/dcm_qa_philips)
  Consistent echo naming (rordenlab#381)
  Philips partial Fourier (rordenlab#377)
  Support InversionTImes (0018,9079) tag (rordenlab#380)
  Philips effective echo spacing formula ambiguous (rordenlab#377)
  TR for Philips 3D EPI (rordenlab#369)
  Citation (rordenlab#102)
  GE PET with variable slice intensity (rordenlab#374)
  Estimate Philips EffectiveEchoSpacing (nipreps/sdcflows#5)
  GE slice interpolation (rordenlab#373)
  3D EPI TR (rordenlab#369) 3D phase (rordenlab#371) Enhanced ordering (rordenlab#372 (comment))
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants