Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace JNIfTI by JNIFTI in makefile macros #707

Merged
merged 1 commit into from
May 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions console/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ set(DCM2NIIX_SRCS
nii_dicom_batch.cpp)


option(USE_JNIfTI "Build with JNIfTI support" ON)
option(USE_JNIFTI "Build with JNIfTI support" ON)
if(USE_JNIFTI)
add_definitions(-DmyEnableJNIfTI)
add_definitions(-DmyEnableJNIFTI)
set(DCM2NIIX_SRCS ${DCM2NIIX_SRCS} cJSON.cpp base64.cpp)
endif()

Expand Down
4 changes: 2 additions & 2 deletions console/main_console.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ void showHelp(const char *argv[], struct TDCMopts opts) {
printf(" -ba : anonymize BIDS (y/n, default %c)\n", bool2Char(opts.isAnonymizeBIDS));
printf(" -c : comment stored in NIfTI aux_file (up to 24 characters e.g. '-c VIP', empty to anonymize e.g. 0020,4000 e.g. '-c \"\"')\n");
printf(" -d : directory search depth. Convert DICOMs in sub-folders of in_folder? (0..9, default %d)\n", opts.dirSearchDepth);
#ifdef myEnableJNIfTI
#ifdef myEnableJNIFTI
printf(" -e : export as NRRD (y) or MGH (o) or JSON/JNIfTI (j) or BJNIfTI (b) instead of NIfTI (y/n/o/j/b, default n)\n");
#else
printf(" -e : export as NRRD (y) or MGH (o) instead of NIfTI (y/n/o/j/b, default n)\n");
Expand Down Expand Up @@ -370,7 +370,7 @@ int main(int argc, const char *argv[]) {
opts.saveFormat = kSaveFormatJNII;
if ((argv[i][0] == 'b') || (argv[i][0] == 'B') || (argv[i][0] == '4'))
opts.saveFormat = kSaveFormatBNII;
#ifndef myEnableJNIfTI
#ifndef myEnableJNIFTI
if ((opts.saveFormat == kSaveFormatJNII) || (opts.saveFormat == kSaveFormatBNII)) {
printf("Recompile for JNIfTI support.\n");
return EXIT_SUCCESS;
Expand Down
2 changes: 1 addition & 1 deletion console/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ endif
#run "JNIfTI=0 make" to disable JNIFTI build
JSFLAGS=
ifneq "$(JNIfTI)" "0"
JSFLAGS=-DmyEnableJNIfTI base64.cpp cJSON.cpp
JSFLAGS=-DmyEnableJNIFTI base64.cpp cJSON.cpp
endif

ifneq ($(OS),Windows_NT)
Expand Down
10 changes: 5 additions & 5 deletions console/nii_dicom_batch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#endif
#include "nii_dicom.h"
#include "nii_ortho.h"
#ifdef myEnableJNIfTI
#ifdef myEnableJNIFTI
#include "base64.h"
#include "cJSON.h"
#endif
Expand Down Expand Up @@ -3583,7 +3583,7 @@ void nii_createDummyFilename(char *niiFilename, struct TDCMopts opts) {
strcat(niiFilename, ".nhdr'");
else
strcat(niiFilename, ".nrrd'");
#ifdef myEnableJNIfTI
#ifdef myEnableJNIFTI
} else if (opts.saveFormat == kSaveFormatJNII) {
strcat(niiFilename, ".jnii'");
} else if (opts.saveFormat == kSaveFormatBNII) {
Expand Down Expand Up @@ -4390,7 +4390,7 @@ int nii_saveNRRD(char *niiFilename, struct nifti_1_header hdr, unsigned char *im

enum TZipMethod {zmZlib, zmGzip, zmBase64};

#ifdef myEnableJNIfTI
#ifdef myEnableJNIFTI
#ifdef Z_DEFLATED

int zmat_run(const size_t inputsize, unsigned char *inputstr, size_t *outputsize, unsigned char **outputbuf, const int zipid, int *ret, const int iscompress){
Expand Down Expand Up @@ -4956,12 +4956,12 @@ int nii_savejnii(char *niiFilename, struct nifti_1_header hdr, unsigned char *im
cJSON_Delete(root);
return EXIT_SUCCESS;
} // nii_savejnii()
#endif //#ifdef myEnableJNIfTI
#endif //#ifdef myEnableJNIFTI

int nii_saveForeign(char *niiFilename, struct nifti_1_header hdr, unsigned char *im, struct TDCMopts opts, struct TDICOMdata d, struct TDTI4D *dti4D, int numDTI) {
if (opts.saveFormat == kSaveFormatMGH)
return nii_saveMGH(niiFilename, hdr, im, opts, d, dti4D, numDTI);
#ifdef myEnableJNIfTI
#ifdef myEnableJNIFTI
else if (opts.saveFormat == kSaveFormatJNII || opts.saveFormat == kSaveFormatBNII)
return nii_savejnii(niiFilename, hdr, im, opts, d, dti4D, numDTI);
#endif
Expand Down