Skip to content

Commit

Permalink
Improve detection of GE isotropic diffusion (#690)
Browse files Browse the repository at this point in the history
  • Loading branch information
neurolabusc committed Mar 15, 2023
1 parent 1a576ef commit c2a4b28
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions console/nii_dicom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4447,7 +4447,7 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16);
#define kTemporalPositionIndex 0x0020 + uint32_t(0x9128 << 16) // UL
#define kDimensionIndexPointer 0x0020 + uint32_t(0x9165 << 16)
//Private Group 21 as Used by Siemens:
#define kScanningSequenceSiemens 0x0021 + (0x105A << 16) //CS
#define kScanningSequenceSiemens 0x0021 + (0x105A << 16) //CS n.b. for GE this is Diffusion direction of SL!
#define kSequenceVariant21 0x0021 + (0x105B << 16) //CS Siemens ONLY: For GE this is TaggingFlipAngle
#define kScanOptionsSiemens 0x0021 + (0x105C << 16) //CS Siemens ONLY
#define kPATModeText 0x0021 + (0x1009 << 16) //LO, see kImaPATModeText
Expand Down Expand Up @@ -4683,6 +4683,7 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16);
char scanningSequenceSiemens[kDICOMStr] = "";
char imageType1st[kDICOMStr] = "";
bool isEncapsulatedData = false;
int diffusionDirectionTypeGE = 0; //issue690
int multiBandFactor = 0;
int frequencyRows = 0;
int numberOfImagesInMosaic = 0;
Expand Down Expand Up @@ -6540,7 +6541,10 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16);
break; //warp
}
case kScanningSequenceSiemens:
dcmStr(lLength, &buffer[lPos], scanningSequenceSiemens);
if (d.manufacturer == kMANUFACTURER_SIEMENS)
dcmStr(lLength, &buffer[lPos], scanningSequenceSiemens);
if (d.manufacturer == kMANUFACTURER_GE) //issue690
diffusionDirectionTypeGE = dcmInt(lLength, &buffer[lPos], d.isLittleEndian);
break;
case kSequenceVariant21:
if (d.manufacturer != kMANUFACTURER_SIEMENS)
Expand Down Expand Up @@ -7942,6 +7946,9 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16);
//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))
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)) ) )
printWarning("GE DWI vectors may have been removed by Neologica DICOM Anonymizer Pro (Issue 542)\n");
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.20230313"
#define kDCMdate "v1.0.20230315"
#define kDCMvers kDCMdate " " kJP2suf kLSsuf kCCsuf kCPUsuf

static const int kMaxEPI3D = 1024; //maximum number of EPI images in Siemens Mosaic
Expand Down

0 comments on commit c2a4b28

Please sign in to comment.