@@ -2389,7 +2389,8 @@ tse3d: T2*/
23892389 // FSL definition is start of first line until start of last line.
23902390 // Other than the use of (n-1), the value is basically just 1.0/bandwidthPerPixelPhaseEncode.
23912391 // https://github.com/rordenlab/dcm2niix/issues/130
2392- if (d.manufacturer != kMANUFACTURER_UIH ) // issue606
2392+ // https://neurostars.org/t/error-bids-validation-after-dcm2bids-conversion-repetitiontime-and-acquisitionduration-are-mutually-exclusive/30759/13
2393+ if ((d.manufacturer != kMANUFACTURER_UIH ) && (d.TR <= 0.0 )) // issue606
23932394 json_Float (fp, " \t\" AcquisitionDuration\" : %g,\n " , d.acquisitionDuration );
23942395 if ((d.manufacturer == kMANUFACTURER_UIH ) && (effectiveEchoSpacing <= 0.0 )) // issue225, issue531
23952396 json_Float (fp, " \t\" TotalReadoutTime\" : %g,\n " , d.acquisitionDuration / 1000.0 );
@@ -6669,7 +6670,6 @@ int nii_saveCrop(char *niiFilename, struct nifti_1_header hdr, unsigned char *im
66696670 hdrX.srow_y [3 ] += hdr.srow_y [2 ] * ventralCrop;
66706671 hdrX.srow_z [3 ] += hdr.srow_z [2 ] * ventralCrop;
66716672 // issue889 - also change origin for qform
6672- // mork
66736673 mat44 Q44;
66746674 LOAD_MAT44 (Q44,
66756675 hdrX.srow_x [0 ], hdrX.srow_x [1 ], hdrX.srow_x [2 ], hdrX.srow_x [3 ],
@@ -8281,6 +8281,15 @@ int saveDcm2NiiCore(int nConvert, struct TDCMsort dcmSort[], struct TDICOMdata d
82818281#endif
82828282
82838283 struct nifti_1_header hdr0 = {0 };
8284+
8285+ if ((iVaries) && (dcmList[indx].manufacturer != kMANUFACTURER_PHILIPS ) && (!opts.isPhilipsFloatNotDisplayScaling )) {
8286+ printWarning (" Variance of DICOM slope/intercept is being ignored due to use of the `-p n` option.\n " );
8287+ iVaries = false ;
8288+ }
8289+ if ((iVaries) && (opts.isIgnoreIntensityScaling )) {
8290+ printWarning (" Variance of DICOM slope/intercept is being ignored due to use of the `-p o` option.\n " );
8291+ iVaries = false ;
8292+ }
82848293 unsigned char *img = nii_loadImgXL (nameList->str [indx], &hdr0, dcmList[indx], iVaries, opts.compressFlag , opts.isVerbose , dti4D);
82858294 if (strlen (opts.imageComments ) > 0 ) {
82868295 for (int i = 0 ; i < 24 ; i++)
@@ -8983,13 +8992,8 @@ int saveDcm2NiiCore(int nConvert, struct TDCMsort dcmSort[], struct TDICOMdata d
89838992 imgM = removeADC (&hdr0, imgM, numADC);
89848993 if (bppVaries)
89858994 printMessage (" Saving as 32-bit float (bits allocated varies).\n " );
8986- else if (iVaries) {
8987- if (!opts.isPhilipsFloatNotDisplayScaling ) {
8988- printWarning (" Variance of DICOM slope/intercept is being ignored due to use of the `-p n` option.\n " );
8989- iVaries = false ;
8990- } else
8991- printMessage (" Saving as 32-bit float (slope, intercept or bits allocated varies).\n " );
8992- }
8995+ else if (iVaries)
8996+ printMessage (" Saving as 32-bit float (slope, intercept or bits allocated varies).\n " );
89938997#ifndef USING_R
89948998 // divest does not support non-NIfTI formats, and requires only one
89958999 // image per series, so skip this to avoid double-saving
@@ -10620,6 +10624,7 @@ void setDefaultOpts(struct TDCMopts *opts, const char *argv[]) { // either "setD
1062010624 opts->isIgnoreDerivedAnd2D = false ;
1062110625 opts->isForceOnsetTimes = true ;
1062210626 opts->isPhilipsFloatNotDisplayScaling = true ;
10627+ opts->isIgnoreIntensityScaling = false ;
1062310628 opts->isCrop = false ;
1062410629 opts->isRotate3DAcq = true ;
1062510630 opts->isGz = false ;
0 commit comments