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

Development #778

Merged
merged 3 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions console/nii_dicom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4734,6 +4734,7 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); //FD
char imageType1st[kDICOMStr] = "";
bool isEncapsulatedData = false;
int diffusionDirectionTypeGE = 0; //issue690
int seriesdiffusionDirectionTypeGE = 0; //issue690, 777
int multiBandFactor = 0;
int frequencyRows = 0;
int numberOfImagesInMosaic = 0;
Expand Down Expand Up @@ -6660,8 +6661,8 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); //FD
case kScanningSequenceSiemens:
if (d.manufacturer == kMANUFACTURER_SIEMENS)
dcmStr(lLength, &buffer[lPos], scanningSequenceSiemens);
if (d.manufacturer == kMANUFACTURER_GE) //issue690
diffusionDirectionTypeGE = dcmInt(lLength, &buffer[lPos], d.isLittleEndian);
if (d.manufacturer == kMANUFACTURER_GE) //issue690, series-level 16=DFAXDTI
seriesdiffusionDirectionTypeGE = dcmInt(lLength, &buffer[lPos], d.isLittleEndian);
break;
case kSequenceVariant21:
if (d.manufacturer != kMANUFACTURER_SIEMENS)
Expand Down Expand Up @@ -7068,7 +7069,7 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); //FD
break;
d.shimGradientZ = dcmIntSS(lLength, &buffer[lPos], d.isLittleEndian);
break;
case kVasCollapseFlagGE: //SS issue 690 16=DiffusionDtiDicomValue
case kVasCollapseFlagGE: //SS issue 690 image-level 16=DiffusionDtiDicomValue or 14=DiffusionT2DicomValue (initial b0)
if (d.manufacturer != kMANUFACTURER_GE)
break;
diffusionDirectionTypeGE = dcmIntSS(lLength, &buffer[lPos], d.isLittleEndian);
Expand Down Expand Up @@ -8126,8 +8127,11 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); //FD
//in practice 0020,0110 not used
//https://github.com/bids-standard/bep001/blob/repetitiontime/Proposal_RepetitionTime.md
}
//issue690
if ((d.manufacturer == kMANUFACTURER_GE) && (diffusionDirectionTypeGE > 0) && (diffusionDirectionTypeGE != 16))
//issue690, 777
// detect non-DTI for GE
if ((d.manufacturer == kMANUFACTURER_GE) && (diffusionDirectionTypeGE > 0) && (diffusionDirectionTypeGE != 16) && (diffusionDirectionTypeGE != 14))
d.numberOfDiffusionDirectionGE = 0;
if ((d.manufacturer == kMANUFACTURER_GE) && (seriesdiffusionDirectionTypeGE > 0) && (seriesdiffusionDirectionTypeGE != 16))
d.numberOfDiffusionDirectionGE = 0;
//issue 542
if ((d.manufacturer == kMANUFACTURER_GE) && (isNeologica) && (!isSameFloat(d.CSA.dtiV[0], 0.0f)) && ((isSameFloat(d.CSA.dtiV[1], 0.0f)) && (isSameFloat(d.CSA.dtiV[2], 0.0f)) && (isSameFloat(d.CSA.dtiV[3], 0.0f)) ) )
Expand Down
2 changes: 1 addition & 1 deletion console/nii_dicom.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ extern "C" {
#define kCPUsuf " " //unknown CPU
#endif

#define kDCMdate "v1.0.20240109"
#define kDCMdate "v1.0.20240117"
#define kDCMvers kDCMdate " " kJP2suf kLSsuf kCCsuf kCPUsuf

static const int kMaxEPI3D = 1024; //maximum number of EPI images in Siemens Mosaic
Expand Down
9 changes: 5 additions & 4 deletions console/nii_dicom_batch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2534,7 +2534,7 @@ int *nii_saveDTI(char pathoutname[], int nConvert, struct TDCMsort dcmSort[], st
*numADC = 0;
bvals = (float *)malloc(numDti * sizeof(float));
int numGEwarn = 0;
bool isGEADC = (dcmList[indx0].numberOfDiffusionDirectionGE == 0);
bool isGEADC = (dcmList[indx0].numberOfDiffusionDirectionGE == 0); // GE non-DTI
for (int i = 0; i < numDti; i++) {
bvals[i] = vx[i].V[0];
//printMessage("---bxyz %g %g %g %g\n",vx[i].V[0],vx[i].V[1],vx[i].V[2],vx[i].V[3]);
Expand All @@ -2556,8 +2556,9 @@ int *nii_saveDTI(char pathoutname[], int nConvert, struct TDCMsort dcmSort[], st
}
bvals[i] = bvals[i] + (0.5 * i / numDti); //add a small bias so ties are kept in sequential order
}
if (numGEwarn > 0)
printWarning("Some images had bval>0 but bvec=0 (either Trace or b=0, see issue 245)\n");
// See issue 777: removed the warning because GE DTI b=0 with bval>0 but bvec=0 (prior to version 29.1) will be handled by geCorrectBvecs()
// if (numGEwarn > 0)
// printWarning("Some images had bval>0 but bvec=0 (either Trace or b=0, see issue 245)\n");
/*if ((*numADC == numDti) || (numGEwarn == numDti)) { //issue 405: we now save bvals file for isotropic series
//all isotropic/ADC images - no valid bvecs
*numADC = 0;
Expand Down Expand Up @@ -7225,7 +7226,7 @@ void sliceTimingGE(struct TDICOMdata *d, const char *filename, struct TDCMopts o
}
}*/
//end: version check
if (d->maxEchoNumGE > 0)
if ((d->maxEchoNumGE > 0) && (d->internalepiVersionGE != 2)) // GE non-Diffusion only
printWarning("GE sequence with %d echoes. See issue 359\n", d->maxEchoNumGE);
if ((d->protocolBlockStartGE < 1) || (d->protocolBlockLengthGE < 19))
return;
Expand Down