From 203dfb42307290bf18434f248bf1137069c87469 Mon Sep 17 00:00:00 2001 From: Chris Rorden Date: Wed, 30 Aug 2017 15:50:07 -0400 Subject: [PATCH] Fix for https://github.com/rordenlab/dcm2niix/issues/125 --- console/nii_dicom_batch.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/console/nii_dicom_batch.cpp b/console/nii_dicom_batch.cpp index 5323d6fc..3eb04450 100755 --- a/console/nii_dicom_batch.cpp +++ b/console/nii_dicom_batch.cpp @@ -697,9 +697,9 @@ void nii_SaveBIDS(char pathoutname[], struct TDICOMdata d, struct TDCMopts opts, //Equivalent to dicm2nii's "if flp(iPhase), phPos = ~phPos; end" if (d.CSA.phaseEncodingDirectionPositive == -1) fprintf(fp, "?"); //unknown - else if ((d.CSA.phaseEncodingDirectionPositive == 1) && ((opts.isFlipY))) + else if ((d.CSA.phaseEncodingDirectionPositive == 1) && ((!opts.isFlipY))) fprintf(fp, "-"); - else if ((d.CSA.phaseEncodingDirectionPositive == 0) && ((!opts.isFlipY))) + else if ((d.CSA.phaseEncodingDirectionPositive == 0) && ((opts.isFlipY))) fprintf(fp, "-"); fprintf(fp, "\",\n"); } //only save PhaseEncodingDirection if BOTH direction and POLARITY are known @@ -1508,7 +1508,7 @@ int nii_saveNII(char * niiFilename, struct nifti_1_header hdr, unsigned char* im printMessage("Error: Image size is zero bytes %s\n", niiFilename); return EXIT_FAILURE; } - #define kMaxPigz 3758096384 + #define kMaxPigz 4294967264 //https://stackoverflow.com/questions/5272825/detecting-64bit-compile-in-c #if UINTPTR_MAX == 0xffffffff #define kMaxGz 2147483647