Skip to content

Commit

Permalink
Do not convert enhanced DICOMs where slice orientation varies within …
Browse files Browse the repository at this point in the history
…a series (#894)
  • Loading branch information
neurolabusc committed Dec 8, 2024
1 parent e922fe8 commit 7067959
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion console/nii_dicom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4699,6 +4699,7 @@ struct TDICOMdata readDICOMx(char *fname, struct TDCMprefs *prefs, struct TDTI4D
bool isHasBMatrix = false;
bool isHasBVec = false;
bool is2005140FSQ = false;
bool isSliceOrientVaries = false; //issue894
int sqDepth04000561 = -1;
bool is00089092SQ = false; // Referenced Image Evidence SQ
bool overlayOK = true;
Expand Down Expand Up @@ -7553,10 +7554,11 @@ struct TDICOMdata readDICOMx(char *fname, struct TDCMprefs *prefs, struct TDTI4D
if ((!isSameFloatGE(d.orient[1], orient[1]) || !isSameFloatGE(d.orient[2], orient[2]) || !isSameFloatGE(d.orient[3], orient[3]) ||
!isSameFloatGE(d.orient[4], orient[4]) || !isSameFloatGE(d.orient[5], orient[5]) || !isSameFloatGE(d.orient[6], orient[6]))) {
if (!d.isLocalizer)
printMessage("slice orientation varies (localizer?) [%g %g %g %g %g %g] != [%g %g %g %g %g %g]\n",
printError("DICOM incompatible with NIfTI slice orientation varies (issue 894, localizer?) [%g %g %g %g %g %g] != [%g %g %g %g %g %g]\n",
d.orient[1], d.orient[2], d.orient[3], d.orient[4], d.orient[5], d.orient[6],
orient[1], orient[2], orient[3], orient[4], orient[5], orient[6]);
d.isLocalizer = true;
isSliceOrientVaries = true;
}
}
dcmMultiFloat(lLength, (char *)&buffer[lPos], 6, d.orient);
Expand Down Expand Up @@ -8474,6 +8476,8 @@ struct TDICOMdata readDICOMx(char *fname, struct TDCMprefs *prefs, struct TDTI4D
d.SAR = fmax(maxSAR, d.SAR);
// d.rawDataRunNumber = (d.rawDataRunNumber > d.phaseNumber) ? d.rawDataRunNumber : d.phaseNumber; //will not work: conflict for MultiPhase ASL with multiple averages
// end: issue529
if (isSliceOrientVaries)
d.isValid = false; //issue894
if (hasDwiDirectionality)
d.isVectorFromBMatrix = false; // issue 265: Philips/Siemens have both directionality and bmatrix, Bruker only has bmatrix
// printf("%s\t%s\t%s\t%s\t%s_%s\n",d.patientBirthDate, d.procedureStepDescription,d.patientName, fname, d.studyDate, d.studyTime);
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.20241127"
#define kDCMdate "v1.0.20241208"
#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 7067959

Please sign in to comment.