Skip to content

Commit a293cde

Browse files
committed
Experimental support for fMRI (#809)
1 parent aa2bb8f commit a293cde

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

console/nii_dicom.cpp

+13-1
Original file line numberDiff line numberDiff line change
@@ -4954,6 +4954,18 @@ struct TDICOMdata readDICOMx(char *fname, struct TDCMprefs *prefs, struct TDTI4D
49544954
d.dimensionIndexValues[1] = floor(B0Philips);
49554955
d.dimensionIndexValues[2] = inStackPositionNumber;
49564956
nDimIndxVal = 3;
4957+
} else if ((d.manufacturer == kMANUFACTURER_PHILIPS) && (nDimIndxVal > 1) && (volumeNumber > 0) && (inStackPositionNumber > 0) ) {
4958+
isKludgeIssue809 = true;
4959+
for (int i = 0; i < nDimIndxVal; i++)
4960+
d.dimensionIndexValues[i] = 0;
4961+
int phase = d.phaseNumber;
4962+
if (d.phaseNumber < 0)
4963+
phase = 0; // if not set: we are saving as UINT
4964+
d.dimensionIndexValues[0] = inStackPositionNumber; // dim[3] slice changes fastest
4965+
d.dimensionIndexValues[1] = phase; // dim[4] successive volumes are phase
4966+
d.dimensionIndexValues[2] = 0; // dim[5] Control/Label unused for fMRI
4967+
d.dimensionIndexValues[3] = volumeNumber; // dim[6] Repeat changes slowest
4968+
nDimIndxVal = 4; // slice < phase < control/label < volume
49574969
}
49584970
if ((volumeNumber == 1) && (acquisitionTimePhilips >= 0.0) && (inStackPositionNumber > 0)) {
49594971
d.CSA.sliceTiming[inStackPositionNumber - 1] = acquisitionTimePhilips;
@@ -8145,7 +8157,7 @@ struct TDICOMdata readDICOMx(char *fname, struct TDCMprefs *prefs, struct TDTI4D
81458157
if ((isKludgeIssue533) && (numDimensionIndexValues > 1))
81468158
printWarning("Guessing temporal order for Philips enhanced DICOM ASL (issue 532).\n");
81478159
if ((isKludgeIssue809) && (numDimensionIndexValues > 1))
8148-
printWarning("Guessing temporal order for Philips enhanced DICOM DWI (issue 809).\n");
8160+
printWarning("Guessing temporal order for Philips enhanced DICOM DWI and fMRI (issue 809).\n");
81498161
// sort dimensions
81508162
if (stackPositionItem < maxVariableItem)
81518163
qsort(dcmDim, numberOfFrames, sizeof(struct TDCMdim), compareTDCMdim);

0 commit comments

Comments
 (0)