Skip to content

Commit

Permalink
Detect GE direct fieldmaps (#501)
Browse files Browse the repository at this point in the history
  • Loading branch information
neurolabusc committed Apr 10, 2021
1 parent 0290321 commit b9252b5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
10 changes: 10 additions & 0 deletions console/nii_dicom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4350,6 +4350,7 @@ const uint32_t kEffectiveTE = 0x0018+ (0x9082 << 16);
#define kFloatPixelPaddingValue 0x0028+(0x0122 << 16 ) // https://github.com/rordenlab/dcm2niix/issues/262
#define kIntercept 0x0028+(0x1052 << 16 )
#define kSlope 0x0028+(0x1053 << 16 )
//#define kRescaleType 0x0028+(0x1053 << 16 ) //LO e.g. for Philips Fieldmap: [Hz]
//#define kSpectroscopyDataPointColumns 0x0028+(0x9002 << 16 ) //IS
#define kGeiisFlag 0x0029+(0x0010 << 16 ) //warn user if dreaded GEIIS was used to process image
#define kCSAImageHeaderInfo 0x0029+(0x1010 << 16 )
Expand Down Expand Up @@ -4527,6 +4528,7 @@ uint32_t kSequenceDelimitationItemTag = 0xFFFE +(0xE0DD << 16 );
bool isSwitchToBigEndian = false;
bool isAtFirstPatientPosition = false; //for 3d and 4d files: flag is true for slices at same position as first slice
bool isMosaic = false;
bool isGEfieldMap = false; //issue501
int patientPositionNum = 0;
float B0Philips = -1.0;
float vRLPhilips = 0.0;
Expand Down Expand Up @@ -5544,6 +5546,8 @@ uint32_t kSequenceDelimitationItemTag = 0xFFFE +(0xE0DD << 16 );
if (strcmp(epiStr, "EPI2") == 0){
d.internalepiVersionGE = 2; //-1 = not epi, 1 = EPI, 2 = EPI2
}
if ((strcmp(epiStr, "EFGRE3D") == 0) || (strcmp(epiStr, "B0map") == 0))
isGEfieldMap = true; //issue501
break;
}
case kBandwidthPerPixelPhaseEncode:
Expand Down Expand Up @@ -6839,6 +6843,12 @@ uint32_t kSequenceDelimitationItemTag = 0xFFFE +(0xE0DD << 16 );
//printMessage("Issue 373: Check for ZIP2 Factor: %d SliceThickness+SliceGap: %f, SpacingBetweenSlices: %f \n", zipFactor, d.xyzMM[3], d.zSpacing);
locationsInAcquisitionGE *= zipFactor; // Multiply number of slices by ZIP factor. Do this prior to checking for conflict below (?).
}
if (isGEfieldMap) { //issue501 : to do check zip factor
//Volume 1) derived phase field map [Hz] and 2) magnitude volume.
d.isDerived = (d.imageNum <= locationsInAcquisitionGE); //first volume
d.isRealIsPhaseMapHz = d.isDerived;
d.isHasReal = d.isDerived;
}
/* SAH.end */
if (locationsInAcquisitionGE < d.locationsInAcquisition) {
d.locationsInAcquisitionConflict = d.locationsInAcquisition;
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.20210403"
#define kDCMdate "v1.0.20210410"
#define kDCMvers kDCMdate " " kJP2suf kLSsuf kCCsuf kCPUsuf

static const int kMaxEPI3D = 1024; //maximum number of EPI images in Siemens Mosaic
Expand Down
3 changes: 3 additions & 0 deletions console/nii_dicom_batch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1201,6 +1201,9 @@ tse3d: T2*/
fprintf(fp, "\t\"PhilipsScaleSlope\": %g,\n", d.intenScalePhilips );
fprintf(fp, "\t\"UsePhilipsFloatNotDisplayScaling\": %d,\n", opts.isPhilipsFloatNotDisplayScaling);
}
//https://bids-specification--622.org.readthedocs.build/en/622/04-modality-specific-files/01-magnetic-resonance-imaging-data.html#case-3-direct-field-mapping
if ((d.isRealIsPhaseMapHz) && (d.isHasReal))
fprintf(fp, "\t\"Units\": \"Hz\",\n"); //
//PET ISOTOPE MODULE ATTRIBUTES
json_Str(fp, "\t\"Radiopharmaceutical\": \"%s\",\n", d.radiopharmaceutical);
json_Float(fp, "\t\"RadionuclidePositronFraction\": %g,\n", d.radionuclidePositronFraction );
Expand Down

0 comments on commit b9252b5

Please sign in to comment.