diff --git a/FILENAMING.md b/FILENAMING.md index 436114a1..5f46d0c5 100644 --- a/FILENAMING.md +++ b/FILENAMING.md @@ -63,7 +63,7 @@ DICOM images can have up to [16](https://www.medicalconnections.co.uk/kb/Number- ## File Name Conflicts -dcm2niix will attempt to write your image using the naming scheme you specify with the '-f' parameter. However, if an image already exists with the specified output name, dcm2niix will append a letter (e.g. 'a') to the end of a file name to avoid overwriting existing images. Consider a situation where dcm2niix is run with '-f %t'. This will name images based on the study time. If a single study has multiple series (for example, a T1 sequence and a fMRI scan, the reulting file names will conflict with each other. In order to avoid overwriting images, dcm2niix will resort to adding the post fix 'a', 'b', etc. There are a few solutions to avoiding these situations. You may want to consider using both of these: +dcm2niix will attempt to write your image using the naming scheme you specify with the '-f' parameter. However, if an image already exists with the specified output name, dcm2niix will append a letter (e.g. 'a') to the end of a file name to avoid overwriting existing images. Consider a situation where dcm2niix is run with '-f %t'. This will name images based on the study time. If a single study has multiple series (for example, a T1 sequence and a fMRI scan, the resulting file names will conflict with each other. In order to avoid overwriting images, dcm2niix will resort to adding the post fix 'a', 'b', etc. There are a few solutions to avoiding these situations. You may want to consider using both of these: - Make sure you specify a naming scheme that can discriminate between your images. For example '-f %t' will not disambiguate different series acquired in the same session. However, '-f %t_%s' will discriminate between series. - Localizer (scout) images are the first scans acquired for any scanning session, and are used to plan the location for subsequent images. Localizers are not used in subsequent analyses (due to resolution, artefacts, etc). Localizers are often acquired with three orthogonal image planes (sagittal, coronal and axial). The NIfTI format requires that all slices in a volume are co-planar, so these localizers will generate naming conflicts. The solution is to use '-i y' which will ignore (not convert) localizers (it will also ignore derived images and 2D slices). This command helps exclude images that are not required for subsequent analyses. - Be aware that if you run dcm2niix twice with the same parameters on the same data, you will encounter file naming conflicts. diff --git a/GE/README.md b/GE/README.md index 5bfbfceb..39e740dd 100644 --- a/GE/README.md +++ b/GE/README.md @@ -118,7 +118,6 @@ Anatomical localizers (e.g. scout images) are quick-and-dirty scans used to posi ## Sample Datasets - [A validation dataset for dcm2niix commits](https://github.com/neurolabusc/dcm_qa_nih). - - [Slice Timing and Phase Encoding examples](https://github.com/jannikadon/cc-dcm2bids-wrapper/tree/main/dicom-qa-examples) - [Slice timing validation](https://github.com/neurolabusc/dcm_qa_stc) for different varieties of GE EPI sequences. - [Examples of phase encoding polarity, slice timing and diffusion gradients](https://github.com/neurolabusc/dcm_qa_ge). - The dcm2niix [wiki](https://www.nitrc.org/plugins/mwiki/index.php/dcm2nii:MainPage) includes examples of diffusion data, slice timing, and other variations. diff --git a/console/main_console.cpp b/console/main_console.cpp index 8865955b..e87c1481 100644 --- a/console/main_console.cpp +++ b/console/main_console.cpp @@ -117,7 +117,7 @@ void showHelp(const char *argv[], struct TDCMopts opts) { //#define kNAME_CONFLICT_OVERWRITE 1 //1 = overwrite existing file with same name //#define kNAME_CONFLICT_ADD_SUFFIX 2 //default 2 = write with new suffix as a new file printf(" -w : write behavior for name conflicts (0,1,2, default 2: 0=skip duplicates, 1=overwrite, 2=add suffix)\n"); - printf(" -x : crop 3D acquisitions (y/n/i, default n, use 'i'gnore to neither crop nor rotate 3D acquistions)\n"); + printf(" -x : crop 3D acquisitions (y/n/i, default n, use 'i'gnore to neither crop nor rotate 3D acquisitions)\n"); char gzCh = 'n'; if (opts.isGz) gzCh = 'y'; diff --git a/console/makefile b/console/makefile index 077b9d91..0b236b13 100644 --- a/console/makefile +++ b/console/makefile @@ -50,3 +50,6 @@ all: sanitize: g++ -O1 -g -fsanitize=address -fno-omit-frame-pointer $(LFLAGS) $(UFILES) + +noroi: + g++ $(CFLAGS) -I. $(JSFLAGS) $(JFLAGS) $(LFLAGS) $(UFILES) -DmyNoRois diff --git a/console/nii_dicom_batch.cpp b/console/nii_dicom_batch.cpp index fc9b9b41..efff6862 100644 --- a/console/nii_dicom_batch.cpp +++ b/console/nii_dicom_batch.cpp @@ -1745,8 +1745,10 @@ tse3d: T2*/ fprintf(fp, "\t\"DiffGradientCyclingGE\": \"2TR\",\n"); if (d.diffCyclingModeGE == kGE_DIFF_CYCLING_3TR) fprintf(fp, "\t\"DiffGradientCyclingGE\": \"3TR\",\n"); + // codespell:disable if (d.diffCyclingModeGE == kGE_DIFF_CYCLING_SPOFF) fprintf(fp, "\t\"DiffGradientCyclingGE\": \"SPOFF\",\n"); + // codespell:enable } } #ifdef myReadAsciiCsa @@ -8401,6 +8403,7 @@ int saveDcm2NiiCore(int nConvert, struct TDCMsort dcmSort[], struct TDICOMdata d else nii_saveNII(pathoutnameADC, hdr0, imgM, opts, dcmList[dcmSort[0].indx]); } + #ifndef myNoRois if (isHasOverlay) { //each series can have up to 16 overlays, overlays may not be on all slices for (int j = 0; j < kMaxOverlay; j++) { bool isOverlay = false; @@ -8452,6 +8455,7 @@ int saveDcm2NiiCore(int nConvert, struct TDCMsort dcmSort[], struct TDICOMdata d nii_saveNII(pathoutnameROI, hdrr, imgR, opts, dcmList[dcmSort[0].indx]); } } + #endif //myNoRois imgM = removeADC(&hdr0, imgM, numADC); if (iVaries) printMessage("Saving as 32-bit float (slope, intercept or bits allocated varies).\n");