From 458ac6532335b874f49196ad4bc6ffa2e63253ec Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Sat, 15 Jan 2022 12:03:19 +0000 Subject: [PATCH 01/85] Python package --- .gitignore | 11 +++++++++++ SuperBuild/SuperBuild.cmake | 4 ++++ dcm2niix/__init__.py | 19 ++++++++++++++++++ pyproject.toml | 7 +++++++ setup.cfg | 39 +++++++++++++++++++++++++++++++++++++ setup.py | 14 +++++++++++++ 6 files changed, 94 insertions(+) create mode 100644 dcm2niix/__init__.py create mode 100644 pyproject.toml create mode 100644 setup.cfg create mode 100644 setup.py diff --git a/.gitignore b/.gitignore index 0b9be923..0b86f87c 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,14 @@ /build/ /bin/ /console/dcm2niix +# Python wrapper +*.py[co] +*.so +__pycache__/ +/_skbuild/ +/_cmake_test_compile/ +/dcm2niix/_dist_ver.py +/dcm2niix/dcm2niix +MANIFEST +/*.egg*/ +/dist/ diff --git a/SuperBuild/SuperBuild.cmake b/SuperBuild/SuperBuild.cmake index e1057a0f..f395cafb 100644 --- a/SuperBuild/SuperBuild.cmake +++ b/SuperBuild/SuperBuild.cmake @@ -164,6 +164,10 @@ ExternalProject_Add(console -DBUILD_DCM2NIIXFSLIB:BOOL=${BUILD_DCM2NIIXFSLIB} ) +if(SKBUILD) + install(DIRECTORY ${CMAKE_BINARY_DIR}/bin/ DESTINATION dcm2niix + USE_SOURCE_PERMISSIONS) +endif() install(DIRECTORY ${CMAKE_BINARY_DIR}/bin/ DESTINATION bin USE_SOURCE_PERMISSIONS) diff --git a/dcm2niix/__init__.py b/dcm2niix/__init__.py new file mode 100644 index 00000000..6b32f89d --- /dev/null +++ b/dcm2niix/__init__.py @@ -0,0 +1,19 @@ +"""Thin wrapper around dcm2niix binary""" +__author__ = "Casper da Costa-Luis" +__date__ = "2022" +# version detector. Precedence: installed dist, git, 'UNKNOWN' +try: + from ._dist_ver import __version__ +except ImportError: # pragma: nocover + try: + from setuptools_scm import get_version + + __version__ = get_version(root="../..", relative_to=__file__) + except (ImportError, LookupError): + __version__ = "UNKNOWN" +__all__ = ['bin', 'bin_path'] + +from pathlib import Path + +bin_path = Path(__file__).resolve().parent / "dcm2niix" +bin = str(bin_path) diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..5c9a0639 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,7 @@ +[build-system] +requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4", + "scikit-build>=0.11.0", "cmake>=3.18", "ninja"] + +[tool.setuptools_scm] +write_to = "dcm2niix/_dist_ver.py" +write_to_template = "__version__ = '{version}'\n" diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 00000000..d7c58507 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,39 @@ +[metadata] +name=pydcm2niix +description=DCM2NIIX Python package +long_description=file: README.md +long_description_content_type=text/markdown +license_file=license.txt +url=https://github.com/rordenlab/dcm2niix +project_urls= + Changelog=https://github.com/rordenlab/dcm2niix/releases + Documentation=https://www.nitrc.org/plugins/mwiki/index.php/dcm2nii:MainPage +author=Li X, Morgan PS, Ashburner J, Smith J, Rorden C +maintainer=Casper da Costa-Luis +maintainer_email=imaging@cdcl.ml +keywords=research, jpeg, dicom, neuroscience, mri, neuroimaging, nifti, dcm, nii, nitrc, bids, dcm2niix, mricrogl +classifiers= + Development Status :: 5 - Production/Stable + Intended Audience :: Education + Intended Audience :: Healthcare Industry + Intended Audience :: Science/Research + Operating System :: Microsoft :: Windows + Operating System :: POSIX :: Linux + Programming Language :: C + Programming Language :: C++ + Programming Language :: Python :: 3 + Programming Language :: Python :: 3.6 + Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3 :: Only + Topic :: Scientific/Engineering :: Medical Science Apps. +[options] +setup_requires= + setuptools>=42 + wheel + setuptools_scm[toml] + scikit-build>=0.11.0 + cmake>=3.18 + ninja +python_requires=>=3.6 diff --git a/setup.py b/setup.py new file mode 100644 index 00000000..05552803 --- /dev/null +++ b/setup.py @@ -0,0 +1,14 @@ +"""Compile source code and setup Python 3 package""" +import re +from pathlib import Path + +from setuptools_scm import get_version +from skbuild import setup + +__version__ = get_version(root=".", relative_to=__file__) +build_ver = ".".join(__version__.split('.')[:3]).split(".dev")[0] +for i in (Path(__file__).resolve().parent / "_skbuild").rglob("CMakeCache.txt"): + i.write_text(re.sub("^//.*$\n^[^#].*pip-build-env.*$", "", i.read_text(), flags=re.M)) +setup(use_scm_version=True, packages=["dcm2niix"], + cmake_languages=("CXX",), cmake_minimum_required_version="3.18", + cmake_args=[f"-DCM2NIIX_BUILD_VERSION={build_ver}", "-DBUILD_ALL_DEP=ON"]) From b439045c94e145fe90d9b190126a6b6d30c0ad01 Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Sat, 15 Jan 2022 12:14:01 +0000 Subject: [PATCH 02/85] mention pip install --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 029006d4..ea6aa9aa 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,7 @@ There are a couple ways to install dcm2niix - [MRIcroGL (NITRC)](https://www.nitrc.org/projects/mricrogl) or [MRIcroGL (GitHub)](https://github.com/rordenlab/MRIcroGL12/releases) includes dcm2niix that can be run from the command line or from the graphical user interface (select the Import menu item). The Linux version of dcm2niix is compiled on a [holy build box](https://github.com/phusion/holy-build-box), so it should run on any Linux distribution. - If you have a MacOS computer with Homebrew or MacPorts you can run `brew install dcm2niix` or `sudo port install dcm2niix`, respectively. - If you have Conda, [`conda install -c conda-forge dcm2niix`](https://anaconda.org/conda-forge/dcm2niix) on Linux, MacOS or Windows. + - If you have pip, `python -m pip install pydcm2niix` on Linux, MacOS or Windows. - On Debian Linux computers you can run `sudo apt-get install dcm2niix`. From 3f698b9c86428b600e715602b623b0dcfa873f47 Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Sat, 15 Jan 2022 12:25:35 +0000 Subject: [PATCH 03/85] add executable --- dcm2niix/__init__.py | 10 +++++++++- dcm2niix/__main__.py | 3 +++ setup.cfg | 4 +++- 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 dcm2niix/__main__.py diff --git a/dcm2niix/__init__.py b/dcm2niix/__init__.py index 6b32f89d..639f1f16 100644 --- a/dcm2niix/__init__.py +++ b/dcm2niix/__init__.py @@ -11,9 +11,17 @@ __version__ = get_version(root="../..", relative_to=__file__) except (ImportError, LookupError): __version__ = "UNKNOWN" -__all__ = ['bin', 'bin_path'] +__all__ = ['bin', 'bin_path', 'main'] from pathlib import Path bin_path = Path(__file__).resolve().parent / "dcm2niix" bin = str(bin_path) + + +def main(args=None): + if args is None: + import sys + args = sys.argv[1:] + from subprocess import run + run([bin] + args) diff --git a/dcm2niix/__main__.py b/dcm2niix/__main__.py new file mode 100644 index 00000000..8273c4ff --- /dev/null +++ b/dcm2niix/__main__.py @@ -0,0 +1,3 @@ +from . import main + +main() diff --git a/setup.cfg b/setup.cfg index d7c58507..f77086a1 100644 --- a/setup.cfg +++ b/setup.cfg @@ -19,7 +19,6 @@ classifiers= Intended Audience :: Science/Research Operating System :: Microsoft :: Windows Operating System :: POSIX :: Linux - Programming Language :: C Programming Language :: C++ Programming Language :: Python :: 3 Programming Language :: Python :: 3.6 @@ -37,3 +36,6 @@ setup_requires= cmake>=3.18 ninja python_requires=>=3.6 +[options.entry_points] +console_scripts= + dcm2niix=dcm2niix:main From 747536036922c310e59498e3042628b3e5b2f726 Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Mon, 9 May 2022 05:10:39 +0100 Subject: [PATCH 04/85] rename PyPI package - pydcm2niix => dcm2niix - thanks to https://github.com/pypa/pypi-support/issues/1609 - closes #573 --- README.md | 2 +- dcm2niix/__init__.py | 2 +- setup.cfg | 2 +- setup.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ea6aa9aa..2de7fb84 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ There are a couple ways to install dcm2niix - [MRIcroGL (NITRC)](https://www.nitrc.org/projects/mricrogl) or [MRIcroGL (GitHub)](https://github.com/rordenlab/MRIcroGL12/releases) includes dcm2niix that can be run from the command line or from the graphical user interface (select the Import menu item). The Linux version of dcm2niix is compiled on a [holy build box](https://github.com/phusion/holy-build-box), so it should run on any Linux distribution. - If you have a MacOS computer with Homebrew or MacPorts you can run `brew install dcm2niix` or `sudo port install dcm2niix`, respectively. - If you have Conda, [`conda install -c conda-forge dcm2niix`](https://anaconda.org/conda-forge/dcm2niix) on Linux, MacOS or Windows. - - If you have pip, `python -m pip install pydcm2niix` on Linux, MacOS or Windows. + - If you have pip, `python -m pip install dcm2niix` on Linux, MacOS or Windows. - On Debian Linux computers you can run `sudo apt-get install dcm2niix`. diff --git a/dcm2niix/__init__.py b/dcm2niix/__init__.py index 639f1f16..8a4127ab 100644 --- a/dcm2niix/__init__.py +++ b/dcm2niix/__init__.py @@ -1,5 +1,5 @@ """Thin wrapper around dcm2niix binary""" -__author__ = "Casper da Costa-Luis" +__author__ = "Casper da Costa-Luis " __date__ = "2022" # version detector. Precedence: installed dist, git, 'UNKNOWN' try: diff --git a/setup.cfg b/setup.cfg index f77086a1..785be9d2 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [metadata] -name=pydcm2niix +name=dcm2niix description=DCM2NIIX Python package long_description=file: README.md long_description_content_type=text/markdown diff --git a/setup.py b/setup.py index 05552803..87754aff 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ from skbuild import setup __version__ = get_version(root=".", relative_to=__file__) -build_ver = ".".join(__version__.split('.')[:3]).split(".dev")[0] +build_ver = ".".join(__version__.split(".")[:3]).split(".dev")[0] for i in (Path(__file__).resolve().parent / "_skbuild").rglob("CMakeCache.txt"): i.write_text(re.sub("^//.*$\n^[^#].*pip-build-env.*$", "", i.read_text(), flags=re.M)) setup(use_scm_version=True, packages=["dcm2niix"], From b91d6db0da6d3a314c14c6beaf7de51b4d46a78f Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Thu, 30 Jun 2022 09:18:54 +0100 Subject: [PATCH 05/85] fix typo --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 87754aff..72f2a7ac 100644 --- a/setup.py +++ b/setup.py @@ -11,4 +11,4 @@ i.write_text(re.sub("^//.*$\n^[^#].*pip-build-env.*$", "", i.read_text(), flags=re.M)) setup(use_scm_version=True, packages=["dcm2niix"], cmake_languages=("CXX",), cmake_minimum_required_version="3.18", - cmake_args=[f"-DCM2NIIX_BUILD_VERSION={build_ver}", "-DBUILD_ALL_DEP=ON"]) + cmake_args=[f"-DDCM2NIIX_BUILD_VERSION={build_ver}", "-DBUILD_ALL_DEP=ON"]) From 7ce50febd616f4ab70a4fdddc86f909b48c696f5 Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Thu, 30 Jun 2022 09:19:26 +0100 Subject: [PATCH 06/85] remove unneeded BUILD_ALL_DEP --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 72f2a7ac..53e2e2e7 100644 --- a/setup.py +++ b/setup.py @@ -11,4 +11,4 @@ i.write_text(re.sub("^//.*$\n^[^#].*pip-build-env.*$", "", i.read_text(), flags=re.M)) setup(use_scm_version=True, packages=["dcm2niix"], cmake_languages=("CXX",), cmake_minimum_required_version="3.18", - cmake_args=[f"-DDCM2NIIX_BUILD_VERSION={build_ver}", "-DBUILD_ALL_DEP=ON"]) + cmake_args=[f"-DDCM2NIIX_BUILD_VERSION={build_ver}"]) From 26723410c977dd501cf57a9f244f9eccbcd86815 Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Thu, 30 Jun 2022 09:19:51 +0100 Subject: [PATCH 07/85] remove unneeded DCM2NIIX_BUILD_VERSION --- setup.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 53e2e2e7..146f7a03 100644 --- a/setup.py +++ b/setup.py @@ -10,5 +10,4 @@ for i in (Path(__file__).resolve().parent / "_skbuild").rglob("CMakeCache.txt"): i.write_text(re.sub("^//.*$\n^[^#].*pip-build-env.*$", "", i.read_text(), flags=re.M)) setup(use_scm_version=True, packages=["dcm2niix"], - cmake_languages=("CXX",), cmake_minimum_required_version="3.18", - cmake_args=[f"-DDCM2NIIX_BUILD_VERSION={build_ver}"]) + cmake_languages=("CXX",), cmake_minimum_required_version="3.18") From 974eb45c467bc6ae945075fb85fd0405501a0c73 Mon Sep 17 00:00:00 2001 From: neurolabusc Date: Sat, 3 Sep 2022 17:35:04 -0400 Subject: [PATCH 08/85] Extract uncombined coil number from CSA header (https://github.com/rordenlab/dcm2niix/issues/631) --- Siemens/README.md | 1 + console/nii_dicom.cpp | 33 +++++++++++++++++++++++++++++++++ console/nii_dicom.h | 9 ++++----- 3 files changed, 38 insertions(+), 5 deletions(-) diff --git a/Siemens/README.md b/Siemens/README.md index d387031e..d4ccf048 100644 --- a/Siemens/README.md +++ b/Siemens/README.md @@ -38,6 +38,7 @@ The private `ICE_Dims` (0021,1106) tag can prove useful for parsing data. The li (0021,1106) LO [X_4_1_1_1_1_160_1_1_1_1_1_277] # ICE_Dims ``` +0. coi = [coil number](https://github.com/rordenlab/dcm2niix/issues/631) (X: combined from multiple coils) 1. eco = echo number 2. phs = phase encode 3. set = diff --git a/console/nii_dicom.cpp b/console/nii_dicom.cpp index 9c03232d..8d589d20 100644 --- a/console/nii_dicom.cpp +++ b/console/nii_dicom.cpp @@ -903,6 +903,7 @@ struct TDICOMdata clear_dicom_data() { d.CSA.multiBandFactor = 1; d.CSA.SeriesHeader_offset = 0; d.CSA.SeriesHeader_length = 0; + d.CSA.coilNumber = -1; return d; } //clear_dicom_data() @@ -1244,6 +1245,30 @@ float csaMultiFloat(unsigned char buff[], int nItems, float Floats[], int *Items return Floats[1]; } //csaMultiFloat() +int csaICEdims(unsigned char buff[]) { + //determine coil number from CSA header + //Combined images start with a letter: X_1_1_1_1_1_1_1_1_1_1_1_106 + //Coil data starts with coil number: 29_1_1_1_1_1_7_1_1_1_1_1_3000012 + TCSAitem itemCSA; + int lPos = 0; + memcpy(&itemCSA, &buff[lPos], sizeof(itemCSA)); + int coilNumber = -1; + if (itemCSA.xx2_Len > 0) { + lPos += sizeof(itemCSA); + char *cString = (char *)malloc(sizeof(char) * (itemCSA.xx2_Len)); + memcpy(cString, &buff[lPos], itemCSA.xx2_Len); //TPX memcpy(&cString, &buff[lPos], sizeof(cString)); + lPos += ((itemCSA.xx2_Len + 3) / 4) * 4; + char c = cString[0]; + if( c >= '0' && c <= '9' ){ + dcmStrDigitsOnly(cString); + char *end; + coilNumber = (int)strtol(cString, &end, 10); + } + free(cString); + } + return coilNumber; +} //csaICEdims() + bool csaIsPhaseMap(unsigned char buff[], int nItems) { //returns true if the tag "ImageHistory" has an item named "CC:ComplexAdd" TCSAitem itemCSA; @@ -1378,6 +1403,8 @@ int readCSAImageHeader(unsigned char *buff, int lLength, struct TCSAdata *CSA, i if (tagCSA.nitems > 0) { if (strcmp(tagCSA.name, "ImageHistory") == 0) CSA->isPhaseMap = csaIsPhaseMap(&buff[lPos], tagCSA.nitems); + else if (strcmp(tagCSA.name, "ICE_Dims") == 0) + CSA->coilNumber = csaICEdims(&buff[lPos]); else if (strcmp(tagCSA.name, "NumberOfImagesInMosaic") == 0) CSA->mosaicSlices = (int)round(csaMultiFloat(&buff[lPos], 1, lFloats, &itemsOK)); else if (strcmp(tagCSA.name, "B_value") == 0) { @@ -6706,6 +6733,12 @@ const uint32_t kEffectiveTE = 0x0018 + (0x9082 << 16); readCSAImageHeader(&buffer[lPos], lLength, &d.CSA, isVerbose, d.is3DAcq); //, dti4D); if (!d.isHasPhase) d.isHasPhase = d.CSA.isPhaseMap; + if ((d.CSA.coilNumber > 0) && (strlen(d.coilName) < 1)) { + sprintf(d.coilName, "%d", d.CSA.coilNumber); + //printf("issue631 coil name '%s'\n", d.coilName); + d.coilCrc = mz_crc32X((unsigned char *)&d.coilName, strlen(d.coilName)); + } + //okra break; case kCSASeriesHeaderInfo: if ((lPos + lLength) > fileLen) diff --git a/console/nii_dicom.h b/console/nii_dicom.h index 2458f75a..e6abc75c 100644 --- a/console/nii_dicom.h +++ b/console/nii_dicom.h @@ -50,7 +50,7 @@ extern "C" { #define kCPUsuf " " //unknown CPU #endif -#define kDCMdate "v1.0.20220720" +#define kDCMdate "v1.0.20220903" #define kDCMvers kDCMdate " " kJP2suf kLSsuf kCCsuf kCPUsuf static const int kMaxEPI3D = 1024; //maximum number of EPI images in Siemens Mosaic @@ -213,10 +213,9 @@ static const uint8_t MAX_NUMBER_OF_DIMENSIONS = 8; } TCSAitem; //Siemens csa item structure #endif struct TCSAdata { - float sliceTiming[kMaxEPI3D], dtiV[4], sliceNormV[4], bandwidthPerPixelPhaseEncode, sliceMeasurementDuration; - int numDti, SeriesHeader_offset, SeriesHeader_length, multiBandFactor, sliceOrder, slice_start, slice_end, mosaicSlices, protocolSliceNumber1, phaseEncodingDirectionPositive; - bool isPhaseMap; - + float sliceTiming[kMaxEPI3D], dtiV[4], sliceNormV[4], bandwidthPerPixelPhaseEncode, sliceMeasurementDuration; + int coilNumber, numDti, SeriesHeader_offset, SeriesHeader_length, multiBandFactor, sliceOrder, slice_start, slice_end, mosaicSlices, protocolSliceNumber1, phaseEncodingDirectionPositive; + bool isPhaseMap; }; struct TDICOMdata { long seriesNum; From f7f376af57a08ee7d7e4a8872a2fcd3e3694549f Mon Sep 17 00:00:00 2001 From: neurolabusc Date: Fri, 9 Sep 2022 11:02:55 -0400 Subject: [PATCH 09/85] Detect some types of CSA corruption (https://github.com/rordenlab/dcm2niix/issues/633) --- console/nii_dicom.cpp | 26 +++++++++++++++++++++----- console/nii_dicom.h | 2 +- console/nii_dicom_batch.cpp | 12 ++++++++++-- 3 files changed, 32 insertions(+), 8 deletions(-) diff --git a/console/nii_dicom.cpp b/console/nii_dicom.cpp index 8d589d20..0bed8410 100644 --- a/console/nii_dicom.cpp +++ b/console/nii_dicom.cpp @@ -1398,6 +1398,10 @@ int readCSAImageHeader(unsigned char *buff, int lLength, struct TCSAdata *CSA, i // Storage order is always little-endian, so byte-swap required values if necessary if (!littleEndianPlatform()) nifti_swap_4bytes(1, &tagCSA.nitems); + if (tagCSA.nitems > 128) { + printError("%d n_tags CSA Image Header corrupted (0029,1010) see issue 633.\n", tagCSA.nitems); + return EXIT_FAILURE; + } if (isVerbose > 1) //extreme verbosity: show every CSA tag printMessage(" %d CSA of %s %d\n", lPos, tagCSA.name, tagCSA.nitems); if (tagCSA.nitems > 0) { @@ -5952,12 +5956,25 @@ const uint32_t kEffectiveTE = 0x0018 + (0x9082 << 16); char iceStr[kDICOMStr]; dcmStr(lLength, &buffer[lPos], iceStr); dcmStrDigitsOnly(iceStr); - char *end; - int echo = (int)strtol(iceStr, &end, 10); + char *end, *echoStr; + //read the first item ('X' or numeric if uncombined) + char c = iceStr[0]; + if( c >= '0' && c <= '9' ){ + int coilNumber = (int)strtol(iceStr, &end, 10); + //if ((iceStr != end) && (coilNumber > 0) && (strlen(d.coilName) < 1)) { //nb with uncombined coil will still have a name, e.g. 'HeadNeck_64' + if ((iceStr != end) && (coilNumber > 0)) { + sprintf(d.coilName, "%d", coilNumber); + //printf("issue631 coil name '%s'\n", d.coilName); + d.coilCrc = mz_crc32X((unsigned char *)&d.coilName, strlen(d.coilName)); + } + } + //read the second item: the echo number ('4') + echoStr = strchr(iceStr, ' '); + int echo = (int)strtol(echoStr, &end, 10); //printMessage("%d:%d:'%s'\n", d.echoNum, echo, iceStr); if (iceStr != end) d.echoNum = echo; - //printMessage("%d:'%s'\n", echo, iceStr); + //printMessage("%d:'%s'\n", echo, echoStr); break; } case kPhaseEncodingDirectionPositiveSiemens: { @@ -6730,7 +6747,7 @@ const uint32_t kEffectiveTE = 0x0018 + (0x9082 << 16); case kCSAImageHeaderInfo: if ((lPos + lLength) > fileLen) break; - readCSAImageHeader(&buffer[lPos], lLength, &d.CSA, isVerbose, d.is3DAcq); //, dti4D); + readCSAImageHeader(&buffer[lPos], lLength, &d.CSA, isVerbose, d.is3DAcq); if (!d.isHasPhase) d.isHasPhase = d.CSA.isPhaseMap; if ((d.CSA.coilNumber > 0) && (strlen(d.coilName) < 1)) { @@ -6738,7 +6755,6 @@ const uint32_t kEffectiveTE = 0x0018 + (0x9082 << 16); //printf("issue631 coil name '%s'\n", d.coilName); d.coilCrc = mz_crc32X((unsigned char *)&d.coilName, strlen(d.coilName)); } - //okra break; case kCSASeriesHeaderInfo: if ((lPos + lLength) > fileLen) diff --git a/console/nii_dicom.h b/console/nii_dicom.h index e6abc75c..72481efa 100644 --- a/console/nii_dicom.h +++ b/console/nii_dicom.h @@ -50,7 +50,7 @@ extern "C" { #define kCPUsuf " " //unknown CPU #endif -#define kDCMdate "v1.0.20220903" +#define kDCMdate "v1.0.20220909" #define kDCMvers kDCMdate " " kJP2suf kLSsuf kCCsuf kCPUsuf static const int kMaxEPI3D = 1024; //maximum number of EPI images in Siemens Mosaic diff --git a/console/nii_dicom_batch.cpp b/console/nii_dicom_batch.cpp index 5cfb3ad9..c1672871 100644 --- a/console/nii_dicom_batch.cpp +++ b/console/nii_dicom_batch.cpp @@ -629,6 +629,10 @@ int phoenixOffsetCSASeriesHeader(unsigned char *buff, int lLength) { memcpy(&tagCSA, &buff[lPos], sizeof(tagCSA)); //read tag if (!littleEndianPlatform()) nifti_swap_4bytes(1, &tagCSA.nitems); + if (tagCSA.nitems > 128) { + printError("%d n_tags CSA Series Header corrupted (0029,1020 ) see issue 633.\n", tagCSA.nitems); + return EXIT_FAILURE; + } //printf("%d CSA of %s %d\n",lPos, tagCSA.name, tagCSA.nitems); lPos += sizeof(tagCSA); if (strcmp(tagCSA.name, "MrPhoenixProtocol") == 0) @@ -707,8 +711,14 @@ void siemensCsaAscii(const char *filename, TCsaAscii *csaAscii, int csaOffset, i size_t result = fread(buffer, 1, csaLength, pFile); if ((int)result != csaLength) return; + fclose(pFile); + //next bit complicated: restrict to ASCII portion to avoid buffer overflow errors in BINARY portion int startAscii = phoenixOffsetCSASeriesHeader((unsigned char *)buffer, csaLength); + if (startAscii == EXIT_FAILURE) { + free(buffer); + return; + } int csaLengthTrim = csaLength; char *bufferTrim = buffer; if ((startAscii > 0) && (startAscii < csaLengthTrim)) { //ignore binary data at start @@ -889,7 +899,6 @@ void siemensCsaAscii(const char *filename, TCsaAscii *csaAscii, int csaOffset, i char keyStrSh7[] = "sGRADSPEC.alShimCurrent[4]"; shimSetting[7] = readKeyFloat(keyStrSh7, keyPos, csaLengthTrim); } - fclose(pFile); free(buffer); return; } // siemensCsaAscii() @@ -1332,7 +1341,6 @@ tse3d: T2*/ if ((strstr(d.imageTypeText, "_ND") != NULL) || (strstr(d.imageType, "_ND") != NULL) || (strstr(d.imageTypeText, "_ND") != NULL) || (strstr(d.imageType, "_ND") != NULL)) fprintf(fp, "\t\"NonlinearGradientCorrection\": false,\n"); - if (d.isDerived) //DICOM is derived image or non-spatial file (sounds, etc) fprintf(fp, "\t\"RawImage\": false,\n"); if (d.seriesNum > 0) From 836d64ea97216a68de549002d8744ec33e6afde7 Mon Sep 17 00:00:00 2001 From: Jaemin Shin Date: Mon, 19 Sep 2022 00:06:30 -0400 Subject: [PATCH 10/85] GE Diffusion SliceTiming --- console/main_console.cpp | 19 ++++++++ console/nii_dicom.cpp | 59 ++++++++++++++++++++++- console/nii_dicom.h | 11 ++++- console/nii_dicom_batch.cpp | 95 ++++++++++++++++++++++++++++++++----- console/nii_dicom_batch.h | 2 +- 5 files changed, 168 insertions(+), 18 deletions(-) diff --git a/console/main_console.cpp b/console/main_console.cpp index 143995c6..74f326e8 100644 --- a/console/main_console.cpp +++ b/console/main_console.cpp @@ -410,6 +410,25 @@ int main(int argc, const char *argv[]) { opts.isTestx0021x105E = true; printf("undocumented '-j y' compares GE slice timing from 0021,105E\n"); } + } else if ((!strcmp(argv[i], "--diffCyclingModeGE")) && ((i + 1) < argc)) { + // see issue 635 + i++; + if (argv[i][0] == '0') { + opts.diffCyclingModeGE = 0; + printf("undocumented '--diffCyclingModeGE 0' cycling OFF\n"); + } + else if (argv[i][0] == '1') { + opts.diffCyclingModeGE = 1; + printf("undocumented '--diffCyclingModeGE 1' cycling All-TR\n"); + } + else if (argv[i][0] == '2') { + opts.diffCyclingModeGE = 2; + printf("undocumented '--diffCyclingModeGE 2' cycling 2-TR\n"); + } + else if (argv[i][0] == '3') { + opts.diffCyclingModeGE = 3; + printf("undocumented '--diffCyclingModeGE 3' cycling 3-TR\n"); + } } else if ((argv[i][1] == 'l') && ((i + 1) < argc)) { i++; if (invalidParam(i, argv)) diff --git a/console/nii_dicom.cpp b/console/nii_dicom.cpp index 0bed8410..530f4890 100644 --- a/console/nii_dicom.cpp +++ b/console/nii_dicom.cpp @@ -868,6 +868,8 @@ struct TDICOMdata clear_dicom_data() { d.maxEchoNumGE = -1; d.epiVersionGE = -1; d.internalepiVersionGE = -1; + d.diffCyclingModeGE = kGE_DIFF_CYCLING_UNKNOWN; + d.tensorFileGE = 0; d.durationLabelPulseGE = -1; d.aslFlags = kASL_FLAG_NONE; d.partialFourierDirection = kPARTIAL_FOURIER_DIRECTION_UNKNOWN; @@ -4328,11 +4330,14 @@ const uint32_t kEffectiveTE = 0x0018 + (0x9082 << 16); #define kInternalPulseSequenceNameGE 0x0019 + (0x109E << 16) //LO 'EPI' or 'EPI2' #define kRawDataRunNumberGE 0x0019 + (0x10A2 << 16)//SL #define kMaxEchoNumGE 0x0019 + (0x10A9 << 16) //DS -#define kUserData12GE 0x0019 + (0x10B3 << 16) //DS phase diffusion direction +#define kUserData11GE 0x0019 + (0x10B2 << 16) //DS Diffusion tensor filename +#define kUserData12GE 0x0019 + (0x10B3 << 16) //DS phase diffusion direction; diffusion gradient cycling mode +#define kUserData15GE 0x0019 + (0x10B6 << 16) //DS Diffusion Gradient Derating; cycling special OFF #define kDiffusionDirectionGEX 0x0019 + (0x10BB << 16) //DS phase diffusion direction #define kDiffusionDirectionGEY 0x0019 + (0x10BC << 16) //DS frequency diffusion direction #define kDiffusionDirectionGEZ 0x0019 + (0x10BD << 16) //DS slice diffusion direction -#define kNumberOfDiffusionDirectionGE 0x0019 + (0x10E0 << 16) ///DS NumberOfDiffusionDirection:UserData24 +#define kNumberOfDiffusionT2GE 0x0019 + (0x10DF << 16) ///DS NumberOfDiffusionT2:UserData23 (release 10+) +#define kNumberOfDiffusionDirectionGE 0x0019 + (0x10E0 << 16) ///DS NumberOfDiffusionDirection:UserData24 (release 10+) #define kVelocityEncodeScaleGE 0x0019 + (0x10E2 << 16) ///DS Velocity Encode Scale #define kStudyID 0x0020 + (0x0010 << 16) #define kSeriesNum 0x0020 + (0x0011 << 16) @@ -4507,7 +4512,9 @@ const uint32_t kEffectiveTE = 0x0018 + (0x9082 << 16); bool is4000561SQ = false; //Original Attributes SQ bool is00089092SQ = false; //Referenced Image Evidence SQ bool overlayOK = true; + int userData11GE = 0; int userData12GE = 0; + float userData15GE = 0; int overlayRows = 0; int overlayCols = 0; bool isNeologica = false; @@ -5659,6 +5666,13 @@ const uint32_t kEffectiveTE = 0x0018 + (0x9082 << 16); d.CSA.dtiV[3] = v[2]; break; } + case kNumberOfDiffusionT2GE: { + if (d.manufacturer != kMANUFACTURER_GE) + break; + float f = dcmStrFloat(lLength, &buffer[lPos]); + d.numberOfDiffusionT2GE = round(f); + break; + } case kNumberOfDiffusionDirectionGE: { if (d.manufacturer != kMANUFACTURER_GE) break; @@ -5691,12 +5705,22 @@ const uint32_t kEffectiveTE = 0x0018 + (0x9082 << 16); break; d.maxEchoNumGE = round(dcmStrFloat(lLength, &buffer[lPos])); break; + case kUserData11GE: { + if (d.manufacturer != kMANUFACTURER_GE) + break; + userData11GE = round(dcmStrFloat(lLength, &buffer[lPos])); + break; } case kUserData12GE: { if (d.manufacturer != kMANUFACTURER_GE) break; userData12GE = round(dcmStrFloat(lLength, &buffer[lPos])); //printf("%d<<<<\n", userData12GE); break; } + case kUserData15GE: { + if (d.manufacturer != kMANUFACTURER_GE) + break; + userData15GE = dcmStrFloat(lLength, &buffer[lPos]); + break; } case kDiffusionDirectionGEX: if (d.manufacturer == kMANUFACTURER_GE) set_diffusion_directionGE(&volDiffusion, lLength, (&buffer[lPos]), 0); @@ -7693,6 +7717,37 @@ const uint32_t kEffectiveTE = 0x0018 + (0x9082 << 16); if ((d.manufacturer == kMANUFACTURER_SIEMENS) && (strstr(d.sequenceName, "fl2d1") != NULL)) { d.isLocalizer = true; } + // detect GE diffusion gradient cycling mode (see issue 635) + // GE diffusion epi + if ((d.epiVersionGE == kGE_EPI_EPI2) || (d.internalepiVersionGE == 2)) { + // Diffusion tensor file number + d.tensorFileGE = userData11GE; + // cycling sytems: Premier, UHP, 7.0T + if ((strstr(d.manufacturersModelName, "Premier") != NULL) || (strstr(d.manufacturersModelName, "UHP") != NULL) || (strstr(d.manufacturersModelName, "7.0T") != NULL)) { + // cycling special OFF mode + if (isSameFloatGE(userData15GE, 0.72)) + d.diffCyclingModeGE = kGE_DIFF_CYCLING_SPOFF; + // 2TR cycling mode + else if (userData12GE == 1) { + d.diffCyclingModeGE = kGE_DIFF_CYCLING_2TR; + if (userData11GE == 0) + d.tensorFileGE = 2; + } + // 3TR cycling mode + else if (userData12GE == 2) { + d.diffCyclingModeGE = kGE_DIFF_CYCLING_3TR; + if (userData11GE == 0) + d.tensorFileGE = 3; + } + // (Default) ALLTR cycling mode + else + d.diffCyclingModeGE = kGE_DIFF_CYCLING_ALLTR; + } + // Non-cylcing systems: all other systems including MR750, Architect, etc + else { + d.diffCyclingModeGE = kGE_DIFF_CYCLING_OFF; + } + } //detect pepolar https://github.com/nipy/heudiconv/issues/479 if ((d.epiVersionGE == kGE_EPI_PEPOLAR_FWD) && (userData12GE == 1)) d.epiVersionGE = kGE_EPI_PEPOLAR_REV; diff --git a/console/nii_dicom.h b/console/nii_dicom.h index 72481efa..db5b59e9 100644 --- a/console/nii_dicom.h +++ b/console/nii_dicom.h @@ -50,7 +50,7 @@ extern "C" { #define kCPUsuf " " //unknown CPU #endif -#define kDCMdate "v1.0.20220909" +#define kDCMdate "v1.0.20220915" #define kDCMvers kDCMdate " " kJP2suf kLSsuf kCCsuf kCPUsuf static const int kMaxEPI3D = 1024; //maximum number of EPI images in Siemens Mosaic @@ -98,6 +98,13 @@ static const int kMaxDTI4D = kMaxSlice2D; //issue460: maximum number of DTI dire #define kGE_EPI_PEPOLAR_REV_FWD_FLIP 7 #define kGE_EPI_PEPOLAR_FWD_REV_FLIP 8 +//GE Diff Gradient Cycling Mode +#define kGE_DIFF_CYCLING_UNKNOWN -1 +#define kGE_DIFF_CYCLING_OFF 0 +#define kGE_DIFF_CYCLING_ALLTR 1 +#define kGE_DIFF_CYCLING_2TR 2 +#define kGE_DIFF_CYCLING_3TR 3 +#define kGE_DIFF_CYCLING_SPOFF 100 //GE phase encoding #define kGE_PHASE_ENCODING_POLARITY_UNKNOWN -1 @@ -222,7 +229,7 @@ static const uint8_t MAX_NUMBER_OF_DIMENSIONS = 8; int xyzDim[5]; uint32_t coilCrc, seriesUidCrc, instanceUidCrc; int overlayStart[kMaxOverlay]; - int postLabelDelay, shimGradientX, shimGradientY, shimGradientZ, phaseNumber, spoiling, mtState, partialFourierDirection, interp3D, aslFlags, durationLabelPulseGE, epiVersionGE, internalepiVersionGE, maxEchoNumGE, rawDataRunNumber, numberOfImagesInGridUIH, numberOfDiffusionDirectionGE, phaseEncodingGE, protocolBlockStartGE, protocolBlockLengthGE, modality, dwellTime, effectiveEchoSpacingGE, phaseEncodingLines, phaseEncodingSteps, echoTrainLength, echoNum, sliceOrient, manufacturer, converted2NII, acquNum, imageNum, imageStart, imageBytes, bitsStored, bitsAllocated, samplesPerPixel,locationsInAcquisition, locationsInAcquisitionConflict, compressionScheme; + int postLabelDelay, shimGradientX, shimGradientY, shimGradientZ, phaseNumber, spoiling, mtState, partialFourierDirection, interp3D, aslFlags, durationLabelPulseGE, epiVersionGE, internalepiVersionGE, maxEchoNumGE, rawDataRunNumber, numberOfImagesInGridUIH, numberOfDiffusionT2GE, numberOfDiffusionDirectionGE, tensorFileGE, diffCyclingModeGE, phaseEncodingGE, protocolBlockStartGE, protocolBlockLengthGE, modality, dwellTime, effectiveEchoSpacingGE, phaseEncodingLines, phaseEncodingSteps, echoTrainLength, echoNum, sliceOrient, manufacturer, converted2NII, acquNum, imageNum, imageStart, imageBytes, bitsStored, bitsAllocated, samplesPerPixel,locationsInAcquisition, locationsInAcquisitionConflict, compressionScheme; float xRayTubeCurrent, exposureTimeMs, numberOfExcitations, numberOfArms, numberOfPointsPerArm, groupDelay, decayFactor, percentSampling,waterFatShift, numberOfAverages, imagingFrequency, patientWeight, zSpacing, zThick, pixelBandwidth, SAR, phaseFieldofView, accelFactPE, accelFactOOP, flipAngle, fieldStrength, TE, TI, TR, intenScale, intenIntercept, intenScalePhilips, gantryTilt, lastScanLoc, angulation[4], velocityEncodeScaleGE; float orient[7], patientPosition[4], patientPositionLast[4], xyzMM[4], stackOffcentre[4]; float rtia_timerGE, radionuclidePositronFraction, radionuclideTotalDose, radionuclideHalfLife, doseCalibrationFactor; //PET ISOTOPE MODULE ATTRIBUTES (C.8-57) diff --git a/console/nii_dicom_batch.cpp b/console/nii_dicom_batch.cpp index c1672871..cfd9ad13 100644 --- a/console/nii_dicom_batch.cpp +++ b/console/nii_dicom_batch.cpp @@ -1519,6 +1519,28 @@ tse3d: T2*/ json_Str(fp, "\t\"PrescanReuseString\": \"%s\",\n", d.prescanReuseString); float delayTimeInTR = -0.01; float repetitionTimePreparation = 0.0; + if (d.numberOfDiffusionDirectionGE > 0) + fprintf(fp, "\t\"NumberOfDiffusionDirectionGE\": %d,\n", d.numberOfDiffusionDirectionGE); + if (d.numberOfDiffusionT2GE > 0) + fprintf(fp, "\t\"NumberOfDiffusionT2GE\": %d,\n", d.numberOfDiffusionT2GE); + if ((d.manufacturer == kMANUFACTURER_GE) && (d.tensorFileGE > 0)) + fprintf(fp, "\t\"TensorFileNumberGE\": %d,\n", d.tensorFileGE); + if ((d.manufacturer == kMANUFACTURER_GE) && (opts.diffCyclingModeGE >= 0)) { + fprintf(fp, "\t\"DiffGradientCyclingGE\": \"OVERRIDE\",\n"); // see issue 635 + d.diffCyclingModeGE = opts.diffCyclingModeGE; + } + if (d.diffCyclingModeGE > 0) { + if (d.diffCyclingModeGE == kGE_DIFF_CYCLING_OFF) + fprintf(fp, "\t\"DiffGradientCyclingGE\": \"OFF\",\n"); + if (d.diffCyclingModeGE == kGE_DIFF_CYCLING_ALLTR) + fprintf(fp, "\t\"DiffGradientCyclingGE\": \"ALLTR\",\n"); + if (d.diffCyclingModeGE == kGE_DIFF_CYCLING_2TR) + fprintf(fp, "\t\"DiffGradientCyclingGE\": \"2TR\",\n"); + if (d.diffCyclingModeGE == kGE_DIFF_CYCLING_3TR) + fprintf(fp, "\t\"DiffGradientCyclingGE\": \"3TR\",\n"); + if (d.diffCyclingModeGE == kGE_DIFF_CYCLING_SPOFF) + fprintf(fp, "\t\"DiffGradientCyclingGE\": \"SPOFF\",\n"); + } #ifdef myReadAsciiCsa if ((d.manufacturer == kMANUFACTURER_SIEMENS) && (d.CSA.SeriesHeader_offset > 0) && (d.CSA.SeriesHeader_length > 0)) { float pf = 1.0f; //partial fourier @@ -5968,6 +5990,7 @@ void readSoftwareVersionsGE(char softwareVersionsGE[], int verbose, char geVersi // softwareVersionsGE // "27\LX\MR Software release:RX27.0_R02_1831.a" -> 27 // "28\LX\MR29.1_EA_2039.g" -> 29 + // "30\LX\SIGNA_LX1.MR30.0_R01_2236.d" -> 30; see issue 634 // geVersionPrefix // RX27.0_R02_1831.a -> RX // MR29.1_EA_2039.g -> MR @@ -5985,16 +6008,36 @@ void readSoftwareVersionsGE(char softwareVersionsGE[], int verbose, char geVersi // RX27.0_R02_1831.a -> 2 // MR29.1_EA_2039.g -> 0 int len = 0; + bool ismatched = false; + int substrlen = 0; + + // If softwareVersionsGE is 30\LX\SIGNA_LX1.MR30.0_R01_2236.d; see issue 634 + char *sepStart = strstr(softwareVersionsGE, "SIGNA_LX1"); + if (ismatched == false) { + if (sepStart != NULL) { + ismatched = true; + substrlen = strlen("SIGNA_LX1"); + sepStart += substrlen+1; + } + } // If softwareVersionsGE is 27\LX\MR Software release:RX27.0_R02_1831.a - char *sepStart = strchr(softwareVersionsGE, ':'); - if (sepStart == NULL) { - // If softwareVersionsGE is 28\LX\MR29.1_EA_2039.g + if (ismatched == false) { + sepStart = strstr(softwareVersionsGE, "MR Software release"); + if (sepStart != NULL) { + ismatched = true; + substrlen = strlen("MR Software release"); + sepStart += substrlen+1; + } + } + // If softwareVersionsGE is 28\LX\MR29.1_EA_2039.g + if (ismatched == false) { sepStart = strrchr(softwareVersionsGE, '\\'); - if (sepStart == NULL) - return; + if (sepStart != NULL) { + ismatched = true; + sepStart += 1; + } } - sepStart += 1; - len = 11; + len = 11; // RX27.0_R02_ char *versionString = (char *)malloc(sizeof(char) * len); versionString[len - 1] = 0; memcpy(versionString, sepStart, len); @@ -6010,6 +6053,7 @@ void readSoftwareVersionsGE(char softwareVersionsGE[], int verbose, char geVersi *geMajorVersion = (float)*geMajorVersionInt + (float)0.1 * (float)*geMinorVersionInt; *is27r3 = ((*geMajorVersion >= 27.1) || ((*geMajorVersionInt == 27) && (*geReleaseVersionInt >= 3))); if (verbose > 1) { + printMessage("GE Software VersionSting: %s\n", softwareVersionsGE); printMessage("GE Software VersionPrefix: %s\n", geVersionPrefix); printMessage("GE Software MajorVersion: %d\n", *geMajorVersionInt); printMessage("GE Software MinorVersion: %d\n", *geMinorVersionInt); @@ -6078,7 +6122,7 @@ void sliceTimingGE(struct TDICOMdata *d, const char *filename, struct TDCMopts o //start version check: float geMajorVersion = 0; int geMajorVersionInt = 0, geMinorVersionInt = 0, geReleaseVersionInt = 0; - char geVersionPrefix[2] = " "; + char geVersionPrefix[3] = ""; bool is27r3 = false; readSoftwareVersionsGE(d->softwareVersions, opts.isVerbose, geVersionPrefix, &geMajorVersion, &geMajorVersionInt, &geMinorVersionInt, &geReleaseVersionInt, &is27r3); //readSoftwareVersionsGE(&geMajorVersion); @@ -6118,7 +6162,7 @@ void sliceTimingGE(struct TDICOMdata *d, const char *filename, struct TDCMopts o if (nSlices != hdr->dim[3]) //redundant with locationsInAcquisition check? printWarning("Missing DICOMs, number of slices estimated (%d) differs from Protocol Block (0025,101B) report (%d).\n", hdr->dim[3], nSlices); d->CSA.multiBandFactor = max(d->CSA.multiBandFactor, mbAccel); - bool isInterleaved = (sliceOrderGE != 0); + bool isInterleaved = true; groupDelay *= 1000.0; //sec -> ms // // Estimate GE Slice Time only for EPI Multi-Phase (epi) or EPI fMRI/BrainWave (epiRT) @@ -6127,6 +6171,7 @@ void sliceTimingGE(struct TDICOMdata *d, const char *filename, struct TDCMopts o if (d->epiVersionGE >= kGE_EPI_PEPOLAR_FWD) printWarning("GE ABCD pepolar research sequence handling is experimental\n");// else if ((d->epiVersionGE == 1) || (strstr(ioptGE, "FMRI") != NULL)) { //-1 = not epi, 0 = epi, 1 = epiRT + isInterleaved = (sliceOrderGE != 0); d->epiVersionGE = 1; d->internalepiVersionGE = 1; // 'EPI'(gradient echo)/'EPI2'(spin echo) if (!isSameFloatGE(groupDelay, d->groupDelay)) @@ -6147,11 +6192,34 @@ void sliceTimingGE(struct TDICOMdata *d, const char *filename, struct TDCMopts o return; } } - // Diffusion (Unsupported) + // Diffusion (see issue 635) else if ((d->epiVersionGE == 2) || (d->internalepiVersionGE == 2) || (strstr(ioptGE, "DIFF") != NULL)) { - printWarning("Unable to compute slice times for GE Diffusion\n"); - d->CSA.sliceTiming[0] = -1.0; - return; + // diffusion gradient cycling OFF + if (opts.diffCyclingModeGE >= 0) + d->diffCyclingModeGE = opts.diffCyclingModeGE; + if ((d->diffCyclingModeGE == kGE_DIFF_CYCLING_SPOFF) || (d->diffCyclingModeGE == kGE_DIFF_CYCLING_OFF)) + is27r3 = false; + else if (d->diffCyclingModeGE == kGE_DIFF_CYCLING_ALLTR) { + printWarning("Unable to compute slice times for GE Diffusion:Cycling\n"); + d->CSA.sliceTiming[0] = -1.0; + return; + } + // TO DO: support 2TR/3TR cycling mode + else if (d->diffCyclingModeGE == kGE_DIFF_CYCLING_2TR) { + printWarning("Unable to compute slice times for GE Diffusion:2TR-Cycling\n"); + d->CSA.sliceTiming[0] = -1.0; + return; + } + else if (d->diffCyclingModeGE == kGE_DIFF_CYCLING_3TR) { + printWarning("Unable to compute slice times for GE Diffusion:3TR-Cyclin\n"); + d->CSA.sliceTiming[0] = -1.0; + return; + } + else { + printWarning("Unable to compute slice times for GE Diffusion\n"); + d->CSA.sliceTiming[0] = -1.0; + return; + } } // Others (Unsupported) else { @@ -8726,6 +8794,7 @@ void setDefaultOpts(struct TDCMopts *opts, const char *argv[]) { //either "setDe opts->isSaveNativeEndian = true; opts->isAddNamePostFixes = true; //e.g. "_e2" added for second echo opts->isTestx0021x105E = false; //GE test slice times stored in 0021,105E + opts->diffCyclingModeGE = -1; opts->isIgnoreTriggerTimes = false; opts->saveFormat = kSaveFormatNIfTI; opts->isPipedGz = false; //e.g. pipe data directly to pigz instead of saving uncompressed to disk diff --git a/console/nii_dicom_batch.h b/console/nii_dicom_batch.h index 80902c0d..0f9c88c8 100644 --- a/console/nii_dicom_batch.h +++ b/console/nii_dicom_batch.h @@ -57,7 +57,7 @@ void nii_clrMrifsStruct(); struct TDCMopts { bool isIgnoreTriggerTimes, isTestx0021x105E, isAddNamePostFixes, isSaveNativeEndian, isOneDirAtATime, isRenameNotConvert, isSave3D, isGz, isPipedGz, isFlipY, isCreateBIDS, isSortDTIbyBVal, isAnonymizeBIDS, isOnlyBIDS, isCreateText, isForceOnsetTimes,isIgnoreDerivedAnd2D, isPhilipsFloatNotDisplayScaling, isTiltCorrect, isRGBplanar, isOnlySingleFile, isForceStackDCE, isIgnoreSeriesInstanceUID, isRotate3DAcq, isCrop; - int saveFormat, isMaximize16BitRange, isForceStackSameSeries, nameConflictBehavior, isVerbose, isProgress, compressFlag, dirSearchDepth, gzLevel; //support for compressed data 0=none, + int saveFormat, isMaximize16BitRange, isForceStackSameSeries, nameConflictBehavior, isVerbose, isProgress, compressFlag, dirSearchDepth, gzLevel, diffCyclingModeGE; //support for compressed data 0=none, char filename[512], outdir[512], indir[512], pigzname[512], optsname[512], indirParent[512], imageComments[24]; double seriesNumber[MAX_NUM_SERIES]; //requires double must store -1 (report but do not convert) as well as seriesUidCrc (uint32) long numSeries; From 15c066e20fcd56bb8d473e0960967517497dd163 Mon Sep 17 00:00:00 2001 From: neurolabusc Date: Mon, 19 Sep 2022 08:19:14 -0400 Subject: [PATCH 11/85] Improve documentation --- BIDS/README.md | 18 ++++++++++-------- GE/README.md | 2 +- README.md | 1 - 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/BIDS/README.md b/BIDS/README.md index d018fa5d..243a9806 100644 --- a/BIDS/README.md +++ b/BIDS/README.md @@ -228,6 +228,7 @@ Data unique to [GE](https://github.com/rordenlab/dcm2niix/tree/master/GE). Deter | ASLContrastTechnique | | DICOM tag 0043,10A3 | D | | ASLLabelingTechnique | | DICOM tag 0043,10A4 | D | | LabelingDuration | s | DICOM tag 0043,10A5 | B | +| SliceTiming | s | [see notes](https://github.com/rordenlab/dcm2niix/tree/master/GE#slice-timing) | B | ### Manufacturer Philips @@ -321,15 +322,16 @@ Fields specific to Siemens V*-series (e.g. VB, VE) MRI systems (e.g. Verio, Trio ### Manufacturer Siemens Magnetic Resonance Imaging (XA) -Fields specific to Siemens XA-series MRI systems (Sola, Vida). +Fields specific to [Siemens XA-series](https://github.com/rordenlab/dcm2niix/tree/master/Siemens#siemens-x-series) MRI systems (Sola, Vida). -| Field | Unit | Comments | Defined By | -|------------------------------|------|------------------------|------------| -| ReceiveCoilActiveElements | | DICOM tag 0021,114F | B | -| BandwidthPerPixelPhaseEncode | Hz | DICOM tag 0021,1153 | D | -| ScanningSequence | | DICOM tag 0021,105a | D | -| PostLabelDelay | s | DICOM tag 0018,9258 | D | -| NonlinearGradientCorrection | b | 0008,0008 or 0021,1175 | B | +| Field | Unit | Comments | Defined By | +|------------------------------|------|----------------------------|------------| +| ReceiveCoilActiveElements | | DICOM tag 0021,114F | B | +| BandwidthPerPixelPhaseEncode | Hz | DICOM tag 0021,1153 | D | +| ScanningSequence | | DICOM tag 0021,105a | D | +| PostLabelDelay | s | DICOM tag 0018,9258 | D | +| NonlinearGradientCorrection | b | 0008,0008 or 0021,1175 | B | +| PhaseEncodingDirection | | polarity from 0021,111c | B | ### Manufacturer UIH diff --git a/GE/README.md b/GE/README.md index 0ac92e96..c0935a23 100644 --- a/GE/README.md +++ b/GE/README.md @@ -28,7 +28,7 @@ Knowing the relative timing of the acquisition for each 2D slice in a 3D volume [Some sequences](https://afni.nimh.nih.gov/afni/community/board/read.php?1,154006) encode the RTIA Timer (0021,105E) element. For example, [this DV24 dataset](https://github.com/nikadon/cc-dcm2bids-wrapper/tree/master/dicom-qa-examples/ge-mr750-slice-timing) includes timing data, while [this DV26 dataset does not](https://github.com/neurolabusc/dcm_qa_nih). Be aware that different versions of GE software appear to use different units for 0021,105E. The DV24 example is reported in seconds, while [14.0 uses 1/10000 seconds](https://github.com/rordenlab/dcm2niix/issues/286). An example of the latter format can be found [here](https://www.nitrc.org/plugins/mwiki/index.php/dcm2nii:MainPage#Archival_MRI). Even with the sequences that do encode the RTIA Timer, there is some debate regarding the accuracy of this element. In the example listed, the slice times are clearly wrong in the first volume. Therefore, dcm2niix always estimates slice times based on the 2nd volume in a time series. -In general, fMRI acquired using GE product sequence (PSD) “epi” with the multiphase option will store slice timing in the Trigger Time (DICOM 0018,1060) element. In contrast, the popular PSD “epiRT” (BrainWave RT, fMRI/DTI package provided by Medical Numerics) does not save this tag (though in some cases it saves the RTIA Timer). Examples are [available](https://www.nitrc.org/plugins/mwiki/index.php/dcm2nii:MainPage#Slice_timing_correction) for both the “epiRT” and “epi” sequences. +In general, fMRI acquired using GE product sequence (PSD) “epi” with the multiphase option will store slice timing in the Trigger Time (DICOM 0018,1060) element. In contrast, the popular PSD “epiRT” (BrainWave RT, fMRI/DTI package provided by Medical Numerics) does not save this tag (though in some cases it saves the RTIA Timer). Examples are [available](https://www.nitrc.org/plugins/mwiki/index.php/dcm2nii:MainPage#Slice_timing_correction) for both the “epiRT” and “epi” sequences. The [“epi2” is a special case](https://github.com/rordenlab/dcm2niix/issues/635). The “epiRT” sequences also allow the user to specify the `Group Delay`, which is 0 msec by default. Increasing this value will create a pause at the end of each volume, and this value is recorded in the DICOM header(as 0043,107C, reported in seconds). This option can be used for sparse designs, where one wants a pause after each value. Be aware that the `RepetitionTime` (0018,0080) reported in this header omits the group delay. So a study with a TR of 2000ms and a Group Delay of 55ms will report the values (0018,0080 = 2000, 0043,107C = 0.055), while the actual sampling rate will be 2055ms. This is unintuitive, the TR with respect to tissue contrast is 2055ms, not the reported 2000. diff --git a/README.md b/README.md index 39f46ffe..9e670994 100644 --- a/README.md +++ b/README.md @@ -178,7 +178,6 @@ The following tools exploit dcm2niix - [MRIcroGL](https://github.com/neurolabusc/MRIcroGL) is available for MacOS, Linux and Windows and provides a graphical interface for dcm2niix. You can get compiled copies from the [MRIcroGL NITRC web site](https://www.nitrc.org/projects/mricrogl/). - [neuro_docker](https://github.com/Neurita/neuro_docker) includes dcm2niix as part of a single, static Dockerfile. - [NeuroDebian](http://neuro.debian.net/pkgs/dcm2niix.html) provides up-to-date version of dcm2niix for Debian-based systems. - - [neurodocker](https://github.com/kaczmarj/neurodocker) generates [custom](https://github.com/rordenlab/dcm2niix/issues/138) Dockerfiles given specific versions of neuroimaging software. - [neurodocker](https://github.com/kaczmarj/neurodocker) includes dcm2niix as a lean, minimal install Dockerfile. - [NeuroElf](http://neuroelf.net) can use dcm2niix to convert DICOM images. - [Neuroinformatics Database (NiDB)](https://github.com/gbook/nidb) is designed to store, retrieve, analyze, and share neuroimaging data. It uses dcm2niix for image QA and handling some formats. From fb62a36db7693f9144246c787d2791ee3463c8ab Mon Sep 17 00:00:00 2001 From: neurolabusc Date: Fri, 23 Sep 2022 06:55:09 -0400 Subject: [PATCH 12/85] Remove GEIIS detection logic if SQ has explicit length (https://github.com/rordenlab/dcm2niix/issues/638) --- README.md | 1 + console/nii_dicom.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/README.md b/README.md index 9e670994..1dd56f39 100644 --- a/README.md +++ b/README.md @@ -163,6 +163,7 @@ The following tools exploit dcm2niix - [DICOM2BIDS](https://github.com/klsea/DICOM2BIDS) is a Python 2 script for creating BIDS files. - [dicom2nifti_batch](https://github.com/scanUCLA/dicom2nifti_batch) is a Matlab script for automating dcm2niix. - [divest](https://github.com/jonclayden/divest) R interface to dcm2niix. + - [DPABI Data Processing & Analysis for Brain Imaging](http://rfmri.org/dpabi) includes dcm2niix. - [ExploreASL](https://sites.google.com/view/exploreasl/exploreasl) uses dcm2niix to import images. - [ezBIDS](https://github.com/brainlife/ezbids) is a [web service](https://brainlife.io/ezbids/) for converting directory full of DICOM images into BIDS without users having to learn python nor custom configuration file. - [fmrif tools](https://github.com/nih-fmrif/fmrif_tools) uses dcm2niix for its [oxy2bids](https://fmrif-tools.readthedocs.io/en/latest/#) tool. diff --git a/console/nii_dicom.cpp b/console/nii_dicom.cpp index 530f4890..bf4cec84 100644 --- a/console/nii_dicom.cpp +++ b/console/nii_dicom.cpp @@ -6373,6 +6373,8 @@ const uint32_t kEffectiveTE = 0x0018 + (0x9082 << 16); d.decayFactor = dcmStrFloat(lLength, &buffer[lPos]); break; case kIconImageSequence: + if (lLength > 8) + break; //issue638: we will skip entire icon if there is an explicit length isIconImageSequence = true; if (sqDepthIcon < 0) sqDepthIcon = sqDepth; From b9b66abf69e91d9be45cd5f69591a5a4ec18bf19 Mon Sep 17 00:00:00 2001 From: neurolabusc Date: Fri, 23 Sep 2022 06:57:27 -0400 Subject: [PATCH 13/85] Version bump --- console/nii_dicom.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/console/nii_dicom.h b/console/nii_dicom.h index db5b59e9..8921626a 100644 --- a/console/nii_dicom.h +++ b/console/nii_dicom.h @@ -50,7 +50,7 @@ extern "C" { #define kCPUsuf " " //unknown CPU #endif -#define kDCMdate "v1.0.20220915" +#define kDCMdate "v1.0.20220923" #define kDCMvers kDCMdate " " kJP2suf kLSsuf kCCsuf kCPUsuf static const int kMaxEPI3D = 1024; //maximum number of EPI images in Siemens Mosaic From 59238aae61aa554ce67db00707458bafd8837a26 Mon Sep 17 00:00:00 2001 From: neurolabusc Date: Fri, 30 Sep 2022 20:37:35 -0400 Subject: [PATCH 14/85] Handle missing pixel data tag (https://github.com/rordenlab/dcm2niix/issues/639) --- console/nii_dicom.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/console/nii_dicom.cpp b/console/nii_dicom.cpp index bf4cec84..5abbb0e8 100644 --- a/console/nii_dicom.cpp +++ b/console/nii_dicom.cpp @@ -7246,6 +7246,15 @@ const uint32_t kEffectiveTE = 0x0018 + (0x9082 << 16); //Uncompressed data (unencapsulated) is sent in DICOM as a series of raw bytes or words (little or big endian) in the Value field of the Pixel Data element (7FE0,0010). Encapsulated data on the other hand is sent not as raw bytes or words but as Fragments contained in Items that are the Value field of Pixel Data printWarning("DICOM violation (contact vendor): compressed image without image fragments, assuming image offset defined by 0x7FE0,x0010: %s\n", fname); d.imageStart = encapsulatedDataImageStart; + } else if ((!isEncapsulatedData) && (d.imageStart < 128)) { + //issue639 d.samplesPerPixel == 3 + int imageStart = (int) (lPos- lLength); + int imgBytes = (int) (lLength); + int imgBytesExpected = (d.bitsAllocated >> 3) * d.samplesPerPixel * d.xyzDim[1] * d.xyzDim[2] ; + if ((imgBytes >= imgBytesExpected) && (d.xyzDim[1] > 1) && (d.xyzDim[2] > 1)) { + printf("Assuming final tag is Pixel Data (7fe0,0010) (issue 639)\n"); + d.imageStart = imageStart; + } } if ((d.manufacturer == kMANUFACTURER_GE) && (d.groupDelay > 0.0)) d.TR += d.groupDelay; //Strangely, for GE the sample rate is (0018,0080) + ((0043,107c) * 1000.0) From 3b26ee61c1788a8aa79df42bc15a901c286e5d18 Mon Sep 17 00:00:00 2001 From: neurolabusc Date: Fri, 7 Oct 2022 11:13:26 +0300 Subject: [PATCH 15/85] Ignore OriginalAttributesSequence (0400,0561) SQ with explicit length (https://github.com/rordenlab/dcm2niix/issues/639) --- README.md | 1 + console/nii_dicom.cpp | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/README.md b/README.md index 1dd56f39..db2fde18 100644 --- a/README.md +++ b/README.md @@ -171,6 +171,7 @@ The following tools exploit dcm2niix - [FreeSurfer](https://github.com/freesurfer/freesurfer) includes dcm2niix for image conversion. - [fsleyes](https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/FSLeyes) is a powerful Python-based image viewer. It uses dcm2niix to handle DICOM files through its fslpy libraries. - [Functional Real-Time Interactive Endogenous Neuromodulation and Decoding (FRIEND) Engine](https://github.com/InstitutoDOr/FriendENGINE) uses dcm2niix. + - [https://github.com/TamerGezici/HCF-bidser](https://github.com/TamerGezici/HCF-bidser) Jupyter notebook script for DICOM to BIDS format. - [heudiconv](https://github.com/nipy/heudiconv) can use dcm2niix to create [BIDS](http://bids.neuroimaging.io/) datasets. Data acquired using the [reproin](https://github.com/ReproNim/reproin) convention can be easily converted to BIDS. - [Horos (Osirix) Bids Output Extension](https://github.com/mslw/horos-bids-output) is a OsiriX / Horos plugin that uses dcm2niix for creating BIDS output. - [kipettools](https://github.com/mathesong/kipettools) uses dcm2niix to load PET data. diff --git a/console/nii_dicom.cpp b/console/nii_dicom.cpp index 5abbb0e8..4499d820 100644 --- a/console/nii_dicom.cpp +++ b/console/nii_dicom.cpp @@ -5342,6 +5342,8 @@ const uint32_t kEffectiveTE = 0x0018 + (0x9082 << 16); dcmStr(lLength, &buffer[lPos], d.referringPhysicianName); break; case kReferencedImageEvidenceSQ: + if (lLength > 8) + break; //issue639: we will skip entire icon if there is an explicit length is00089092SQ = true; break; case kComplexImageComponent: @@ -6759,6 +6761,8 @@ const uint32_t kEffectiveTE = 0x0018 + (0x9082 << 16); philMRImageDiffVolumeNumber = dcmStrInt(lLength, &buffer[lPos]); break; case kOriginalAttributesSq: + if (lLength > 8) + break; //issue639: we will skip entire icon if there is an explicit length is4000561SQ = true; break; case kWaveformSq: From d0b24b92d32462fdece08596a5392bed7b644da5 Mon Sep 17 00:00:00 2001 From: neurolabusc Date: Wed, 12 Oct 2022 15:20:03 -0400 Subject: [PATCH 16/85] segment varying TR in single series (https://github.com/rordenlab/dcm2niix/issues/641) --- console/nii_dicom.cpp | 8 +++++++- console/nii_dicom_batch.cpp | 7 +++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/console/nii_dicom.cpp b/console/nii_dicom.cpp index 4499d820..7ebd283f 100644 --- a/console/nii_dicom.cpp +++ b/console/nii_dicom.cpp @@ -4464,6 +4464,7 @@ const uint32_t kEffectiveTE = 0x0018 + (0x9082 << 16); //#define kNumberOfLocationsPhilips 0x2001+(0x1015 << 16 ) //SS //#define kStackSliceNumber 0x2001+(0x1035 << 16 )//? Potential way to determine slice order for Philips? #define kNumberOfDynamicScans 0x2001 + (0x1081 << 16) //'2001' '1081' 'IS' 'NumberOfDynamicScans' +//#define kTRPhilips 0x2005 + (0x1030 << 16) //(2005,1030) FL 30\150 #define kMRfMRIStatusIndicationPhilips 0x2005 + (0x1063 << 16) #define kMRAcquisitionTypePhilips 0x2005 + (0x106F << 16) //SS #define kAngulationAP 0x2005 + (0x1071 << 16) //'2005' '1071' 'FL' 'MRStackAngulationAP' @@ -4473,7 +4474,7 @@ const uint32_t kEffectiveTE = 0x0018 + (0x9082 << 16); #define kMRStackOffcentreFH 0x2005 + (0x1079 << 16) #define kMRStackOffcentreRL 0x2005 + (0x107A << 16) #define kPhilipsSlope 0x2005 + (0x100E << 16) -#define kMRImageDynamicScanBeginTime 0x2005 + (0x10a0 << 16) //FL +#define kMRImageDynamicScanBeginTime 0x2005 + (0x10A0 << 16) //FL #define kDiffusionDirectionRL 0x2005 + (0x10B0 << 16) #define kDiffusionDirectionAP 0x2005 + (0x10B1 << 16) #define kDiffusionDirectionFH 0x2005 + (0x10B2 << 16) @@ -4610,6 +4611,7 @@ const uint32_t kEffectiveTE = 0x0018 + (0x9082 << 16); float vRLPhilips = 0.0; float vAPPhilips = 0.0; float vFHPhilips = 0.0; + //float TRPhilips = -1.0; double acquisitionTimePhilips = -1.0; bool isPhase = false; bool isReal = false; @@ -6388,6 +6390,10 @@ const uint32_t kEffectiveTE = 0x0018 + (0x9082 << 16); //~d.numberOfDynamicScans = dcmStrInt(lLength, &buffer[lPos]); numberOfDynamicScans = dcmStrInt(lLength, &buffer[lPos]); break; + /*case kTRPhilips: + if (d.manufacturer != kMANUFACTURER_PHILIPS) break; + TRPhilips = dcmFloat(lLength, &buffer[lPos], d.isLittleEndian); + break;*/ case kMRAcquisitionType: //detect 3D acquisition: we can reorient these without worrying about slice time correct or BVEC/BVAL orientation if (lLength > 1) d.is2DAcq = (buffer[lPos] == '2') && (toupper(buffer[lPos + 1]) == 'D'); diff --git a/console/nii_dicom_batch.cpp b/console/nii_dicom_batch.cpp index cfd9ad13..0ac24e21 100644 --- a/console/nii_dicom_batch.cpp +++ b/console/nii_dicom_batch.cpp @@ -7662,6 +7662,13 @@ bool isSameSet(struct TDICOMdata d1, struct TDICOMdata d2, struct TDCMopts *opts warnings->phaseVaries = true; return false; } + if (!(isSameFloat(d1.TR, d2.TR))) { + if (!warnings->echoVaries) + printMessage("Slices not stacked: TR varies (%g, %g, issue 641). Use 'merge 2D slices' option to force stacking\n", d1.TR, d2.TR); + *isMultiEcho = true; + warnings->echoVaries = true; + return false; + } //if ((d1.TE != d2.TE) || (d1.echoNum != d2.echoNum)) { if ((!(isSameFloat(d1.TE, d2.TE))) || (d1.echoNum != d2.echoNum)) { if ((!warnings->echoVaries) && (d1.isXRay)) //for CT/XRay we check DICOM tag 0018,1152 (XRayExposure) From 3eeef67e837f193fcaec1091d8f2bcf57c299b49 Mon Sep 17 00:00:00 2001 From: neurolabusc Date: Thu, 13 Oct 2022 12:40:41 -0400 Subject: [PATCH 17/85] Escape forward slash (https://github.com/rordenlab/dcm2niix/issues/640) --- console/nii_dicom.h | 2 +- console/nii_dicom_batch.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/console/nii_dicom.h b/console/nii_dicom.h index 8921626a..d3140b41 100644 --- a/console/nii_dicom.h +++ b/console/nii_dicom.h @@ -50,7 +50,7 @@ extern "C" { #define kCPUsuf " " //unknown CPU #endif -#define kDCMdate "v1.0.20220923" +#define kDCMdate "v1.0.20221013" #define kDCMvers kDCMdate " " kJP2suf kLSsuf kCCsuf kCPUsuf static const int kMaxEPI3D = 1024; //maximum number of EPI images in Siemens Mosaic diff --git a/console/nii_dicom_batch.cpp b/console/nii_dicom_batch.cpp index 0ac24e21..3e8958bf 100644 --- a/console/nii_dicom_batch.cpp +++ b/console/nii_dicom_batch.cpp @@ -1037,7 +1037,7 @@ void json_Str(FILE *fp, const char *sLabel, char *sVal) { // issue131,425 int o = 0; for (int i = 0; i < (int)strlen(sVal); i++) { //escape double quote (") and Backslash - if ((sVal[i] == '"') || (sVal[i] == '\\')) { //escape double quotes and back slash + if ((sVal[i] == '"') || (sVal[i] == '\\') || (sVal[i] == '/')) { //escape double quotes, back slash, or slash sValEsc[o] = '\\'; o++; } From 1239897baac97652b687851d21585f59f7f5782a Mon Sep 17 00:00:00 2001 From: neurolabusc Date: Fri, 21 Oct 2022 07:42:01 -0400 Subject: [PATCH 18/85] Do not escape slashes (https://github.com/rordenlab/dcm2niix/issues/640) --- console/nii_dicom.h | 2 +- console/nii_dicom_batch.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/console/nii_dicom.h b/console/nii_dicom.h index d3140b41..bd8a60c2 100644 --- a/console/nii_dicom.h +++ b/console/nii_dicom.h @@ -50,7 +50,7 @@ extern "C" { #define kCPUsuf " " //unknown CPU #endif -#define kDCMdate "v1.0.20221013" +#define kDCMdate "v1.0.20221021" #define kDCMvers kDCMdate " " kJP2suf kLSsuf kCCsuf kCPUsuf static const int kMaxEPI3D = 1024; //maximum number of EPI images in Siemens Mosaic diff --git a/console/nii_dicom_batch.cpp b/console/nii_dicom_batch.cpp index 3e8958bf..92e658c2 100644 --- a/console/nii_dicom_batch.cpp +++ b/console/nii_dicom_batch.cpp @@ -1037,7 +1037,8 @@ void json_Str(FILE *fp, const char *sLabel, char *sVal) { // issue131,425 int o = 0; for (int i = 0; i < (int)strlen(sVal); i++) { //escape double quote (") and Backslash - if ((sVal[i] == '"') || (sVal[i] == '\\') || (sVal[i] == '/')) { //escape double quotes, back slash, or slash + //if ((sVal[i] == '"') || (sVal[i] == '\\') || (sVal[i] == '/')) { //issue640: escape double quotes, back slash, or slash + if ((sVal[i] == '"') || (sVal[i] == '\\')) { //escape double quotes and back slash sValEsc[o] = '\\'; o++; } From 2a9fbe82aaf29bf0830c23a5e44fccea9382ee32 Mon Sep 17 00:00:00 2001 From: neurolabusc Date: Mon, 24 Oct 2022 15:13:05 -0400 Subject: [PATCH 19/85] MR Solutions (https://github.com/rordenlab/dcm2niix/issues/642) --- console/nii_dicom.cpp | 4 ++++ console/nii_dicom.h | 5 +++-- console/nii_dicom_batch.cpp | 12 ++++++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/console/nii_dicom.cpp b/console/nii_dicom.cpp index 7ebd283f..7876009e 100644 --- a/console/nii_dicom.cpp +++ b/console/nii_dicom.cpp @@ -885,6 +885,7 @@ struct TDICOMdata clear_dicom_data() { d.isHasOverlay = false; d.isPrivateCreatorRemap = false; d.isRealIsPhaseMapHz = false; + d.isQuadruped = false; d.numberOfImagesInGridUIH = 0; d.phaseEncodingRC = '?'; d.patientSex = '?'; @@ -1211,6 +1212,8 @@ int dcmStrManufacturer(const int lByteLength, unsigned char lBuffer[]) { //read ret = kMANUFACTURER_UIH; if ((toupper(cString[0]) == 'B') && (toupper(cString[1]) == 'R')) ret = kMANUFACTURER_BRUKER; + if ((toupper(cString[0]) == 'M') && (toupper(cString[1]) == 'R')) + ret = kMANUFACTURER_MRSOLUTIONS; //if (ret == kMANUFACTURER_UNKNOWN) //reduce verbosity: single warning for series : Unable to determine manufacturer (0008,0070) // printWarning("Unknown manufacturer %s\n", cString); //#ifdef _MSC_VER @@ -5417,6 +5420,7 @@ const uint32_t kEffectiveTE = 0x0018 + (0x9082 << 16); int slen = (int)strlen(aotTxt); if ((slen < 9) || (strstr(aotTxt, "QUADRUPED") == NULL)) break; + d.isQuadruped = true; printError("Anatomical Orientation Type (0010,2210) is QUADRUPED: rotate coordinates accordingly\n"); break; } diff --git a/console/nii_dicom.h b/console/nii_dicom.h index bd8a60c2..bd6b2d8a 100644 --- a/console/nii_dicom.h +++ b/console/nii_dicom.h @@ -50,7 +50,7 @@ extern "C" { #define kCPUsuf " " //unknown CPU #endif -#define kDCMdate "v1.0.20221021" +#define kDCMdate "v1.0.20221024" #define kDCMvers kDCMdate " " kJP2suf kLSsuf kCCsuf kCPUsuf static const int kMaxEPI3D = 1024; //maximum number of EPI images in Siemens Mosaic @@ -70,6 +70,7 @@ static const int kMaxDTI4D = kMaxSlice2D; //issue460: maximum number of DTI dire #define kMANUFACTURER_HITACHI 7 #define kMANUFACTURER_CANON 8 #define kMANUFACTURER_MEDISO 9 +#define kMANUFACTURER_MRSOLUTIONS 10 //note: note a complete modality list, e.g. XA,PX, etc #define kMODALITY_UNKNOWN 0 @@ -241,7 +242,7 @@ static const uint8_t MAX_NUMBER_OF_DIMENSIONS = 8; char scanOptions[kDICOMStrLarge], institutionAddress[kDICOMStrLarge], imageComments[kDICOMStrLarge]; uint32_t dimensionIndexValues[MAX_NUMBER_OF_DIMENSIONS]; struct TCSAdata CSA; - bool isRealIsPhaseMapHz, isPrivateCreatorRemap, isHasOverlay, isEPI, isIR, isPartialFourier, isDiffusion, isVectorFromBMatrix, isRawDataStorage, isGrayscaleSoftcopyPresentationState, isStackableSeries, isCoilVaries, isNonParallelSlices, isBVecWorldCoordinates, isSegamiOasis, isXA10A, isScaleOrTEVaries, isScaleVariesEnh, isDerived, isXRay, isMultiEcho, isValid, is3DAcq, is2DAcq, isExplicitVR, isLittleEndian, isPlanarRGB, isSigned, isHasPhase, isHasImaginary, isHasReal, isHasMagnitude,isHasMixed, isFloat, isResampled, isLocalizer; + bool isQuadruped, isRealIsPhaseMapHz, isPrivateCreatorRemap, isHasOverlay, isEPI, isIR, isPartialFourier, isDiffusion, isVectorFromBMatrix, isRawDataStorage, isGrayscaleSoftcopyPresentationState, isStackableSeries, isCoilVaries, isNonParallelSlices, isBVecWorldCoordinates, isSegamiOasis, isXA10A, isScaleOrTEVaries, isScaleVariesEnh, isDerived, isXRay, isMultiEcho, isValid, is3DAcq, is2DAcq, isExplicitVR, isLittleEndian, isPlanarRGB, isSigned, isHasPhase, isHasImaginary, isHasReal, isHasMagnitude,isHasMixed, isFloat, isResampled, isLocalizer; char phaseEncodingRC, patientSex; }; struct TDCMprefs { diff --git a/console/nii_dicom_batch.cpp b/console/nii_dicom_batch.cpp index 92e658c2..7bdc8057 100644 --- a/console/nii_dicom_batch.cpp +++ b/console/nii_dicom_batch.cpp @@ -1244,6 +1244,9 @@ tse3d: T2*/ case kMANUFACTURER_UIH: fprintf(fp, "\t\"Manufacturer\": \"UIH\",\n"); break; + case kMANUFACTURER_MRSOLUTIONS: + fprintf(fp, "\t\"Manufacturer\": \"MRSolutions\",\n"); + break; }; //if (d.epiVersionGE == 0) // fprintf(fp, "\t\"PulseSequenceName\": \"epi\",\n"); @@ -1284,6 +1287,8 @@ tse3d: T2*/ //d.patientBirthDate //convert from DICOM YYYYMMDD to JSON //d.patientAge //4-digit Age String: nnnD, nnnW, nnnM, nnnY; } + if (d.isQuadruped) + json_Bool(fp, "\t\"Quadruped\": %s,\n", true); // BIDS suggests 0018,9020 but Siemens V-series do not populate this, alternatives are CSA or (0018,0021) CS [SK\MTC\SP] json_Str(fp, "\t\"BodyPartExamined\": \"%s\",\n", d.bodyPartExamined); json_Str(fp, "\t\"PatientPosition\": \"%s\",\n", d.patientOrient); // 0018,5100 = PatientPosition in DICOM json_Str(fp, "\t\"ProcedureStepDescription\": \"%s\",\n", d.procedureStepDescription); @@ -3140,6 +3145,10 @@ int nii_createFilename(struct TDICOMdata dcm, char *niiFilename, struct TDCMopts strcat(outname, "Ph"); else if (dcm.manufacturer == kMANUFACTURER_SIEMENS) strcat(outname, "Si"); + else if (dcm.manufacturer == kMANUFACTURER_MEDISO) + strcat(outname, "Me"); + else if (dcm.manufacturer == kMANUFACTURER_MRSOLUTIONS) + strcat(outname, "MR"); else strcat(outname, "NA"); //manufacturer name not available } @@ -3636,6 +3645,9 @@ void nii_saveAttributes(struct TDICOMdata &data, struct nifti_1_header &header, case kMANUFACTURER_CANON: images->addAttribute("manufacturer", "Canon"); break; + case kMANUFACTURER_MRSOLUTIONS: + images->addAttribute("manufacturer", "MRSolutions"); + break; } images->addAttribute("scannerModelName", data.manufacturersModelName); images->addAttribute("imageType", data.imageType); From 524d111958cc3ab13a2b285dedd5cd27c9be5393 Mon Sep 17 00:00:00 2001 From: Jaemin Shin Date: Wed, 2 Nov 2022 16:23:15 -0400 Subject: [PATCH 20/85] GE Diffusion JSON update --- console/nii_dicom.cpp | 4 ++-- console/nii_dicom.h | 2 +- console/nii_dicom_batch.cpp | 45 ++++++++++++++++++++----------------- 3 files changed, 27 insertions(+), 24 deletions(-) diff --git a/console/nii_dicom.cpp b/console/nii_dicom.cpp index 7876009e..1a144e10 100644 --- a/console/nii_dicom.cpp +++ b/console/nii_dicom.cpp @@ -7753,13 +7753,13 @@ const uint32_t kEffectiveTE = 0x0018 + (0x9082 << 16); if (isSameFloatGE(userData15GE, 0.72)) d.diffCyclingModeGE = kGE_DIFF_CYCLING_SPOFF; // 2TR cycling mode - else if (userData12GE == 1) { + else if (userData12GE == 2) { d.diffCyclingModeGE = kGE_DIFF_CYCLING_2TR; if (userData11GE == 0) d.tensorFileGE = 2; } // 3TR cycling mode - else if (userData12GE == 2) { + else if (userData12GE == 3) { d.diffCyclingModeGE = kGE_DIFF_CYCLING_3TR; if (userData11GE == 0) d.tensorFileGE = 3; diff --git a/console/nii_dicom.h b/console/nii_dicom.h index bd6b2d8a..6425a367 100644 --- a/console/nii_dicom.h +++ b/console/nii_dicom.h @@ -50,7 +50,7 @@ extern "C" { #define kCPUsuf " " //unknown CPU #endif -#define kDCMdate "v1.0.20221024" +#define kDCMdate "v1.0.20221102" #define kDCMvers kDCMdate " " kJP2suf kLSsuf kCCsuf kCPUsuf static const int kMaxEPI3D = 1024; //maximum number of EPI images in Siemens Mosaic diff --git a/console/nii_dicom_batch.cpp b/console/nii_dicom_batch.cpp index 7bdc8057..94b477e4 100644 --- a/console/nii_dicom_batch.cpp +++ b/console/nii_dicom_batch.cpp @@ -1525,27 +1525,30 @@ tse3d: T2*/ json_Str(fp, "\t\"PrescanReuseString\": \"%s\",\n", d.prescanReuseString); float delayTimeInTR = -0.01; float repetitionTimePreparation = 0.0; - if (d.numberOfDiffusionDirectionGE > 0) - fprintf(fp, "\t\"NumberOfDiffusionDirectionGE\": %d,\n", d.numberOfDiffusionDirectionGE); - if (d.numberOfDiffusionT2GE > 0) - fprintf(fp, "\t\"NumberOfDiffusionT2GE\": %d,\n", d.numberOfDiffusionT2GE); - if ((d.manufacturer == kMANUFACTURER_GE) && (d.tensorFileGE > 0)) - fprintf(fp, "\t\"TensorFileNumberGE\": %d,\n", d.tensorFileGE); - if ((d.manufacturer == kMANUFACTURER_GE) && (opts.diffCyclingModeGE >= 0)) { - fprintf(fp, "\t\"DiffGradientCyclingGE\": \"OVERRIDE\",\n"); // see issue 635 - d.diffCyclingModeGE = opts.diffCyclingModeGE; - } - if (d.diffCyclingModeGE > 0) { - if (d.diffCyclingModeGE == kGE_DIFF_CYCLING_OFF) - fprintf(fp, "\t\"DiffGradientCyclingGE\": \"OFF\",\n"); - if (d.diffCyclingModeGE == kGE_DIFF_CYCLING_ALLTR) - fprintf(fp, "\t\"DiffGradientCyclingGE\": \"ALLTR\",\n"); - if (d.diffCyclingModeGE == kGE_DIFF_CYCLING_2TR) - fprintf(fp, "\t\"DiffGradientCyclingGE\": \"2TR\",\n"); - if (d.diffCyclingModeGE == kGE_DIFF_CYCLING_3TR) - fprintf(fp, "\t\"DiffGradientCyclingGE\": \"3TR\",\n"); - if (d.diffCyclingModeGE == kGE_DIFF_CYCLING_SPOFF) - fprintf(fp, "\t\"DiffGradientCyclingGE\": \"SPOFF\",\n"); + // GE Diffusion specific fields + if ((d.epiVersionGE == kGE_EPI_EPI2) || (d.internalepiVersionGE == 2)) { + if (d.numberOfDiffusionDirectionGE > 0) + fprintf(fp, "\t\"NumberOfDiffusionDirectionGE\": %d,\n", d.numberOfDiffusionDirectionGE); + if (d.numberOfDiffusionT2GE > 0) + fprintf(fp, "\t\"NumberOfDiffusionT2GE\": %d,\n", d.numberOfDiffusionT2GE); + if (d.tensorFileGE > 0) + fprintf(fp, "\t\"TensorFileNumberGE\": %d,\n", d.tensorFileGE); + if (opts.diffCyclingModeGE >= 0) { + fprintf(fp, "\t\"DiffGradientCyclingGE\": \"OVERRIDE\",\n"); // see issue 635 + d.diffCyclingModeGE = opts.diffCyclingModeGE; + } + if (d.diffCyclingModeGE > 0) { + if (d.diffCyclingModeGE == kGE_DIFF_CYCLING_OFF) + fprintf(fp, "\t\"DiffGradientCyclingGE\": \"OFF\",\n"); + if (d.diffCyclingModeGE == kGE_DIFF_CYCLING_ALLTR) + fprintf(fp, "\t\"DiffGradientCyclingGE\": \"ALLTR\",\n"); + if (d.diffCyclingModeGE == kGE_DIFF_CYCLING_2TR) + fprintf(fp, "\t\"DiffGradientCyclingGE\": \"2TR\",\n"); + if (d.diffCyclingModeGE == kGE_DIFF_CYCLING_3TR) + fprintf(fp, "\t\"DiffGradientCyclingGE\": \"3TR\",\n"); + if (d.diffCyclingModeGE == kGE_DIFF_CYCLING_SPOFF) + fprintf(fp, "\t\"DiffGradientCyclingGE\": \"SPOFF\",\n"); + } } #ifdef myReadAsciiCsa if ((d.manufacturer == kMANUFACTURER_SIEMENS) && (d.CSA.SeriesHeader_offset > 0) && (d.CSA.SeriesHeader_length > 0)) { From d64f05f86b57c7549fa1cfe9f81ca42da2ab9fdf Mon Sep 17 00:00:00 2001 From: neurolabusc Date: Wed, 9 Nov 2022 07:45:12 -0500 Subject: [PATCH 21/85] Add VariableFlipAngle detection (https://github.com/rordenlab/dcm2niix/issues/646) --- BIDS/README.md | 1 + console/nii_dicom.cpp | 10 ++++++++-- console/nii_dicom.h | 2 +- console/nii_dicom_batch.cpp | 17 +++++++++++++++-- 4 files changed, 25 insertions(+), 5 deletions(-) diff --git a/BIDS/README.md b/BIDS/README.md index 243a9806..601e8844 100644 --- a/BIDS/README.md +++ b/BIDS/README.md @@ -140,6 +140,7 @@ Fields specific to MRI scans. | EstimatedEffectiveEchoSpacing | s | | D | | EstimatedTotalReadoutTime | s | | D | | FlipAngle | deg | DICOM tag 0018,1314 | B | +| VariableFlipAngleFlag | b | DICOM tag 0018,1315 | D | | ImageOrientationPatientDICOM | | DICOM tag 0020,0037 | D | | ImagingFrequency | MHz | DICOM tag 0018,0084 | D | | InPlanePhaseEncodingDirectionDICOM | | DICOM tag 0018,1312 | D | diff --git a/console/nii_dicom.cpp b/console/nii_dicom.cpp index 1a144e10..f2e048f7 100644 --- a/console/nii_dicom.cpp +++ b/console/nii_dicom.cpp @@ -719,6 +719,7 @@ struct TDICOMdata clear_dicom_data() { strcpy(d.studyDate, ""); strcpy(d.studyTime, ""); strcpy(d.protocolName, ""); + strcpy(d.patientOrient, ""); strcpy(d.seriesDescription, ""); strcpy(d.sequenceName, ""); strcpy(d.scanningSequence, ""); @@ -885,6 +886,7 @@ struct TDICOMdata clear_dicom_data() { d.isHasOverlay = false; d.isPrivateCreatorRemap = false; d.isRealIsPhaseMapHz = false; + d.isVariableFlipAngle = false; d.isQuadruped = false; d.numberOfImagesInGridUIH = 0; d.phaseEncodingRC = '?'; @@ -4283,8 +4285,9 @@ struct TDICOMdata readDICOMx(char *fname, struct TDCMprefs *prefs, struct TDTI4D #define kReceiveCoilName 0x0018 + (0x1250 << 16) // SH //#define kTransmitCoilName 0x0018 + (0x1251 << 16) // SH issue527 #define kAcquisitionMatrix 0x0018 + (0x1310 << 16) //US -#define kFlipAngle 0x0018 + (0x1314 << 16) #define kInPlanePhaseEncodingDirection 0x0018 + (0x1312 << 16) //CS +#define kFlipAngle 0x0018 + (0x1314 << 16) +#define kVariableFlipAngleFlag 0x0018 + (0x1315 << 16) //CS #define kSAR 0x0018 + (0x1316 << 16) //'DS' 'SAR' #define kPatientOrient 0x0018 + (0x5100 << 16) //0018,5100. patient orientation - 'HFS' #define kPulseSequenceName 0x0018 + uint32_t(0x9005 << 16) //'SH' 'YES'/'NO' @@ -5421,7 +5424,7 @@ const uint32_t kEffectiveTE = 0x0018 + (0x9082 << 16); if ((slen < 9) || (strstr(aotTxt, "QUADRUPED") == NULL)) break; d.isQuadruped = true; - printError("Anatomical Orientation Type (0010,2210) is QUADRUPED: rotate coordinates accordingly\n"); + //printError("Anatomical Orientation Type (0010,2210) is QUADRUPED: rotate coordinates accordingly\n"); break; } case kDeidentificationMethod: { //issue 383 @@ -6230,6 +6233,9 @@ const uint32_t kEffectiveTE = 0x0018 + (0x9082 << 16); case kFlipAngle: d.flipAngle = dcmStrFloat(lLength, &buffer[lPos]); break; + case kVariableFlipAngleFlag: + d.isVariableFlipAngle = ('Y' == toupper(buffer[lPos])); //first character is either 'y'es or 'n'o + break; case kRadionuclideHalfLife: d.radionuclideHalfLife = dcmStrFloat(lLength, &buffer[lPos]); break; diff --git a/console/nii_dicom.h b/console/nii_dicom.h index 6425a367..d1bb2ad3 100644 --- a/console/nii_dicom.h +++ b/console/nii_dicom.h @@ -242,7 +242,7 @@ static const uint8_t MAX_NUMBER_OF_DIMENSIONS = 8; char scanOptions[kDICOMStrLarge], institutionAddress[kDICOMStrLarge], imageComments[kDICOMStrLarge]; uint32_t dimensionIndexValues[MAX_NUMBER_OF_DIMENSIONS]; struct TCSAdata CSA; - bool isQuadruped, isRealIsPhaseMapHz, isPrivateCreatorRemap, isHasOverlay, isEPI, isIR, isPartialFourier, isDiffusion, isVectorFromBMatrix, isRawDataStorage, isGrayscaleSoftcopyPresentationState, isStackableSeries, isCoilVaries, isNonParallelSlices, isBVecWorldCoordinates, isSegamiOasis, isXA10A, isScaleOrTEVaries, isScaleVariesEnh, isDerived, isXRay, isMultiEcho, isValid, is3DAcq, is2DAcq, isExplicitVR, isLittleEndian, isPlanarRGB, isSigned, isHasPhase, isHasImaginary, isHasReal, isHasMagnitude,isHasMixed, isFloat, isResampled, isLocalizer; + bool isVariableFlipAngle, isQuadruped, isRealIsPhaseMapHz, isPrivateCreatorRemap, isHasOverlay, isEPI, isIR, isPartialFourier, isDiffusion, isVectorFromBMatrix, isRawDataStorage, isGrayscaleSoftcopyPresentationState, isStackableSeries, isCoilVaries, isNonParallelSlices, isBVecWorldCoordinates, isSegamiOasis, isXA10A, isScaleOrTEVaries, isScaleVariesEnh, isDerived, isXRay, isMultiEcho, isValid, is3DAcq, is2DAcq, isExplicitVR, isLittleEndian, isPlanarRGB, isSigned, isHasPhase, isHasImaginary, isHasReal, isHasMagnitude,isHasMixed, isFloat, isResampled, isLocalizer; char phaseEncodingRC, patientSex; }; struct TDCMprefs { diff --git a/console/nii_dicom_batch.cpp b/console/nii_dicom_batch.cpp index 94b477e4..f6a317de 100644 --- a/console/nii_dicom_batch.cpp +++ b/console/nii_dicom_batch.cpp @@ -1509,6 +1509,8 @@ tse3d: T2*/ fprintf(fp, "\t\"SpoilingType\": \"COMBINED\",\n"); json_Float(fp, "\t\"InversionTime\": %g,\n", d.TI / 1000.0); json_Float(fp, "\t\"FlipAngle\": %g,\n", d.flipAngle); + if (d.isVariableFlipAngle) + json_Bool(fp, "\t\"VariableFlipAngleFlag\": %s,\n", true); // BIDS suggests 0018,9020 but Siemens V-series do not populate this, alternatives are CSA or (0018,0021) CS [SK\MTC\SP] bool interp = false; //2D interpolation float phaseOversampling = 0.0; //n.b. https://neurostars.org/t/getting-missing-ge-information-required-by-bids-for-common-preprocessing/1357/7 @@ -1603,7 +1605,7 @@ tse3d: T2*/ json_FloatNotNan(fp, "\t\"PostLabelDelay\": %g,\n", csaAscii.adFree[2] * (1.0 / 1000000.0)); //usec -> sec json_FloatNotNan(fp, "\t\"NumRFBlocks\": %g,\n", csaAscii.adFree[3]); json_FloatNotNan(fp, "\t\"RFGap\": %g,\n", csaAscii.adFree[4] * (1.0 / 1000000.0)); //usec -> sec - json_FloatNotNan(fp, "\t\"MeanGzx10\": %g,\n", csaAscii.adFree[10]); // mT/m + json_FloatNotNan(fp, "\t\"MeanGzx10\": %g,\n", csaAscii.RepetitionTimeExcitation[10]); // mT/m json_FloatNotNan(fp, "\t\"PhiAdjust\": %g,\n", csaAscii.adFree[11]); // percent } //ASL specific tags - 3D pCASL Danny J.J. Wang http://www.loft-lab.org @@ -6565,6 +6567,10 @@ int saveDcm2NiiCore(int nConvert, struct TDCMsort dcmSort[], struct TDICOMdata d dti4D->frameDuration[0] = -1; dti4D->frameReferenceTime[0] = -1; } + if (strlen(dcmList[indx0].patientOrient) < 3) + printWarning("PatientOrient (0018,5100) not specified (issue 642).\n"); + if (dcmList[indx0].isQuadruped) + printWarning("Anatomical Orientation Type (0010,2210) is QUADRUPED: rotate coordinates accordingly (issue 642)\n"); #ifdef newTilt //see issue 254 if (((nConvert > 1) || (dcmList[indx0].xyzDim[3] > 1)) && ((dcmList[indx0].modality == kMODALITY_CT) || (dcmList[indx0].isXRay) || (dcmList[indx0].gantryTilt > 0.0))) { //issue372: enhanced DICOMs can also have gantry tilt dcmList[indx0].gantryTilt = computeGantryTiltPrecise(dcmList[indx0], dcmList[indxEnd], opts.isVerbose); @@ -7685,6 +7691,13 @@ bool isSameSet(struct TDICOMdata d1, struct TDICOMdata d2, struct TDCMopts *opts warnings->echoVaries = true; return false; } + if (!(isSameFloat(d1.flipAngle, d2.flipAngle))) { + if (!warnings->echoVaries) + printMessage("Slices not stacked: flip angle varies (%g, %g, issue 646).\n", d1.TR, d2.TR); + *isMultiEcho = true; + warnings->echoVaries = true; + return false; + } //if ((d1.TE != d2.TE) || (d1.echoNum != d2.echoNum)) { if ((!(isSameFloat(d1.TE, d2.TE))) || (d1.echoNum != d2.echoNum)) { if ((!warnings->echoVaries) && (d1.isXRay)) //for CT/XRay we check DICOM tag 0018,1152 (XRayExposure) @@ -8906,7 +8919,7 @@ void readIniFile(struct TDCMopts *opts, const char *argv[]) { FILE *fp = fopen(opts->optsname, "r"); if (fp == NULL) return; - char Setting[20], Value[255]; + char Setting[255], Value[255]; //while ( fscanf(fp, "%[^=]=%s\n", Setting, Value) == 2 ) { //while ( fscanf(fp, "%[^=]=%s\n", Setting, Value) == 2 ) { while (fscanf(fp, "%[^=]=%[^\n]\n", Setting, Value) == 2) { From 6bc10bb30412b4605066406c31abd14e1a7a6df6 Mon Sep 17 00:00:00 2001 From: neurolabusc Date: Wed, 9 Nov 2022 08:11:10 -0500 Subject: [PATCH 22/85] Fix typo --- console/nii_dicom_batch.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/console/nii_dicom_batch.cpp b/console/nii_dicom_batch.cpp index f6a317de..b07aac4b 100644 --- a/console/nii_dicom_batch.cpp +++ b/console/nii_dicom_batch.cpp @@ -1605,7 +1605,7 @@ tse3d: T2*/ json_FloatNotNan(fp, "\t\"PostLabelDelay\": %g,\n", csaAscii.adFree[2] * (1.0 / 1000000.0)); //usec -> sec json_FloatNotNan(fp, "\t\"NumRFBlocks\": %g,\n", csaAscii.adFree[3]); json_FloatNotNan(fp, "\t\"RFGap\": %g,\n", csaAscii.adFree[4] * (1.0 / 1000000.0)); //usec -> sec - json_FloatNotNan(fp, "\t\"MeanGzx10\": %g,\n", csaAscii.RepetitionTimeExcitation[10]); // mT/m + json_FloatNotNan(fp, "\t\"MeanGzx10\": %g,\n", csaAscii.adFree[10]); json_FloatNotNan(fp, "\t\"PhiAdjust\": %g,\n", csaAscii.adFree[11]); // percent } //ASL specific tags - 3D pCASL Danny J.J. Wang http://www.loft-lab.org From 8f82dc171683301ff5e34b74c05668167f081d15 Mon Sep 17 00:00:00 2001 From: neurolabusc Date: Sun, 20 Nov 2022 06:57:46 -0500 Subject: [PATCH 23/85] Find pigz.exe Find pigz.exe if not in current working directory for Windows [issue 650](https://github.com/rordenlab/dcm2niix/issues/650) --- COMPILE.md | 42 +++++++++++++++++-------------------- console/nii_dicom.cpp | 8 +++---- console/nii_dicom.h | 2 +- console/nii_dicom_batch.cpp | 33 +++++++++++++++-------------- console/windows.bat | 1 + 5 files changed, 42 insertions(+), 44 deletions(-) create mode 100644 console/windows.bat diff --git a/COMPILE.md b/COMPILE.md index b8bcc99b..46374a02 100644 --- a/COMPILE.md +++ b/COMPILE.md @@ -13,7 +13,7 @@ The text below generally describes how to build dcm2niix using the [GCC](https:/ You can also build the software without C-make. The easiest way to do this is to run the function "make" from the "console" folder. Note that this only creates the default version of dcm2niix, not the optional batch version described above. The make command simply calls the g++ compiler, and if you want you can tune this for your build. In essence, the make function simply calls ``` -g++ -dead_strip -O3 -I. main_console.cpp nii_dicom.cpp jpg_0XC3.cpp ujpeg.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp nii_foreign.cpp -o dcm2niix -DmyDisableOpenJPEG +g++ -O3 -I. main_console.cpp nii_dicom.cpp jpg_0XC3.cpp ujpeg.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp nii_foreign.cpp -o dcm2niix -DmyDisableOpenJPEG ``` The following sub-sections list how you can modify this basic recipe for your needs. @@ -31,7 +31,7 @@ cmake -DUSE_OPENJPEG=ON -DCMAKE_CXX_FLAGS=-g .. && make If we have zlib, we can use it (-lz) and disable [miniz](https://code.google.com/p/miniz/) (-myDisableMiniZ) ``` -g++ -O3 -DmyDisableOpenJPEG -I. main_console.cpp nii_dicom.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp jpg_0XC3.cpp ujpeg.cpp nii_foreign.cpp -dead_strip -o dcm2niix -lz -DmyDisableMiniZ +g++ -O3 -DmyDisableOpenJPEG -I. main_console.cpp nii_dicom.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp jpg_0XC3.cpp ujpeg.cpp nii_foreign.cpp -o dcm2niix -lz -DmyDisableMiniZ ``` ##### MINGW BUILD @@ -47,7 +47,7 @@ g++ -O3 -s -DmyDisableOpenJPEG -DmyDisableZLib -I. main_console.cpp nii_dicom.cp DICOM images can be stored as either raw data or compressed using one of many formats as described by the [transfer syntaxes](https://www.nitrc.org/plugins/mwiki/index.php/dcm2nii:MainPage#Transfer_Syntaxes_and_Compressed_Images). One of the compressed formats is the lossy classic JPEG format (which is separate from and predates the lossy JPEG 2000 format). This software comes with the [NanoJPEG](http://keyj.emphy.de/nanojpeg/) library to handle these images. However, you can use the `myDisableClassicJPEG` compiler switch to remove this dependency. The resulting executable will be smaller but will not be able to convert images stored with this format. ``` -g++ -dead_strip -O3 -I. main_console.cpp nii_dicom.cpp jpg_0XC3.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp nii_foreign.cpp -o dcm2niix -DmyDisableClassicJPEG -DmyDisableOpenJPEG +g++ -O3 -I. main_console.cpp nii_dicom.cpp jpg_0XC3.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp nii_foreign.cpp -o dcm2niix -DmyDisableClassicJPEG -DmyDisableOpenJPEG ``` ##### USING LIBJPEG-TURBO TO DECODE CLASSIC JPEG @@ -55,18 +55,18 @@ g++ -dead_strip -O3 -I. main_console.cpp nii_dicom.cpp jpg_0XC3.cpp nifti1_io_co By default, classic JPEG images will be decoded using the [compact NanoJPEG decoder](http://keyj.emphy.de/nanojpeg/). However, the compiler directive `myTurboJPEG` will create an executable based on the [libjpeg-turbo](http://www.libjpeg-turbo.org) library. This library is a faster decoder and is the standard for many Linux distributions. On the other hand, the lossy classic JPEG is rarely used for DICOM images, so this compilation has extra dependencies and can result in a larger executable size (for static builds). ``` -g++ -dead_strip -O3 -I. main_console.cpp nii_dicom.cpp jpg_0XC3.cpp ujpeg.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp nii_foreign.cpp -o dcm2niix -DmyDisableOpenJPEG -DmyTurboJPEG -I/opt/libjpeg-turbo/include /opt/libjpeg-turbo/lib/libturbojpeg.a +g++ -O3 -I. main_console.cpp nii_dicom.cpp jpg_0XC3.cpp ujpeg.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp nii_foreign.cpp -o dcm2niix -DmyDisableOpenJPEG -DmyTurboJPEG -I/opt/libjpeg-turbo/include /opt/libjpeg-turbo/lib/libturbojpeg.a ``` ##### JPEG-LS BUILD You can compile dcm2niix to convert DICOM images compressed with the [JPEG-LS](https://en.wikipedia.org/wiki/JPEG_2000) [transfer syntaxes 1.2.840.10008.1.2.4.80 and 1.2.840.10008.1.2.4.81](https://www.nitrc.org/plugins/mwiki/index.php/dcm2nii:MainPage#Transfer_Syntaxes_and_Compressed_Images). Decoding this format is handled by the [CharLS library](https://github.com/team-charls/charls), which is included with dcm2niix in the `charls` folder. The included code was downloaded from the CharLS website on 6 June 2018. To enable support you will need to include the `myEnableJPEGLS` compiler flag as well as a few file sin the `charls` folder. Therefore, a minimal compile (with just JPEG-LS and without JPEG2000) should look like this: -`g++ -I. -DmyEnableJPEGLS charls/jpegls.cpp charls/jpegmarkersegment.cpp charls/interface.cpp charls/jpegstreamwriter.cpp charls/jpegstreamreader.cpp main_console.cpp nii_foreign.cpp nii_dicom.cpp jpg_0XC3.cpp ujpeg.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp -o dcm2niix -DmyDisableOpenJPEG` - -Alternatively, you can decompress an image in JPEG-LS to an uncompressed DICOM using [gdcmconv](https://github.com/malaterre/GDCM)(e.g. `gdcmconv -w 3691459 3691459.dcm`). Or you can use gdcmconv compress a DICOM to JPEG-LS (e.g. `gdcmconv -L 3691459 3691459.dcm`). Alternatively, the DCMTK tool [dcmcjpls](https://support.dcmtk.org/docs/dcmcjpls.html) provides JPEG-LS support. - +``` +g++ -I. -DmyEnableJPEGLS charls/jpegls.cpp charls/jpegmarkersegment.cpp charls/interface.cpp charls/jpegstreamwriter.cpp charls/jpegstreamreader.cpp main_console.cpp nii_foreign.cpp nii_dicom.cpp jpg_0XC3.cpp ujpeg.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp -o dcm2niix -DmyDisableOpenJPEG +``` +Alternatively, you can decompress an image in JPEG-LS to an uncompressed DICOM using [gdcmconv](https://github.com/malaterre/GDCM) (e.g. `gdcmconv -w 3691459 3691459.dcm`). Or you can use gdcmconv compress a DICOM to JPEG-LS (e.g. `gdcmconv -L 3691459 3691459.dcm`). Alternatively, the DCMTK tool [dcmcjpls](https://support.dcmtk.org/docs/dcmcjpls.html) provides JPEG-LS support. ##### JPEG2000 BUILD @@ -81,14 +81,14 @@ You can build dcm2niix with JPEG2000 decompression support using OpenJPEG 2.1.0. You should then be able to run: ``` -g++ -O3 -dead_strip -I. main_console.cpp nii_dicom.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp jpg_0XC3.cpp ujpeg.cpp nii_foreign.cpp -o dcm2niix -lopenjp2 +g++ -O3 -I. main_console.cpp nii_dicom.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp jpg_0XC3.cpp ujpeg.cpp nii_foreign.cpp -o dcm2niix -lopenjp2 ``` But in my experience this works best if you explicitly tell the software how to find the libraries, so your compile will probably look like one of these options: ``` #for MacOS -g++ -O3 -dead_strip -I. main_console.cpp nii_dicom.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp jpg_0XC3.cpp ujpeg.cpp nii_foreign.cpp -o dcm2niix -I/usr/local/include/openjpeg-2.1 /usr/local/lib/libopenjp2.a +g++ -O3 -I. main_console.cpp nii_dicom.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp jpg_0XC3.cpp ujpeg.cpp nii_foreign.cpp -o dcm2niix -I/usr/local/include/openjpeg-2.1 /usr/local/lib/libopenjp2.a ``` ``` #For older Linux @@ -107,27 +107,23 @@ g++ -O3 -DmyDisableOpenJPEG -DmyEnableJasper -I. main_console.cpp nii_dicom.cpp ##### VISUAL STUDIO BUILD -This software can be compiled with VisualStudio 2015. This example assumes the compiler is in your path. +This software can be compiled with [Microsoft's Visual Studio C compiler](http://landinghub.visualstudio.com/visual-cpp-build-tools). This example assumes the compiler is in your path (For Windows 11 you can run the `x64 Native Tools Command Prompt`). + +Crucially, you will want to [set a large stack allocation](https://learn.microsoft.com/en-us/cpp/build/reference/stack-stack-allocations?view=msvc-170). This allows dcm2niix to convert a huge number of DICOM images in a single pass (which requires a large amount of memory). ``` -vcvarsall amd64 -cl /EHsc main_console.cpp nii_dicom.cpp jpg_0XC3.cpp ujpeg.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp nii_foreign.cpp -DmyDisableOpenJPEG /o dcm2niix +cl /wd4018 /wd4068 /wd4101 /wd4244 /wd4267 /wd4305 /wd4308 /wd4334 /wd4800 /wd4819 /wd4996 base64.cpp cJSON.cpp main_console.cpp nii_foreign.cpp nii_dicom.cpp jpg_0XC3.cpp ujpeg.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp /Fe:dcm2niix.exe -DmyDisableOpenJPEG /link /STACK:8388608 ``` -##### OSX BUILD WITH BOTH 32 AND 64-BIT SUPPORT +##### MacOS BUILD UNIVERSAl BINARIES SUPPORT -Building command line version universal binary from OSX 64 bit system: - This requires a C compiler. With a terminal, change directory to the 'conosle' folder and run the following: +On MacOS you can create Universal binaries, that bundle optimized code for different architectures. For example, supporting PowerPC, Intel and Apple Silicon (e.g. M1) CPUs. Further, you can optimize Intel code for either 32-bit or 64-bit operation. More details on Universal binaries and notarization is provided [here](https://github.com/neurolabusc/NotarizeC). -``` -g++ -O3 -DmyDisableOpenJPEG -I. main_console.cpp nii_dicom.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp jpg_0XC3.cpp ujpeg.cpp nii_foreign.cpp -dead_strip -arch i386 -o dcm2niix32 -``` - -``` -g++ -O3 -DmyDisableOpenJPEG -I. main_console.cpp nii_dicom.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp jpg_0XC3.cpp ujpeg.cpp nii_foreign.cpp -dead_strip -o dcm2niix64 -``` +Here is a simple example of creating independent 32-bit and 64-bit executables and then using `lipo` to create a single universal executable: ``` +g++ -O3 -DmyDisableOpenJPEG -I. main_console.cpp nii_dicom.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp jpg_0XC3.cpp ujpeg.cpp nii_foreign.cpp -arch i386 -o dcm2niix32 +g++ -O3 -DmyDisableOpenJPEG -I. main_console.cpp nii_dicom.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp jpg_0XC3.cpp ujpeg.cpp nii_foreign.cpp -o dcm2niix64 lipo -create dcm2niix32 dcm2niix64 -o dcm2niix ``` diff --git a/console/nii_dicom.cpp b/console/nii_dicom.cpp index f2e048f7..3cc73801 100644 --- a/console/nii_dicom.cpp +++ b/console/nii_dicom.cpp @@ -5821,8 +5821,8 @@ const uint32_t kEffectiveTE = 0x0018 + (0x9082 << 16); } //if not first slice in file set_isAtFirstPatientPosition_tvd(&volDiffusion, isAtFirstPatientPosition); //if (isAtFirstPatientPosition) numFirstPatientPosition++; - if (isVerbose > 0) //verbose > 1 will report full DICOM tag - printMessage(" Patient Position 0020,0032 (#,@,X,Y,Z)\t%d\t%ld\t%g\t%g\t%g\n", patientPositionNum, lPos, patientPosition[1], patientPosition[2], patientPosition[3]); + if (isVerbose > 1) //verbose > 1 will report full DICOM tag + printMessage(" Patient Position 0020,0032 (#,@,X,Y,Z)\t%d\t%zu\t%g\t%g\t%g\n", patientPositionNum, lPos, patientPosition[1], patientPosition[2], patientPosition[3]); if ((isOrient) && (nSliceMM < kMaxSlice2D)) { vec3 pos = setVec3(patientPosition[1], patientPosition[2], patientPosition[3]); sliceMM[nSliceMM] = dotProduct(pos, sliceV); @@ -6852,7 +6852,7 @@ const uint32_t kEffectiveTE = 0x0018 + (0x9082 << 16); int isVerboseX = isVerbose; //for debugging only - in standard release we will enable user defined "isVerbose" //int isVerboseX = 2; if (isVerboseX > 1) - printMessage(" UserDefineDataGE file offset/length %ld %u\n", lFileOffset + lPos, lLength); + printMessage(" UserDefineDataGE file offset/length %zu %u\n", lFileOffset + lPos, lLength); if (lLength < 916) { //minimum size is hdr_offset=0, read 0x0394 printMessage(" GE header too small to be valid (A)\n"); break; @@ -7165,7 +7165,7 @@ const uint32_t kEffectiveTE = 0x0018 + (0x9082 << 16); // this section will report very little for implicit data //if (d.isHasReal) printf("r");else printf("m"); char str[kDICOMStr]; - sprintf(str, "%*c%04x,%04x %u@%ld ", sqDepth + 1, ' ', groupElement & 65535, groupElement >> 16, lLength, lFileOffset + lPos); + sprintf(str, "%*c%04x,%04x %u@%zu ", sqDepth + 1, ' ', groupElement & 65535, groupElement >> 16, lLength, lFileOffset + lPos); bool isStr = false; if (d.isExplicitVR) { //sprintf(str, "%s%c%c ", str, vr[0], vr[1]); diff --git a/console/nii_dicom.h b/console/nii_dicom.h index d1bb2ad3..797d843c 100644 --- a/console/nii_dicom.h +++ b/console/nii_dicom.h @@ -50,7 +50,7 @@ extern "C" { #define kCPUsuf " " //unknown CPU #endif -#define kDCMdate "v1.0.20221102" +#define kDCMdate "v1.0.20221120" #define kDCMvers kDCMdate " " kJP2suf kLSsuf kCCsuf kCPUsuf static const int kMaxEPI3D = 1024; //maximum number of EPI images in Siemens Mosaic diff --git a/console/nii_dicom_batch.cpp b/console/nii_dicom_batch.cpp index b07aac4b..02afbc00 100644 --- a/console/nii_dicom_batch.cpp +++ b/console/nii_dicom_batch.cpp @@ -8244,8 +8244,7 @@ int nii_loadDirCore(char *indir, struct TDCMopts *opts) { start = clock(); #endif if (opts->isProgress) - progressPct = reportProgress(progressPct, kStage1Frac); //proportion correct, 0..100 - // struct TDICOMdata dcmList [nameList.numItems]; //<- this exhausts the stack for large arrays + progressPct = reportProgress(progressPct, kStage1Frac); //proportion correct, 0..100 // struct TDICOMdata dcmList [nameList.numItems]; //<- this exhausts the stack for large arrays struct TDICOMdata *dcmList = (struct TDICOMdata *)malloc(nameList.numItems * sizeof(struct TDICOMdata)); struct TDTI4D *dti4D = (struct TDTI4D *)malloc(sizeof(struct TDTI4D)); struct TDCMprefs prefs; @@ -8708,27 +8707,29 @@ int findpathof(char *pth, const char *exe) { void readFindPigz(struct TDCMopts *opts, const char *argv[]) { #if defined(_WIN64) || defined(_WIN32) strcpy(opts->pigzname, "pigz.exe"); + if (is_exe(opts->pigzname)) + return; if (!is_exe(opts->pigzname)) { -#if defined(__APPLE__) -#ifdef myDisableZLib - printMessage("Compression requires %s in the same folder as the executable http://macappstore.org/pigz/\n", opts->pigzname); -#else //myUseZLib - if (opts->isVerbose > 0) - printMessage("Compression will be faster with %s in the same folder as the executable http://macappstore.org/pigz/\n", opts->pigzname); -#endif - strcpy(opts->pigzname, ""); -#else + char exepth[PATH_MAX]; + strcpy(exepth, argv[0]); + dropFilenameFromPath(exepth); //, opts.pigzname); + char appendChar[2] = {"a"}; + appendChar[0] = kPathSeparator; + strcat(exepth, appendChar); + strcat(exepth, opts->pigzname); + strcpy(opts->pigzname, exepth); + } + if (is_exe(opts->pigzname)) + return; #ifdef myDisableZLib printMessage("Compression requires %s in the same folder as the executable\n", opts->pigzname); #else //myUseZLib if (opts->isVerbose > 0) printMessage("Compression will be faster with %s in the same folder as the executable\n", opts->pigzname); #endif - strcpy(opts->pigzname, ""); -#endif - } else - strcpy(opts->pigzname, ".\\pigz"); //drop -#else + strcpy(opts->pigzname, ""); + return; +#else //if windows else linux char str[PATH_MAX]; //possible pigz names const char *names[] = { diff --git a/console/windows.bat b/console/windows.bat new file mode 100644 index 00000000..28c9689c --- /dev/null +++ b/console/windows.bat @@ -0,0 +1 @@ +cl /wd4018 /wd4068 /wd4101 /wd4244 /wd4267 /wd4305 /wd4308 /wd4334 /wd4800 /wd4819 /wd4996 base64.cpp cJSON.cpp main_console.cpp nii_foreign.cpp nii_dicom.cpp jpg_0XC3.cpp ujpeg.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp /Fe:dcm2niix.exe -DmyDisableOpenJPEG /link /STACK:8388608 \ No newline at end of file From be2f6c54c2b00e2f479ba21354ae20dac82a07e0 Mon Sep 17 00:00:00 2001 From: neurolabusc Date: Mon, 21 Nov 2022 09:02:18 -0500 Subject: [PATCH 24/85] Find Windows path Issue 650 (https://github.com/rordenlab/dcm2niix/issues/650) --- console/nii_dicom.h | 2 +- console/nii_dicom_batch.cpp | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/console/nii_dicom.h b/console/nii_dicom.h index 797d843c..ac6a6e72 100644 --- a/console/nii_dicom.h +++ b/console/nii_dicom.h @@ -50,7 +50,7 @@ extern "C" { #define kCPUsuf " " //unknown CPU #endif -#define kDCMdate "v1.0.20221120" +#define kDCMdate "v1.0.20221121" #define kDCMvers kDCMdate " " kJP2suf kLSsuf kCCsuf kCPUsuf static const int kMaxEPI3D = 1024; //maximum number of EPI images in Siemens Mosaic diff --git a/console/nii_dicom_batch.cpp b/console/nii_dicom_batch.cpp index 02afbc00..660a28c3 100644 --- a/console/nii_dicom_batch.cpp +++ b/console/nii_dicom_batch.cpp @@ -8721,6 +8721,21 @@ void readFindPigz(struct TDCMopts *opts, const char *argv[]) { } if (is_exe(opts->pigzname)) return; + HMODULE hModule = GetModuleHandle(NULL); + if (hModule != NULL) { + // https://stackoverflow.com/questions/1528298/get-path-of-executable + char exepth[PATH_MAX]; + GetModuleFileName(hModule, exepth, (sizeof(exepth))); + dropFilenameFromPath(exepth); //, opts.pigzname); + char appendChar[2] = {"a"}; + appendChar[0] = kPathSeparator; + strcat(exepth, appendChar); + strcpy(opts->pigzname, "pigz.exe"); + strcat(exepth, opts->pigzname); + strcpy(opts->pigzname, exepth); + } + if (is_exe(opts->pigzname)) + return; #ifdef myDisableZLib printMessage("Compression requires %s in the same folder as the executable\n", opts->pigzname); #else //myUseZLib From c269a1adc81d79e6b3cfe4ab7a934aaad39f0c5d Mon Sep 17 00:00:00 2001 From: neurolabusc Date: Sun, 27 Nov 2022 09:46:37 -0500 Subject: [PATCH 25/85] Change SeriesInstanceUID precedence SeriesInstanceUID precedence (https://github.com/rordenlab/dcm2niix/issues/655) --- console/nii_dicom.cpp | 4 +++- console/nii_dicom.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/console/nii_dicom.cpp b/console/nii_dicom.cpp index 3cc73801..f6d9355d 100644 --- a/console/nii_dicom.cpp +++ b/console/nii_dicom.cpp @@ -4536,6 +4536,7 @@ const uint32_t kEffectiveTE = 0x0018 + (0x9082 << 16); int philMRImageDiffBValueNumber = 0; int philMRImageDiffVolumeNumber = -1; int sqDepth = 0; + int seriesInstanceUIDsqDepth = 65535; //issue655 int acquisitionTimesGE_UIH = 0; int sqDepth00189114 = -1; bool hasDwiDirectionality = false; @@ -5788,8 +5789,9 @@ const uint32_t kEffectiveTE = 0x0018 + (0x9082 << 16); dcmStr(lLength, &buffer[lPos], d.studyInstanceUID); break; case kSeriesInstanceUID: // 0020,000E + if (sqDepth > seriesInstanceUIDsqDepth) break; //issue655 + seriesInstanceUIDsqDepth = sqDepth; dcmStr(lLength, &buffer[lPos], d.seriesInstanceUID); - //printMessage(">>%s\n", d.seriesInstanceUID); d.seriesUidCrc = mz_crc32X((unsigned char *)&d.seriesInstanceUID, strlen(d.seriesInstanceUID)); break; case kImagePositionPatient: { diff --git a/console/nii_dicom.h b/console/nii_dicom.h index ac6a6e72..78355d48 100644 --- a/console/nii_dicom.h +++ b/console/nii_dicom.h @@ -50,7 +50,7 @@ extern "C" { #define kCPUsuf " " //unknown CPU #endif -#define kDCMdate "v1.0.20221121" +#define kDCMdate "v1.0.20221127" #define kDCMvers kDCMdate " " kJP2suf kLSsuf kCCsuf kCPUsuf static const int kMaxEPI3D = 1024; //maximum number of EPI images in Siemens Mosaic From a0a9b037153b787dd9d2e4c5f596193b74ee1256 Mon Sep 17 00:00:00 2001 From: neurolabusc Date: Mon, 5 Dec 2022 09:52:36 -0500 Subject: [PATCH 26/85] bval for few volumes More permissive bval creation (https://github.com/rordenlab/dcm2niix/issues/657) --- console/nii_dicom_batch.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/console/nii_dicom_batch.cpp b/console/nii_dicom_batch.cpp index 660a28c3..a623c510 100644 --- a/console/nii_dicom_batch.cpp +++ b/console/nii_dicom_batch.cpp @@ -2266,10 +2266,10 @@ int *nii_saveDTI(char pathoutname[], int nConvert, struct TDCMsort dcmSort[], st } if (numDti < 1) return NULL; - if ((numDti < 3) && (nConvert < 3)) + if ((numDti < 2) && (nConvert < 2)) return NULL; TDTI *vx = NULL; - if (numDti > 2) { + if (numDti > 1) { vx = (TDTI *)malloc(numDti * sizeof(TDTI)); for (int i = 0; i < numDti; i++) //for each direction for (int v = 0; v < 4; v++) //for each vector+B-value From efe2c82f376627db927960de1ca406172a7a3a5b Mon Sep 17 00:00:00 2001 From: neurolabusc Date: Wed, 7 Dec 2022 10:29:27 -0500 Subject: [PATCH 27/85] Update README.md Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index a2217c13..877f57b2 100644 --- a/README.md +++ b/README.md @@ -147,9 +147,11 @@ The following tools exploit dcm2niix - [Brain imAgiNg Analysis iN Arcana (Banana)](https://pypi.org/project/banana/) is a collection of brain imaging analysis workflows, it uses dcm2niix for format conversions. - [brainnetome DiffusionKit](http://diffusion.brainnetome.org/en/latest/) uses dcm2niix to convert images. - [BraTS-Preprocessor](https://neuronflow.github.io/BraTS-Preprocessor/) uses dcm2niix to import files for [Brain Tumor Segmentation](https://www.frontiersin.org/articles/10.3389/fnins.2020.00125/full). + - [CardioNIfTI](https://github.com/UK-Digital-Heart-Project/CardioNIfTI) processes cardiac MR DICOM datasets and converts them to NIfTI. - [clinica](https://github.com/aramis-lab/clinica) is a software platform for clinical neuroimaging studies that uses dcm2niix to convert DICOM images. - [clpipe](https://github.com/cohenlabUNC/clpipe) uses dcm2bids for DICOM import. - [conversion](https://github.com/pnlbwh/conversion) is a Python library that can convert dcm2niix created NIfTI files to the popular NRRD format (including DWI gradient tables). Note, recent versions of dcm2niix can directly convert DICOM images to NRRD. + - [d2b-dcm2niix](https://github.com/d2b-dev/d2b-dcm2niix) data to BIDS wrapper. - [DAC2BIDS](https://github.com/dangom/dac2bids) uses dcm2niibatch to create [BIDS](http://bids.neuroimaging.io/) datasets. - [Data2Bids](https://github.com/SIMEXP/Data2Bids) converts non-DICOM images with associated JSON files to BIDS. While this tool does not require dcm2niix, it can leverage dcm2niix output similar to niix2bids. - [Dcm2Bids](https://github.com/cbedetti/Dcm2Bids) uses dcm2niix to create [BIDS](http://bids.neuroimaging.io/) datasets. Here is a [tutorial](https://andysbrainbook.readthedocs.io/en/latest/OpenScience/OS/BIDS_Overview.html) describing usage. @@ -179,6 +181,7 @@ The following tools exploit dcm2niix - [LEAD-DBS](http://www.lead-dbs.org/) uses dcm2niix for [DICOM import](https://github.com/leaddbs/leaddbs/blob/master/ea_dicom_import.m). - [lin4neuro](http://www.lin4neuro.net/lin4neuro/18.04bionic/vm/) releases such as the English l4n-18.04.4-amd64-20200801-en.ova include MRIcroGL and dcm2niix pre-installed. This allows user with VirtualBox or VMWarePlayer to use these tools (and many other neuroimaging tools) in a graphical virtual machine. - [MRIcroGL](https://github.com/neurolabusc/MRIcroGL) is available for MacOS, Linux and Windows and provides a graphical interface for dcm2niix. You can get compiled copies from the [MRIcroGL NITRC web site](https://www.nitrc.org/projects/mricrogl/). + - [MrPyConvert](https://github.com/Jolinda/mrpyconvert) Python library dicom to bids conversion. - [neuro_docker](https://github.com/Neurita/neuro_docker) includes dcm2niix as part of a single, static Dockerfile. - [NeuroDebian](http://neuro.debian.net/pkgs/dcm2niix.html) provides up-to-date version of dcm2niix for Debian-based systems. - [neurodocker](https://github.com/kaczmarj/neurodocker) includes dcm2niix as a lean, minimal install Dockerfile. From 90de607c923edd4095783dc8e4f154a7c7a2eeed Mon Sep 17 00:00:00 2001 From: neurolabusc Date: Thu, 8 Dec 2022 09:05:32 -0500 Subject: [PATCH 28/85] Infer numberOfDynamicScans from TemporalPosition For Philips files where 2001,1081 was stripped by an anonymization tool --- console/nii_dicom.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/console/nii_dicom.cpp b/console/nii_dicom.cpp index f6d9355d..ecda6527 100644 --- a/console/nii_dicom.cpp +++ b/console/nii_dicom.cpp @@ -4551,6 +4551,7 @@ const uint32_t kEffectiveTE = 0x0018 + (0x9082 << 16); size_t dimensionIndexPointerCounter = 0; int maxInStackPositionNumber = 0; int temporalPositionIndex = 0; + int minTemporalPositionIndex = 65535; int maxTemporalPositionIndex = 0; //int temporalPositionIdentifier = 0; int locationsInAcquisitionPhilips = 0; @@ -5877,6 +5878,8 @@ const uint32_t kEffectiveTE = 0x0018 + (0x9082 << 16); temporalPositionIndex = dcmInt(4, &buffer[lPos], d.isLittleEndian); if (temporalPositionIndex > maxTemporalPositionIndex) maxTemporalPositionIndex = temporalPositionIndex; + if (temporalPositionIndex < minTemporalPositionIndex) + minTemporalPositionIndex = temporalPositionIndex; break; case kDimensionIndexPointer: dimensionIndexPointer[dimensionIndexPointerCounter++] = dcmAttributeTag(&buffer[lPos], d.isLittleEndian); @@ -7413,6 +7416,8 @@ const uint32_t kEffectiveTE = 0x0018 + (0x9082 << 16); strcpy(d.protocolName, d.sequenceName); //protocolName (0018,1030) optional, sequence name (0018,0024) is not a good substitute for Siemens as it can vary per volume: *ep_b0 *ep_b1000#1, *ep_b1000#2, etc https://www.nitrc.org/forum/forum.php?thread_id=8771&forum_id=4703 if (numberOfFrames == 0) numberOfFrames = d.xyzDim[3]; + if ((numberOfDynamicScans < 1) && (maxTemporalPositionIndex > minTemporalPositionIndex)) + numberOfDynamicScans = maxTemporalPositionIndex - minTemporalPositionIndex + 1; if ((locationsInAcquisitionPhilips > 0) && ((d.xyzDim[3] % locationsInAcquisitionPhilips) == 0)) { d.xyzDim[4] = d.xyzDim[3] / locationsInAcquisitionPhilips; d.xyzDim[3] = locationsInAcquisitionPhilips; From 9340601bae42b90f1543912035b540f5c84dfab6 Mon Sep 17 00:00:00 2001 From: neurolabusc Date: Sat, 17 Dec 2022 09:34:19 -0500 Subject: [PATCH 29/85] Huge PAR/REC files Handle huge PAR/REC files (https://github.com/rordenlab/dcm2niix/issues/659) --- console/CMakeLists.txt | 514 ++++++++++++++++++++--------------------- console/nii_dicom.cpp | 100 ++++++-- console/nii_dicom.h | 2 +- console/windows.bat | 5 +- 4 files changed, 342 insertions(+), 279 deletions(-) diff --git a/console/CMakeLists.txt b/console/CMakeLists.txt index 0dcfe303..c48c9338 100644 --- a/console/CMakeLists.txt +++ b/console/CMakeLists.txt @@ -1,257 +1,257 @@ -cmake_minimum_required(VERSION 2.8.11) - -project(console) - -# Option Choose whether to use static runtime -include(ucm.cmake) -option(USE_STATIC_RUNTIME "Use static runtime" ON) -if(USE_STATIC_RUNTIME) - ucm_set_runtime(STATIC) -else() - ucm_set_runtime(DYNAMIC) -endif() - -# Basic CMake build settings -if(NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE "Release" CACHE STRING - "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE) - set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug;Release;RelWithDebInfo;MinSizeRel") -endif() - -if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") - # using Clang - add_definitions(-fno-caret-diagnostics) - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-dead_strip") -elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU") - # using GCC - if(NOT (${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 7.1.0)) - add_definitions(-Wno-format-overflow) # available since GCC 7.1.0 - endif() - if(NOT (${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 4.5.0)) - add_definitions(-Wno-unused-result) # available since GCC 4.5.0 - endif() - if(NOT (${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 4.8.0)) - add_definitions(-fno-diagnostics-show-caret) # available since GCC 4.8.0 - endif() -elseif(MSVC) - # using Visual Studio C++ - add_definitions(-D_CRT_SECURE_NO_DEPRECATE) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4018") # '<': signed/unsigned mismatch - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4068") # unknown pragma - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4101") # unreferenced local variable - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4244") # 'initializing': conversion from 'double' to 'int', possible loss of data - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4267") # 'initializing': conversion from 'size_t' to 'int', possible loss of data - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4305") # 'argument': truncation from 'double' to 'float' - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4308") # negative integral constant converted to unsigned type - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4334") # '<<': result of 32-bit shift implicitly converted to 64 bits - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4800") # 'uint32_t' : forcing value to bool 'true' or 'false' - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4819") # The file contains a character that cannot be represented in the current code page - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4996") # 'access': The POSIX name for this item is deprecated - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /STACK:8388608") # set "Stack Reserve Size" to 8MB (default value is 1MB) -endif() - -# Compiler dependent flags -include (CheckCXXCompilerFlag) -if(UNIX) - check_cxx_compiler_flag(-march=armv8-a+crc ARM_CRC) - if(ARM_CRC) - # wrong answer for Apple Silicon: check_cxx_compiler_flag(-msse2 HAS_SSE2) - else() - check_cxx_compiler_flag(-msse2 HAS_SSE2) - if(HAS_SSE2) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2 -mfpmath=sse") - endif() - endif() -endif() - -set(PROGRAMS dcm2niix) - -option(USE_TURBOJPEG "Use TurboJPEG to decode classic JPEG" OFF) -option(USE_JASPER "Build with JPEG2000 support using Jasper" OFF) -option(USE_OPENJPEG "Build with JPEG2000 support using OpenJPEG" OFF) -option(USE_JPEGLS "Build with JPEG-LS support using CharLS" OFF) - -option(BATCH_VERSION "Build dcm2niibatch for multiple conversions" OFF) - -option(BUILD_DCM2NIIXFSLIB "Build libdcm2niixfs.a" OFF) - -if(USE_OPENJPEG OR USE_TURBOJPEG OR USE_JASPER) - message("-- Set BUILD_DCM2NIIXFSLIB to OFF since USE_TURBOJPEG/USE_JASPER/USE_OPENJPEG is ON.") - set(BUILD_DCM2NIIXFSLIB OFF CACHE BOOL "Build libdcm2niixfs.a" FORCE) -endif() - -set(DCM2NIIX_SRCS - main_console.cpp - nii_dicom.cpp - jpg_0XC3.cpp - ujpeg.cpp - nifti1_io_core.cpp - nii_foreign.cpp - nii_ortho.cpp - nii_dicom_batch.cpp) - - -option(USE_JNIfTI "Build with JNIfTI support" ON) -if(USE_JNIFTI) - add_definitions(-DmyEnableJNIfTI) - set(DCM2NIIX_SRCS ${DCM2NIIX_SRCS} cJSON.cpp base64.cpp) -endif() - -if(BUILD_DCM2NIIXFSLIB) - set(DCM2NIIXFSLIB dcm2niixfs) - set(DCM2NIIXFSLIB_SRCS - dcm2niix_fswrapper.cpp - nii_dicom.cpp - jpg_0XC3.cpp - ujpeg.cpp - nifti1_io_core.cpp - nii_foreign.cpp - nii_ortho.cpp - nii_dicom_batch.cpp) -endif() - -if(USE_JPEGLS) - add_definitions(-DmyEnableJPEGLS) - if(MSVC) - add_definitions(-DCHARLS_STATIC) - endif() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14") - - set(CHARLS_SRCS - charls/jpegls.cpp - charls/jpegmarkersegment.cpp - charls/interface.cpp - charls/jpegstreamwriter.cpp - charls/jpegstreamreader.cpp) - add_executable(dcm2niix ${DCM2NIIX_SRCS} ${CHARLS_SRCS}) - - if(BUILD_DCM2NIIXFSLIB) - add_library(${DCM2NIIXFSLIB} STATIC ${DCM2NIIXFSLIB_SRCS} ${CHARLS_SRCS}) - endif() -else() - add_executable(dcm2niix ${DCM2NIIX_SRCS}) - - if(BUILD_DCM2NIIXFSLIB) - add_library(${DCM2NIIXFSLIB} STATIC ${DCM2NIIXFSLIB_SRCS}) - endif() -endif() - -set(ZLIB_IMPLEMENTATION "Miniz" CACHE STRING "Choose zlib implementation.") -set_property(CACHE ZLIB_IMPLEMENTATION PROPERTY STRINGS "Miniz;System;Custom") -if(NOT ${ZLIB_IMPLEMENTATION} STREQUAL "Miniz") - if(NOT ${ZLIB_IMPLEMENTATION} STREQUAL "System") - set(ZLIB_ROOT ${ZLIB_ROOT} CACHE PATH "Specify custom zlib root directory.") - if(NOT ZLIB_ROOT) - message(FATAL_ERROR "ZLIB_ROOT needs to be set to locate custom zlib!") - endif() - endif() - find_package(ZLIB REQUIRED) - add_definitions(-DmyDisableMiniZ) - target_include_directories(dcm2niix PRIVATE ${ZLIB_INCLUDE_DIRS}) - target_link_libraries(dcm2niix ${ZLIB_LIBRARIES}) -endif() - -if(USE_TURBOJPEG) - find_package(PkgConfig REQUIRED) - pkg_check_modules(TURBOJPEG REQUIRED libturbojpeg) - add_definitions(-DmyTurboJPEG) - target_include_directories(dcm2niix PRIVATE ${TURBOJPEG_INCLUDEDIR}) - target_link_libraries(dcm2niix ${TURBOJPEG_LIBRARIES}) -endif() - -if(USE_JASPER) - find_package(Jasper REQUIRED) - add_definitions(-DmyEnableJasper) - target_include_directories(dcm2niix PRIVATE ${JASPER_INCLUDE_DIR}) - target_link_libraries(dcm2niix ${JASPER_LIBRARIES}) -endif() - -if(USE_OPENJPEG) - set(OpenJPEG_DIR "${OpenJPEG_DIR}" CACHE PATH "Path to OpenJPEG configuration file" FORCE) - - find_package(OpenJPEG REQUIRED) - - if(WIN32) - if(BUILD_SHARED_LIBS) - add_definitions(-DOPJ_EXPORTS) - else() - add_definitions(-DOPJ_STATIC) - endif() - endif() - - target_include_directories(dcm2niix PRIVATE ${OPENJPEG_INCLUDE_DIRS}) - target_link_libraries(dcm2niix ${OPENJPEG_LIBRARIES}) -else () - add_definitions(-DmyDisableOpenJPEG) -endif() - -if(BATCH_VERSION) - set(DCM2NIIBATCH_SRCS - main_console_batch.cpp - nii_dicom.cpp - jpg_0XC3.cpp - ujpeg.cpp - nifti1_io_core.cpp - nii_foreign.cpp - nii_ortho.cpp - nii_dicom_batch.cpp) - - if(USE_JNIFTI) - set(DCM2NIIBATCH_SRCS ${DCM2NIIBATCH_SRCS} cJSON.cpp base64.cpp) - endif() - - if(USE_JPEGLS) - add_executable(dcm2niibatch ${DCM2NIIBATCH_SRCS} ${CHARLS_SRCS}) - else() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") - add_executable(dcm2niibatch ${DCM2NIIBATCH_SRCS}) - endif() - - set(YAML-CPP_DIR ${YAML-CPP_DIR} CACHE PATH "Path to yaml-cpp configuration file" FORCE) - - find_package(YAML-CPP REQUIRED) - target_include_directories(dcm2niibatch PRIVATE ${YAML_CPP_INCLUDE_DIR}) - target_link_libraries(dcm2niibatch ${YAML_CPP_LIBRARIES}) - - if(ZLIB_FOUND) - target_include_directories(dcm2niibatch PRIVATE ${ZLIB_INCLUDE_DIRS}) - target_link_libraries(dcm2niibatch ${ZLIB_LIBRARIES}) - endif() - - if(TURBOJPEG_FOUND) - target_include_directories(dcm2niibatch PRIVATE ${TURBOJPEG_INCLUDEDIR}) - target_link_libraries(dcm2niibatch ${TURBOJPEG_LIBRARIES}) - endif() - - if(JASPER_FOUND) - target_include_directories(dcm2niibatch PRIVATE ${JASPER_INCLUDE_DIR}) - target_link_libraries(dcm2niibatch ${JASPER_LIBRARIES}) - endif() - - if(OPENJPEG_FOUND) - target_include_directories(dcm2niibatch PRIVATE ${OPENJPEG_INCLUDE_DIRS}) - target_link_libraries(dcm2niibatch ${OPENJPEG_LIBRARIES}) - endif() - - list(APPEND PROGRAMS dcm2niibatch) -endif() - -if(BUILD_DCM2NIIXFSLIB) - target_compile_definitions(${DCM2NIIXFSLIB} PRIVATE -DUSING_DCM2NIIXFSWRAPPER -DUSING_MGH_NIFTI_IO) -endif() - -if(APPLE) - message("-- Adding Apple plist") - set_target_properties(dcm2niix PROPERTIES LINK_FLAGS "-Wl,-sectcreate,__TEXT,__info_plist,${CMAKE_SOURCE_DIR}/Info.plist") - #Apple notarization requires a Info.plist - # For .app bundles, the Info.plist is a separate file, for executables it is appended as a section - #you can check that the Info.plist section has been inserted with either of these commands - # otool -l ./dcm2niix | grep info_plist -B1 -A10 - # launchctl plist ./dcm2niix -endif() - -install(TARGETS ${PROGRAMS} DESTINATION bin) - -if(BUILD_DCM2NIIXFSLIB) - install(TARGETS ${DCM2NIIXFSLIB} DESTINATION lib) -endif() +cmake_minimum_required(VERSION 2.8.11) + +project(console) + +# Option Choose whether to use static runtime +include(ucm.cmake) +option(USE_STATIC_RUNTIME "Use static runtime" ON) +if(USE_STATIC_RUNTIME) + ucm_set_runtime(STATIC) +else() + ucm_set_runtime(DYNAMIC) +endif() + +# Basic CMake build settings +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE "Release" CACHE STRING + "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE) + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug;Release;RelWithDebInfo;MinSizeRel") +endif() + +if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") + # using Clang + add_definitions(-fno-caret-diagnostics) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-dead_strip") +elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU") + # using GCC + if(NOT (${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 7.1.0)) + add_definitions(-Wno-format-overflow) # available since GCC 7.1.0 + endif() + if(NOT (${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 4.5.0)) + add_definitions(-Wno-unused-result) # available since GCC 4.5.0 + endif() + if(NOT (${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 4.8.0)) + add_definitions(-fno-diagnostics-show-caret) # available since GCC 4.8.0 + endif() +elseif(MSVC) + # using Visual Studio C++ + add_definitions(-D_CRT_SECURE_NO_DEPRECATE) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4018") # '<': signed/unsigned mismatch + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4068") # unknown pragma + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4101") # unreferenced local variable + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4244") # 'initializing': conversion from 'double' to 'int', possible loss of data + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4267") # 'initializing': conversion from 'size_t' to 'int', possible loss of data + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4305") # 'argument': truncation from 'double' to 'float' + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4308") # negative integral constant converted to unsigned type + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4334") # '<<': result of 32-bit shift implicitly converted to 64 bits + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4800") # 'uint32_t' : forcing value to bool 'true' or 'false' + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4819") # The file contains a character that cannot be represented in the current code page + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4996") # 'access': The POSIX name for this item is deprecated + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /STACK:16388608") # set "Stack Reserve Size" to 16MB (default value is 1MB) +endif() + +# Compiler dependent flags +include (CheckCXXCompilerFlag) +if(UNIX) + check_cxx_compiler_flag(-march=armv8-a+crc ARM_CRC) + if(ARM_CRC) + # wrong answer for Apple Silicon: check_cxx_compiler_flag(-msse2 HAS_SSE2) + else() + check_cxx_compiler_flag(-msse2 HAS_SSE2) + if(HAS_SSE2) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2 -mfpmath=sse") + endif() + endif() +endif() + +set(PROGRAMS dcm2niix) + +option(USE_TURBOJPEG "Use TurboJPEG to decode classic JPEG" OFF) +option(USE_JASPER "Build with JPEG2000 support using Jasper" OFF) +option(USE_OPENJPEG "Build with JPEG2000 support using OpenJPEG" OFF) +option(USE_JPEGLS "Build with JPEG-LS support using CharLS" OFF) + +option(BATCH_VERSION "Build dcm2niibatch for multiple conversions" OFF) + +option(BUILD_DCM2NIIXFSLIB "Build libdcm2niixfs.a" OFF) + +if(USE_OPENJPEG OR USE_TURBOJPEG OR USE_JASPER) + message("-- Set BUILD_DCM2NIIXFSLIB to OFF since USE_TURBOJPEG/USE_JASPER/USE_OPENJPEG is ON.") + set(BUILD_DCM2NIIXFSLIB OFF CACHE BOOL "Build libdcm2niixfs.a" FORCE) +endif() + +set(DCM2NIIX_SRCS + main_console.cpp + nii_dicom.cpp + jpg_0XC3.cpp + ujpeg.cpp + nifti1_io_core.cpp + nii_foreign.cpp + nii_ortho.cpp + nii_dicom_batch.cpp) + + +option(USE_JNIfTI "Build with JNIfTI support" ON) +if(USE_JNIFTI) + add_definitions(-DmyEnableJNIfTI) + set(DCM2NIIX_SRCS ${DCM2NIIX_SRCS} cJSON.cpp base64.cpp) +endif() + +if(BUILD_DCM2NIIXFSLIB) + set(DCM2NIIXFSLIB dcm2niixfs) + set(DCM2NIIXFSLIB_SRCS + dcm2niix_fswrapper.cpp + nii_dicom.cpp + jpg_0XC3.cpp + ujpeg.cpp + nifti1_io_core.cpp + nii_foreign.cpp + nii_ortho.cpp + nii_dicom_batch.cpp) +endif() + +if(USE_JPEGLS) + add_definitions(-DmyEnableJPEGLS) + if(MSVC) + add_definitions(-DCHARLS_STATIC) + endif() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14") + + set(CHARLS_SRCS + charls/jpegls.cpp + charls/jpegmarkersegment.cpp + charls/interface.cpp + charls/jpegstreamwriter.cpp + charls/jpegstreamreader.cpp) + add_executable(dcm2niix ${DCM2NIIX_SRCS} ${CHARLS_SRCS}) + + if(BUILD_DCM2NIIXFSLIB) + add_library(${DCM2NIIXFSLIB} STATIC ${DCM2NIIXFSLIB_SRCS} ${CHARLS_SRCS}) + endif() +else() + add_executable(dcm2niix ${DCM2NIIX_SRCS}) + + if(BUILD_DCM2NIIXFSLIB) + add_library(${DCM2NIIXFSLIB} STATIC ${DCM2NIIXFSLIB_SRCS}) + endif() +endif() + +set(ZLIB_IMPLEMENTATION "Miniz" CACHE STRING "Choose zlib implementation.") +set_property(CACHE ZLIB_IMPLEMENTATION PROPERTY STRINGS "Miniz;System;Custom") +if(NOT ${ZLIB_IMPLEMENTATION} STREQUAL "Miniz") + if(NOT ${ZLIB_IMPLEMENTATION} STREQUAL "System") + set(ZLIB_ROOT ${ZLIB_ROOT} CACHE PATH "Specify custom zlib root directory.") + if(NOT ZLIB_ROOT) + message(FATAL_ERROR "ZLIB_ROOT needs to be set to locate custom zlib!") + endif() + endif() + find_package(ZLIB REQUIRED) + add_definitions(-DmyDisableMiniZ) + target_include_directories(dcm2niix PRIVATE ${ZLIB_INCLUDE_DIRS}) + target_link_libraries(dcm2niix ${ZLIB_LIBRARIES}) +endif() + +if(USE_TURBOJPEG) + find_package(PkgConfig REQUIRED) + pkg_check_modules(TURBOJPEG REQUIRED libturbojpeg) + add_definitions(-DmyTurboJPEG) + target_include_directories(dcm2niix PRIVATE ${TURBOJPEG_INCLUDEDIR}) + target_link_libraries(dcm2niix ${TURBOJPEG_LIBRARIES}) +endif() + +if(USE_JASPER) + find_package(Jasper REQUIRED) + add_definitions(-DmyEnableJasper) + target_include_directories(dcm2niix PRIVATE ${JASPER_INCLUDE_DIR}) + target_link_libraries(dcm2niix ${JASPER_LIBRARIES}) +endif() + +if(USE_OPENJPEG) + set(OpenJPEG_DIR "${OpenJPEG_DIR}" CACHE PATH "Path to OpenJPEG configuration file" FORCE) + + find_package(OpenJPEG REQUIRED) + + if(WIN32) + if(BUILD_SHARED_LIBS) + add_definitions(-DOPJ_EXPORTS) + else() + add_definitions(-DOPJ_STATIC) + endif() + endif() + + target_include_directories(dcm2niix PRIVATE ${OPENJPEG_INCLUDE_DIRS}) + target_link_libraries(dcm2niix ${OPENJPEG_LIBRARIES}) +else () + add_definitions(-DmyDisableOpenJPEG) +endif() + +if(BATCH_VERSION) + set(DCM2NIIBATCH_SRCS + main_console_batch.cpp + nii_dicom.cpp + jpg_0XC3.cpp + ujpeg.cpp + nifti1_io_core.cpp + nii_foreign.cpp + nii_ortho.cpp + nii_dicom_batch.cpp) + + if(USE_JNIFTI) + set(DCM2NIIBATCH_SRCS ${DCM2NIIBATCH_SRCS} cJSON.cpp base64.cpp) + endif() + + if(USE_JPEGLS) + add_executable(dcm2niibatch ${DCM2NIIBATCH_SRCS} ${CHARLS_SRCS}) + else() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + add_executable(dcm2niibatch ${DCM2NIIBATCH_SRCS}) + endif() + + set(YAML-CPP_DIR ${YAML-CPP_DIR} CACHE PATH "Path to yaml-cpp configuration file" FORCE) + + find_package(YAML-CPP REQUIRED) + target_include_directories(dcm2niibatch PRIVATE ${YAML_CPP_INCLUDE_DIR}) + target_link_libraries(dcm2niibatch ${YAML_CPP_LIBRARIES}) + + if(ZLIB_FOUND) + target_include_directories(dcm2niibatch PRIVATE ${ZLIB_INCLUDE_DIRS}) + target_link_libraries(dcm2niibatch ${ZLIB_LIBRARIES}) + endif() + + if(TURBOJPEG_FOUND) + target_include_directories(dcm2niibatch PRIVATE ${TURBOJPEG_INCLUDEDIR}) + target_link_libraries(dcm2niibatch ${TURBOJPEG_LIBRARIES}) + endif() + + if(JASPER_FOUND) + target_include_directories(dcm2niibatch PRIVATE ${JASPER_INCLUDE_DIR}) + target_link_libraries(dcm2niibatch ${JASPER_LIBRARIES}) + endif() + + if(OPENJPEG_FOUND) + target_include_directories(dcm2niibatch PRIVATE ${OPENJPEG_INCLUDE_DIRS}) + target_link_libraries(dcm2niibatch ${OPENJPEG_LIBRARIES}) + endif() + + list(APPEND PROGRAMS dcm2niibatch) +endif() + +if(BUILD_DCM2NIIXFSLIB) + target_compile_definitions(${DCM2NIIXFSLIB} PRIVATE -DUSING_DCM2NIIXFSWRAPPER -DUSING_MGH_NIFTI_IO) +endif() + +if(APPLE) + message("-- Adding Apple plist") + set_target_properties(dcm2niix PROPERTIES LINK_FLAGS "-Wl,-sectcreate,__TEXT,__info_plist,${CMAKE_SOURCE_DIR}/Info.plist") + #Apple notarization requires a Info.plist + # For .app bundles, the Info.plist is a separate file, for executables it is appended as a section + #you can check that the Info.plist section has been inserted with either of these commands + # otool -l ./dcm2niix | grep info_plist -B1 -A10 + # launchctl plist ./dcm2niix +endif() + +install(TARGETS ${PROGRAMS} DESTINATION bin) + +if(BUILD_DCM2NIIXFSLIB) + install(TARGETS ${DCM2NIIXFSLIB} DESTINATION lib) +endif() diff --git a/console/nii_dicom.cpp b/console/nii_dicom.cpp index ecda6527..cd518769 100644 --- a/console/nii_dicom.cpp +++ b/console/nii_dicom.cpp @@ -42,6 +42,10 @@ #define isnan ISNAN #endif +#ifndef max +#define max(a, b) (a > b ? a : b) +#endif + #ifndef myDisableClassicJPEG #ifdef myTurboJPEG #include @@ -393,6 +397,39 @@ mat44 noNaN(mat44 Q44, bool isVerbose, bool *isBogus) //simplify any headers tha return ret; } +#define kYYYYMMDDlen 8 //how many characters to encode year,month,day in "YYYYDDMM" format + +/*double dicomTimeToSecX(double dicomTime) { + //convert HHMMSS to seconds, 135300.024 -> 135259.731 are 0.293 sec apart + char acqTimeBuf[64]; + snprintf(acqTimeBuf, sizeof acqTimeBuf, "%+013.5f", (double)dicomTime); + int ahour, amin; + double asec; + int count = 0; + sscanf(acqTimeBuf, "%3d%2d%lf%n", &ahour, &amin, &asec, &count); + if (!count) + return -1; + return (ahour * 3600) + (amin * 60) + asec; +} + +double DateTimeToTime(char *dstr) { + if (strlen(dstr) > (kYYYYMMDDlen + 5)) { + // 20161117131643.80000 -> date 20161117 time 131643.80000 + //printMessage("acquisitionDateTime %s\n",acquisitionDateTimeTxt); + //char acquisitionDateTxt[kDICOMStr]; + //memcpy(acquisitionDateTxt, dstr, kYYYYMMDDlen); + //acquisitionDateTxt[kYYYYMMDDlen] = '\0'; // IMPORTANT! + //d.acquisitionDate = atof(acquisitionDateTxt); + char acquisitionTimeTxt[kDICOMStr]; + int timeLen = (int)strlen(dstr) - kYYYYMMDDlen; + strncpy(acquisitionTimeTxt, &dstr[kYYYYMMDDlen], timeLen); + acquisitionTimeTxt[timeLen] = '\0'; // IMPORTANT! + printf(">>>%s\n", acquisitionTimeTxt); + return atof(acquisitionTimeTxt); + } + return 0.0; +}*/ + #define kSessionOK 0 #define kSessionBadMatrix 1 @@ -1840,6 +1877,7 @@ struct TDICOMdata nii_readParRec(char *parname, int isVerbose, struct TDTI4D *dt int numSlice2D = 0; int prevDyn = -1; bool dynNotAscending = false; + int maxSlice2D = 0; int parVers = 0; int maxSeq = -1; //maximum value of Seq column int seq1 = -1; //value of Seq volume for first slice @@ -2123,10 +2161,6 @@ struct TDICOMdata nii_readParRec(char *parname, int isVerbose, struct TDTI4D *dt if ((d.intenScale != cols[kRS]) || (d.intenIntercept != cols[kRI])) isIntenScaleVaries = true; } - if (cols[kImageType] == 0) - d.isHasMagnitude = true; - if (cols[kImageType] != 0) - d.isHasPhase = true; if (isSameFloat(cols[kImageType], 18)) { //printWarning("Field map in Hz will be saved as the 'real' image.\n"); //isTypeWarning = true; @@ -2231,13 +2265,25 @@ struct TDICOMdata nii_readParRec(char *parname, int isVerbose, struct TDTI4D *dt //if (slice == 1) printMessage("%d\t%d\t%d\t%d\t%d\n", isADC,(int)cols[kbvalNumber], (int)cols[kGradientNumber], bval, vol); if (vol > maxVol) maxVol = vol; - bool isReal = (cols[kImageType] == 1); - bool isImaginary = (cols[kImageType] == 2); - bool isPhase = (cols[kImageType] == 3); - if (cols[kImageType] == 18) { + int imageType = (int) cols[kImageType]; + bool isMagnitude = (imageType == 0); + bool isReal = (imageType == 1); + bool isImaginary = (imageType == 2); + bool isPhase = (imageType == 3); + bool isRealIsPhaseMapHz = (imageType == 18); + if (isMagnitude) + d.isHasMagnitude = true; + if (isImaginary) + d.isHasImaginary = true; + if (isPhase) + d.isHasPhase = true; + if (isRealIsPhaseMapHz) { isReal = true; + d.isHasReal = true; d.isRealIsPhaseMapHz = true; } + if (isReal) + d.isHasReal = true; if (cols[kImageType] == 4) { if (!isType4Warning) { printWarning("Unknown image type (4). Be aware the 'phase' image is of an unknown type.\n"); @@ -2252,6 +2298,7 @@ struct TDICOMdata nii_readParRec(char *parname, int isVerbose, struct TDTI4D *dt } isReal = true; //<- this is not correct, kludge for bug in ROGERS_20180526_WIP_B0_NS_8_1.PAR } + int vx = vol; if (isReal) vol += num3DExpected; if (isImaginary) @@ -2300,7 +2347,7 @@ struct TDICOMdata nii_readParRec(char *parname, int isVerbose, struct TDTI4D *dt //offset images by type: mag+0,real+1, imag+2,phase+3 //if (cols[kImageType] != 0) //yikes - phase maps! // slice = slice + numExpected; - //printWarning("%d\t%d\n", slice -1, numSlice2D); + maxSlice2D = max(slice, maxSlice2D); if ((slice >= 0) && (slice < kMaxSlice2D) && (numSlice2D < kMaxSlice2D) && (numSlice2D >= 0)) { dti4D->sliceOrder[slice - 1] = numSlice2D; //printMessage("%d\t%d\t%d\n", numSlice2D, slice, (int)cols[kSlice],(int)vol); @@ -2356,11 +2403,22 @@ struct TDICOMdata nii_readParRec(char *parname, int isVerbose, struct TDTI4D *dt slice = slice + 1; } } + if (maxSlice2D >= kMaxSlice2D) {//issue659 + printError("Use dicm2nii or increase kMaxSlice2D (issue 659) %d\n", maxSlice2D); + d.isValid = false; + } + //number of image types: issue659 + int nType = 0; + if (d.isHasMagnitude) nType ++; + if (d.isHasImaginary) nType ++; + if (d.isHasPhase) nType ++; + if (d.isHasReal) nType ++; + nType = max(nType, 1); if (slice != numSlice2D) { printError("Catastrophic error: found %d but expected %d slices. %s\n", slice, numSlice2D, parname); - printMessage(" slices*grad*bval*cardiac*echo*dynamic*mix*labels = %d*%d*%d*%d*%d*%d*%d*%d\n", + printMessage(" slices*grad*bval*cardiac*echo*dynamic*mix*labels*types = %d*%d*%d*%d*%d*%d*%d*%d*%d\n", d.xyzDim[3], maxNumberOfGradientOrients, maxNumberOfDiffusionValues, - maxNumberOfCardiacPhases, maxNumberOfEchoes, maxNumberOfDynamics, maxNumberOfMixes, maxNumberOfLabels); + maxNumberOfCardiacPhases, maxNumberOfEchoes, maxNumberOfDynamics, maxNumberOfMixes, maxNumberOfLabels, nType); d.isValid = false; } for (int i = 0; i < numSlice2D; i++) { //issue363 @@ -4133,6 +4191,7 @@ struct TDICOMdata readDICOMx(char *fname, struct TDCMprefs *prefs, struct TDTI4D dti4D->volumeOnsetTime[0] = -1; dti4D->decayFactor[0] = -1; dti4D->frameDuration[0] = -1; + dti4D->frameReferenceTime[0] = -1; //dti4D->fragmentOffset[0] = -1; dti4D->intenScale[0] = 0.0; struct TVolumeDiffusion volDiffusion = initTVolumeDiffusion(&d, dti4D); @@ -4300,7 +4359,7 @@ struct TDICOMdata readDICOMx(char *fname, struct TDCMprefs *prefs, struct TDTI4D #define kCardiacSynchronizationTechnique 0x0018 + uint32_t(0x9037 << 16) //'CS' #define kParallelReductionFactorInPlane 0x0018 + uint32_t(0x9069 << 16) //FD #define kAcquisitionDuration 0x0018 + uint32_t(0x9073 << 16) //FD -//#define kFrameAcquisitionDateTime 0x0018+uint32_t(0x9074<< 16 ) //DT "20181019212528.232500" +#define kFrameAcquisitionDateTime 0x0018+uint32_t(0x9074<< 16 ) //DT "20181019212528.232500" #define kDiffusionDirectionality 0x0018 + uint32_t(0x9075 << 16) // NONE, ISOTROPIC, or DIRECTIONAL #define kParallelAcquisitionTechnique 0x0018 + uint32_t(0x9078 << 16) //CS: SENSE, SMASH #define kInversionTimes 0x0018 + uint32_t(0x9079 << 16) //FD @@ -5585,13 +5644,15 @@ const uint32_t kEffectiveTE = 0x0018 + (0x9082 << 16); d.acquisitionDuration = dcmFloatDouble(lLength, &buffer[lPos], d.isLittleEndian); break; //in theory, 0018,9074 could provide XA10 slice time information, but scrambled by XA10 de-identification: better to use 0021,1104 - //case kFrameAcquisitionDateTime: { - // //(0018,9074) DT [20190621095516.140000] YYYYMMDDHHMMSS - // //see https://github.com/rordenlab/dcm2niix/issues/303 - // char dateTime[kDICOMStr]; - // dcmStr(lLength, &buffer[lPos], dateTime); - // printf("%s\tkFrameAcquisitionDateTime\n", dateTime); - //} + /*case kFrameAcquisitionDateTime: { + //(0018,9074) DT [20190621095516.140000] YYYYMMDDHHMMSS + //see https://github.com/rordenlab/dcm2niix/issues/303 + char dateTime[kDICOMStr]; + dcmStr(lLength, &buffer[lPos], dateTime); + double dTime = DateTimeToTime(dateTime); + printf("%s\t FrameAcquisitionDateTime %0.4f \n", dateTime, dTime); + //d.triggerDelayTime = dTime; + }*/ case kDiffusionDirectionality: { // 0018, 9075 set_directionality0018_9075(&volDiffusion, (&buffer[lPos])); if ((d.manufacturer != kMANUFACTURER_PHILIPS) || (lLength < 10)) @@ -7296,7 +7357,6 @@ const uint32_t kEffectiveTE = 0x0018 + (0x9082 << 16); d.isHasOverlay = false; } //Recent Philips images include DateTime (0008,002A) but not separate date and time (0008,0022 and 0008,0032) -#define kYYYYMMDDlen 8 //how many characters to encode year,month,day in "YYYYDDMM" format if ((strlen(acquisitionDateTimeTxt) > (kYYYYMMDDlen + 5)) && (!isFloatDiff(d.acquisitionTime, 0.0f)) && (!isFloatDiff(d.acquisitionDate, 0.0f))) { // 20161117131643.80000 -> date 20161117 time 131643.80000 //printMessage("acquisitionDateTime %s\n",acquisitionDateTimeTxt); diff --git a/console/nii_dicom.h b/console/nii_dicom.h index 78355d48..5fb816c0 100644 --- a/console/nii_dicom.h +++ b/console/nii_dicom.h @@ -54,7 +54,7 @@ extern "C" { #define kDCMvers kDCMdate " " kJP2suf kLSsuf kCCsuf kCPUsuf static const int kMaxEPI3D = 1024; //maximum number of EPI images in Siemens Mosaic -static const int kMaxSlice2D = 65535; //issue460 maximum number of 2D slices in 4D (Philips) images +static const int kMaxSlice2D = 131070;// 65535; //issue460 maximum number of 2D slices in 4D (Philips) images static const int kMaxDTI4D = kMaxSlice2D; //issue460: maximum number of DTI directions for 4D (Philips) images, also maximum number of 2D slices for Enhanced DICOM and PAR/REC #define kDICOMStr 66 //64 characters plus NULL https://github.com/rordenlab/dcm2niix/issues/268 diff --git a/console/windows.bat b/console/windows.bat index 28c9689c..acc18462 100644 --- a/console/windows.bat +++ b/console/windows.bat @@ -1 +1,4 @@ -cl /wd4018 /wd4068 /wd4101 /wd4244 /wd4267 /wd4305 /wd4308 /wd4334 /wd4800 /wd4819 /wd4996 base64.cpp cJSON.cpp main_console.cpp nii_foreign.cpp nii_dicom.cpp jpg_0XC3.cpp ujpeg.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp /Fe:dcm2niix.exe -DmyDisableOpenJPEG /link /STACK:8388608 \ No newline at end of file +cl /wd4018 /wd4068 /wd4101 /wd4244 /wd4267 /wd4305 /wd4308 /wd4334 /wd4800 /wd4819 /wd4996 base64.cpp cJSON.cpp main_console.cpp nii_foreign.cpp nii_dicom.cpp jpg_0XC3.cpp ujpeg.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp /Fe:dcm2niix.exe -DmyDisableOpenJPEG /link /STACK:16388608 +rm *.exp +rm *.lib +rm *.obj \ No newline at end of file From 4ce1005cd5d78fbbe17bd1ab1a814a472259f1ec Mon Sep 17 00:00:00 2001 From: neurolabusc Date: Sat, 17 Dec 2022 11:56:04 -0500 Subject: [PATCH 30/85] Increase stack size for Unix make script (https://github.com/rordenlab/dcm2niix/issues/659) --- COMPILE.md | 32 +++++++++++++++----------------- console/makefile | 5 ++++- console/nii_dicom.h | 2 +- 3 files changed, 20 insertions(+), 19 deletions(-) diff --git a/COMPILE.md b/COMPILE.md index 46374a02..c5a62708 100644 --- a/COMPILE.md +++ b/COMPILE.md @@ -8,12 +8,14 @@ Beyond the complexity of compiling the software, the only downside to adding opt The text below generally describes how to build dcm2niix using the [GCC](https://gcc.gnu.org) compiler using the `g++` command. However, the code is portable and you can use different compilers. For [clang/llvm](https://clang.llvm.org) compile using `clang++`. If you have the [Intel C compiler](https://software.intel.com/en-us/c-compilers), you can substitute the `icc` command. The code is compatible with Microsoft's VS 2015 or later. For [Microsoft's C compiler](http://landinghub.visualstudio.com/visual-cpp-build-tools) you would use the `cl` command. In theory, the code should support other compilers, but this has not been tested. Be aware that if you do not have gcc installed the `g++` command may use a default to a compiler (e.g. clang). To check what compiler was used, run the dcm2niix software: it always reports the version and the compiler used for the build. +Note that in the commands below we increase the [stack size](https://stackoverflow.com/questions/71253952/how-to-increase-stack-size-in-macos-for-running-c-c-program#:~:text=You%20can%20increase%20the%20stack,requests%20the%20system%20will%20grant.) to 16mb, which is larger than the Unix (8mb) and Windows (1mb) defaults. + ## Building the command line version without cmake You can also build the software without C-make. The easiest way to do this is to run the function "make" from the "console" folder. Note that this only creates the default version of dcm2niix, not the optional batch version described above. The make command simply calls the g++ compiler, and if you want you can tune this for your build. In essence, the make function simply calls ``` -g++ -O3 -I. main_console.cpp nii_dicom.cpp jpg_0XC3.cpp ujpeg.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp nii_foreign.cpp -o dcm2niix -DmyDisableOpenJPEG +g++ -O3 -I. main_console.cpp nii_dicom.cpp jpg_0XC3.cpp ujpeg.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp nii_foreign.cpp -o dcm2niix -DmyDisableOpenJPEG -Wl,-stack_size -Wl,3f00000 ``` The following sub-sections list how you can modify this basic recipe for your needs. @@ -31,7 +33,7 @@ cmake -DUSE_OPENJPEG=ON -DCMAKE_CXX_FLAGS=-g .. && make If we have zlib, we can use it (-lz) and disable [miniz](https://code.google.com/p/miniz/) (-myDisableMiniZ) ``` -g++ -O3 -DmyDisableOpenJPEG -I. main_console.cpp nii_dicom.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp jpg_0XC3.cpp ujpeg.cpp nii_foreign.cpp -o dcm2niix -lz -DmyDisableMiniZ +g++ -O3 -DmyDisableOpenJPEG -I. main_console.cpp nii_dicom.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp jpg_0XC3.cpp ujpeg.cpp nii_foreign.cpp -o dcm2niix -lz -DmyDisableMiniZ g++ -O3 -I. main_console.cpp nii_dicom.cpp jpg_0XC3.cpp ujpeg.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp nii_foreign.cpp -o dcm2niix -DmyDisableOpenJPEG -Wl,-stack_size -Wl,3f00000 ``` ##### MINGW BUILD @@ -39,7 +41,7 @@ g++ -O3 -DmyDisableOpenJPEG -I. main_console.cpp nii_dicom.cpp nifti1_io_core.cp If you use the (obsolete) compiler MinGW on Windows you will want to include the rare libgcc libraries with your executable so others can use it. Here I also demonstrate the optional "-DmyDisableZLib" to remove zip support. ``` -g++ -O3 -s -DmyDisableOpenJPEG -DmyDisableZLib -I. main_console.cpp nii_dicom.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp jpg_0XC3.cpp ujpeg.cpp nii_foreign.cpp -o dcm2niix -static-libgcc +g++ -O3 -s -DmyDisableOpenJPEG -DmyDisableZLib -I. main_console.cpp nii_dicom.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp jpg_0XC3.cpp ujpeg.cpp nii_foreign.cpp -o dcm2niix -static-libgcc g++ -O3 -I. main_console.cpp nii_dicom.cpp jpg_0XC3.cpp ujpeg.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp nii_foreign.cpp -o dcm2niix -DmyDisableOpenJPEG -Wl,-stack_size -Wl,3f00000 ``` ##### DISABLING CLASSIC JPEG @@ -47,7 +49,7 @@ g++ -O3 -s -DmyDisableOpenJPEG -DmyDisableZLib -I. main_console.cpp nii_dicom.cp DICOM images can be stored as either raw data or compressed using one of many formats as described by the [transfer syntaxes](https://www.nitrc.org/plugins/mwiki/index.php/dcm2nii:MainPage#Transfer_Syntaxes_and_Compressed_Images). One of the compressed formats is the lossy classic JPEG format (which is separate from and predates the lossy JPEG 2000 format). This software comes with the [NanoJPEG](http://keyj.emphy.de/nanojpeg/) library to handle these images. However, you can use the `myDisableClassicJPEG` compiler switch to remove this dependency. The resulting executable will be smaller but will not be able to convert images stored with this format. ``` -g++ -O3 -I. main_console.cpp nii_dicom.cpp jpg_0XC3.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp nii_foreign.cpp -o dcm2niix -DmyDisableClassicJPEG -DmyDisableOpenJPEG +g++ -O3 -I. main_console.cpp nii_dicom.cpp jpg_0XC3.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp nii_foreign.cpp -o dcm2niix -DmyDisableClassicJPEG -DmyDisableOpenJPEG g++ -O3 -I. main_console.cpp nii_dicom.cpp jpg_0XC3.cpp ujpeg.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp nii_foreign.cpp -o dcm2niix -DmyDisableOpenJPEG -Wl,-stack_size -Wl,3f00000 ``` ##### USING LIBJPEG-TURBO TO DECODE CLASSIC JPEG @@ -55,7 +57,7 @@ g++ -O3 -I. main_console.cpp nii_dicom.cpp jpg_0XC3.cpp nifti1_io_core.cpp nii_o By default, classic JPEG images will be decoded using the [compact NanoJPEG decoder](http://keyj.emphy.de/nanojpeg/). However, the compiler directive `myTurboJPEG` will create an executable based on the [libjpeg-turbo](http://www.libjpeg-turbo.org) library. This library is a faster decoder and is the standard for many Linux distributions. On the other hand, the lossy classic JPEG is rarely used for DICOM images, so this compilation has extra dependencies and can result in a larger executable size (for static builds). ``` -g++ -O3 -I. main_console.cpp nii_dicom.cpp jpg_0XC3.cpp ujpeg.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp nii_foreign.cpp -o dcm2niix -DmyDisableOpenJPEG -DmyTurboJPEG -I/opt/libjpeg-turbo/include /opt/libjpeg-turbo/lib/libturbojpeg.a +g++ -O3 -I. main_console.cpp nii_dicom.cpp jpg_0XC3.cpp ujpeg.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp nii_foreign.cpp -o dcm2niix -DmyDisableOpenJPEG -DmyTurboJPEG -I/opt/libjpeg-turbo/include /opt/libjpeg-turbo/lib/libturbojpeg.a g++ -O3 -I. main_console.cpp nii_dicom.cpp jpg_0XC3.cpp ujpeg.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp nii_foreign.cpp -o dcm2niix -DmyDisableOpenJPEG -Wl,-stack_size -Wl,3f00000 ``` ##### JPEG-LS BUILD @@ -63,7 +65,7 @@ g++ -O3 -I. main_console.cpp nii_dicom.cpp jpg_0XC3.cpp ujpeg.cpp nifti1_io_core You can compile dcm2niix to convert DICOM images compressed with the [JPEG-LS](https://en.wikipedia.org/wiki/JPEG_2000) [transfer syntaxes 1.2.840.10008.1.2.4.80 and 1.2.840.10008.1.2.4.81](https://www.nitrc.org/plugins/mwiki/index.php/dcm2nii:MainPage#Transfer_Syntaxes_and_Compressed_Images). Decoding this format is handled by the [CharLS library](https://github.com/team-charls/charls), which is included with dcm2niix in the `charls` folder. The included code was downloaded from the CharLS website on 6 June 2018. To enable support you will need to include the `myEnableJPEGLS` compiler flag as well as a few file sin the `charls` folder. Therefore, a minimal compile (with just JPEG-LS and without JPEG2000) should look like this: ``` -g++ -I. -DmyEnableJPEGLS charls/jpegls.cpp charls/jpegmarkersegment.cpp charls/interface.cpp charls/jpegstreamwriter.cpp charls/jpegstreamreader.cpp main_console.cpp nii_foreign.cpp nii_dicom.cpp jpg_0XC3.cpp ujpeg.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp -o dcm2niix -DmyDisableOpenJPEG +g++ -I. -DmyEnableJPEGLS charls/jpegls.cpp charls/jpegmarkersegment.cpp charls/interface.cpp charls/jpegstreamwriter.cpp charls/jpegstreamreader.cpp main_console.cpp nii_foreign.cpp nii_dicom.cpp jpg_0XC3.cpp ujpeg.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp -o dcm2niix -DmyDisableOpenJPEG g++ -O3 -I. main_console.cpp nii_dicom.cpp jpg_0XC3.cpp ujpeg.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp nii_foreign.cpp -o dcm2niix -DmyDisableOpenJPEG -Wl,-stack_size -Wl,3f00000 ``` Alternatively, you can decompress an image in JPEG-LS to an uncompressed DICOM using [gdcmconv](https://github.com/malaterre/GDCM) (e.g. `gdcmconv -w 3691459 3691459.dcm`). Or you can use gdcmconv compress a DICOM to JPEG-LS (e.g. `gdcmconv -L 3691459 3691459.dcm`). Alternatively, the DCMTK tool [dcmcjpls](https://support.dcmtk.org/docs/dcmcjpls.html) provides JPEG-LS support. @@ -81,28 +83,24 @@ You can build dcm2niix with JPEG2000 decompression support using OpenJPEG 2.1.0. You should then be able to run: ``` -g++ -O3 -I. main_console.cpp nii_dicom.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp jpg_0XC3.cpp ujpeg.cpp nii_foreign.cpp -o dcm2niix -lopenjp2 +g++ -O3 -I. main_console.cpp nii_dicom.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp jpg_0XC3.cpp ujpeg.cpp nii_foreign.cpp -o dcm2niix -lopenjp2 g++ -O3 -I. main_console.cpp nii_dicom.cpp jpg_0XC3.cpp ujpeg.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp nii_foreign.cpp -o dcm2niix -DmyDisableOpenJPEG -Wl,-stack_size -Wl,3f00000 ``` But in my experience this works best if you explicitly tell the software how to find the libraries, so your compile will probably look like one of these options: ``` #for MacOS -g++ -O3 -I. main_console.cpp nii_dicom.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp jpg_0XC3.cpp ujpeg.cpp nii_foreign.cpp -o dcm2niix -I/usr/local/include/openjpeg-2.1 /usr/local/lib/libopenjp2.a -``` -``` +g++ -O3 -I. main_console.cpp nii_dicom.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp jpg_0XC3.cpp ujpeg.cpp nii_foreign.cpp -o dcm2niix -I/usr/local/include/openjpeg-2.1 /usr/local/lib/libopenjp2.a g++ -O3 -I. main_console.cpp nii_dicom.cpp jpg_0XC3.cpp ujpeg.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp nii_foreign.cpp -o dcm2niix -DmyDisableOpenJPEG -Wl,-stack_size -Wl,3f00000 #For older Linux -g++ -O3 -I. main_console.cpp nii_dicom.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp jpg_0XC3.cpp ujpeg.cpp nii_foreign.cpp -o dcm2niix -I/usr/local/lib /usr/local/lib/libopenjp2.a -``` -``` +g++ -O3 -I. main_console.cpp nii_dicom.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp jpg_0XC3.cpp ujpeg.cpp nii_foreign.cpp -o dcm2niix -I/usr/local/lib /usr/local/lib/libopenjp2.a g++ -O3 -I. main_console.cpp nii_dicom.cpp jpg_0XC3.cpp ujpeg.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp nii_foreign.cpp -o dcm2niix -DmyDisableOpenJPEG -Wl,-stack_size -Wl,3f00000 #For modern Linux -g++ -O3 -s -I. main_console.cpp nii_dicom.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp jpg_0XC3.cpp ujpeg.cpp nii_foreign.cpp -lpthread -o dcm2niix -I/usr/local/include/openjpeg-2.2 ~/openjpeg-master/build/bin/libopenjp2.a +g++ -O3 -s -I. main_console.cpp nii_dicom.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp jpg_0XC3.cpp ujpeg.cpp nii_foreign.cpp -lpthread -o dcm2niix -I/usr/local/include/openjpeg-2.2 ~/openjpeg-master/build/bin/libopenjp2.a g++ -O3 -I. main_console.cpp nii_dicom.cpp jpg_0XC3.cpp ujpeg.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp nii_foreign.cpp -o dcm2niix -DmyDisableOpenJPEG -Wl,-stack_size -Wl,3f00000 ``` If you want to build this with JPEG2000 decompression support using Jasper: You will need to have the Jasper (http://www.ece.uvic.ca/~frodo/jasper/) and libjpeg (http://www.ijg.org) libraries installed which for Linux users may be as easy as running 'sudo apt-get install libjasper-dev' (otherwise, see http://www.ece.uvic.ca/~frodo/jasper/#doc). You can then run: ``` -g++ -O3 -DmyDisableOpenJPEG -DmyEnableJasper -I. main_console.cpp nii_dicom.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp jpg_0XC3.cpp ujpeg.cpp nii_foreign.cpp -s -o dcm2niix -ljasper -ljpeg +g++ -O3 -DmyDisableOpenJPEG -DmyEnableJasper -I. main_console.cpp nii_dicom.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp jpg_0XC3.cpp ujpeg.cpp nii_foreign.cpp -s -o dcm2niix -ljasper -ljpeg g++ -O3 -I. main_console.cpp nii_dicom.cpp jpg_0XC3.cpp ujpeg.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp nii_foreign.cpp -o dcm2niix -DmyDisableOpenJPEG -Wl,-stack_size -Wl,3f00000 ``` ##### VISUAL STUDIO BUILD @@ -122,8 +120,8 @@ On MacOS you can create Universal binaries, that bundle optimized code for diffe Here is a simple example of creating independent 32-bit and 64-bit executables and then using `lipo` to create a single universal executable: ``` -g++ -O3 -DmyDisableOpenJPEG -I. main_console.cpp nii_dicom.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp jpg_0XC3.cpp ujpeg.cpp nii_foreign.cpp -arch i386 -o dcm2niix32 -g++ -O3 -DmyDisableOpenJPEG -I. main_console.cpp nii_dicom.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp jpg_0XC3.cpp ujpeg.cpp nii_foreign.cpp -o dcm2niix64 +g++ -O3 -DmyDisableOpenJPEG -I. main_console.cpp nii_dicom.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp jpg_0XC3.cpp ujpeg.cpp nii_foreign.cpp -arch i386 -o dcm2niix32 g++ -O3 -I. main_console.cpp nii_dicom.cpp jpg_0XC3.cpp ujpeg.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp nii_foreign.cpp -o dcm2niix -DmyDisableOpenJPEG -Wl,-stack_size -Wl,3f00000 +g++ -O3 -DmyDisableOpenJPEG -I. main_console.cpp nii_dicom.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp jpg_0XC3.cpp ujpeg.cpp nii_foreign.cpp -o dcm2niix64 g++ -O3 -I. main_console.cpp nii_dicom.cpp jpg_0XC3.cpp ujpeg.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp nii_foreign.cpp -o dcm2niix -DmyDisableOpenJPEG -Wl,-stack_size -Wl,3f00000 lipo -create dcm2niix32 dcm2niix64 -o dcm2niix ``` diff --git a/console/makefile b/console/makefile index 3b14bfa9..a9ce4dbf 100644 --- a/console/makefile +++ b/console/makefile @@ -4,6 +4,9 @@ CFLAGS=-s -O3 # Debugging #CFLAGS=-g +# issue659: increase stack to 16mb +LFLAGS=-s -O3 -Wl,-stack_size -Wl,3f00000 + #Leak tests: # https://clang.llvm.org/docs/AddressSanitizer.html # clang++ -O1 -g -fsanitize=address -fno-omit-frame-pointer -I. main_console.cpp nii_foreign.cpp nii_dicom.cpp jpg_0XC3.cpp ujpeg.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp base64.c cJSON.c -o dcm2niix -DmyDisableOpenJPEG @@ -37,4 +40,4 @@ ifneq ($(OS),Windows_NT) endif endif all: - g++ $(CFLAGS) -I. $(JSFLAGS) $(JFLAGS) main_console.cpp nii_foreign.cpp nii_dicom.cpp jpg_0XC3.cpp ujpeg.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp -o dcm2niix -DmyDisableOpenJPEG + g++ $(CFLAGS) -I. $(JSFLAGS) $(JFLAGS) $(LFLAGS) main_console.cpp nii_foreign.cpp nii_dicom.cpp jpg_0XC3.cpp ujpeg.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp -o dcm2niix -DmyDisableOpenJPEG diff --git a/console/nii_dicom.h b/console/nii_dicom.h index 5fb816c0..02a56a0e 100644 --- a/console/nii_dicom.h +++ b/console/nii_dicom.h @@ -50,7 +50,7 @@ extern "C" { #define kCPUsuf " " //unknown CPU #endif -#define kDCMdate "v1.0.20221127" +#define kDCMdate "v1.0.20221217" #define kDCMvers kDCMdate " " kJP2suf kLSsuf kCCsuf kCPUsuf static const int kMaxEPI3D = 1024; //maximum number of EPI images in Siemens Mosaic From cd9ff35fa3c886aaae4fec1ba23171e93f1fff27 Mon Sep 17 00:00:00 2001 From: neurolabusc Date: Sat, 17 Dec 2022 12:06:45 -0500 Subject: [PATCH 31/85] Update cmake --- COMPILE.md | 2 +- console/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/COMPILE.md b/COMPILE.md index c5a62708..7e2fd146 100644 --- a/COMPILE.md +++ b/COMPILE.md @@ -8,7 +8,7 @@ Beyond the complexity of compiling the software, the only downside to adding opt The text below generally describes how to build dcm2niix using the [GCC](https://gcc.gnu.org) compiler using the `g++` command. However, the code is portable and you can use different compilers. For [clang/llvm](https://clang.llvm.org) compile using `clang++`. If you have the [Intel C compiler](https://software.intel.com/en-us/c-compilers), you can substitute the `icc` command. The code is compatible with Microsoft's VS 2015 or later. For [Microsoft's C compiler](http://landinghub.visualstudio.com/visual-cpp-build-tools) you would use the `cl` command. In theory, the code should support other compilers, but this has not been tested. Be aware that if you do not have gcc installed the `g++` command may use a default to a compiler (e.g. clang). To check what compiler was used, run the dcm2niix software: it always reports the version and the compiler used for the build. -Note that in the commands below we increase the [stack size](https://stackoverflow.com/questions/71253952/how-to-increase-stack-size-in-macos-for-running-c-c-program#:~:text=You%20can%20increase%20the%20stack,requests%20the%20system%20will%20grant.) to 16mb, which is larger than the Unix (8mb) and Windows (1mb) defaults. +Note that in the commands below we increase the [stack size](https://stackoverflow.com/questions/18909395/how-do-i-increase-the-stack-size-when-compiling-with-clang-on-os-x)zgit to 16mb, which is larger than the Unix (8mb) and Windows (1mb) defaults. ## Building the command line version without cmake diff --git a/console/CMakeLists.txt b/console/CMakeLists.txt index c48c9338..d18324d8 100644 --- a/console/CMakeLists.txt +++ b/console/CMakeLists.txt @@ -21,7 +21,7 @@ endif() if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") # using Clang add_definitions(-fno-caret-diagnostics) - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-dead_strip") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-dead_strip -Wl,-stack_size -Wl,0x1000000") elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU") # using GCC if(NOT (${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 7.1.0)) From 0e00be7d49b828f1aa48a74016652acfbd73c43f Mon Sep 17 00:00:00 2001 From: neurolabusc Date: Sat, 17 Dec 2022 12:09:18 -0500 Subject: [PATCH 32/85] Consistent stack size --- console/makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/console/makefile b/console/makefile index a9ce4dbf..3d20976a 100644 --- a/console/makefile +++ b/console/makefile @@ -5,7 +5,7 @@ CFLAGS=-s -O3 #CFLAGS=-g # issue659: increase stack to 16mb -LFLAGS=-s -O3 -Wl,-stack_size -Wl,3f00000 +LFLAGS=-s -O3 -Wl,-stack_size -Wl,0x1000000 #Leak tests: # https://clang.llvm.org/docs/AddressSanitizer.html From 30aee1b2819fc2a7d24a2065b0fa5cd6835a48e0 Mon Sep 17 00:00:00 2001 From: Ningfei Li Date: Sat, 17 Dec 2022 23:14:37 +0100 Subject: [PATCH 33/85] CI: Update CI configurations. --- .appveyor.yml | 91 +++++++++++++++++++++++++++++++++++++++++++++++++++ .travis.yml | 47 -------------------------- README.md | 1 - appveyor.yml | 62 ----------------------------------- 4 files changed, 91 insertions(+), 110 deletions(-) create mode 100644 .appveyor.yml delete mode 100644 .travis.yml delete mode 100644 appveyor.yml diff --git a/.appveyor.yml b/.appveyor.yml new file mode 100644 index 00000000..16844fe2 --- /dev/null +++ b/.appveyor.yml @@ -0,0 +1,91 @@ +environment: + matrix: + - job_name: win + appveyor_build_worker_image: Visual Studio 2022 + + - job_name: linux + appveyor_build_worker_image: Ubuntu1604 + + - job_name: mac + appveyor_build_worker_image: macos-catalina + +matrix: + fast_finish: true + +version: build-{build} + +configuration: Release + +platform: x64 + +clone_depth: 1 + +init: + - ps: >- + $env:DATE = $(Get-Date -Format d-MMM-yyyy) + + $githash = $env:APPVEYOR_REPO_COMMIT.Substring(0, 7) + + $gittag = if ($env:APPVEYOR_REPO_TAG -eq $True) {"_$($env:APPVEYOR_REPO_TAG_NAME)"} else {""} + + Update-AppveyorBuild -Version "$($env:DATE)_g${githash}${gittag}" + + $env:RELEASE_VERSION = $(Get-Date -Format d-MMMM-yyyy) + +for: + - + matrix: + only: + - job_name: win + + build_script: + - cmake -Wno-dev -DBATCH_VERSION=ON -DUSE_OPENJPEG=ON -DUSE_JPEGLS=ON -B build + - cmake --build build --config %configuration% + + after_build: + - 7z a dcm2niix_win.zip .\build\bin\* >$null + - appveyor PushArtifact dcm2niix_win.zip + + - + matrix: + only: + - job_name: linux + + build_script: + - export CC=gcc-8 CXX=g++-8 + - cmake -Wno-dev -DBATCH_VERSION=ON -DUSE_OPENJPEG=ON -DUSE_JPEGLS=ON -B build + - cmake --build build + + after_build: + - strip -sx ./build/bin/* + - 7z a dcm2niix_lnx.zip ./build/bin/* &>/dev/null + - appveyor PushArtifact dcm2niix_lnx.zip + + - + matrix: + only: + - job_name: mac + + build_script: + - sudo xcode-select -s /Applications/Xcode-11.3.1.app + - cmake -Wno-dev -DBATCH_VERSION=ON -DUSE_OPENJPEG=ON -DUSE_JPEGLS=ON -B build + - cmake --build build + + after_build: + - strip -Sx ./build/bin/* + - 7z a dcm2niix_macos.zip ./build/bin/* &>/dev/null + - appveyor PushArtifact dcm2niix_macos.zip + +deploy: + - provider: GitHub + tag: $(APPVEYOR_REPO_TAG_NAME) + release: version $(RELEASE_VERSION) ($(APPVEYOR_REPO_TAG_NAME)) + description: "" + auth_token: + secure: gCltVLQEWsjSTRlsi8qw7FGP54ujBq60apjXkWTV954b65bOHl95hXMxxkQ734L4 + artifact: /dcm2niix_.*\.zip/ + draft: false + prerelease: false + on: + branch: master + APPVEYOR_REPO_TAG: true diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 8775c604..00000000 --- a/.travis.yml +++ /dev/null @@ -1,47 +0,0 @@ -language: cpp - -git: - depth: 1 - -matrix: - include: - - os: linux - dist: trusty - addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - g++-5 # support c++14 - env: - - MATRIX_EVAL="CC=gcc-5 && CXX=g++-5" - - TARGET=lnx - - os: osx - osx_image: xcode8.3 # Tracvis default: OS X 10.12.6 and Xcode 8.3.3 - env: TARGET=mac - -before_install: - - eval "${MATRIX_EVAL}" - - git submodule update --init --remote --depth=3 - -script: - # - mkdir build && cd build && cmake -DBATCH_VERSION=ON -DUSE_OPENJPEG=ON -DUSE_JPEGLS=true -DZLIB_IMPLEMENTATION=Cloudflare .. && make && cd - - - mkdir build && cd build && cmake -DBATCH_VERSION=OFF -DUSE_OPENJPEG=ON -DUSE_JPEGLS=true -DZLIB_IMPLEMENTATION=Cloudflare .. && make && cd - - - export PATH=$PWD/build/bin:$PATH - - cd dcm_qa && ./batch.sh && cd - - - cd dcm_qa_nih && ./batch.sh && cd - - - cd dcm_qa_uih && ./batch.sh && cd - - -before_deploy: - - zip -j dcm2niix_${TARGET}.zip build/bin/* - - sleep 300 # make sure appveyor deployment is done, thus proper release name is set - -deploy: - provider: releases - api_key: - secure: sVIYRakcEQdMPEdGSSePtMVCMQvaohqV7NNzEErAgZ+b/4ofv2aPpJb5kNTv3JRl2FrPy7iXJ8lOUQ/95pqvimX6jv5ztksTNXtSMnHZNbjjWwIc99enPY+mSdWMO2lb9vGBWQ9GNfXjmk7MgtDHPjjygbuZfUw9fmGy4ocxkws= - file_glob: true - file: dcm2niix*.zip - skip_cleanup: true - on: - tags: true diff --git a/README.md b/README.md index 877f57b2..235a76c1 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,3 @@ -[![Build Status](https://travis-ci.org/rordenlab/dcm2niix.svg?branch=master)](https://travis-ci.org/rordenlab/dcm2niix) [![Build status](https://ci.appveyor.com/api/projects/status/7o0xp2fgbhadkgn1?svg=true)](https://ci.appveyor.com/project/neurolabusc/dcm2niix) ## About diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 65b1f885..00000000 --- a/appveyor.yml +++ /dev/null @@ -1,62 +0,0 @@ -version: build-{build} - -image: Visual Studio 2015 - -configuration: Release - -platform: x64 - -clone_depth: 1 - -clone_folder: c:\projects\dcm2niix - -init: -- ps: >- - $env:DATE = $(Get-Date -Format d-MMM-yyyy) - - $githash = $env:APPVEYOR_REPO_COMMIT.Substring(0, 7) - - $gittag = if ($env:APPVEYOR_REPO_TAG -eq $True) {"_$($env:APPVEYOR_REPO_TAG_NAME)"} else {""} - - Update-AppveyorBuild -Version "$($env:DATE)_g${githash}${gittag}" - - $env:release_version = $(Get-Date -Format d-MMMM-yyyy) - -before_build: -- cmd: >- - echo "Running cmake" - - mkdir c:\projects\dcm2niix\build - - cd c:\projects\dcm2niix\build - - cmake -Wno-dev -G "Visual Studio 14 2015 Win64" -DBATCH_VERSION=ON -DUSE_OPENJPEG=ON -DUSE_JPEGLS=true ..\ - -build: - project: c:\projects\dcm2niix\build\dcm2niix.sln - - verbosity: normal - -after_build: -- ps: >- - cd c:\projects\dcm2niix - - 7z a dcm2niix_win.zip c:\projects\dcm2niix\build\bin\* >$null - -artifacts: - - path: dcm2niix*.zip - name: dcm2niix - -deploy: - - provider: GitHub - tag: $(appveyor_repo_tag_name) - release: version $(release_version) ($(appveyor_repo_tag_name)) - description: "" - auth_token: - secure: gCltVLQEWsjSTRlsi8qw7FGP54ujBq60apjXkWTV954b65bOHl95hXMxxkQ734L4 - artifact: dcm2niix - draft: false - prerelease: false - on: - branch: master - appveyor_repo_tag: true From a31c7b9f9d7a7e4d973f749f31961a3f561dc0f1 Mon Sep 17 00:00:00 2001 From: Ningfei Li Date: Sun, 18 Dec 2022 00:50:47 +0100 Subject: [PATCH 34/85] BUG: Fix max definition. It was not working with GCC. Ref: https://stackoverflow.com/a/58532788 --- console/nii_dicom.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/console/nii_dicom.cpp b/console/nii_dicom.cpp index cd518769..ae280ebe 100644 --- a/console/nii_dicom.cpp +++ b/console/nii_dicom.cpp @@ -1,5 +1,6 @@ //#define MY_DEBUG #if defined(_WIN64) || defined(_WIN32) +#define NOMINMAX #include //write to registry #endif #ifdef _MSC_VER @@ -36,16 +37,13 @@ #include #include // discriminate files from folders #include +#include #ifdef USING_R #undef isnan #define isnan ISNAN #endif -#ifndef max -#define max(a, b) (a > b ? a : b) -#endif - #ifndef myDisableClassicJPEG #ifdef myTurboJPEG #include @@ -2347,7 +2345,7 @@ struct TDICOMdata nii_readParRec(char *parname, int isVerbose, struct TDTI4D *dt //offset images by type: mag+0,real+1, imag+2,phase+3 //if (cols[kImageType] != 0) //yikes - phase maps! // slice = slice + numExpected; - maxSlice2D = max(slice, maxSlice2D); + maxSlice2D = std::max(slice, maxSlice2D); if ((slice >= 0) && (slice < kMaxSlice2D) && (numSlice2D < kMaxSlice2D) && (numSlice2D >= 0)) { dti4D->sliceOrder[slice - 1] = numSlice2D; //printMessage("%d\t%d\t%d\n", numSlice2D, slice, (int)cols[kSlice],(int)vol); @@ -2413,7 +2411,7 @@ struct TDICOMdata nii_readParRec(char *parname, int isVerbose, struct TDTI4D *dt if (d.isHasImaginary) nType ++; if (d.isHasPhase) nType ++; if (d.isHasReal) nType ++; - nType = max(nType, 1); + nType = std::max(nType, 1); if (slice != numSlice2D) { printError("Catastrophic error: found %d but expected %d slices. %s\n", slice, numSlice2D, parname); printMessage(" slices*grad*bval*cardiac*echo*dynamic*mix*labels*types = %d*%d*%d*%d*%d*%d*%d*%d*%d\n", From 084fb5f4504f63ff9db629b6d201b71a9448d89e Mon Sep 17 00:00:00 2001 From: Ningfei Li Date: Sun, 18 Dec 2022 01:17:08 +0100 Subject: [PATCH 35/85] Do not set c++14 flag for MSVC. --- console/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/console/CMakeLists.txt b/console/CMakeLists.txt index d18324d8..4e746814 100644 --- a/console/CMakeLists.txt +++ b/console/CMakeLists.txt @@ -114,8 +114,9 @@ if(USE_JPEGLS) add_definitions(-DmyEnableJPEGLS) if(MSVC) add_definitions(-DCHARLS_STATIC) + else() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14") endif() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14") set(CHARLS_SRCS charls/jpegls.cpp From 9864768390c34f311d0a05a9ed9846a8d79d6c55 Mon Sep 17 00:00:00 2001 From: Ningfei Li Date: Sun, 18 Dec 2022 01:34:38 +0100 Subject: [PATCH 36/85] Add links to development version in README. --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 235a76c1..a88fc615 100644 --- a/README.md +++ b/README.md @@ -43,11 +43,12 @@ Command line usage is described in the [NITRC wiki](https://www.nitrc.org/plugin There are a couple ways to install dcm2niix - [Github Releases](https://github.com/rordenlab/dcm2niix/releases) provides the latest compiled executables. This is an excellent option for MacOS and Windows users. However, the provided Linux executable requires a recent version of Linux (e.g. Ubuntu 14.04 or later), so the provided Unix executable is not suitable for very old distributions. Specifically, it requires Glibc 2.19 (from 2014) or later. Users of older systems can compile their own copy of dcm2niix or download the compiled version included with MRIcroGL Glibc 2.12 (from 2011, see below). - - Run the following command to get the latest version for Linux, Macintosh or Windows: + - Run the following command to get the latest release version for Linux, Macintosh or Windows: * `curl -fLO https://github.com/rordenlab/dcm2niix/releases/latest/download/dcm2niix_lnx.zip` * `curl -fLO https://github.com/rordenlab/dcm2niix/releases/latest/download/dcm2niix_mac.zip` * `curl -fLO https://github.com/rordenlab/dcm2niix/releases/latest/download/dcm2niix_mac_arm.pkg` * `curl -fLO https://github.com/rordenlab/dcm2niix/releases/latest/download/dcm2niix_win.zip` + - Latest development version is available on [AppVeyor](https://ci.appveyor.com/project/neurolabusc/dcm2niix) for [Linux](https://ci.appveyor.com/api/projects/neurolabusc/dcm2niix/artifacts/dcm2niix_lnx.zip?job=linux), [Macintosh](https://ci.appveyor.com/api/projects/neurolabusc/dcm2niix/artifacts/dcm2niix_mac.zip?job=mac) or [Windows](https://ci.appveyor.com/api/projects/neurolabusc/dcm2niix/artifacts/dcm2niix_win.zip?job=win). - [MRIcroGL (NITRC)](https://www.nitrc.org/projects/mricrogl) or [MRIcroGL (GitHub)](https://github.com/rordenlab/MRIcroGL12/releases) includes dcm2niix that can be run from the command line or from the graphical user interface (select the Import menu item). The Linux version of dcm2niix is compiled on a [holy build box](https://github.com/phusion/holy-build-box), so it should run on any Linux distribution. - If you have a MacOS computer with Homebrew or MacPorts you can run `brew install dcm2niix` or `sudo port install dcm2niix`, respectively. - If you have Conda, [`conda install -c conda-forge dcm2niix`](https://anaconda.org/conda-forge/dcm2niix) on Linux, MacOS or Windows. From dbe72ae4db7ca888e708243ec1af6473ad174c44 Mon Sep 17 00:00:00 2001 From: Ningfei Li Date: Sun, 18 Dec 2022 12:17:53 +0100 Subject: [PATCH 37/85] Add workaround for yaml-cpp-devel-0.7.0-1.fc38 on Fedora Rawhide. This closes #647. --- console/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/console/CMakeLists.txt b/console/CMakeLists.txt index 4e746814..aa52bd7c 100644 --- a/console/CMakeLists.txt +++ b/console/CMakeLists.txt @@ -211,6 +211,10 @@ if(BATCH_VERSION) set(YAML-CPP_DIR ${YAML-CPP_DIR} CACHE PATH "Path to yaml-cpp configuration file" FORCE) find_package(YAML-CPP REQUIRED) + if(YAML-CPP_FOUND AND NOT YAML_CPP_LIBRARIES) + # workaround for yaml-cpp-devel-0.7.0-1.fc38 on Fedora Rawhide + set(YAML_CPP_LIBRARIES yaml-cpp) + endif() target_include_directories(dcm2niibatch PRIVATE ${YAML_CPP_INCLUDE_DIR}) target_link_libraries(dcm2niibatch ${YAML_CPP_LIBRARIES}) From 12eeefb7e25c174aa4e85a6ca41f722237c29d9e Mon Sep 17 00:00:00 2001 From: Ningfei Li Date: Sun, 18 Dec 2022 15:00:15 +0100 Subject: [PATCH 38/85] Enable choosing different OpenJPEG and yaml-cpp installation. --- .appveyor.yml | 6 ++--- SuperBuild/SuperBuild.cmake | 53 +++++++++++++++++++++++-------------- 2 files changed, 36 insertions(+), 23 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 16844fe2..5eed215e 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -39,7 +39,7 @@ for: - job_name: win build_script: - - cmake -Wno-dev -DBATCH_VERSION=ON -DUSE_OPENJPEG=ON -DUSE_JPEGLS=ON -B build + - cmake -Wno-dev -DBATCH_VERSION=ON -DUSE_OPENJPEG=GitHub -DUSE_JPEGLS=ON -B build - cmake --build build --config %configuration% after_build: @@ -53,7 +53,7 @@ for: build_script: - export CC=gcc-8 CXX=g++-8 - - cmake -Wno-dev -DBATCH_VERSION=ON -DUSE_OPENJPEG=ON -DUSE_JPEGLS=ON -B build + - cmake -Wno-dev -DBATCH_VERSION=ON -DUSE_OPENJPEG=GitHub -DUSE_JPEGLS=ON -B build - cmake --build build after_build: @@ -68,7 +68,7 @@ for: build_script: - sudo xcode-select -s /Applications/Xcode-11.3.1.app - - cmake -Wno-dev -DBATCH_VERSION=ON -DUSE_OPENJPEG=ON -DUSE_JPEGLS=ON -B build + - cmake -Wno-dev -DBATCH_VERSION=ON -DUSE_OPENJPEG=GitHub -DUSE_JPEGLS=ON -B build - cmake --build build after_build: diff --git a/SuperBuild/SuperBuild.cmake b/SuperBuild/SuperBuild.cmake index f395cafb..ad682c94 100644 --- a/SuperBuild/SuperBuild.cmake +++ b/SuperBuild/SuperBuild.cmake @@ -38,7 +38,8 @@ endif() option(USE_TURBOJPEG "Use TurboJPEG to decode classic JPEG" OFF) option(USE_JASPER "Build with JPEG2000 support using Jasper" OFF) -option(USE_OPENJPEG "Build with JPEG2000 support using OpenJPEG" OFF) +set(USE_OPENJPEG "OFF" CACHE STRING "Build with JPEG2000 support using OpenJPEG.") +set_property(CACHE USE_OPENJPEG PROPERTY STRINGS "OFF;GitHub;System;Custom") option(USE_JPEGLS "Build with JPEG-LS support using CharLS" OFF) option(USE_JNIFTI "Build with JNIFTI support" ON) @@ -67,56 +68,68 @@ else() set(DEP_INSTALL_DIR ${CMAKE_BINARY_DIR}) endif() -if(USE_OPENJPEG) +if(NOT ${USE_OPENJPEG} STREQUAL "OFF") message("-- Build with OpenJPEG: ${USE_OPENJPEG}") if(OpenJPEG_DIR) + set(USE_OPENJPEG "Custom" CACHE STRING "Build with JPEG2000 support using OpenJPEG." FORCE) set(OpenJPEG_DIR "${OpenJPEG_DIR}" CACHE PATH "Path to OpenJPEG configuration file" FORCE) message("-- Using OpenJPEG library from ${OpenJPEG_DIR}") - else() + elseif(${USE_OPENJPEG} STREQUAL "System") find_package(PkgConfig) if(PKG_CONFIG_FOUND) pkg_check_modules(OPENJPEG libopenjp2) endif() - if(OPENJPEG_FOUND AND NOT ${OPENJPEG_INCLUDE_DIRS} MATCHES "gdcmopenjpeg") - set(OpenJPEG_DIR ${OPENJPEG_LIBDIR}/openjpeg-${OPENJPEG_VERSION} CACHE PATH "Path to OpenJPEG configuration file" FORCE) - message("-- Using OpenJPEG library from ${OpenJPEG_DIR}") - else() - if(${OPENJPEG_INCLUDE_DIRS} MATCHES "gdcmopenjpeg") + if(OPENJPEG_FOUND) + if(NOT ${OPENJPEG_INCLUDE_DIRS} MATCHES "gdcmopenjpeg") + set(OpenJPEG_DIR ${OPENJPEG_LIBDIR}/openjpeg-${OPENJPEG_VERSION} CACHE PATH "Path to OpenJPEG configuration file" FORCE) + message("-- Using OpenJPEG library from ${OpenJPEG_DIR}") + else() message("-- Unable to use GDCM's internal OpenJPEG") endif() - include(${CMAKE_SOURCE_DIR}/SuperBuild/External-OPENJPEG.cmake) - list(APPEND DEPENDENCIES openjpeg) - set(BUILD_OPENJPEG TRUE) - message("-- Will build OpenJPEG library from github") endif() endif() + + if(${USE_OPENJPEG} STREQUAL "GitHub" OR NOT OpenJPEG_DIR) + set(USE_OPENJPEG "GitHub" CACHE STRING "Build with JPEG2000 support using OpenJPEG." FORCE) + include(${CMAKE_SOURCE_DIR}/SuperBuild/External-OPENJPEG.cmake) + list(APPEND DEPENDENCIES openjpeg) + set(BUILD_OPENJPEG TRUE) + message("-- Will build OpenJPEG library from GitHub") + endif() endif() if(BATCH_VERSION) message("-- Build dcm2niibatch: ${BATCH_VERSION}") + set(YAML-CPP_IMPLEMENTATION "GitHub" CACHE STRING "Choose yaml-cpp implementation.") + set_property(CACHE YAML-CPP_IMPLEMENTATION PROPERTY STRINGS "GitHub;System;Custom") + if(YAML-CPP_DIR) + set(YAML-CPP_IMPLEMENTATION "Custom" CACHE STRING "Choose yaml-cpp implementation." FORCE) set(YAML-CPP_DIR ${YAML-CPP_DIR} CACHE PATH "Path to yaml-cpp configuration file" FORCE) message("-- Using yaml-cpp library from ${YAML-CPP_DIR}") - else() + elseif(${YAML-CPP_IMPLEMENTATION} STREQUAL "System") find_package(PkgConfig) if(PKG_CONFIG_FOUND) pkg_check_modules(YAML-CPP yaml-cpp) endif() - # Build from github if not found or version < 0.5.3 + # Build from GitHub if not found or version < 0.5.3 if(YAML-CPP_FOUND AND NOT (YAML-CPP_VERSION VERSION_LESS "0.5.3")) set(YAML-CPP_DIR ${YAML-CPP_LIBDIR}/cmake/yaml-cpp CACHE PATH "Path to yaml-cpp configuration file" FORCE) message("-- Using yaml-cpp library from ${YAML-CPP_DIR}") - else() - include(${CMAKE_SOURCE_DIR}/SuperBuild/External-YAML-CPP.cmake) - list(APPEND DEPENDENCIES yaml-cpp) - set(BUILD_YAML-CPP TRUE) - message("-- Will build yaml-cpp library from github") endif() endif() + + if(${YAML-CPP_IMPLEMENTATION} STREQUAL "GitHub" OR NOT YAML-CPP_DIR) + set(YAML-CPP_IMPLEMENTATION "GitHub" CACHE STRING "Choose yaml-cpp implementation." FORCE) + include(${CMAKE_SOURCE_DIR}/SuperBuild/External-YAML-CPP.cmake) + list(APPEND DEPENDENCIES yaml-cpp) + set(BUILD_YAML-CPP TRUE) + message("-- Will build yaml-cpp library from GitHub") + endif() endif() set(ZLIB_IMPLEMENTATION "Miniz" CACHE STRING "Choose zlib implementation.") @@ -126,7 +139,7 @@ if(${ZLIB_IMPLEMENTATION} STREQUAL "Cloudflare") include(${CMAKE_SOURCE_DIR}/SuperBuild/External-CLOUDFLARE-ZLIB.cmake) list(APPEND DEPENDENCIES zlib) set(BUILD_CLOUDFLARE-ZLIB TRUE) - message("-- Will build Cloudflare zlib from github") + message("-- Will build Cloudflare zlib from GitHub") elseif(${ZLIB_IMPLEMENTATION} STREQUAL "Custom") set(ZLIB_ROOT ${ZLIB_ROOT} CACHE PATH "Specify custom zlib root directory.") if(NOT ZLIB_ROOT) From 5c016bdf58f4d799a6b7e7214bd3423808cee824 Mon Sep 17 00:00:00 2001 From: Ningfei Li Date: Sun, 18 Dec 2022 15:04:51 +0100 Subject: [PATCH 39/85] Remove git_protocol option. git protocol not working anymore on GitHub. --- SuperBuild/External-CLOUDFLARE-ZLIB.cmake | 2 +- SuperBuild/External-OPENJPEG.cmake | 2 +- SuperBuild/External-YAML-CPP.cmake | 2 +- SuperBuild/SuperBuild.cmake | 8 -------- 4 files changed, 3 insertions(+), 11 deletions(-) diff --git a/SuperBuild/External-CLOUDFLARE-ZLIB.cmake b/SuperBuild/External-CLOUDFLARE-ZLIB.cmake index 9f064ebc..7f4e781a 100644 --- a/SuperBuild/External-CLOUDFLARE-ZLIB.cmake +++ b/SuperBuild/External-CLOUDFLARE-ZLIB.cmake @@ -1,7 +1,7 @@ set(CLOUDFLARE_BRANCH gcc.amd64) # Cloudflare zlib branch ExternalProject_Add(zlib - GIT_REPOSITORY "${git_protocol}://github.com/ningfei/zlib.git" + GIT_REPOSITORY "https://github.com/ningfei/zlib.git" GIT_TAG "${CLOUDFLARE_BRANCH}" SOURCE_DIR cloudflare-zlib BINARY_DIR cloudflare-zlib-build diff --git a/SuperBuild/External-OPENJPEG.cmake b/SuperBuild/External-OPENJPEG.cmake index 565c14cb..84b3afce 100644 --- a/SuperBuild/External-OPENJPEG.cmake +++ b/SuperBuild/External-OPENJPEG.cmake @@ -1,7 +1,7 @@ set(OPENJPEG_TAG v2.1-static) # version v2.1-static ExternalProject_Add(openjpeg - GIT_REPOSITORY "${git_protocol}://github.com/ningfei/openjpeg.git" + GIT_REPOSITORY "https://github.com/ningfei/openjpeg.git" GIT_TAG "${OPENJPEG_TAG}" SOURCE_DIR openjpeg BINARY_DIR openjpeg-build diff --git a/SuperBuild/External-YAML-CPP.cmake b/SuperBuild/External-YAML-CPP.cmake index 2e1aef1e..5cea5931 100644 --- a/SuperBuild/External-YAML-CPP.cmake +++ b/SuperBuild/External-YAML-CPP.cmake @@ -1,7 +1,7 @@ set(YAML-CPP_TAG yaml-cpp-0.5.3) # version yaml-cpp-0.5.3 ExternalProject_Add(yaml-cpp - GIT_REPOSITORY "${git_protocol}://github.com/ningfei/yaml-cpp.git" + GIT_REPOSITORY "https://github.com/ningfei/yaml-cpp.git" GIT_TAG "${YAML-CPP_TAG}" SOURCE_DIR yaml-cpp BINARY_DIR yaml-cpp-build diff --git a/SuperBuild/SuperBuild.cmake b/SuperBuild/SuperBuild.cmake index ad682c94..fb454b3a 100644 --- a/SuperBuild/SuperBuild.cmake +++ b/SuperBuild/SuperBuild.cmake @@ -4,14 +4,6 @@ if(NOT GIT_FOUND) message(FATAL_ERROR "Cannot find Git. Git is required for Superbuild") endif() -# Use git protocol or not -option(USE_GIT_PROTOCOL "If behind a firewall turn this off to use http instead." OFF) -if(USE_GIT_PROTOCOL) - set(git_protocol "git") -else() - set(git_protocol "https") -endif() - # Basic CMake build settings if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "Release" CACHE STRING From 2eb659ec465df46bf10acd45d885d8ce4fb31140 Mon Sep 17 00:00:00 2001 From: Ningfei Li Date: Sun, 18 Dec 2022 15:57:44 +0100 Subject: [PATCH 40/85] CI builds universal binaries for macOS. --- .appveyor.yml | 14 +- CMakeCache.txt | 411 +++++++++ CMakeFiles/3.25.1/CMakeCCompiler.cmake | 72 ++ CMakeFiles/3.25.1/CMakeCXXCompiler.cmake | 83 ++ .../3.25.1/CMakeDetermineCompilerABI_C.bin | Bin 0 -> 16712 bytes .../3.25.1/CMakeDetermineCompilerABI_CXX.bin | Bin 0 -> 16696 bytes CMakeFiles/3.25.1/CMakeSystem.cmake | 15 + .../3.25.1/CompilerIdC/CMakeCCompilerId.c | 868 ++++++++++++++++++ .../3.25.1/CompilerIdC/CMakeCCompilerId.o | Bin 0 -> 1712 bytes .../CompilerIdCXX/CMakeCXXCompilerId.cpp | 857 +++++++++++++++++ .../3.25.1/CompilerIdCXX/CMakeCXXCompilerId.o | Bin 0 -> 1712 bytes CMakeFiles/CMakeError.log | 0 CMakeFiles/CMakeOutput.log | 312 +++++++ CMakeFiles/cmake.check_cache | 1 + SuperBuild/External-CLOUDFLARE-ZLIB.cmake | 1 + SuperBuild/External-OPENJPEG.cmake | 1 + SuperBuild/External-YAML-CPP.cmake | 1 + SuperBuild/SuperBuild.cmake | 11 +- .../src/console-stamp/console-custominfo.txt | 9 + console-prefix/tmp/console-cfgcmd.txt | 1 + console-prefix/tmp/console-mkdirs.cmake | 22 + 21 files changed, 2671 insertions(+), 8 deletions(-) create mode 100644 CMakeCache.txt create mode 100644 CMakeFiles/3.25.1/CMakeCCompiler.cmake create mode 100644 CMakeFiles/3.25.1/CMakeCXXCompiler.cmake create mode 100755 CMakeFiles/3.25.1/CMakeDetermineCompilerABI_C.bin create mode 100755 CMakeFiles/3.25.1/CMakeDetermineCompilerABI_CXX.bin create mode 100644 CMakeFiles/3.25.1/CMakeSystem.cmake create mode 100644 CMakeFiles/3.25.1/CompilerIdC/CMakeCCompilerId.c create mode 100644 CMakeFiles/3.25.1/CompilerIdC/CMakeCCompilerId.o create mode 100644 CMakeFiles/3.25.1/CompilerIdCXX/CMakeCXXCompilerId.cpp create mode 100644 CMakeFiles/3.25.1/CompilerIdCXX/CMakeCXXCompilerId.o create mode 100644 CMakeFiles/CMakeError.log create mode 100644 CMakeFiles/CMakeOutput.log create mode 100644 CMakeFiles/cmake.check_cache create mode 100644 console-prefix/src/console-stamp/console-custominfo.txt create mode 100644 console-prefix/tmp/console-cfgcmd.txt create mode 100644 console-prefix/tmp/console-mkdirs.cmake diff --git a/.appveyor.yml b/.appveyor.yml index 5eed215e..faaf7828 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -57,7 +57,7 @@ for: - cmake --build build after_build: - - strip -sx ./build/bin/* + - strip -sx build/bin/* - 7z a dcm2niix_lnx.zip ./build/bin/* &>/dev/null - appveyor PushArtifact dcm2niix_lnx.zip @@ -68,11 +68,17 @@ for: build_script: - sudo xcode-select -s /Applications/Xcode-11.3.1.app - - cmake -Wno-dev -DBATCH_VERSION=ON -DUSE_OPENJPEG=GitHub -DUSE_JPEGLS=ON -B build - - cmake --build build + - cmake -Wno-dev -DCMAKE_OSX_ARCHITECTURES=x86_64 -DBATCH_VERSION=ON -DUSE_OPENJPEG=GitHub -DUSE_JPEGLS=ON -B intel + - cmake --build intel + - sudo xcode-select -s /Applications/Xcode-12.3.app + - cmake -Wno-dev -DCMAKE_OSX_ARCHITECTURES=arm64 -DBATCH_VERSION=ON -DUSE_OPENJPEG=GitHub -DUSE_JPEGLS=ON -B apple + - cmake --build apple after_build: - - strip -Sx ./build/bin/* + - mkdir -p build/bin + - lipo -create -output build/bin/dcm2niix intel/bin/dcm2niix apple/bin/dcm2niix + - lipo -create -output build/bin/dcm2niibatch intel/bin/dcm2niibatch apple/bin/dcm2niibatch + - strip -Sx build/bin/* - 7z a dcm2niix_macos.zip ./build/bin/* &>/dev/null - appveyor PushArtifact dcm2niix_macos.zip diff --git a/CMakeCache.txt b/CMakeCache.txt new file mode 100644 index 00000000..e16af8c3 --- /dev/null +++ b/CMakeCache.txt @@ -0,0 +1,411 @@ +# This is the CMakeCache file. +# For build in directory: /Users/ningfei/Repo/dcm2niix +# It was generated by CMake: /opt/homebrew/Cellar/cmake/3.25.1/bin/cmake +# You can edit this file to change values found and used by cmake. +# If you do not want to change any of the values, simply exit the editor. +# If you do want to change a value, simply edit, save, and exit the editor. +# The syntax for the file is as follows: +# KEY:TYPE=VALUE +# KEY is the name of a variable in the cache. +# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!. +# VALUE is the current value for the KEY. + +######################## +# EXTERNAL cache entries +######################## + +//Build dcm2niibatch for multiple conversions +BATCH_VERSION:BOOL=OFF + +//Build libdcm2niixfs.a +BUILD_DCM2NIIXFSLIB:BOOL=OFF + +//Build documentation (manpages) +BUILD_DOCS:BOOL=OFF + +//Path to a program. +CMAKE_ADDR2LINE:FILEPATH=CMAKE_ADDR2LINE-NOTFOUND + +//Path to a program. +CMAKE_AR:FILEPATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar + +//Choose the type of build, options are: Debug Release RelWithDebInfo +// MinSizeRel. +CMAKE_BUILD_TYPE:STRING=Release + +//Enable/Disable color output during build. +CMAKE_COLOR_MAKEFILE:BOOL=ON + +//CXX compiler +CMAKE_CXX_COMPILER:FILEPATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ + +//Flags used by the CXX compiler during all build types. +CMAKE_CXX_FLAGS:STRING= + +//Flags used by the CXX compiler during DEBUG builds. +CMAKE_CXX_FLAGS_DEBUG:STRING=-g + +//Flags used by the CXX compiler during MINSIZEREL builds. +CMAKE_CXX_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG + +//Flags used by the CXX compiler during RELEASE builds. +CMAKE_CXX_FLAGS_RELEASE:STRING=-O3 -DNDEBUG + +//Flags used by the CXX compiler during RELWITHDEBINFO builds. +CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG + +//C compiler +CMAKE_C_COMPILER:FILEPATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc + +//Flags used by the C compiler during all build types. +CMAKE_C_FLAGS:STRING= + +//Flags used by the C compiler during DEBUG builds. +CMAKE_C_FLAGS_DEBUG:STRING=-g + +//Flags used by the C compiler during MINSIZEREL builds. +CMAKE_C_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG + +//Flags used by the C compiler during RELEASE builds. +CMAKE_C_FLAGS_RELEASE:STRING=-O3 -DNDEBUG + +//Flags used by the C compiler during RELWITHDEBINFO builds. +CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG + +//Path to a program. +CMAKE_DLLTOOL:FILEPATH=CMAKE_DLLTOOL-NOTFOUND + +//Flags used by the linker during all build types. +CMAKE_EXE_LINKER_FLAGS:STRING= + +//Flags used by the linker during DEBUG builds. +CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during MINSIZEREL builds. +CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during RELEASE builds. +CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during RELWITHDEBINFO builds. +CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//Enable/Disable output of compile commands during generation. +CMAKE_EXPORT_COMPILE_COMMANDS:BOOL= + +//Value Computed by CMake. +CMAKE_FIND_PACKAGE_REDIRECTS_DIR:STATIC=/Users/ningfei/Repo/dcm2niix/CMakeFiles/pkgRedirects + +//Path to a program. +CMAKE_INSTALL_NAME_TOOL:FILEPATH=/usr/bin/install_name_tool + +//Install path prefix, prepended onto install directories. +CMAKE_INSTALL_PREFIX:PATH=/usr/local + +//Path to a program. +CMAKE_LINKER:FILEPATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld + +//Path to a program. +CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/make + +//Flags used by the linker during the creation of modules during +// all build types. +CMAKE_MODULE_LINKER_FLAGS:STRING= + +//Flags used by the linker during the creation of modules during +// DEBUG builds. +CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during the creation of modules during +// MINSIZEREL builds. +CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during the creation of modules during +// RELEASE builds. +CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during the creation of modules during +// RELWITHDEBINFO builds. +CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//Path to a program. +CMAKE_NM:FILEPATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm + +//Path to a program. +CMAKE_OBJCOPY:FILEPATH=CMAKE_OBJCOPY-NOTFOUND + +//Path to a program. +CMAKE_OBJDUMP:FILEPATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/objdump + +//Build architectures for OSX +CMAKE_OSX_ARCHITECTURES:STRING=x86_64 + +//Minimum OS X version to target for deployment (at runtime); newer +// APIs weak linked. Set to empty string for default value. +CMAKE_OSX_DEPLOYMENT_TARGET:STRING= + +//The product will be built against the headers and libraries located +// inside the indicated SDK. +CMAKE_OSX_SYSROOT:PATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk + +//Value Computed by CMake +CMAKE_PROJECT_DESCRIPTION:STATIC= + +//Value Computed by CMake +CMAKE_PROJECT_HOMEPAGE_URL:STATIC= + +//Value Computed by CMake +CMAKE_PROJECT_NAME:STATIC=dcm2niix + +//Path to a program. +CMAKE_RANLIB:FILEPATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib + +//Path to a program. +CMAKE_READELF:FILEPATH=CMAKE_READELF-NOTFOUND + +//Flags used by the linker during the creation of shared libraries +// during all build types. +CMAKE_SHARED_LINKER_FLAGS:STRING= + +//Flags used by the linker during the creation of shared libraries +// during DEBUG builds. +CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during the creation of shared libraries +// during MINSIZEREL builds. +CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during the creation of shared libraries +// during RELEASE builds. +CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during the creation of shared libraries +// during RELWITHDEBINFO builds. +CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//If set, runtime paths are not added when installing shared libraries, +// but are added when building. +CMAKE_SKIP_INSTALL_RPATH:BOOL=NO + +//If set, runtime paths are not added when using shared libraries. +CMAKE_SKIP_RPATH:BOOL=NO + +//Flags used by the linker during the creation of static libraries +// during all build types. +CMAKE_STATIC_LINKER_FLAGS:STRING= + +//Flags used by the linker during the creation of static libraries +// during DEBUG builds. +CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during the creation of static libraries +// during MINSIZEREL builds. +CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during the creation of static libraries +// during RELEASE builds. +CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during the creation of static libraries +// during RELWITHDEBINFO builds. +CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//Path to a program. +CMAKE_STRIP:FILEPATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip + +//If this value is on, makefiles will be generated without the +// .SILENT directive, and all commands will be echoed to the console +// during the make. This is useful for debugging only. With Visual +// Studio IDE projects all commands are done without /nologo. +CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE + +//Git command line client +GIT_EXECUTABLE:FILEPATH=/opt/homebrew/bin/git + +//Optionally install built dependent libraries (OpenJPEG and yaml-cpp) +// for future use. +INSTALL_DEPENDENCIES:BOOL=OFF + +//Build with JPEG2000 support using Jasper +USE_JASPER:BOOL=OFF + +//Build with JNIFTI support +USE_JNIFTI:BOOL=ON + +//Build with JPEG-LS support using CharLS +USE_JPEGLS:BOOL=OFF + +//Build with JPEG2000 support using OpenJPEG. +USE_OPENJPEG:STRING=OFF + +//Use static runtime +USE_STATIC_RUNTIME:BOOL=ON + +//Use TurboJPEG to decode classic JPEG +USE_TURBOJPEG:BOOL=OFF + +//Choose zlib implementation. +ZLIB_IMPLEMENTATION:STRING=Miniz + +//Value Computed by CMake +dcm2niix_BINARY_DIR:STATIC=/Users/ningfei/Repo/dcm2niix + +//Value Computed by CMake +dcm2niix_IS_TOP_LEVEL:STATIC=ON + +//Value Computed by CMake +dcm2niix_SOURCE_DIR:STATIC=/Users/ningfei/Repo/dcm2niix + + +######################## +# INTERNAL cache entries +######################## + +//ADVANCED property for variable: CMAKE_ADDR2LINE +CMAKE_ADDR2LINE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_AR +CMAKE_AR-ADVANCED:INTERNAL=1 +//STRINGS property for variable: CMAKE_BUILD_TYPE +CMAKE_BUILD_TYPE-STRINGS:INTERNAL=Debug;Release;RelWithDebInfo;MinSizeRel +//This is the directory where this CMakeCache.txt was created +CMAKE_CACHEFILE_DIR:INTERNAL=/Users/ningfei/Repo/dcm2niix +//Major version of cmake used to create the current loaded cache +CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3 +//Minor version of cmake used to create the current loaded cache +CMAKE_CACHE_MINOR_VERSION:INTERNAL=25 +//Patch version of cmake used to create the current loaded cache +CMAKE_CACHE_PATCH_VERSION:INTERNAL=1 +//ADVANCED property for variable: CMAKE_COLOR_MAKEFILE +CMAKE_COLOR_MAKEFILE-ADVANCED:INTERNAL=1 +//Path to CMake executable. +CMAKE_COMMAND:INTERNAL=/opt/homebrew/Cellar/cmake/3.25.1/bin/cmake +//Path to cpack program executable. +CMAKE_CPACK_COMMAND:INTERNAL=/opt/homebrew/Cellar/cmake/3.25.1/bin/cpack +//Path to ctest program executable. +CMAKE_CTEST_COMMAND:INTERNAL=/opt/homebrew/Cellar/cmake/3.25.1/bin/ctest +//ADVANCED property for variable: CMAKE_CXX_COMPILER +CMAKE_CXX_COMPILER-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS +CMAKE_CXX_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_DEBUG +CMAKE_CXX_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_MINSIZEREL +CMAKE_CXX_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELEASE +CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELWITHDEBINFO +CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_COMPILER +CMAKE_C_COMPILER-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS +CMAKE_C_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_DEBUG +CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_MINSIZEREL +CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_RELEASE +CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_RELWITHDEBINFO +CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_DLLTOOL +CMAKE_DLLTOOL-ADVANCED:INTERNAL=1 +//Path to cache edit program executable. +CMAKE_EDIT_COMMAND:INTERNAL=/opt/homebrew/Cellar/cmake/3.25.1/bin/ccmake +//Executable file format +CMAKE_EXECUTABLE_FORMAT:INTERNAL=MACHO +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS +CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG +CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL +CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE +CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS +CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1 +//Name of external makefile project generator. +CMAKE_EXTRA_GENERATOR:INTERNAL= +//Name of generator. +CMAKE_GENERATOR:INTERNAL=Unix Makefiles +//Generator instance identifier. +CMAKE_GENERATOR_INSTANCE:INTERNAL= +//Name of generator platform. +CMAKE_GENERATOR_PLATFORM:INTERNAL= +//Name of generator toolset. +CMAKE_GENERATOR_TOOLSET:INTERNAL= +//Source directory with the top level CMakeLists.txt file for this +// project +CMAKE_HOME_DIRECTORY:INTERNAL=/Users/ningfei/Repo/dcm2niix +//ADVANCED property for variable: CMAKE_INSTALL_NAME_TOOL +CMAKE_INSTALL_NAME_TOOL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_LINKER +CMAKE_LINKER-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MAKE_PROGRAM +CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS +CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG +CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL +CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE +CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_NM +CMAKE_NM-ADVANCED:INTERNAL=1 +//number of local generators +CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=1 +//ADVANCED property for variable: CMAKE_OBJCOPY +CMAKE_OBJCOPY-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_OBJDUMP +CMAKE_OBJDUMP-ADVANCED:INTERNAL=1 +//Platform information initialized +CMAKE_PLATFORM_INFO_INITIALIZED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_RANLIB +CMAKE_RANLIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_READELF +CMAKE_READELF-ADVANCED:INTERNAL=1 +//Path to CMake installation. +CMAKE_ROOT:INTERNAL=/opt/homebrew/Cellar/cmake/3.25.1/share/cmake +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS +CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG +CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL +CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE +CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH +CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SKIP_RPATH +CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS +CMAKE_STATIC_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_DEBUG +CMAKE_STATIC_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL +CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELEASE +CMAKE_STATIC_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STRIP +CMAKE_STRIP-ADVANCED:INTERNAL=1 +//uname command +CMAKE_UNAME:INTERNAL=/usr/bin/uname +//ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE +CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1 +//Details about finding Git +FIND_PACKAGE_MESSAGE_DETAILS_Git:INTERNAL=[/opt/homebrew/bin/git][v2.38.1()] +//ADVANCED property for variable: GIT_EXECUTABLE +GIT_EXECUTABLE-ADVANCED:INTERNAL=1 +//STRINGS property for variable: USE_OPENJPEG +USE_OPENJPEG-STRINGS:INTERNAL=OFF;GitHub;System;Custom +//STRINGS property for variable: ZLIB_IMPLEMENTATION +ZLIB_IMPLEMENTATION-STRINGS:INTERNAL=Miniz;System;Cloudflare;Custom + diff --git a/CMakeFiles/3.25.1/CMakeCCompiler.cmake b/CMakeFiles/3.25.1/CMakeCCompiler.cmake new file mode 100644 index 00000000..30eb4797 --- /dev/null +++ b/CMakeFiles/3.25.1/CMakeCCompiler.cmake @@ -0,0 +1,72 @@ +set(CMAKE_C_COMPILER "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc") +set(CMAKE_C_COMPILER_ARG1 "") +set(CMAKE_C_COMPILER_ID "AppleClang") +set(CMAKE_C_COMPILER_VERSION "14.0.0.14000029") +set(CMAKE_C_COMPILER_VERSION_INTERNAL "") +set(CMAKE_C_COMPILER_WRAPPER "") +set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "17") +set(CMAKE_C_EXTENSIONS_COMPUTED_DEFAULT "ON") +set(CMAKE_C_COMPILE_FEATURES "c_std_90;c_function_prototypes;c_std_99;c_restrict;c_variadic_macros;c_std_11;c_static_assert;c_std_17;c_std_23") +set(CMAKE_C90_COMPILE_FEATURES "c_std_90;c_function_prototypes") +set(CMAKE_C99_COMPILE_FEATURES "c_std_99;c_restrict;c_variadic_macros") +set(CMAKE_C11_COMPILE_FEATURES "c_std_11;c_static_assert") +set(CMAKE_C17_COMPILE_FEATURES "c_std_17") +set(CMAKE_C23_COMPILE_FEATURES "c_std_23") + +set(CMAKE_C_PLATFORM_ID "Darwin") +set(CMAKE_C_SIMULATE_ID "") +set(CMAKE_C_COMPILER_FRONTEND_VARIANT "") +set(CMAKE_C_SIMULATE_VERSION "") + + + + +set(CMAKE_AR "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar") +set(CMAKE_C_COMPILER_AR "") +set(CMAKE_RANLIB "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib") +set(CMAKE_C_COMPILER_RANLIB "") +set(CMAKE_LINKER "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld") +set(CMAKE_MT "") +set(CMAKE_COMPILER_IS_GNUCC ) +set(CMAKE_C_COMPILER_LOADED 1) +set(CMAKE_C_COMPILER_WORKS TRUE) +set(CMAKE_C_ABI_COMPILED TRUE) + +set(CMAKE_C_COMPILER_ENV_VAR "CC") + +set(CMAKE_C_COMPILER_ID_RUN 1) +set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m) +set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) +set(CMAKE_C_LINKER_PREFERENCE 10) + +# Save compiler ABI information. +set(CMAKE_C_SIZEOF_DATA_PTR "8") +set(CMAKE_C_COMPILER_ABI "") +set(CMAKE_C_BYTE_ORDER "LITTLE_ENDIAN") +set(CMAKE_C_LIBRARY_ARCHITECTURE "") + +if(CMAKE_C_SIZEOF_DATA_PTR) + set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}") +endif() + +if(CMAKE_C_COMPILER_ABI) + set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}") +endif() + +if(CMAKE_C_LIBRARY_ARCHITECTURE) + set(CMAKE_LIBRARY_ARCHITECTURE "") +endif() + +set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "") +if(CMAKE_C_CL_SHOWINCLUDES_PREFIX) + set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_C_CL_SHOWINCLUDES_PREFIX}") +endif() + + + + + +set(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES "/opt/homebrew/include;/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include;/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include") +set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "") +set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "/Users/ningfei/.local/lib;/opt/homebrew/lib;/Users/ningfei/Repo/dcm2niix;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/lib") +set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/System/Library/Frameworks") diff --git a/CMakeFiles/3.25.1/CMakeCXXCompiler.cmake b/CMakeFiles/3.25.1/CMakeCXXCompiler.cmake new file mode 100644 index 00000000..ee0e7381 --- /dev/null +++ b/CMakeFiles/3.25.1/CMakeCXXCompiler.cmake @@ -0,0 +1,83 @@ +set(CMAKE_CXX_COMPILER "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++") +set(CMAKE_CXX_COMPILER_ARG1 "") +set(CMAKE_CXX_COMPILER_ID "AppleClang") +set(CMAKE_CXX_COMPILER_VERSION "14.0.0.14000029") +set(CMAKE_CXX_COMPILER_VERSION_INTERNAL "") +set(CMAKE_CXX_COMPILER_WRAPPER "") +set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "98") +set(CMAKE_CXX_EXTENSIONS_COMPUTED_DEFAULT "ON") +set(CMAKE_CXX_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters;cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates;cxx_std_17;cxx_std_20;cxx_std_23") +set(CMAKE_CXX98_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters") +set(CMAKE_CXX11_COMPILE_FEATURES "cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates") +set(CMAKE_CXX14_COMPILE_FEATURES "cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates") +set(CMAKE_CXX17_COMPILE_FEATURES "cxx_std_17") +set(CMAKE_CXX20_COMPILE_FEATURES "cxx_std_20") +set(CMAKE_CXX23_COMPILE_FEATURES "cxx_std_23") + +set(CMAKE_CXX_PLATFORM_ID "Darwin") +set(CMAKE_CXX_SIMULATE_ID "") +set(CMAKE_CXX_COMPILER_FRONTEND_VARIANT "") +set(CMAKE_CXX_SIMULATE_VERSION "") + + + + +set(CMAKE_AR "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar") +set(CMAKE_CXX_COMPILER_AR "") +set(CMAKE_RANLIB "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib") +set(CMAKE_CXX_COMPILER_RANLIB "") +set(CMAKE_LINKER "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld") +set(CMAKE_MT "") +set(CMAKE_COMPILER_IS_GNUCXX ) +set(CMAKE_CXX_COMPILER_LOADED 1) +set(CMAKE_CXX_COMPILER_WORKS TRUE) +set(CMAKE_CXX_ABI_COMPILED TRUE) + +set(CMAKE_CXX_COMPILER_ENV_VAR "CXX") + +set(CMAKE_CXX_COMPILER_ID_RUN 1) +set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;mpp;CPP;ixx;cppm) +set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC) + +foreach (lang C OBJC OBJCXX) + if (CMAKE_${lang}_COMPILER_ID_RUN) + foreach(extension IN LISTS CMAKE_${lang}_SOURCE_FILE_EXTENSIONS) + list(REMOVE_ITEM CMAKE_CXX_SOURCE_FILE_EXTENSIONS ${extension}) + endforeach() + endif() +endforeach() + +set(CMAKE_CXX_LINKER_PREFERENCE 30) +set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1) + +# Save compiler ABI information. +set(CMAKE_CXX_SIZEOF_DATA_PTR "8") +set(CMAKE_CXX_COMPILER_ABI "") +set(CMAKE_CXX_BYTE_ORDER "LITTLE_ENDIAN") +set(CMAKE_CXX_LIBRARY_ARCHITECTURE "") + +if(CMAKE_CXX_SIZEOF_DATA_PTR) + set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}") +endif() + +if(CMAKE_CXX_COMPILER_ABI) + set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}") +endif() + +if(CMAKE_CXX_LIBRARY_ARCHITECTURE) + set(CMAKE_LIBRARY_ARCHITECTURE "") +endif() + +set(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX "") +if(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX) + set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_CXX_CL_SHOWINCLUDES_PREFIX}") +endif() + + + + + +set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "/opt/homebrew/include;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/c++/v1;/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include;/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include") +set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "c++") +set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "/Users/ningfei/.local/lib;/opt/homebrew/lib;/Users/ningfei/Repo/dcm2niix;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/lib") +set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/System/Library/Frameworks") diff --git a/CMakeFiles/3.25.1/CMakeDetermineCompilerABI_C.bin b/CMakeFiles/3.25.1/CMakeDetermineCompilerABI_C.bin new file mode 100755 index 0000000000000000000000000000000000000000..e094821d4ebd22d30d0eadf47af5226f01f05d62 GIT binary patch literal 16712 zcmeI3&ubG=5XWCkixvCpB#It_2dy63qJ@@HY+AZ)R@-f?5yVoSO|!KNX;P96HbSKr z!60J)3lCnzi{QbFhaUClKOkNr^jJj1@4Ve5*;X$-e+Py)-+Av%=6yET`SR=MpVLYu zl1iyl@ILqe#B-HGq|^m?2Cj8>YR-CSEiFnmZi%@3r;<8jIH+~bdXS4BG56E)oCa`a` ztaYvQ#48oFS6VL{9q;d5SWlRWi5Bkvvljn(+qq-S*b%#Q&{xDMS~KCtkR=RF=@F%N z`z1=_J7BpP>M>~PMS3_7e*rDLzhT|NdKR9Ai^&;r`4)2KB-V>dDR?)0s8+2E6}|jW zpqvknfGB88^HUd zj(q=ili!v1%bvVNsjGNOqSXufxmU0H?&je1Ao}w1=8(FAMe6USmFmKJE!4t`Mgk;2 z0wh2JBtQZrKmsH{0wh2JBtQZrKmsH{0wh2JBtQZrKmsH{0wh2JBtQZrKmsH{0wh2J zBtQZrKmsH{0wh2JBtQZrKmsH{0wh2JBtQZrKmsIiG6MHAjqm%`Z@JvqIm|R_2m4l2 zRAz1AF!QQ&0%6~$j;^HDY*@`OIVZ^v9hq2iDVBU`HCH|(V>`2p<5lmeTVB_NEx)on zJQj_jV^=B1UYyO3`*rPB%5Gt~Vo&Qi$FgUfsbFN?+|Sp2SC=aVx3WBM=W_FwwwxJz z%0VTWf4*cY#aEeSmRV=ac^h{yS1u-6W~94uv)|m7Y%36vf)9s|CAMkit0j5V5?Y-x z1Jp^qxuM-{cddq|H{4ZptvY4;UAJLSqnoQPrL@-ooIVXe6`YKIXl#A25*p6ejVH_hqK?V|{7USCDUE*Lm-;c1s0swWN;i O6+PcCy3sa%OYASt+{sD+ literal 0 HcmV?d00001 diff --git a/CMakeFiles/3.25.1/CMakeDetermineCompilerABI_CXX.bin b/CMakeFiles/3.25.1/CMakeDetermineCompilerABI_CXX.bin new file mode 100755 index 0000000000000000000000000000000000000000..7c54cfe0cd7a3abad27407e2a682ac21fe45c5df GIT binary patch literal 16696 zcmeI3&ubG=5XWDdRx9?`K}As^2Yi*Z|Ogwj}^P4?9;q??j#un`Kq zcnBi+r+Ctv2p)R$r2l~jAxbYo5fNwJ+a+167th~;$$Q_oGqdwPo9le|@%7hHAreU; zLc2lOWh*PvOV>VvGt=1Dl?DDte zxHK)-LY*c(N}78(O}<5%dB3A|o7Usxi{xzl4Wj=E$NZ1=QBsP$hkT?~t&Ehs!iZZh zxun_7l5-zlK7JoO*_>3bAC7+dcI5nxaXL$pn>+Q=rdRLv{~|Gw9HeLZezdY(q5E+i z{{HR8@8$dQGrqI9aDuLqX!Sz<6o-a}$A+mXub}%(x5taihvM(otAW}ao(WU9s<=eX z{cKDL(M{{sP%~c`2!H?xfB*=900@8p2!H?xfB*=900@8p2!H?xfB*=900@8p2!H?x zfB*=900@8p2!H?xfB*=900@8p2!H?xfB*=900@8p2!H?xfB*=900@8p2!Mbg@F3Ip zyl4Gn(bzf2G-~^MR+Ckxc<&(dqU#oI``>nUC#`0~YKDjNeE6m_6FXdr9X_|3tMBQ= zcIFl)tKL&pUYG7xP|1&`qfvBvDuiP%%oQesx>S|2a`P2?M$S8yJ?l)Hk#(J4s0T`x zE3T^Kvvw|*wWQ_D+S3kI;`!%ux>9`QS!SMfra5oz4$YObvE~`+9?Bfh*?ijCut<^f zOf);2nXxu|Jzs6M@!y0L$MgVohuqwdYFia+)bxg0qpn5Q=9=e=i%GG+6J|vl?!Axl zqPcpSL)UsMoQvo2c7Fac)clJ61W!_%zD{Xv?#g|pXyX3x`=x%rlq=b>>pX}r+r9`T htYpW{aSOC8c#oy>U2n}d0XKDCTR_PRf|812eghY#&FugH literal 0 HcmV?d00001 diff --git a/CMakeFiles/3.25.1/CMakeSystem.cmake b/CMakeFiles/3.25.1/CMakeSystem.cmake new file mode 100644 index 00000000..05cfe7e2 --- /dev/null +++ b/CMakeFiles/3.25.1/CMakeSystem.cmake @@ -0,0 +1,15 @@ +set(CMAKE_HOST_SYSTEM "Darwin-22.2.0") +set(CMAKE_HOST_SYSTEM_NAME "Darwin") +set(CMAKE_HOST_SYSTEM_VERSION "22.2.0") +set(CMAKE_HOST_SYSTEM_PROCESSOR "arm64") + + + +set(CMAKE_SYSTEM "Darwin-22.2.0") +set(CMAKE_SYSTEM_NAME "Darwin") +set(CMAKE_SYSTEM_VERSION "22.2.0") +set(CMAKE_SYSTEM_PROCESSOR "arm64") + +set(CMAKE_CROSSCOMPILING "FALSE") + +set(CMAKE_SYSTEM_LOADED 1) diff --git a/CMakeFiles/3.25.1/CompilerIdC/CMakeCCompilerId.c b/CMakeFiles/3.25.1/CompilerIdC/CMakeCCompilerId.c new file mode 100644 index 00000000..a83e3782 --- /dev/null +++ b/CMakeFiles/3.25.1/CompilerIdC/CMakeCCompilerId.c @@ -0,0 +1,868 @@ +#ifdef __cplusplus +# error "A C++ compiler has been selected for C." +#endif + +#if defined(__18CXX) +# define ID_VOID_MAIN +#endif +#if defined(__CLASSIC_C__) +/* cv-qualifiers did not exist in K&R C */ +# define const +# define volatile +#endif + +#if !defined(__has_include) +/* If the compiler does not have __has_include, pretend the answer is + always no. */ +# define __has_include(x) 0 +#endif + + +/* Version number components: V=Version, R=Revision, P=Patch + Version date components: YYYY=Year, MM=Month, DD=Day */ + +#if defined(__INTEL_COMPILER) || defined(__ICC) +# define COMPILER_ID "Intel" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# if defined(__GNUC__) +# define SIMULATE_ID "GNU" +# endif + /* __INTEL_COMPILER = VRP prior to 2021, and then VVVV for 2021 and later, + except that a few beta releases use the old format with V=2021. */ +# if __INTEL_COMPILER < 2021 || __INTEL_COMPILER == 202110 || __INTEL_COMPILER == 202111 +# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) +# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) +# if defined(__INTEL_COMPILER_UPDATE) +# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE) +# else +# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10) +# endif +# else +# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER) +# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER_UPDATE) + /* The third version component from --version is an update index, + but no macro is provided for it. */ +# define COMPILER_VERSION_PATCH DEC(0) +# endif +# if defined(__INTEL_COMPILER_BUILD_DATE) + /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */ +# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) +# endif +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif +# if defined(__GNUC__) +# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) +# elif defined(__GNUG__) +# define SIMULATE_VERSION_MAJOR DEC(__GNUG__) +# endif +# if defined(__GNUC_MINOR__) +# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) +# endif +# if defined(__GNUC_PATCHLEVEL__) +# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif + +#elif (defined(__clang__) && defined(__INTEL_CLANG_COMPILER)) || defined(__INTEL_LLVM_COMPILER) +# define COMPILER_ID "IntelLLVM" +#if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +#endif +#if defined(__GNUC__) +# define SIMULATE_ID "GNU" +#endif +/* __INTEL_LLVM_COMPILER = VVVVRP prior to 2021.2.0, VVVVRRPP for 2021.2.0 and + * later. Look for 6 digit vs. 8 digit version number to decide encoding. + * VVVV is no smaller than the current year when a version is released. + */ +#if __INTEL_LLVM_COMPILER < 1000000L +# define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/100) +# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 10) +#else +# define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/10000) +# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/100 % 100) +# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 100) +#endif +#if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +#endif +#if defined(__GNUC__) +# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) +#elif defined(__GNUG__) +# define SIMULATE_VERSION_MAJOR DEC(__GNUG__) +#endif +#if defined(__GNUC_MINOR__) +# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) +#endif +#if defined(__GNUC_PATCHLEVEL__) +# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +#endif + +#elif defined(__PATHCC__) +# define COMPILER_ID "PathScale" +# define COMPILER_VERSION_MAJOR DEC(__PATHCC__) +# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__) +# if defined(__PATHCC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__) +# endif + +#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__) +# define COMPILER_ID "Embarcadero" +# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF) +# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) +# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF) + +#elif defined(__BORLANDC__) +# define COMPILER_ID "Borland" + /* __BORLANDC__ = 0xVRR */ +# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) +# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) + +#elif defined(__WATCOMC__) && __WATCOMC__ < 1200 +# define COMPILER_ID "Watcom" + /* __WATCOMC__ = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) +# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# if (__WATCOMC__ % 10) > 0 +# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# endif + +#elif defined(__WATCOMC__) +# define COMPILER_ID "OpenWatcom" + /* __WATCOMC__ = VVRP + 1100 */ +# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) +# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# if (__WATCOMC__ % 10) > 0 +# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# endif + +#elif defined(__SUNPRO_C) +# define COMPILER_ID "SunPro" +# if __SUNPRO_C >= 0x5100 + /* __SUNPRO_C = 0xVRRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>12) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xFF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) +# else + /* __SUNPRO_CC = 0xVRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>8) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) +# endif + +#elif defined(__HP_cc) +# define COMPILER_ID "HP" + /* __HP_cc = VVRRPP */ +# define COMPILER_VERSION_MAJOR DEC(__HP_cc/10000) +# define COMPILER_VERSION_MINOR DEC(__HP_cc/100 % 100) +# define COMPILER_VERSION_PATCH DEC(__HP_cc % 100) + +#elif defined(__DECC) +# define COMPILER_ID "Compaq" + /* __DECC_VER = VVRRTPPPP */ +# define COMPILER_VERSION_MAJOR DEC(__DECC_VER/10000000) +# define COMPILER_VERSION_MINOR DEC(__DECC_VER/100000 % 100) +# define COMPILER_VERSION_PATCH DEC(__DECC_VER % 10000) + +#elif defined(__IBMC__) && defined(__COMPILER_VER__) +# define COMPILER_ID "zOS" + /* __IBMC__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) + +#elif defined(__open_xl__) && defined(__clang__) +# define COMPILER_ID "IBMClang" +# define COMPILER_VERSION_MAJOR DEC(__open_xl_version__) +# define COMPILER_VERSION_MINOR DEC(__open_xl_release__) +# define COMPILER_VERSION_PATCH DEC(__open_xl_modification__) +# define COMPILER_VERSION_TWEAK DEC(__open_xl_ptf_fix_level__) + + +#elif defined(__ibmxl__) && defined(__clang__) +# define COMPILER_ID "XLClang" +# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__) +# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__) +# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__) +# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__) + + +#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ >= 800 +# define COMPILER_ID "XL" + /* __IBMC__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) + +#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ < 800 +# define COMPILER_ID "VisualAge" + /* __IBMC__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) + +#elif defined(__NVCOMPILER) +# define COMPILER_ID "NVHPC" +# define COMPILER_VERSION_MAJOR DEC(__NVCOMPILER_MAJOR__) +# define COMPILER_VERSION_MINOR DEC(__NVCOMPILER_MINOR__) +# if defined(__NVCOMPILER_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__NVCOMPILER_PATCHLEVEL__) +# endif + +#elif defined(__PGI) +# define COMPILER_ID "PGI" +# define COMPILER_VERSION_MAJOR DEC(__PGIC__) +# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) +# if defined(__PGIC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) +# endif + +#elif defined(_CRAYC) +# define COMPILER_ID "Cray" +# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) +# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) + +#elif defined(__TI_COMPILER_VERSION__) +# define COMPILER_ID "TI" + /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ +# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) +# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) +# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) + +#elif defined(__CLANG_FUJITSU) +# define COMPILER_ID "FujitsuClang" +# define COMPILER_VERSION_MAJOR DEC(__FCC_major__) +# define COMPILER_VERSION_MINOR DEC(__FCC_minor__) +# define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__) +# define COMPILER_VERSION_INTERNAL_STR __clang_version__ + + +#elif defined(__FUJITSU) +# define COMPILER_ID "Fujitsu" +# if defined(__FCC_version__) +# define COMPILER_VERSION __FCC_version__ +# elif defined(__FCC_major__) +# define COMPILER_VERSION_MAJOR DEC(__FCC_major__) +# define COMPILER_VERSION_MINOR DEC(__FCC_minor__) +# define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__) +# endif +# if defined(__fcc_version) +# define COMPILER_VERSION_INTERNAL DEC(__fcc_version) +# elif defined(__FCC_VERSION) +# define COMPILER_VERSION_INTERNAL DEC(__FCC_VERSION) +# endif + + +#elif defined(__ghs__) +# define COMPILER_ID "GHS" +/* __GHS_VERSION_NUMBER = VVVVRP */ +# ifdef __GHS_VERSION_NUMBER +# define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100) +# define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10) +# define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10) +# endif + +#elif defined(__TASKING__) +# define COMPILER_ID "Tasking" + # define COMPILER_VERSION_MAJOR DEC(__VERSION__/1000) + # define COMPILER_VERSION_MINOR DEC(__VERSION__ % 100) +# define COMPILER_VERSION_INTERNAL DEC(__VERSION__) + +#elif defined(__TINYC__) +# define COMPILER_ID "TinyCC" + +#elif defined(__BCC__) +# define COMPILER_ID "Bruce" + +#elif defined(__SCO_VERSION__) +# define COMPILER_ID "SCO" + +#elif defined(__ARMCC_VERSION) && !defined(__clang__) +# define COMPILER_ID "ARMCC" +#if __ARMCC_VERSION >= 1000000 + /* __ARMCC_VERSION = VRRPPPP */ + # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000) + # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100) + # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) +#else + /* __ARMCC_VERSION = VRPPPP */ + # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000) + # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10) + # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) +#endif + + +#elif defined(__clang__) && defined(__apple_build_version__) +# define COMPILER_ID "AppleClang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif +# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__) + +#elif defined(__clang__) && defined(__ARMCOMPILER_VERSION) +# define COMPILER_ID "ARMClang" + # define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000) + # define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100) + # define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION % 10000) +# define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION) + +#elif defined(__clang__) +# define COMPILER_ID "Clang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif + +#elif defined(__LCC__) && (defined(__GNUC__) || defined(__GNUG__) || defined(__MCST__)) +# define COMPILER_ID "LCC" +# define COMPILER_VERSION_MAJOR DEC(1) +# if defined(__LCC__) +# define COMPILER_VERSION_MINOR DEC(__LCC__- 100) +# endif +# if defined(__LCC_MINOR__) +# define COMPILER_VERSION_PATCH DEC(__LCC_MINOR__) +# endif +# if defined(__GNUC__) && defined(__GNUC_MINOR__) +# define SIMULATE_ID "GNU" +# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) +# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) +# if defined(__GNUC_PATCHLEVEL__) +# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif +# endif + +#elif defined(__GNUC__) +# define COMPILER_ID "GNU" +# define COMPILER_VERSION_MAJOR DEC(__GNUC__) +# if defined(__GNUC_MINOR__) +# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) +# endif +# if defined(__GNUC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif + +#elif defined(_MSC_VER) +# define COMPILER_ID "MSVC" + /* _MSC_VER = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) +# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) +# if defined(_MSC_FULL_VER) +# if _MSC_VER >= 1400 + /* _MSC_FULL_VER = VVRRPPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) +# else + /* _MSC_FULL_VER = VVRRPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) +# endif +# endif +# if defined(_MSC_BUILD) +# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) +# endif + +#elif defined(_ADI_COMPILER) +# define COMPILER_ID "ADSP" +#if defined(__VERSIONNUM__) + /* __VERSIONNUM__ = 0xVVRRPPTT */ +# define COMPILER_VERSION_MAJOR DEC(__VERSIONNUM__ >> 24 & 0xFF) +# define COMPILER_VERSION_MINOR DEC(__VERSIONNUM__ >> 16 & 0xFF) +# define COMPILER_VERSION_PATCH DEC(__VERSIONNUM__ >> 8 & 0xFF) +# define COMPILER_VERSION_TWEAK DEC(__VERSIONNUM__ & 0xFF) +#endif + +#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) +# define COMPILER_ID "IAR" +# if defined(__VER__) && defined(__ICCARM__) +# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000) +# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000) +# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000) +# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) +# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__) || defined(__ICCSTM8__)) +# define COMPILER_VERSION_MAJOR DEC((__VER__) / 100) +# define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100)) +# define COMPILER_VERSION_PATCH DEC(__SUBVERSION__) +# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) +# endif + +#elif defined(__SDCC_VERSION_MAJOR) || defined(SDCC) +# define COMPILER_ID "SDCC" +# if defined(__SDCC_VERSION_MAJOR) +# define COMPILER_VERSION_MAJOR DEC(__SDCC_VERSION_MAJOR) +# define COMPILER_VERSION_MINOR DEC(__SDCC_VERSION_MINOR) +# define COMPILER_VERSION_PATCH DEC(__SDCC_VERSION_PATCH) +# else + /* SDCC = VRP */ +# define COMPILER_VERSION_MAJOR DEC(SDCC/100) +# define COMPILER_VERSION_MINOR DEC(SDCC/10 % 10) +# define COMPILER_VERSION_PATCH DEC(SDCC % 10) +# endif + + +/* These compilers are either not known or too old to define an + identification macro. Try to identify the platform and guess that + it is the native compiler. */ +#elif defined(__hpux) || defined(__hpua) +# define COMPILER_ID "HP" + +#else /* unknown compiler */ +# define COMPILER_ID "" +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; +#ifdef SIMULATE_ID +char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; +#endif + +#ifdef __QNXNTO__ +char const* qnxnto = "INFO" ":" "qnxnto[]"; +#endif + +#if defined(__CRAYXT_COMPUTE_LINUX_TARGET) +char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; +#endif + +#define STRINGIFY_HELPER(X) #X +#define STRINGIFY(X) STRINGIFY_HELPER(X) + +/* Identify known platforms by name. */ +#if defined(__linux) || defined(__linux__) || defined(linux) +# define PLATFORM_ID "Linux" + +#elif defined(__MSYS__) +# define PLATFORM_ID "MSYS" + +#elif defined(__CYGWIN__) +# define PLATFORM_ID "Cygwin" + +#elif defined(__MINGW32__) +# define PLATFORM_ID "MinGW" + +#elif defined(__APPLE__) +# define PLATFORM_ID "Darwin" + +#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) +# define PLATFORM_ID "Windows" + +#elif defined(__FreeBSD__) || defined(__FreeBSD) +# define PLATFORM_ID "FreeBSD" + +#elif defined(__NetBSD__) || defined(__NetBSD) +# define PLATFORM_ID "NetBSD" + +#elif defined(__OpenBSD__) || defined(__OPENBSD) +# define PLATFORM_ID "OpenBSD" + +#elif defined(__sun) || defined(sun) +# define PLATFORM_ID "SunOS" + +#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) +# define PLATFORM_ID "AIX" + +#elif defined(__hpux) || defined(__hpux__) +# define PLATFORM_ID "HP-UX" + +#elif defined(__HAIKU__) +# define PLATFORM_ID "Haiku" + +#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) +# define PLATFORM_ID "BeOS" + +#elif defined(__QNX__) || defined(__QNXNTO__) +# define PLATFORM_ID "QNX" + +#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) +# define PLATFORM_ID "Tru64" + +#elif defined(__riscos) || defined(__riscos__) +# define PLATFORM_ID "RISCos" + +#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) +# define PLATFORM_ID "SINIX" + +#elif defined(__UNIX_SV__) +# define PLATFORM_ID "UNIX_SV" + +#elif defined(__bsdos__) +# define PLATFORM_ID "BSDOS" + +#elif defined(_MPRAS) || defined(MPRAS) +# define PLATFORM_ID "MP-RAS" + +#elif defined(__osf) || defined(__osf__) +# define PLATFORM_ID "OSF1" + +#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) +# define PLATFORM_ID "SCO_SV" + +#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) +# define PLATFORM_ID "ULTRIX" + +#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) +# define PLATFORM_ID "Xenix" + +#elif defined(__WATCOMC__) +# if defined(__LINUX__) +# define PLATFORM_ID "Linux" + +# elif defined(__DOS__) +# define PLATFORM_ID "DOS" + +# elif defined(__OS2__) +# define PLATFORM_ID "OS2" + +# elif defined(__WINDOWS__) +# define PLATFORM_ID "Windows3x" + +# elif defined(__VXWORKS__) +# define PLATFORM_ID "VxWorks" + +# else /* unknown platform */ +# define PLATFORM_ID +# endif + +#elif defined(__INTEGRITY) +# if defined(INT_178B) +# define PLATFORM_ID "Integrity178" + +# else /* regular Integrity */ +# define PLATFORM_ID "Integrity" +# endif + +# elif defined(_ADI_COMPILER) +# define PLATFORM_ID "ADSP" + +#else /* unknown platform */ +# define PLATFORM_ID + +#endif + +/* For windows compilers MSVC and Intel we can determine + the architecture of the compiler being used. This is because + the compilers do not have flags that can change the architecture, + but rather depend on which compiler is being used +*/ +#if defined(_WIN32) && defined(_MSC_VER) +# if defined(_M_IA64) +# define ARCHITECTURE_ID "IA64" + +# elif defined(_M_ARM64EC) +# define ARCHITECTURE_ID "ARM64EC" + +# elif defined(_M_X64) || defined(_M_AMD64) +# define ARCHITECTURE_ID "x64" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# elif defined(_M_ARM64) +# define ARCHITECTURE_ID "ARM64" + +# elif defined(_M_ARM) +# if _M_ARM == 4 +# define ARCHITECTURE_ID "ARMV4I" +# elif _M_ARM == 5 +# define ARCHITECTURE_ID "ARMV5I" +# else +# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM) +# endif + +# elif defined(_M_MIPS) +# define ARCHITECTURE_ID "MIPS" + +# elif defined(_M_SH) +# define ARCHITECTURE_ID "SHx" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__WATCOMC__) +# if defined(_M_I86) +# define ARCHITECTURE_ID "I86" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) +# if defined(__ICCARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__ICCRX__) +# define ARCHITECTURE_ID "RX" + +# elif defined(__ICCRH850__) +# define ARCHITECTURE_ID "RH850" + +# elif defined(__ICCRL78__) +# define ARCHITECTURE_ID "RL78" + +# elif defined(__ICCRISCV__) +# define ARCHITECTURE_ID "RISCV" + +# elif defined(__ICCAVR__) +# define ARCHITECTURE_ID "AVR" + +# elif defined(__ICC430__) +# define ARCHITECTURE_ID "MSP430" + +# elif defined(__ICCV850__) +# define ARCHITECTURE_ID "V850" + +# elif defined(__ICC8051__) +# define ARCHITECTURE_ID "8051" + +# elif defined(__ICCSTM8__) +# define ARCHITECTURE_ID "STM8" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__ghs__) +# if defined(__PPC64__) +# define ARCHITECTURE_ID "PPC64" + +# elif defined(__ppc__) +# define ARCHITECTURE_ID "PPC" + +# elif defined(__ARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__x86_64__) +# define ARCHITECTURE_ID "x64" + +# elif defined(__i386__) +# define ARCHITECTURE_ID "X86" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__TI_COMPILER_VERSION__) +# if defined(__TI_ARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__MSP430__) +# define ARCHITECTURE_ID "MSP430" + +# elif defined(__TMS320C28XX__) +# define ARCHITECTURE_ID "TMS320C28x" + +# elif defined(__TMS320C6X__) || defined(_TMS320C6X) +# define ARCHITECTURE_ID "TMS320C6x" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +# elif defined(__ADSPSHARC__) +# define ARCHITECTURE_ID "SHARC" + +# elif defined(__ADSPBLACKFIN__) +# define ARCHITECTURE_ID "Blackfin" + +#elif defined(__TASKING__) + +# if defined(__CTC__) || defined(__CPTC__) +# define ARCHITECTURE_ID "TriCore" + +# elif defined(__CMCS__) +# define ARCHITECTURE_ID "MCS" + +# elif defined(__CARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__CARC__) +# define ARCHITECTURE_ID "ARC" + +# elif defined(__C51__) +# define ARCHITECTURE_ID "8051" + +# elif defined(__CPCP__) +# define ARCHITECTURE_ID "PCP" + +# else +# define ARCHITECTURE_ID "" +# endif + +#else +# define ARCHITECTURE_ID +#endif + +/* Convert integer to decimal digit literals. */ +#define DEC(n) \ + ('0' + (((n) / 10000000)%10)), \ + ('0' + (((n) / 1000000)%10)), \ + ('0' + (((n) / 100000)%10)), \ + ('0' + (((n) / 10000)%10)), \ + ('0' + (((n) / 1000)%10)), \ + ('0' + (((n) / 100)%10)), \ + ('0' + (((n) / 10)%10)), \ + ('0' + ((n) % 10)) + +/* Convert integer to hex digit literals. */ +#define HEX(n) \ + ('0' + ((n)>>28 & 0xF)), \ + ('0' + ((n)>>24 & 0xF)), \ + ('0' + ((n)>>20 & 0xF)), \ + ('0' + ((n)>>16 & 0xF)), \ + ('0' + ((n)>>12 & 0xF)), \ + ('0' + ((n)>>8 & 0xF)), \ + ('0' + ((n)>>4 & 0xF)), \ + ('0' + ((n) & 0xF)) + +/* Construct a string literal encoding the version number. */ +#ifdef COMPILER_VERSION +char const* info_version = "INFO" ":" "compiler_version[" COMPILER_VERSION "]"; + +/* Construct a string literal encoding the version number components. */ +#elif defined(COMPILER_VERSION_MAJOR) +char const info_version[] = { + 'I', 'N', 'F', 'O', ':', + 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', + COMPILER_VERSION_MAJOR, +# ifdef COMPILER_VERSION_MINOR + '.', COMPILER_VERSION_MINOR, +# ifdef COMPILER_VERSION_PATCH + '.', COMPILER_VERSION_PATCH, +# ifdef COMPILER_VERSION_TWEAK + '.', COMPILER_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + +/* Construct a string literal encoding the internal version number. */ +#ifdef COMPILER_VERSION_INTERNAL +char const info_version_internal[] = { + 'I', 'N', 'F', 'O', ':', + 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_', + 'i','n','t','e','r','n','a','l','[', + COMPILER_VERSION_INTERNAL,']','\0'}; +#elif defined(COMPILER_VERSION_INTERNAL_STR) +char const* info_version_internal = "INFO" ":" "compiler_version_internal[" COMPILER_VERSION_INTERNAL_STR "]"; +#endif + +/* Construct a string literal encoding the version number components. */ +#ifdef SIMULATE_VERSION_MAJOR +char const info_simulate_version[] = { + 'I', 'N', 'F', 'O', ':', + 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[', + SIMULATE_VERSION_MAJOR, +# ifdef SIMULATE_VERSION_MINOR + '.', SIMULATE_VERSION_MINOR, +# ifdef SIMULATE_VERSION_PATCH + '.', SIMULATE_VERSION_PATCH, +# ifdef SIMULATE_VERSION_TWEAK + '.', SIMULATE_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; +char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; + + + +#if !defined(__STDC__) && !defined(__clang__) +# if defined(_MSC_VER) || defined(__ibmxl__) || defined(__IBMC__) +# define C_VERSION "90" +# else +# define C_VERSION +# endif +#elif __STDC_VERSION__ > 201710L +# define C_VERSION "23" +#elif __STDC_VERSION__ >= 201710L +# define C_VERSION "17" +#elif __STDC_VERSION__ >= 201000L +# define C_VERSION "11" +#elif __STDC_VERSION__ >= 199901L +# define C_VERSION "99" +#else +# define C_VERSION "90" +#endif +const char* info_language_standard_default = + "INFO" ":" "standard_default[" C_VERSION "]"; + +const char* info_language_extensions_default = "INFO" ":" "extensions_default[" +#if (defined(__clang__) || defined(__GNUC__) || defined(__xlC__) || \ + defined(__TI_COMPILER_VERSION__)) && \ + !defined(__STRICT_ANSI__) + "ON" +#else + "OFF" +#endif +"]"; + +/*--------------------------------------------------------------------------*/ + +#ifdef ID_VOID_MAIN +void main() {} +#else +# if defined(__CLASSIC_C__) +int main(argc, argv) int argc; char *argv[]; +# else +int main(int argc, char* argv[]) +# endif +{ + int require = 0; + require += info_compiler[argc]; + require += info_platform[argc]; + require += info_arch[argc]; +#ifdef COMPILER_VERSION_MAJOR + require += info_version[argc]; +#endif +#ifdef COMPILER_VERSION_INTERNAL + require += info_version_internal[argc]; +#endif +#ifdef SIMULATE_ID + require += info_simulate[argc]; +#endif +#ifdef SIMULATE_VERSION_MAJOR + require += info_simulate_version[argc]; +#endif +#if defined(__CRAYXT_COMPUTE_LINUX_TARGET) + require += info_cray[argc]; +#endif + require += info_language_standard_default[argc]; + require += info_language_extensions_default[argc]; + (void)argv; + return require; +} +#endif diff --git a/CMakeFiles/3.25.1/CompilerIdC/CMakeCCompilerId.o b/CMakeFiles/3.25.1/CompilerIdC/CMakeCCompilerId.o new file mode 100644 index 0000000000000000000000000000000000000000..cebe8296f1eeef08d7fea5bfeebd7fa286fbae0d GIT binary patch literal 1712 zcmb_cJ%|%Q6rOnJnKPOwSSSY?u(1kBF5n-5go~mQ?yg7?3CFl3o7}=?vurkcg~fq_ zHiFk!SzMtY*jgAX!6uz&BbL$XuCVtkjNjXNlfSF{c`*CE@4cC~Z+5=fk3YZvIwnL& z!00iHQ9gu690PU+<4ceY=z&L%a~re|ZY3 zzmmGh8Qd4sXezXB#*#;129Jq{r~^~ literal 0 HcmV?d00001 diff --git a/CMakeFiles/3.25.1/CompilerIdCXX/CMakeCXXCompilerId.cpp b/CMakeFiles/3.25.1/CompilerIdCXX/CMakeCXXCompilerId.cpp new file mode 100644 index 00000000..c9ba632f --- /dev/null +++ b/CMakeFiles/3.25.1/CompilerIdCXX/CMakeCXXCompilerId.cpp @@ -0,0 +1,857 @@ +/* This source file must have a .cpp extension so that all C++ compilers + recognize the extension without flags. Borland does not know .cxx for + example. */ +#ifndef __cplusplus +# error "A C compiler has been selected for C++." +#endif + +#if !defined(__has_include) +/* If the compiler does not have __has_include, pretend the answer is + always no. */ +# define __has_include(x) 0 +#endif + + +/* Version number components: V=Version, R=Revision, P=Patch + Version date components: YYYY=Year, MM=Month, DD=Day */ + +#if defined(__COMO__) +# define COMPILER_ID "Comeau" + /* __COMO_VERSION__ = VRR */ +# define COMPILER_VERSION_MAJOR DEC(__COMO_VERSION__ / 100) +# define COMPILER_VERSION_MINOR DEC(__COMO_VERSION__ % 100) + +#elif defined(__INTEL_COMPILER) || defined(__ICC) +# define COMPILER_ID "Intel" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# if defined(__GNUC__) +# define SIMULATE_ID "GNU" +# endif + /* __INTEL_COMPILER = VRP prior to 2021, and then VVVV for 2021 and later, + except that a few beta releases use the old format with V=2021. */ +# if __INTEL_COMPILER < 2021 || __INTEL_COMPILER == 202110 || __INTEL_COMPILER == 202111 +# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) +# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) +# if defined(__INTEL_COMPILER_UPDATE) +# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE) +# else +# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10) +# endif +# else +# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER) +# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER_UPDATE) + /* The third version component from --version is an update index, + but no macro is provided for it. */ +# define COMPILER_VERSION_PATCH DEC(0) +# endif +# if defined(__INTEL_COMPILER_BUILD_DATE) + /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */ +# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) +# endif +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif +# if defined(__GNUC__) +# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) +# elif defined(__GNUG__) +# define SIMULATE_VERSION_MAJOR DEC(__GNUG__) +# endif +# if defined(__GNUC_MINOR__) +# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) +# endif +# if defined(__GNUC_PATCHLEVEL__) +# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif + +#elif (defined(__clang__) && defined(__INTEL_CLANG_COMPILER)) || defined(__INTEL_LLVM_COMPILER) +# define COMPILER_ID "IntelLLVM" +#if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +#endif +#if defined(__GNUC__) +# define SIMULATE_ID "GNU" +#endif +/* __INTEL_LLVM_COMPILER = VVVVRP prior to 2021.2.0, VVVVRRPP for 2021.2.0 and + * later. Look for 6 digit vs. 8 digit version number to decide encoding. + * VVVV is no smaller than the current year when a version is released. + */ +#if __INTEL_LLVM_COMPILER < 1000000L +# define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/100) +# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 10) +#else +# define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/10000) +# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/100 % 100) +# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 100) +#endif +#if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +#endif +#if defined(__GNUC__) +# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) +#elif defined(__GNUG__) +# define SIMULATE_VERSION_MAJOR DEC(__GNUG__) +#endif +#if defined(__GNUC_MINOR__) +# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) +#endif +#if defined(__GNUC_PATCHLEVEL__) +# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +#endif + +#elif defined(__PATHCC__) +# define COMPILER_ID "PathScale" +# define COMPILER_VERSION_MAJOR DEC(__PATHCC__) +# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__) +# if defined(__PATHCC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__) +# endif + +#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__) +# define COMPILER_ID "Embarcadero" +# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF) +# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) +# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF) + +#elif defined(__BORLANDC__) +# define COMPILER_ID "Borland" + /* __BORLANDC__ = 0xVRR */ +# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) +# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) + +#elif defined(__WATCOMC__) && __WATCOMC__ < 1200 +# define COMPILER_ID "Watcom" + /* __WATCOMC__ = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) +# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# if (__WATCOMC__ % 10) > 0 +# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# endif + +#elif defined(__WATCOMC__) +# define COMPILER_ID "OpenWatcom" + /* __WATCOMC__ = VVRP + 1100 */ +# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) +# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# if (__WATCOMC__ % 10) > 0 +# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# endif + +#elif defined(__SUNPRO_CC) +# define COMPILER_ID "SunPro" +# if __SUNPRO_CC >= 0x5100 + /* __SUNPRO_CC = 0xVRRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>12) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xFF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) +# else + /* __SUNPRO_CC = 0xVRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>8) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) +# endif + +#elif defined(__HP_aCC) +# define COMPILER_ID "HP" + /* __HP_aCC = VVRRPP */ +# define COMPILER_VERSION_MAJOR DEC(__HP_aCC/10000) +# define COMPILER_VERSION_MINOR DEC(__HP_aCC/100 % 100) +# define COMPILER_VERSION_PATCH DEC(__HP_aCC % 100) + +#elif defined(__DECCXX) +# define COMPILER_ID "Compaq" + /* __DECCXX_VER = VVRRTPPPP */ +# define COMPILER_VERSION_MAJOR DEC(__DECCXX_VER/10000000) +# define COMPILER_VERSION_MINOR DEC(__DECCXX_VER/100000 % 100) +# define COMPILER_VERSION_PATCH DEC(__DECCXX_VER % 10000) + +#elif defined(__IBMCPP__) && defined(__COMPILER_VER__) +# define COMPILER_ID "zOS" + /* __IBMCPP__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) + +#elif defined(__open_xl__) && defined(__clang__) +# define COMPILER_ID "IBMClang" +# define COMPILER_VERSION_MAJOR DEC(__open_xl_version__) +# define COMPILER_VERSION_MINOR DEC(__open_xl_release__) +# define COMPILER_VERSION_PATCH DEC(__open_xl_modification__) +# define COMPILER_VERSION_TWEAK DEC(__open_xl_ptf_fix_level__) + + +#elif defined(__ibmxl__) && defined(__clang__) +# define COMPILER_ID "XLClang" +# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__) +# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__) +# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__) +# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__) + + +#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ >= 800 +# define COMPILER_ID "XL" + /* __IBMCPP__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) + +#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ < 800 +# define COMPILER_ID "VisualAge" + /* __IBMCPP__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) + +#elif defined(__NVCOMPILER) +# define COMPILER_ID "NVHPC" +# define COMPILER_VERSION_MAJOR DEC(__NVCOMPILER_MAJOR__) +# define COMPILER_VERSION_MINOR DEC(__NVCOMPILER_MINOR__) +# if defined(__NVCOMPILER_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__NVCOMPILER_PATCHLEVEL__) +# endif + +#elif defined(__PGI) +# define COMPILER_ID "PGI" +# define COMPILER_VERSION_MAJOR DEC(__PGIC__) +# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) +# if defined(__PGIC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) +# endif + +#elif defined(_CRAYC) +# define COMPILER_ID "Cray" +# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) +# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) + +#elif defined(__TI_COMPILER_VERSION__) +# define COMPILER_ID "TI" + /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ +# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) +# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) +# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) + +#elif defined(__CLANG_FUJITSU) +# define COMPILER_ID "FujitsuClang" +# define COMPILER_VERSION_MAJOR DEC(__FCC_major__) +# define COMPILER_VERSION_MINOR DEC(__FCC_minor__) +# define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__) +# define COMPILER_VERSION_INTERNAL_STR __clang_version__ + + +#elif defined(__FUJITSU) +# define COMPILER_ID "Fujitsu" +# if defined(__FCC_version__) +# define COMPILER_VERSION __FCC_version__ +# elif defined(__FCC_major__) +# define COMPILER_VERSION_MAJOR DEC(__FCC_major__) +# define COMPILER_VERSION_MINOR DEC(__FCC_minor__) +# define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__) +# endif +# if defined(__fcc_version) +# define COMPILER_VERSION_INTERNAL DEC(__fcc_version) +# elif defined(__FCC_VERSION) +# define COMPILER_VERSION_INTERNAL DEC(__FCC_VERSION) +# endif + + +#elif defined(__ghs__) +# define COMPILER_ID "GHS" +/* __GHS_VERSION_NUMBER = VVVVRP */ +# ifdef __GHS_VERSION_NUMBER +# define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100) +# define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10) +# define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10) +# endif + +#elif defined(__TASKING__) +# define COMPILER_ID "Tasking" + # define COMPILER_VERSION_MAJOR DEC(__VERSION__/1000) + # define COMPILER_VERSION_MINOR DEC(__VERSION__ % 100) +# define COMPILER_VERSION_INTERNAL DEC(__VERSION__) + +#elif defined(__SCO_VERSION__) +# define COMPILER_ID "SCO" + +#elif defined(__ARMCC_VERSION) && !defined(__clang__) +# define COMPILER_ID "ARMCC" +#if __ARMCC_VERSION >= 1000000 + /* __ARMCC_VERSION = VRRPPPP */ + # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000) + # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100) + # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) +#else + /* __ARMCC_VERSION = VRPPPP */ + # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000) + # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10) + # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) +#endif + + +#elif defined(__clang__) && defined(__apple_build_version__) +# define COMPILER_ID "AppleClang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif +# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__) + +#elif defined(__clang__) && defined(__ARMCOMPILER_VERSION) +# define COMPILER_ID "ARMClang" + # define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000) + # define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100) + # define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION % 10000) +# define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION) + +#elif defined(__clang__) +# define COMPILER_ID "Clang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif + +#elif defined(__LCC__) && (defined(__GNUC__) || defined(__GNUG__) || defined(__MCST__)) +# define COMPILER_ID "LCC" +# define COMPILER_VERSION_MAJOR DEC(1) +# if defined(__LCC__) +# define COMPILER_VERSION_MINOR DEC(__LCC__- 100) +# endif +# if defined(__LCC_MINOR__) +# define COMPILER_VERSION_PATCH DEC(__LCC_MINOR__) +# endif +# if defined(__GNUC__) && defined(__GNUC_MINOR__) +# define SIMULATE_ID "GNU" +# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) +# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) +# if defined(__GNUC_PATCHLEVEL__) +# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif +# endif + +#elif defined(__GNUC__) || defined(__GNUG__) +# define COMPILER_ID "GNU" +# if defined(__GNUC__) +# define COMPILER_VERSION_MAJOR DEC(__GNUC__) +# else +# define COMPILER_VERSION_MAJOR DEC(__GNUG__) +# endif +# if defined(__GNUC_MINOR__) +# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) +# endif +# if defined(__GNUC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif + +#elif defined(_MSC_VER) +# define COMPILER_ID "MSVC" + /* _MSC_VER = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) +# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) +# if defined(_MSC_FULL_VER) +# if _MSC_VER >= 1400 + /* _MSC_FULL_VER = VVRRPPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) +# else + /* _MSC_FULL_VER = VVRRPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) +# endif +# endif +# if defined(_MSC_BUILD) +# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) +# endif + +#elif defined(_ADI_COMPILER) +# define COMPILER_ID "ADSP" +#if defined(__VERSIONNUM__) + /* __VERSIONNUM__ = 0xVVRRPPTT */ +# define COMPILER_VERSION_MAJOR DEC(__VERSIONNUM__ >> 24 & 0xFF) +# define COMPILER_VERSION_MINOR DEC(__VERSIONNUM__ >> 16 & 0xFF) +# define COMPILER_VERSION_PATCH DEC(__VERSIONNUM__ >> 8 & 0xFF) +# define COMPILER_VERSION_TWEAK DEC(__VERSIONNUM__ & 0xFF) +#endif + +#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) +# define COMPILER_ID "IAR" +# if defined(__VER__) && defined(__ICCARM__) +# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000) +# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000) +# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000) +# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) +# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__) || defined(__ICCSTM8__)) +# define COMPILER_VERSION_MAJOR DEC((__VER__) / 100) +# define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100)) +# define COMPILER_VERSION_PATCH DEC(__SUBVERSION__) +# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) +# endif + + +/* These compilers are either not known or too old to define an + identification macro. Try to identify the platform and guess that + it is the native compiler. */ +#elif defined(__hpux) || defined(__hpua) +# define COMPILER_ID "HP" + +#else /* unknown compiler */ +# define COMPILER_ID "" +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; +#ifdef SIMULATE_ID +char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; +#endif + +#ifdef __QNXNTO__ +char const* qnxnto = "INFO" ":" "qnxnto[]"; +#endif + +#if defined(__CRAYXT_COMPUTE_LINUX_TARGET) +char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; +#endif + +#define STRINGIFY_HELPER(X) #X +#define STRINGIFY(X) STRINGIFY_HELPER(X) + +/* Identify known platforms by name. */ +#if defined(__linux) || defined(__linux__) || defined(linux) +# define PLATFORM_ID "Linux" + +#elif defined(__MSYS__) +# define PLATFORM_ID "MSYS" + +#elif defined(__CYGWIN__) +# define PLATFORM_ID "Cygwin" + +#elif defined(__MINGW32__) +# define PLATFORM_ID "MinGW" + +#elif defined(__APPLE__) +# define PLATFORM_ID "Darwin" + +#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) +# define PLATFORM_ID "Windows" + +#elif defined(__FreeBSD__) || defined(__FreeBSD) +# define PLATFORM_ID "FreeBSD" + +#elif defined(__NetBSD__) || defined(__NetBSD) +# define PLATFORM_ID "NetBSD" + +#elif defined(__OpenBSD__) || defined(__OPENBSD) +# define PLATFORM_ID "OpenBSD" + +#elif defined(__sun) || defined(sun) +# define PLATFORM_ID "SunOS" + +#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) +# define PLATFORM_ID "AIX" + +#elif defined(__hpux) || defined(__hpux__) +# define PLATFORM_ID "HP-UX" + +#elif defined(__HAIKU__) +# define PLATFORM_ID "Haiku" + +#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) +# define PLATFORM_ID "BeOS" + +#elif defined(__QNX__) || defined(__QNXNTO__) +# define PLATFORM_ID "QNX" + +#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) +# define PLATFORM_ID "Tru64" + +#elif defined(__riscos) || defined(__riscos__) +# define PLATFORM_ID "RISCos" + +#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) +# define PLATFORM_ID "SINIX" + +#elif defined(__UNIX_SV__) +# define PLATFORM_ID "UNIX_SV" + +#elif defined(__bsdos__) +# define PLATFORM_ID "BSDOS" + +#elif defined(_MPRAS) || defined(MPRAS) +# define PLATFORM_ID "MP-RAS" + +#elif defined(__osf) || defined(__osf__) +# define PLATFORM_ID "OSF1" + +#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) +# define PLATFORM_ID "SCO_SV" + +#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) +# define PLATFORM_ID "ULTRIX" + +#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) +# define PLATFORM_ID "Xenix" + +#elif defined(__WATCOMC__) +# if defined(__LINUX__) +# define PLATFORM_ID "Linux" + +# elif defined(__DOS__) +# define PLATFORM_ID "DOS" + +# elif defined(__OS2__) +# define PLATFORM_ID "OS2" + +# elif defined(__WINDOWS__) +# define PLATFORM_ID "Windows3x" + +# elif defined(__VXWORKS__) +# define PLATFORM_ID "VxWorks" + +# else /* unknown platform */ +# define PLATFORM_ID +# endif + +#elif defined(__INTEGRITY) +# if defined(INT_178B) +# define PLATFORM_ID "Integrity178" + +# else /* regular Integrity */ +# define PLATFORM_ID "Integrity" +# endif + +# elif defined(_ADI_COMPILER) +# define PLATFORM_ID "ADSP" + +#else /* unknown platform */ +# define PLATFORM_ID + +#endif + +/* For windows compilers MSVC and Intel we can determine + the architecture of the compiler being used. This is because + the compilers do not have flags that can change the architecture, + but rather depend on which compiler is being used +*/ +#if defined(_WIN32) && defined(_MSC_VER) +# if defined(_M_IA64) +# define ARCHITECTURE_ID "IA64" + +# elif defined(_M_ARM64EC) +# define ARCHITECTURE_ID "ARM64EC" + +# elif defined(_M_X64) || defined(_M_AMD64) +# define ARCHITECTURE_ID "x64" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# elif defined(_M_ARM64) +# define ARCHITECTURE_ID "ARM64" + +# elif defined(_M_ARM) +# if _M_ARM == 4 +# define ARCHITECTURE_ID "ARMV4I" +# elif _M_ARM == 5 +# define ARCHITECTURE_ID "ARMV5I" +# else +# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM) +# endif + +# elif defined(_M_MIPS) +# define ARCHITECTURE_ID "MIPS" + +# elif defined(_M_SH) +# define ARCHITECTURE_ID "SHx" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__WATCOMC__) +# if defined(_M_I86) +# define ARCHITECTURE_ID "I86" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) +# if defined(__ICCARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__ICCRX__) +# define ARCHITECTURE_ID "RX" + +# elif defined(__ICCRH850__) +# define ARCHITECTURE_ID "RH850" + +# elif defined(__ICCRL78__) +# define ARCHITECTURE_ID "RL78" + +# elif defined(__ICCRISCV__) +# define ARCHITECTURE_ID "RISCV" + +# elif defined(__ICCAVR__) +# define ARCHITECTURE_ID "AVR" + +# elif defined(__ICC430__) +# define ARCHITECTURE_ID "MSP430" + +# elif defined(__ICCV850__) +# define ARCHITECTURE_ID "V850" + +# elif defined(__ICC8051__) +# define ARCHITECTURE_ID "8051" + +# elif defined(__ICCSTM8__) +# define ARCHITECTURE_ID "STM8" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__ghs__) +# if defined(__PPC64__) +# define ARCHITECTURE_ID "PPC64" + +# elif defined(__ppc__) +# define ARCHITECTURE_ID "PPC" + +# elif defined(__ARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__x86_64__) +# define ARCHITECTURE_ID "x64" + +# elif defined(__i386__) +# define ARCHITECTURE_ID "X86" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__TI_COMPILER_VERSION__) +# if defined(__TI_ARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__MSP430__) +# define ARCHITECTURE_ID "MSP430" + +# elif defined(__TMS320C28XX__) +# define ARCHITECTURE_ID "TMS320C28x" + +# elif defined(__TMS320C6X__) || defined(_TMS320C6X) +# define ARCHITECTURE_ID "TMS320C6x" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +# elif defined(__ADSPSHARC__) +# define ARCHITECTURE_ID "SHARC" + +# elif defined(__ADSPBLACKFIN__) +# define ARCHITECTURE_ID "Blackfin" + +#elif defined(__TASKING__) + +# if defined(__CTC__) || defined(__CPTC__) +# define ARCHITECTURE_ID "TriCore" + +# elif defined(__CMCS__) +# define ARCHITECTURE_ID "MCS" + +# elif defined(__CARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__CARC__) +# define ARCHITECTURE_ID "ARC" + +# elif defined(__C51__) +# define ARCHITECTURE_ID "8051" + +# elif defined(__CPCP__) +# define ARCHITECTURE_ID "PCP" + +# else +# define ARCHITECTURE_ID "" +# endif + +#else +# define ARCHITECTURE_ID +#endif + +/* Convert integer to decimal digit literals. */ +#define DEC(n) \ + ('0' + (((n) / 10000000)%10)), \ + ('0' + (((n) / 1000000)%10)), \ + ('0' + (((n) / 100000)%10)), \ + ('0' + (((n) / 10000)%10)), \ + ('0' + (((n) / 1000)%10)), \ + ('0' + (((n) / 100)%10)), \ + ('0' + (((n) / 10)%10)), \ + ('0' + ((n) % 10)) + +/* Convert integer to hex digit literals. */ +#define HEX(n) \ + ('0' + ((n)>>28 & 0xF)), \ + ('0' + ((n)>>24 & 0xF)), \ + ('0' + ((n)>>20 & 0xF)), \ + ('0' + ((n)>>16 & 0xF)), \ + ('0' + ((n)>>12 & 0xF)), \ + ('0' + ((n)>>8 & 0xF)), \ + ('0' + ((n)>>4 & 0xF)), \ + ('0' + ((n) & 0xF)) + +/* Construct a string literal encoding the version number. */ +#ifdef COMPILER_VERSION +char const* info_version = "INFO" ":" "compiler_version[" COMPILER_VERSION "]"; + +/* Construct a string literal encoding the version number components. */ +#elif defined(COMPILER_VERSION_MAJOR) +char const info_version[] = { + 'I', 'N', 'F', 'O', ':', + 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', + COMPILER_VERSION_MAJOR, +# ifdef COMPILER_VERSION_MINOR + '.', COMPILER_VERSION_MINOR, +# ifdef COMPILER_VERSION_PATCH + '.', COMPILER_VERSION_PATCH, +# ifdef COMPILER_VERSION_TWEAK + '.', COMPILER_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + +/* Construct a string literal encoding the internal version number. */ +#ifdef COMPILER_VERSION_INTERNAL +char const info_version_internal[] = { + 'I', 'N', 'F', 'O', ':', + 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_', + 'i','n','t','e','r','n','a','l','[', + COMPILER_VERSION_INTERNAL,']','\0'}; +#elif defined(COMPILER_VERSION_INTERNAL_STR) +char const* info_version_internal = "INFO" ":" "compiler_version_internal[" COMPILER_VERSION_INTERNAL_STR "]"; +#endif + +/* Construct a string literal encoding the version number components. */ +#ifdef SIMULATE_VERSION_MAJOR +char const info_simulate_version[] = { + 'I', 'N', 'F', 'O', ':', + 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[', + SIMULATE_VERSION_MAJOR, +# ifdef SIMULATE_VERSION_MINOR + '.', SIMULATE_VERSION_MINOR, +# ifdef SIMULATE_VERSION_PATCH + '.', SIMULATE_VERSION_PATCH, +# ifdef SIMULATE_VERSION_TWEAK + '.', SIMULATE_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; +char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; + + + +#if defined(__INTEL_COMPILER) && defined(_MSVC_LANG) && _MSVC_LANG < 201403L +# if defined(__INTEL_CXX11_MODE__) +# if defined(__cpp_aggregate_nsdmi) +# define CXX_STD 201402L +# else +# define CXX_STD 201103L +# endif +# else +# define CXX_STD 199711L +# endif +#elif defined(_MSC_VER) && defined(_MSVC_LANG) +# define CXX_STD _MSVC_LANG +#else +# define CXX_STD __cplusplus +#endif + +const char* info_language_standard_default = "INFO" ":" "standard_default[" +#if CXX_STD > 202002L + "23" +#elif CXX_STD > 201703L + "20" +#elif CXX_STD >= 201703L + "17" +#elif CXX_STD >= 201402L + "14" +#elif CXX_STD >= 201103L + "11" +#else + "98" +#endif +"]"; + +const char* info_language_extensions_default = "INFO" ":" "extensions_default[" +#if (defined(__clang__) || defined(__GNUC__) || defined(__xlC__) || \ + defined(__TI_COMPILER_VERSION__)) && \ + !defined(__STRICT_ANSI__) + "ON" +#else + "OFF" +#endif +"]"; + +/*--------------------------------------------------------------------------*/ + +int main(int argc, char* argv[]) +{ + int require = 0; + require += info_compiler[argc]; + require += info_platform[argc]; + require += info_arch[argc]; +#ifdef COMPILER_VERSION_MAJOR + require += info_version[argc]; +#endif +#ifdef COMPILER_VERSION_INTERNAL + require += info_version_internal[argc]; +#endif +#ifdef SIMULATE_ID + require += info_simulate[argc]; +#endif +#ifdef SIMULATE_VERSION_MAJOR + require += info_simulate_version[argc]; +#endif +#if defined(__CRAYXT_COMPUTE_LINUX_TARGET) + require += info_cray[argc]; +#endif + require += info_language_standard_default[argc]; + require += info_language_extensions_default[argc]; + (void)argv; + return require; +} diff --git a/CMakeFiles/3.25.1/CompilerIdCXX/CMakeCXXCompilerId.o b/CMakeFiles/3.25.1/CompilerIdCXX/CMakeCXXCompilerId.o new file mode 100644 index 0000000000000000000000000000000000000000..27a98dfcaa20cf8c789543d58ca3b653f13b3e7a GIT binary patch literal 1712 zcmb_cJ#5oZ5PqShqzWV;F@P#TBo?M92^m^Yq(lt}kkxj`5QwUWmAI)T$FUp-Iu^me zz(849io}4J7|8@v9NVIIAex_mO?sT15Gey|D^RxL=qi6dtbI|o&<3zjF3b7wX^nFe5+TTDh@$ zm41!wSbnwWd5*R0m~LZTgb~j%gN>Hotd>k4zm2`7U)!v*-40B*Zu)guw>Hd<6I7QL zIf8ky+_sH28pc*v*8lKhPt+&xTRtVMrbEf(Qp!lDM@A+`zU?;-`V= zyEuF_ci1ZI^ANGm9Mu`;hNsva;^<{PZ(ZV;1X@S33?1ihh+}Z{yuau8Hz3JdD6Rhy zG9g|vpXEKDGrz$61@W={pAtvmdR`xbC$QfdufNS)?@w-u-{bft<`w32zft@qbNbE+ zwqfGpu-%Q8q?YWM4ND$vs_7Ne4JjO%!d1)5bgSb+x@%;zVRG&&A)BV{@;cr4OsV6A c6EwXXr%S;Ay`m`$(5$8~Kr@=c0Hq%J4MtKCng9R* literal 0 HcmV?d00001 diff --git a/CMakeFiles/CMakeError.log b/CMakeFiles/CMakeError.log new file mode 100644 index 00000000..e69de29b diff --git a/CMakeFiles/CMakeOutput.log b/CMakeFiles/CMakeOutput.log new file mode 100644 index 00000000..2b73be42 --- /dev/null +++ b/CMakeFiles/CMakeOutput.log @@ -0,0 +1,312 @@ +The system is: Darwin - 22.2.0 - arm64 +Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded. +Compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc +Build flags: +Id flags: -c + +The output was: +0 + + +Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "CMakeCCompilerId.o" + +The C compiler identification is AppleClang, found in "/Users/ningfei/Repo/dcm2niix/CMakeFiles/3.25.1/CompilerIdC/CMakeCCompilerId.o" + +Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded. +Compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ +Build flags: +Id flags: -c + +The output was: +0 + + +Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "CMakeCXXCompilerId.o" + +The CXX compiler identification is AppleClang, found in "/Users/ningfei/Repo/dcm2niix/CMakeFiles/3.25.1/CompilerIdCXX/CMakeCXXCompilerId.o" + +Detecting C compiler ABI info compiled with the following output: +Change Dir: /Users/ningfei/Repo/dcm2niix/CMakeFiles/CMakeScratch/TryCompile-MCzuMu + +Run Build Command(s):/usr/bin/make -f Makefile cmTC_fbd25/fast && /Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_fbd25.dir/build.make CMakeFiles/cmTC_fbd25.dir/build +Building C object CMakeFiles/cmTC_fbd25.dir/CMakeCCompilerABI.c.o +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk -v -Wl,-v -MD -MT CMakeFiles/cmTC_fbd25.dir/CMakeCCompilerABI.c.o -MF CMakeFiles/cmTC_fbd25.dir/CMakeCCompilerABI.c.o.d -o CMakeFiles/cmTC_fbd25.dir/CMakeCCompilerABI.c.o -c /opt/homebrew/Cellar/cmake/3.25.1/share/cmake/Modules/CMakeCCompilerABI.c +Apple clang version 14.0.0 (clang-1400.0.29.202) +Target: x86_64-apple-darwin22.2.0 +Thread model: posix +InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin +clang: warning: -Wl,-v: 'linker' input unused [-Wunused-command-line-argument] + "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple x86_64-apple-macosx13.0.0 -Wundef-prefix=TARGET_OS_ -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -Werror=implicit-function-declaration -emit-obj -mrelax-all --mrelax-relocations -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name CMakeCCompilerABI.c -mrelocation-model pic -pic-level 2 -mframe-pointer=all -fno-strict-return -fno-rounding-math -funwind-tables=2 -target-sdk-version=13.1 -fvisibility-inlines-hidden-static-local-var -target-cpu penryn -tune-cpu generic -debugger-tuning=lldb -target-linker-version 820.1 -v -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0 -dependency-file CMakeFiles/cmTC_fbd25.dir/CMakeCCompilerABI.c.o.d -skip-unused-modulemap-deps -MT CMakeFiles/cmTC_fbd25.dir/CMakeCCompilerABI.c.o -sys-header-deps -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk -c-isystem /Users/ningfei/.local/include -c-isystem /opt/homebrew/include -c-isystem . -cxx-isystem /Users/ningfei/.local/include -cxx-isystem /opt/homebrew/include -cxx-isystem . -internal-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/local/include -internal-isystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -Wno-reorder-init-list -Wno-implicit-int-float-conversion -Wno-c99-designator -Wno-final-dtor-non-final-class -Wno-extra-semi-stmt -Wno-misleading-indentation -Wno-quoted-include-in-framework-header -Wno-implicit-fallthrough -Wno-enum-enum-conversion -Wno-enum-float-conversion -Wno-elaborated-enum-base -Wno-reserved-identifier -Wno-gnu-folding-constant -Wno-cast-function-type -Wno-bitwise-instead-of-logical -fdebug-compilation-dir=/Users/ningfei/Repo/dcm2niix/CMakeFiles/CMakeScratch/TryCompile-MCzuMu -ferror-limit 19 -stack-protector 1 -fstack-check -mdarwin-stkchk-strong-link -fblocks -fencode-extended-block-signature -fregister-global-dtors-with-atexit -fgnuc-version=4.2.1 -fmax-type-align=16 -fcommon -clang-vendor-feature=+messageToSelfInClassMethodIdReturnType -clang-vendor-feature=+disableInferNewAvailabilityFromInit -clang-vendor-feature=+disableNonDependentMemberExprInCurrentInstantiation -fno-odr-hash-protocols -clang-vendor-feature=+enableAggressiveVLAFolding -clang-vendor-feature=+revert09abecef7bbf -clang-vendor-feature=+thisNoAlignAttr -clang-vendor-feature=+thisNoNullAttr -mllvm -disable-aligned-alloc-awareness=1 -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o CMakeFiles/cmTC_fbd25.dir/CMakeCCompilerABI.c.o -x c /opt/homebrew/Cellar/cmake/3.25.1/share/cmake/Modules/CMakeCCompilerABI.c +clang -cc1 version 14.0.0 (clang-1400.0.29.202) default target arm64-apple-darwin22.2.0 +ignoring nonexistent directory "/Users/ningfei/.local/include" +ignoring nonexistent directory "/Users/ningfei/.local/include" +ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/local/include" +ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/Library/Frameworks" +#include "..." search starts here: +#include <...> search starts here: + /opt/homebrew/include + . + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/System/Library/Frameworks (framework directory) +End of search list. +Linking C executable cmTC_fbd25 +/opt/homebrew/Cellar/cmake/3.25.1/bin/cmake -E cmake_link_script CMakeFiles/cmTC_fbd25.dir/link.txt --verbose=1 +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names -v -Wl,-v CMakeFiles/cmTC_fbd25.dir/CMakeCCompilerABI.c.o -o cmTC_fbd25 +Apple clang version 14.0.0 (clang-1400.0.29.202) +Target: x86_64-apple-darwin22.2.0 +Thread model: posix +InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin + "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -dynamic -arch x86_64 -platform_version macos 13.0.0 13.1 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk -o cmTC_fbd25 -L/Users/ningfei/.local/lib -L/opt/homebrew/lib -L. -search_paths_first -headerpad_max_install_names -v CMakeFiles/cmTC_fbd25.dir/CMakeCCompilerABI.c.o -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/lib/darwin/libclang_rt.osx.a +@(#)PROGRAM:ld PROJECT:ld64-820.1 +BUILD 20:07:05 Nov 7 2022 +configured to support archs: armv6 armv7 armv7s arm64 arm64e arm64_32 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em +Library search paths: + /Users/ningfei/.local/lib + /opt/homebrew/lib + . + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/lib +Framework search paths: + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/System/Library/Frameworks/ + + + +Parsed C implicit include dir info from above output: rv=done + found start of include info + found start of implicit include info + add: [/opt/homebrew/include] + add: [.] + add: [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include] + add: [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include] + add: [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include] + end of search list found + collapse include dir [/opt/homebrew/include] ==> [/opt/homebrew/include] + skipping relative include dir [.] + collapse include dir [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include] ==> [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include] + collapse include dir [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include] ==> [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include] + collapse include dir [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include] ==> [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include] + implicit include dirs: [/opt/homebrew/include;/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include;/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include] + + +Parsed C implicit link information from above output: + link line regex: [^( *|.*[/\])(ld|CMAKE_LINK_STARTFILE-NOTFOUND|([^/\]+-)?ld|collect2)[^/\]*( |$)] + ignore line: [Change Dir: /Users/ningfei/Repo/dcm2niix/CMakeFiles/CMakeScratch/TryCompile-MCzuMu] + ignore line: [] + ignore line: [Run Build Command(s):/usr/bin/make -f Makefile cmTC_fbd25/fast && /Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_fbd25.dir/build.make CMakeFiles/cmTC_fbd25.dir/build] + ignore line: [Building C object CMakeFiles/cmTC_fbd25.dir/CMakeCCompilerABI.c.o] + ignore line: [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk -v -Wl -v -MD -MT CMakeFiles/cmTC_fbd25.dir/CMakeCCompilerABI.c.o -MF CMakeFiles/cmTC_fbd25.dir/CMakeCCompilerABI.c.o.d -o CMakeFiles/cmTC_fbd25.dir/CMakeCCompilerABI.c.o -c /opt/homebrew/Cellar/cmake/3.25.1/share/cmake/Modules/CMakeCCompilerABI.c] + ignore line: [Apple clang version 14.0.0 (clang-1400.0.29.202)] + ignore line: [Target: x86_64-apple-darwin22.2.0] + ignore line: [Thread model: posix] + ignore line: [InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin] + ignore line: [clang: warning: -Wl -v: 'linker' input unused [-Wunused-command-line-argument]] + ignore line: [ "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple x86_64-apple-macosx13.0.0 -Wundef-prefix=TARGET_OS_ -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -Werror=implicit-function-declaration -emit-obj -mrelax-all --mrelax-relocations -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name CMakeCCompilerABI.c -mrelocation-model pic -pic-level 2 -mframe-pointer=all -fno-strict-return -fno-rounding-math -funwind-tables=2 -target-sdk-version=13.1 -fvisibility-inlines-hidden-static-local-var -target-cpu penryn -tune-cpu generic -debugger-tuning=lldb -target-linker-version 820.1 -v -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0 -dependency-file CMakeFiles/cmTC_fbd25.dir/CMakeCCompilerABI.c.o.d -skip-unused-modulemap-deps -MT CMakeFiles/cmTC_fbd25.dir/CMakeCCompilerABI.c.o -sys-header-deps -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk -c-isystem /Users/ningfei/.local/include -c-isystem /opt/homebrew/include -c-isystem . -cxx-isystem /Users/ningfei/.local/include -cxx-isystem /opt/homebrew/include -cxx-isystem . -internal-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/local/include -internal-isystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -Wno-reorder-init-list -Wno-implicit-int-float-conversion -Wno-c99-designator -Wno-final-dtor-non-final-class -Wno-extra-semi-stmt -Wno-misleading-indentation -Wno-quoted-include-in-framework-header -Wno-implicit-fallthrough -Wno-enum-enum-conversion -Wno-enum-float-conversion -Wno-elaborated-enum-base -Wno-reserved-identifier -Wno-gnu-folding-constant -Wno-cast-function-type -Wno-bitwise-instead-of-logical -fdebug-compilation-dir=/Users/ningfei/Repo/dcm2niix/CMakeFiles/CMakeScratch/TryCompile-MCzuMu -ferror-limit 19 -stack-protector 1 -fstack-check -mdarwin-stkchk-strong-link -fblocks -fencode-extended-block-signature -fregister-global-dtors-with-atexit -fgnuc-version=4.2.1 -fmax-type-align=16 -fcommon -clang-vendor-feature=+messageToSelfInClassMethodIdReturnType -clang-vendor-feature=+disableInferNewAvailabilityFromInit -clang-vendor-feature=+disableNonDependentMemberExprInCurrentInstantiation -fno-odr-hash-protocols -clang-vendor-feature=+enableAggressiveVLAFolding -clang-vendor-feature=+revert09abecef7bbf -clang-vendor-feature=+thisNoAlignAttr -clang-vendor-feature=+thisNoNullAttr -mllvm -disable-aligned-alloc-awareness=1 -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o CMakeFiles/cmTC_fbd25.dir/CMakeCCompilerABI.c.o -x c /opt/homebrew/Cellar/cmake/3.25.1/share/cmake/Modules/CMakeCCompilerABI.c] + ignore line: [clang -cc1 version 14.0.0 (clang-1400.0.29.202) default target arm64-apple-darwin22.2.0] + ignore line: [ignoring nonexistent directory "/Users/ningfei/.local/include"] + ignore line: [ignoring nonexistent directory "/Users/ningfei/.local/include"] + ignore line: [ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/local/include"] + ignore line: [ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/Library/Frameworks"] + ignore line: [#include "..." search starts here:] + ignore line: [#include <...> search starts here:] + ignore line: [ /opt/homebrew/include] + ignore line: [ .] + ignore line: [ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include] + ignore line: [ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include] + ignore line: [ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include] + ignore line: [ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/System/Library/Frameworks (framework directory)] + ignore line: [End of search list.] + ignore line: [Linking C executable cmTC_fbd25] + ignore line: [/opt/homebrew/Cellar/cmake/3.25.1/bin/cmake -E cmake_link_script CMakeFiles/cmTC_fbd25.dir/link.txt --verbose=1] + ignore line: [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk -Wl -search_paths_first -Wl -headerpad_max_install_names -v -Wl -v CMakeFiles/cmTC_fbd25.dir/CMakeCCompilerABI.c.o -o cmTC_fbd25 ] + ignore line: [Apple clang version 14.0.0 (clang-1400.0.29.202)] + ignore line: [Target: x86_64-apple-darwin22.2.0] + ignore line: [Thread model: posix] + ignore line: [InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin] + link line: [ "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -dynamic -arch x86_64 -platform_version macos 13.0.0 13.1 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk -o cmTC_fbd25 -L/Users/ningfei/.local/lib -L/opt/homebrew/lib -L. -search_paths_first -headerpad_max_install_names -v CMakeFiles/cmTC_fbd25.dir/CMakeCCompilerABI.c.o -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/lib/darwin/libclang_rt.osx.a] + arg [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld] ==> ignore + arg [-demangle] ==> ignore + arg [-lto_library] ==> ignore, skip following value + arg [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib] ==> skip value of -lto_library + arg [-dynamic] ==> ignore + arg [-arch] ==> ignore + arg [x86_64] ==> ignore + arg [-platform_version] ==> ignore + arg [macos] ==> ignore + arg [13.0.0] ==> ignore + arg [13.1] ==> ignore + arg [-syslibroot] ==> ignore + arg [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk] ==> ignore + arg [-o] ==> ignore + arg [cmTC_fbd25] ==> ignore + arg [-L/Users/ningfei/.local/lib] ==> dir [/Users/ningfei/.local/lib] + arg [-L/opt/homebrew/lib] ==> dir [/opt/homebrew/lib] + arg [-L.] ==> ignore + arg [-search_paths_first] ==> ignore + arg [-headerpad_max_install_names] ==> ignore + arg [-v] ==> ignore + arg [CMakeFiles/cmTC_fbd25.dir/CMakeCCompilerABI.c.o] ==> ignore + arg [-lSystem] ==> lib [System] + arg [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/lib/darwin/libclang_rt.osx.a] ==> lib [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/lib/darwin/libclang_rt.osx.a] + Library search paths: [;/Users/ningfei/.local/lib;/opt/homebrew/lib;.;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/lib] + Framework search paths: [;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/System/Library/Frameworks/] + remove lib [System] + remove lib [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/lib/darwin/libclang_rt.osx.a] + collapse library dir [/Users/ningfei/.local/lib] ==> [/Users/ningfei/.local/lib] + collapse library dir [/opt/homebrew/lib] ==> [/opt/homebrew/lib] + collapse library dir [/Users/ningfei/.local/lib] ==> [/Users/ningfei/.local/lib] + collapse library dir [/opt/homebrew/lib] ==> [/opt/homebrew/lib] + collapse library dir [.] ==> [/Users/ningfei/Repo/dcm2niix] + collapse library dir [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/lib] ==> [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/lib] + collapse framework dir [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/System/Library/Frameworks/] ==> [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/System/Library/Frameworks] + implicit libs: [] + implicit objs: [] + implicit dirs: [/Users/ningfei/.local/lib;/opt/homebrew/lib;/Users/ningfei/Repo/dcm2niix;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/lib] + implicit fwks: [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/System/Library/Frameworks] + + +Detecting CXX compiler ABI info compiled with the following output: +Change Dir: /Users/ningfei/Repo/dcm2niix/CMakeFiles/CMakeScratch/TryCompile-1caCWZ + +Run Build Command(s):/usr/bin/make -f Makefile cmTC_3307b/fast && /Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_3307b.dir/build.make CMakeFiles/cmTC_3307b.dir/build +Building CXX object CMakeFiles/cmTC_3307b.dir/CMakeCXXCompilerABI.cpp.o +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk -v -Wl,-v -MD -MT CMakeFiles/cmTC_3307b.dir/CMakeCXXCompilerABI.cpp.o -MF CMakeFiles/cmTC_3307b.dir/CMakeCXXCompilerABI.cpp.o.d -o CMakeFiles/cmTC_3307b.dir/CMakeCXXCompilerABI.cpp.o -c /opt/homebrew/Cellar/cmake/3.25.1/share/cmake/Modules/CMakeCXXCompilerABI.cpp +Apple clang version 14.0.0 (clang-1400.0.29.202) +Target: x86_64-apple-darwin22.2.0 +Thread model: posix +InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin +clang: warning: -Wl,-v: 'linker' input unused [-Wunused-command-line-argument] + "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple x86_64-apple-macosx13.0.0 -Wundef-prefix=TARGET_OS_ -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -Werror=implicit-function-declaration -emit-obj -mrelax-all --mrelax-relocations -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name CMakeCXXCompilerABI.cpp -mrelocation-model pic -pic-level 2 -mframe-pointer=all -fno-strict-return -fno-rounding-math -funwind-tables=2 -target-sdk-version=13.1 -fvisibility-inlines-hidden-static-local-var -target-cpu penryn -tune-cpu generic -debugger-tuning=lldb -target-linker-version 820.1 -v -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0 -dependency-file CMakeFiles/cmTC_3307b.dir/CMakeCXXCompilerABI.cpp.o.d -skip-unused-modulemap-deps -MT CMakeFiles/cmTC_3307b.dir/CMakeCXXCompilerABI.cpp.o -sys-header-deps -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk -c-isystem /Users/ningfei/.local/include -c-isystem /opt/homebrew/include -c-isystem . -cxx-isystem /Users/ningfei/.local/include -cxx-isystem /opt/homebrew/include -cxx-isystem . -stdlib=libc++ -internal-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/c++/v1 -internal-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/local/include -internal-isystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -Wno-reorder-init-list -Wno-implicit-int-float-conversion -Wno-c99-designator -Wno-final-dtor-non-final-class -Wno-extra-semi-stmt -Wno-misleading-indentation -Wno-quoted-include-in-framework-header -Wno-implicit-fallthrough -Wno-enum-enum-conversion -Wno-enum-float-conversion -Wno-elaborated-enum-base -Wno-reserved-identifier -Wno-gnu-folding-constant -Wno-cast-function-type -Wno-bitwise-instead-of-logical -fdeprecated-macro -fdebug-compilation-dir=/Users/ningfei/Repo/dcm2niix/CMakeFiles/CMakeScratch/TryCompile-1caCWZ -ferror-limit 19 -stack-protector 1 -fstack-check -mdarwin-stkchk-strong-link -fblocks -fencode-extended-block-signature -fregister-global-dtors-with-atexit -fgnuc-version=4.2.1 -fno-cxx-modules -fcxx-exceptions -fexceptions -fmax-type-align=16 -fcommon -clang-vendor-feature=+messageToSelfInClassMethodIdReturnType -clang-vendor-feature=+disableInferNewAvailabilityFromInit -clang-vendor-feature=+disableNonDependentMemberExprInCurrentInstantiation -fno-odr-hash-protocols -clang-vendor-feature=+enableAggressiveVLAFolding -clang-vendor-feature=+revert09abecef7bbf -clang-vendor-feature=+thisNoAlignAttr -clang-vendor-feature=+thisNoNullAttr -mllvm -disable-aligned-alloc-awareness=1 -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o CMakeFiles/cmTC_3307b.dir/CMakeCXXCompilerABI.cpp.o -x c++ /opt/homebrew/Cellar/cmake/3.25.1/share/cmake/Modules/CMakeCXXCompilerABI.cpp +clang -cc1 version 14.0.0 (clang-1400.0.29.202) default target arm64-apple-darwin22.2.0 +ignoring nonexistent directory "/Users/ningfei/.local/include" +ignoring nonexistent directory "/Users/ningfei/.local/include" +ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/local/include" +ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/Library/Frameworks" +#include "..." search starts here: +#include <...> search starts here: + /opt/homebrew/include + . + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/c++/v1 + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/System/Library/Frameworks (framework directory) +End of search list. +Linking CXX executable cmTC_3307b +/opt/homebrew/Cellar/cmake/3.25.1/bin/cmake -E cmake_link_script CMakeFiles/cmTC_3307b.dir/link.txt --verbose=1 +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names -v -Wl,-v CMakeFiles/cmTC_3307b.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_3307b +Apple clang version 14.0.0 (clang-1400.0.29.202) +Target: x86_64-apple-darwin22.2.0 +Thread model: posix +InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin + "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -dynamic -arch x86_64 -platform_version macos 13.0.0 13.1 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk -o cmTC_3307b -L/Users/ningfei/.local/lib -L/opt/homebrew/lib -L. -search_paths_first -headerpad_max_install_names -v CMakeFiles/cmTC_3307b.dir/CMakeCXXCompilerABI.cpp.o -lc++ -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/lib/darwin/libclang_rt.osx.a +@(#)PROGRAM:ld PROJECT:ld64-820.1 +BUILD 20:07:05 Nov 7 2022 +configured to support archs: armv6 armv7 armv7s arm64 arm64e arm64_32 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em +Library search paths: + /Users/ningfei/.local/lib + /opt/homebrew/lib + . + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/lib +Framework search paths: + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/System/Library/Frameworks/ + + + +Parsed CXX implicit include dir info from above output: rv=done + found start of include info + found start of implicit include info + add: [/opt/homebrew/include] + add: [.] + add: [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/c++/v1] + add: [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include] + add: [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include] + add: [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include] + end of search list found + collapse include dir [/opt/homebrew/include] ==> [/opt/homebrew/include] + skipping relative include dir [.] + collapse include dir [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/c++/v1] ==> [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/c++/v1] + collapse include dir [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include] ==> [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include] + collapse include dir [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include] ==> [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include] + collapse include dir [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include] ==> [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include] + implicit include dirs: [/opt/homebrew/include;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/c++/v1;/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include;/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include] + + +Parsed CXX implicit link information from above output: + link line regex: [^( *|.*[/\])(ld|CMAKE_LINK_STARTFILE-NOTFOUND|([^/\]+-)?ld|collect2)[^/\]*( |$)] + ignore line: [Change Dir: /Users/ningfei/Repo/dcm2niix/CMakeFiles/CMakeScratch/TryCompile-1caCWZ] + ignore line: [] + ignore line: [Run Build Command(s):/usr/bin/make -f Makefile cmTC_3307b/fast && /Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_3307b.dir/build.make CMakeFiles/cmTC_3307b.dir/build] + ignore line: [Building CXX object CMakeFiles/cmTC_3307b.dir/CMakeCXXCompilerABI.cpp.o] + ignore line: [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk -v -Wl -v -MD -MT CMakeFiles/cmTC_3307b.dir/CMakeCXXCompilerABI.cpp.o -MF CMakeFiles/cmTC_3307b.dir/CMakeCXXCompilerABI.cpp.o.d -o CMakeFiles/cmTC_3307b.dir/CMakeCXXCompilerABI.cpp.o -c /opt/homebrew/Cellar/cmake/3.25.1/share/cmake/Modules/CMakeCXXCompilerABI.cpp] + ignore line: [Apple clang version 14.0.0 (clang-1400.0.29.202)] + ignore line: [Target: x86_64-apple-darwin22.2.0] + ignore line: [Thread model: posix] + ignore line: [InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin] + ignore line: [clang: warning: -Wl -v: 'linker' input unused [-Wunused-command-line-argument]] + ignore line: [ "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple x86_64-apple-macosx13.0.0 -Wundef-prefix=TARGET_OS_ -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -Werror=implicit-function-declaration -emit-obj -mrelax-all --mrelax-relocations -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name CMakeCXXCompilerABI.cpp -mrelocation-model pic -pic-level 2 -mframe-pointer=all -fno-strict-return -fno-rounding-math -funwind-tables=2 -target-sdk-version=13.1 -fvisibility-inlines-hidden-static-local-var -target-cpu penryn -tune-cpu generic -debugger-tuning=lldb -target-linker-version 820.1 -v -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0 -dependency-file CMakeFiles/cmTC_3307b.dir/CMakeCXXCompilerABI.cpp.o.d -skip-unused-modulemap-deps -MT CMakeFiles/cmTC_3307b.dir/CMakeCXXCompilerABI.cpp.o -sys-header-deps -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk -c-isystem /Users/ningfei/.local/include -c-isystem /opt/homebrew/include -c-isystem . -cxx-isystem /Users/ningfei/.local/include -cxx-isystem /opt/homebrew/include -cxx-isystem . -stdlib=libc++ -internal-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/c++/v1 -internal-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/local/include -internal-isystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -Wno-reorder-init-list -Wno-implicit-int-float-conversion -Wno-c99-designator -Wno-final-dtor-non-final-class -Wno-extra-semi-stmt -Wno-misleading-indentation -Wno-quoted-include-in-framework-header -Wno-implicit-fallthrough -Wno-enum-enum-conversion -Wno-enum-float-conversion -Wno-elaborated-enum-base -Wno-reserved-identifier -Wno-gnu-folding-constant -Wno-cast-function-type -Wno-bitwise-instead-of-logical -fdeprecated-macro -fdebug-compilation-dir=/Users/ningfei/Repo/dcm2niix/CMakeFiles/CMakeScratch/TryCompile-1caCWZ -ferror-limit 19 -stack-protector 1 -fstack-check -mdarwin-stkchk-strong-link -fblocks -fencode-extended-block-signature -fregister-global-dtors-with-atexit -fgnuc-version=4.2.1 -fno-cxx-modules -fcxx-exceptions -fexceptions -fmax-type-align=16 -fcommon -clang-vendor-feature=+messageToSelfInClassMethodIdReturnType -clang-vendor-feature=+disableInferNewAvailabilityFromInit -clang-vendor-feature=+disableNonDependentMemberExprInCurrentInstantiation -fno-odr-hash-protocols -clang-vendor-feature=+enableAggressiveVLAFolding -clang-vendor-feature=+revert09abecef7bbf -clang-vendor-feature=+thisNoAlignAttr -clang-vendor-feature=+thisNoNullAttr -mllvm -disable-aligned-alloc-awareness=1 -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o CMakeFiles/cmTC_3307b.dir/CMakeCXXCompilerABI.cpp.o -x c++ /opt/homebrew/Cellar/cmake/3.25.1/share/cmake/Modules/CMakeCXXCompilerABI.cpp] + ignore line: [clang -cc1 version 14.0.0 (clang-1400.0.29.202) default target arm64-apple-darwin22.2.0] + ignore line: [ignoring nonexistent directory "/Users/ningfei/.local/include"] + ignore line: [ignoring nonexistent directory "/Users/ningfei/.local/include"] + ignore line: [ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/local/include"] + ignore line: [ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/Library/Frameworks"] + ignore line: [#include "..." search starts here:] + ignore line: [#include <...> search starts here:] + ignore line: [ /opt/homebrew/include] + ignore line: [ .] + ignore line: [ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/c++/v1] + ignore line: [ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include] + ignore line: [ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include] + ignore line: [ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include] + ignore line: [ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/System/Library/Frameworks (framework directory)] + ignore line: [End of search list.] + ignore line: [Linking CXX executable cmTC_3307b] + ignore line: [/opt/homebrew/Cellar/cmake/3.25.1/bin/cmake -E cmake_link_script CMakeFiles/cmTC_3307b.dir/link.txt --verbose=1] + ignore line: [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk -Wl -search_paths_first -Wl -headerpad_max_install_names -v -Wl -v CMakeFiles/cmTC_3307b.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_3307b ] + ignore line: [Apple clang version 14.0.0 (clang-1400.0.29.202)] + ignore line: [Target: x86_64-apple-darwin22.2.0] + ignore line: [Thread model: posix] + ignore line: [InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin] + link line: [ "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -dynamic -arch x86_64 -platform_version macos 13.0.0 13.1 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk -o cmTC_3307b -L/Users/ningfei/.local/lib -L/opt/homebrew/lib -L. -search_paths_first -headerpad_max_install_names -v CMakeFiles/cmTC_3307b.dir/CMakeCXXCompilerABI.cpp.o -lc++ -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/lib/darwin/libclang_rt.osx.a] + arg [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld] ==> ignore + arg [-demangle] ==> ignore + arg [-lto_library] ==> ignore, skip following value + arg [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib] ==> skip value of -lto_library + arg [-dynamic] ==> ignore + arg [-arch] ==> ignore + arg [x86_64] ==> ignore + arg [-platform_version] ==> ignore + arg [macos] ==> ignore + arg [13.0.0] ==> ignore + arg [13.1] ==> ignore + arg [-syslibroot] ==> ignore + arg [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk] ==> ignore + arg [-o] ==> ignore + arg [cmTC_3307b] ==> ignore + arg [-L/Users/ningfei/.local/lib] ==> dir [/Users/ningfei/.local/lib] + arg [-L/opt/homebrew/lib] ==> dir [/opt/homebrew/lib] + arg [-L.] ==> ignore + arg [-search_paths_first] ==> ignore + arg [-headerpad_max_install_names] ==> ignore + arg [-v] ==> ignore + arg [CMakeFiles/cmTC_3307b.dir/CMakeCXXCompilerABI.cpp.o] ==> ignore + arg [-lc++] ==> lib [c++] + arg [-lSystem] ==> lib [System] + arg [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/lib/darwin/libclang_rt.osx.a] ==> lib [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/lib/darwin/libclang_rt.osx.a] + Library search paths: [;/Users/ningfei/.local/lib;/opt/homebrew/lib;.;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/lib] + Framework search paths: [;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/System/Library/Frameworks/] + remove lib [System] + remove lib [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/lib/darwin/libclang_rt.osx.a] + collapse library dir [/Users/ningfei/.local/lib] ==> [/Users/ningfei/.local/lib] + collapse library dir [/opt/homebrew/lib] ==> [/opt/homebrew/lib] + collapse library dir [/Users/ningfei/.local/lib] ==> [/Users/ningfei/.local/lib] + collapse library dir [/opt/homebrew/lib] ==> [/opt/homebrew/lib] + collapse library dir [.] ==> [/Users/ningfei/Repo/dcm2niix] + collapse library dir [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/lib] ==> [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/lib] + collapse framework dir [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/System/Library/Frameworks/] ==> [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/System/Library/Frameworks] + implicit libs: [c++] + implicit objs: [] + implicit dirs: [/Users/ningfei/.local/lib;/opt/homebrew/lib;/Users/ningfei/Repo/dcm2niix;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/lib] + implicit fwks: [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/System/Library/Frameworks] + + diff --git a/CMakeFiles/cmake.check_cache b/CMakeFiles/cmake.check_cache new file mode 100644 index 00000000..3dccd731 --- /dev/null +++ b/CMakeFiles/cmake.check_cache @@ -0,0 +1 @@ +# This file is generated by cmake for dependency checking of the CMakeCache.txt file diff --git a/SuperBuild/External-CLOUDFLARE-ZLIB.cmake b/SuperBuild/External-CLOUDFLARE-ZLIB.cmake index 7f4e781a..9bc4d691 100644 --- a/SuperBuild/External-CLOUDFLARE-ZLIB.cmake +++ b/SuperBuild/External-CLOUDFLARE-ZLIB.cmake @@ -7,6 +7,7 @@ ExternalProject_Add(zlib BINARY_DIR cloudflare-zlib-build CMAKE_ARGS -Wno-dev + ${OSX_ARCHITECTURES} -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} -DCMAKE_INSTALL_PREFIX:PATH=${DEP_INSTALL_DIR} ) diff --git a/SuperBuild/External-OPENJPEG.cmake b/SuperBuild/External-OPENJPEG.cmake index 84b3afce..f1175884 100644 --- a/SuperBuild/External-OPENJPEG.cmake +++ b/SuperBuild/External-OPENJPEG.cmake @@ -8,6 +8,7 @@ ExternalProject_Add(openjpeg CMAKE_ARGS -Wno-dev --no-warn-unused-cli + ${OSX_ARCHITECTURES} -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} -DCMAKE_INSTALL_PREFIX:PATH=${DEP_INSTALL_DIR} ) diff --git a/SuperBuild/External-YAML-CPP.cmake b/SuperBuild/External-YAML-CPP.cmake index 5cea5931..95d009f0 100644 --- a/SuperBuild/External-YAML-CPP.cmake +++ b/SuperBuild/External-YAML-CPP.cmake @@ -8,6 +8,7 @@ ExternalProject_Add(yaml-cpp CMAKE_ARGS -Wno-dev --no-warn-unused-cli + ${OSX_ARCHITECTURES} -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} -DCMAKE_INSTALL_PREFIX:PATH=${DEP_INSTALL_DIR} ) diff --git a/SuperBuild/SuperBuild.cmake b/SuperBuild/SuperBuild.cmake index fb454b3a..d0635308 100644 --- a/SuperBuild/SuperBuild.cmake +++ b/SuperBuild/SuperBuild.cmake @@ -28,6 +28,10 @@ if(USE_STATIC_RUNTIME) endif() endif() +if(APPLE) + set(OSX_ARCHITECTURES "-DCMAKE_OSX_ARCHITECTURES:STRING=${CMAKE_OSX_ARCHITECTURES}") +endif() + option(USE_TURBOJPEG "Use TurboJPEG to decode classic JPEG" OFF) option(USE_JASPER "Build with JPEG2000 support using Jasper" OFF) set(USE_OPENJPEG "OFF" CACHE STRING "Build with JPEG2000 support using OpenJPEG.") @@ -147,6 +151,7 @@ ExternalProject_Add(console CMAKE_ARGS -Wno-dev --no-warn-unused-cli + ${OSX_ARCHITECTURES} -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_BINARY_DIR} -DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS} @@ -170,11 +175,9 @@ ExternalProject_Add(console ) if(SKBUILD) - install(DIRECTORY ${CMAKE_BINARY_DIR}/bin/ DESTINATION dcm2niix - USE_SOURCE_PERMISSIONS) + install(DIRECTORY ${CMAKE_BINARY_DIR}/bin/ DESTINATION dcm2niix USE_SOURCE_PERMISSIONS) endif() -install(DIRECTORY ${CMAKE_BINARY_DIR}/bin/ DESTINATION bin - USE_SOURCE_PERMISSIONS) +install(DIRECTORY ${CMAKE_BINARY_DIR}/bin/ DESTINATION bin USE_SOURCE_PERMISSIONS) option(BUILD_DOCS "Build documentation (manpages)" OFF) if(BUILD_DOCS) diff --git a/console-prefix/src/console-stamp/console-custominfo.txt b/console-prefix/src/console-stamp/console-custominfo.txt new file mode 100644 index 00000000..d3f6044b --- /dev/null +++ b/console-prefix/src/console-stamp/console-custominfo.txt @@ -0,0 +1,9 @@ +# This is a generated file and its contents are an internal implementation detail. +# The download step will be re-executed if anything in this file changes. +# No other meaning or use of this file is supported. + +method=custom +command= +source_dir=/Users/ningfei/Repo/dcm2niix/console +work_dir=/Users/ningfei/Repo/dcm2niix/console-prefix/src + diff --git a/console-prefix/tmp/console-cfgcmd.txt b/console-prefix/tmp/console-cfgcmd.txt new file mode 100644 index 00000000..8ba2b9fc --- /dev/null +++ b/console-prefix/tmp/console-cfgcmd.txt @@ -0,0 +1 @@ +cmd='/opt/homebrew/Cellar/cmake/3.25.1/bin/cmake;-Wno-dev;--no-warn-unused-clil;-DCMAKE_OSX_ARCHITECTURES=x86_64;-DCMAKE_BUILD_TYPE:STRING=Release;-DCMAKE_INSTALL_PREFIX:PATH=/Users/ningfei/Repo/dcm2niix;-DCMAKE_C_FLAGS:STRING=;-DCMAKE_CXX_FLAGS:STRING=;-DCMAKE_VERBOSE_MAKEFILE:BOOL=FALSE;-DUSE_STATIC_RUNTIME:BOOL=ON;-DUSE_TURBOJPEG:BOOL=OFF;-DUSE_JASPER:BOOL=OFF;-DUSE_JPEGLS:BOOL=OFF;-DUSE_JNIFTI:BOOL=ON;-DZLIB_IMPLEMENTATION:STRING=Miniz;-DZLIB_ROOT:PATH=;-DUSE_OPENJPEG:BOOL=OFF;-DOpenJPEG_DIR:PATH=;-DBATCH_VERSION:BOOL=OFF;-DYAML-CPP_DIR:PATH=;-DBUILD_DCM2NIIXFSLIB:BOOL=OFF;-GUnix Makefiles;' diff --git a/console-prefix/tmp/console-mkdirs.cmake b/console-prefix/tmp/console-mkdirs.cmake new file mode 100644 index 00000000..9141b5b0 --- /dev/null +++ b/console-prefix/tmp/console-mkdirs.cmake @@ -0,0 +1,22 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +cmake_minimum_required(VERSION 3.5) + +file(MAKE_DIRECTORY + "/Users/ningfei/Repo/dcm2niix/console" + "/Users/ningfei/Repo/dcm2niix/console-build" + "/Users/ningfei/Repo/dcm2niix/console-prefix" + "/Users/ningfei/Repo/dcm2niix/console-prefix/tmp" + "/Users/ningfei/Repo/dcm2niix/console-prefix/src/console-stamp" + "/Users/ningfei/Repo/dcm2niix/console-prefix/src" + "/Users/ningfei/Repo/dcm2niix/console-prefix/src/console-stamp" +) + +set(configSubDirs ) +foreach(subDir IN LISTS configSubDirs) + file(MAKE_DIRECTORY "/Users/ningfei/Repo/dcm2niix/console-prefix/src/console-stamp/${subDir}") +endforeach() +if(cfgdir) + file(MAKE_DIRECTORY "/Users/ningfei/Repo/dcm2niix/console-prefix/src/console-stamp${cfgdir}") # cfgdir has leading slash +endif() From 4762234d4d32a1206d2e635a39d4d533aef39fc8 Mon Sep 17 00:00:00 2001 From: Ningfei Li Date: Sun, 18 Dec 2022 17:07:35 +0100 Subject: [PATCH 41/85] Enable Cloudflare zlib by default in CI. Also turn off building dcm2niibatch. --- .appveyor.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index faaf7828..a1aa35b6 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -39,7 +39,7 @@ for: - job_name: win build_script: - - cmake -Wno-dev -DBATCH_VERSION=ON -DUSE_OPENJPEG=GitHub -DUSE_JPEGLS=ON -B build + - cmake -Wno-dev -DZLIB_IMPLEMENTATION=Cloudflare -DUSE_OPENJPEG=GitHub -DUSE_JPEGLS=ON -B build - cmake --build build --config %configuration% after_build: @@ -53,7 +53,7 @@ for: build_script: - export CC=gcc-8 CXX=g++-8 - - cmake -Wno-dev -DBATCH_VERSION=ON -DUSE_OPENJPEG=GitHub -DUSE_JPEGLS=ON -B build + - cmake -Wno-dev -DZLIB_IMPLEMENTATION=Cloudflare -DUSE_OPENJPEG=GitHub -DUSE_JPEGLS=ON -B build - cmake --build build after_build: @@ -68,16 +68,15 @@ for: build_script: - sudo xcode-select -s /Applications/Xcode-11.3.1.app - - cmake -Wno-dev -DCMAKE_OSX_ARCHITECTURES=x86_64 -DBATCH_VERSION=ON -DUSE_OPENJPEG=GitHub -DUSE_JPEGLS=ON -B intel + - cmake -Wno-dev -DCMAKE_OSX_ARCHITECTURES=x86_64 -DZLIB_IMPLEMENTATION=Cloudflare -DUSE_OPENJPEG=GitHub -DUSE_JPEGLS=ON -B intel - cmake --build intel - sudo xcode-select -s /Applications/Xcode-12.3.app - - cmake -Wno-dev -DCMAKE_OSX_ARCHITECTURES=arm64 -DBATCH_VERSION=ON -DUSE_OPENJPEG=GitHub -DUSE_JPEGLS=ON -B apple + - cmake -Wno-dev -DCMAKE_OSX_ARCHITECTURES=arm64 -DZLIB_IMPLEMENTATION=Cloudflare -DUSE_OPENJPEG=GitHub -DUSE_JPEGLS=ON -B apple - cmake --build apple after_build: - mkdir -p build/bin - lipo -create -output build/bin/dcm2niix intel/bin/dcm2niix apple/bin/dcm2niix - - lipo -create -output build/bin/dcm2niibatch intel/bin/dcm2niibatch apple/bin/dcm2niibatch - strip -Sx build/bin/* - 7z a dcm2niix_macos.zip ./build/bin/* &>/dev/null - appveyor PushArtifact dcm2niix_macos.zip From a82cf42801d27bad2ba19883540f456d1c91f8e0 Mon Sep 17 00:00:00 2001 From: Ningfei Li Date: Fri, 28 Oct 2022 12:32:49 +0200 Subject: [PATCH 42/85] ENH: Add -q option to only search directory for DICOMs. --- console/main_console.cpp | 18 +++++++++++++++--- console/nii_dicom_batch.cpp | 9 ++++++++- console/nii_dicom_batch.h | 2 +- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/console/main_console.cpp b/console/main_console.cpp index 74f326e8..b64b987d 100644 --- a/console/main_console.cpp +++ b/console/main_console.cpp @@ -104,6 +104,7 @@ void showHelp(const char *argv[], struct TDCMopts opts) { printf(" -n : only convert this series CRC number - can be used up to %i times (default convert all)\n", MAX_NUM_SERIES); printf(" -o : output directory (omit to save to input folder)\n"); printf(" -p : Philips precise float (not display) scaling (y/n, default y)\n"); + printf(" -q : only search directory for DICOMs (y/l/n, default y) [y=show number of DICOMs found, l=additionally list DICOMs found, n=no]\n"); printf(" -r : rename instead of convert DICOMs (y/n, default n)\n"); printf(" -s : single file mode, do not convert other images in folder (y/n, default n)\n"); //text notes replaced with BIDS: this function is deprecated @@ -178,7 +179,7 @@ void showHelp(const char *argv[], struct TDCMopts opts) { } //showHelp() int invalidParam(int i, const char *argv[]) { - if (strchr("yYnNoOhHiIjJBb01234",argv[i][0])) + if (strchr("yYnNoOhHiIjlLJBb01234",argv[i][0])) return 0; //if (argv[i][0] != '-') return 0; @@ -471,6 +472,14 @@ int main(int argc, const char *argv[]) { return 0; if ((argv[i][0] == 'y') || (argv[i][0] == 'Y')) opts.isRenameNotConvert = true; + } else if ((argv[i][1] == 'q') && ((i + 1) < argc)) { + i++; + if (invalidParam(i, argv)) + return 0; + if ((argv[i][0] == 'y') || (argv[i][0] == 'Y')) + opts.onlySearchDirForDICOM = 1; + else if ((argv[i][0] == 'l') || (argv[i][0] == 'L')) + opts.onlySearchDirForDICOM = 2; } else if ((argv[i][1] == 's') && ((i + 1) < argc)) { i++; if (invalidParam(i, argv)) @@ -624,11 +633,14 @@ int main(int argc, const char *argv[]) { if (ret != EXIT_SUCCESS) return ret; } + + if (opts.onlySearchDirForDICOM == 0) { #if !defined(_WIN64) && !defined(_WIN32) - printf("Conversion required %f seconds (%f for core code).\n", get_wall_time() - startWall, ((float)(clock() - start)) / CLOCKS_PER_SEC); + printf("Conversion required %f seconds (%f for core code).\n", get_wall_time() - startWall, ((float)(clock() - start)) / CLOCKS_PER_SEC); #else - printf("Conversion required %f seconds.\n", ((float)(clock() - start)) / CLOCKS_PER_SEC); + printf("Conversion required %f seconds.\n", ((float)(clock() - start)) / CLOCKS_PER_SEC); #endif + } //if (isSaveIni) //we now save defaults earlier, in case of early termination. // saveIniFile(opts); return EXIT_SUCCESS; diff --git a/console/nii_dicom_batch.cpp b/console/nii_dicom_batch.cpp index a623c510..ee9b0d5b 100644 --- a/console/nii_dicom_batch.cpp +++ b/console/nii_dicom_batch.cpp @@ -8238,6 +8238,12 @@ int nii_loadDirCore(char *indir, struct TDCMopts *opts) { } size_t nDcm = nameList.numItems; printMessage("Found %lu DICOM file(s)\n", nameList.numItems); //includes images and other non-image DICOMs + if (opts->onlySearchDirForDICOM == 2) { + printMessage("List of DICOM file(s):\n"); + for (int i = 0; i < nameList.numItems; i++) + printMessage("%s\n", nameList.str[i]); + printMessage("End of list (%lu in total)\n", nameList.numItems); + } #ifdef myTimer if (opts->isProgress > 1) printMessage("Stage 1 (Count number of DICOMs) required %f seconds.\n", ((float)(clock() - start)) / CLOCKS_PER_SEC); @@ -8294,7 +8300,7 @@ int nii_loadDirCore(char *indir, struct TDCMopts *opts) { printMessage("Stage 2 (Read DICOM headers, Convert 4D) required %f seconds.\n", ((float)(clock() - start)) / CLOCKS_PER_SEC); start = clock(); #endif - if (opts->isRenameNotConvert) { + if ((opts->isRenameNotConvert) || (opts->onlySearchDirForDICOM != 0)) { free(dcmList); free(dti4D); return EXIT_SUCCESS; @@ -8852,6 +8858,7 @@ void setDefaultOpts(struct TDCMopts *opts, const char *argv[]) { //either "setDe opts->isPipedGz = false; //e.g. pipe data directly to pigz instead of saving uncompressed to disk opts->isSave3D = false; opts->dirSearchDepth = 5; + opts->onlySearchDirForDICOM = 0; opts->isProgress = 0; opts->nameConflictBehavior = kNAME_CONFLICT_ADD_SUFFIX; #ifdef myDisableZLib diff --git a/console/nii_dicom_batch.h b/console/nii_dicom_batch.h index 0f9c88c8..22398999 100644 --- a/console/nii_dicom_batch.h +++ b/console/nii_dicom_batch.h @@ -57,7 +57,7 @@ void nii_clrMrifsStruct(); struct TDCMopts { bool isIgnoreTriggerTimes, isTestx0021x105E, isAddNamePostFixes, isSaveNativeEndian, isOneDirAtATime, isRenameNotConvert, isSave3D, isGz, isPipedGz, isFlipY, isCreateBIDS, isSortDTIbyBVal, isAnonymizeBIDS, isOnlyBIDS, isCreateText, isForceOnsetTimes,isIgnoreDerivedAnd2D, isPhilipsFloatNotDisplayScaling, isTiltCorrect, isRGBplanar, isOnlySingleFile, isForceStackDCE, isIgnoreSeriesInstanceUID, isRotate3DAcq, isCrop; - int saveFormat, isMaximize16BitRange, isForceStackSameSeries, nameConflictBehavior, isVerbose, isProgress, compressFlag, dirSearchDepth, gzLevel, diffCyclingModeGE; //support for compressed data 0=none, + int saveFormat, isMaximize16BitRange, isForceStackSameSeries, nameConflictBehavior, isVerbose, isProgress, compressFlag, dirSearchDepth, onlySearchDirForDICOM, gzLevel, diffCyclingModeGE; //support for compressed data 0=none, char filename[512], outdir[512], indir[512], pigzname[512], optsname[512], indirParent[512], imageComments[24]; double seriesNumber[MAX_NUM_SERIES]; //requires double must store -1 (report but do not convert) as well as seriesUidCrc (uint32) long numSeries; From 68056b0db45c96fa519e8009abf55b23432367ea Mon Sep 17 00:00:00 2001 From: neurolabusc Date: Mon, 19 Dec 2022 10:12:20 -0500 Subject: [PATCH 43/85] Update Philips README Update Philips README (https://github.com/rordenlab/dcm2niix/issues/377) --- Philips/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Philips/README.md b/Philips/README.md index 3ac7e353..64963a12 100644 --- a/Philips/README.md +++ b/Philips/README.md @@ -152,7 +152,7 @@ Philips DICOMs do not allow one to determine the temporal order of volumes for d Likewise, the BIDS tag "PhaseEncodingDirection" allows tools like [eddy](https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/eddy) and [TOPUP](https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/topup) to undistort images. While the Philips DICOM header distinguishes the phase encoding axis (e.g. anterior-posterior vs left-right) it does not encode the polarity (A->P vs P->A). -Another value desirable for TOPUP is the "TotalReadoutTime". Again, one can not confidently calculate this from Philips DICOMs (though on can [approximate it if you make a few assumptions](https://github.com/nipreps/sdcflows/issues/5)). If you do decide to calculate this using values from the MRI console, be aware that the [FSL definition](https://github.com/rordenlab/dcm2niix/issues/130) is not intuitive for scans with interpolation, partial Fourier, parallel imaging, etc. However, it should be pointed out that the "TotalReadoutTime" only influences TOPUP's calibrated validation images that are typically ignored. The data used in subsequent steps will not be influenced by this value. +Another value desirable for susceptibility distortion correction (e.g., TOPUP) is the "TotalReadoutTime". Be aware that the [FSL definition](https://github.com/rordenlab/dcm2niix/issues/130) is not intuitive for scans with parallel imaging, phase oversampling, partial Fourier, interpolation, etc. It has been challenging to establish and validate the correct equations to calculate "TotalReadoutTime" on Philips in the presence of all these possible factors, and the issue is further complicated by the fact that Philips have may changed the manner in which it reports the [relevant information over time](https://github.com/rordenlab/dcm2niix/issues/377#issuecomment-598665157). For this reason, for Philips data, `dcm2niix` currently reports `EstimatedTotalReadoutTime` and `EstimatedEffectiveEchoSpacing` (note the inclusion of `Estimated` as part of those variable names). See [issue 377](https://github.com/rordenlab/dcm2niix/issues/377) for a fuller discussion. However, it is also relevant to note that getting "TotalReadoutTime" correct is not critical to the TOPUP correction _if the readout time is identical for all the relevant images_ (i.e., the spin-echo EPI images to estimate the field, as well as any subsequent images being corrected). If that is not the case, or if you want TOPUP to return a valid estimate of the field itself (in Hz; `--fout` flag), then getting "Total Readout Time" correct is important. ## Partial Volumes From dc24c928cd89a84da0117b517fcbf13816db61c9 Mon Sep 17 00:00:00 2001 From: neurolabusc Date: Tue, 20 Dec 2022 14:25:16 -0500 Subject: [PATCH 44/85] Limit Linux stack size usage --- console/makefile | 6 +++++- console/nii_dicom.h | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/console/makefile b/console/makefile index 3d20976a..1f35e23c 100644 --- a/console/makefile +++ b/console/makefile @@ -5,7 +5,10 @@ CFLAGS=-s -O3 #CFLAGS=-g # issue659: increase stack to 16mb -LFLAGS=-s -O3 -Wl,-stack_size -Wl,0x1000000 +#For Linux linker stacksize ignored: we must use setrlimit +# LFLAGS=-Wl,-z -Wl,stack-size=16777216 +LFLAGS= + #Leak tests: # https://clang.llvm.org/docs/AddressSanitizer.html @@ -37,6 +40,7 @@ ifneq ($(OS),Windows_NT) # otool -l ./dcm2niix | grep info_plist -B1 -A10 # launchctl plist ./dcm2niix #MacOS links g++ to clang++, for gcc install via homebrew and replace g++ with /usr/local/bin/gcc-9 + LFLAGS=-Wl,-stack_size -Wl,0x1000000 endif endif all: diff --git a/console/nii_dicom.h b/console/nii_dicom.h index 02a56a0e..91545570 100644 --- a/console/nii_dicom.h +++ b/console/nii_dicom.h @@ -54,7 +54,12 @@ extern "C" { #define kDCMvers kDCMdate " " kJP2suf kLSsuf kCCsuf kCPUsuf static const int kMaxEPI3D = 1024; //maximum number of EPI images in Siemens Mosaic -static const int kMaxSlice2D = 131070;// 65535; //issue460 maximum number of 2D slices in 4D (Philips) images + +#if defined(__linux__) //Unix users must use setrlimit + static const int kMaxSlice2D = 65535; //issue460 maximum number of 2D slices in 4D (Philips) images +#else + static const int kMaxSlice2D = 131070;// 65535; //issue460 maximum number of 2D slices in 4D (Philips) images +#endif static const int kMaxDTI4D = kMaxSlice2D; //issue460: maximum number of DTI directions for 4D (Philips) images, also maximum number of 2D slices for Enhanced DICOM and PAR/REC #define kDICOMStr 66 //64 characters plus NULL https://github.com/rordenlab/dcm2niix/issues/268 From 3e59de1e05bd5f9a0aba41880ac33acd9bcfcd28 Mon Sep 17 00:00:00 2001 From: Ningfei Li Date: Fri, 30 Dec 2022 22:42:39 +0100 Subject: [PATCH 45/85] Remove CMake cache files. --- CMakeCache.txt | 411 --------- CMakeFiles/3.25.1/CMakeCCompiler.cmake | 72 -- CMakeFiles/3.25.1/CMakeCXXCompiler.cmake | 83 -- .../3.25.1/CMakeDetermineCompilerABI_C.bin | Bin 16712 -> 0 bytes .../3.25.1/CMakeDetermineCompilerABI_CXX.bin | Bin 16696 -> 0 bytes CMakeFiles/3.25.1/CMakeSystem.cmake | 15 - .../3.25.1/CompilerIdC/CMakeCCompilerId.c | 868 ------------------ .../3.25.1/CompilerIdC/CMakeCCompilerId.o | Bin 1712 -> 0 bytes .../CompilerIdCXX/CMakeCXXCompilerId.cpp | 857 ----------------- .../3.25.1/CompilerIdCXX/CMakeCXXCompilerId.o | Bin 1712 -> 0 bytes CMakeFiles/CMakeError.log | 0 CMakeFiles/CMakeOutput.log | 312 ------- CMakeFiles/cmake.check_cache | 1 - .../src/console-stamp/console-custominfo.txt | 9 - console-prefix/tmp/console-cfgcmd.txt | 1 - console-prefix/tmp/console-mkdirs.cmake | 22 - 16 files changed, 2651 deletions(-) delete mode 100644 CMakeCache.txt delete mode 100644 CMakeFiles/3.25.1/CMakeCCompiler.cmake delete mode 100644 CMakeFiles/3.25.1/CMakeCXXCompiler.cmake delete mode 100755 CMakeFiles/3.25.1/CMakeDetermineCompilerABI_C.bin delete mode 100755 CMakeFiles/3.25.1/CMakeDetermineCompilerABI_CXX.bin delete mode 100644 CMakeFiles/3.25.1/CMakeSystem.cmake delete mode 100644 CMakeFiles/3.25.1/CompilerIdC/CMakeCCompilerId.c delete mode 100644 CMakeFiles/3.25.1/CompilerIdC/CMakeCCompilerId.o delete mode 100644 CMakeFiles/3.25.1/CompilerIdCXX/CMakeCXXCompilerId.cpp delete mode 100644 CMakeFiles/3.25.1/CompilerIdCXX/CMakeCXXCompilerId.o delete mode 100644 CMakeFiles/CMakeError.log delete mode 100644 CMakeFiles/CMakeOutput.log delete mode 100644 CMakeFiles/cmake.check_cache delete mode 100644 console-prefix/src/console-stamp/console-custominfo.txt delete mode 100644 console-prefix/tmp/console-cfgcmd.txt delete mode 100644 console-prefix/tmp/console-mkdirs.cmake diff --git a/CMakeCache.txt b/CMakeCache.txt deleted file mode 100644 index e16af8c3..00000000 --- a/CMakeCache.txt +++ /dev/null @@ -1,411 +0,0 @@ -# This is the CMakeCache file. -# For build in directory: /Users/ningfei/Repo/dcm2niix -# It was generated by CMake: /opt/homebrew/Cellar/cmake/3.25.1/bin/cmake -# You can edit this file to change values found and used by cmake. -# If you do not want to change any of the values, simply exit the editor. -# If you do want to change a value, simply edit, save, and exit the editor. -# The syntax for the file is as follows: -# KEY:TYPE=VALUE -# KEY is the name of a variable in the cache. -# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!. -# VALUE is the current value for the KEY. - -######################## -# EXTERNAL cache entries -######################## - -//Build dcm2niibatch for multiple conversions -BATCH_VERSION:BOOL=OFF - -//Build libdcm2niixfs.a -BUILD_DCM2NIIXFSLIB:BOOL=OFF - -//Build documentation (manpages) -BUILD_DOCS:BOOL=OFF - -//Path to a program. -CMAKE_ADDR2LINE:FILEPATH=CMAKE_ADDR2LINE-NOTFOUND - -//Path to a program. -CMAKE_AR:FILEPATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar - -//Choose the type of build, options are: Debug Release RelWithDebInfo -// MinSizeRel. -CMAKE_BUILD_TYPE:STRING=Release - -//Enable/Disable color output during build. -CMAKE_COLOR_MAKEFILE:BOOL=ON - -//CXX compiler -CMAKE_CXX_COMPILER:FILEPATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - -//Flags used by the CXX compiler during all build types. -CMAKE_CXX_FLAGS:STRING= - -//Flags used by the CXX compiler during DEBUG builds. -CMAKE_CXX_FLAGS_DEBUG:STRING=-g - -//Flags used by the CXX compiler during MINSIZEREL builds. -CMAKE_CXX_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG - -//Flags used by the CXX compiler during RELEASE builds. -CMAKE_CXX_FLAGS_RELEASE:STRING=-O3 -DNDEBUG - -//Flags used by the CXX compiler during RELWITHDEBINFO builds. -CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG - -//C compiler -CMAKE_C_COMPILER:FILEPATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - -//Flags used by the C compiler during all build types. -CMAKE_C_FLAGS:STRING= - -//Flags used by the C compiler during DEBUG builds. -CMAKE_C_FLAGS_DEBUG:STRING=-g - -//Flags used by the C compiler during MINSIZEREL builds. -CMAKE_C_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG - -//Flags used by the C compiler during RELEASE builds. -CMAKE_C_FLAGS_RELEASE:STRING=-O3 -DNDEBUG - -//Flags used by the C compiler during RELWITHDEBINFO builds. -CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG - -//Path to a program. -CMAKE_DLLTOOL:FILEPATH=CMAKE_DLLTOOL-NOTFOUND - -//Flags used by the linker during all build types. -CMAKE_EXE_LINKER_FLAGS:STRING= - -//Flags used by the linker during DEBUG builds. -CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING= - -//Flags used by the linker during MINSIZEREL builds. -CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING= - -//Flags used by the linker during RELEASE builds. -CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING= - -//Flags used by the linker during RELWITHDEBINFO builds. -CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING= - -//Enable/Disable output of compile commands during generation. -CMAKE_EXPORT_COMPILE_COMMANDS:BOOL= - -//Value Computed by CMake. -CMAKE_FIND_PACKAGE_REDIRECTS_DIR:STATIC=/Users/ningfei/Repo/dcm2niix/CMakeFiles/pkgRedirects - -//Path to a program. -CMAKE_INSTALL_NAME_TOOL:FILEPATH=/usr/bin/install_name_tool - -//Install path prefix, prepended onto install directories. -CMAKE_INSTALL_PREFIX:PATH=/usr/local - -//Path to a program. -CMAKE_LINKER:FILEPATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld - -//Path to a program. -CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/make - -//Flags used by the linker during the creation of modules during -// all build types. -CMAKE_MODULE_LINKER_FLAGS:STRING= - -//Flags used by the linker during the creation of modules during -// DEBUG builds. -CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING= - -//Flags used by the linker during the creation of modules during -// MINSIZEREL builds. -CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING= - -//Flags used by the linker during the creation of modules during -// RELEASE builds. -CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING= - -//Flags used by the linker during the creation of modules during -// RELWITHDEBINFO builds. -CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING= - -//Path to a program. -CMAKE_NM:FILEPATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm - -//Path to a program. -CMAKE_OBJCOPY:FILEPATH=CMAKE_OBJCOPY-NOTFOUND - -//Path to a program. -CMAKE_OBJDUMP:FILEPATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/objdump - -//Build architectures for OSX -CMAKE_OSX_ARCHITECTURES:STRING=x86_64 - -//Minimum OS X version to target for deployment (at runtime); newer -// APIs weak linked. Set to empty string for default value. -CMAKE_OSX_DEPLOYMENT_TARGET:STRING= - -//The product will be built against the headers and libraries located -// inside the indicated SDK. -CMAKE_OSX_SYSROOT:PATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk - -//Value Computed by CMake -CMAKE_PROJECT_DESCRIPTION:STATIC= - -//Value Computed by CMake -CMAKE_PROJECT_HOMEPAGE_URL:STATIC= - -//Value Computed by CMake -CMAKE_PROJECT_NAME:STATIC=dcm2niix - -//Path to a program. -CMAKE_RANLIB:FILEPATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib - -//Path to a program. -CMAKE_READELF:FILEPATH=CMAKE_READELF-NOTFOUND - -//Flags used by the linker during the creation of shared libraries -// during all build types. -CMAKE_SHARED_LINKER_FLAGS:STRING= - -//Flags used by the linker during the creation of shared libraries -// during DEBUG builds. -CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING= - -//Flags used by the linker during the creation of shared libraries -// during MINSIZEREL builds. -CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING= - -//Flags used by the linker during the creation of shared libraries -// during RELEASE builds. -CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING= - -//Flags used by the linker during the creation of shared libraries -// during RELWITHDEBINFO builds. -CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING= - -//If set, runtime paths are not added when installing shared libraries, -// but are added when building. -CMAKE_SKIP_INSTALL_RPATH:BOOL=NO - -//If set, runtime paths are not added when using shared libraries. -CMAKE_SKIP_RPATH:BOOL=NO - -//Flags used by the linker during the creation of static libraries -// during all build types. -CMAKE_STATIC_LINKER_FLAGS:STRING= - -//Flags used by the linker during the creation of static libraries -// during DEBUG builds. -CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING= - -//Flags used by the linker during the creation of static libraries -// during MINSIZEREL builds. -CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING= - -//Flags used by the linker during the creation of static libraries -// during RELEASE builds. -CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING= - -//Flags used by the linker during the creation of static libraries -// during RELWITHDEBINFO builds. -CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING= - -//Path to a program. -CMAKE_STRIP:FILEPATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip - -//If this value is on, makefiles will be generated without the -// .SILENT directive, and all commands will be echoed to the console -// during the make. This is useful for debugging only. With Visual -// Studio IDE projects all commands are done without /nologo. -CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE - -//Git command line client -GIT_EXECUTABLE:FILEPATH=/opt/homebrew/bin/git - -//Optionally install built dependent libraries (OpenJPEG and yaml-cpp) -// for future use. -INSTALL_DEPENDENCIES:BOOL=OFF - -//Build with JPEG2000 support using Jasper -USE_JASPER:BOOL=OFF - -//Build with JNIFTI support -USE_JNIFTI:BOOL=ON - -//Build with JPEG-LS support using CharLS -USE_JPEGLS:BOOL=OFF - -//Build with JPEG2000 support using OpenJPEG. -USE_OPENJPEG:STRING=OFF - -//Use static runtime -USE_STATIC_RUNTIME:BOOL=ON - -//Use TurboJPEG to decode classic JPEG -USE_TURBOJPEG:BOOL=OFF - -//Choose zlib implementation. -ZLIB_IMPLEMENTATION:STRING=Miniz - -//Value Computed by CMake -dcm2niix_BINARY_DIR:STATIC=/Users/ningfei/Repo/dcm2niix - -//Value Computed by CMake -dcm2niix_IS_TOP_LEVEL:STATIC=ON - -//Value Computed by CMake -dcm2niix_SOURCE_DIR:STATIC=/Users/ningfei/Repo/dcm2niix - - -######################## -# INTERNAL cache entries -######################## - -//ADVANCED property for variable: CMAKE_ADDR2LINE -CMAKE_ADDR2LINE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_AR -CMAKE_AR-ADVANCED:INTERNAL=1 -//STRINGS property for variable: CMAKE_BUILD_TYPE -CMAKE_BUILD_TYPE-STRINGS:INTERNAL=Debug;Release;RelWithDebInfo;MinSizeRel -//This is the directory where this CMakeCache.txt was created -CMAKE_CACHEFILE_DIR:INTERNAL=/Users/ningfei/Repo/dcm2niix -//Major version of cmake used to create the current loaded cache -CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3 -//Minor version of cmake used to create the current loaded cache -CMAKE_CACHE_MINOR_VERSION:INTERNAL=25 -//Patch version of cmake used to create the current loaded cache -CMAKE_CACHE_PATCH_VERSION:INTERNAL=1 -//ADVANCED property for variable: CMAKE_COLOR_MAKEFILE -CMAKE_COLOR_MAKEFILE-ADVANCED:INTERNAL=1 -//Path to CMake executable. -CMAKE_COMMAND:INTERNAL=/opt/homebrew/Cellar/cmake/3.25.1/bin/cmake -//Path to cpack program executable. -CMAKE_CPACK_COMMAND:INTERNAL=/opt/homebrew/Cellar/cmake/3.25.1/bin/cpack -//Path to ctest program executable. -CMAKE_CTEST_COMMAND:INTERNAL=/opt/homebrew/Cellar/cmake/3.25.1/bin/ctest -//ADVANCED property for variable: CMAKE_CXX_COMPILER -CMAKE_CXX_COMPILER-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS -CMAKE_CXX_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS_DEBUG -CMAKE_CXX_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS_MINSIZEREL -CMAKE_CXX_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELEASE -CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELWITHDEBINFO -CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_COMPILER -CMAKE_C_COMPILER-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS -CMAKE_C_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS_DEBUG -CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS_MINSIZEREL -CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS_RELEASE -CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS_RELWITHDEBINFO -CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_DLLTOOL -CMAKE_DLLTOOL-ADVANCED:INTERNAL=1 -//Path to cache edit program executable. -CMAKE_EDIT_COMMAND:INTERNAL=/opt/homebrew/Cellar/cmake/3.25.1/bin/ccmake -//Executable file format -CMAKE_EXECUTABLE_FORMAT:INTERNAL=MACHO -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS -CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG -CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL -CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE -CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO -CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS -CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1 -//Name of external makefile project generator. -CMAKE_EXTRA_GENERATOR:INTERNAL= -//Name of generator. -CMAKE_GENERATOR:INTERNAL=Unix Makefiles -//Generator instance identifier. -CMAKE_GENERATOR_INSTANCE:INTERNAL= -//Name of generator platform. -CMAKE_GENERATOR_PLATFORM:INTERNAL= -//Name of generator toolset. -CMAKE_GENERATOR_TOOLSET:INTERNAL= -//Source directory with the top level CMakeLists.txt file for this -// project -CMAKE_HOME_DIRECTORY:INTERNAL=/Users/ningfei/Repo/dcm2niix -//ADVANCED property for variable: CMAKE_INSTALL_NAME_TOOL -CMAKE_INSTALL_NAME_TOOL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_LINKER -CMAKE_LINKER-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MAKE_PROGRAM -CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS -CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG -CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL -CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE -CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO -CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_NM -CMAKE_NM-ADVANCED:INTERNAL=1 -//number of local generators -CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=1 -//ADVANCED property for variable: CMAKE_OBJCOPY -CMAKE_OBJCOPY-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_OBJDUMP -CMAKE_OBJDUMP-ADVANCED:INTERNAL=1 -//Platform information initialized -CMAKE_PLATFORM_INFO_INITIALIZED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_RANLIB -CMAKE_RANLIB-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_READELF -CMAKE_READELF-ADVANCED:INTERNAL=1 -//Path to CMake installation. -CMAKE_ROOT:INTERNAL=/opt/homebrew/Cellar/cmake/3.25.1/share/cmake -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS -CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG -CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL -CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE -CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO -CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH -CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SKIP_RPATH -CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS -CMAKE_STATIC_LINKER_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_DEBUG -CMAKE_STATIC_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL -CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELEASE -CMAKE_STATIC_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO -CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STRIP -CMAKE_STRIP-ADVANCED:INTERNAL=1 -//uname command -CMAKE_UNAME:INTERNAL=/usr/bin/uname -//ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE -CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1 -//Details about finding Git -FIND_PACKAGE_MESSAGE_DETAILS_Git:INTERNAL=[/opt/homebrew/bin/git][v2.38.1()] -//ADVANCED property for variable: GIT_EXECUTABLE -GIT_EXECUTABLE-ADVANCED:INTERNAL=1 -//STRINGS property for variable: USE_OPENJPEG -USE_OPENJPEG-STRINGS:INTERNAL=OFF;GitHub;System;Custom -//STRINGS property for variable: ZLIB_IMPLEMENTATION -ZLIB_IMPLEMENTATION-STRINGS:INTERNAL=Miniz;System;Cloudflare;Custom - diff --git a/CMakeFiles/3.25.1/CMakeCCompiler.cmake b/CMakeFiles/3.25.1/CMakeCCompiler.cmake deleted file mode 100644 index 30eb4797..00000000 --- a/CMakeFiles/3.25.1/CMakeCCompiler.cmake +++ /dev/null @@ -1,72 +0,0 @@ -set(CMAKE_C_COMPILER "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc") -set(CMAKE_C_COMPILER_ARG1 "") -set(CMAKE_C_COMPILER_ID "AppleClang") -set(CMAKE_C_COMPILER_VERSION "14.0.0.14000029") -set(CMAKE_C_COMPILER_VERSION_INTERNAL "") -set(CMAKE_C_COMPILER_WRAPPER "") -set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "17") -set(CMAKE_C_EXTENSIONS_COMPUTED_DEFAULT "ON") -set(CMAKE_C_COMPILE_FEATURES "c_std_90;c_function_prototypes;c_std_99;c_restrict;c_variadic_macros;c_std_11;c_static_assert;c_std_17;c_std_23") -set(CMAKE_C90_COMPILE_FEATURES "c_std_90;c_function_prototypes") -set(CMAKE_C99_COMPILE_FEATURES "c_std_99;c_restrict;c_variadic_macros") -set(CMAKE_C11_COMPILE_FEATURES "c_std_11;c_static_assert") -set(CMAKE_C17_COMPILE_FEATURES "c_std_17") -set(CMAKE_C23_COMPILE_FEATURES "c_std_23") - -set(CMAKE_C_PLATFORM_ID "Darwin") -set(CMAKE_C_SIMULATE_ID "") -set(CMAKE_C_COMPILER_FRONTEND_VARIANT "") -set(CMAKE_C_SIMULATE_VERSION "") - - - - -set(CMAKE_AR "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar") -set(CMAKE_C_COMPILER_AR "") -set(CMAKE_RANLIB "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib") -set(CMAKE_C_COMPILER_RANLIB "") -set(CMAKE_LINKER "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld") -set(CMAKE_MT "") -set(CMAKE_COMPILER_IS_GNUCC ) -set(CMAKE_C_COMPILER_LOADED 1) -set(CMAKE_C_COMPILER_WORKS TRUE) -set(CMAKE_C_ABI_COMPILED TRUE) - -set(CMAKE_C_COMPILER_ENV_VAR "CC") - -set(CMAKE_C_COMPILER_ID_RUN 1) -set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m) -set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) -set(CMAKE_C_LINKER_PREFERENCE 10) - -# Save compiler ABI information. -set(CMAKE_C_SIZEOF_DATA_PTR "8") -set(CMAKE_C_COMPILER_ABI "") -set(CMAKE_C_BYTE_ORDER "LITTLE_ENDIAN") -set(CMAKE_C_LIBRARY_ARCHITECTURE "") - -if(CMAKE_C_SIZEOF_DATA_PTR) - set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}") -endif() - -if(CMAKE_C_COMPILER_ABI) - set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}") -endif() - -if(CMAKE_C_LIBRARY_ARCHITECTURE) - set(CMAKE_LIBRARY_ARCHITECTURE "") -endif() - -set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "") -if(CMAKE_C_CL_SHOWINCLUDES_PREFIX) - set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_C_CL_SHOWINCLUDES_PREFIX}") -endif() - - - - - -set(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES "/opt/homebrew/include;/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include;/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include") -set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "") -set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "/Users/ningfei/.local/lib;/opt/homebrew/lib;/Users/ningfei/Repo/dcm2niix;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/lib") -set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/System/Library/Frameworks") diff --git a/CMakeFiles/3.25.1/CMakeCXXCompiler.cmake b/CMakeFiles/3.25.1/CMakeCXXCompiler.cmake deleted file mode 100644 index ee0e7381..00000000 --- a/CMakeFiles/3.25.1/CMakeCXXCompiler.cmake +++ /dev/null @@ -1,83 +0,0 @@ -set(CMAKE_CXX_COMPILER "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++") -set(CMAKE_CXX_COMPILER_ARG1 "") -set(CMAKE_CXX_COMPILER_ID "AppleClang") -set(CMAKE_CXX_COMPILER_VERSION "14.0.0.14000029") -set(CMAKE_CXX_COMPILER_VERSION_INTERNAL "") -set(CMAKE_CXX_COMPILER_WRAPPER "") -set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "98") -set(CMAKE_CXX_EXTENSIONS_COMPUTED_DEFAULT "ON") -set(CMAKE_CXX_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters;cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates;cxx_std_17;cxx_std_20;cxx_std_23") -set(CMAKE_CXX98_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters") -set(CMAKE_CXX11_COMPILE_FEATURES "cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates") -set(CMAKE_CXX14_COMPILE_FEATURES "cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates") -set(CMAKE_CXX17_COMPILE_FEATURES "cxx_std_17") -set(CMAKE_CXX20_COMPILE_FEATURES "cxx_std_20") -set(CMAKE_CXX23_COMPILE_FEATURES "cxx_std_23") - -set(CMAKE_CXX_PLATFORM_ID "Darwin") -set(CMAKE_CXX_SIMULATE_ID "") -set(CMAKE_CXX_COMPILER_FRONTEND_VARIANT "") -set(CMAKE_CXX_SIMULATE_VERSION "") - - - - -set(CMAKE_AR "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar") -set(CMAKE_CXX_COMPILER_AR "") -set(CMAKE_RANLIB "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib") -set(CMAKE_CXX_COMPILER_RANLIB "") -set(CMAKE_LINKER "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld") -set(CMAKE_MT "") -set(CMAKE_COMPILER_IS_GNUCXX ) -set(CMAKE_CXX_COMPILER_LOADED 1) -set(CMAKE_CXX_COMPILER_WORKS TRUE) -set(CMAKE_CXX_ABI_COMPILED TRUE) - -set(CMAKE_CXX_COMPILER_ENV_VAR "CXX") - -set(CMAKE_CXX_COMPILER_ID_RUN 1) -set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;mpp;CPP;ixx;cppm) -set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC) - -foreach (lang C OBJC OBJCXX) - if (CMAKE_${lang}_COMPILER_ID_RUN) - foreach(extension IN LISTS CMAKE_${lang}_SOURCE_FILE_EXTENSIONS) - list(REMOVE_ITEM CMAKE_CXX_SOURCE_FILE_EXTENSIONS ${extension}) - endforeach() - endif() -endforeach() - -set(CMAKE_CXX_LINKER_PREFERENCE 30) -set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1) - -# Save compiler ABI information. -set(CMAKE_CXX_SIZEOF_DATA_PTR "8") -set(CMAKE_CXX_COMPILER_ABI "") -set(CMAKE_CXX_BYTE_ORDER "LITTLE_ENDIAN") -set(CMAKE_CXX_LIBRARY_ARCHITECTURE "") - -if(CMAKE_CXX_SIZEOF_DATA_PTR) - set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}") -endif() - -if(CMAKE_CXX_COMPILER_ABI) - set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}") -endif() - -if(CMAKE_CXX_LIBRARY_ARCHITECTURE) - set(CMAKE_LIBRARY_ARCHITECTURE "") -endif() - -set(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX "") -if(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX) - set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_CXX_CL_SHOWINCLUDES_PREFIX}") -endif() - - - - - -set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "/opt/homebrew/include;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/c++/v1;/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include;/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include") -set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "c++") -set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "/Users/ningfei/.local/lib;/opt/homebrew/lib;/Users/ningfei/Repo/dcm2niix;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/lib") -set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/System/Library/Frameworks") diff --git a/CMakeFiles/3.25.1/CMakeDetermineCompilerABI_C.bin b/CMakeFiles/3.25.1/CMakeDetermineCompilerABI_C.bin deleted file mode 100755 index e094821d4ebd22d30d0eadf47af5226f01f05d62..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 16712 zcmeI3&ubG=5XWCkixvCpB#It_2dy63qJ@@HY+AZ)R@-f?5yVoSO|!KNX;P96HbSKr z!60J)3lCnzi{QbFhaUClKOkNr^jJj1@4Ve5*;X$-e+Py)-+Av%=6yET`SR=MpVLYu zl1iyl@ILqe#B-HGq|^m?2Cj8>YR-CSEiFnmZi%@3r;<8jIH+~bdXS4BG56E)oCa`a` ztaYvQ#48oFS6VL{9q;d5SWlRWi5Bkvvljn(+qq-S*b%#Q&{xDMS~KCtkR=RF=@F%N z`z1=_J7BpP>M>~PMS3_7e*rDLzhT|NdKR9Ai^&;r`4)2KB-V>dDR?)0s8+2E6}|jW zpqvknfGB88^HUd zj(q=ili!v1%bvVNsjGNOqSXufxmU0H?&je1Ao}w1=8(FAMe6USmFmKJE!4t`Mgk;2 z0wh2JBtQZrKmsH{0wh2JBtQZrKmsH{0wh2JBtQZrKmsH{0wh2JBtQZrKmsH{0wh2J zBtQZrKmsH{0wh2JBtQZrKmsH{0wh2JBtQZrKmsIiG6MHAjqm%`Z@JvqIm|R_2m4l2 zRAz1AF!QQ&0%6~$j;^HDY*@`OIVZ^v9hq2iDVBU`HCH|(V>`2p<5lmeTVB_NEx)on zJQj_jV^=B1UYyO3`*rPB%5Gt~Vo&Qi$FgUfsbFN?+|Sp2SC=aVx3WBM=W_FwwwxJz z%0VTWf4*cY#aEeSmRV=ac^h{yS1u-6W~94uv)|m7Y%36vf)9s|CAMkit0j5V5?Y-x z1Jp^qxuM-{cddq|H{4ZptvY4;UAJLSqnoQPrL@-ooIVXe6`YKIXl#A25*p6ejVH_hqK?V|{7USCDUE*Lm-;c1s0swWN;i O6+PcCy3sa%OYASt+{sD+ diff --git a/CMakeFiles/3.25.1/CMakeDetermineCompilerABI_CXX.bin b/CMakeFiles/3.25.1/CMakeDetermineCompilerABI_CXX.bin deleted file mode 100755 index 7c54cfe0cd7a3abad27407e2a682ac21fe45c5df..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 16696 zcmeI3&ubG=5XWDdRx9?`K}As^2Yi*Z|Ogwj}^P4?9;q??j#un`Kq zcnBi+r+Ctv2p)R$r2l~jAxbYo5fNwJ+a+167th~;$$Q_oGqdwPo9le|@%7hHAreU; zLc2lOWh*PvOV>VvGt=1Dl?DDte zxHK)-LY*c(N}78(O}<5%dB3A|o7Usxi{xzl4Wj=E$NZ1=QBsP$hkT?~t&Ehs!iZZh zxun_7l5-zlK7JoO*_>3bAC7+dcI5nxaXL$pn>+Q=rdRLv{~|Gw9HeLZezdY(q5E+i z{{HR8@8$dQGrqI9aDuLqX!Sz<6o-a}$A+mXub}%(x5taihvM(otAW}ao(WU9s<=eX z{cKDL(M{{sP%~c`2!H?xfB*=900@8p2!H?xfB*=900@8p2!H?xfB*=900@8p2!H?x zfB*=900@8p2!H?xfB*=900@8p2!H?xfB*=900@8p2!H?xfB*=900@8p2!Mbg@F3Ip zyl4Gn(bzf2G-~^MR+Ckxc<&(dqU#oI``>nUC#`0~YKDjNeE6m_6FXdr9X_|3tMBQ= zcIFl)tKL&pUYG7xP|1&`qfvBvDuiP%%oQesx>S|2a`P2?M$S8yJ?l)Hk#(J4s0T`x zE3T^Kvvw|*wWQ_D+S3kI;`!%ux>9`QS!SMfra5oz4$YObvE~`+9?Bfh*?ijCut<^f zOf);2nXxu|Jzs6M@!y0L$MgVohuqwdYFia+)bxg0qpn5Q=9=e=i%GG+6J|vl?!Axl zqPcpSL)UsMoQvo2c7Fac)clJ61W!_%zD{Xv?#g|pXyX3x`=x%rlq=b>>pX}r+r9`T htYpW{aSOC8c#oy>U2n}d0XKDCTR_PRf|812eghY#&FugH diff --git a/CMakeFiles/3.25.1/CMakeSystem.cmake b/CMakeFiles/3.25.1/CMakeSystem.cmake deleted file mode 100644 index 05cfe7e2..00000000 --- a/CMakeFiles/3.25.1/CMakeSystem.cmake +++ /dev/null @@ -1,15 +0,0 @@ -set(CMAKE_HOST_SYSTEM "Darwin-22.2.0") -set(CMAKE_HOST_SYSTEM_NAME "Darwin") -set(CMAKE_HOST_SYSTEM_VERSION "22.2.0") -set(CMAKE_HOST_SYSTEM_PROCESSOR "arm64") - - - -set(CMAKE_SYSTEM "Darwin-22.2.0") -set(CMAKE_SYSTEM_NAME "Darwin") -set(CMAKE_SYSTEM_VERSION "22.2.0") -set(CMAKE_SYSTEM_PROCESSOR "arm64") - -set(CMAKE_CROSSCOMPILING "FALSE") - -set(CMAKE_SYSTEM_LOADED 1) diff --git a/CMakeFiles/3.25.1/CompilerIdC/CMakeCCompilerId.c b/CMakeFiles/3.25.1/CompilerIdC/CMakeCCompilerId.c deleted file mode 100644 index a83e3782..00000000 --- a/CMakeFiles/3.25.1/CompilerIdC/CMakeCCompilerId.c +++ /dev/null @@ -1,868 +0,0 @@ -#ifdef __cplusplus -# error "A C++ compiler has been selected for C." -#endif - -#if defined(__18CXX) -# define ID_VOID_MAIN -#endif -#if defined(__CLASSIC_C__) -/* cv-qualifiers did not exist in K&R C */ -# define const -# define volatile -#endif - -#if !defined(__has_include) -/* If the compiler does not have __has_include, pretend the answer is - always no. */ -# define __has_include(x) 0 -#endif - - -/* Version number components: V=Version, R=Revision, P=Patch - Version date components: YYYY=Year, MM=Month, DD=Day */ - -#if defined(__INTEL_COMPILER) || defined(__ICC) -# define COMPILER_ID "Intel" -# if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -# endif -# if defined(__GNUC__) -# define SIMULATE_ID "GNU" -# endif - /* __INTEL_COMPILER = VRP prior to 2021, and then VVVV for 2021 and later, - except that a few beta releases use the old format with V=2021. */ -# if __INTEL_COMPILER < 2021 || __INTEL_COMPILER == 202110 || __INTEL_COMPILER == 202111 -# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) -# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) -# if defined(__INTEL_COMPILER_UPDATE) -# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE) -# else -# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10) -# endif -# else -# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER) -# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER_UPDATE) - /* The third version component from --version is an update index, - but no macro is provided for it. */ -# define COMPILER_VERSION_PATCH DEC(0) -# endif -# if defined(__INTEL_COMPILER_BUILD_DATE) - /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */ -# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) -# endif -# if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -# endif -# if defined(__GNUC__) -# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) -# elif defined(__GNUG__) -# define SIMULATE_VERSION_MAJOR DEC(__GNUG__) -# endif -# if defined(__GNUC_MINOR__) -# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) -# endif -# if defined(__GNUC_PATCHLEVEL__) -# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) -# endif - -#elif (defined(__clang__) && defined(__INTEL_CLANG_COMPILER)) || defined(__INTEL_LLVM_COMPILER) -# define COMPILER_ID "IntelLLVM" -#if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -#endif -#if defined(__GNUC__) -# define SIMULATE_ID "GNU" -#endif -/* __INTEL_LLVM_COMPILER = VVVVRP prior to 2021.2.0, VVVVRRPP for 2021.2.0 and - * later. Look for 6 digit vs. 8 digit version number to decide encoding. - * VVVV is no smaller than the current year when a version is released. - */ -#if __INTEL_LLVM_COMPILER < 1000000L -# define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/100) -# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 10) -#else -# define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/10000) -# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/100 % 100) -# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 100) -#endif -#if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -#endif -#if defined(__GNUC__) -# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) -#elif defined(__GNUG__) -# define SIMULATE_VERSION_MAJOR DEC(__GNUG__) -#endif -#if defined(__GNUC_MINOR__) -# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) -#endif -#if defined(__GNUC_PATCHLEVEL__) -# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) -#endif - -#elif defined(__PATHCC__) -# define COMPILER_ID "PathScale" -# define COMPILER_VERSION_MAJOR DEC(__PATHCC__) -# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__) -# if defined(__PATHCC_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__) -# endif - -#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__) -# define COMPILER_ID "Embarcadero" -# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF) -# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) -# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF) - -#elif defined(__BORLANDC__) -# define COMPILER_ID "Borland" - /* __BORLANDC__ = 0xVRR */ -# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) -# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) - -#elif defined(__WATCOMC__) && __WATCOMC__ < 1200 -# define COMPILER_ID "Watcom" - /* __WATCOMC__ = VVRR */ -# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) -# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) -# if (__WATCOMC__ % 10) > 0 -# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) -# endif - -#elif defined(__WATCOMC__) -# define COMPILER_ID "OpenWatcom" - /* __WATCOMC__ = VVRP + 1100 */ -# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) -# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) -# if (__WATCOMC__ % 10) > 0 -# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) -# endif - -#elif defined(__SUNPRO_C) -# define COMPILER_ID "SunPro" -# if __SUNPRO_C >= 0x5100 - /* __SUNPRO_C = 0xVRRP */ -# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>12) -# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xFF) -# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) -# else - /* __SUNPRO_CC = 0xVRP */ -# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>8) -# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xF) -# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) -# endif - -#elif defined(__HP_cc) -# define COMPILER_ID "HP" - /* __HP_cc = VVRRPP */ -# define COMPILER_VERSION_MAJOR DEC(__HP_cc/10000) -# define COMPILER_VERSION_MINOR DEC(__HP_cc/100 % 100) -# define COMPILER_VERSION_PATCH DEC(__HP_cc % 100) - -#elif defined(__DECC) -# define COMPILER_ID "Compaq" - /* __DECC_VER = VVRRTPPPP */ -# define COMPILER_VERSION_MAJOR DEC(__DECC_VER/10000000) -# define COMPILER_VERSION_MINOR DEC(__DECC_VER/100000 % 100) -# define COMPILER_VERSION_PATCH DEC(__DECC_VER % 10000) - -#elif defined(__IBMC__) && defined(__COMPILER_VER__) -# define COMPILER_ID "zOS" - /* __IBMC__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) - -#elif defined(__open_xl__) && defined(__clang__) -# define COMPILER_ID "IBMClang" -# define COMPILER_VERSION_MAJOR DEC(__open_xl_version__) -# define COMPILER_VERSION_MINOR DEC(__open_xl_release__) -# define COMPILER_VERSION_PATCH DEC(__open_xl_modification__) -# define COMPILER_VERSION_TWEAK DEC(__open_xl_ptf_fix_level__) - - -#elif defined(__ibmxl__) && defined(__clang__) -# define COMPILER_ID "XLClang" -# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__) -# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__) -# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__) -# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__) - - -#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ >= 800 -# define COMPILER_ID "XL" - /* __IBMC__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) - -#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ < 800 -# define COMPILER_ID "VisualAge" - /* __IBMC__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) - -#elif defined(__NVCOMPILER) -# define COMPILER_ID "NVHPC" -# define COMPILER_VERSION_MAJOR DEC(__NVCOMPILER_MAJOR__) -# define COMPILER_VERSION_MINOR DEC(__NVCOMPILER_MINOR__) -# if defined(__NVCOMPILER_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__NVCOMPILER_PATCHLEVEL__) -# endif - -#elif defined(__PGI) -# define COMPILER_ID "PGI" -# define COMPILER_VERSION_MAJOR DEC(__PGIC__) -# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) -# if defined(__PGIC_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) -# endif - -#elif defined(_CRAYC) -# define COMPILER_ID "Cray" -# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) -# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) - -#elif defined(__TI_COMPILER_VERSION__) -# define COMPILER_ID "TI" - /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ -# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) -# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) -# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) - -#elif defined(__CLANG_FUJITSU) -# define COMPILER_ID "FujitsuClang" -# define COMPILER_VERSION_MAJOR DEC(__FCC_major__) -# define COMPILER_VERSION_MINOR DEC(__FCC_minor__) -# define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__) -# define COMPILER_VERSION_INTERNAL_STR __clang_version__ - - -#elif defined(__FUJITSU) -# define COMPILER_ID "Fujitsu" -# if defined(__FCC_version__) -# define COMPILER_VERSION __FCC_version__ -# elif defined(__FCC_major__) -# define COMPILER_VERSION_MAJOR DEC(__FCC_major__) -# define COMPILER_VERSION_MINOR DEC(__FCC_minor__) -# define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__) -# endif -# if defined(__fcc_version) -# define COMPILER_VERSION_INTERNAL DEC(__fcc_version) -# elif defined(__FCC_VERSION) -# define COMPILER_VERSION_INTERNAL DEC(__FCC_VERSION) -# endif - - -#elif defined(__ghs__) -# define COMPILER_ID "GHS" -/* __GHS_VERSION_NUMBER = VVVVRP */ -# ifdef __GHS_VERSION_NUMBER -# define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100) -# define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10) -# define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10) -# endif - -#elif defined(__TASKING__) -# define COMPILER_ID "Tasking" - # define COMPILER_VERSION_MAJOR DEC(__VERSION__/1000) - # define COMPILER_VERSION_MINOR DEC(__VERSION__ % 100) -# define COMPILER_VERSION_INTERNAL DEC(__VERSION__) - -#elif defined(__TINYC__) -# define COMPILER_ID "TinyCC" - -#elif defined(__BCC__) -# define COMPILER_ID "Bruce" - -#elif defined(__SCO_VERSION__) -# define COMPILER_ID "SCO" - -#elif defined(__ARMCC_VERSION) && !defined(__clang__) -# define COMPILER_ID "ARMCC" -#if __ARMCC_VERSION >= 1000000 - /* __ARMCC_VERSION = VRRPPPP */ - # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000) - # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100) - # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) -#else - /* __ARMCC_VERSION = VRPPPP */ - # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000) - # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10) - # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) -#endif - - -#elif defined(__clang__) && defined(__apple_build_version__) -# define COMPILER_ID "AppleClang" -# if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -# endif -# define COMPILER_VERSION_MAJOR DEC(__clang_major__) -# define COMPILER_VERSION_MINOR DEC(__clang_minor__) -# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) -# if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -# endif -# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__) - -#elif defined(__clang__) && defined(__ARMCOMPILER_VERSION) -# define COMPILER_ID "ARMClang" - # define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000) - # define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100) - # define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION % 10000) -# define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION) - -#elif defined(__clang__) -# define COMPILER_ID "Clang" -# if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -# endif -# define COMPILER_VERSION_MAJOR DEC(__clang_major__) -# define COMPILER_VERSION_MINOR DEC(__clang_minor__) -# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) -# if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -# endif - -#elif defined(__LCC__) && (defined(__GNUC__) || defined(__GNUG__) || defined(__MCST__)) -# define COMPILER_ID "LCC" -# define COMPILER_VERSION_MAJOR DEC(1) -# if defined(__LCC__) -# define COMPILER_VERSION_MINOR DEC(__LCC__- 100) -# endif -# if defined(__LCC_MINOR__) -# define COMPILER_VERSION_PATCH DEC(__LCC_MINOR__) -# endif -# if defined(__GNUC__) && defined(__GNUC_MINOR__) -# define SIMULATE_ID "GNU" -# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) -# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) -# if defined(__GNUC_PATCHLEVEL__) -# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) -# endif -# endif - -#elif defined(__GNUC__) -# define COMPILER_ID "GNU" -# define COMPILER_VERSION_MAJOR DEC(__GNUC__) -# if defined(__GNUC_MINOR__) -# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) -# endif -# if defined(__GNUC_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) -# endif - -#elif defined(_MSC_VER) -# define COMPILER_ID "MSVC" - /* _MSC_VER = VVRR */ -# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) -# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) -# if defined(_MSC_FULL_VER) -# if _MSC_VER >= 1400 - /* _MSC_FULL_VER = VVRRPPPPP */ -# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) -# else - /* _MSC_FULL_VER = VVRRPPPP */ -# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) -# endif -# endif -# if defined(_MSC_BUILD) -# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) -# endif - -#elif defined(_ADI_COMPILER) -# define COMPILER_ID "ADSP" -#if defined(__VERSIONNUM__) - /* __VERSIONNUM__ = 0xVVRRPPTT */ -# define COMPILER_VERSION_MAJOR DEC(__VERSIONNUM__ >> 24 & 0xFF) -# define COMPILER_VERSION_MINOR DEC(__VERSIONNUM__ >> 16 & 0xFF) -# define COMPILER_VERSION_PATCH DEC(__VERSIONNUM__ >> 8 & 0xFF) -# define COMPILER_VERSION_TWEAK DEC(__VERSIONNUM__ & 0xFF) -#endif - -#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) -# define COMPILER_ID "IAR" -# if defined(__VER__) && defined(__ICCARM__) -# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000) -# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000) -# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000) -# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) -# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__) || defined(__ICCSTM8__)) -# define COMPILER_VERSION_MAJOR DEC((__VER__) / 100) -# define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100)) -# define COMPILER_VERSION_PATCH DEC(__SUBVERSION__) -# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) -# endif - -#elif defined(__SDCC_VERSION_MAJOR) || defined(SDCC) -# define COMPILER_ID "SDCC" -# if defined(__SDCC_VERSION_MAJOR) -# define COMPILER_VERSION_MAJOR DEC(__SDCC_VERSION_MAJOR) -# define COMPILER_VERSION_MINOR DEC(__SDCC_VERSION_MINOR) -# define COMPILER_VERSION_PATCH DEC(__SDCC_VERSION_PATCH) -# else - /* SDCC = VRP */ -# define COMPILER_VERSION_MAJOR DEC(SDCC/100) -# define COMPILER_VERSION_MINOR DEC(SDCC/10 % 10) -# define COMPILER_VERSION_PATCH DEC(SDCC % 10) -# endif - - -/* These compilers are either not known or too old to define an - identification macro. Try to identify the platform and guess that - it is the native compiler. */ -#elif defined(__hpux) || defined(__hpua) -# define COMPILER_ID "HP" - -#else /* unknown compiler */ -# define COMPILER_ID "" -#endif - -/* Construct the string literal in pieces to prevent the source from - getting matched. Store it in a pointer rather than an array - because some compilers will just produce instructions to fill the - array rather than assigning a pointer to a static array. */ -char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; -#ifdef SIMULATE_ID -char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; -#endif - -#ifdef __QNXNTO__ -char const* qnxnto = "INFO" ":" "qnxnto[]"; -#endif - -#if defined(__CRAYXT_COMPUTE_LINUX_TARGET) -char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; -#endif - -#define STRINGIFY_HELPER(X) #X -#define STRINGIFY(X) STRINGIFY_HELPER(X) - -/* Identify known platforms by name. */ -#if defined(__linux) || defined(__linux__) || defined(linux) -# define PLATFORM_ID "Linux" - -#elif defined(__MSYS__) -# define PLATFORM_ID "MSYS" - -#elif defined(__CYGWIN__) -# define PLATFORM_ID "Cygwin" - -#elif defined(__MINGW32__) -# define PLATFORM_ID "MinGW" - -#elif defined(__APPLE__) -# define PLATFORM_ID "Darwin" - -#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) -# define PLATFORM_ID "Windows" - -#elif defined(__FreeBSD__) || defined(__FreeBSD) -# define PLATFORM_ID "FreeBSD" - -#elif defined(__NetBSD__) || defined(__NetBSD) -# define PLATFORM_ID "NetBSD" - -#elif defined(__OpenBSD__) || defined(__OPENBSD) -# define PLATFORM_ID "OpenBSD" - -#elif defined(__sun) || defined(sun) -# define PLATFORM_ID "SunOS" - -#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) -# define PLATFORM_ID "AIX" - -#elif defined(__hpux) || defined(__hpux__) -# define PLATFORM_ID "HP-UX" - -#elif defined(__HAIKU__) -# define PLATFORM_ID "Haiku" - -#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) -# define PLATFORM_ID "BeOS" - -#elif defined(__QNX__) || defined(__QNXNTO__) -# define PLATFORM_ID "QNX" - -#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) -# define PLATFORM_ID "Tru64" - -#elif defined(__riscos) || defined(__riscos__) -# define PLATFORM_ID "RISCos" - -#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) -# define PLATFORM_ID "SINIX" - -#elif defined(__UNIX_SV__) -# define PLATFORM_ID "UNIX_SV" - -#elif defined(__bsdos__) -# define PLATFORM_ID "BSDOS" - -#elif defined(_MPRAS) || defined(MPRAS) -# define PLATFORM_ID "MP-RAS" - -#elif defined(__osf) || defined(__osf__) -# define PLATFORM_ID "OSF1" - -#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) -# define PLATFORM_ID "SCO_SV" - -#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) -# define PLATFORM_ID "ULTRIX" - -#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) -# define PLATFORM_ID "Xenix" - -#elif defined(__WATCOMC__) -# if defined(__LINUX__) -# define PLATFORM_ID "Linux" - -# elif defined(__DOS__) -# define PLATFORM_ID "DOS" - -# elif defined(__OS2__) -# define PLATFORM_ID "OS2" - -# elif defined(__WINDOWS__) -# define PLATFORM_ID "Windows3x" - -# elif defined(__VXWORKS__) -# define PLATFORM_ID "VxWorks" - -# else /* unknown platform */ -# define PLATFORM_ID -# endif - -#elif defined(__INTEGRITY) -# if defined(INT_178B) -# define PLATFORM_ID "Integrity178" - -# else /* regular Integrity */ -# define PLATFORM_ID "Integrity" -# endif - -# elif defined(_ADI_COMPILER) -# define PLATFORM_ID "ADSP" - -#else /* unknown platform */ -# define PLATFORM_ID - -#endif - -/* For windows compilers MSVC and Intel we can determine - the architecture of the compiler being used. This is because - the compilers do not have flags that can change the architecture, - but rather depend on which compiler is being used -*/ -#if defined(_WIN32) && defined(_MSC_VER) -# if defined(_M_IA64) -# define ARCHITECTURE_ID "IA64" - -# elif defined(_M_ARM64EC) -# define ARCHITECTURE_ID "ARM64EC" - -# elif defined(_M_X64) || defined(_M_AMD64) -# define ARCHITECTURE_ID "x64" - -# elif defined(_M_IX86) -# define ARCHITECTURE_ID "X86" - -# elif defined(_M_ARM64) -# define ARCHITECTURE_ID "ARM64" - -# elif defined(_M_ARM) -# if _M_ARM == 4 -# define ARCHITECTURE_ID "ARMV4I" -# elif _M_ARM == 5 -# define ARCHITECTURE_ID "ARMV5I" -# else -# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM) -# endif - -# elif defined(_M_MIPS) -# define ARCHITECTURE_ID "MIPS" - -# elif defined(_M_SH) -# define ARCHITECTURE_ID "SHx" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__WATCOMC__) -# if defined(_M_I86) -# define ARCHITECTURE_ID "I86" - -# elif defined(_M_IX86) -# define ARCHITECTURE_ID "X86" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) -# if defined(__ICCARM__) -# define ARCHITECTURE_ID "ARM" - -# elif defined(__ICCRX__) -# define ARCHITECTURE_ID "RX" - -# elif defined(__ICCRH850__) -# define ARCHITECTURE_ID "RH850" - -# elif defined(__ICCRL78__) -# define ARCHITECTURE_ID "RL78" - -# elif defined(__ICCRISCV__) -# define ARCHITECTURE_ID "RISCV" - -# elif defined(__ICCAVR__) -# define ARCHITECTURE_ID "AVR" - -# elif defined(__ICC430__) -# define ARCHITECTURE_ID "MSP430" - -# elif defined(__ICCV850__) -# define ARCHITECTURE_ID "V850" - -# elif defined(__ICC8051__) -# define ARCHITECTURE_ID "8051" - -# elif defined(__ICCSTM8__) -# define ARCHITECTURE_ID "STM8" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__ghs__) -# if defined(__PPC64__) -# define ARCHITECTURE_ID "PPC64" - -# elif defined(__ppc__) -# define ARCHITECTURE_ID "PPC" - -# elif defined(__ARM__) -# define ARCHITECTURE_ID "ARM" - -# elif defined(__x86_64__) -# define ARCHITECTURE_ID "x64" - -# elif defined(__i386__) -# define ARCHITECTURE_ID "X86" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__TI_COMPILER_VERSION__) -# if defined(__TI_ARM__) -# define ARCHITECTURE_ID "ARM" - -# elif defined(__MSP430__) -# define ARCHITECTURE_ID "MSP430" - -# elif defined(__TMS320C28XX__) -# define ARCHITECTURE_ID "TMS320C28x" - -# elif defined(__TMS320C6X__) || defined(_TMS320C6X) -# define ARCHITECTURE_ID "TMS320C6x" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -# elif defined(__ADSPSHARC__) -# define ARCHITECTURE_ID "SHARC" - -# elif defined(__ADSPBLACKFIN__) -# define ARCHITECTURE_ID "Blackfin" - -#elif defined(__TASKING__) - -# if defined(__CTC__) || defined(__CPTC__) -# define ARCHITECTURE_ID "TriCore" - -# elif defined(__CMCS__) -# define ARCHITECTURE_ID "MCS" - -# elif defined(__CARM__) -# define ARCHITECTURE_ID "ARM" - -# elif defined(__CARC__) -# define ARCHITECTURE_ID "ARC" - -# elif defined(__C51__) -# define ARCHITECTURE_ID "8051" - -# elif defined(__CPCP__) -# define ARCHITECTURE_ID "PCP" - -# else -# define ARCHITECTURE_ID "" -# endif - -#else -# define ARCHITECTURE_ID -#endif - -/* Convert integer to decimal digit literals. */ -#define DEC(n) \ - ('0' + (((n) / 10000000)%10)), \ - ('0' + (((n) / 1000000)%10)), \ - ('0' + (((n) / 100000)%10)), \ - ('0' + (((n) / 10000)%10)), \ - ('0' + (((n) / 1000)%10)), \ - ('0' + (((n) / 100)%10)), \ - ('0' + (((n) / 10)%10)), \ - ('0' + ((n) % 10)) - -/* Convert integer to hex digit literals. */ -#define HEX(n) \ - ('0' + ((n)>>28 & 0xF)), \ - ('0' + ((n)>>24 & 0xF)), \ - ('0' + ((n)>>20 & 0xF)), \ - ('0' + ((n)>>16 & 0xF)), \ - ('0' + ((n)>>12 & 0xF)), \ - ('0' + ((n)>>8 & 0xF)), \ - ('0' + ((n)>>4 & 0xF)), \ - ('0' + ((n) & 0xF)) - -/* Construct a string literal encoding the version number. */ -#ifdef COMPILER_VERSION -char const* info_version = "INFO" ":" "compiler_version[" COMPILER_VERSION "]"; - -/* Construct a string literal encoding the version number components. */ -#elif defined(COMPILER_VERSION_MAJOR) -char const info_version[] = { - 'I', 'N', 'F', 'O', ':', - 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', - COMPILER_VERSION_MAJOR, -# ifdef COMPILER_VERSION_MINOR - '.', COMPILER_VERSION_MINOR, -# ifdef COMPILER_VERSION_PATCH - '.', COMPILER_VERSION_PATCH, -# ifdef COMPILER_VERSION_TWEAK - '.', COMPILER_VERSION_TWEAK, -# endif -# endif -# endif - ']','\0'}; -#endif - -/* Construct a string literal encoding the internal version number. */ -#ifdef COMPILER_VERSION_INTERNAL -char const info_version_internal[] = { - 'I', 'N', 'F', 'O', ':', - 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_', - 'i','n','t','e','r','n','a','l','[', - COMPILER_VERSION_INTERNAL,']','\0'}; -#elif defined(COMPILER_VERSION_INTERNAL_STR) -char const* info_version_internal = "INFO" ":" "compiler_version_internal[" COMPILER_VERSION_INTERNAL_STR "]"; -#endif - -/* Construct a string literal encoding the version number components. */ -#ifdef SIMULATE_VERSION_MAJOR -char const info_simulate_version[] = { - 'I', 'N', 'F', 'O', ':', - 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[', - SIMULATE_VERSION_MAJOR, -# ifdef SIMULATE_VERSION_MINOR - '.', SIMULATE_VERSION_MINOR, -# ifdef SIMULATE_VERSION_PATCH - '.', SIMULATE_VERSION_PATCH, -# ifdef SIMULATE_VERSION_TWEAK - '.', SIMULATE_VERSION_TWEAK, -# endif -# endif -# endif - ']','\0'}; -#endif - -/* Construct the string literal in pieces to prevent the source from - getting matched. Store it in a pointer rather than an array - because some compilers will just produce instructions to fill the - array rather than assigning a pointer to a static array. */ -char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; -char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; - - - -#if !defined(__STDC__) && !defined(__clang__) -# if defined(_MSC_VER) || defined(__ibmxl__) || defined(__IBMC__) -# define C_VERSION "90" -# else -# define C_VERSION -# endif -#elif __STDC_VERSION__ > 201710L -# define C_VERSION "23" -#elif __STDC_VERSION__ >= 201710L -# define C_VERSION "17" -#elif __STDC_VERSION__ >= 201000L -# define C_VERSION "11" -#elif __STDC_VERSION__ >= 199901L -# define C_VERSION "99" -#else -# define C_VERSION "90" -#endif -const char* info_language_standard_default = - "INFO" ":" "standard_default[" C_VERSION "]"; - -const char* info_language_extensions_default = "INFO" ":" "extensions_default[" -#if (defined(__clang__) || defined(__GNUC__) || defined(__xlC__) || \ - defined(__TI_COMPILER_VERSION__)) && \ - !defined(__STRICT_ANSI__) - "ON" -#else - "OFF" -#endif -"]"; - -/*--------------------------------------------------------------------------*/ - -#ifdef ID_VOID_MAIN -void main() {} -#else -# if defined(__CLASSIC_C__) -int main(argc, argv) int argc; char *argv[]; -# else -int main(int argc, char* argv[]) -# endif -{ - int require = 0; - require += info_compiler[argc]; - require += info_platform[argc]; - require += info_arch[argc]; -#ifdef COMPILER_VERSION_MAJOR - require += info_version[argc]; -#endif -#ifdef COMPILER_VERSION_INTERNAL - require += info_version_internal[argc]; -#endif -#ifdef SIMULATE_ID - require += info_simulate[argc]; -#endif -#ifdef SIMULATE_VERSION_MAJOR - require += info_simulate_version[argc]; -#endif -#if defined(__CRAYXT_COMPUTE_LINUX_TARGET) - require += info_cray[argc]; -#endif - require += info_language_standard_default[argc]; - require += info_language_extensions_default[argc]; - (void)argv; - return require; -} -#endif diff --git a/CMakeFiles/3.25.1/CompilerIdC/CMakeCCompilerId.o b/CMakeFiles/3.25.1/CompilerIdC/CMakeCCompilerId.o deleted file mode 100644 index cebe8296f1eeef08d7fea5bfeebd7fa286fbae0d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1712 zcmb_cJ%|%Q6rOnJnKPOwSSSY?u(1kBF5n-5go~mQ?yg7?3CFl3o7}=?vurkcg~fq_ zHiFk!SzMtY*jgAX!6uz&BbL$XuCVtkjNjXNlfSF{c`*CE@4cC~Z+5=fk3YZvIwnL& z!00iHQ9gu690PU+<4ceY=z&L%a~re|ZY3 zzmmGh8Qd4sXezXB#*#;129Jq{r~^~ diff --git a/CMakeFiles/3.25.1/CompilerIdCXX/CMakeCXXCompilerId.cpp b/CMakeFiles/3.25.1/CompilerIdCXX/CMakeCXXCompilerId.cpp deleted file mode 100644 index c9ba632f..00000000 --- a/CMakeFiles/3.25.1/CompilerIdCXX/CMakeCXXCompilerId.cpp +++ /dev/null @@ -1,857 +0,0 @@ -/* This source file must have a .cpp extension so that all C++ compilers - recognize the extension without flags. Borland does not know .cxx for - example. */ -#ifndef __cplusplus -# error "A C compiler has been selected for C++." -#endif - -#if !defined(__has_include) -/* If the compiler does not have __has_include, pretend the answer is - always no. */ -# define __has_include(x) 0 -#endif - - -/* Version number components: V=Version, R=Revision, P=Patch - Version date components: YYYY=Year, MM=Month, DD=Day */ - -#if defined(__COMO__) -# define COMPILER_ID "Comeau" - /* __COMO_VERSION__ = VRR */ -# define COMPILER_VERSION_MAJOR DEC(__COMO_VERSION__ / 100) -# define COMPILER_VERSION_MINOR DEC(__COMO_VERSION__ % 100) - -#elif defined(__INTEL_COMPILER) || defined(__ICC) -# define COMPILER_ID "Intel" -# if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -# endif -# if defined(__GNUC__) -# define SIMULATE_ID "GNU" -# endif - /* __INTEL_COMPILER = VRP prior to 2021, and then VVVV for 2021 and later, - except that a few beta releases use the old format with V=2021. */ -# if __INTEL_COMPILER < 2021 || __INTEL_COMPILER == 202110 || __INTEL_COMPILER == 202111 -# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) -# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) -# if defined(__INTEL_COMPILER_UPDATE) -# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE) -# else -# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10) -# endif -# else -# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER) -# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER_UPDATE) - /* The third version component from --version is an update index, - but no macro is provided for it. */ -# define COMPILER_VERSION_PATCH DEC(0) -# endif -# if defined(__INTEL_COMPILER_BUILD_DATE) - /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */ -# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) -# endif -# if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -# endif -# if defined(__GNUC__) -# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) -# elif defined(__GNUG__) -# define SIMULATE_VERSION_MAJOR DEC(__GNUG__) -# endif -# if defined(__GNUC_MINOR__) -# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) -# endif -# if defined(__GNUC_PATCHLEVEL__) -# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) -# endif - -#elif (defined(__clang__) && defined(__INTEL_CLANG_COMPILER)) || defined(__INTEL_LLVM_COMPILER) -# define COMPILER_ID "IntelLLVM" -#if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -#endif -#if defined(__GNUC__) -# define SIMULATE_ID "GNU" -#endif -/* __INTEL_LLVM_COMPILER = VVVVRP prior to 2021.2.0, VVVVRRPP for 2021.2.0 and - * later. Look for 6 digit vs. 8 digit version number to decide encoding. - * VVVV is no smaller than the current year when a version is released. - */ -#if __INTEL_LLVM_COMPILER < 1000000L -# define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/100) -# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 10) -#else -# define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/10000) -# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/100 % 100) -# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 100) -#endif -#if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -#endif -#if defined(__GNUC__) -# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) -#elif defined(__GNUG__) -# define SIMULATE_VERSION_MAJOR DEC(__GNUG__) -#endif -#if defined(__GNUC_MINOR__) -# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) -#endif -#if defined(__GNUC_PATCHLEVEL__) -# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) -#endif - -#elif defined(__PATHCC__) -# define COMPILER_ID "PathScale" -# define COMPILER_VERSION_MAJOR DEC(__PATHCC__) -# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__) -# if defined(__PATHCC_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__) -# endif - -#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__) -# define COMPILER_ID "Embarcadero" -# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF) -# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) -# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF) - -#elif defined(__BORLANDC__) -# define COMPILER_ID "Borland" - /* __BORLANDC__ = 0xVRR */ -# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) -# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) - -#elif defined(__WATCOMC__) && __WATCOMC__ < 1200 -# define COMPILER_ID "Watcom" - /* __WATCOMC__ = VVRR */ -# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) -# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) -# if (__WATCOMC__ % 10) > 0 -# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) -# endif - -#elif defined(__WATCOMC__) -# define COMPILER_ID "OpenWatcom" - /* __WATCOMC__ = VVRP + 1100 */ -# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) -# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) -# if (__WATCOMC__ % 10) > 0 -# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) -# endif - -#elif defined(__SUNPRO_CC) -# define COMPILER_ID "SunPro" -# if __SUNPRO_CC >= 0x5100 - /* __SUNPRO_CC = 0xVRRP */ -# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>12) -# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xFF) -# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) -# else - /* __SUNPRO_CC = 0xVRP */ -# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>8) -# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xF) -# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) -# endif - -#elif defined(__HP_aCC) -# define COMPILER_ID "HP" - /* __HP_aCC = VVRRPP */ -# define COMPILER_VERSION_MAJOR DEC(__HP_aCC/10000) -# define COMPILER_VERSION_MINOR DEC(__HP_aCC/100 % 100) -# define COMPILER_VERSION_PATCH DEC(__HP_aCC % 100) - -#elif defined(__DECCXX) -# define COMPILER_ID "Compaq" - /* __DECCXX_VER = VVRRTPPPP */ -# define COMPILER_VERSION_MAJOR DEC(__DECCXX_VER/10000000) -# define COMPILER_VERSION_MINOR DEC(__DECCXX_VER/100000 % 100) -# define COMPILER_VERSION_PATCH DEC(__DECCXX_VER % 10000) - -#elif defined(__IBMCPP__) && defined(__COMPILER_VER__) -# define COMPILER_ID "zOS" - /* __IBMCPP__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) - -#elif defined(__open_xl__) && defined(__clang__) -# define COMPILER_ID "IBMClang" -# define COMPILER_VERSION_MAJOR DEC(__open_xl_version__) -# define COMPILER_VERSION_MINOR DEC(__open_xl_release__) -# define COMPILER_VERSION_PATCH DEC(__open_xl_modification__) -# define COMPILER_VERSION_TWEAK DEC(__open_xl_ptf_fix_level__) - - -#elif defined(__ibmxl__) && defined(__clang__) -# define COMPILER_ID "XLClang" -# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__) -# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__) -# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__) -# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__) - - -#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ >= 800 -# define COMPILER_ID "XL" - /* __IBMCPP__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) - -#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ < 800 -# define COMPILER_ID "VisualAge" - /* __IBMCPP__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) - -#elif defined(__NVCOMPILER) -# define COMPILER_ID "NVHPC" -# define COMPILER_VERSION_MAJOR DEC(__NVCOMPILER_MAJOR__) -# define COMPILER_VERSION_MINOR DEC(__NVCOMPILER_MINOR__) -# if defined(__NVCOMPILER_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__NVCOMPILER_PATCHLEVEL__) -# endif - -#elif defined(__PGI) -# define COMPILER_ID "PGI" -# define COMPILER_VERSION_MAJOR DEC(__PGIC__) -# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) -# if defined(__PGIC_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) -# endif - -#elif defined(_CRAYC) -# define COMPILER_ID "Cray" -# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) -# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) - -#elif defined(__TI_COMPILER_VERSION__) -# define COMPILER_ID "TI" - /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ -# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) -# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) -# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) - -#elif defined(__CLANG_FUJITSU) -# define COMPILER_ID "FujitsuClang" -# define COMPILER_VERSION_MAJOR DEC(__FCC_major__) -# define COMPILER_VERSION_MINOR DEC(__FCC_minor__) -# define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__) -# define COMPILER_VERSION_INTERNAL_STR __clang_version__ - - -#elif defined(__FUJITSU) -# define COMPILER_ID "Fujitsu" -# if defined(__FCC_version__) -# define COMPILER_VERSION __FCC_version__ -# elif defined(__FCC_major__) -# define COMPILER_VERSION_MAJOR DEC(__FCC_major__) -# define COMPILER_VERSION_MINOR DEC(__FCC_minor__) -# define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__) -# endif -# if defined(__fcc_version) -# define COMPILER_VERSION_INTERNAL DEC(__fcc_version) -# elif defined(__FCC_VERSION) -# define COMPILER_VERSION_INTERNAL DEC(__FCC_VERSION) -# endif - - -#elif defined(__ghs__) -# define COMPILER_ID "GHS" -/* __GHS_VERSION_NUMBER = VVVVRP */ -# ifdef __GHS_VERSION_NUMBER -# define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100) -# define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10) -# define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10) -# endif - -#elif defined(__TASKING__) -# define COMPILER_ID "Tasking" - # define COMPILER_VERSION_MAJOR DEC(__VERSION__/1000) - # define COMPILER_VERSION_MINOR DEC(__VERSION__ % 100) -# define COMPILER_VERSION_INTERNAL DEC(__VERSION__) - -#elif defined(__SCO_VERSION__) -# define COMPILER_ID "SCO" - -#elif defined(__ARMCC_VERSION) && !defined(__clang__) -# define COMPILER_ID "ARMCC" -#if __ARMCC_VERSION >= 1000000 - /* __ARMCC_VERSION = VRRPPPP */ - # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000) - # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100) - # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) -#else - /* __ARMCC_VERSION = VRPPPP */ - # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000) - # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10) - # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) -#endif - - -#elif defined(__clang__) && defined(__apple_build_version__) -# define COMPILER_ID "AppleClang" -# if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -# endif -# define COMPILER_VERSION_MAJOR DEC(__clang_major__) -# define COMPILER_VERSION_MINOR DEC(__clang_minor__) -# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) -# if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -# endif -# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__) - -#elif defined(__clang__) && defined(__ARMCOMPILER_VERSION) -# define COMPILER_ID "ARMClang" - # define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000) - # define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100) - # define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION % 10000) -# define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION) - -#elif defined(__clang__) -# define COMPILER_ID "Clang" -# if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -# endif -# define COMPILER_VERSION_MAJOR DEC(__clang_major__) -# define COMPILER_VERSION_MINOR DEC(__clang_minor__) -# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) -# if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -# endif - -#elif defined(__LCC__) && (defined(__GNUC__) || defined(__GNUG__) || defined(__MCST__)) -# define COMPILER_ID "LCC" -# define COMPILER_VERSION_MAJOR DEC(1) -# if defined(__LCC__) -# define COMPILER_VERSION_MINOR DEC(__LCC__- 100) -# endif -# if defined(__LCC_MINOR__) -# define COMPILER_VERSION_PATCH DEC(__LCC_MINOR__) -# endif -# if defined(__GNUC__) && defined(__GNUC_MINOR__) -# define SIMULATE_ID "GNU" -# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) -# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) -# if defined(__GNUC_PATCHLEVEL__) -# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) -# endif -# endif - -#elif defined(__GNUC__) || defined(__GNUG__) -# define COMPILER_ID "GNU" -# if defined(__GNUC__) -# define COMPILER_VERSION_MAJOR DEC(__GNUC__) -# else -# define COMPILER_VERSION_MAJOR DEC(__GNUG__) -# endif -# if defined(__GNUC_MINOR__) -# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) -# endif -# if defined(__GNUC_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) -# endif - -#elif defined(_MSC_VER) -# define COMPILER_ID "MSVC" - /* _MSC_VER = VVRR */ -# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) -# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) -# if defined(_MSC_FULL_VER) -# if _MSC_VER >= 1400 - /* _MSC_FULL_VER = VVRRPPPPP */ -# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) -# else - /* _MSC_FULL_VER = VVRRPPPP */ -# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) -# endif -# endif -# if defined(_MSC_BUILD) -# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) -# endif - -#elif defined(_ADI_COMPILER) -# define COMPILER_ID "ADSP" -#if defined(__VERSIONNUM__) - /* __VERSIONNUM__ = 0xVVRRPPTT */ -# define COMPILER_VERSION_MAJOR DEC(__VERSIONNUM__ >> 24 & 0xFF) -# define COMPILER_VERSION_MINOR DEC(__VERSIONNUM__ >> 16 & 0xFF) -# define COMPILER_VERSION_PATCH DEC(__VERSIONNUM__ >> 8 & 0xFF) -# define COMPILER_VERSION_TWEAK DEC(__VERSIONNUM__ & 0xFF) -#endif - -#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) -# define COMPILER_ID "IAR" -# if defined(__VER__) && defined(__ICCARM__) -# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000) -# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000) -# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000) -# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) -# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__) || defined(__ICCSTM8__)) -# define COMPILER_VERSION_MAJOR DEC((__VER__) / 100) -# define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100)) -# define COMPILER_VERSION_PATCH DEC(__SUBVERSION__) -# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) -# endif - - -/* These compilers are either not known or too old to define an - identification macro. Try to identify the platform and guess that - it is the native compiler. */ -#elif defined(__hpux) || defined(__hpua) -# define COMPILER_ID "HP" - -#else /* unknown compiler */ -# define COMPILER_ID "" -#endif - -/* Construct the string literal in pieces to prevent the source from - getting matched. Store it in a pointer rather than an array - because some compilers will just produce instructions to fill the - array rather than assigning a pointer to a static array. */ -char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; -#ifdef SIMULATE_ID -char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; -#endif - -#ifdef __QNXNTO__ -char const* qnxnto = "INFO" ":" "qnxnto[]"; -#endif - -#if defined(__CRAYXT_COMPUTE_LINUX_TARGET) -char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; -#endif - -#define STRINGIFY_HELPER(X) #X -#define STRINGIFY(X) STRINGIFY_HELPER(X) - -/* Identify known platforms by name. */ -#if defined(__linux) || defined(__linux__) || defined(linux) -# define PLATFORM_ID "Linux" - -#elif defined(__MSYS__) -# define PLATFORM_ID "MSYS" - -#elif defined(__CYGWIN__) -# define PLATFORM_ID "Cygwin" - -#elif defined(__MINGW32__) -# define PLATFORM_ID "MinGW" - -#elif defined(__APPLE__) -# define PLATFORM_ID "Darwin" - -#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) -# define PLATFORM_ID "Windows" - -#elif defined(__FreeBSD__) || defined(__FreeBSD) -# define PLATFORM_ID "FreeBSD" - -#elif defined(__NetBSD__) || defined(__NetBSD) -# define PLATFORM_ID "NetBSD" - -#elif defined(__OpenBSD__) || defined(__OPENBSD) -# define PLATFORM_ID "OpenBSD" - -#elif defined(__sun) || defined(sun) -# define PLATFORM_ID "SunOS" - -#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) -# define PLATFORM_ID "AIX" - -#elif defined(__hpux) || defined(__hpux__) -# define PLATFORM_ID "HP-UX" - -#elif defined(__HAIKU__) -# define PLATFORM_ID "Haiku" - -#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) -# define PLATFORM_ID "BeOS" - -#elif defined(__QNX__) || defined(__QNXNTO__) -# define PLATFORM_ID "QNX" - -#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) -# define PLATFORM_ID "Tru64" - -#elif defined(__riscos) || defined(__riscos__) -# define PLATFORM_ID "RISCos" - -#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) -# define PLATFORM_ID "SINIX" - -#elif defined(__UNIX_SV__) -# define PLATFORM_ID "UNIX_SV" - -#elif defined(__bsdos__) -# define PLATFORM_ID "BSDOS" - -#elif defined(_MPRAS) || defined(MPRAS) -# define PLATFORM_ID "MP-RAS" - -#elif defined(__osf) || defined(__osf__) -# define PLATFORM_ID "OSF1" - -#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) -# define PLATFORM_ID "SCO_SV" - -#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) -# define PLATFORM_ID "ULTRIX" - -#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) -# define PLATFORM_ID "Xenix" - -#elif defined(__WATCOMC__) -# if defined(__LINUX__) -# define PLATFORM_ID "Linux" - -# elif defined(__DOS__) -# define PLATFORM_ID "DOS" - -# elif defined(__OS2__) -# define PLATFORM_ID "OS2" - -# elif defined(__WINDOWS__) -# define PLATFORM_ID "Windows3x" - -# elif defined(__VXWORKS__) -# define PLATFORM_ID "VxWorks" - -# else /* unknown platform */ -# define PLATFORM_ID -# endif - -#elif defined(__INTEGRITY) -# if defined(INT_178B) -# define PLATFORM_ID "Integrity178" - -# else /* regular Integrity */ -# define PLATFORM_ID "Integrity" -# endif - -# elif defined(_ADI_COMPILER) -# define PLATFORM_ID "ADSP" - -#else /* unknown platform */ -# define PLATFORM_ID - -#endif - -/* For windows compilers MSVC and Intel we can determine - the architecture of the compiler being used. This is because - the compilers do not have flags that can change the architecture, - but rather depend on which compiler is being used -*/ -#if defined(_WIN32) && defined(_MSC_VER) -# if defined(_M_IA64) -# define ARCHITECTURE_ID "IA64" - -# elif defined(_M_ARM64EC) -# define ARCHITECTURE_ID "ARM64EC" - -# elif defined(_M_X64) || defined(_M_AMD64) -# define ARCHITECTURE_ID "x64" - -# elif defined(_M_IX86) -# define ARCHITECTURE_ID "X86" - -# elif defined(_M_ARM64) -# define ARCHITECTURE_ID "ARM64" - -# elif defined(_M_ARM) -# if _M_ARM == 4 -# define ARCHITECTURE_ID "ARMV4I" -# elif _M_ARM == 5 -# define ARCHITECTURE_ID "ARMV5I" -# else -# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM) -# endif - -# elif defined(_M_MIPS) -# define ARCHITECTURE_ID "MIPS" - -# elif defined(_M_SH) -# define ARCHITECTURE_ID "SHx" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__WATCOMC__) -# if defined(_M_I86) -# define ARCHITECTURE_ID "I86" - -# elif defined(_M_IX86) -# define ARCHITECTURE_ID "X86" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) -# if defined(__ICCARM__) -# define ARCHITECTURE_ID "ARM" - -# elif defined(__ICCRX__) -# define ARCHITECTURE_ID "RX" - -# elif defined(__ICCRH850__) -# define ARCHITECTURE_ID "RH850" - -# elif defined(__ICCRL78__) -# define ARCHITECTURE_ID "RL78" - -# elif defined(__ICCRISCV__) -# define ARCHITECTURE_ID "RISCV" - -# elif defined(__ICCAVR__) -# define ARCHITECTURE_ID "AVR" - -# elif defined(__ICC430__) -# define ARCHITECTURE_ID "MSP430" - -# elif defined(__ICCV850__) -# define ARCHITECTURE_ID "V850" - -# elif defined(__ICC8051__) -# define ARCHITECTURE_ID "8051" - -# elif defined(__ICCSTM8__) -# define ARCHITECTURE_ID "STM8" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__ghs__) -# if defined(__PPC64__) -# define ARCHITECTURE_ID "PPC64" - -# elif defined(__ppc__) -# define ARCHITECTURE_ID "PPC" - -# elif defined(__ARM__) -# define ARCHITECTURE_ID "ARM" - -# elif defined(__x86_64__) -# define ARCHITECTURE_ID "x64" - -# elif defined(__i386__) -# define ARCHITECTURE_ID "X86" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__TI_COMPILER_VERSION__) -# if defined(__TI_ARM__) -# define ARCHITECTURE_ID "ARM" - -# elif defined(__MSP430__) -# define ARCHITECTURE_ID "MSP430" - -# elif defined(__TMS320C28XX__) -# define ARCHITECTURE_ID "TMS320C28x" - -# elif defined(__TMS320C6X__) || defined(_TMS320C6X) -# define ARCHITECTURE_ID "TMS320C6x" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -# elif defined(__ADSPSHARC__) -# define ARCHITECTURE_ID "SHARC" - -# elif defined(__ADSPBLACKFIN__) -# define ARCHITECTURE_ID "Blackfin" - -#elif defined(__TASKING__) - -# if defined(__CTC__) || defined(__CPTC__) -# define ARCHITECTURE_ID "TriCore" - -# elif defined(__CMCS__) -# define ARCHITECTURE_ID "MCS" - -# elif defined(__CARM__) -# define ARCHITECTURE_ID "ARM" - -# elif defined(__CARC__) -# define ARCHITECTURE_ID "ARC" - -# elif defined(__C51__) -# define ARCHITECTURE_ID "8051" - -# elif defined(__CPCP__) -# define ARCHITECTURE_ID "PCP" - -# else -# define ARCHITECTURE_ID "" -# endif - -#else -# define ARCHITECTURE_ID -#endif - -/* Convert integer to decimal digit literals. */ -#define DEC(n) \ - ('0' + (((n) / 10000000)%10)), \ - ('0' + (((n) / 1000000)%10)), \ - ('0' + (((n) / 100000)%10)), \ - ('0' + (((n) / 10000)%10)), \ - ('0' + (((n) / 1000)%10)), \ - ('0' + (((n) / 100)%10)), \ - ('0' + (((n) / 10)%10)), \ - ('0' + ((n) % 10)) - -/* Convert integer to hex digit literals. */ -#define HEX(n) \ - ('0' + ((n)>>28 & 0xF)), \ - ('0' + ((n)>>24 & 0xF)), \ - ('0' + ((n)>>20 & 0xF)), \ - ('0' + ((n)>>16 & 0xF)), \ - ('0' + ((n)>>12 & 0xF)), \ - ('0' + ((n)>>8 & 0xF)), \ - ('0' + ((n)>>4 & 0xF)), \ - ('0' + ((n) & 0xF)) - -/* Construct a string literal encoding the version number. */ -#ifdef COMPILER_VERSION -char const* info_version = "INFO" ":" "compiler_version[" COMPILER_VERSION "]"; - -/* Construct a string literal encoding the version number components. */ -#elif defined(COMPILER_VERSION_MAJOR) -char const info_version[] = { - 'I', 'N', 'F', 'O', ':', - 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', - COMPILER_VERSION_MAJOR, -# ifdef COMPILER_VERSION_MINOR - '.', COMPILER_VERSION_MINOR, -# ifdef COMPILER_VERSION_PATCH - '.', COMPILER_VERSION_PATCH, -# ifdef COMPILER_VERSION_TWEAK - '.', COMPILER_VERSION_TWEAK, -# endif -# endif -# endif - ']','\0'}; -#endif - -/* Construct a string literal encoding the internal version number. */ -#ifdef COMPILER_VERSION_INTERNAL -char const info_version_internal[] = { - 'I', 'N', 'F', 'O', ':', - 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_', - 'i','n','t','e','r','n','a','l','[', - COMPILER_VERSION_INTERNAL,']','\0'}; -#elif defined(COMPILER_VERSION_INTERNAL_STR) -char const* info_version_internal = "INFO" ":" "compiler_version_internal[" COMPILER_VERSION_INTERNAL_STR "]"; -#endif - -/* Construct a string literal encoding the version number components. */ -#ifdef SIMULATE_VERSION_MAJOR -char const info_simulate_version[] = { - 'I', 'N', 'F', 'O', ':', - 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[', - SIMULATE_VERSION_MAJOR, -# ifdef SIMULATE_VERSION_MINOR - '.', SIMULATE_VERSION_MINOR, -# ifdef SIMULATE_VERSION_PATCH - '.', SIMULATE_VERSION_PATCH, -# ifdef SIMULATE_VERSION_TWEAK - '.', SIMULATE_VERSION_TWEAK, -# endif -# endif -# endif - ']','\0'}; -#endif - -/* Construct the string literal in pieces to prevent the source from - getting matched. Store it in a pointer rather than an array - because some compilers will just produce instructions to fill the - array rather than assigning a pointer to a static array. */ -char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; -char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; - - - -#if defined(__INTEL_COMPILER) && defined(_MSVC_LANG) && _MSVC_LANG < 201403L -# if defined(__INTEL_CXX11_MODE__) -# if defined(__cpp_aggregate_nsdmi) -# define CXX_STD 201402L -# else -# define CXX_STD 201103L -# endif -# else -# define CXX_STD 199711L -# endif -#elif defined(_MSC_VER) && defined(_MSVC_LANG) -# define CXX_STD _MSVC_LANG -#else -# define CXX_STD __cplusplus -#endif - -const char* info_language_standard_default = "INFO" ":" "standard_default[" -#if CXX_STD > 202002L - "23" -#elif CXX_STD > 201703L - "20" -#elif CXX_STD >= 201703L - "17" -#elif CXX_STD >= 201402L - "14" -#elif CXX_STD >= 201103L - "11" -#else - "98" -#endif -"]"; - -const char* info_language_extensions_default = "INFO" ":" "extensions_default[" -#if (defined(__clang__) || defined(__GNUC__) || defined(__xlC__) || \ - defined(__TI_COMPILER_VERSION__)) && \ - !defined(__STRICT_ANSI__) - "ON" -#else - "OFF" -#endif -"]"; - -/*--------------------------------------------------------------------------*/ - -int main(int argc, char* argv[]) -{ - int require = 0; - require += info_compiler[argc]; - require += info_platform[argc]; - require += info_arch[argc]; -#ifdef COMPILER_VERSION_MAJOR - require += info_version[argc]; -#endif -#ifdef COMPILER_VERSION_INTERNAL - require += info_version_internal[argc]; -#endif -#ifdef SIMULATE_ID - require += info_simulate[argc]; -#endif -#ifdef SIMULATE_VERSION_MAJOR - require += info_simulate_version[argc]; -#endif -#if defined(__CRAYXT_COMPUTE_LINUX_TARGET) - require += info_cray[argc]; -#endif - require += info_language_standard_default[argc]; - require += info_language_extensions_default[argc]; - (void)argv; - return require; -} diff --git a/CMakeFiles/3.25.1/CompilerIdCXX/CMakeCXXCompilerId.o b/CMakeFiles/3.25.1/CompilerIdCXX/CMakeCXXCompilerId.o deleted file mode 100644 index 27a98dfcaa20cf8c789543d58ca3b653f13b3e7a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1712 zcmb_cJ#5oZ5PqShqzWV;F@P#TBo?M92^m^Yq(lt}kkxj`5QwUWmAI)T$FUp-Iu^me zz(849io}4J7|8@v9NVIIAex_mO?sT15Gey|D^RxL=qi6dtbI|o&<3zjF3b7wX^nFe5+TTDh@$ zm41!wSbnwWd5*R0m~LZTgb~j%gN>Hotd>k4zm2`7U)!v*-40B*Zu)guw>Hd<6I7QL zIf8ky+_sH28pc*v*8lKhPt+&xTRtVMrbEf(Qp!lDM@A+`zU?;-`V= zyEuF_ci1ZI^ANGm9Mu`;hNsva;^<{PZ(ZV;1X@S33?1ihh+}Z{yuau8Hz3JdD6Rhy zG9g|vpXEKDGrz$61@W={pAtvmdR`xbC$QfdufNS)?@w-u-{bft<`w32zft@qbNbE+ zwqfGpu-%Q8q?YWM4ND$vs_7Ne4JjO%!d1)5bgSb+x@%;zVRG&&A)BV{@;cr4OsV6A c6EwXXr%S;Ay`m`$(5$8~Kr@=c0Hq%J4MtKCng9R* diff --git a/CMakeFiles/CMakeError.log b/CMakeFiles/CMakeError.log deleted file mode 100644 index e69de29b..00000000 diff --git a/CMakeFiles/CMakeOutput.log b/CMakeFiles/CMakeOutput.log deleted file mode 100644 index 2b73be42..00000000 --- a/CMakeFiles/CMakeOutput.log +++ /dev/null @@ -1,312 +0,0 @@ -The system is: Darwin - 22.2.0 - arm64 -Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded. -Compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -Build flags: -Id flags: -c - -The output was: -0 - - -Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "CMakeCCompilerId.o" - -The C compiler identification is AppleClang, found in "/Users/ningfei/Repo/dcm2niix/CMakeFiles/3.25.1/CompilerIdC/CMakeCCompilerId.o" - -Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded. -Compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -Build flags: -Id flags: -c - -The output was: -0 - - -Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "CMakeCXXCompilerId.o" - -The CXX compiler identification is AppleClang, found in "/Users/ningfei/Repo/dcm2niix/CMakeFiles/3.25.1/CompilerIdCXX/CMakeCXXCompilerId.o" - -Detecting C compiler ABI info compiled with the following output: -Change Dir: /Users/ningfei/Repo/dcm2niix/CMakeFiles/CMakeScratch/TryCompile-MCzuMu - -Run Build Command(s):/usr/bin/make -f Makefile cmTC_fbd25/fast && /Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_fbd25.dir/build.make CMakeFiles/cmTC_fbd25.dir/build -Building C object CMakeFiles/cmTC_fbd25.dir/CMakeCCompilerABI.c.o -/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk -v -Wl,-v -MD -MT CMakeFiles/cmTC_fbd25.dir/CMakeCCompilerABI.c.o -MF CMakeFiles/cmTC_fbd25.dir/CMakeCCompilerABI.c.o.d -o CMakeFiles/cmTC_fbd25.dir/CMakeCCompilerABI.c.o -c /opt/homebrew/Cellar/cmake/3.25.1/share/cmake/Modules/CMakeCCompilerABI.c -Apple clang version 14.0.0 (clang-1400.0.29.202) -Target: x86_64-apple-darwin22.2.0 -Thread model: posix -InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin -clang: warning: -Wl,-v: 'linker' input unused [-Wunused-command-line-argument] - "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple x86_64-apple-macosx13.0.0 -Wundef-prefix=TARGET_OS_ -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -Werror=implicit-function-declaration -emit-obj -mrelax-all --mrelax-relocations -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name CMakeCCompilerABI.c -mrelocation-model pic -pic-level 2 -mframe-pointer=all -fno-strict-return -fno-rounding-math -funwind-tables=2 -target-sdk-version=13.1 -fvisibility-inlines-hidden-static-local-var -target-cpu penryn -tune-cpu generic -debugger-tuning=lldb -target-linker-version 820.1 -v -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0 -dependency-file CMakeFiles/cmTC_fbd25.dir/CMakeCCompilerABI.c.o.d -skip-unused-modulemap-deps -MT CMakeFiles/cmTC_fbd25.dir/CMakeCCompilerABI.c.o -sys-header-deps -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk -c-isystem /Users/ningfei/.local/include -c-isystem /opt/homebrew/include -c-isystem . -cxx-isystem /Users/ningfei/.local/include -cxx-isystem /opt/homebrew/include -cxx-isystem . -internal-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/local/include -internal-isystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -Wno-reorder-init-list -Wno-implicit-int-float-conversion -Wno-c99-designator -Wno-final-dtor-non-final-class -Wno-extra-semi-stmt -Wno-misleading-indentation -Wno-quoted-include-in-framework-header -Wno-implicit-fallthrough -Wno-enum-enum-conversion -Wno-enum-float-conversion -Wno-elaborated-enum-base -Wno-reserved-identifier -Wno-gnu-folding-constant -Wno-cast-function-type -Wno-bitwise-instead-of-logical -fdebug-compilation-dir=/Users/ningfei/Repo/dcm2niix/CMakeFiles/CMakeScratch/TryCompile-MCzuMu -ferror-limit 19 -stack-protector 1 -fstack-check -mdarwin-stkchk-strong-link -fblocks -fencode-extended-block-signature -fregister-global-dtors-with-atexit -fgnuc-version=4.2.1 -fmax-type-align=16 -fcommon -clang-vendor-feature=+messageToSelfInClassMethodIdReturnType -clang-vendor-feature=+disableInferNewAvailabilityFromInit -clang-vendor-feature=+disableNonDependentMemberExprInCurrentInstantiation -fno-odr-hash-protocols -clang-vendor-feature=+enableAggressiveVLAFolding -clang-vendor-feature=+revert09abecef7bbf -clang-vendor-feature=+thisNoAlignAttr -clang-vendor-feature=+thisNoNullAttr -mllvm -disable-aligned-alloc-awareness=1 -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o CMakeFiles/cmTC_fbd25.dir/CMakeCCompilerABI.c.o -x c /opt/homebrew/Cellar/cmake/3.25.1/share/cmake/Modules/CMakeCCompilerABI.c -clang -cc1 version 14.0.0 (clang-1400.0.29.202) default target arm64-apple-darwin22.2.0 -ignoring nonexistent directory "/Users/ningfei/.local/include" -ignoring nonexistent directory "/Users/ningfei/.local/include" -ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/local/include" -ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/Library/Frameworks" -#include "..." search starts here: -#include <...> search starts here: - /opt/homebrew/include - . - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/System/Library/Frameworks (framework directory) -End of search list. -Linking C executable cmTC_fbd25 -/opt/homebrew/Cellar/cmake/3.25.1/bin/cmake -E cmake_link_script CMakeFiles/cmTC_fbd25.dir/link.txt --verbose=1 -/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names -v -Wl,-v CMakeFiles/cmTC_fbd25.dir/CMakeCCompilerABI.c.o -o cmTC_fbd25 -Apple clang version 14.0.0 (clang-1400.0.29.202) -Target: x86_64-apple-darwin22.2.0 -Thread model: posix -InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin - "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -dynamic -arch x86_64 -platform_version macos 13.0.0 13.1 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk -o cmTC_fbd25 -L/Users/ningfei/.local/lib -L/opt/homebrew/lib -L. -search_paths_first -headerpad_max_install_names -v CMakeFiles/cmTC_fbd25.dir/CMakeCCompilerABI.c.o -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/lib/darwin/libclang_rt.osx.a -@(#)PROGRAM:ld PROJECT:ld64-820.1 -BUILD 20:07:05 Nov 7 2022 -configured to support archs: armv6 armv7 armv7s arm64 arm64e arm64_32 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em -Library search paths: - /Users/ningfei/.local/lib - /opt/homebrew/lib - . - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/lib -Framework search paths: - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/System/Library/Frameworks/ - - - -Parsed C implicit include dir info from above output: rv=done - found start of include info - found start of implicit include info - add: [/opt/homebrew/include] - add: [.] - add: [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include] - add: [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include] - add: [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include] - end of search list found - collapse include dir [/opt/homebrew/include] ==> [/opt/homebrew/include] - skipping relative include dir [.] - collapse include dir [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include] ==> [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include] - collapse include dir [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include] ==> [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include] - collapse include dir [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include] ==> [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include] - implicit include dirs: [/opt/homebrew/include;/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include;/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include] - - -Parsed C implicit link information from above output: - link line regex: [^( *|.*[/\])(ld|CMAKE_LINK_STARTFILE-NOTFOUND|([^/\]+-)?ld|collect2)[^/\]*( |$)] - ignore line: [Change Dir: /Users/ningfei/Repo/dcm2niix/CMakeFiles/CMakeScratch/TryCompile-MCzuMu] - ignore line: [] - ignore line: [Run Build Command(s):/usr/bin/make -f Makefile cmTC_fbd25/fast && /Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_fbd25.dir/build.make CMakeFiles/cmTC_fbd25.dir/build] - ignore line: [Building C object CMakeFiles/cmTC_fbd25.dir/CMakeCCompilerABI.c.o] - ignore line: [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk -v -Wl -v -MD -MT CMakeFiles/cmTC_fbd25.dir/CMakeCCompilerABI.c.o -MF CMakeFiles/cmTC_fbd25.dir/CMakeCCompilerABI.c.o.d -o CMakeFiles/cmTC_fbd25.dir/CMakeCCompilerABI.c.o -c /opt/homebrew/Cellar/cmake/3.25.1/share/cmake/Modules/CMakeCCompilerABI.c] - ignore line: [Apple clang version 14.0.0 (clang-1400.0.29.202)] - ignore line: [Target: x86_64-apple-darwin22.2.0] - ignore line: [Thread model: posix] - ignore line: [InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin] - ignore line: [clang: warning: -Wl -v: 'linker' input unused [-Wunused-command-line-argument]] - ignore line: [ "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple x86_64-apple-macosx13.0.0 -Wundef-prefix=TARGET_OS_ -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -Werror=implicit-function-declaration -emit-obj -mrelax-all --mrelax-relocations -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name CMakeCCompilerABI.c -mrelocation-model pic -pic-level 2 -mframe-pointer=all -fno-strict-return -fno-rounding-math -funwind-tables=2 -target-sdk-version=13.1 -fvisibility-inlines-hidden-static-local-var -target-cpu penryn -tune-cpu generic -debugger-tuning=lldb -target-linker-version 820.1 -v -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0 -dependency-file CMakeFiles/cmTC_fbd25.dir/CMakeCCompilerABI.c.o.d -skip-unused-modulemap-deps -MT CMakeFiles/cmTC_fbd25.dir/CMakeCCompilerABI.c.o -sys-header-deps -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk -c-isystem /Users/ningfei/.local/include -c-isystem /opt/homebrew/include -c-isystem . -cxx-isystem /Users/ningfei/.local/include -cxx-isystem /opt/homebrew/include -cxx-isystem . -internal-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/local/include -internal-isystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -Wno-reorder-init-list -Wno-implicit-int-float-conversion -Wno-c99-designator -Wno-final-dtor-non-final-class -Wno-extra-semi-stmt -Wno-misleading-indentation -Wno-quoted-include-in-framework-header -Wno-implicit-fallthrough -Wno-enum-enum-conversion -Wno-enum-float-conversion -Wno-elaborated-enum-base -Wno-reserved-identifier -Wno-gnu-folding-constant -Wno-cast-function-type -Wno-bitwise-instead-of-logical -fdebug-compilation-dir=/Users/ningfei/Repo/dcm2niix/CMakeFiles/CMakeScratch/TryCompile-MCzuMu -ferror-limit 19 -stack-protector 1 -fstack-check -mdarwin-stkchk-strong-link -fblocks -fencode-extended-block-signature -fregister-global-dtors-with-atexit -fgnuc-version=4.2.1 -fmax-type-align=16 -fcommon -clang-vendor-feature=+messageToSelfInClassMethodIdReturnType -clang-vendor-feature=+disableInferNewAvailabilityFromInit -clang-vendor-feature=+disableNonDependentMemberExprInCurrentInstantiation -fno-odr-hash-protocols -clang-vendor-feature=+enableAggressiveVLAFolding -clang-vendor-feature=+revert09abecef7bbf -clang-vendor-feature=+thisNoAlignAttr -clang-vendor-feature=+thisNoNullAttr -mllvm -disable-aligned-alloc-awareness=1 -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o CMakeFiles/cmTC_fbd25.dir/CMakeCCompilerABI.c.o -x c /opt/homebrew/Cellar/cmake/3.25.1/share/cmake/Modules/CMakeCCompilerABI.c] - ignore line: [clang -cc1 version 14.0.0 (clang-1400.0.29.202) default target arm64-apple-darwin22.2.0] - ignore line: [ignoring nonexistent directory "/Users/ningfei/.local/include"] - ignore line: [ignoring nonexistent directory "/Users/ningfei/.local/include"] - ignore line: [ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/local/include"] - ignore line: [ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/Library/Frameworks"] - ignore line: [#include "..." search starts here:] - ignore line: [#include <...> search starts here:] - ignore line: [ /opt/homebrew/include] - ignore line: [ .] - ignore line: [ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include] - ignore line: [ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include] - ignore line: [ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include] - ignore line: [ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/System/Library/Frameworks (framework directory)] - ignore line: [End of search list.] - ignore line: [Linking C executable cmTC_fbd25] - ignore line: [/opt/homebrew/Cellar/cmake/3.25.1/bin/cmake -E cmake_link_script CMakeFiles/cmTC_fbd25.dir/link.txt --verbose=1] - ignore line: [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk -Wl -search_paths_first -Wl -headerpad_max_install_names -v -Wl -v CMakeFiles/cmTC_fbd25.dir/CMakeCCompilerABI.c.o -o cmTC_fbd25 ] - ignore line: [Apple clang version 14.0.0 (clang-1400.0.29.202)] - ignore line: [Target: x86_64-apple-darwin22.2.0] - ignore line: [Thread model: posix] - ignore line: [InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin] - link line: [ "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -dynamic -arch x86_64 -platform_version macos 13.0.0 13.1 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk -o cmTC_fbd25 -L/Users/ningfei/.local/lib -L/opt/homebrew/lib -L. -search_paths_first -headerpad_max_install_names -v CMakeFiles/cmTC_fbd25.dir/CMakeCCompilerABI.c.o -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/lib/darwin/libclang_rt.osx.a] - arg [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld] ==> ignore - arg [-demangle] ==> ignore - arg [-lto_library] ==> ignore, skip following value - arg [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib] ==> skip value of -lto_library - arg [-dynamic] ==> ignore - arg [-arch] ==> ignore - arg [x86_64] ==> ignore - arg [-platform_version] ==> ignore - arg [macos] ==> ignore - arg [13.0.0] ==> ignore - arg [13.1] ==> ignore - arg [-syslibroot] ==> ignore - arg [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk] ==> ignore - arg [-o] ==> ignore - arg [cmTC_fbd25] ==> ignore - arg [-L/Users/ningfei/.local/lib] ==> dir [/Users/ningfei/.local/lib] - arg [-L/opt/homebrew/lib] ==> dir [/opt/homebrew/lib] - arg [-L.] ==> ignore - arg [-search_paths_first] ==> ignore - arg [-headerpad_max_install_names] ==> ignore - arg [-v] ==> ignore - arg [CMakeFiles/cmTC_fbd25.dir/CMakeCCompilerABI.c.o] ==> ignore - arg [-lSystem] ==> lib [System] - arg [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/lib/darwin/libclang_rt.osx.a] ==> lib [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/lib/darwin/libclang_rt.osx.a] - Library search paths: [;/Users/ningfei/.local/lib;/opt/homebrew/lib;.;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/lib] - Framework search paths: [;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/System/Library/Frameworks/] - remove lib [System] - remove lib [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/lib/darwin/libclang_rt.osx.a] - collapse library dir [/Users/ningfei/.local/lib] ==> [/Users/ningfei/.local/lib] - collapse library dir [/opt/homebrew/lib] ==> [/opt/homebrew/lib] - collapse library dir [/Users/ningfei/.local/lib] ==> [/Users/ningfei/.local/lib] - collapse library dir [/opt/homebrew/lib] ==> [/opt/homebrew/lib] - collapse library dir [.] ==> [/Users/ningfei/Repo/dcm2niix] - collapse library dir [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/lib] ==> [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/lib] - collapse framework dir [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/System/Library/Frameworks/] ==> [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/System/Library/Frameworks] - implicit libs: [] - implicit objs: [] - implicit dirs: [/Users/ningfei/.local/lib;/opt/homebrew/lib;/Users/ningfei/Repo/dcm2niix;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/lib] - implicit fwks: [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/System/Library/Frameworks] - - -Detecting CXX compiler ABI info compiled with the following output: -Change Dir: /Users/ningfei/Repo/dcm2niix/CMakeFiles/CMakeScratch/TryCompile-1caCWZ - -Run Build Command(s):/usr/bin/make -f Makefile cmTC_3307b/fast && /Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_3307b.dir/build.make CMakeFiles/cmTC_3307b.dir/build -Building CXX object CMakeFiles/cmTC_3307b.dir/CMakeCXXCompilerABI.cpp.o -/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk -v -Wl,-v -MD -MT CMakeFiles/cmTC_3307b.dir/CMakeCXXCompilerABI.cpp.o -MF CMakeFiles/cmTC_3307b.dir/CMakeCXXCompilerABI.cpp.o.d -o CMakeFiles/cmTC_3307b.dir/CMakeCXXCompilerABI.cpp.o -c /opt/homebrew/Cellar/cmake/3.25.1/share/cmake/Modules/CMakeCXXCompilerABI.cpp -Apple clang version 14.0.0 (clang-1400.0.29.202) -Target: x86_64-apple-darwin22.2.0 -Thread model: posix -InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin -clang: warning: -Wl,-v: 'linker' input unused [-Wunused-command-line-argument] - "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple x86_64-apple-macosx13.0.0 -Wundef-prefix=TARGET_OS_ -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -Werror=implicit-function-declaration -emit-obj -mrelax-all --mrelax-relocations -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name CMakeCXXCompilerABI.cpp -mrelocation-model pic -pic-level 2 -mframe-pointer=all -fno-strict-return -fno-rounding-math -funwind-tables=2 -target-sdk-version=13.1 -fvisibility-inlines-hidden-static-local-var -target-cpu penryn -tune-cpu generic -debugger-tuning=lldb -target-linker-version 820.1 -v -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0 -dependency-file CMakeFiles/cmTC_3307b.dir/CMakeCXXCompilerABI.cpp.o.d -skip-unused-modulemap-deps -MT CMakeFiles/cmTC_3307b.dir/CMakeCXXCompilerABI.cpp.o -sys-header-deps -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk -c-isystem /Users/ningfei/.local/include -c-isystem /opt/homebrew/include -c-isystem . -cxx-isystem /Users/ningfei/.local/include -cxx-isystem /opt/homebrew/include -cxx-isystem . -stdlib=libc++ -internal-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/c++/v1 -internal-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/local/include -internal-isystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -Wno-reorder-init-list -Wno-implicit-int-float-conversion -Wno-c99-designator -Wno-final-dtor-non-final-class -Wno-extra-semi-stmt -Wno-misleading-indentation -Wno-quoted-include-in-framework-header -Wno-implicit-fallthrough -Wno-enum-enum-conversion -Wno-enum-float-conversion -Wno-elaborated-enum-base -Wno-reserved-identifier -Wno-gnu-folding-constant -Wno-cast-function-type -Wno-bitwise-instead-of-logical -fdeprecated-macro -fdebug-compilation-dir=/Users/ningfei/Repo/dcm2niix/CMakeFiles/CMakeScratch/TryCompile-1caCWZ -ferror-limit 19 -stack-protector 1 -fstack-check -mdarwin-stkchk-strong-link -fblocks -fencode-extended-block-signature -fregister-global-dtors-with-atexit -fgnuc-version=4.2.1 -fno-cxx-modules -fcxx-exceptions -fexceptions -fmax-type-align=16 -fcommon -clang-vendor-feature=+messageToSelfInClassMethodIdReturnType -clang-vendor-feature=+disableInferNewAvailabilityFromInit -clang-vendor-feature=+disableNonDependentMemberExprInCurrentInstantiation -fno-odr-hash-protocols -clang-vendor-feature=+enableAggressiveVLAFolding -clang-vendor-feature=+revert09abecef7bbf -clang-vendor-feature=+thisNoAlignAttr -clang-vendor-feature=+thisNoNullAttr -mllvm -disable-aligned-alloc-awareness=1 -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o CMakeFiles/cmTC_3307b.dir/CMakeCXXCompilerABI.cpp.o -x c++ /opt/homebrew/Cellar/cmake/3.25.1/share/cmake/Modules/CMakeCXXCompilerABI.cpp -clang -cc1 version 14.0.0 (clang-1400.0.29.202) default target arm64-apple-darwin22.2.0 -ignoring nonexistent directory "/Users/ningfei/.local/include" -ignoring nonexistent directory "/Users/ningfei/.local/include" -ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/local/include" -ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/Library/Frameworks" -#include "..." search starts here: -#include <...> search starts here: - /opt/homebrew/include - . - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/c++/v1 - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/System/Library/Frameworks (framework directory) -End of search list. -Linking CXX executable cmTC_3307b -/opt/homebrew/Cellar/cmake/3.25.1/bin/cmake -E cmake_link_script CMakeFiles/cmTC_3307b.dir/link.txt --verbose=1 -/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names -v -Wl,-v CMakeFiles/cmTC_3307b.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_3307b -Apple clang version 14.0.0 (clang-1400.0.29.202) -Target: x86_64-apple-darwin22.2.0 -Thread model: posix -InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin - "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -dynamic -arch x86_64 -platform_version macos 13.0.0 13.1 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk -o cmTC_3307b -L/Users/ningfei/.local/lib -L/opt/homebrew/lib -L. -search_paths_first -headerpad_max_install_names -v CMakeFiles/cmTC_3307b.dir/CMakeCXXCompilerABI.cpp.o -lc++ -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/lib/darwin/libclang_rt.osx.a -@(#)PROGRAM:ld PROJECT:ld64-820.1 -BUILD 20:07:05 Nov 7 2022 -configured to support archs: armv6 armv7 armv7s arm64 arm64e arm64_32 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em -Library search paths: - /Users/ningfei/.local/lib - /opt/homebrew/lib - . - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/lib -Framework search paths: - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/System/Library/Frameworks/ - - - -Parsed CXX implicit include dir info from above output: rv=done - found start of include info - found start of implicit include info - add: [/opt/homebrew/include] - add: [.] - add: [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/c++/v1] - add: [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include] - add: [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include] - add: [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include] - end of search list found - collapse include dir [/opt/homebrew/include] ==> [/opt/homebrew/include] - skipping relative include dir [.] - collapse include dir [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/c++/v1] ==> [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/c++/v1] - collapse include dir [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include] ==> [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include] - collapse include dir [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include] ==> [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include] - collapse include dir [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include] ==> [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include] - implicit include dirs: [/opt/homebrew/include;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/c++/v1;/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include;/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include] - - -Parsed CXX implicit link information from above output: - link line regex: [^( *|.*[/\])(ld|CMAKE_LINK_STARTFILE-NOTFOUND|([^/\]+-)?ld|collect2)[^/\]*( |$)] - ignore line: [Change Dir: /Users/ningfei/Repo/dcm2niix/CMakeFiles/CMakeScratch/TryCompile-1caCWZ] - ignore line: [] - ignore line: [Run Build Command(s):/usr/bin/make -f Makefile cmTC_3307b/fast && /Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_3307b.dir/build.make CMakeFiles/cmTC_3307b.dir/build] - ignore line: [Building CXX object CMakeFiles/cmTC_3307b.dir/CMakeCXXCompilerABI.cpp.o] - ignore line: [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk -v -Wl -v -MD -MT CMakeFiles/cmTC_3307b.dir/CMakeCXXCompilerABI.cpp.o -MF CMakeFiles/cmTC_3307b.dir/CMakeCXXCompilerABI.cpp.o.d -o CMakeFiles/cmTC_3307b.dir/CMakeCXXCompilerABI.cpp.o -c /opt/homebrew/Cellar/cmake/3.25.1/share/cmake/Modules/CMakeCXXCompilerABI.cpp] - ignore line: [Apple clang version 14.0.0 (clang-1400.0.29.202)] - ignore line: [Target: x86_64-apple-darwin22.2.0] - ignore line: [Thread model: posix] - ignore line: [InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin] - ignore line: [clang: warning: -Wl -v: 'linker' input unused [-Wunused-command-line-argument]] - ignore line: [ "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple x86_64-apple-macosx13.0.0 -Wundef-prefix=TARGET_OS_ -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -Werror=implicit-function-declaration -emit-obj -mrelax-all --mrelax-relocations -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name CMakeCXXCompilerABI.cpp -mrelocation-model pic -pic-level 2 -mframe-pointer=all -fno-strict-return -fno-rounding-math -funwind-tables=2 -target-sdk-version=13.1 -fvisibility-inlines-hidden-static-local-var -target-cpu penryn -tune-cpu generic -debugger-tuning=lldb -target-linker-version 820.1 -v -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0 -dependency-file CMakeFiles/cmTC_3307b.dir/CMakeCXXCompilerABI.cpp.o.d -skip-unused-modulemap-deps -MT CMakeFiles/cmTC_3307b.dir/CMakeCXXCompilerABI.cpp.o -sys-header-deps -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk -c-isystem /Users/ningfei/.local/include -c-isystem /opt/homebrew/include -c-isystem . -cxx-isystem /Users/ningfei/.local/include -cxx-isystem /opt/homebrew/include -cxx-isystem . -stdlib=libc++ -internal-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/c++/v1 -internal-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/local/include -internal-isystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -Wno-reorder-init-list -Wno-implicit-int-float-conversion -Wno-c99-designator -Wno-final-dtor-non-final-class -Wno-extra-semi-stmt -Wno-misleading-indentation -Wno-quoted-include-in-framework-header -Wno-implicit-fallthrough -Wno-enum-enum-conversion -Wno-enum-float-conversion -Wno-elaborated-enum-base -Wno-reserved-identifier -Wno-gnu-folding-constant -Wno-cast-function-type -Wno-bitwise-instead-of-logical -fdeprecated-macro -fdebug-compilation-dir=/Users/ningfei/Repo/dcm2niix/CMakeFiles/CMakeScratch/TryCompile-1caCWZ -ferror-limit 19 -stack-protector 1 -fstack-check -mdarwin-stkchk-strong-link -fblocks -fencode-extended-block-signature -fregister-global-dtors-with-atexit -fgnuc-version=4.2.1 -fno-cxx-modules -fcxx-exceptions -fexceptions -fmax-type-align=16 -fcommon -clang-vendor-feature=+messageToSelfInClassMethodIdReturnType -clang-vendor-feature=+disableInferNewAvailabilityFromInit -clang-vendor-feature=+disableNonDependentMemberExprInCurrentInstantiation -fno-odr-hash-protocols -clang-vendor-feature=+enableAggressiveVLAFolding -clang-vendor-feature=+revert09abecef7bbf -clang-vendor-feature=+thisNoAlignAttr -clang-vendor-feature=+thisNoNullAttr -mllvm -disable-aligned-alloc-awareness=1 -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o CMakeFiles/cmTC_3307b.dir/CMakeCXXCompilerABI.cpp.o -x c++ /opt/homebrew/Cellar/cmake/3.25.1/share/cmake/Modules/CMakeCXXCompilerABI.cpp] - ignore line: [clang -cc1 version 14.0.0 (clang-1400.0.29.202) default target arm64-apple-darwin22.2.0] - ignore line: [ignoring nonexistent directory "/Users/ningfei/.local/include"] - ignore line: [ignoring nonexistent directory "/Users/ningfei/.local/include"] - ignore line: [ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/local/include"] - ignore line: [ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/Library/Frameworks"] - ignore line: [#include "..." search starts here:] - ignore line: [#include <...> search starts here:] - ignore line: [ /opt/homebrew/include] - ignore line: [ .] - ignore line: [ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/c++/v1] - ignore line: [ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include] - ignore line: [ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include] - ignore line: [ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include] - ignore line: [ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/System/Library/Frameworks (framework directory)] - ignore line: [End of search list.] - ignore line: [Linking CXX executable cmTC_3307b] - ignore line: [/opt/homebrew/Cellar/cmake/3.25.1/bin/cmake -E cmake_link_script CMakeFiles/cmTC_3307b.dir/link.txt --verbose=1] - ignore line: [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk -Wl -search_paths_first -Wl -headerpad_max_install_names -v -Wl -v CMakeFiles/cmTC_3307b.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_3307b ] - ignore line: [Apple clang version 14.0.0 (clang-1400.0.29.202)] - ignore line: [Target: x86_64-apple-darwin22.2.0] - ignore line: [Thread model: posix] - ignore line: [InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin] - link line: [ "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -dynamic -arch x86_64 -platform_version macos 13.0.0 13.1 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk -o cmTC_3307b -L/Users/ningfei/.local/lib -L/opt/homebrew/lib -L. -search_paths_first -headerpad_max_install_names -v CMakeFiles/cmTC_3307b.dir/CMakeCXXCompilerABI.cpp.o -lc++ -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/lib/darwin/libclang_rt.osx.a] - arg [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld] ==> ignore - arg [-demangle] ==> ignore - arg [-lto_library] ==> ignore, skip following value - arg [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib] ==> skip value of -lto_library - arg [-dynamic] ==> ignore - arg [-arch] ==> ignore - arg [x86_64] ==> ignore - arg [-platform_version] ==> ignore - arg [macos] ==> ignore - arg [13.0.0] ==> ignore - arg [13.1] ==> ignore - arg [-syslibroot] ==> ignore - arg [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk] ==> ignore - arg [-o] ==> ignore - arg [cmTC_3307b] ==> ignore - arg [-L/Users/ningfei/.local/lib] ==> dir [/Users/ningfei/.local/lib] - arg [-L/opt/homebrew/lib] ==> dir [/opt/homebrew/lib] - arg [-L.] ==> ignore - arg [-search_paths_first] ==> ignore - arg [-headerpad_max_install_names] ==> ignore - arg [-v] ==> ignore - arg [CMakeFiles/cmTC_3307b.dir/CMakeCXXCompilerABI.cpp.o] ==> ignore - arg [-lc++] ==> lib [c++] - arg [-lSystem] ==> lib [System] - arg [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/lib/darwin/libclang_rt.osx.a] ==> lib [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/lib/darwin/libclang_rt.osx.a] - Library search paths: [;/Users/ningfei/.local/lib;/opt/homebrew/lib;.;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/lib] - Framework search paths: [;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/System/Library/Frameworks/] - remove lib [System] - remove lib [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/lib/darwin/libclang_rt.osx.a] - collapse library dir [/Users/ningfei/.local/lib] ==> [/Users/ningfei/.local/lib] - collapse library dir [/opt/homebrew/lib] ==> [/opt/homebrew/lib] - collapse library dir [/Users/ningfei/.local/lib] ==> [/Users/ningfei/.local/lib] - collapse library dir [/opt/homebrew/lib] ==> [/opt/homebrew/lib] - collapse library dir [.] ==> [/Users/ningfei/Repo/dcm2niix] - collapse library dir [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/lib] ==> [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/lib] - collapse framework dir [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/System/Library/Frameworks/] ==> [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/System/Library/Frameworks] - implicit libs: [c++] - implicit objs: [] - implicit dirs: [/Users/ningfei/.local/lib;/opt/homebrew/lib;/Users/ningfei/Repo/dcm2niix;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/lib] - implicit fwks: [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/System/Library/Frameworks] - - diff --git a/CMakeFiles/cmake.check_cache b/CMakeFiles/cmake.check_cache deleted file mode 100644 index 3dccd731..00000000 --- a/CMakeFiles/cmake.check_cache +++ /dev/null @@ -1 +0,0 @@ -# This file is generated by cmake for dependency checking of the CMakeCache.txt file diff --git a/console-prefix/src/console-stamp/console-custominfo.txt b/console-prefix/src/console-stamp/console-custominfo.txt deleted file mode 100644 index d3f6044b..00000000 --- a/console-prefix/src/console-stamp/console-custominfo.txt +++ /dev/null @@ -1,9 +0,0 @@ -# This is a generated file and its contents are an internal implementation detail. -# The download step will be re-executed if anything in this file changes. -# No other meaning or use of this file is supported. - -method=custom -command= -source_dir=/Users/ningfei/Repo/dcm2niix/console -work_dir=/Users/ningfei/Repo/dcm2niix/console-prefix/src - diff --git a/console-prefix/tmp/console-cfgcmd.txt b/console-prefix/tmp/console-cfgcmd.txt deleted file mode 100644 index 8ba2b9fc..00000000 --- a/console-prefix/tmp/console-cfgcmd.txt +++ /dev/null @@ -1 +0,0 @@ -cmd='/opt/homebrew/Cellar/cmake/3.25.1/bin/cmake;-Wno-dev;--no-warn-unused-clil;-DCMAKE_OSX_ARCHITECTURES=x86_64;-DCMAKE_BUILD_TYPE:STRING=Release;-DCMAKE_INSTALL_PREFIX:PATH=/Users/ningfei/Repo/dcm2niix;-DCMAKE_C_FLAGS:STRING=;-DCMAKE_CXX_FLAGS:STRING=;-DCMAKE_VERBOSE_MAKEFILE:BOOL=FALSE;-DUSE_STATIC_RUNTIME:BOOL=ON;-DUSE_TURBOJPEG:BOOL=OFF;-DUSE_JASPER:BOOL=OFF;-DUSE_JPEGLS:BOOL=OFF;-DUSE_JNIFTI:BOOL=ON;-DZLIB_IMPLEMENTATION:STRING=Miniz;-DZLIB_ROOT:PATH=;-DUSE_OPENJPEG:BOOL=OFF;-DOpenJPEG_DIR:PATH=;-DBATCH_VERSION:BOOL=OFF;-DYAML-CPP_DIR:PATH=;-DBUILD_DCM2NIIXFSLIB:BOOL=OFF;-GUnix Makefiles;' diff --git a/console-prefix/tmp/console-mkdirs.cmake b/console-prefix/tmp/console-mkdirs.cmake deleted file mode 100644 index 9141b5b0..00000000 --- a/console-prefix/tmp/console-mkdirs.cmake +++ /dev/null @@ -1,22 +0,0 @@ -# Distributed under the OSI-approved BSD 3-Clause License. See accompanying -# file Copyright.txt or https://cmake.org/licensing for details. - -cmake_minimum_required(VERSION 3.5) - -file(MAKE_DIRECTORY - "/Users/ningfei/Repo/dcm2niix/console" - "/Users/ningfei/Repo/dcm2niix/console-build" - "/Users/ningfei/Repo/dcm2niix/console-prefix" - "/Users/ningfei/Repo/dcm2niix/console-prefix/tmp" - "/Users/ningfei/Repo/dcm2niix/console-prefix/src/console-stamp" - "/Users/ningfei/Repo/dcm2niix/console-prefix/src" - "/Users/ningfei/Repo/dcm2niix/console-prefix/src/console-stamp" -) - -set(configSubDirs ) -foreach(subDir IN LISTS configSubDirs) - file(MAKE_DIRECTORY "/Users/ningfei/Repo/dcm2niix/console-prefix/src/console-stamp/${subDir}") -endforeach() -if(cfgdir) - file(MAKE_DIRECTORY "/Users/ningfei/Repo/dcm2niix/console-prefix/src/console-stamp${cfgdir}") # cfgdir has leading slash -endif() From 4351e5b9bfb5be1c99fc4bb0d3f4c507f70d8906 Mon Sep 17 00:00:00 2001 From: neurolabusc Date: Tue, 10 Jan 2023 08:09:16 -0500 Subject: [PATCH 46/85] Handle missing 0020,0037 (https://github.com/rordenlab/dcm2niix/issues/665) --- README.md | 1 + Siemens/README.md | 2 +- console/nii_dicom.cpp | 6 +++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a88fc615..ea39aa90 100644 --- a/README.md +++ b/README.md @@ -168,6 +168,7 @@ The following tools exploit dcm2niix - [divest](https://github.com/jonclayden/divest) R interface to dcm2niix. - [DPABI Data Processing & Analysis for Brain Imaging](http://rfmri.org/dpabi) includes dcm2niix. - [ExploreASL](https://sites.google.com/view/exploreasl/exploreasl) uses dcm2niix to import images. + - [ExploreASL-GUI](https://github.com/MauricePasternak/ExploreASL-GUI) uses dcm2niix for image conversion. - [ezBIDS](https://github.com/brainlife/ezbids) is a [web service](https://brainlife.io/ezbids/) for converting directory full of DICOM images into BIDS without users having to learn python nor custom configuration file. - [fmrif tools](https://github.com/nih-fmrif/fmrif_tools) uses dcm2niix for its [oxy2bids](https://fmrif-tools.readthedocs.io/en/latest/#) tool. - [fMRIprep.dcm2niix](https://github.com/BrettNordin/fMRIprep.dcm2niix) is designed to convert DICOM format to the NIfTI format. diff --git a/Siemens/README.md b/Siemens/README.md index d4ccf048..3e883205 100644 --- a/Siemens/README.md +++ b/Siemens/README.md @@ -6,7 +6,7 @@ dcm2niix attempts to convert Siemens DICOM format images to NIfTI. This page des Siemens MR is named by Series, Generation, Major Version and Minor Version. Prior to the Siemens Vida, all contemporary Siemens MRI systems (Trio, Prisma, Skyra, etc) were part of the V series. So a Trio might be on VB17, and a Prisma on VE11 (series 'V', generation 'E', major version '1', minor version '1'). The 3T Vida and 1.5T Sola introduce the X-series (XA10, XA11, XA20). Since the V-series was dominant for so long, most users simply omit the series, e.g. referring to a system as `B19`. However, Siemens has recently introduced a new X-series. -The DICOM images exported by the X-series is radically different than the V-series. The images lack the proprietary CSA header with its rich meta data. +The DICOM images exported by the X-series is [radically different](https://wikis.utexas.edu/display/IRC/New+Enhanced+DICOM+format) than the V-series. The images lack the proprietary CSA header with its rich meta data. X-series users are strongly encouraged to export data using the "Enhanced" format and to not use any of the "Anonymize" features on the console. The consequences of these options is discussed in detail in [issue 236](https://github.com/rordenlab/dcm2niix/issues/236). Siemens notes `We highly recommend that the Enhanced DICOM format be used. This is because this format retains far more information in the header`. Failure to export data in this format has led to catastrophic data loss for numerous users (for publicly reported details see issues [203](https://github.com/rordenlab/dcm2niix/issues/203), [236](https://github.com/rordenlab/dcm2niix/issues/236), [240](https://github.com/rordenlab/dcm2niix/issues/240), [274](https://github.com/rordenlab/dcm2niix/issues/274), [303](https://github.com/rordenlab/dcm2niix/issues/303), [370](https://github.com/rordenlab/dcm2niix/issues/370), [394](https://github.com/rordenlab/dcm2niix/issues/394)). This reflects limitations of the DICOM data, not dcm2niix. diff --git a/console/nii_dicom.cpp b/console/nii_dicom.cpp index ae280ebe..cd4c64fb 100644 --- a/console/nii_dicom.cpp +++ b/console/nii_dicom.cpp @@ -662,9 +662,9 @@ int headerDcm2NiiSForm(struct TDICOMdata d, struct TDICOMdata d2, struct nifti_1 d.orient[1] = 1.0f; d.orient[2] = 0.0f; d.orient[3] = 0.0f; - d.orient[1] = 0.0f; - d.orient[2] = 1.0f; - d.orient[3] = 0.0f; + d.orient[4] = 0.0f; + d.orient[5] = 1.0f; + d.orient[6] = 0.0f; if ((d.isDerived) || ((d.bitsAllocated == 8) && (d.samplesPerPixel == 3) && (d.manufacturer == kMANUFACTURER_SIEMENS))) { printMessage("Unable to determine spatial orientation: 0020,0037 missing (probably not a problem: derived image)\n"); } else { From cf828a1bace637fa2a5720cccebc049cd1186afe Mon Sep 17 00:00:00 2001 From: neurolabusc Date: Sat, 14 Jan 2023 16:38:55 -0500 Subject: [PATCH 47/85] SliceTimes for XA30 MFSPLIT, fewer warnings for derived data (https://github.com/rordenlab/dcm2niix/issues/236) --- console/nii_dicom.cpp | 2 +- console/nii_dicom.h | 2 +- console/nii_dicom_batch.cpp | 28 ++++++++++++++++++---------- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/console/nii_dicom.cpp b/console/nii_dicom.cpp index cd4c64fb..eaef224f 100644 --- a/console/nii_dicom.cpp +++ b/console/nii_dicom.cpp @@ -6046,7 +6046,7 @@ const uint32_t kEffectiveTE = 0x0018 + (0x9082 << 16); break; d.CSA.sliceTiming[acquisitionTimesGE_UIH] = dcmStrFloat(lLength, &buffer[lPos]); d.CSA.sliceTiming[acquisitionTimesGE_UIH] *= 1000.0; //convert sec to msec - //printf("x\t%d\t%g\tkTimeAfterStart\n", acquisitionTimesGE_UIH, d.CSA.sliceTiming[acquisitionTimesGE_UIH]); + //printf("\t%d\t%g\tTimeAfterStart(0021,1104)\n", d.imageNum, d.CSA.sliceTiming[acquisitionTimesGE_UIH]); acquisitionTimesGE_UIH++; break; case kICE_dims: { //issue568: LO (0021,1106) [X_4_1_1_1_1_160_1_1_1_1_1_277] diff --git a/console/nii_dicom.h b/console/nii_dicom.h index 91545570..57aca93d 100644 --- a/console/nii_dicom.h +++ b/console/nii_dicom.h @@ -50,7 +50,7 @@ extern "C" { #define kCPUsuf " " //unknown CPU #endif -#define kDCMdate "v1.0.20221217" +#define kDCMdate "v1.0.20230101" #define kDCMvers kDCMdate " " kJP2suf kLSsuf kCCsuf kCPUsuf static const int kMaxEPI3D = 1024; //maximum number of EPI images in Siemens Mosaic diff --git a/console/nii_dicom_batch.cpp b/console/nii_dicom_batch.cpp index ee9b0d5b..6e750b79 100644 --- a/console/nii_dicom_batch.cpp +++ b/console/nii_dicom_batch.cpp @@ -390,7 +390,7 @@ void siemensPhilipsCorrectBvecs(struct TDICOMdata *d, int sliceDir, struct TDTI for (int i = 0; i < d->CSA.numDti; i++) { float vLen = sqrt((vx[i].V[1] * vx[i].V[1]) + (vx[i].V[2] * vx[i].V[2]) + (vx[i].V[3] * vx[i].V[3])); if ((vx[i].V[0] <= FLT_EPSILON) || (vLen <= FLT_EPSILON)) { //bvalue=0 - if (vx[i].V[0] > 5.0) //Philip stores n.b. UIH B=1.25126 Vec=0,0,0 while Philips stored isotropic images + if ((vx[i].V[0] > 5.0) && (!d->isDerived)) //Philip stores n.b. UIH B=1.25126 Vec=0,0,0 while Philips stored isotropic images printWarning("Volume %d appears to be derived image ADC/Isotropic (non-zero b-value with zero vector length)\n", i); continue; //do not normalize or reorient b0 vectors } //if bvalue=0 @@ -2222,6 +2222,7 @@ int *nii_saveDTI(char pathoutname[], int nConvert, struct TDCMsort dcmSort[], st #endif //https://github.com/rordenlab/dcm2niix/issues/352 bool allB0 = dcmList[indx0].isDiffusion; + bool isDerived = dcmList[indx0].isDerived; if (dcmList[indx0].isDerived) allB0 = false; //e.g. FA map if ((numDti == numVol) && (numDti > 1)) @@ -2351,11 +2352,13 @@ int *nii_saveDTI(char pathoutname[], int nConvert, struct TDCMsort dcmSort[], st for (int i = 0; i < numDti; i++) if (vx[i].V[0] > maxB0) maxB0 = vx[i].V[0]; - //for CMRR sequences unweighted volumes are not actually B=0 but they have B near zero - if (minB0 > 50) - printWarning("This diffusion series does not have a B0 (reference) volume\n"); - if ((!opts.isSortDTIbyBVal) && (minB0idx > 0)) - printMessage("Note: B0 not the first volume in the series (FSL eddy reference volume is %d)\n", minB0idx); + if (!isDerived) { //no warnings for derived data + //for CMRR sequences unweighted volumes are not actually B=0 but they have B near zero + if (minB0 > 50) + printWarning("This diffusion series does not have a B0 (reference) volume\n"); + if ((!opts.isSortDTIbyBVal) && (minB0idx > 0)) + printMessage("Note: B0 not the first volume in the series (FSL eddy reference volume is %d)\n", minB0idx); + } float kADCval = maxB0 + 1; //mark as unusual *numADC = 0; bvals = (float *)malloc(numDti * sizeof(float)); @@ -5886,6 +5889,10 @@ void checkSliceTiming(struct TDICOMdata *d, struct TDICOMdata *d1, int verbose, if ((minT1 < 0.0) && (d->rtia_timerGE >= 0.0)) return; //use rtia timer if (minT1 < 0.0) { //https://github.com/neurolabusc/MRIcroGL/issues/31 + if (d->isDerived) { //slice timing not relevant for derived data, values mangled with Siemens XA30 + d->CSA.sliceTiming[0] = -1.0; + return; + } if (d->modality == kMODALITY_MR) printWarning("Siemens MoCo? Bogus slice timing (range %g..%g, TR=%g seconds)\n", minT1, maxT1, TRms); return; @@ -5909,10 +5916,10 @@ void sliceTimingXA(struct TDCMsort *dcmSort, struct TDICOMdata *dcmList, struct // Ignore first volume: For an example of erroneous first volume timing, see series 10 (Functional_w_SMS=3) https://github.com/rordenlab/dcm2niix/issues/240 // an alternative would be to use 0018,9074 - this would need to be converted from DT to Secs, and is scrambled if de-identifies data see enhanced de-identified series 26 from issue 236 uint64_t indx0 = dcmSort[0].indx; //first volume - if ((!dcmList[indx0].isXA10A) || (hdr->dim[3] < 1)) + if ((!dcmList[indx0].isXA10A) || (hdr->dim[3] < 1) || (hdr->dim[4] < 1)) return; - if ((nConvert == (hdr->dim[3] * hdr->dim[4])) && (hdr->dim[3] < (kMaxEPI3D - 1)) && (hdr->dim[3] > 1) && (hdr->dim[4] > 1)) { - //XA11 2D classic + if ((nConvert == (hdr->dim[3] * hdr->dim[4])) && (hdr->dim[3] < (kMaxEPI3D - 1)) && (hdr->dim[3] > 1)) { + //XA11 2D classic: nb XA30 in `MFSPLIT` will save each 3D volume from 4D timeseries as a unique series number! for (int v = 0; v < hdr->dim[3]; v++) dcmList[indx0].CSA.sliceTiming[v] = dcmList[dcmSort[v].indx].CSA.sliceTiming[0]; } else if ((nConvert == (hdr->dim[4])) && (hdr->dim[3] < (kMaxEPI3D - 1)) && (hdr->dim[3] > 1) && (hdr->dim[4] > 1)) { @@ -6640,6 +6647,7 @@ int saveDcm2NiiCore(int nConvert, struct TDCMsort dcmSort[], struct TDICOMdata d //printMessage(" %d %d %d %d %lu\n", hdr0.dim[1], hdr0.dim[2], hdr0.dim[3], hdr0.dim[4], (unsigned long)[imgM length]); bool isHasOverlay = dcmList[indx0].isHasOverlay; + bool isDerived = dcmList[indx0].isDerived; if (nConvert > 1) { //next: detect trigger time see example https://www.slicer.org/wiki/Documentation/4.4/Modules/MultiVolumeExplorer double triggerDx = dcmList[dcmSort[nConvert - 1].indx].triggerDelayTime - dcmList[indx0].triggerDelayTime; @@ -6693,7 +6701,7 @@ int saveDcm2NiiCore(int nConvert, struct TDCMsort dcmSort[], struct TDICOMdata d } } } - if (nAcq != nSamePos) + if ((nAcq != nSamePos) && (!isDerived)) //Siemens Derived FA-RGB images have bogus spatial data printWarning("Expected %d volumes but found spatial position repeats %d times.\n", nAcq, nSamePos); //end validate number of spatial volumes if ((nAcq > 1) && ((nConvert / nAcq) > 1) && ((nConvert % nAcq) == 0)) { From f7c2e0346d84d6f6fd367b5f65cd69a7b95e7b12 Mon Sep 17 00:00:00 2001 From: neurolabusc Date: Wed, 18 Jan 2023 11:03:02 -0500 Subject: [PATCH 48/85] Read more tags from XA30 interoperability mode (https://github.com/rordenlab/dcm2niix/issues/236) --- BIDS/README.md | 6 +++--- console/nii_dicom.cpp | 11 ++++++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/BIDS/README.md b/BIDS/README.md index 601e8844..03006111 100644 --- a/BIDS/README.md +++ b/BIDS/README.md @@ -142,7 +142,7 @@ Fields specific to MRI scans. | FlipAngle | deg | DICOM tag 0018,1314 | B | | VariableFlipAngleFlag | b | DICOM tag 0018,1315 | D | | ImageOrientationPatientDICOM | | DICOM tag 0020,0037 | D | -| ImagingFrequency | MHz | DICOM tag 0018,0084 | D | +| ImagingFrequency | MHz | DICOM tag 0018,0084 or 0018,9098 | D | | InPlanePhaseEncodingDirectionDICOM | | DICOM tag 0018,1312 | D | | InversionTime | s | DICOM tag 0018,0082 | B | | MagneticFieldStrength | T | DICOM tag 0018,0087 | B | @@ -158,13 +158,13 @@ Fields specific to MRI scans. | PercentSampling | | DICOM tag 0018,0093 | D | | PhaseEncodingAxis | | When polarity unknown | B | | PhaseEncodingDirection | | When polarity known | B | -| PhaseEncodingSteps | | DICOM tag 0018,0089 | D | +| PhaseEncodingSteps | | DICOM tag 0018,0089 or 0018,9231 | D | | PixelBandwidth | Hz | DICOM tag 0018,0095 | D | | ReceiveCoilName | | DICOM tag 0018,1250 | B | | RepetitionTime | s | DICOM tag 0018,0080 | B | | RepetitionTimeExcitation | s | DICOM tag 0018, 0080 for some manufacturers | B | | RepetitionTimeInversion | s | | D | -| SAR | | DICOM tag 0018,1316 | D | +| SAR | | DICOM tag 0018,1316 or 0018,9181 | D | | SliceThickness | mm | [nb](http://dclunie.blogspot.com/2013/10/how-thick-am-i-sad-story-of-lonely-slice.html) | D | | SliceTiming | s | | B | | SpacingBetweenSlices | mm | [nb](http://dclunie.blogspot.com/2013/10/how-thick-am-i-sad-story-of-lonely-slice.html) | D | diff --git a/console/nii_dicom.cpp b/console/nii_dicom.cpp index eaef224f..225d8b66 100644 --- a/console/nii_dicom.cpp +++ b/console/nii_dicom.cpp @@ -4321,7 +4321,7 @@ struct TDICOMdata readDICOMx(char *fname, struct TDCMprefs *prefs, struct TDTI4D #define kEchoNum 0x0018 + (0x0086 << 16) //IS #define kMagneticFieldStrength 0x0018 + (0x0087 << 16) //DS #define kZSpacing 0x0018 + (0x0088 << 16) //'DS' 'SpacingBetweenSlices' -#define kPhaseEncodingSteps 0x0018 + (0x0089 << 16) //'IS' +#define kPhaseEncodingSteps 0x0018 + (0x0089 << 16) //IS #define kEchoTrainLength 0x0018 + (0x0091 << 16) //IS #define kPercentSampling 0x0018 + (0x0093 << 16) //'DS' #define kPhaseFieldofView 0x0018 + (0x0094 << 16) //'DS' @@ -4366,8 +4366,9 @@ const uint32_t kEffectiveTE = 0x0018 + (0x9082 << 16); //#define kDiffusionBFactorSiemens 0x0019+(0x100C<< 16 ) // 0019;000C;SIEMENS MR HEADER;B_value #define kDiffusion_bValue 0x0018 + uint32_t(0x9087 << 16) // FD #define kDiffusionOrientation 0x0018 + uint32_t(0x9089 << 16) // FD, seen in enhanced DICOM from Philips 5.* and Siemens XA10. -#define kImagingFrequency2 0x0018 + uint32_t(0x9098 << 16) //FD +#define kImagingFrequencyFD 0x0018 + uint32_t(0x9098 << 16) //FD #define kParallelReductionFactorOutOfPlane 0x0018 + uint32_t(0x9155 << 16) //FD +#define kSARFD 0x0018 + (0x9181 << 16) //FD //#define kFrameAcquisitionDuration 0x0018+uint32_t(0x9220 << 16 ) //FD #define kArterialSpinLabelingContrast 0x0018 + uint32_t(0x9250 << 16) //CS #define kASLPulseTrainDuration 0x0018 + uint32_t(0x9258 << 16) //UL @@ -6657,7 +6658,7 @@ const uint32_t kEffectiveTE = 0x0018 + (0x9082 << 16); set_orientation0018_9089(&volDiffusion, lLength, &buffer[lPos], d.isLittleEndian); } break; - case kImagingFrequency2: + case kImagingFrequencyFD: d.imagingFrequency = dcmFloatDouble(lLength, &buffer[lPos], d.isLittleEndian); break; case kParallelReductionFactorOutOfPlane: @@ -6665,6 +6666,10 @@ const uint32_t kEffectiveTE = 0x0018 + (0x9082 << 16); break; d.accelFactOOP = dcmFloatDouble(lLength, &buffer[lPos], d.isLittleEndian); break; + case kSARFD: + //see issue668 + //d.SAR = dcmFloatDouble(lLength, &buffer[lPos], d.isLittleEndian); + break; //case kFrameAcquisitionDuration : // frameAcquisitionDuration = dcmFloatDouble(lLength, &buffer[lPos], d.isLittleEndian); //issue369 // break; From 8953578f40faf1d1b32d960744e4352361946f69 Mon Sep 17 00:00:00 2001 From: neurolabusc Date: Wed, 18 Jan 2023 12:59:57 -0500 Subject: [PATCH 49/85] Force constants to use UINT32 --- console/nii_dicom.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/console/nii_dicom.cpp b/console/nii_dicom.cpp index 225d8b66..18ee13fa 100644 --- a/console/nii_dicom.cpp +++ b/console/nii_dicom.cpp @@ -4362,13 +4362,13 @@ struct TDICOMdata readDICOMx(char *fname, struct TDCMprefs *prefs, struct TDTI4D #define kParallelAcquisitionTechnique 0x0018 + uint32_t(0x9078 << 16) //CS: SENSE, SMASH #define kInversionTimes 0x0018 + uint32_t(0x9079 << 16) //FD #define kPartialFourier 0x0018 + uint32_t(0x9081 << 16) //CS -const uint32_t kEffectiveTE = 0x0018 + (0x9082 << 16); +const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); //#define kDiffusionBFactorSiemens 0x0019+(0x100C<< 16 ) // 0019;000C;SIEMENS MR HEADER;B_value #define kDiffusion_bValue 0x0018 + uint32_t(0x9087 << 16) // FD #define kDiffusionOrientation 0x0018 + uint32_t(0x9089 << 16) // FD, seen in enhanced DICOM from Philips 5.* and Siemens XA10. #define kImagingFrequencyFD 0x0018 + uint32_t(0x9098 << 16) //FD #define kParallelReductionFactorOutOfPlane 0x0018 + uint32_t(0x9155 << 16) //FD -#define kSARFD 0x0018 + (0x9181 << 16) //FD +#define kSARFD 0x0018 + uint32_t(0x9181 << 16) //FD //#define kFrameAcquisitionDuration 0x0018+uint32_t(0x9220 << 16 ) //FD #define kArterialSpinLabelingContrast 0x0018 + uint32_t(0x9250 << 16) //CS #define kASLPulseTrainDuration 0x0018 + uint32_t(0x9258 << 16) //UL From 337de3657acdd19cea107a3f3193880705669ac5 Mon Sep 17 00:00:00 2001 From: neurolabusc Date: Sat, 21 Jan 2023 15:25:30 -0500 Subject: [PATCH 50/85] Improve XA30 support --- console/nii_dicom.cpp | 11 +++++++--- console/nii_dicom.h | 2 +- console/nii_dicom_batch.cpp | 42 +++++++++++++++++++------------------ 3 files changed, 31 insertions(+), 24 deletions(-) diff --git a/console/nii_dicom.cpp b/console/nii_dicom.cpp index 18ee13fa..609c99dc 100644 --- a/console/nii_dicom.cpp +++ b/console/nii_dicom.cpp @@ -4564,12 +4564,13 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); // https://github.com/dcm4che/dcm4che/blob/master/dcm4che-dict/src/main/dicom3tools/libsrc/standard/elmdict/siemens.tpl // https://github.com/neurolabusc/dcm_qa_agfa // http://dicom.nema.org/medical/dicom/current/output/chtml/part05/sect_7.8.html -#define kMaxRemaps 16 //no vendor uses more than 5 private creator groups + #define kMaxRemaps 16 //no vendor uses more than 5 private creator groups //we need to keep track of multiple remappings, e.g. issue 437 2005,0014->2005,0012; 2005,0015->2005,0011 int nRemaps = 0; uint32_t privateCreatorMasks[kMaxRemaps]; //0 -> none uint32_t privateCreatorRemaps[kMaxRemaps]; //0 -> none #endif + double maxSAR = -INFINITY; double TE = 0.0; //most recent echo time recorded float temporalResolutionMS = 0.0; float MRImageDynamicScanBeginTime = 0.0; @@ -5908,6 +5909,7 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); break; case kSAR: d.SAR = dcmStrFloat(lLength, &buffer[lPos]); + maxSAR = fmax(maxSAR, d.SAR); break; case kStudyID: dcmStr(lLength, &buffer[lPos], d.studyID); @@ -6667,8 +6669,9 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); d.accelFactOOP = dcmFloatDouble(lLength, &buffer[lPos], d.isLittleEndian); break; case kSARFD: - //see issue668 - //d.SAR = dcmFloatDouble(lLength, &buffer[lPos], d.isLittleEndian); + //Siemens XA uses kSARFD instead of kSAR + d.SAR = dcmFloatDouble(lLength, &buffer[lPos], d.isLittleEndian); + maxSAR = fmax(maxSAR, d.SAR); break; //case kFrameAcquisitionDuration : // frameAcquisitionDuration = dcmFloatDouble(lLength, &buffer[lPos], d.isLittleEndian); //issue369 @@ -7923,6 +7926,8 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); d.rawDataRunNumber = philMRImageDiffVolumeNumber; d.phaseNumber = 0; } + //issue 668: several SAR levels for different regions (IEC_HEAD, IEC_LOCAL, etc) + 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 (hasDwiDirectionality) diff --git a/console/nii_dicom.h b/console/nii_dicom.h index 57aca93d..6cfe9dc9 100644 --- a/console/nii_dicom.h +++ b/console/nii_dicom.h @@ -50,7 +50,7 @@ extern "C" { #define kCPUsuf " " //unknown CPU #endif -#define kDCMdate "v1.0.20230101" +#define kDCMdate "v1.0.20230121" #define kDCMvers kDCMdate " " kJP2suf kLSsuf kCCsuf kCPUsuf static const int kMaxEPI3D = 1024; //maximum number of EPI images in Siemens Mosaic diff --git a/console/nii_dicom_batch.cpp b/console/nii_dicom_batch.cpp index 6e750b79..d7aba225 100644 --- a/console/nii_dicom_batch.cpp +++ b/console/nii_dicom_batch.cpp @@ -712,13 +712,10 @@ void siemensCsaAscii(const char *filename, TCsaAscii *csaAscii, int csaOffset, i if ((int)result != csaLength) return; fclose(pFile); - //next bit complicated: restrict to ASCII portion to avoid buffer overflow errors in BINARY portion int startAscii = phoenixOffsetCSASeriesHeader((unsigned char *)buffer, csaLength); - if (startAscii == EXIT_FAILURE) { - free(buffer); - return; - } + //n.b. previous function parses binary V* "SV10" portion of header + // it will return "EXIT_FAILURE for text based X* "" int csaLengthTrim = csaLength; char *bufferTrim = buffer; if ((startAscii > 0) && (startAscii < csaLengthTrim)) { //ignore binary data at start @@ -1475,6 +1472,7 @@ tse3d: T2*/ json_Float(fp, "\t\"SliceThickness\": %g,\n", d.zThick); json_Float(fp, "\t\"SpacingBetweenSlices\": %g,\n", d.zSpacing); } + //if (!opts.isAnonymizeBIDS) //issue668 is SAR identifiable?? json_Float(fp, "\t\"SAR\": %g,\n", d.SAR); if (d.numberOfAverages > 1.0) json_Float(fp, "\t\"NumberOfAverages\": %g,\n", d.numberOfAverages); @@ -5911,6 +5909,22 @@ void checkSliceTiming(struct TDICOMdata *d, struct TDICOMdata *d1, int verbose, printMessage("CSA slice timing based on 2nd volume, 1st volume corrupted (CMRR bug, range %g..%g, TR=%g ms)\n", minT, maxT, TRms); } //checkSliceTiming() +void setMultiBandFactor(int dim3, uint64_t indx0, struct TDICOMdata *dcmList) { + float mn = dcmList[indx0].CSA.sliceTiming[0]; + //first pass: find minimum + for (int v = 0; v < dim3; v++) + mn = fminf(dcmList[indx0].CSA.sliceTiming[v],mn); + //second pass: all times relative to min (i.e. make min = 0) + int mb = 0; + for (int v = 0; v < dim3; v++) { + dcmList[indx0].CSA.sliceTiming[v] -= mn; + if (isSameFloatGE(dcmList[indx0].CSA.sliceTiming[v], 0.0)) + mb++; + } + if ((dcmList[indx0].CSA.multiBandFactor < 2) && (mb > 1)) + dcmList[indx0].CSA.multiBandFactor = mb; +} // setMultiBandFactor() + void sliceTimingXA(struct TDCMsort *dcmSort, struct TDICOMdata *dcmList, struct nifti_1_header *hdr, int verbose, const char *filename, int nConvert) { //Siemens XA10 slice timing // Ignore first volume: For an example of erroneous first volume timing, see series 10 (Functional_w_SMS=3) https://github.com/rordenlab/dcm2niix/issues/240 @@ -5922,25 +5936,13 @@ void sliceTimingXA(struct TDCMsort *dcmSort, struct TDICOMdata *dcmList, struct //XA11 2D classic: nb XA30 in `MFSPLIT` will save each 3D volume from 4D timeseries as a unique series number! for (int v = 0; v < hdr->dim[3]; v++) dcmList[indx0].CSA.sliceTiming[v] = dcmList[dcmSort[v].indx].CSA.sliceTiming[0]; + setMultiBandFactor(hdr->dim[3], indx0, dcmList); } else if ((nConvert == (hdr->dim[4])) && (hdr->dim[3] < (kMaxEPI3D - 1)) && (hdr->dim[3] > 1) && (hdr->dim[4] > 1)) { //XA10 mosaics - these are missing a lot of information - float mn = dcmList[dcmSort[1].indx].CSA.sliceTiming[0]; //get slice timing from second volume - for (int v = 0; v < hdr->dim[3]; v++) { + for (int v = 0; v < hdr->dim[3]; v++) dcmList[indx0].CSA.sliceTiming[v] = dcmList[dcmSort[1].indx].CSA.sliceTiming[v]; - if (dcmList[indx0].CSA.sliceTiming[v] < mn) - mn = dcmList[indx0].CSA.sliceTiming[v]; - } - if (mn < 0.0) - mn = 0.0; - int mb = 0; - for (int v = 0; v < hdr->dim[3]; v++) { - dcmList[indx0].CSA.sliceTiming[v] -= mn; - if (isSameFloatGE(dcmList[indx0].CSA.sliceTiming[v], 0.0)) - mb++; - } - if ((dcmList[indx0].CSA.multiBandFactor < 2) && (mb > 1)) - dcmList[indx0].CSA.multiBandFactor = mb; + setMultiBandFactor(hdr->dim[3], indx0, dcmList); return; //we have subtracted min } //issue429: subtract min From 1d4413e9609a8b5064c878572713d174fc861d64 Mon Sep 17 00:00:00 2001 From: neurolabusc Date: Sat, 21 Jan 2023 15:31:00 -0500 Subject: [PATCH 51/85] Lack of slice timing does not imply multiband --- console/nii_dicom_batch.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/console/nii_dicom_batch.cpp b/console/nii_dicom_batch.cpp index d7aba225..3eee9294 100644 --- a/console/nii_dicom_batch.cpp +++ b/console/nii_dicom_batch.cpp @@ -5921,7 +5921,7 @@ void setMultiBandFactor(int dim3, uint64_t indx0, struct TDICOMdata *dcmList) { if (isSameFloatGE(dcmList[indx0].CSA.sliceTiming[v], 0.0)) mb++; } - if ((dcmList[indx0].CSA.multiBandFactor < 2) && (mb > 1)) + if ((dcmList[indx0].CSA.multiBandFactor < 2) && (mb > 1) && (mb < dim3)) dcmList[indx0].CSA.multiBandFactor = mb; } // setMultiBandFactor() From e53c23038a1d137712c9ed3d8809c5be6baffb0a Mon Sep 17 00:00:00 2001 From: neurolabusc Date: Sun, 29 Jan 2023 08:34:58 -0500 Subject: [PATCH 52/85] New encodingSteps, clean up OutOfPlane (https://github.com/rordenlab/dcm2niix/issues/671, https://github.com/rordenlab/dcm2niix/issues/672) --- BIDS/README.md | 8 ++++++-- console/nii_dicom.cpp | 21 ++++++++++++++++----- console/nii_dicom.h | 4 ++-- console/nii_dicom_batch.cpp | 18 +++++++++++++----- 4 files changed, 37 insertions(+), 14 deletions(-) diff --git a/BIDS/README.md b/BIDS/README.md index 03006111..c480e74e 100644 --- a/BIDS/README.md +++ b/BIDS/README.md @@ -152,19 +152,22 @@ Fields specific to MRI scans. | NumberOfAverages | | DICOM tag 0018,0083 | D | | ParallelAcquisitionTechnique | | DICOM tag 0018, 9078, aka `SENSE`, `GRAPPA` | B | | ParallelReductionFactorInPlane | | DICOM tag 0018,9069 | B | +| ParallelReductionFactorOutOfPlane | | DICOM tag 0018,9069 | B | | ParallelReductionOutOfPlane | | DICOM tag 0018,9155 | D | | PartialFourierDirection | | DICOM tag 0018,9036 | B | | PercentPhaseFOV | | DICOM tag 0018,0094 | D | | PercentSampling | | DICOM tag 0018,0093 | D | | PhaseEncodingAxis | | When polarity unknown | B | | PhaseEncodingDirection | | When polarity known | B | -| PhaseEncodingSteps | | DICOM tag 0018,0089 or 0018,9231 | D | +| FrequencyEncodingSteps | | DICOM tag 0018,9058 | D | +| PhaseEncodingSteps | | DICOM tag 0018,0089 or 0018,9231 aka PhaseEncodingStepsInPlane | D | +| PhaseEncodingStepsOutOfPlane | | DICOM tag 0018,9232 | D | | PixelBandwidth | Hz | DICOM tag 0018,0095 | D | | ReceiveCoilName | | DICOM tag 0018,1250 | B | | RepetitionTime | s | DICOM tag 0018,0080 | B | | RepetitionTimeExcitation | s | DICOM tag 0018, 0080 for some manufacturers | B | | RepetitionTimeInversion | s | | D | -| SAR | | DICOM tag 0018,1316 or 0018,9181 | D | +| SAR | | DICOM tag 0018,1316 or 0018,9181 defined by 0018,9179 | D | | SliceThickness | mm | [nb](http://dclunie.blogspot.com/2013/10/how-thick-am-i-sad-story-of-lonely-slice.html) | D | | SliceTiming | s | | B | | SpacingBetweenSlices | mm | [nb](http://dclunie.blogspot.com/2013/10/how-thick-am-i-sad-story-of-lonely-slice.html) | D | @@ -333,6 +336,7 @@ Fields specific to [Siemens XA-series](https://github.com/rordenlab/dcm2niix/tre | PostLabelDelay | s | DICOM tag 0018,9258 | D | | NonlinearGradientCorrection | b | 0008,0008 or 0021,1175 | B | | PhaseEncodingDirection | | polarity from 0021,111c | B | +| SpoilingState | | 0021,105B | B | ### Manufacturer UIH diff --git a/console/nii_dicom.cpp b/console/nii_dicom.cpp index 609c99dc..a4077965 100644 --- a/console/nii_dicom.cpp +++ b/console/nii_dicom.cpp @@ -835,6 +835,8 @@ struct TDICOMdata clear_dicom_data() { d.protocolBlockStartGE = 0; d.protocolBlockLengthGE = 0; d.phaseEncodingSteps = 0; + d.frequencyEncodingSteps = 0; + d.phaseEncodingStepsOutOfPlane = 0; d.coilCrc = 0; d.seriesUidCrc = 0; d.instanceUidCrc = 0; @@ -4355,6 +4357,7 @@ struct TDICOMdata readDICOMx(char *fname, struct TDCMprefs *prefs, struct TDTI4D #define kRectilinearPhaseEncodeReordering 0x0018 + uint32_t(0x9034 << 16) //'CS' 'REVERSE_LINEAR'/'LINEAR' #define kPartialFourierDirection 0x0018 + uint32_t(0x9036 << 16) //'CS' #define kCardiacSynchronizationTechnique 0x0018 + uint32_t(0x9037 << 16) //'CS' +#define kMRAcquisitionFrequencyEncodingSteps 0x0018 + uint32_t(0x9058 << 16) //US #define kParallelReductionFactorInPlane 0x0018 + uint32_t(0x9069 << 16) //FD #define kAcquisitionDuration 0x0018 + uint32_t(0x9073 << 16) //FD #define kFrameAcquisitionDateTime 0x0018+uint32_t(0x9074<< 16 ) //DT "20181019212528.232500" @@ -4367,8 +4370,11 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); #define kDiffusion_bValue 0x0018 + uint32_t(0x9087 << 16) // FD #define kDiffusionOrientation 0x0018 + uint32_t(0x9089 << 16) // FD, seen in enhanced DICOM from Philips 5.* and Siemens XA10. #define kImagingFrequencyFD 0x0018 + uint32_t(0x9098 << 16) //FD +#define kMREchoSequence 0x0018 + uint32_t(0x9114 << 16) //SQ #define kParallelReductionFactorOutOfPlane 0x0018 + uint32_t(0x9155 << 16) //FD #define kSARFD 0x0018 + uint32_t(0x9181 << 16) //FD +#define kMRAcquisitionPhaseEncodingStepsInPlane 0x0018 + uint32_t(0x9231 << 16) //US +#define kMRAcquisitionPhaseEncodingStepsOutOfPlane 0x0018 + uint32_t(0x9232 << 16) //US //#define kFrameAcquisitionDuration 0x0018+uint32_t(0x9220 << 16 ) //FD #define kArterialSpinLabelingContrast 0x0018 + uint32_t(0x9250 << 16) //CS #define kASLPulseTrainDuration 0x0018 + uint32_t(0x9258 << 16) //UL @@ -4378,8 +4384,6 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); #define kDiffusionBValueYY 0x0018 + uint32_t(0x9605 << 16) //FD #define kDiffusionBValueYZ 0x0018 + uint32_t(0x9606 << 16) //FD #define kDiffusionBValueZZ 0x0018 + uint32_t(0x9607 << 16) //FD -#define kMREchoSequence 0x0018 + uint32_t(0x9114 << 16) //SQ -#define kMRAcquisitionPhaseEncodingStepsInPlane 0x0018 + uint32_t(0x9231 << 16) //US #define kNumberOfImagesInMosaic 0x0019 + (0x100A << 16) //US NumberOfImagesInMosaic //https://nmrimaging.wordpress.com/2011/12/20/when-we-process/ // https://nciphub.org/groups/qindicom/wiki/DiffusionrelatedDICOMtags:experienceacrosssites?action=pdf @@ -5686,7 +5690,13 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); sqDepth00189114 = sqDepth - 1; break; case kMRAcquisitionPhaseEncodingStepsInPlane: - d.phaseEncodingLines = dcmInt(lLength, &buffer[lPos], d.isLittleEndian); + d.phaseEncodingSteps = dcmInt(lLength, &buffer[lPos], d.isLittleEndian); + break; + case kMRAcquisitionFrequencyEncodingSteps: + d.frequencyEncodingSteps = dcmInt(lLength, &buffer[lPos], d.isLittleEndian); + break; + case kMRAcquisitionPhaseEncodingStepsOutOfPlane: + d.phaseEncodingStepsOutOfPlane = dcmInt(lLength, &buffer[lPos], d.isLittleEndian); break; case kNumberOfImagesInMosaic: if (d.manufacturer == kMANUFACTURER_SIEMENS) @@ -6670,8 +6680,9 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); break; case kSARFD: //Siemens XA uses kSARFD instead of kSAR - d.SAR = dcmFloatDouble(lLength, &buffer[lPos], d.isLittleEndian); - maxSAR = fmax(maxSAR, d.SAR); + // ignore as we also need to know the definition issue 668 + //d.SAR = dcmFloatDouble(lLength, &buffer[lPos], d.isLittleEndian); + //maxSAR = fmax(maxSAR, d.SAR); break; //case kFrameAcquisitionDuration : // frameAcquisitionDuration = dcmFloatDouble(lLength, &buffer[lPos], d.isLittleEndian); //issue369 diff --git a/console/nii_dicom.h b/console/nii_dicom.h index 6cfe9dc9..4b8328f4 100644 --- a/console/nii_dicom.h +++ b/console/nii_dicom.h @@ -50,7 +50,7 @@ extern "C" { #define kCPUsuf " " //unknown CPU #endif -#define kDCMdate "v1.0.20230121" +#define kDCMdate "v1.0.20230127" #define kDCMvers kDCMdate " " kJP2suf kLSsuf kCCsuf kCPUsuf static const int kMaxEPI3D = 1024; //maximum number of EPI images in Siemens Mosaic @@ -235,7 +235,7 @@ static const uint8_t MAX_NUMBER_OF_DIMENSIONS = 8; int xyzDim[5]; uint32_t coilCrc, seriesUidCrc, instanceUidCrc; int overlayStart[kMaxOverlay]; - int postLabelDelay, shimGradientX, shimGradientY, shimGradientZ, phaseNumber, spoiling, mtState, partialFourierDirection, interp3D, aslFlags, durationLabelPulseGE, epiVersionGE, internalepiVersionGE, maxEchoNumGE, rawDataRunNumber, numberOfImagesInGridUIH, numberOfDiffusionT2GE, numberOfDiffusionDirectionGE, tensorFileGE, diffCyclingModeGE, phaseEncodingGE, protocolBlockStartGE, protocolBlockLengthGE, modality, dwellTime, effectiveEchoSpacingGE, phaseEncodingLines, phaseEncodingSteps, echoTrainLength, echoNum, sliceOrient, manufacturer, converted2NII, acquNum, imageNum, imageStart, imageBytes, bitsStored, bitsAllocated, samplesPerPixel,locationsInAcquisition, locationsInAcquisitionConflict, compressionScheme; + int postLabelDelay, shimGradientX, shimGradientY, shimGradientZ, phaseNumber, spoiling, mtState, partialFourierDirection, interp3D, aslFlags, durationLabelPulseGE, epiVersionGE, internalepiVersionGE, maxEchoNumGE, rawDataRunNumber, numberOfImagesInGridUIH, numberOfDiffusionT2GE, numberOfDiffusionDirectionGE, tensorFileGE, diffCyclingModeGE, phaseEncodingGE, protocolBlockStartGE, protocolBlockLengthGE, modality, dwellTime, effectiveEchoSpacingGE, phaseEncodingLines, phaseEncodingSteps, frequencyEncodingSteps, phaseEncodingStepsOutOfPlane, echoTrainLength, echoNum, sliceOrient, manufacturer, converted2NII, acquNum, imageNum, imageStart, imageBytes, bitsStored, bitsAllocated, samplesPerPixel,locationsInAcquisition, locationsInAcquisitionConflict, compressionScheme; float xRayTubeCurrent, exposureTimeMs, numberOfExcitations, numberOfArms, numberOfPointsPerArm, groupDelay, decayFactor, percentSampling,waterFatShift, numberOfAverages, imagingFrequency, patientWeight, zSpacing, zThick, pixelBandwidth, SAR, phaseFieldofView, accelFactPE, accelFactOOP, flipAngle, fieldStrength, TE, TI, TR, intenScale, intenIntercept, intenScalePhilips, gantryTilt, lastScanLoc, angulation[4], velocityEncodeScaleGE; float orient[7], patientPosition[4], patientPositionLast[4], xyzMM[4], stackOffcentre[4]; float rtia_timerGE, radionuclidePositronFraction, radionuclideTotalDose, radionuclideHalfLife, doseCalibrationFactor; //PET ISOTOPE MODULE ATTRIBUTES (C.8-57) diff --git a/console/nii_dicom_batch.cpp b/console/nii_dicom_batch.cpp index 3eee9294..a1f7f8a3 100644 --- a/console/nii_dicom_batch.cpp +++ b/console/nii_dicom_batch.cpp @@ -764,6 +764,10 @@ void siemensCsaAscii(const char *filename, TCsaAscii *csaAscii, int csaOffset, i csaAscii->parallelReductionFactorInPlane = readKey(keyStrAF, keyPos, csaLengthTrim); char keyStrAF3D[] = "sPat.lAccelFact3D"; csaAscii->accelFact3D = readKey(keyStrAF3D, keyPos, csaLengthTrim); + //issue 672: the tag "sSliceAcceleration.lMultiBandFactor" is not reliable: + // series 7 dcm_qa_xa30 has x3 multiband, but this tag reports "1" (perhaps cmrr sequences) + //char keyStrMB[] = "sSliceAcceleration.lMultiBandFactor"; + //csaAscii->multiBandFactor = readKey(keyStrMB, keyPos, csaLengthTrim); char keyStrRef[] = "sPat.lRefLinesPE"; csaAscii->refLinesPE = readKey(keyStrRef, keyPos, csaLengthTrim); char keyStrCombineMode[] = "ucCoilCombineMode"; @@ -1801,15 +1805,15 @@ tse3d: T2*/ if ((csaAscii.ucMTC == 1) && (d.mtState < 0)) //precedence for 0018,9020 over CSA json_Bool(fp, "\t\"MTState\": %s,\n", 1); json_Str(fp, "\t\"ConsistencyInfo\": \"%s\",\n", consistencyInfo); - if (csaAscii.accelFact3D > 1.01) json_Float(fp, "\t\"AccelFact3D\": %g,\n", csaAscii.accelFact3D); //see *spcR_44ns where "sPat.lAccelFactPE = 1", "sPat.lAccelFact3D = 2" (0051,1011) LO [p2], perhaps ParallelReductionFactorInPlane should be 1? + if (csaAscii.accelFact3D > 0) + d.accelFactOOP = csaAscii.accelFact3D; + //see issue 672 if (csaAscii.accelFact3D > 1.01) json_Float(fp, "\t\"AccelFact3D\": %g,\n", csaAscii.accelFact3D); //see *spcR_44ns where "sPat.lAccelFactPE = 1", "sPat.lAccelFact3D = 2" (0051,1011) LO [p2], perhaps ParallelReductionFactorInPlane should be 1? if (csaAscii.parallelReductionFactorInPlane > 0) { //AccelFactorPE -> phase encoding if (csaAscii.patMode == 1) fprintf(fp, "\t\"MatrixCoilMode\": \"SENSE\",\n"); if (csaAscii.patMode == 2) fprintf(fp, "\t\"MatrixCoilMode\": \"GRAPPA\",\n"); - if (d.accelFactPE < 1.0) { //value not found in DICOM header, but WAS found in CSA ascii - d.accelFactPE = csaAscii.parallelReductionFactorInPlane; //value found in ASCII but not in DICOM (0051,1011) - } + d.accelFactPE = csaAscii.parallelReductionFactorInPlane; //issue672: csa precedence over value found in DICOM (0051,1011) if ((csaAscii.accelFact3D < 1.01) && (csaAscii.parallelReductionFactorInPlane != (int)(d.accelFactPE))) printWarning("ParallelReductionFactorInPlane reported in DICOM [0051,1011] (%d) does not match CSA series value %d\n", (int)(d.accelFactPE), csaAscii.parallelReductionFactorInPlane); } @@ -1893,6 +1897,10 @@ tse3d: T2*/ fprintf(fp, "\t\"PhaseEncodingStepsNoPartialFourier\": %d,\n", d.phaseEncodingSteps); } else if (d.phaseEncodingSteps > 0) fprintf(fp, "\t\"PhaseEncodingSteps\": %d,\n", d.phaseEncodingSteps); + if (d.frequencyEncodingSteps > 0) + fprintf(fp, "\t\"FrequencyEncodingSteps\": %d,\n", d.frequencyEncodingSteps); + if (d.phaseEncodingStepsOutOfPlane > 0) + fprintf(fp, "\t\"PhaseEncodingStepsOutOfPlane\": %d,\n", d.phaseEncodingStepsOutOfPlane); if ((d.phaseEncodingLines > 0) && (d.modality == kMODALITY_MR)) fprintf(fp, "\t\"AcquisitionMatrixPE\": %d,\n", d.phaseEncodingLines); //Compute ReconMatrixPE @@ -1921,7 +1929,7 @@ tse3d: T2*/ json_Str(fp, "\t\"ParallelAcquisitionTechnique\": \"%s\",\n", d.parallelAcquisitionTechnique); //https://github.com/rordenlab/dcm2niix/issues/314 if (d.accelFactOOP > 1.0) - fprintf(fp, "\t\"ParallelReductionOutOfPlane\": %g,\n", d.accelFactOOP); + fprintf(fp, "\t\"ParallelReductionFactorOutOfPlane\": %g,\n", d.accelFactOOP); //issue672 //EffectiveEchoSpacing // Siemens bandwidthPerPixelPhaseEncode already accounts for the effects of parallel imaging, // interpolation, phaseOversampling, and phaseResolution, in the context of the size of the From 865dab86761bbc73f89ea4df6a5655679af28a75 Mon Sep 17 00:00:00 2001 From: neurolabusc Date: Thu, 2 Feb 2023 09:53:59 +0100 Subject: [PATCH 53/85] GE Phase encoding polarity precedence (https://github.com/rordenlab/dcm2niix/issues/674) --- BIDS/README.md | 5 ++--- GE/README.md | 2 +- console/nii_dicom.cpp | 18 ++++++++++-------- console/nii_dicom.h | 2 +- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/BIDS/README.md b/BIDS/README.md index c480e74e..d3d6c7eb 100644 --- a/BIDS/README.md +++ b/BIDS/README.md @@ -152,8 +152,7 @@ Fields specific to MRI scans. | NumberOfAverages | | DICOM tag 0018,0083 | D | | ParallelAcquisitionTechnique | | DICOM tag 0018, 9078, aka `SENSE`, `GRAPPA` | B | | ParallelReductionFactorInPlane | | DICOM tag 0018,9069 | B | -| ParallelReductionFactorOutOfPlane | | DICOM tag 0018,9069 | B | -| ParallelReductionOutOfPlane | | DICOM tag 0018,9155 | D | +| ParallelReductionFactorOutOfPlane | | DICOM tag 0018,9155 | B | | PartialFourierDirection | | DICOM tag 0018,9036 | B | | PercentPhaseFOV | | DICOM tag 0018,0094 | D | | PercentSampling | | DICOM tag 0018,0093 | D | @@ -303,6 +302,7 @@ Fields specific to Siemens V*-series (e.g. VB, VE) MRI systems (e.g. Verio, Trio | DelayTime | s | Pause between EPI volumes, where TR is longer than required by TA (`sparse` imaging) | D | | TxRefAmp | V | | D | | ParallelReductionFactorInPlane | | DICOM tag 0021,1009 | B | +| ParallelReductionFactorOutOfPlane | | CSA `sPat.lAccelFact3D` | B | | PhaseResolution | f | | D | | PhaseOversampling | | | D | | MultibandAccelerationFactor | | DICOM tag 0021,1009 | B | @@ -313,7 +313,6 @@ Fields specific to Siemens V*-series (e.g. VB, VE) MRI systems (e.g. Verio, Trio | FmriExternalInfo | | | D | | WipMemBlock | | | D | | AveragesDouble | | CSA `dAveragesDouble`, fractions possible, independent of DICOM `NumberOfAverages` (0018,0083) | D | -| AccelFact3D | | 3D Acquisitions (Parallel Reduction Factor Across Slices) | D | | ProtocolName | | Check SeriesDescription - they might be switched around | D | | RefLinesPE | | # of reference lines in the phase encoding direction for acceleration (GRAPPA) | D | | ConsistencyInfo | | The more complete software version, e.g. VE11C or VE11E instead of just VE11. | D | diff --git a/GE/README.md b/GE/README.md index c0935a23..7efbdc92 100644 --- a/GE/README.md +++ b/GE/README.md @@ -86,7 +86,7 @@ While GE DICOMs will report if the image uses partial Fourier, it will not revea ## Phase-Encoding Polarity -All EPI scans have spatial distortion, particularly those with longer readout times. Tools like [FSL topup](https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/topup/TopupUsersGuide) can leverage data where two spin-echo images are acquired that are identical except for using opposite phase-encoding polarity (e.g. one uses A>P, the other P>A). Each image is distorted with the same magnitude, but in the opposite direction. GE's Rx27 software version and later populate the [Rectilinear Phase Encode Reordering (0018,9034)](http://dicomlookup.com/lookup.asp?sw=Tnumber&q=(0018,9034)) tag which for EPI is set to either LINEAR or REVERSE_LINEAR. +All EPI scans have spatial distortion, particularly those with longer readout times. Tools like [FSL topup](https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/topup/TopupUsersGuide) can leverage data where two spin-echo images are acquired that are identical except for using opposite phase-encoding polarity (e.g. one uses A>P, the other P>A). Each image is distorted with the same magnitude, but in the opposite direction. GE's Rx27 software version and later populate the [Rectilinear Phase Encode Reordering (0018,9034)](http://dicomlookup.com/lookup.asp?sw=Tnumber&q=(0018,9034)) tag which for EPI is set to either LINEAR or REVERSE_LINEAR. This should be given precedence to similar values in [User Define Data GE (0043,102A)](https://github.com/rordenlab/dcm2niix/issues/674). ## GE Protocol Data Block diff --git a/console/nii_dicom.cpp b/console/nii_dicom.cpp index a4077965..e097d2f6 100644 --- a/console/nii_dicom.cpp +++ b/console/nii_dicom.cpp @@ -6999,16 +6999,18 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); int sliceOrderFlag = dcmInt(2, (unsigned char *)hdr + kydir_off, true); if (isVerboseX > 1) printMessage(" GE phasePolarity/sliceOrder flags %d %d\n", phasePolarityFlag, sliceOrderFlag); - if (phasePolarityFlag == kGE_PHASE_ENCODING_POLARITY_FLIPPED) - d.phaseEncodingGE = kGE_PHASE_ENCODING_POLARITY_FLIPPED; - if (phasePolarityFlag == kGE_PHASE_ENCODING_POLARITY_UNFLIPPED) - d.phaseEncodingGE = kGE_PHASE_ENCODING_POLARITY_UNFLIPPED; - if (sliceOrderFlag == kGE_SLICE_ORDER_BOTTOM_UP) { - //https://cfmriweb.ucsd.edu/Howto/3T/operatingtips.html - if (d.phaseEncodingGE == kGE_PHASE_ENCODING_POLARITY_UNFLIPPED) + if (d.phaseEncodingGE == kGE_PHASE_ENCODING_POLARITY_UNKNOWN) { //issue674 precedence of 0018,9034 over 0043,102A + if (phasePolarityFlag == kGE_PHASE_ENCODING_POLARITY_FLIPPED) d.phaseEncodingGE = kGE_PHASE_ENCODING_POLARITY_FLIPPED; - else + if (phasePolarityFlag == kGE_PHASE_ENCODING_POLARITY_UNFLIPPED) d.phaseEncodingGE = kGE_PHASE_ENCODING_POLARITY_UNFLIPPED; + if (sliceOrderFlag == kGE_SLICE_ORDER_BOTTOM_UP) { + //https://cfmriweb.ucsd.edu/Howto/3T/operatingtips.html + if (d.phaseEncodingGE == kGE_PHASE_ENCODING_POLARITY_UNFLIPPED) + d.phaseEncodingGE = kGE_PHASE_ENCODING_POLARITY_FLIPPED; + else + d.phaseEncodingGE = kGE_PHASE_ENCODING_POLARITY_UNFLIPPED; + } } //if (sliceOrderFlag == kGE_SLICE_ORDER_TOP_DOWN) // d.sliceOrderGE = kGE_SLICE_ORDER_TOP_DOWN; diff --git a/console/nii_dicom.h b/console/nii_dicom.h index 4b8328f4..3ef81863 100644 --- a/console/nii_dicom.h +++ b/console/nii_dicom.h @@ -50,7 +50,7 @@ extern "C" { #define kCPUsuf " " //unknown CPU #endif -#define kDCMdate "v1.0.20230127" +#define kDCMdate "v1.0.20230201" #define kDCMvers kDCMdate " " kJP2suf kLSsuf kCCsuf kCPUsuf static const int kMaxEPI3D = 1024; //maximum number of EPI images in Siemens Mosaic From 1dea4f9360fcd48b04c081426c4ff1c5fe0ef4b2 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 2 Feb 2023 11:39:39 -0500 Subject: [PATCH 54/85] Rudimentary codespell configuration excluding few common hits and QA submodules --- .codespellrc | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .codespellrc diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 00000000..5714ae73 --- /dev/null +++ b/.codespellrc @@ -0,0 +1,5 @@ +[codespell] +skip = .git,*.json,dcm_qa* +# te - the TE used in the code often +# clen - another common variable for length of smth +ignore-words-list = te,clen From 061c16143fc4ec31c77c6b55d91e78252669a28a Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 2 Feb 2023 11:47:03 -0500 Subject: [PATCH 55/85] Manually fixing or skipping some ambigous fixes --- .codespellrc | 7 ++++++- Philips/README.md | 2 +- console/nii_dicom.cpp | 2 +- console/nii_dicom_batch.cpp | 4 ++-- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.codespellrc b/.codespellrc index 5714ae73..d77a3405 100644 --- a/.codespellrc +++ b/.codespellrc @@ -2,4 +2,9 @@ skip = .git,*.json,dcm_qa* # te - the TE used in the code often # clen - another common variable for length of smth -ignore-words-list = te,clen +# tage - for \tAge, inline ignores are yet to be released +# nd - there is some kind of ND whi +# ❯ grep -e 'trace or MD ' -e 'Trace/ND' ./console/nii_dicom_batch.cpp +# // the isotropic trace or MD can be calculated) often come as +# /*if (!dcmList[indx0].isDerived) //no need to warn if images are derived Trace/ND pair +ignore-words-list = te,clen,tage,nd diff --git a/Philips/README.md b/Philips/README.md index 64963a12..3c2f81ab 100644 --- a/Philips/README.md +++ b/Philips/README.md @@ -136,7 +136,7 @@ MyCustomDirections ``` -Important tags for Philips DICOM include b-value index (2005,1412) and gradient direction number (2005,1413). Knowing both 2005,1412 nd 2005,1413 uniquely identifies a volume in a series (two volumes can share either b-value or gradient direction, but can not be identical in both dimensions). With software release R5.6 and later there are additional useful tags: DIFFUSION2_KDTI (2005, 1595, Y/N) specifies whether acquisition ordering is enabled for a series. NR_OF_DIFFUSION_ORDER (2005,1599) specifies the number of vectors in a series. DIFFUSION_ORDER (2005,1596) specifies the acquisition ordering of a series. +Important tags for Philips DICOM include b-value index (2005,1412) and gradient direction number (2005,1413). Knowing both 2005,1412 and 2005,1413 uniquely identifies a volume in a series (two volumes can share either b-value or gradient direction, but can not be identical in both dimensions). With software release R5.6 and later there are additional useful tags: DIFFUSION2_KDTI (2005, 1595, Y/N) specifies whether acquisition ordering is enabled for a series. NR_OF_DIFFUSION_ORDER (2005,1599) specifies the number of vectors in a series. DIFFUSION_ORDER (2005,1596) specifies the acquisition ordering of a series. ## Missing Information diff --git a/console/nii_dicom.cpp b/console/nii_dicom.cpp index e097d2f6..0a380256 100644 --- a/console/nii_dicom.cpp +++ b/console/nii_dicom.cpp @@ -5363,7 +5363,7 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); char uid[kDICOMStrLarge]; dcmStr(lLength, &buffer[lPos], uid, true); char *timeStr = strrchr(uid, '.'); - //nb Manufactuer (0008,0070) comes AFTER (0008,0018) SOPInstanceUID. + //nb Manufacturer (0008,0070) comes AFTER (0008,0018) SOPInstanceUID. //format of (0008,0018) UI //[1.23.4.2019051416101221842 // .YYYYMMDDHHmmssxxxxx diff --git a/console/nii_dicom_batch.cpp b/console/nii_dicom_batch.cpp index a1f7f8a3..ea39250f 100644 --- a/console/nii_dicom_batch.cpp +++ b/console/nii_dicom_batch.cpp @@ -4608,7 +4608,7 @@ int nii_savejnii(char *niiFilename, struct nifti_1_header hdr, unsigned char *im size_t compressedbytes, totalbytes; unsigned char *compressed=NULL, *buf=NULL; - /*jnifti convers code-based header fields to human-readable/standardized strings*/ + /*jnifti converts code-based header fields to human-readable/standardized strings*/ int datatypeidx; const char *datatypestr[]={"uint8","int16","int32","single","complex64","double", "rgb24" ,"int8","uint16","uint32","int64","uint64", @@ -7631,7 +7631,7 @@ bool isSameSet(struct TDICOMdata d1, struct TDICOMdata d2, struct TDCMopts *opts } if ((d1.manufacturer == kMANUFACTURER_SIEMENS) && (strcmp(d1.protocolName, d2.protocolName) == 0) && (strlen(d1.softwareVersions) > 4) && (strlen(d1.sequenceName) > 4) && (strlen(d2.sequenceName) > 4)) { if (strstr(d1.sequenceName, "_ep_b") && strstr(d2.sequenceName, "_ep_b") && (strstr(d1.softwareVersions, "VB13") || strstr(d1.softwareVersions, "VB12"))) { - //Siemens B12/B13 users with a "DWI" but not "DTI" license would ofter create multi-series acquisitions + //Siemens B12/B13 users with a "DWI" but not "DTI" license would often create multi-series acquisitions if (!warnings->forceStackSeries) printMessage("Diffusion images stacked despite varying series number (early Siemens DTI).\n"); warnings->forceStackSeries = true; From cac0a1e87b77ed758956245d43e391ea3b66ac0c Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 2 Feb 2023 11:48:16 -0500 Subject: [PATCH 56/85] ignore ser --- .codespellrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.codespellrc b/.codespellrc index d77a3405..a9022c82 100644 --- a/.codespellrc +++ b/.codespellrc @@ -7,4 +7,5 @@ skip = .git,*.json,dcm_qa* # ❯ grep -e 'trace or MD ' -e 'Trace/ND' ./console/nii_dicom_batch.cpp # // the isotropic trace or MD can be calculated) often come as # /*if (!dcmList[indx0].isDerived) //no need to warn if images are derived Trace/ND pair -ignore-words-list = te,clen,tage,nd +# ser - used in printMessage(" acq %d img %d ser %ld ... +ignore-words-list = te,clen,tage,nd,ser From 925013c9d08baf1a79dff925e9b48595c0e03b0a Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 2 Feb 2023 11:49:57 -0500 Subject: [PATCH 57/85] [DATALAD RUNCMD] Run codespell throughout === Do not change lines below === { "chain": [], "cmd": "codespell -w", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^ --- console/cJSON.h | 2 +- console/charls/README.md | 2 +- console/charls/scan.h | 2 +- console/charls/util.h | 4 ++-- console/miniz.c | 4 ++-- console/nii_dicom.cpp | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/console/cJSON.h b/console/cJSON.h index 2c535628..204b40e0 100644 --- a/console/cJSON.h +++ b/console/cJSON.h @@ -258,7 +258,7 @@ CJSON_PUBLIC(cJSON_bool) cJSON_Compare(const cJSON * const a, const cJSON * cons /* Minify a strings, remove blank characters(such as ' ', '\t', '\r', '\n') from strings. * The input pointer json cannot point to a read-only address area, such as a string constant, - * but should point to a readable and writable adress area. */ + * but should point to a readable and writable address area. */ CJSON_PUBLIC(void) cJSON_Minify(char *json); /* Helper functions for creating and adding items to an object at the same time. diff --git a/console/charls/README.md b/console/charls/README.md index 82f45adc..d168c52b 100644 --- a/console/charls/README.md +++ b/console/charls/README.md @@ -75,7 +75,7 @@ The code is regularly compiled/tested on Windows and 64 bit Linux. Additionally, ## Users & Acknowledgements -CharLS is being used by [GDCM DICOM toolkit](http://sourceforge.net/projects/gdcm/), thanks for [Mathieu Malaterre](http://sourceforge.net/users/malat) for getting CharLS started on Linux. [Kato Kanryu](http://knivez.homelinux.org/) wrote an initial version of the color transfroms and the DIB output format code, for an [irfanview](http://www.irfanview.com) plugin using CharLS. Thanks to Uli Schlachter, CharLS now finally runs correctly on big-endian architectures like Sun SPARC. +CharLS is being used by [GDCM DICOM toolkit](http://sourceforge.net/projects/gdcm/), thanks for [Mathieu Malaterre](http://sourceforge.net/users/malat) for getting CharLS started on Linux. [Kato Kanryu](http://knivez.homelinux.org/) wrote an initial version of the color transforms and the DIB output format code, for an [irfanview](http://www.irfanview.com) plugin using CharLS. Thanks to Uli Schlachter, CharLS now finally runs correctly on big-endian architectures like Sun SPARC. ## Legal diff --git a/console/charls/scan.h b/console/charls/scan.h index 8c3383e0..bcc261dc 100644 --- a/console/charls/scan.h +++ b/console/charls/scan.h @@ -106,7 +106,7 @@ class JlsCodec : public Strategy using PIXEL = typename Traits::PIXEL; using SAMPLE = typename Traits::SAMPLE; - WARNING_SUPPRESS(26495) // false warning that _contextRunmode is unintialized + WARNING_SUPPRESS(26495) // false warning that _contextRunmode is uninitialized JlsCodec(const Traits& inTraits, const JlsParameters& params) : Strategy(params), traits(inTraits), diff --git a/console/charls/util.h b/console/charls/util.h index 17914d28..573a07ba 100644 --- a/console/charls/util.h +++ b/console/charls/util.h @@ -27,7 +27,7 @@ std::unique_ptr make_unique(Args&&... args) #endif // Only use __forceinline for the Microsoft C++ compiler in release mode (verified scenario) -// Use the build-in optimizer for all other C++ compilers. +// Use the built-in optimizer for all other C++ compilers. // Note: usage of FORCE_INLINE may be reduced in the future as the latest generation of C++ compilers // can handle optimization by themselves. #ifndef FORCE_INLINE @@ -136,7 +136,7 @@ struct Quad : Triplet v4(0) {} - WARNING_SUPPRESS(26495) // false warning that v4 is unintialized + WARNING_SUPPRESS(26495) // false warning that v4 is uninitialized Quad(Triplet triplet, int32_t alpha) noexcept : Triplet(triplet), diff --git a/console/miniz.c b/console/miniz.c index 47d10109..133a3d32 100644 --- a/console/miniz.c +++ b/console/miniz.c @@ -705,7 +705,7 @@ enum // pSrc_buf, src_buf_len: Pointer and size of the Deflate or zlib source data to decompress. // On return: // Function returns a pointer to the decompressed data, or NULL on failure. -// *pOut_len will be set to the decompressed data's size, which could be larger than src_buf_len on uncompressible data. +// *pOut_len will be set to the decompressed data's size, which could be larger than src_buf_len on incompressible data. // The caller must call mz_free() on the returned block when it's no longer needed. void *tinfl_decompress_mem_to_heap(const void *pSrc_buf, size_t src_buf_len, size_t *pOut_len, int flags); @@ -817,7 +817,7 @@ enum // flags: The max match finder probes (default is 128) logically OR'd against the above flags. Higher probes are slower but improve compression. // On return: // Function returns a pointer to the compressed data, or NULL on failure. -// *pOut_len will be set to the compressed data's size, which could be larger than src_buf_len on uncompressible data. +// *pOut_len will be set to the compressed data's size, which could be larger than src_buf_len on incompressible data. // The caller must free() the returned block when it's no longer needed. void *tdefl_compress_mem_to_heap(const void *pSrc_buf, size_t src_buf_len, size_t *pOut_len, int flags); diff --git a/console/nii_dicom.cpp b/console/nii_dicom.cpp index 0a380256..7becb16a 100644 --- a/console/nii_dicom.cpp +++ b/console/nii_dicom.cpp @@ -7839,7 +7839,7 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); if ((d.epiVersionGE == kGE_EPI_EPI2) || (d.internalepiVersionGE == 2)) { // Diffusion tensor file number d.tensorFileGE = userData11GE; - // cycling sytems: Premier, UHP, 7.0T + // cycling systems: Premier, UHP, 7.0T if ((strstr(d.manufacturersModelName, "Premier") != NULL) || (strstr(d.manufacturersModelName, "UHP") != NULL) || (strstr(d.manufacturersModelName, "7.0T") != NULL)) { // cycling special OFF mode if (isSameFloatGE(userData15GE, 0.72)) From 37d081d12c6eee7a4d3884943f0e27e259b1e81c Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 2 Feb 2023 11:51:08 -0500 Subject: [PATCH 58/85] Add codespell github workflow to ensure no typos sneak in --- .github/workflows/codespell.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/codespell.yml diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml new file mode 100644 index 00000000..c26aab66 --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,19 @@ +--- +name: Codespell + +on: + push: + branches: [development,master] + pull_request: + branches: [development,master] + +jobs: + codespell: + name: Check for spelling errors + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Codespell + uses: codespell-project/actions-codespell@v1 From 961e626fea12f04c00cc4e7a3ab1c189e5587628 Mon Sep 17 00:00:00 2001 From: Jaemin Shin Date: Thu, 2 Feb 2023 16:03:42 -0500 Subject: [PATCH 59/85] GE phase encoding polarity with (0018, 9034) --- console/nii_dicom.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/console/nii_dicom.cpp b/console/nii_dicom.cpp index e097d2f6..10571a85 100644 --- a/console/nii_dicom.cpp +++ b/console/nii_dicom.cpp @@ -5616,9 +5616,9 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); if (lLength < 2) break; if (toupper(buffer[lPos]) == 'L') - d.phaseEncodingGE = kGE_PHASE_ENCODING_POLARITY_UNFLIPPED; + d.phaseEncodingGE = kGE_PHASE_ENCODING_POLARITY_FLIPPED; //issue674, (0018, 9034) LINEAR-->FLIPPED if (toupper(buffer[lPos]) == 'R') - d.phaseEncodingGE = kGE_PHASE_ENCODING_POLARITY_FLIPPED; + d.phaseEncodingGE = kGE_PHASE_ENCODING_POLARITY_UNFLIPPED; //issue674, R(0018, 9034) REVERSE_LINEAR-->UNFLIPPED break; } case kPartialFourierDirection: { //'CS' PHASE FREQUENCY SLICE_SELECT COMBINATION From 19738600abc66f2107a57161527fa7ecc5347072 Mon Sep 17 00:00:00 2001 From: neurolabusc Date: Sat, 11 Feb 2023 12:06:19 -0500 Subject: [PATCH 60/85] Compressed Sensing and Deep Learning (https://github.com/bids-standard/bids-specification/issues/1407) --- BIDS/README.md | 2 ++ console/nii_dicom.cpp | 39 ++++++++++++++++++++++++++++++++++--- console/nii_dicom.h | 9 +++++---- console/nii_dicom_batch.cpp | 33 +++++++++++++++++++++++++++---- 4 files changed, 72 insertions(+), 11 deletions(-) diff --git a/BIDS/README.md b/BIDS/README.md index d3d6c7eb..e0a5e747 100644 --- a/BIDS/README.md +++ b/BIDS/README.md @@ -232,6 +232,8 @@ Data unique to [GE](https://github.com/rordenlab/dcm2niix/tree/master/GE). Deter | ASLLabelingTechnique | | DICOM tag 0043,10A4 | D | | LabelingDuration | s | DICOM tag 0043,10A5 | B | | SliceTiming | s | [see notes](https://github.com/rordenlab/dcm2niix/tree/master/GE#slice-timing) | B | +| CompressedSensingFactor | | DICOM tag 0043,10b7 | D | +| DeepLearningFactor | | DICOM tag 0043,10ca | D | ### Manufacturer Philips diff --git a/console/nii_dicom.cpp b/console/nii_dicom.cpp index d4fa8277..e71e2572 100644 --- a/console/nii_dicom.cpp +++ b/console/nii_dicom.cpp @@ -842,6 +842,9 @@ struct TDICOMdata clear_dicom_data() { d.instanceUidCrc = 0; d.accelFactPE = 0.0; d.accelFactOOP = 0.0; + d.compressedSensingFactor = 0.0; + d.isDeepLearning = false; + strcpy(d.deepLearningText, ""); //d.patientPositionNumPhilips = 0; d.imageBytes = 0; d.intenScale = 1; @@ -977,7 +980,7 @@ void dcmStrDigitsOnlyKey(char key, char *lStr) { return; bool isKey = false; for (int i = 0; i < (int)len; i++) { - if (!isdigit(lStr[i])) { + if (!isdigitdot(lStr[i])) { isKey = (lStr[i] == key); lStr[i] = ' '; } else if (!isKey) @@ -1253,6 +1256,8 @@ int dcmStrManufacturer(const int lByteLength, unsigned char lBuffer[]) { //read ret = kMANUFACTURER_BRUKER; if ((toupper(cString[0]) == 'M') && (toupper(cString[1]) == 'R')) ret = kMANUFACTURER_MRSOLUTIONS; + if ((toupper(cString[0]) == 'H') && (toupper(cString[1]) == 'Y')) + ret = kMANUFACTURER_HYPERFINE; //if (ret == kMANUFACTURER_UNKNOWN) //reduce verbosity: single warning for series : Unable to determine manufacturer (0008,0070) // printWarning("Unknown manufacturer %s\n", cString); //#ifdef _MSC_VER @@ -4438,10 +4443,12 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); #define kICE_dims 0x0021 + (0x1106 << 16) //LO [X_4_1_1_1_1_160_1_1_1_1_1_277] #define kPhaseEncodingDirectionPositiveSiemens 0x0021 + (0x111C << 16) //IS #define kRealDwellTime 0x0021+(0x1142<< 16 )//IS +//#define kPATModeText2 0x0021 + (0x1156 << 16) //LO, always same as 0021,1009 #define kBandwidthPerPixelPhaseEncode21 0x0021 + (0x1153 << 16) //FD #define kCoilElements 0x0021 + (0x114F << 16) //LO #define kAcquisitionMatrixText21 0x0021 + (0x1158 << 16) //SH #define kImageTypeText 0x0021 + (0x1175 << 16) //CS +#define kDeepLearningText 0x0021 + (0x1176 << 16) //LO //Private Group 21 as used by GE: #define kLocationsInAcquisitionGE 0x0021 + (0x104F << 16) //SS 'LocationsInAcquisitionGE' #define kRTIA_timer 0x0021 + (0x105E << 16) //DS @@ -4488,6 +4495,8 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); #define kASLLabelingTechniqueGE 0x0043 + (0x10A4 << 16) //LO #define kDurationLabelPulseGE 0x0043 + (0x10A5 << 16) //IS #define kMultiBandGE 0x0043 + (0x10B6 << 16) //LO +#define kCompressedSensingParameters 0x0043 + (0x10B7 << 16) //LO +#define kDeepLearningParameters 0x0043 + (0x10CA << 16) //LO "0.75\High" #define kAcquisitionMatrixText 0x0051 + (0x100B << 16) //LO #define kImageOrientationText 0x0051 + (0x100E << 16) // #define kCoilSiemens 0x0051 + (0x100F << 16) @@ -6028,13 +6037,13 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); char accelStr[kDICOMStr]; dcmStr(lLength, &buffer[lPos], accelStr); char *ptr; - dcmStrDigitsOnlyKey('p', accelStr); //e.g. if "p2s4" return "2", if "s4" return "" + dcmStrDigitsDotOnlyKey('p', accelStr); //e.g. if "p2s4" return "2", if "s4" return "" d.accelFactPE = (float)strtof(accelStr, &ptr); if (*ptr != '\0') d.accelFactPE = 0.0; //between slice accel dcmStr(lLength, &buffer[lPos], accelStr); - dcmStrDigitsOnlyKey('s', accelStr); //e.g. if "p2s4" return "4", if "p2" return "" + dcmStrDigitsDotOnlyKey('s', accelStr); //e.g. if "p2s4" return "4", if "p2" return "" multiBandFactor = (int)strtol(accelStr, &ptr, 10); if (*ptr != '\0') multiBandFactor = 0.0; @@ -6388,6 +6397,12 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); } break; } + case kDeepLearningText: { + if ((d.manufacturer != kMANUFACTURER_SIEMENS) || (lLength < 2)) + break; + dcmStr(lLength, &buffer[lPos], d.deepLearningText, true); + break; + } case kAcquisitionMatrixText21: //fall through to kAcquisitionMatrixText case kAcquisitionMatrixText: { @@ -7100,6 +7115,24 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); d.CSA.multiBandFactor = mb; break; } + case kCompressedSensingParameters: { //LO issue672 + if ((d.manufacturer != kMANUFACTURER_GE) || (lLength < 2)) + break; + //0043,10b7) LO [1.24\1\10\0] # 12, 4 Compressed Sensing Parameters + float cs = dcmStrFloat(lLength, &buffer[lPos]); + if (cs > 1.0) + d.compressedSensingFactor = cs; + //dcmStr(lLength, &buffer[lPos], d.compressedSensingText); + break; + } + case kDeepLearningParameters: { //LO issue672 + if ((d.manufacturer != kMANUFACTURER_GE) || (lLength < 2)) + break; + //(0043,10ca) LO [0.75\High] + d.isDeepLearning = true; + dcmStr(lLength, &buffer[lPos], d.deepLearningText, true); + break; + } case kGeiisFlag: if ((lLength > 4) && (buffer[lPos] == 'G') && (buffer[lPos + 1] == 'E') && (buffer[lPos + 2] == 'I') && (buffer[lPos + 3] == 'I')) { //read a few digits, as bug is specific to GEIIS, while GEMS are fine diff --git a/console/nii_dicom.h b/console/nii_dicom.h index 3ef81863..0753a600 100644 --- a/console/nii_dicom.h +++ b/console/nii_dicom.h @@ -50,7 +50,7 @@ extern "C" { #define kCPUsuf " " //unknown CPU #endif -#define kDCMdate "v1.0.20230201" +#define kDCMdate "v1.0.20230210" #define kDCMvers kDCMdate " " kJP2suf kLSsuf kCCsuf kCPUsuf static const int kMaxEPI3D = 1024; //maximum number of EPI images in Siemens Mosaic @@ -76,6 +76,7 @@ static const int kMaxDTI4D = kMaxSlice2D; //issue460: maximum number of DTI dire #define kMANUFACTURER_CANON 8 #define kMANUFACTURER_MEDISO 9 #define kMANUFACTURER_MRSOLUTIONS 10 +#define kMANUFACTURER_HYPERFINE 11 //note: note a complete modality list, e.g. XA,PX, etc #define kMODALITY_UNKNOWN 0 @@ -236,7 +237,7 @@ static const uint8_t MAX_NUMBER_OF_DIMENSIONS = 8; uint32_t coilCrc, seriesUidCrc, instanceUidCrc; int overlayStart[kMaxOverlay]; int postLabelDelay, shimGradientX, shimGradientY, shimGradientZ, phaseNumber, spoiling, mtState, partialFourierDirection, interp3D, aslFlags, durationLabelPulseGE, epiVersionGE, internalepiVersionGE, maxEchoNumGE, rawDataRunNumber, numberOfImagesInGridUIH, numberOfDiffusionT2GE, numberOfDiffusionDirectionGE, tensorFileGE, diffCyclingModeGE, phaseEncodingGE, protocolBlockStartGE, protocolBlockLengthGE, modality, dwellTime, effectiveEchoSpacingGE, phaseEncodingLines, phaseEncodingSteps, frequencyEncodingSteps, phaseEncodingStepsOutOfPlane, echoTrainLength, echoNum, sliceOrient, manufacturer, converted2NII, acquNum, imageNum, imageStart, imageBytes, bitsStored, bitsAllocated, samplesPerPixel,locationsInAcquisition, locationsInAcquisitionConflict, compressionScheme; - float xRayTubeCurrent, exposureTimeMs, numberOfExcitations, numberOfArms, numberOfPointsPerArm, groupDelay, decayFactor, percentSampling,waterFatShift, numberOfAverages, imagingFrequency, patientWeight, zSpacing, zThick, pixelBandwidth, SAR, phaseFieldofView, accelFactPE, accelFactOOP, flipAngle, fieldStrength, TE, TI, TR, intenScale, intenIntercept, intenScalePhilips, gantryTilt, lastScanLoc, angulation[4], velocityEncodeScaleGE; + float compressedSensingFactor, xRayTubeCurrent, exposureTimeMs, numberOfExcitations, numberOfArms, numberOfPointsPerArm, groupDelay, decayFactor, percentSampling,waterFatShift, numberOfAverages, imagingFrequency, patientWeight, zSpacing, zThick, pixelBandwidth, SAR, phaseFieldofView, accelFactPE, accelFactOOP, flipAngle, fieldStrength, TE, TI, TR, intenScale, intenIntercept, intenScalePhilips, gantryTilt, lastScanLoc, angulation[4], velocityEncodeScaleGE; float orient[7], patientPosition[4], patientPositionLast[4], xyzMM[4], stackOffcentre[4]; float rtia_timerGE, radionuclidePositronFraction, radionuclideTotalDose, radionuclideHalfLife, doseCalibrationFactor; //PET ISOTOPE MODULE ATTRIBUTES (C.8-57) float frameReferenceTime, frameDuration, ecat_isotope_halflife, ecat_dosage; @@ -244,10 +245,10 @@ static const uint8_t MAX_NUMBER_OF_DIMENSIONS = 8; double acquisitionDuration, triggerDelayTime, RWVScale, RWVIntercept, dateTime, acquisitionTime, acquisitionDate, bandwidthPerPixelPhaseEncode; char parallelAcquisitionTechnique[kDICOMStr], radiopharmaceutical[kDICOMStr], convolutionKernel[kDICOMStr], unitsPT[kDICOMStr], decayCorrection[kDICOMStr], attenuationCorrectionMethod[kDICOMStr],reconstructionMethod[kDICOMStr]; char prescanReuseString[kDICOMStr], imageOrientationText[kDICOMStr], pulseSequenceName[kDICOMStr], coilElements[kDICOMStr], coilName[kDICOMStr], phaseEncodingDirectionDisplayedUIH[kDICOMStr], imageBaseName[kDICOMStr], stationName[kDICOMStr], softwareVersions[kDICOMStr], deviceSerialNumber[kDICOMStr], institutionName[kDICOMStr], referringPhysicianName[kDICOMStr], instanceUID[kDICOMStr], seriesInstanceUID[kDICOMStr], studyInstanceUID[kDICOMStr], bodyPartExamined[kDICOMStr], procedureStepDescription[kDICOMStr], imageTypeText[kDICOMStr], imageType[kDICOMStr], institutionalDepartmentName[kDICOMStr], manufacturersModelName[kDICOMStr], patientID[kDICOMStr], patientOrient[kDICOMStr], patientName[kDICOMStr], accessionNumber[kDICOMStr], seriesDescription[kDICOMStr], studyID[kDICOMStr], sequenceName[kDICOMStr], protocolName[kDICOMStr],sequenceVariant[kDICOMStr],scanningSequence[kDICOMStr], patientBirthDate[kDICOMStr], patientAge[kDICOMStr], studyDate[kDICOMStr],studyTime[kDICOMStr]; - char scanOptions[kDICOMStrLarge], institutionAddress[kDICOMStrLarge], imageComments[kDICOMStrLarge]; + char deepLearningText[kDICOMStrLarge], scanOptions[kDICOMStrLarge], institutionAddress[kDICOMStrLarge], imageComments[kDICOMStrLarge]; uint32_t dimensionIndexValues[MAX_NUMBER_OF_DIMENSIONS]; struct TCSAdata CSA; - bool isVariableFlipAngle, isQuadruped, isRealIsPhaseMapHz, isPrivateCreatorRemap, isHasOverlay, isEPI, isIR, isPartialFourier, isDiffusion, isVectorFromBMatrix, isRawDataStorage, isGrayscaleSoftcopyPresentationState, isStackableSeries, isCoilVaries, isNonParallelSlices, isBVecWorldCoordinates, isSegamiOasis, isXA10A, isScaleOrTEVaries, isScaleVariesEnh, isDerived, isXRay, isMultiEcho, isValid, is3DAcq, is2DAcq, isExplicitVR, isLittleEndian, isPlanarRGB, isSigned, isHasPhase, isHasImaginary, isHasReal, isHasMagnitude,isHasMixed, isFloat, isResampled, isLocalizer; + bool isDeepLearning, isVariableFlipAngle, isQuadruped, isRealIsPhaseMapHz, isPrivateCreatorRemap, isHasOverlay, isEPI, isIR, isPartialFourier, isDiffusion, isVectorFromBMatrix, isRawDataStorage, isGrayscaleSoftcopyPresentationState, isStackableSeries, isCoilVaries, isNonParallelSlices, isBVecWorldCoordinates, isSegamiOasis, isXA10A, isScaleOrTEVaries, isScaleVariesEnh, isDerived, isXRay, isMultiEcho, isValid, is3DAcq, is2DAcq, isExplicitVR, isLittleEndian, isPlanarRGB, isSigned, isHasPhase, isHasImaginary, isHasReal, isHasMagnitude,isHasMixed, isFloat, isResampled, isLocalizer; char phaseEncodingRC, patientSex; }; struct TDCMprefs { diff --git a/console/nii_dicom_batch.cpp b/console/nii_dicom_batch.cpp index ea39250f..4da66e4b 100644 --- a/console/nii_dicom_batch.cpp +++ b/console/nii_dicom_batch.cpp @@ -650,7 +650,7 @@ int phoenixOffsetCSASeriesHeader(unsigned char *buff, int lLength) { #define kMaxWipFree 64 typedef struct { - float TE0, TE1, delayTimeInTR, phaseOversampling, phaseResolution, txRefAmp; + float TE0, TE1, delayTimeInTR, phaseOversampling, phaseResolution, txRefAmp, accelFactTotal; int phaseEncodingLines, existUcImageNumb, ucMode, baseResolution, interp, partialFourier, echoSpacing, difBipolar, parallelReductionFactorInPlane, refLinesPE, combineMode, patMode, ucMTC, accelFact3D; float alFree[kMaxWipFree]; @@ -680,6 +680,7 @@ void siemensCsaAscii(const char *filename, TCsaAscii *csaAscii, int csaOffset, i csaAscii->difBipolar = 0; //0=not assigned,1=bipolar,2=monopolar csaAscii->parallelReductionFactorInPlane = 0; csaAscii->accelFact3D = 0;//lAccelFact3D + csaAscii->accelFactTotal = 0.0; csaAscii->refLinesPE = 0; csaAscii->combineMode = 0; csaAscii->patMode = 0; @@ -764,6 +765,8 @@ void siemensCsaAscii(const char *filename, TCsaAscii *csaAscii, int csaOffset, i csaAscii->parallelReductionFactorInPlane = readKey(keyStrAF, keyPos, csaLengthTrim); char keyStrAF3D[] = "sPat.lAccelFact3D"; csaAscii->accelFact3D = readKey(keyStrAF3D, keyPos, csaLengthTrim); + char keyStrAFTotal[] = "sPat.dTotalAccelFact"; + csaAscii->accelFactTotal = readKeyFloat(keyStrAFTotal, keyPos, csaLengthTrim); //issue 672: the tag "sSliceAcceleration.lMultiBandFactor" is not reliable: // series 7 dcm_qa_xa30 has x3 multiband, but this tag reports "1" (perhaps cmrr sequences) //char keyStrMB[] = "sSliceAcceleration.lMultiBandFactor"; @@ -1248,6 +1251,9 @@ tse3d: T2*/ case kMANUFACTURER_MRSOLUTIONS: fprintf(fp, "\t\"Manufacturer\": \"MRSolutions\",\n"); break; + case kMANUFACTURER_HYPERFINE: + fprintf(fp, "\t\"Manufacturer\": \"Hyperfine\",\n"); + break; }; //if (d.epiVersionGE == 0) // fprintf(fp, "\t\"PulseSequenceName\": \"epi\",\n"); @@ -1817,6 +1823,8 @@ tse3d: T2*/ if ((csaAscii.accelFact3D < 1.01) && (csaAscii.parallelReductionFactorInPlane != (int)(d.accelFactPE))) printWarning("ParallelReductionFactorInPlane reported in DICOM [0051,1011] (%d) does not match CSA series value %d\n", (int)(d.accelFactPE), csaAscii.parallelReductionFactorInPlane); } + if ((!isnan(csaAscii.accelFactTotal)) && (csaAscii.accelFactTotal > (d.accelFactPE * d.accelFactOOP) )) + d.compressedSensingFactor = csaAscii.accelFactTotal; //see dcm_qa_cs_dl } else { //e.g. Siemens Vida does not have CSA header, but has many attributes json_Str(fp, "\t\"ReceiveCoilActiveElements\": \"%s\",\n", d.coilElements); if (strcmp(d.coilElements, d.coilName) != 0) @@ -1929,7 +1937,19 @@ tse3d: T2*/ json_Str(fp, "\t\"ParallelAcquisitionTechnique\": \"%s\",\n", d.parallelAcquisitionTechnique); //https://github.com/rordenlab/dcm2niix/issues/314 if (d.accelFactOOP > 1.0) - fprintf(fp, "\t\"ParallelReductionFactorOutOfPlane\": %g,\n", d.accelFactOOP); //issue672 + json_Float(fp, "\t\"ParallelReductionFactorOutOfPlane\": %g,\n", d.accelFactOOP); //issue672 + if (d.compressedSensingFactor > 1.0) + json_Float(fp, "\t\"CompressedSensingFactor\": %g,\n", d.compressedSensingFactor); + //detect if Siemens data is DeepLearning: see dcm_qa_cs_dl + if (d.manufacturer == kMANUFACTURER_SIEMENS) { + //DRB,DRG,DRS DeepReveal Boost,Gain,Sharp + d.isDeepLearning = (strstr(d.imageType, "_DRB_")|| strstr(d.imageType, "_DRG_") || strstr(d.imageType, "_DRS_") || + strstr(d.imageTypeText, "_DRB_")|| strstr(d.imageTypeText, "_DRG_") || strstr(d.imageTypeText, "_DRS_")); + } + if (d.isDeepLearning) { + json_Bool(fp, "\t\"DeepLearning\": %s,\n", 1); + json_Str(fp, "\t\"DeepLearningDetails\": \"%s\",\n", d.deepLearningText); + } //EffectiveEchoSpacing // Siemens bandwidthPerPixelPhaseEncode already accounts for the effects of parallel imaging, // interpolation, phaseOversampling, and phaseResolution, in the context of the size of the @@ -2048,7 +2068,7 @@ tse3d: T2*/ } //only save PhaseEncodingDirection if BOTH direction and POLARITY are known //Slice Timing UIH or GE >>>> //in theory, we should also report XA10 slice times here, but see series 24 of https://github.com/rordenlab/dcm2niix/issues/236 - if ((d.modality != kMODALITY_CT) && (d.modality != kMODALITY_PT) && (!d.is3DAcq) && (d.CSA.sliceTiming[0] >= 0.0)) { + if ((d.modality != kMODALITY_CT) && (d.modality != kMODALITY_PT) && (!d.is3DAcq) && (h->dim[3] > 1) && (d.CSA.sliceTiming[1] >= 0.0) && (d.CSA.sliceTiming[0] >= 0.0)) { fprintf(fp, "\t\"SliceTiming\": [\n"); for (int i = 0; i < h->dim[3]; i++) { if (i != 0) @@ -3163,6 +3183,8 @@ int nii_createFilename(struct TDICOMdata dcm, char *niiFilename, struct TDCMopts strcat(outname, "Me"); else if (dcm.manufacturer == kMANUFACTURER_MRSOLUTIONS) strcat(outname, "MR"); + else if (dcm.manufacturer == kMANUFACTURER_HYPERFINE) + strcat(outname, "Hy"); else strcat(outname, "NA"); //manufacturer name not available } @@ -3662,6 +3684,9 @@ void nii_saveAttributes(struct TDICOMdata &data, struct nifti_1_header &header, case kMANUFACTURER_MRSOLUTIONS: images->addAttribute("manufacturer", "MRSolutions"); break; + case kMANUFACTURER_HYPERFINE: + images->addAttribute("manufacturer", "Hyperfine"); + break; } images->addAttribute("scannerModelName", data.manufacturersModelName); images->addAttribute("imageType", data.imageType); @@ -5811,7 +5836,7 @@ void checkSliceTiming(struct TDICOMdata *d, struct TDICOMdata *d1, int verbose, int nSlices = 0; while ((nSlices < kMaxEPI3D) && (d->CSA.sliceTiming[nSlices] >= 0.0)) nSlices++; - if (nSlices < 1) + if (nSlices < 2) return; if (d->CSA.sliceTiming[kMaxEPI3D - 1] < -1.0) //the value -2.0 is used as a flag for negative MosaicRefAcqTimes in checkSliceTimes(), see issue 271 printWarning("Adjusting for negative MosaicRefAcqTimes (issue 271).\n"); From 42e529a17890c7e7619199d63bd089bd14060b59 Mon Sep 17 00:00:00 2001 From: neurolabusc Date: Sat, 4 Mar 2023 07:23:28 -0500 Subject: [PATCH 61/85] Extend ImagingFrequency precision (https://github.com/rordenlab/dcm2niix/issues/685) --- README.md | 7 +++++++ console/nii_dicom.cpp | 11 ++++++++++- console/nii_dicom.h | 4 ++-- console/nii_dicom_batch.cpp | 2 +- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ea39aa90..6941e434 100644 --- a/README.md +++ b/README.md @@ -151,6 +151,8 @@ The following tools exploit dcm2niix - [clinica](https://github.com/aramis-lab/clinica) is a software platform for clinical neuroimaging studies that uses dcm2niix to convert DICOM images. - [clpipe](https://github.com/cohenlabUNC/clpipe) uses dcm2bids for DICOM import. - [conversion](https://github.com/pnlbwh/conversion) is a Python library that can convert dcm2niix created NIfTI files to the popular NRRD format (including DWI gradient tables). Note, recent versions of dcm2niix can directly convert DICOM images to NRRD. + - [convert_source](https://github.com/AdebayoBraimah/convert_source) to convert DICOM to BIDS directory layout. + - [CT-preprocess](https://github.com/GravO8/CT-preprocess) brain extract head CT scans. - [d2b-dcm2niix](https://github.com/d2b-dev/d2b-dcm2niix) data to BIDS wrapper. - [DAC2BIDS](https://github.com/dangom/dac2bids) uses dcm2niibatch to create [BIDS](http://bids.neuroimaging.io/) datasets. - [Data2Bids](https://github.com/SIMEXP/Data2Bids) converts non-DICOM images with associated JSON files to BIDS. While this tool does not require dcm2niix, it can leverage dcm2niix output similar to niix2bids. @@ -165,6 +167,7 @@ The following tools exploit dcm2niix - [dicom2bids](https://github.com/Jolinda/lcnimodules) includes python modules for converting dicom files to nifti in a bids-compatible file structure that use dcm2niix. - [DICOM2BIDS](https://github.com/klsea/DICOM2BIDS) is a Python 2 script for creating BIDS files. - [dicom2nifti_batch](https://github.com/scanUCLA/dicom2nifti_batch) is a Matlab script for automating dcm2niix. + - [dicomConversionToNifti](https://github.com/bsmarine/dicomConversionToNifti) converts, de-identifies and assigns standardized naming convention to medical imaging. - [divest](https://github.com/jonclayden/divest) R interface to dcm2niix. - [DPABI Data Processing & Analysis for Brain Imaging](http://rfmri.org/dpabi) includes dcm2niix. - [ExploreASL](https://sites.google.com/view/exploreasl/exploreasl) uses dcm2niix to import images. @@ -183,6 +186,7 @@ The following tools exploit dcm2niix - [lin4neuro](http://www.lin4neuro.net/lin4neuro/18.04bionic/vm/) releases such as the English l4n-18.04.4-amd64-20200801-en.ova include MRIcroGL and dcm2niix pre-installed. This allows user with VirtualBox or VMWarePlayer to use these tools (and many other neuroimaging tools) in a graphical virtual machine. - [MRIcroGL](https://github.com/neurolabusc/MRIcroGL) is available for MacOS, Linux and Windows and provides a graphical interface for dcm2niix. You can get compiled copies from the [MRIcroGL NITRC web site](https://www.nitrc.org/projects/mricrogl/). - [MrPyConvert](https://github.com/Jolinda/mrpyconvert) Python library dicom to bids conversion. + - [Nekton](https://github.com/deepc-health/nekton) is a python package for DICOM to NifTi and NifTi to DICOM-SEG and GSPS conversion. - [neuro_docker](https://github.com/Neurita/neuro_docker) includes dcm2niix as part of a single, static Dockerfile. - [NeuroDebian](http://neuro.debian.net/pkgs/dcm2niix.html) provides up-to-date version of dcm2niix for Debian-based systems. - [neurodocker](https://github.com/kaczmarj/neurodocker) includes dcm2niix as a lean, minimal install Dockerfile. @@ -192,9 +196,11 @@ The following tools exploit dcm2niix - [niix2bids](https://github.com/benoitberanger/niix2bids ) attempts to automatically convert Siemens MRI images converted by dcm2niix to BIDS. - [nipype](https://github.com/nipy/nipype) can use dcm2niix to convert images. - [PET2BIDS](https://github.com/openneuropet/PET2BIDS) uses dcm2niix for DICOM images. + - [pl-dcm2niix](https://github.com/FNNDSC/pl-dcm2niix) is a ChRIS wrapper for dcm2niix. - [py2bids](https://github.com/Jolinda/py2bids) dcm2niix dicom to bids conversion wrapper. - [pyBIDSconv provides a graphical format for converting DICOM images to the BIDS format](https://github.com/DrMichaelLindner/pyBIDSconv). It includes clever default heuristics for identifying Siemens scans. - [pydcm2niix is a Python module for working with dcm2niix](https://github.com/jstutters/pydcm2niix). + - [pydra-dcm2bids](https://github.com/aramis-lab/pydra-dcm2bids) supports Pydra tasks for dcm2bids. - [pydra-dcm2niix](https://github.com/nipype/pydra-dcm2niix) is a contains Pydra task interface for dcm2niix. - [qsm](https://github.com/CAIsr/qsm) Quantitative Susceptibility Mapping software. - [reproin](https://github.com/ReproNim/reproin) is a setup for automatic generation of shareable, version-controlled BIDS datasets from MR scanners. @@ -205,4 +211,5 @@ The following tools exploit dcm2niix - [tar2bids](https://github.com/khanlab/tar2bids) converts DICOM tarball(s) to BIDS using heudiconv which invokes dcm2niix. - [TORTOISE](https://tortoise.nibib.nih.gov) is used for processing diffusion MRI data, and uses dcm2niix to import DICOM images. - [TractoR (Tracto­graphy with R) uses dcm2niix for image conversion](http://www.tractor-mri.org.uk/TractoR-and-DICOM). + - [twice_exceptionality_repository](https://github.com/avery-water/twice_exceptionality_repository) converts DICOM to BIDS format, creates masks, and runs VBM. - [XNAT2BIDS](https://github.com/kamillipi/2bids) is a simple xnat pipeline to convert DICOM scans to BIDS-compatible output. diff --git a/console/nii_dicom.cpp b/console/nii_dicom.cpp index e71e2572..59239518 100644 --- a/console/nii_dicom.cpp +++ b/console/nii_dicom.cpp @@ -1564,6 +1564,15 @@ void dcmMultiFloat(int lByteLength, char lBuffer[], int lnFloats, float *lFloats free(cString); } //dcmMultiFloat() +double dcmStrDouble(const int lByteLength, const unsigned char lBuffer[]) { //read float stored as a string + char *cString = (char *)malloc(sizeof(char) * (lByteLength + 1)); + memcpy(cString, (char *)&lBuffer[0], lByteLength); + cString[lByteLength] = 0; //null terminate + double ret = (double)atof(cString); + free(cString); + return ret; +} //dcmStrDouble() + float dcmStrFloat(const int lByteLength, const unsigned char lBuffer[]) { //read float stored as a string char *cString = (char *)malloc(sizeof(char) * (lByteLength + 1)); memcpy(cString, (char *)&lBuffer[0], lByteLength); @@ -6248,7 +6257,7 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); d.numberOfAverages = dcmStrFloat(lLength, &buffer[lPos]); break; case kImagingFrequency: - d.imagingFrequency = dcmStrFloat(lLength, &buffer[lPos]); + d.imagingFrequency = dcmStrDouble(lLength, &buffer[lPos]); break; case kTriggerTime: { if (prefs->isIgnoreTriggerTimes) diff --git a/console/nii_dicom.h b/console/nii_dicom.h index 0753a600..99eb6723 100644 --- a/console/nii_dicom.h +++ b/console/nii_dicom.h @@ -237,12 +237,12 @@ static const uint8_t MAX_NUMBER_OF_DIMENSIONS = 8; uint32_t coilCrc, seriesUidCrc, instanceUidCrc; int overlayStart[kMaxOverlay]; int postLabelDelay, shimGradientX, shimGradientY, shimGradientZ, phaseNumber, spoiling, mtState, partialFourierDirection, interp3D, aslFlags, durationLabelPulseGE, epiVersionGE, internalepiVersionGE, maxEchoNumGE, rawDataRunNumber, numberOfImagesInGridUIH, numberOfDiffusionT2GE, numberOfDiffusionDirectionGE, tensorFileGE, diffCyclingModeGE, phaseEncodingGE, protocolBlockStartGE, protocolBlockLengthGE, modality, dwellTime, effectiveEchoSpacingGE, phaseEncodingLines, phaseEncodingSteps, frequencyEncodingSteps, phaseEncodingStepsOutOfPlane, echoTrainLength, echoNum, sliceOrient, manufacturer, converted2NII, acquNum, imageNum, imageStart, imageBytes, bitsStored, bitsAllocated, samplesPerPixel,locationsInAcquisition, locationsInAcquisitionConflict, compressionScheme; - float compressedSensingFactor, xRayTubeCurrent, exposureTimeMs, numberOfExcitations, numberOfArms, numberOfPointsPerArm, groupDelay, decayFactor, percentSampling,waterFatShift, numberOfAverages, imagingFrequency, patientWeight, zSpacing, zThick, pixelBandwidth, SAR, phaseFieldofView, accelFactPE, accelFactOOP, flipAngle, fieldStrength, TE, TI, TR, intenScale, intenIntercept, intenScalePhilips, gantryTilt, lastScanLoc, angulation[4], velocityEncodeScaleGE; + float compressedSensingFactor, xRayTubeCurrent, exposureTimeMs, numberOfExcitations, numberOfArms, numberOfPointsPerArm, groupDelay, decayFactor, percentSampling,waterFatShift, numberOfAverages, patientWeight, zSpacing, zThick, pixelBandwidth, SAR, phaseFieldofView, accelFactPE, accelFactOOP, flipAngle, fieldStrength, TE, TI, TR, intenScale, intenIntercept, intenScalePhilips, gantryTilt, lastScanLoc, angulation[4], velocityEncodeScaleGE; float orient[7], patientPosition[4], patientPositionLast[4], xyzMM[4], stackOffcentre[4]; float rtia_timerGE, radionuclidePositronFraction, radionuclideTotalDose, radionuclideHalfLife, doseCalibrationFactor; //PET ISOTOPE MODULE ATTRIBUTES (C.8-57) float frameReferenceTime, frameDuration, ecat_isotope_halflife, ecat_dosage; float pixelPaddingValue; // used for both FloatPixelPaddingValue (0028, 0122) and PixelPaddingValue (0028, 0120); NaN if not present. - double acquisitionDuration, triggerDelayTime, RWVScale, RWVIntercept, dateTime, acquisitionTime, acquisitionDate, bandwidthPerPixelPhaseEncode; + double imagingFrequency, acquisitionDuration, triggerDelayTime, RWVScale, RWVIntercept, dateTime, acquisitionTime, acquisitionDate, bandwidthPerPixelPhaseEncode; char parallelAcquisitionTechnique[kDICOMStr], radiopharmaceutical[kDICOMStr], convolutionKernel[kDICOMStr], unitsPT[kDICOMStr], decayCorrection[kDICOMStr], attenuationCorrectionMethod[kDICOMStr],reconstructionMethod[kDICOMStr]; char prescanReuseString[kDICOMStr], imageOrientationText[kDICOMStr], pulseSequenceName[kDICOMStr], coilElements[kDICOMStr], coilName[kDICOMStr], phaseEncodingDirectionDisplayedUIH[kDICOMStr], imageBaseName[kDICOMStr], stationName[kDICOMStr], softwareVersions[kDICOMStr], deviceSerialNumber[kDICOMStr], institutionName[kDICOMStr], referringPhysicianName[kDICOMStr], instanceUID[kDICOMStr], seriesInstanceUID[kDICOMStr], studyInstanceUID[kDICOMStr], bodyPartExamined[kDICOMStr], procedureStepDescription[kDICOMStr], imageTypeText[kDICOMStr], imageType[kDICOMStr], institutionalDepartmentName[kDICOMStr], manufacturersModelName[kDICOMStr], patientID[kDICOMStr], patientOrient[kDICOMStr], patientName[kDICOMStr], accessionNumber[kDICOMStr], seriesDescription[kDICOMStr], studyID[kDICOMStr], sequenceName[kDICOMStr], protocolName[kDICOMStr],sequenceVariant[kDICOMStr],scanningSequence[kDICOMStr], patientBirthDate[kDICOMStr], patientAge[kDICOMStr], studyDate[kDICOMStr],studyTime[kDICOMStr]; char deepLearningText[kDICOMStrLarge], scanOptions[kDICOMStrLarge], institutionAddress[kDICOMStrLarge], imageComments[kDICOMStrLarge]; diff --git a/console/nii_dicom_batch.cpp b/console/nii_dicom_batch.cpp index 4da66e4b..ab9ec501 100644 --- a/console/nii_dicom_batch.cpp +++ b/console/nii_dicom_batch.cpp @@ -1219,7 +1219,7 @@ tse3d: T2*/ //Imaging Frequency (0018,0084) can be useful https://support.brainvoyager.com/brainvoyager/functional-analysis-preparation/29-pre-processing/78-epi-distortion-correction-echo-spacing-and-bandwidth // however, UIH stores 128176031 not 128.176031 https://github.com/rordenlab/dcm2niix/issues/225 if (d.imagingFrequency < 9000000) - json_Float(fp, "\t\"ImagingFrequency\": %g,\n", d.imagingFrequency); + fprintf(fp, "\t\"ImagingFrequency\": %.10g,\n", d.imagingFrequency); switch (d.manufacturer) { case kMANUFACTURER_BRUKER: fprintf(fp, "\t\"Manufacturer\": \"Bruker\",\n"); From e155e0ed8a48f6f591ae53794ae4572b905bf0af Mon Sep 17 00:00:00 2001 From: neurolabusc Date: Mon, 6 Mar 2023 12:36:17 -0500 Subject: [PATCH 62/85] Refine Compressed Sensing detection --- BIDS/README.md | 2 ++ console/nii_dicom_batch.cpp | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/BIDS/README.md b/BIDS/README.md index e0a5e747..37200c58 100644 --- a/BIDS/README.md +++ b/BIDS/README.md @@ -339,6 +339,8 @@ Fields specific to [Siemens XA-series](https://github.com/rordenlab/dcm2niix/tre | PhaseEncodingDirection | | polarity from 0021,111c | B | | SpoilingState | | 0021,105B | B | +Siemens also includes some sequence information in the private MRPhoenixProtocol (0021,1019) tag. You can view this with [gdcmdump](https://gdcm.sourceforge.net/html/gdcmdump.html), e.g. `gdcmdump --mrprotocol img.dcm`. Fields that dcm2niix inspects include `sPat.lAccelFact3D `, `sPat.lAccelFactPE`, `sPat.lRefLinesPE` and `sPat.ucPATMode`. The behavior of dcm2niix will be more well documented as our understanding of this tag improves. + ### Manufacturer UIH Fields specific to United Imaging Healthcare systems (e.g. uMR 770). diff --git a/console/nii_dicom_batch.cpp b/console/nii_dicom_batch.cpp index ab9ec501..62252eba 100644 --- a/console/nii_dicom_batch.cpp +++ b/console/nii_dicom_batch.cpp @@ -1815,6 +1815,7 @@ tse3d: T2*/ d.accelFactOOP = csaAscii.accelFact3D; //see issue 672 if (csaAscii.accelFact3D > 1.01) json_Float(fp, "\t\"AccelFact3D\": %g,\n", csaAscii.accelFact3D); //see *spcR_44ns where "sPat.lAccelFactPE = 1", "sPat.lAccelFact3D = 2" (0051,1011) LO [p2], perhaps ParallelReductionFactorInPlane should be 1? if (csaAscii.parallelReductionFactorInPlane > 0) { //AccelFactorPE -> phase encoding + //1=SENSE, 2=GRAPPA, 32=SMS??, 256=CompressedSense? if (csaAscii.patMode == 1) fprintf(fp, "\t\"MatrixCoilMode\": \"SENSE\",\n"); if (csaAscii.patMode == 2) @@ -1823,7 +1824,7 @@ tse3d: T2*/ if ((csaAscii.accelFact3D < 1.01) && (csaAscii.parallelReductionFactorInPlane != (int)(d.accelFactPE))) printWarning("ParallelReductionFactorInPlane reported in DICOM [0051,1011] (%d) does not match CSA series value %d\n", (int)(d.accelFactPE), csaAscii.parallelReductionFactorInPlane); } - if ((!isnan(csaAscii.accelFactTotal)) && (csaAscii.accelFactTotal > (d.accelFactPE * d.accelFactOOP) )) + if ((csaAscii.patMode == 256) && (!isnan(csaAscii.accelFactTotal)) && (csaAscii.accelFactTotal > (d.accelFactPE * d.accelFactOOP) )) d.compressedSensingFactor = csaAscii.accelFactTotal; //see dcm_qa_cs_dl } else { //e.g. Siemens Vida does not have CSA header, but has many attributes json_Str(fp, "\t\"ReceiveCoilActiveElements\": \"%s\",\n", d.coilElements); @@ -1927,6 +1928,12 @@ tse3d: T2*/ } if ((d.modality == kMODALITY_MR) && (reconMatrixPE > 0)) fprintf(fp, "\t\"ReconMatrixPE\": %d,\n", reconMatrixPE); + if ((d.accelFactPE > 1.0) && (d.manufacturer == kMANUFACTURER_PHILIPS) && strstr(d.parallelAcquisitionTechnique, "CSENSE") ) { + //see dcm_qa_cs_dl: while GE allows you to set ASSET and compressed sense, Philips reports only CSENSE + d.compressedSensingFactor = d.accelFactPE; + d.accelFactPE = 1.0; + d.parallelAcquisitionTechnique[0] = '\0'; + } double bandwidthPerPixelPhaseEncode = d.bandwidthPerPixelPhaseEncode; if (bandwidthPerPixelPhaseEncode == 0.0) bandwidthPerPixelPhaseEncode = d.CSA.bandwidthPerPixelPhaseEncode; From bf3f69e886c846fe52e4f1db4f48b43745aa9a40 Mon Sep 17 00:00:00 2001 From: neurolabusc Date: Wed, 8 Mar 2023 18:21:03 -0500 Subject: [PATCH 63/85] signed 12-bit integers (https://github.com/rordenlab/dcm2niix/issues/688). --- console/nii_dicom.h | 2 +- console/nii_dicom_batch.cpp | 19 +++++++++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/console/nii_dicom.h b/console/nii_dicom.h index 99eb6723..acd64004 100644 --- a/console/nii_dicom.h +++ b/console/nii_dicom.h @@ -50,7 +50,7 @@ extern "C" { #define kCPUsuf " " //unknown CPU #endif -#define kDCMdate "v1.0.20230210" +#define kDCMdate "v1.0.20230308" #define kDCMvers kDCMdate " " kJP2suf kLSsuf kCCsuf kCPUsuf static const int kMaxEPI3D = 1024; //maximum number of EPI images in Siemens Mosaic diff --git a/console/nii_dicom_batch.cpp b/console/nii_dicom_batch.cpp index 62252eba..a605e5e6 100644 --- a/console/nii_dicom_batch.cpp +++ b/console/nii_dicom_batch.cpp @@ -5093,7 +5093,11 @@ void nii_storeIntegerScaleFactor(int scale, struct nifti_1_header *hdr) { strcat(hdr->descrip, newstr); } -void nii_mask12bit(unsigned char *img, struct nifti_1_header *hdr) { +int int12toint16(int U12) { + return (short)(U12 & 0xFFF) - ((U12 & 0x800) << 1); +} + +void nii_mask12bit(unsigned char *img, struct nifti_1_header *hdr, bool isSigned) { //https://github.com/rordenlab/dcm2niix/issues/251 if (hdr->datatype != DT_INT16) return; @@ -5105,8 +5109,15 @@ void nii_mask12bit(unsigned char *img, struct nifti_1_header *hdr) { if (nVox < 1) return; int16_t *img16 = (int16_t *)img; - for (int i = 0; i < nVox; i++) - img16[i] = img16[i] & 4095; //12 bit data ranges from 0..4095, any other values are overflow + //issue 688 + if (isSigned) { + for (int i = 0; i < nVox; i++) + img16[i] = int12toint16(img16[i]); //signed 12 bit data ranges from 0..4095, any other values are overflow + + } else { + for (int i = 0; i < nVox; i++) + img16[i] = img16[i] & 4095; //12 bit data ranges from 0..4095, any other values are overflow + } } unsigned char * nii_uint16toFloat32(unsigned char *img, struct nifti_1_header *hdr, int isVerbose) { @@ -7183,7 +7194,7 @@ int saveDcm2NiiCore(int nConvert, struct TDCMsort dcmSort[], struct TDICOMdata d int *volOrderIndex = nii_saveDTI(pathoutname, nConvert, dcmSort, dcmList, opts, sliceDir, dti4D, &numADC, hdr0.dim[4]); PhilipsPrecise(&dcmList[dcmSort[0].indx], opts.isPhilipsFloatNotDisplayScaling, &hdr0, opts.isVerbose); if ((dcmList[dcmSort[0].indx].bitsStored == 12) && (dcmList[dcmSort[0].indx].bitsAllocated == 16)) - nii_mask12bit(imgM, &hdr0); + nii_mask12bit(imgM, &hdr0, dcmList[dcmSort[0].indx].isSigned); if ((opts.saveFormat == kSaveFormatMGH) && (hdr0.datatype == DT_UINT16)) imgM = nii_uint16toFloat32(imgM, &hdr0, opts.isVerbose); if ((opts.isMaximize16BitRange == kMaximize16BitRange_True) && (hdr0.datatype == DT_INT16)) { From 30263416be7dac8b8af91e07befe81733dc1a962 Mon Sep 17 00:00:00 2001 From: neurolabusc Date: Thu, 9 Mar 2023 08:33:41 -0500 Subject: [PATCH 64/85] use snprint: sprintf has been explicitly marked deprecated --- console/cJSON.cpp | 12 +++--- console/nii_dicom.cpp | 34 +++++++-------- console/nii_dicom_batch.cpp | 84 ++++++++++++++++++------------------- console/nii_dicom_batch.h | 3 +- console/nii_foreign.cpp | 2 +- 5 files changed, 68 insertions(+), 67 deletions(-) diff --git a/console/cJSON.cpp b/console/cJSON.cpp index bc95cde6..db83be24 100644 --- a/console/cJSON.cpp +++ b/console/cJSON.cpp @@ -95,7 +95,7 @@ CJSON_PUBLIC(char *) cJSON_GetStringValue(const cJSON * const item) { CJSON_PUBLIC(const char*) cJSON_Version(void) { static char version[15]; - sprintf(version, "%i.%i.%i", CJSON_VERSION_MAJOR, CJSON_VERSION_MINOR, CJSON_VERSION_PATCH); + snprintf(version, 15, "%i.%i.%i", CJSON_VERSION_MAJOR, CJSON_VERSION_MINOR, CJSON_VERSION_PATCH); return version; } @@ -505,22 +505,22 @@ static cJSON_bool print_number(const cJSON * const item, printbuffer * const out /* This checks for NaN and Infinity */ if ((d * 0) != 0) { - length = sprintf((char*)number_buffer, "null"); + length = snprintf((char*)number_buffer, 26, "null"); } else { /* Try 15 decimal places of precision to avoid nonsignificant nonzero digits */ - length = sprintf((char*)number_buffer, "%1.15g", d); + length = snprintf((char*)number_buffer, 26, "%1.15g", d); /* Check whether the original double can be recovered */ if ((sscanf((char*)number_buffer, "%lg", &test) != 1) || !compare_double((double)test, d)) { /* If not, print with 17 decimal places of precision */ - length = sprintf((char*)number_buffer, "%1.17g", d); + length = snprintf((char*)number_buffer, 26, "%1.17g", d); } } - /* sprintf failed or buffer overrun occurred */ + /* snprintf failed or buffer overrun occurred */ if ((length < 0) || (length > (int)(sizeof(number_buffer) - 1))) { return false; @@ -949,7 +949,7 @@ static cJSON_bool print_string_ptr(const unsigned char * const input, printbuffe break; default: /* escape and print as unicode codepoint */ - sprintf((char*)output_pointer, "u%04x", *input_pointer); + snprintf((char*)output_pointer, output_length, "u%04x", *input_pointer); output_pointer += 4; break; } diff --git a/console/nii_dicom.cpp b/console/nii_dicom.cpp index 59239518..1c9ecc84 100644 --- a/console/nii_dicom.cpp +++ b/console/nii_dicom.cpp @@ -683,12 +683,12 @@ int headerDcm2Nii2(struct TDICOMdata d, struct TDICOMdata d2, struct nifti_1_hea if (h->slice_code == NIFTI_SLICE_UNKNOWN) h->slice_code = d2.CSA.sliceOrder; //sometimes the first slice order is screwed up https://github.com/eauerbach/CMRR-MB/issues/29 if (d.modality == kMODALITY_MR) - sprintf(txt, "TE=%.2g;Time=%.3f", d.TE, d.acquisitionTime); + snprintf(txt, 1024, "TE=%.2g;Time=%.3f", d.TE, d.acquisitionTime); else - sprintf(txt, "Time=%.3f", d.acquisitionTime); + snprintf(txt, 1024, "Time=%.3f", d.acquisitionTime); if (d.CSA.phaseEncodingDirectionPositive >= 0) { char dtxt[1024] = {""}; - sprintf(dtxt, ";phase=%d", d.CSA.phaseEncodingDirectionPositive); + snprintf(dtxt, 1024, ";phase=%d", d.CSA.phaseEncodingDirectionPositive); strcat(txt, dtxt); } //from dicm2nii 20151117 InPlanePhaseEncodingDirection @@ -698,7 +698,7 @@ int headerDcm2Nii2(struct TDICOMdata d, struct TDICOMdata d2, struct nifti_1_hea h->dim_info = (3 << 4) + (2 << 2) + 1; if (d.CSA.multiBandFactor > 1) { char dtxt[1024] = {""}; - sprintf(dtxt, ";mb=%d", d.CSA.multiBandFactor); + snprintf(dtxt, 1024, ";mb=%d", d.CSA.multiBandFactor); strcat(txt, dtxt); } // GCC 8 warns about truncation using snprintf @@ -6093,7 +6093,7 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); int coilNumber = (int)strtol(iceStr, &end, 10); //if ((iceStr != end) && (coilNumber > 0) && (strlen(d.coilName) < 1)) { //nb with uncombined coil will still have a name, e.g. 'HeadNeck_64' if ((iceStr != end) && (coilNumber > 0)) { - sprintf(d.coilName, "%d", coilNumber); + snprintf(d.coilName, kDICOMStr, "%d", coilNumber); //printf("issue631 coil name '%s'\n", d.coilName); d.coilCrc = mz_crc32X((unsigned char *)&d.coilName, strlen(d.coilName)); } @@ -6904,7 +6904,7 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); if (!d.isHasPhase) d.isHasPhase = d.CSA.isPhaseMap; if ((d.CSA.coilNumber > 0) && (strlen(d.coilName) < 1)) { - sprintf(d.coilName, "%d", d.CSA.coilNumber); + snprintf(d.coilName, kDICOMStr, "%d", d.CSA.coilNumber); //printf("issue631 coil name '%s'\n", d.coilName); d.coilCrc = mz_crc32X((unsigned char *)&d.coilName, strlen(d.coilName)); } @@ -6967,7 +6967,7 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); //debug code to export binary data /* char str[kDICOMStr]; - sprintf(str, "%s_ge.bin",fname); + snprintf(str, kDICOMStr, "%s_ge.bin",fname); FILE *pFile = fopen(str, "wb"); fwrite(&buffer[lPos], 1, lLength, pFile); fclose (pFile); @@ -7292,30 +7292,30 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); // this section will report very little for implicit data //if (d.isHasReal) printf("r");else printf("m"); char str[kDICOMStr]; - sprintf(str, "%*c%04x,%04x %u@%zu ", sqDepth + 1, ' ', groupElement & 65535, groupElement >> 16, lLength, lFileOffset + lPos); + snprintf(str, kDICOMStr, "%*c%04x,%04x %u@%zu ", sqDepth + 1, ' ', groupElement & 65535, groupElement >> 16, lLength, lFileOffset + lPos); bool isStr = false; if (d.isExplicitVR) { - //sprintf(str, "%s%c%c ", str, vr[0], vr[1]); + //snprintf(str, kDICOMStr, "%s%c%c ", str, vr[0], vr[1]); //if (snprintf(str2, kDICOMStr-1, "%s%c%c", str, vr[0], vr[1]) < 0) exit(EXIT_FAILURE); strncat(str, &vr[0], 1); str[kDICOMStr-1] = '\0'; //silence warning -Wstringop-truncation strncat(str, &vr[1], 1); str[kDICOMStr-1] = '\0'; //silence warning -Wstringop-truncation strcat(str, " "); - //sprintf(str, "%s%c%c ", str2, vr[0], vr[1]); + //snprintf(str, kDICOMStr, "%s%c%c ", str2, vr[0], vr[1]); char str2[kDICOMStr] = ""; if ((vr[0] == 'F') && (vr[1] == 'D')) - sprintf(str2, "%g ", dcmFloatDouble(lLength, &buffer[lPos], d.isLittleEndian)); + snprintf(str2, kDICOMStr, "%g ", dcmFloatDouble(lLength, &buffer[lPos], d.isLittleEndian)); if ((vr[0] == 'F') && (vr[1] == 'L')) - sprintf(str2, "%g ", dcmFloat(lLength, &buffer[lPos], d.isLittleEndian)); + snprintf(str2, kDICOMStr, "%g ", dcmFloat(lLength, &buffer[lPos], d.isLittleEndian)); if ((vr[0] == 'S') && (vr[1] == 'S')) - sprintf(str2, "%d ", dcmInt(lLength, &buffer[lPos], d.isLittleEndian)); + snprintf(str2, kDICOMStr, "%d ", dcmInt(lLength, &buffer[lPos], d.isLittleEndian)); if ((vr[0] == 'S') && (vr[1] == 'L')) - sprintf(str2, "%d ", dcmInt(lLength, &buffer[lPos], d.isLittleEndian)); + snprintf(str2, kDICOMStr, "%d ", dcmInt(lLength, &buffer[lPos], d.isLittleEndian)); if ((vr[0] == 'U') && (vr[1] == 'S')) - sprintf(str2, "%d ", dcmInt(lLength, &buffer[lPos], d.isLittleEndian)); + snprintf(str2, kDICOMStr, "%d ", dcmInt(lLength, &buffer[lPos], d.isLittleEndian)); if ((vr[0] == 'U') && (vr[1] == 'L')) - sprintf(str, "%d ", dcmInt(lLength, &buffer[lPos], d.isLittleEndian)); + snprintf(str2, kDICOMStr, "%d ", dcmInt(lLength, &buffer[lPos], d.isLittleEndian)); if ((vr[0] == 'A') && (vr[1] == 'E')) isStr = true; if ((vr[0] == 'A') && (vr[1] == 'S')) @@ -7832,7 +7832,7 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); } if (((d.manufacturer == kMANUFACTURER_TOSHIBA) || (d.manufacturer == kMANUFACTURER_CANON)) && (B0Philips > 0.0)) { //issue 388 char txt[1024] = {""}; - sprintf(txt, "b=%d(", (int)round(B0Philips)); + snprintf(txt, 1024, "b=%d(", (int)round(B0Philips)); if (strstr(d.imageComments, txt) != NULL) { //printf("%s>>>%s %g\n", txt, d.imageComments, B0Philips); int len = strlen(txt); diff --git a/console/nii_dicom_batch.cpp b/console/nii_dicom_batch.cpp index a605e5e6..8c0bf671 100644 --- a/console/nii_dicom_batch.cpp +++ b/console/nii_dicom_batch.cpp @@ -815,7 +815,7 @@ void siemensCsaAscii(const char *filename, TCsaAscii *csaAscii, int csaOffset, i if (keyPosTi) { for (int k = 0; k < kMaxWipFree; k++) { char txt[1024] = {""}; - sprintf(txt, "%s%d]", keyStrTiFree, k); + snprintf(txt, 1024, "%s%d]", keyStrTiFree, k); csaAscii->alTI[k] = readKeyFloatNan(txt, keyPos, csaLengthTrim); } } @@ -828,7 +828,7 @@ void siemensCsaAscii(const char *filename, TCsaAscii *csaAscii, int csaOffset, i if (keyPosFree) { for (int k = 0; k < kMaxWipFree; k++) { char txt[1024] = {""}; - sprintf(txt, "%s%d]", keyStrAlFree, k); + snprintf(txt, 1024, "%s%d]", keyStrAlFree, k); csaAscii->alFree[k] = readKeyFloat(txt, keyPos, csaLengthTrim); } } @@ -847,7 +847,7 @@ void siemensCsaAscii(const char *filename, TCsaAscii *csaAscii, int csaOffset, i if (keyPosFree) { for (int k = 0; k < kMaxWipFree; k++) { char txt[1024] = {""}; - sprintf(txt, "%s%d]", keyStrAdFree, k); + snprintf(txt, 1024, "%s%d]", keyStrAdFree, k); csaAscii->adFree[k] = readKeyFloatNan(txt, keyPos, csaLengthTrim); } } @@ -1680,14 +1680,14 @@ tse3d: T2*/ for (int k = 11; k < 31; k++) { if (isValid) { char newstr[256]; - sprintf(newstr, "\t\"PLD%d\": %%g,\n", k-11); + snprintf(newstr, 256, "\t\"PLD%d\": %%g,\n", k-11); json_Float(fp, newstr, csaAscii.alFree[k]/ 1000.0); //ms -> sec if (csaAscii.alFree[k] <= 0.0) isValid = false; }//isValid } //for k */ for (int k = 3; k < 11; k++) { //vessel locations char newstr[256]; - sprintf(newstr, "\t\"sWipMemBlockAdFree%d\": %%g,\n", k); //issue483: sWipMemBlock.AdFree -> sWipMemBlockAdFree + snprintf(newstr, 256, "\t\"sWipMemBlockAdFree%d\": %%g,\n", k); //issue483: sWipMemBlock.AdFree -> sWipMemBlockAdFree json_FloatNotNan(fp, newstr, csaAscii.adFree[k]); } } @@ -3116,7 +3116,7 @@ int nii_createFilename(struct TDICOMdata dcm, char *niiFilename, struct TDCMopts inname[strlen(inname) - 4] = '\0'; } char outname[PATH_MAX] = {""}; - char newstr[256]; + char newstr[PATH_MAX]; if (strlen(inname) < 1) { strcpy(inname, "T%t_N%n_S%s"); } @@ -3156,7 +3156,7 @@ int nii_createFilename(struct TDICOMdata dcm, char *niiFilename, struct TDCMopts strcat(outname, dcm.seriesDescription); if (f == 'E') { isEchoReported = true; - sprintf(newstr, "%d", dcm.echoNum); + snprintf(newstr, PATH_MAX, "%d", dcm.echoNum); strcat(outname, newstr); } if (f == 'F') @@ -3208,28 +3208,28 @@ int nii_createFilename(struct TDICOMdata dcm, char *niiFilename, struct TDCMopts printWarning("Unable to append protocol name (0018,1030) to filename (it is empty).\n"); } if (f == 'R') { - sprintf(newstr, "%d", dcm.imageNum); + snprintf(newstr, PATH_MAX, "%d", dcm.imageNum); strcat(outname, newstr); isImageNumReported = true; } if (f == 'Q') strcat(outname, dcm.scanningSequence); if (f == 'S') { - sprintf(newstr, "%ld", dcm.seriesNum); + snprintf(newstr, PATH_MAX, "%ld", dcm.seriesNum); strcat(outname, newstr); isSeriesReported = true; } if (f == 'T') { - sprintf(newstr, "%0.0f", dcm.dateTime); + snprintf(newstr, PATH_MAX, "%0.0f", dcm.dateTime); strcat(outname, newstr); } if (f == 'U') { if (opts.isRenameNotConvert) { - sprintf(newstr, "%d", dcm.acquNum); + snprintf(newstr, PATH_MAX, "%d", dcm.acquNum); strcat(outname, newstr); //isAcquisitionReported = true; } else { - sprintf(newstr, "%d", dcm.acquNum); + snprintf(newstr, PATH_MAX, "%d", dcm.acquNum); strcat(outname, newstr); #ifdef mySegmentByAcq //isAcquisitionReported = true; @@ -3259,31 +3259,31 @@ int nii_createFilename(struct TDICOMdata dcm, char *niiFilename, struct TDCMopts if (f == 'X') strcat(outname, dcm.studyID); if ((f == 'Y') && (dcm.rawDataRunNumber >= 0)) { - sprintf(newstr, "%d", dcm.rawDataRunNumber); //GE (0019,10A2) else (0020,0100) + snprintf(newstr, PATH_MAX, "%d", dcm.rawDataRunNumber); //GE (0019,10A2) else (0020,0100) strcat(outname, newstr); } if (f == 'Z') strcat(outname, dcm.sequenceName); if ((f >= '0') && (f <= '9')) { if ((pos < strlen(inname)) && (toupper(inname[pos + 1]) == 'S')) { - char zeroPad[12] = {""}; - sprintf(zeroPad, "%%0%dd", f - '0'); - sprintf(newstr, zeroPad, dcm.seriesNum); + char zeroPad[128] = {""}; + snprintf(zeroPad, 128, "%%0%dd", f - '0'); + snprintf(newstr, PATH_MAX, zeroPad, dcm.seriesNum); strcat(outname, newstr); pos++; // e.g. %3f requires extra increment: skip both number and following character } if ((pos < strlen(inname)) && (toupper(inname[pos + 1]) == 'R')) { - char zeroPad[12] = {""}; - sprintf(zeroPad, "%%0%dd", f - '0'); - sprintf(newstr, zeroPad, dcm.imageNum); + char zeroPad[128] = {""}; + snprintf(zeroPad, 128, "%%0%dd", f - '0'); + snprintf(newstr, PATH_MAX, zeroPad, dcm.imageNum); isImageNumReported = true; strcat(outname, newstr); pos++; // e.g. %3f requires extra increment: skip both number and following character } if ((pos < strlen(inname)) && (toupper(inname[pos + 1]) == 'Y') && (dcm.rawDataRunNumber >= 0)) { - char zeroPad[12] = {""}; - sprintf(zeroPad, "%%0%dd", f - '0'); - sprintf(newstr, zeroPad, dcm.rawDataRunNumber); //GE (0019,10A2) else (0020,0100) + char zeroPad[128] = {""}; + snprintf(zeroPad, 128, "%%0%dd", f - '0'); + snprintf(newstr, PATH_MAX, zeroPad, dcm.rawDataRunNumber); //GE (0019,10A2) else (0020,0100) strcat(outname, newstr); pos++; // e.g. %3f requires extra increment: skip both number and following character } @@ -3298,7 +3298,7 @@ int nii_createFilename(struct TDICOMdata dcm, char *niiFilename, struct TDCMopts strcat(outname, newstr); } if ((isAddNamePostFixes) && (!isCoilReported) && (dcm.isCoilVaries)) { - //sprintf(newstr, "_c%d", dcm.coilNum); + //snprintf(newstr, PATH_MAX, "_c%d", dcm.coilNum); //strcat (outname,newstr); strcat(outname, "_c"); strcat(outname, dcm.coilName); @@ -3310,23 +3310,23 @@ int nii_createFilename(struct TDICOMdata dcm, char *niiFilename, struct TDCMopts if ((isAddNamePostFixes) && (!isEchoReported) && ((dcm.isMultiEcho) || (dcm.echoNum > 1))) { //multiple echoes saved as same series #endif if ((dcm.echoNum < 1) && (dcm.TE > 0)) - sprintf(newstr, "_e%g", dcm.TE); //issue568: Siemens XA20 might omit echo number + snprintf(newstr, PATH_MAX, "_e%g", dcm.TE); //issue568: Siemens XA20 might omit echo number else - sprintf(newstr, "_e%d", dcm.echoNum); + snprintf(newstr, PATH_MAX, "_e%d", dcm.echoNum); strcat(outname, newstr); isEchoReported = true; } if ((isAddNamePostFixes) && (!isSeriesReported) && (!isEchoReported) && (dcm.echoNum > 1)) { //last resort: user provided no method to disambiguate echo number in filename - sprintf(newstr, "_e%d", dcm.echoNum); + snprintf(newstr, PATH_MAX, "_e%d", dcm.echoNum); strcat(outname, newstr); isEchoReported = true; } if ((dcm.isNonParallelSlices) && (!isImageNumReported)) { - sprintf(newstr, "_i%05d", dcm.imageNum); + snprintf(newstr, PATH_MAX, "_i%05d", dcm.imageNum); strcat(outname, newstr); } /*if (dcm.maxGradDynVol > 0) { //Philips segmented - sprintf(newstr, "_v%04d", dcm.gradDynVol+1); //+1 as indexed from zero + snprintf(newstr, PATH_MAX, "_v%04d", dcm.gradDynVol+1); //+1 as indexed from zero strcat (outname,newstr); }*/ if ((isAddNamePostFixes) && (dcm.isHasImaginary)) { @@ -3344,7 +3344,7 @@ int nii_createFilename(struct TDICOMdata dcm, char *niiFilename, struct TDCMopts strcat(outname, "Mag"); //Philips enhanced with BOTH phase and Magnitude in single file } if ((isAddNamePostFixes) && (dcm.aslFlags == kASL_FLAG_NONE) && (dcm.triggerDelayTime >= 1) && (dcm.manufacturer != kMANUFACTURER_GE)) { //issue 336 GE uses this for slice timing - sprintf(newstr, "_t%d", (int)roundf(dcm.triggerDelayTime)); + snprintf(newstr, PATH_MAX, "_t%d", (int)roundf(dcm.triggerDelayTime)); strcat(outname, newstr); } //could add (isAddNamePostFixes) to these next two, but consequences could be catastrophic @@ -3422,8 +3422,8 @@ int nii_createFilename(struct TDICOMdata dcm, char *niiFilename, struct TDCMopts mkdir(newdir, 0700); #endif } - char ch[12] = {""}; - sprintf(ch, "%c", outname[pos]); + char ch[128] = {""}; + snprintf(ch, 128, "%c", outname[pos]); strcat(newdir, ch); } } @@ -3803,11 +3803,11 @@ int pigz_File(char *fname, struct TDCMopts opts, size_t imgsz) { strcat(command, opts.pigzname); if ((opts.gzLevel > 0) && (opts.gzLevel < 12)) { char newstr[256]; - sprintf(newstr, "\"%s -n -f -%d \"", blockSize, opts.gzLevel); + snprintf(newstr, 256, "\"%s -n -f -%d \"", blockSize, opts.gzLevel); strcat(command, newstr); } else { char newstr[256]; - sprintf(newstr, "\"%s -n \"", blockSize); + snprintf(newstr, 256, "\"%s -n \"", blockSize); strcat(command, newstr); } strcat(command, fname); @@ -4320,7 +4320,7 @@ int zmat_run(const size_t inputsize, unsigned char *inputstr, size_t *outputsize /** perform compression or encoding */ if(zipid==zmBase64){ /** base64 encoding */ - *outputbuf=base64_encode((const unsigned char*)inputstr, inputsize, outputsize); + *outputbuf=base64_encode((const unsigned char*)inputstr, inputsize, outputsize); }else if(zipid==zmZlib || zipid==zmGzip){ /** zlib (.zip) or gzip (.gz) compression */ if(zipid==zmZlib){ @@ -4998,7 +4998,7 @@ int nii_saveNII(char *niiFilename, struct nifti_1_header hdr, unsigned char *im, strcat(command, opts.pigzname); if ((opts.gzLevel > 0) && (opts.gzLevel < 12)) { char newstr[256]; - sprintf(newstr, "\" -n -f -%d > \"", opts.gzLevel); + snprintf(newstr, 256, "\" -n -f -%d > \"", opts.gzLevel); strcat(command, newstr); } else strcat(command, "\" -n -f > \""); //current versions of pigz (2.3) built on Windows can hang if the filename is included, presumably because it is not finding the path characters ':\' @@ -5075,9 +5075,9 @@ int nii_saveNII3D(char *niiFilename, struct nifti_1_header hdr, unsigned char *i char zeroPad[PATH_MAX] = {""}; double fnVol = nVol; int zeroPadLen = (1 + log10(fnVol)); - sprintf(zeroPad, "%%s_%%0%dd", zeroPadLen); + snprintf(zeroPad, PATH_MAX, "%%s_%%0%dd", zeroPadLen); for (int i = 1; i <= nVol; i++) { - sprintf(fname, zeroPad, niiFilename, i); + snprintf(fname, 2048, zeroPad, niiFilename, i); if (nii_saveNII(fname, hdr1, (unsigned char *)&im[pos], opts, d) == EXIT_FAILURE) return EXIT_FAILURE; pos += imgsz; @@ -5088,7 +5088,7 @@ int nii_saveNII3D(char *niiFilename, struct nifti_1_header hdr, unsigned char *i void nii_storeIntegerScaleFactor(int scale, struct nifti_1_header *hdr) { //appends NIfTI header description field with " isN" where N is integer scaling char newstr[256]; - sprintf(newstr, " is%d", scale); + snprintf(newstr, 256, " is%d", scale); if ((strlen(newstr) + strlen(hdr->descrip)) < 80) strcat(hdr->descrip, newstr); } @@ -7208,7 +7208,7 @@ int saveDcm2NiiCore(int nConvert, struct TDCMsort dcmSort[], struct TDICOMdata d #ifndef USING_DCM2NIIXFSWRAPPER printMessage("Convert %d DICOM as %s (%dx%dx%dx%d)\n", nConvert, pathoutname, hdr0.dim[1], hdr0.dim[2], hdr0.dim[3], hdr0.dim[4]); #else - printMessage( "Convert %d DICOM (%dx%dx%dx%d)\n", nConvert, hdr0.dim[1],hdr0.dim[2],hdr0.dim[3],hdr0.dim[4]); + printMessage( "Convert %d DICOM (%dx%dx%dx%d)\n", nConvert, hdr0.dim[1],hdr0.dim[2],hdr0.dim[3],hdr0.dim[4]); #endif #ifndef USING_R fflush(stdout); //show immediately if run from MRIcroGL GUI @@ -7312,7 +7312,7 @@ int saveDcm2NiiCore(int nConvert, struct TDCMsort dcmSort[], struct TDICOMdata d char pathoutnameROI[2048] = {""}; strcat(pathoutnameROI, pathoutname); char append[128] = {""}; - sprintf(append, "_ROI%d", j + 1); + snprintf(append, 127, "_ROI%d", j + 1); strcat(pathoutnameROI, append); struct nifti_1_header hdrr = hdrrx; hdrr.dim[0] = 3; @@ -8789,7 +8789,7 @@ void readFindPigz(struct TDCMopts *opts, const char *argv[]) { if (is_exe(opts->pigzname)) return; HMODULE hModule = GetModuleHandle(NULL); - if (hModule != NULL) { + if (hModule != NULL) { // https://stackoverflow.com/questions/1528298/get-path-of-executable char exepth[PATH_MAX]; GetModuleFileName(hModule, exepth, (sizeof(exepth))); @@ -8999,7 +8999,7 @@ void readIniFile(struct TDCMopts *opts, const char *argv[]) { void readIniFile(struct TDCMopts *opts, const char *argv[]) { setDefaultOpts(opts, argv); - sprintf(opts->optsname, "%s%s", getenv("HOME"), STATUSFILENAME); + snprintf(opts->optsname, kOptsStr, "%s%s", getenv("HOME"), STATUSFILENAME); FILE *fp = fopen(opts->optsname, "r"); if (fp == NULL) return; diff --git a/console/nii_dicom_batch.h b/console/nii_dicom_batch.h index 22398999..6271016e 100644 --- a/console/nii_dicom_batch.h +++ b/console/nii_dicom_batch.h @@ -54,11 +54,12 @@ void nii_clrMrifsStruct(); #define kSaveFormatBNII 4 #define MAX_NUM_SERIES 16 +#define kOptsStr 512 struct TDCMopts { bool isIgnoreTriggerTimes, isTestx0021x105E, isAddNamePostFixes, isSaveNativeEndian, isOneDirAtATime, isRenameNotConvert, isSave3D, isGz, isPipedGz, isFlipY, isCreateBIDS, isSortDTIbyBVal, isAnonymizeBIDS, isOnlyBIDS, isCreateText, isForceOnsetTimes,isIgnoreDerivedAnd2D, isPhilipsFloatNotDisplayScaling, isTiltCorrect, isRGBplanar, isOnlySingleFile, isForceStackDCE, isIgnoreSeriesInstanceUID, isRotate3DAcq, isCrop; int saveFormat, isMaximize16BitRange, isForceStackSameSeries, nameConflictBehavior, isVerbose, isProgress, compressFlag, dirSearchDepth, onlySearchDirForDICOM, gzLevel, diffCyclingModeGE; //support for compressed data 0=none, - char filename[512], outdir[512], indir[512], pigzname[512], optsname[512], indirParent[512], imageComments[24]; + char filename[kOptsStr], outdir[kOptsStr], indir[kOptsStr], pigzname[kOptsStr], optsname[kOptsStr], indirParent[kOptsStr], imageComments[24]; double seriesNumber[MAX_NUM_SERIES]; //requires double must store -1 (report but do not convert) as well as seriesUidCrc (uint32) long numSeries; #ifdef USING_R diff --git a/console/nii_foreign.cpp b/console/nii_foreign.cpp index 5547a58c..8377160c 100644 --- a/console/nii_foreign.cpp +++ b/console/nii_foreign.cpp @@ -399,7 +399,7 @@ unsigned char *readEcat7(const char *fname, struct TDICOMdata *dcm, struct nifti } dcm->manufacturer = kMANUFACTURER_SIEMENS; //dcm->manufacturersModelName = itoa(mhdr.system_type); - sprintf(dcm->manufacturersModelName, "%d", mhdr.system_type); + snprintf(dcm->manufacturersModelName, kDICOMStr, "%d", mhdr.system_type); dcm->bitsAllocated = bytesPerVoxel * 8; if (isScaleFactorVaries) dcm->isFloat = true; From 1023af0d610b9c744c0b5d845d7a601c255f1923 Mon Sep 17 00:00:00 2001 From: neurolabusc Date: Fri, 10 Mar 2023 07:38:51 -0500 Subject: [PATCH 65/85] snprintf (https://github.com/DaveGamble/cJSON/pull/389/files) --- console/cJSON.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/console/cJSON.cpp b/console/cJSON.cpp index db83be24..d694214d 100644 --- a/console/cJSON.cpp +++ b/console/cJSON.cpp @@ -95,7 +95,7 @@ CJSON_PUBLIC(char *) cJSON_GetStringValue(const cJSON * const item) { CJSON_PUBLIC(const char*) cJSON_Version(void) { static char version[15]; - snprintf(version, 15, "%i.%i.%i", CJSON_VERSION_MAJOR, CJSON_VERSION_MINOR, CJSON_VERSION_PATCH); + snprintf(version, sizeof(version), "%i.%i.%i", CJSON_VERSION_MAJOR, CJSON_VERSION_MINOR, CJSON_VERSION_PATCH); return version; } @@ -505,18 +505,18 @@ static cJSON_bool print_number(const cJSON * const item, printbuffer * const out /* This checks for NaN and Infinity */ if ((d * 0) != 0) { - length = snprintf((char*)number_buffer, 26, "null"); + length = snprintf((char*)number_buffer, sizeof(number_buffer), "null"); } else { /* Try 15 decimal places of precision to avoid nonsignificant nonzero digits */ - length = snprintf((char*)number_buffer, 26, "%1.15g", d); + length = snprintf((char*)number_buffer, sizeof(number_buffer), "%1.15g", d); /* Check whether the original double can be recovered */ if ((sscanf((char*)number_buffer, "%lg", &test) != 1) || !compare_double((double)test, d)) { /* If not, print with 17 decimal places of precision */ - length = snprintf((char*)number_buffer, 26, "%1.17g", d); + length = snprintf((char*)number_buffer, sizeof(number_buffer), "%1.17g", d); } } @@ -949,7 +949,7 @@ static cJSON_bool print_string_ptr(const unsigned char * const input, printbuffe break; default: /* escape and print as unicode codepoint */ - snprintf((char*)output_pointer, output_length, "u%04x", *input_pointer); + snprintf((char*)output_pointer, output_buffer->length - (output_pointer - output_buffer->buffer), "u%04x", *input_pointer); output_pointer += 4; break; } From 6fdf95fd45f7f6644a22a7840c7613f42a4b0cdc Mon Sep 17 00:00:00 2001 From: neurolabusc Date: Sat, 11 Mar 2023 11:03:03 -0500 Subject: [PATCH 66/85] Experimental Bruker support (https://github.com/rordenlab/dcm2niix/issues/265) --- console/nii_dicom.cpp | 71 ++++++++++++------------------------- console/nii_dicom.h | 2 +- console/nii_dicom_batch.cpp | 2 +- 3 files changed, 25 insertions(+), 50 deletions(-) diff --git a/console/nii_dicom.cpp b/console/nii_dicom.cpp index 1c9ecc84..8267ed4e 100644 --- a/console/nii_dicom.cpp +++ b/console/nii_dicom.cpp @@ -4019,7 +4019,15 @@ void _update_tvd(struct TVolumeDiffusion *ptvd) { } } } - if (!isReady) { //bvecs NOT filled: see if symBMatrix filled + if ((!isReady) && (ptvd->_dtiV[0] < 100.0) && (!isnan(ptvd->_symBMatrix[0]))) { + //issue265: Bruker omits 0018,9089 for low b-values though it includes a bmatrix + ptvd->_dtiV[1] = 0.0; + ptvd->_dtiV[2] = 0.0; + ptvd->_dtiV[3] = 0.0; + isReady = true; + + } + /*if (!isReady) { //bvecs NOT filled: see if symBMatrix filled isReady = true; for (int i = 1; i < 6; ++i) if (isnan(ptvd->_symBMatrix[i])) @@ -4068,11 +4076,7 @@ void _update_tvd(struct TVolumeDiffusion *ptvd) { ptvd->_dtiV[1] = bVec.v[0]; ptvd->_dtiV[2] = bVec.v[1]; ptvd->_dtiV[3] = bVec.v[2]; - //printf("bmat=[%g %g %g %g %g %g %g %g %g]\n", ptvd->_symBMatrix[0],ptvd->_symBMatrix[1],ptvd->_symBMatrix[2], ptvd->_symBMatrix[1],ptvd->_symBMatrix[3],ptvd->_symBMatrix[4], ptvd->_symBMatrix[2],ptvd->_symBMatrix[4],ptvd->_symBMatrix[5]); - //printf("bmats=[%g %g %g %g %g %g];\n", ptvd->_symBMatrix[0],ptvd->_symBMatrix[1],ptvd->_symBMatrix[2],ptvd->_symBMatrix[3],ptvd->_symBMatrix[4],ptvd->_symBMatrix[5]); - //printf("bvec=[%g %g %g];\n", ptvd->_dtiV[1], ptvd->_dtiV[2], ptvd->_dtiV[3]); - //printf("bval=%g;\n\n", ptvd->_dtiV[0]); - } + }*/ if (!isReady) return; // If still here, update dd and *pdti4D. @@ -4393,11 +4397,11 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); #define kArterialSpinLabelingContrast 0x0018 + uint32_t(0x9250 << 16) //CS #define kASLPulseTrainDuration 0x0018 + uint32_t(0x9258 << 16) //UL #define kDiffusionBValueXX 0x0018 + uint32_t(0x9602 << 16) //FD -#define kDiffusionBValueXY 0x0018 + uint32_t(0x9603 << 16) //FD -#define kDiffusionBValueXZ 0x0018 + uint32_t(0x9604 << 16) //FD -#define kDiffusionBValueYY 0x0018 + uint32_t(0x9605 << 16) //FD -#define kDiffusionBValueYZ 0x0018 + uint32_t(0x9606 << 16) //FD -#define kDiffusionBValueZZ 0x0018 + uint32_t(0x9607 << 16) //FD +//#define kDiffusionBValueXY 0x0018 + uint32_t(0x9603 << 16) //FD +//#define kDiffusionBValueXZ 0x0018 + uint32_t(0x9604 << 16) //FD +//#define kDiffusionBValueYY 0x0018 + uint32_t(0x9605 << 16) //FD +//#define kDiffusionBValueYZ 0x0018 + uint32_t(0x9606 << 16) //FD +//#define kDiffusionBValueZZ 0x0018 + uint32_t(0x9607 << 16) //FD #define kNumberOfImagesInMosaic 0x0019 + (0x100A << 16) //US NumberOfImagesInMosaic //https://nmrimaging.wordpress.com/2011/12/20/when-we-process/ // https://nciphub.org/groups/qindicom/wiki/DiffusionrelatedDICOMtags:experienceacrosssites?action=pdf @@ -4596,6 +4600,8 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); double TE = 0.0; //most recent echo time recorded float temporalResolutionMS = 0.0; float MRImageDynamicScanBeginTime = 0.0; + bool isHasBMatrix = false; + bool isHasBVec = false; bool is2005140FSQ = false; bool is4000561SQ = false; //Original Attributes SQ bool is00089092SQ = false; //Referenced Image Evidence SQ @@ -6675,7 +6681,8 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); // ((d.manufacturer == kMANUFACTURER_PHILIPS) && !is2005140FSQ)) && // (isAtFirstPatientPosition || isnan(d.patientPosition[1]))) //if((d.manufacturer == kMANUFACTURER_SIEMENS) || ((d.manufacturer == kMANUFACTURER_PHILIPS) && !is2005140FSQ)) - if ((d.manufacturer == kMANUFACTURER_MEDISO) || (d.manufacturer == kMANUFACTURER_TOSHIBA) || (d.manufacturer == kMANUFACTURER_CANON) || (d.manufacturer == kMANUFACTURER_HITACHI) || (d.manufacturer == kMANUFACTURER_SIEMENS) || (d.manufacturer == kMANUFACTURER_PHILIPS)) { + if (true) { + //if ((d.manufacturer == kMANUFACTURER_MEDISO) || (d.manufacturer == kMANUFACTURER_TOSHIBA) || (d.manufacturer == kMANUFACTURER_CANON) || (d.manufacturer == kMANUFACTURER_HITACHI) || (d.manufacturer == kMANUFACTURER_SIEMENS) || (d.manufacturer == kMANUFACTURER_PHILIPS)) { //for kMANUFACTURER_HITACHI see https://nciphub.org/groups/qindicom/wiki/StandardcompliantenhancedmultiframeDWI float v[4]; //dcmMultiFloat(lLength, (char*)&buffer[lPos], 3, v); @@ -6692,6 +6699,7 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); hasDwiDirectionality = true; d.isBVecWorldCoordinates = true; //e.g. Canon saved image space coordinates in Comments, world space in 0018, 9089 set_orientation0018_9089(&volDiffusion, lLength, &buffer[lPos], d.isLittleEndian); + isHasBVec = true; } break; case kImagingFrequencyFD: @@ -6732,42 +6740,7 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); break; //other manufacturers provide bvec directly, rather than bmatrix double bMat = dcmFloatDouble(lLength, &buffer[lPos], d.isLittleEndian); set_bMatrix(&volDiffusion, bMat, 0); - break; - } - case kDiffusionBValueXY: { - if (!(d.manufacturer == kMANUFACTURER_BRUKER)) - break; //other manufacturers provide bvec directly, rather than bmatrix - double bMat = dcmFloatDouble(lLength, &buffer[lPos], d.isLittleEndian); - set_bMatrix(&volDiffusion, bMat, 1); - break; - } - case kDiffusionBValueXZ: { - if (!(d.manufacturer == kMANUFACTURER_BRUKER)) - break; //other manufacturers provide bvec directly, rather than bmatrix - double bMat = dcmFloatDouble(lLength, &buffer[lPos], d.isLittleEndian); - set_bMatrix(&volDiffusion, bMat, 2); - break; - } - case kDiffusionBValueYY: { - if (!(d.manufacturer == kMANUFACTURER_BRUKER)) - break; //other manufacturers provide bvec directly, rather than bmatrix - double bMat = dcmFloatDouble(lLength, &buffer[lPos], d.isLittleEndian); - set_bMatrix(&volDiffusion, bMat, 3); - break; - } - case kDiffusionBValueYZ: { - if (!(d.manufacturer == kMANUFACTURER_BRUKER)) - break; //other manufacturers provide bvec directly, rather than bmatrix - double bMat = dcmFloatDouble(lLength, &buffer[lPos], d.isLittleEndian); - set_bMatrix(&volDiffusion, bMat, 4); - break; - } - case kDiffusionBValueZZ: { - if (!(d.manufacturer == kMANUFACTURER_BRUKER)) - break; //other manufacturers provide bvec directly, rather than bmatrix - double bMat = dcmFloatDouble(lLength, &buffer[lPos], d.isLittleEndian); - set_bMatrix(&volDiffusion, bMat, 5); - d.isVectorFromBMatrix = true; + isHasBMatrix = true; break; } case kSliceNumberMrPhilips: { @@ -7500,6 +7473,8 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); d.isDerived = true; //to my knowledge, palette images always derived printWarning("Photometric Interpretation 'PALETTE COLOR' not supported\n"); } + if ((isHasBMatrix) && (!isHasBVec)) + printWarning("Underspecified BMatrix without BVector (issue 265)\n"); if ((d.compressionScheme == kCompress50) && (d.bitsAllocated > 8)) { //dcmcjpg with +ee can create .51 syntax images that are 8,12,16,24-bit: we can only decode 8/24-bit printError("Unable to decode %d-bit images with Transfer Syntax 1.2.840.10008.1.2.4.51, decompress with dcmdjpg or gdcmconv\n", d.bitsAllocated); diff --git a/console/nii_dicom.h b/console/nii_dicom.h index acd64004..55e8b32d 100644 --- a/console/nii_dicom.h +++ b/console/nii_dicom.h @@ -50,7 +50,7 @@ extern "C" { #define kCPUsuf " " //unknown CPU #endif -#define kDCMdate "v1.0.20230308" +#define kDCMdate "v1.0.20230311" #define kDCMvers kDCMdate " " kJP2suf kLSsuf kCCsuf kCPUsuf static const int kMaxEPI3D = 1024; //maximum number of EPI images in Siemens Mosaic diff --git a/console/nii_dicom_batch.cpp b/console/nii_dicom_batch.cpp index 8c0bf671..80af5e23 100644 --- a/console/nii_dicom_batch.cpp +++ b/console/nii_dicom_batch.cpp @@ -390,7 +390,7 @@ void siemensPhilipsCorrectBvecs(struct TDICOMdata *d, int sliceDir, struct TDTI for (int i = 0; i < d->CSA.numDti; i++) { float vLen = sqrt((vx[i].V[1] * vx[i].V[1]) + (vx[i].V[2] * vx[i].V[2]) + (vx[i].V[3] * vx[i].V[3])); if ((vx[i].V[0] <= FLT_EPSILON) || (vLen <= FLT_EPSILON)) { //bvalue=0 - if ((vx[i].V[0] > 5.0) && (!d->isDerived)) //Philip stores n.b. UIH B=1.25126 Vec=0,0,0 while Philips stored isotropic images + if ((vx[i].V[0] > 50.0) && (!d->isDerived)) //Philip stores n.b. UIH B=1.25126 Vec=0,0,0 while Philips stored isotropic images printWarning("Volume %d appears to be derived image ADC/Isotropic (non-zero b-value with zero vector length)\n", i); continue; //do not normalize or reorient b0 vectors } //if bvalue=0 From a38d7c1f8307bea74b53c8203e50b0da772e0ab4 Mon Sep 17 00:00:00 2001 From: neurolabusc Date: Mon, 13 Mar 2023 15:45:02 -0400 Subject: [PATCH 67/85] Siemens fldyn3d1 kludge for XA (https://github.com/rordenlab/dcm2niix/issues/689) --- console/nii_dicom.cpp | 5 ++++- console/nii_dicom.h | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/console/nii_dicom.cpp b/console/nii_dicom.cpp index 8267ed4e..91514e57 100644 --- a/console/nii_dicom.cpp +++ b/console/nii_dicom.cpp @@ -7786,7 +7786,10 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); if ((d.manufacturer == kMANUFACTURER_SIEMENS) && (strstr(d.sequenceName, "fldyn3d1") != NULL)) { //combine DCE series https://github.com/rordenlab/dcm2niix/issues/252 d.isStackableSeries = true; - d.imageNum += (d.seriesNum * 1000); + if (d.isXA10A) //issue689 + d.imageNum += (d.acquNum * 1000); + else + d.imageNum += (d.seriesNum * 1000); strcpy(d.seriesInstanceUID, d.studyInstanceUID); d.seriesUidCrc = mz_crc32X((unsigned char *)&d.protocolName, strlen(d.protocolName)); } diff --git a/console/nii_dicom.h b/console/nii_dicom.h index 55e8b32d..c9c5609c 100644 --- a/console/nii_dicom.h +++ b/console/nii_dicom.h @@ -50,7 +50,7 @@ extern "C" { #define kCPUsuf " " //unknown CPU #endif -#define kDCMdate "v1.0.20230311" +#define kDCMdate "v1.0.20230313" #define kDCMvers kDCMdate " " kJP2suf kLSsuf kCCsuf kCPUsuf static const int kMaxEPI3D = 1024; //maximum number of EPI images in Siemens Mosaic From 1a576ef2bfc516b183e089ff44237ee0729115f3 Mon Sep 17 00:00:00 2001 From: neurolabusc Date: Mon, 13 Mar 2023 15:55:54 -0400 Subject: [PATCH 68/85] Limit scope of VE* fldyn3d1 kludge --- console/nii_dicom.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/console/nii_dicom.cpp b/console/nii_dicom.cpp index 91514e57..0706689a 100644 --- a/console/nii_dicom.cpp +++ b/console/nii_dicom.cpp @@ -7785,13 +7785,14 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); //if ((d.manufacturer == kMANUFACTURER_SIEMENS) && (strcmp(d.sequenceName, "fldyn3d1")== 0)) { if ((d.manufacturer == kMANUFACTURER_SIEMENS) && (strstr(d.sequenceName, "fldyn3d1") != NULL)) { //combine DCE series https://github.com/rordenlab/dcm2niix/issues/252 - d.isStackableSeries = true; if (d.isXA10A) //issue689 d.imageNum += (d.acquNum * 1000); - else + else { + d.isStackableSeries = true; d.imageNum += (d.seriesNum * 1000); - strcpy(d.seriesInstanceUID, d.studyInstanceUID); - d.seriesUidCrc = mz_crc32X((unsigned char *)&d.protocolName, strlen(d.protocolName)); + strcpy(d.seriesInstanceUID, d.studyInstanceUID); + d.seriesUidCrc = mz_crc32X((unsigned char *)&d.protocolName, strlen(d.protocolName)); + } } //TODO533: alias Philips ASL PLD as frameDuration? isKludgeIssue533 //if ((d.manufacturer == kMANUFACTURER_PHILIPS) && ((!isTriggerSynced) || (!isProspectiveSynced)) ) //issue408 From c2a4b28e7ae7d4761a959b44dda5c6c34986b300 Mon Sep 17 00:00:00 2001 From: neurolabusc Date: Wed, 15 Mar 2023 13:52:43 -0400 Subject: [PATCH 69/85] Improve detection of GE isotropic diffusion (https://github.com/rordenlab/dcm2niix/issues/690) --- console/nii_dicom.cpp | 11 +++++++++-- console/nii_dicom.h | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/console/nii_dicom.cpp b/console/nii_dicom.cpp index 0706689a..4a54d618 100644 --- a/console/nii_dicom.cpp +++ b/console/nii_dicom.cpp @@ -4447,7 +4447,7 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); #define kTemporalPositionIndex 0x0020 + uint32_t(0x9128 << 16) // UL #define kDimensionIndexPointer 0x0020 + uint32_t(0x9165 << 16) //Private Group 21 as Used by Siemens: -#define kScanningSequenceSiemens 0x0021 + (0x105A << 16) //CS +#define kScanningSequenceSiemens 0x0021 + (0x105A << 16) //CS n.b. for GE this is Diffusion direction of SL! #define kSequenceVariant21 0x0021 + (0x105B << 16) //CS Siemens ONLY: For GE this is TaggingFlipAngle #define kScanOptionsSiemens 0x0021 + (0x105C << 16) //CS Siemens ONLY #define kPATModeText 0x0021 + (0x1009 << 16) //LO, see kImaPATModeText @@ -4683,6 +4683,7 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); char scanningSequenceSiemens[kDICOMStr] = ""; char imageType1st[kDICOMStr] = ""; bool isEncapsulatedData = false; + int diffusionDirectionTypeGE = 0; //issue690 int multiBandFactor = 0; int frequencyRows = 0; int numberOfImagesInMosaic = 0; @@ -6540,7 +6541,10 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); break; //warp } case kScanningSequenceSiemens: - dcmStr(lLength, &buffer[lPos], scanningSequenceSiemens); + if (d.manufacturer == kMANUFACTURER_SIEMENS) + dcmStr(lLength, &buffer[lPos], scanningSequenceSiemens); + if (d.manufacturer == kMANUFACTURER_GE) //issue690 + diffusionDirectionTypeGE = dcmInt(lLength, &buffer[lPos], d.isLittleEndian); break; case kSequenceVariant21: if (d.manufacturer != kMANUFACTURER_SIEMENS) @@ -7942,6 +7946,9 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); //in practice 0020,0110 not used //https://github.com/bids-standard/bep001/blob/repetitiontime/Proposal_RepetitionTime.md } + //issue690 + if ((d.manufacturer == kMANUFACTURER_GE) && (diffusionDirectionTypeGE > 0) && (diffusionDirectionTypeGE != 16)) + d.numberOfDiffusionDirectionGE = 0; //issue 542 if ((d.manufacturer == kMANUFACTURER_GE) && (isNeologica) && (!isSameFloat(d.CSA.dtiV[0], 0.0f)) && ((isSameFloat(d.CSA.dtiV[1], 0.0f)) && (isSameFloat(d.CSA.dtiV[2], 0.0f)) && (isSameFloat(d.CSA.dtiV[3], 0.0f)) ) ) printWarning("GE DWI vectors may have been removed by Neologica DICOM Anonymizer Pro (Issue 542)\n"); diff --git a/console/nii_dicom.h b/console/nii_dicom.h index c9c5609c..c83e7a54 100644 --- a/console/nii_dicom.h +++ b/console/nii_dicom.h @@ -50,7 +50,7 @@ extern "C" { #define kCPUsuf " " //unknown CPU #endif -#define kDCMdate "v1.0.20230313" +#define kDCMdate "v1.0.20230315" #define kDCMvers kDCMdate " " kJP2suf kLSsuf kCCsuf kCPUsuf static const int kMaxEPI3D = 1024; //maximum number of EPI images in Siemens Mosaic From e1c6845734fcd204128fb77d658846c165179959 Mon Sep 17 00:00:00 2001 From: neurolabusc Date: Thu, 16 Mar 2023 07:33:11 -0400 Subject: [PATCH 70/85] GE Vas collapse flag (0043,1030) (https://github.com/rordenlab/dcm2niix/issues/690) --- console/nii_dicom.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/console/nii_dicom.cpp b/console/nii_dicom.cpp index 4a54d618..5353b7f3 100644 --- a/console/nii_dicom.cpp +++ b/console/nii_dicom.cpp @@ -4497,6 +4497,7 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); #define kShimGradientX 0x0043 + (0x1002 << 16) //SS #define kShimGradientY 0x0043 + (0x1003 << 16) //SS #define kShimGradientZ 0x0043 + (0x1004 << 16) //SS +#define kVasCollapseFlagGE 0x0043 + (0x1030 << 16) //SS issue690 #define kPrescanReuseString 0x0043 + (0x1095 << 16) //LO #define kUserDefineDataGE 0x0043 + (0x102A << 16) //OB #define kEffectiveEchoSpacingGE 0x0043 + (0x102C << 16) //SS @@ -6923,6 +6924,11 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); break; d.shimGradientZ = dcmIntSS(lLength, &buffer[lPos], d.isLittleEndian); break; + case kVasCollapseFlagGE: //SS issue 690 16=DiffusionDtiDicomValue + if (d.manufacturer != kMANUFACTURER_GE) + break; + diffusionDirectionTypeGE = dcmIntSS(lLength, &buffer[lPos], d.isLittleEndian); + break; case kPrescanReuseString: //LO if (d.manufacturer != kMANUFACTURER_GE) break; From 54b32abbfd2407a688a5219d902363f37729635a Mon Sep 17 00:00:00 2001 From: neurolabusc Date: Thu, 16 Mar 2023 16:06:28 -0400 Subject: [PATCH 71/85] -c argument overrides existing comments (https://github.com/rordenlab/dcm2niix/issues/691) --- console/main_console.cpp | 4 +++- console/nii_dicom.cpp | 4 +++- console/nii_dicom_batch.cpp | 9 ++++++--- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/console/main_console.cpp b/console/main_console.cpp index b64b987d..539fd276 100644 --- a/console/main_console.cpp +++ b/console/main_console.cpp @@ -78,7 +78,7 @@ void showHelp(const char *argv[], struct TDCMopts opts) { printf(" -a : adjacent DICOMs (images from same series always in same folder) for faster conversion (n/y, default n)\n"); printf(" -b : BIDS sidecar (y/n/o [o=only: no NIfTI], default %c)\n", bool2Char(opts.isCreateBIDS)); printf(" -ba : anonymize BIDS (y/n, default %c)\n", bool2Char(opts.isAnonymizeBIDS)); - printf(" -c : comment stored in NIfTI aux_file (provide up to 24 characters e.g. '-c first_visit')\n"); + 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 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"); @@ -352,6 +352,8 @@ int main(int argc, const char *argv[]) { } else if ((argv[i][1] == 'c') && ((i + 1) < argc)) { i++; snprintf(opts.imageComments, 24, "%s", argv[i]); + if (strlen(opts.imageComments) == 0) //empty string is flag to anonymize DICOM image comments + snprintf(opts.imageComments, 24, "%s", "\t"); } else if ((argv[i][1] == 'd') && ((i + 1) < argc)) { i++; if ((argv[i][0] >= '0') && (argv[i][0] <= '9')) diff --git a/console/nii_dicom.cpp b/console/nii_dicom.cpp index 5353b7f3..f0c98310 100644 --- a/console/nii_dicom.cpp +++ b/console/nii_dicom.cpp @@ -705,8 +705,10 @@ int headerDcm2Nii2(struct TDICOMdata d, struct TDICOMdata d2, struct nifti_1_hea // snprintf(h->descrip,80, "%s",txt); memcpy(h->descrip, txt, 79); h->descrip[79] = '\0'; - if (strlen(d.imageComments) > 0) + if ((strlen(d.imageComments) > 0) && (h->aux_file[0] == 0)) //issue691 snprintf(h->aux_file, 24, "%.23s", d.imageComments); + if ((h->aux_file[0] == '\t') && (h->aux_file[1] == 0)) + h->aux_file[0] = 0; //issue691 return headerDcm2NiiSForm(d, d2, h, isVerbose); } //headerDcm2Nii2() diff --git a/console/nii_dicom_batch.cpp b/console/nii_dicom_batch.cpp index 80af5e23..eea31288 100644 --- a/console/nii_dicom_batch.cpp +++ b/console/nii_dicom_batch.cpp @@ -1387,8 +1387,11 @@ tse3d: T2*/ // if (d.acquisitionDate > 0.0) fprintf(fp, "\t\"AcquisitionDate\": %8.0f,\n", d.acquisitionDate ); if (d.acquNum > 0) fprintf(fp, "\t\"AcquisitionNumber\": %d,\n", d.acquNum); - json_Str(fp, "\t\"ImageComments\": \"%s\",\n", d.imageComments); - json_Str(fp, "\t\"ConversionComments\": \"%s\",\n", opts.imageComments); + bool maskComments = (strlen(opts.imageComments) == 1) && (opts.imageComments[0] == '\t'); + if (!maskComments) { + json_Str(fp, "\t\"ImageComments\": \"%s\",\n", d.imageComments); + json_Str(fp, "\t\"ConversionComments\": \"%s\",\n", opts.imageComments); + } //if conditionals: the following values are required for DICOM MRI, but not available for CT json_Float(fp, "\t\"TriggerDelayTime\": %g,\n", d.triggerDelayTime); if (d.RWVScale != 0) { @@ -6678,7 +6681,7 @@ int saveDcm2NiiCore(int nConvert, struct TDCMsort dcmSort[], struct TDICOMdata d mrifsStruct.tdicomData = dcmList[indx]; // first in sorted list dcmSort #endif - struct nifti_1_header hdr0; + struct nifti_1_header hdr0 = {0}; unsigned char *img = nii_loadImgXL(nameList->str[indx], &hdr0, dcmList[indx], iVaries, opts.compressFlag, opts.isVerbose, dti4D); if (strlen(opts.imageComments) > 0) { for (int i = 0; i < 24; i++) From 6928d7676cce8fdfa274b9a5bf5865393a537188 Mon Sep 17 00:00:00 2001 From: neurolabusc Date: Mon, 20 Mar 2023 15:16:56 -0400 Subject: [PATCH 72/85] Auto-detect non-sense instance numbers (https://github.com/rordenlab/dcm2niix/issues/622) --- console/nii_dicom.cpp | 2 +- console/nii_dicom.h | 2 +- console/nii_dicom_batch.cpp | 38 +++++++++++++++++++++++++++---------- 3 files changed, 30 insertions(+), 12 deletions(-) diff --git a/console/nii_dicom.cpp b/console/nii_dicom.cpp index f0c98310..7b6a7d08 100644 --- a/console/nii_dicom.cpp +++ b/console/nii_dicom.cpp @@ -4385,7 +4385,7 @@ struct TDICOMdata readDICOMx(char *fname, struct TDCMprefs *prefs, struct TDTI4D #define kParallelAcquisitionTechnique 0x0018 + uint32_t(0x9078 << 16) //CS: SENSE, SMASH #define kInversionTimes 0x0018 + uint32_t(0x9079 << 16) //FD #define kPartialFourier 0x0018 + uint32_t(0x9081 << 16) //CS -const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); +const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); //FD //#define kDiffusionBFactorSiemens 0x0019+(0x100C<< 16 ) // 0019;000C;SIEMENS MR HEADER;B_value #define kDiffusion_bValue 0x0018 + uint32_t(0x9087 << 16) // FD #define kDiffusionOrientation 0x0018 + uint32_t(0x9089 << 16) // FD, seen in enhanced DICOM from Philips 5.* and Siemens XA10. diff --git a/console/nii_dicom.h b/console/nii_dicom.h index c83e7a54..4d010f40 100644 --- a/console/nii_dicom.h +++ b/console/nii_dicom.h @@ -50,7 +50,7 @@ extern "C" { #define kCPUsuf " " //unknown CPU #endif -#define kDCMdate "v1.0.20230315" +#define kDCMdate "v1.0.20230320" #define kDCMvers kDCMdate " " kJP2suf kLSsuf kCCsuf kCPUsuf static const int kMaxEPI3D = 1024; //maximum number of EPI images in Siemens Mosaic diff --git a/console/nii_dicom_batch.cpp b/console/nii_dicom_batch.cpp index eea31288..b5b98fa9 100644 --- a/console/nii_dicom_batch.cpp +++ b/console/nii_dicom_batch.cpp @@ -59,6 +59,7 @@ #ifndef M_PI #define M_PI 3.14159265358979323846 #endif +#define kSliceTolerance 0.2 #if defined(_WIN64) || defined(_WIN32) const char kPathSeparator = '\\'; @@ -2809,12 +2810,35 @@ int compareTFloatSort(const void *a, const void *b) { return 0; } // compareTFloatSort() + +int isSameFloatT(float a, float b, float tolerance) { + return (fabs(a - b) <= tolerance); +} + bool ensureSequentialSlicePositions(int d3, int d4, struct TDCMsort dcmSort[], struct TDICOMdata dcmList[], int verbose) { //ensure slice position is sequential: either ascending [1 2 3] or descending [3 2 1], not [1 3 2], [3 1 2] etc. //n.b. as currently designed, this will force swapDim3Dim4() for 4D data int nConvert = d3 * d4; if (d3 < 3) return true; //always consistent + //first pass: check order: issue 622 + int i = 0; + bool isSequential = true; + for (int t = 0; t < d4; t++) { //for each volume + float dx = intersliceDistanceSigned(dcmList[dcmSort[i].indx], dcmList[dcmSort[i + 1].indx]); + for (int z = 0; z < d3; z++) { //for slice + if (z > 0) { + float dx2 = intersliceDistanceSigned(dcmList[dcmSort[i - 1].indx], dcmList[dcmSort[i].indx]); + if (!isSameFloatT(dx, dx2, kSliceTolerance)) + isSequential = false; + } //if not 1st slice (which does not have prior slice) + i++; + } //for each slice + } //for each volume + if (isSequential) + return true; + //second pass: fix if required + printWarning("Instance Number (0020,0013) order is not spatial.\n"); TFloatSort *floatSort = (TFloatSort *)malloc(nConvert * sizeof(TFloatSort)); int minVol = dcmList[dcmSort[0].indx].rawDataRunNumber; int maxVol = minVol; @@ -5278,10 +5302,6 @@ int siemensCtKludge(int nConvert, struct TDCMsort dcmSort[], struct TDICOMdata d return nConvert; //all images in sequential order } // siemensCtKludge() -int isSameFloatT(float a, float b, float tolerance) { - return (fabs(a - b) <= tolerance); -} - void adjustOriginForNegativeTilt(struct nifti_1_header *hdr, float shiftPxY) { if (hdr->sform_code > 0) { // Adjust the srow_* offsets using srow_y @@ -6908,17 +6928,15 @@ int saveDcm2NiiCore(int nConvert, struct TDCMsort dcmSort[], struct TDICOMdata d } //if PET //next: detect variable inter-slice distance float dx = intersliceDistance(dcmList[dcmSort[0].indx], dcmList[dcmSort[1].indx]); -#ifdef myInstanceNumberOrderIsNotSpatial +//#ifdef myInstanceNumberOrderIsNotSpatial if (!isSameFloat(dx, 0.0)) //only for XYZT, not TXYZ: perhaps run for swapDim3Dim4? Extremely rare anomaly if (!ensureSequentialSlicePositions(hdr0.dim[3], hdr0.dim[4], dcmSort, dcmList, opts.isVerbose)) dx = intersliceDistance(dcmList[dcmSort[0].indx], dcmList[dcmSort[1].indx]); indx0 = dcmSort[0].indx; - //if (nConvert > 1) - // indx1 = dcmSort[1].indx; -#endif +//#endif bool dxVaries = false; for (int i = 1; i < nConvert; i++) - if (!isSameFloatT(dx, intersliceDistance(dcmList[dcmSort[i - 1].indx], dcmList[dcmSort[i].indx]), 0.2)) + if (!isSameFloatT(dx, intersliceDistance(dcmList[dcmSort[i - 1].indx], dcmList[dcmSort[i].indx]), kSliceTolerance)) dxVaries = true; if (hdr0.dim[4] < 2) { if (dxVaries) { @@ -6966,7 +6984,7 @@ int saveDcm2NiiCore(int nConvert, struct TDCMsort dcmSort[], struct TDICOMdata d dxVaries = false; dx = intersliceDistance(dcmList[dcmSort[0].indx], dcmList[dcmSort[1].indx]); for (int i = 1; i < nConvert; i++) - if (!isSameFloatT(dx, intersliceDistance(dcmList[dcmSort[i - 1].indx], dcmList[dcmSort[i].indx]), 0.2)) + if (!isSameFloatT(dx, intersliceDistance(dcmList[dcmSort[i - 1].indx], dcmList[dcmSort[i].indx]), kSliceTolerance)) dxVaries = true; for (int i = 1; i < nConvert; i++) sliceMMarray[i] = intersliceDistance(dcmList[dcmSort[0].indx], dcmList[dcmSort[i].indx]); From fb32a2dade65488d490162ab268c3c47c743de4c Mon Sep 17 00:00:00 2001 From: neurolabusc Date: Tue, 28 Mar 2023 04:35:29 -0400 Subject: [PATCH 73/85] corrupted 0028,0008 (https://github.com/rordenlab/dcm2niix/issues/695) --- README.md | 1 + console/base64.cpp | 3 ++- console/nii_dicom.cpp | 9 +++++---- console/nii_dicom_batch.cpp | 4 +--- console/ucm.cmake | 2 +- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 6941e434..3978a6cd 100644 --- a/README.md +++ b/README.md @@ -149,6 +149,7 @@ The following tools exploit dcm2niix - [BraTS-Preprocessor](https://neuronflow.github.io/BraTS-Preprocessor/) uses dcm2niix to import files for [Brain Tumor Segmentation](https://www.frontiersin.org/articles/10.3389/fnins.2020.00125/full). - [CardioNIfTI](https://github.com/UK-Digital-Heart-Project/CardioNIfTI) processes cardiac MR DICOM datasets and converts them to NIfTI. - [clinica](https://github.com/aramis-lab/clinica) is a software platform for clinical neuroimaging studies that uses dcm2niix to convert DICOM images. + - [clinical_dicom2bids_smk](https://github.com/greydongilmore/clinical_dicom2bids_smk) Snakemake workflow to convert a clinical dicom directory into BIDS structure. - [clpipe](https://github.com/cohenlabUNC/clpipe) uses dcm2bids for DICOM import. - [conversion](https://github.com/pnlbwh/conversion) is a Python library that can convert dcm2niix created NIfTI files to the popular NRRD format (including DWI gradient tables). Note, recent versions of dcm2niix can directly convert DICOM images to NRRD. - [convert_source](https://github.com/AdebayoBraimah/convert_source) to convert DICOM to BIDS directory layout. diff --git a/console/base64.cpp b/console/base64.cpp index e7033279..a645b77c 100644 --- a/console/base64.cpp +++ b/console/base64.cpp @@ -111,7 +111,8 @@ unsigned char * base64_decode(const unsigned char *src, size_t len, memset(dtable, 0x80, 256); //os_ for (i = 0; i < sizeof(base64_table) - 1; i++) dtable[base64_table[i]] = (unsigned char) i; - dtable['='] = 0; + //next line rewritten to avoid warning -Wchar-subscripts + dtable[61] = 0; //dtable['='] = 0; count = 0; for (i = 0; i < len; i++) { diff --git a/console/nii_dicom.cpp b/console/nii_dicom.cpp index 7b6a7d08..875e1fce 100644 --- a/console/nii_dicom.cpp +++ b/console/nii_dicom.cpp @@ -2314,7 +2314,6 @@ struct TDICOMdata nii_readParRec(char *parname, int isVerbose, struct TDTI4D *dt } isReal = true; //<- this is not correct, kludge for bug in ROGERS_20180526_WIP_B0_NS_8_1.PAR } - int vx = vol; if (isReal) vol += num3DExpected; if (isImaginary) @@ -6025,6 +6024,8 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); //FD d.isPlanarRGB = dcmInt(lLength, &buffer[lPos], d.isLittleEndian); break; case kDim3: + if (lLength < 1) //issue 695 + break; d.xyzDim[3] = dcmStrInt(lLength, &buffer[lPos]); numberOfFrames = d.xyzDim[3]; break; @@ -7451,7 +7452,7 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); //FD d.xyzMM[3] = d.zSpacing; //use zSpacing if provided: depending on vendor, kZThick may or may not include a slice gap //printMessage("patientPositions = %d XYZT = %d slicePerVol = %d numberOfDynamicScans %d\n",patientPositionNum,d.xyzDim[3], d.locationsInAcquisition, d.numberOfDynamicScans); if ((d.manufacturer == kMANUFACTURER_PHILIPS) && (patientPositionNum > d.xyzDim[3])) { - d.CSA.numDti = d.xyzDim[3]; //issue506 + d.CSA.numDti = d.xyzDim[3]; //issue506 printMessage("Please check slice thicknesses: Philips R3.2.2 bug can disrupt estimation (%d positions reported for %d slices)\n", patientPositionNum, d.xyzDim[3]); //Philips reported different positions for each slice! } if ((d.imageStart > 144) && (d.xyzDim[1] > 1) && (d.xyzDim[2] > 1)) @@ -7552,7 +7553,7 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); //FD if ((B0Philips >= 0) && (d.CSA.numDti == 0)) { d.CSA.dtiV[0] = B0Philips; d.CSA.numDti = 1; - } //issue409 Siemens XA saved as classic 2D not enhanced + } //issue409 Siemens XA saved as classic 2D not enhanced if (!isnan(patientPositionStartPhilips[1])) //for Philips data without for (int k = 0; k < 4; k++) d.patientPosition[k] = patientPositionStartPhilips[k]; @@ -7781,7 +7782,7 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); //FD d.imageNum = abs((int)d.instanceUidCrc) % 2147483647; //INT_MAX; if (d.imageNum == 0) d.imageNum = 1; //https://github.com/rordenlab/dcm2niix/issues/341 - //d.imageNum = 1; //not set + //d.imageNum = 1; //not set } if ((numDimensionIndexValues < 1) && (d.manufacturer == kMANUFACTURER_PHILIPS) && (d.seriesNum > 99999) && (philMRImageDiffBValueNumber > 0)) { //Ugly kludge to distinguish Philips classic DICOM dti diff --git a/console/nii_dicom_batch.cpp b/console/nii_dicom_batch.cpp index b5b98fa9..f4ec1a63 100644 --- a/console/nii_dicom_batch.cpp +++ b/console/nii_dicom_batch.cpp @@ -2209,7 +2209,6 @@ unsigned char *reorderVolumes(struct nifti_1_header *hdr, unsigned char *inImg, for (int i = 0; i < numVol; i++) inPos[i] = i; unsigned char *tempVol = (unsigned char *)malloc(numVolBytes); - int outPos = 0; for (int o = 0; o < numVol; o++) { int i = inPos[volOrderIndex[o]]; //input volume if (i == o) @@ -2218,7 +2217,6 @@ unsigned char *reorderVolumes(struct nifti_1_header *hdr, unsigned char *inImg, memcpy(&inImg[o * numVolBytes], &inImg[i * numVolBytes], numVolBytes); //copy volume to desire location dest, src, bytes memcpy(&inImg[i * numVolBytes], &tempVol[0], numVolBytes); //copy unsorted volume inPos[o] = i; - outPos += numVolBytes; } //for each volume free(inPos); free(volOrderIndex); @@ -8479,7 +8477,7 @@ int nii_loadDirCore(char *indir, struct TDCMopts *opts) { free(dcmSort); } //convert all images of this series } -#else //avoid bubble sort - dont check all images for match, only those with identical series instance UID +#else //avoid bubble sort - do not check all images for match, only those with identical series instance UID //3: stack DICOMs with the same Series struct TWarnings warnings = setWarnings(); //sort by series instance UID ... avoids bubble-sort penalty diff --git a/console/ucm.cmake b/console/ucm.cmake index e6e7fc8f..37f025f3 100644 --- a/console/ucm.cmake +++ b/console/ucm.cmake @@ -611,7 +611,7 @@ macro(ucm_add_target) # also set the name of the target output as the original one set_target_properties(${unity_target_name} PROPERTIES OUTPUT_NAME ${ARG_NAME}) if(UCM_NO_COTIRE_FOLDER) - # reset the folder property so all unity targets dont end up in a single folder in the solution explorer of VS + # reset the folder property so all unity targets do not end up in a single folder in the solution explorer of VS set_target_properties(${unity_target_name} PROPERTIES FOLDER "") endif() set_target_properties(all_unity PROPERTIES FOLDER "CMakePredefinedTargets") From 66424afb747dfc91511f216ed4190e527e3e7e87 Mon Sep 17 00:00:00 2001 From: neurolabusc Date: Tue, 28 Mar 2023 07:10:15 -0400 Subject: [PATCH 74/85] Completely ignore empty tags (https://github.com/rordenlab/dcm2niix/issues/695) --- console/nii_dicom.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/console/nii_dicom.cpp b/console/nii_dicom.cpp index 875e1fce..098b7a1d 100644 --- a/console/nii_dicom.cpp +++ b/console/nii_dicom.cpp @@ -5171,6 +5171,7 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); //FD // d.isValid = false; //return d; } + if (lLength > 0) //issue694: skip empty tags, "gdcmanon --dumb --empty 0018,0089 good.dcm bad.dcm" switch (groupElement) { case kMediaStorageSOPClassUID: { char mediaUID[kDICOMStr]; From a0dfcc36bd8326008ea973e1bb36ebf9e4996af9 Mon Sep 17 00:00:00 2001 From: neurolabusc Date: Wed, 5 Apr 2023 09:40:17 -0400 Subject: [PATCH 75/85] Update SForm formula for images with shear (https://github.com/rordenlab/dcm2niix/issues/697) --- README.md | 6 +++--- console/nii_dicom.cpp | 2 +- console/nii_dicom.h | 2 +- console/nii_dicom_batch.cpp | 4 ++++ 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 3978a6cd..fa82dd62 100644 --- a/README.md +++ b/README.md @@ -45,8 +45,7 @@ There are a couple ways to install dcm2niix - [Github Releases](https://github.com/rordenlab/dcm2niix/releases) provides the latest compiled executables. This is an excellent option for MacOS and Windows users. However, the provided Linux executable requires a recent version of Linux (e.g. Ubuntu 14.04 or later), so the provided Unix executable is not suitable for very old distributions. Specifically, it requires Glibc 2.19 (from 2014) or later. Users of older systems can compile their own copy of dcm2niix or download the compiled version included with MRIcroGL Glibc 2.12 (from 2011, see below). - Run the following command to get the latest release version for Linux, Macintosh or Windows: * `curl -fLO https://github.com/rordenlab/dcm2niix/releases/latest/download/dcm2niix_lnx.zip` - * `curl -fLO https://github.com/rordenlab/dcm2niix/releases/latest/download/dcm2niix_mac.zip` - * `curl -fLO https://github.com/rordenlab/dcm2niix/releases/latest/download/dcm2niix_mac_arm.pkg` + * `curl -fLO https://github.com/rordenlab/dcm2niix/releases/latest/download/macos_dcm2niix.pkg` * `curl -fLO https://github.com/rordenlab/dcm2niix/releases/latest/download/dcm2niix_win.zip` - Latest development version is available on [AppVeyor](https://ci.appveyor.com/project/neurolabusc/dcm2niix) for [Linux](https://ci.appveyor.com/api/projects/neurolabusc/dcm2niix/artifacts/dcm2niix_lnx.zip?job=linux), [Macintosh](https://ci.appveyor.com/api/projects/neurolabusc/dcm2niix/artifacts/dcm2niix_mac.zip?job=mac) or [Windows](https://ci.appveyor.com/api/projects/neurolabusc/dcm2niix/artifacts/dcm2niix_win.zip?job=win). - [MRIcroGL (NITRC)](https://www.nitrc.org/projects/mricrogl) or [MRIcroGL (GitHub)](https://github.com/rordenlab/MRIcroGL12/releases) includes dcm2niix that can be run from the command line or from the graphical user interface (select the Import menu item). The Linux version of dcm2niix is compiled on a [holy build box](https://github.com/phusion/holy-build-box), so it should run on any Linux distribution. @@ -120,7 +119,8 @@ If you have any problems with the cmake build script described above or want to - [MRtrix mrconvert](http://mrtrix.readthedocs.io/en/latest/reference/commands/mrconvert.html) is a useful general purpose image converter and handles DTI data well. It is an outstanding tool for modern Philips enhanced images. - [nanconvert](https://github.com/spinicist/nanconvert) uses the ITK library to convert DICOM from GE and proprietary Bruker to standard formats like DICOM. - [PET CT viewer](http://petctviewer.org/index.php/feature/results-exports/nifti-export) for [Fiji](https://fiji.sc) can load DICOM images and export as NIfTI. - - [Plastimatch](https://www.plastimatch.org/) is a Swiss Army knife - it computes registration, image processing, statistics and it has a basic image format converter that can convert some DICOM images to NIfTI or NRRD. + - [Plastimatch](https://plastimatch.org/) is a Swiss Army knife - it computes registration, image processing, + statistics and it has a basic image format converter that can convert some DICOM images to NIfTI or NRRD. - [Simple Dicom Reader 2 (Sdr2)](http://ogles.sourceforge.net/sdr2-doc/index.html) uses [dcmtk](https://dicom.offis.de/dcmtk.php.en) to read DICOM images and convert them to the NIfTI format. - [SlicerHeart extension](https://github.com/SlicerHeart/SlicerHeart) is specifically designed to help 3D Slicer support ultra sound (US) images stored as DICOM. - [spec2nii](https://github.com/wexeee/spec2nii) converts MR spectroscopy to NIFTI. diff --git a/console/nii_dicom.cpp b/console/nii_dicom.cpp index 098b7a1d..a7b1af48 100644 --- a/console/nii_dicom.cpp +++ b/console/nii_dicom.cpp @@ -5171,7 +5171,7 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); //FD // d.isValid = false; //return d; } - if (lLength > 0) //issue694: skip empty tags, "gdcmanon --dumb --empty 0018,0089 good.dcm bad.dcm" + if (lLength > 0) //issue695: skip empty tags, "gdcmanon --dumb --empty 0018,0089 good.dcm bad.dcm" switch (groupElement) { case kMediaStorageSOPClassUID: { char mediaUID[kDICOMStr]; diff --git a/console/nii_dicom.h b/console/nii_dicom.h index 4d010f40..4f243502 100644 --- a/console/nii_dicom.h +++ b/console/nii_dicom.h @@ -50,7 +50,7 @@ extern "C" { #define kCPUsuf " " //unknown CPU #endif -#define kDCMdate "v1.0.20230320" +#define kDCMdate "v1.0.20230404" #define kDCMvers kDCMdate " " kJP2suf kLSsuf kCCsuf kCPUsuf static const int kMaxEPI3D = 1024; //maximum number of EPI images in Siemens Mosaic diff --git a/console/nii_dicom_batch.cpp b/console/nii_dicom_batch.cpp index f4ec1a63..b44c9935 100644 --- a/console/nii_dicom_batch.cpp +++ b/console/nii_dicom_batch.cpp @@ -7279,6 +7279,9 @@ int saveDcm2NiiCore(int nConvert, struct TDCMsort dcmSort[], struct TDICOMdata d float c = cos(thetaRad); if (!isSameFloatGE(c, 0.0)) { mat33 shearMat; + hdr0.srow_y[2] = 0.0; //remove gantry tilt + hdr0.srow_z[2] = hdr0.pixdim[3]; //retain distance between slices + /* LOAD_MAT33(shearMat, 1.0, 0.0, 0.0, 0.0, 1.0, sin(thetaRad) / c, 0.0, 0.0, 1.0); @@ -7292,6 +7295,7 @@ int saveDcm2NiiCore(int nConvert, struct TDCMsort dcmSort[], struct TDICOMdata d s.m[1][0], s.m[1][1], s.m[1][2], hdr0.srow_y[3], s.m[2][0], s.m[2][1], s.m[2][2], hdr0.srow_z[3]); setQSForm(&hdr0, shearForm, true); + */ } //avoid div/0: cosine not zero } //if gantry tilt //end: gantry tilt we need to save the shear in the transform From f19bea84cd8f903965e7daf904ee8818205bbc10 Mon Sep 17 00:00:00 2001 From: neurolabusc Date: Sun, 9 Apr 2023 10:04:53 -0400 Subject: [PATCH 76/85] Detect Philips SmartSpeed AI (https://github.com/neurolabusc/dcm_qa_cs_dl) --- Canon/README.md | 2 +- console/nii_dicom.cpp | 12 ++++++++++++ console/nii_dicom_batch.cpp | 11 +++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/Canon/README.md b/Canon/README.md index 945ef84c..829f4cc7 100644 --- a/Canon/README.md +++ b/Canon/README.md @@ -37,7 +37,7 @@ In contrast, Canon software [V6.1](https://github.com/neurolabusc/dcm_qa_canon_6 The [BIDS format](https://bids.neuroimaging.io) can record several sequence properties that are useful for processing MRI data. The DICOM headers created by Toshiba scanners are very clean and minimalistic, and do not report several of these advanced properties. Therefore, dcm2niix is unable to populate these properties of the JSON file. This reflects a limitation of the DICOM images, not of dcm2niix. - SliceTiming is not recorded. This can be useful for slice time correction. - - Phase encoding polarity is not record. This is useful for undistortion with [TOPUP](https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/topup). + - Phase encoding polarity is not record. This is useful for undistortion with [TOPUP](https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/topup). Clément Debacker notes that this parameter can be encoded into a XML field called `` inserted in the private tag700D,1119. However, this requires the user to explicitly request these details and uses XML rather than DICOM so it is not easily parsed. To enable this, choose `Utility` > `Maintenance` > `Config.` > `DICOM management` > `Remote Node` > Select desired node > `Edit` > Beside Storage click on `Details` > `Advanced 1` > `Private tag for MRI image`. ## Sample Datasets diff --git a/console/nii_dicom.cpp b/console/nii_dicom.cpp index a7b1af48..26c3f7d0 100644 --- a/console/nii_dicom.cpp +++ b/console/nii_dicom.cpp @@ -4570,6 +4570,7 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); //FD #define kDiffusionDirectionRL 0x2005 + (0x10B0 << 16) #define kDiffusionDirectionAP 0x2005 + (0x10B1 << 16) #define kDiffusionDirectionFH 0x2005 + (0x10B2 << 16) +#define kDeepLearningPhilips 0x2005 + (0x1110 << 16) #define kPrivatePerFrameSq 0x2005 + (0x140F << 16) #define kMRImageDiffBValueNumber 0x2005 + (0x1412 << 16) //IS #define kMRImageGradientOrientationNumber 0x2005+(0x1413 << 16) //IS @@ -6835,6 +6836,17 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); //FD vFHPhilips = dcmFloat(lLength, &buffer[lPos], d.isLittleEndian); set_diffusion_directionPhilips(&volDiffusion, vFHPhilips, 2); break; + case kDeepLearningPhilips: { //CS + if (d.manufacturer != kMANUFACTURER_PHILIPS) + break; + char st[kDICOMStr]; + //see dcm_qa_cs_dl reports `none` or `CS_SENSE_AI` + dcmStr(lLength, &buffer[lPos], st); + if (strstr(st, "_AI") != NULL) { + d.isDeepLearning = true; + dcmStr(lLength, &buffer[lPos], d.deepLearningText, true); + } + } case kPrivatePerFrameSq: if (d.manufacturer != kMANUFACTURER_PHILIPS) break; diff --git a/console/nii_dicom_batch.cpp b/console/nii_dicom_batch.cpp index b44c9935..790f7e20 100644 --- a/console/nii_dicom_batch.cpp +++ b/console/nii_dicom_batch.cpp @@ -7279,8 +7279,19 @@ int saveDcm2NiiCore(int nConvert, struct TDCMsort dcmSort[], struct TDICOMdata d float c = cos(thetaRad); if (!isSameFloatGE(c, 0.0)) { mat33 shearMat; + //gantry tilt formula changed with issue697 + /*printf("a=[%g %g %g %g; %g %g %g %g; %g %g %g %g; 0 0 0 1];\n", + hdr0.srow_x[0], hdr0.srow_x[1], hdr0.srow_x[2], hdr0.srow_x[3], + hdr0.srow_y[0], hdr0.srow_y[1], hdr0.srow_y[2], hdr0.srow_y[3], + hdr0.srow_z[0], hdr0.srow_z[1], hdr0.srow_z[2], hdr0.srow_z[3] + );*/ hdr0.srow_y[2] = 0.0; //remove gantry tilt hdr0.srow_z[2] = hdr0.pixdim[3]; //retain distance between slices + /*printf("b=[%g %g %g %g; %g %g %g %g; %g %g %g %g; 0 0 0 1];\n", + hdr0.srow_x[0], hdr0.srow_x[1], hdr0.srow_x[2], hdr0.srow_x[3], + hdr0.srow_y[0], hdr0.srow_y[1], hdr0.srow_y[2], hdr0.srow_y[3], + hdr0.srow_z[0], hdr0.srow_z[1], hdr0.srow_z[2], hdr0.srow_z[3] + );*/ /* LOAD_MAT33(shearMat, 1.0, 0.0, 0.0, 0.0, 1.0, sin(thetaRad) / c, From 4c1e2b9e8ad6763381739a55752d4b06b68da946 Mon Sep 17 00:00:00 2001 From: neurolabusc Date: Tue, 11 Apr 2023 15:09:05 -0400 Subject: [PATCH 77/85] More robust detection of iPAT and partial Fourier for XA10 --- README.md | 5 ++--- VERSIONS.md | 6 +++++- console/charls/README.md | 3 --- console/nii_dicom.cpp | 14 ++++++++++++-- console/nii_dicom.h | 2 +- console/nii_dicom_batch.cpp | 7 +++++-- 6 files changed, 25 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index fa82dd62..7de22ccb 100644 --- a/README.md +++ b/README.md @@ -112,13 +112,12 @@ If you have any problems with the cmake build script described above or want to - [dicom2nifti](https://github.com/icometrix/dicom2nifti) uses the scriptable Python wrapper utilizes the [high performance GDCMCONV](http://gdcm.sourceforge.net/wiki/index.php/Gdcmconv) executables. - [dicomtonifti](https://github.com/dgobbi/vtk-dicom/wiki/dicomtonifti) leverages [VTK](https://www.vtk.org/). - [dimon](https://afni.nimh.nih.gov/pub/dist/doc/program_help/Dimon.html) and [to3d](https://afni.nimh.nih.gov/pub/dist/doc/program_help/to3d.html) are included with AFNI. - - [dinifti](http://as.nyu.edu/cbi/resources/Software/DINIfTI.html) is focused on conversion of Siemens data. + - [dinifti](https://as.nyu.edu/cbi/resources/Software/DINIfTI.html) is focused on conversion of classic Siemens DICOMs. - [DWIConvert](https://github.com/BRAINSia/BRAINSTools/tree/master/DWIConvert) converts DICOM images to NRRD and NIfTI formats. - - [mcverter](http://lcni.uoregon.edu/%7Ejolinda/MRIConvert/) has great support for various vendors. + - [mcverter](http://lcni.uoregon.edu/%7Ejolinda/MRIConvert/) a great tool for classic DICOMs. - [mri_convert](https://surfer.nmr.mgh.harvard.edu/pub/docs/html/mri_convert.help.xml.html) is part of the popular FreeSurfer package. In my limited experience this tool works well for GE and Siemens data, but fails with Philips 4D datasets. - [MRtrix mrconvert](http://mrtrix.readthedocs.io/en/latest/reference/commands/mrconvert.html) is a useful general purpose image converter and handles DTI data well. It is an outstanding tool for modern Philips enhanced images. - [nanconvert](https://github.com/spinicist/nanconvert) uses the ITK library to convert DICOM from GE and proprietary Bruker to standard formats like DICOM. - - [PET CT viewer](http://petctviewer.org/index.php/feature/results-exports/nifti-export) for [Fiji](https://fiji.sc) can load DICOM images and export as NIfTI. - [Plastimatch](https://plastimatch.org/) is a Swiss Army knife - it computes registration, image processing, statistics and it has a basic image format converter that can convert some DICOM images to NIfTI or NRRD. - [Simple Dicom Reader 2 (Sdr2)](http://ogles.sourceforge.net/sdr2-doc/index.html) uses [dcmtk](https://dicom.offis.de/dcmtk.php.en) to read DICOM images and convert them to the NIfTI format. diff --git a/VERSIONS.md b/VERSIONS.md index 0f61dc09..c1f2a22f 100644 --- a/VERSIONS.md +++ b/VERSIONS.md @@ -1,4 +1,8 @@ -## Versions +## Modern Releases + + - [See Github releases for major release notes](https://github.com/rordenlab/dcm2niix/releases). + +## Legacy Releases 14-November-2018 - [GE images provide more BIDS tags](https://github.com/rordenlab/dcm2niix/issues/163). diff --git a/console/charls/README.md b/console/charls/README.md index d168c52b..4ff0549d 100644 --- a/console/charls/README.md +++ b/console/charls/README.md @@ -1,6 +1,3 @@ -[![Build status](https://ci.appveyor.com/api/projects/status/yq0naf3v2m8nfa8r/branch/master?svg=true)](https://ci.appveyor.com/project/vbaderks/charls/branch/master) -[![Build Status](https://travis-ci.org/team-charls/charls.svg?branch=master)](https://travis-ci.org/team-charls/charls) - # CharLS CharLS is a C++ implementation of the JPEG-LS standard for lossless and near-lossless image compression and decompression. diff --git a/console/nii_dicom.cpp b/console/nii_dicom.cpp index 26c3f7d0..a14ea39c 100644 --- a/console/nii_dicom.cpp +++ b/console/nii_dicom.cpp @@ -4394,6 +4394,7 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); //FD #define kSARFD 0x0018 + uint32_t(0x9181 << 16) //FD #define kMRAcquisitionPhaseEncodingStepsInPlane 0x0018 + uint32_t(0x9231 << 16) //US #define kMRAcquisitionPhaseEncodingStepsOutOfPlane 0x0018 + uint32_t(0x9232 << 16) //US +#define kGradientEchoTrainLength 0x0018 + uint32_t(0x9241 << 16) //US //#define kFrameAcquisitionDuration 0x0018+uint32_t(0x9220 << 16 ) //FD #define kArterialSpinLabelingContrast 0x0018 + uint32_t(0x9250 << 16) //CS #define kASLPulseTrainDuration 0x0018 + uint32_t(0x9258 << 16) //UL @@ -4611,7 +4612,8 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); //FD bool overlayOK = true; int userData11GE = 0; int userData12GE = 0; - float userData15GE = 0; + float userData15GE = 0; + float accelFactPE = 0.0; int overlayRows = 0; int overlayCols = 0; bool isNeologica = false; @@ -5668,9 +5670,10 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); //FD isProspectiveSynced = true; break;*/ case kParallelReductionFactorInPlane: + accelFactPE = dcmFloatDouble(lLength, &buffer[lPos], d.isLittleEndian); if (d.manufacturer == kMANUFACTURER_SIEMENS) break; - d.accelFactPE = dcmFloatDouble(lLength, &buffer[lPos], d.isLittleEndian); + d.accelFactPE = accelFactPE; break; case kAcquisitionDuration: //n.b. used differently by different vendors https://github.com/rordenlab/dcm2niix/issues/225 @@ -5727,6 +5730,9 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); //FD case kMRAcquisitionPhaseEncodingStepsOutOfPlane: d.phaseEncodingStepsOutOfPlane = dcmInt(lLength, &buffer[lPos], d.isLittleEndian); break; + case kGradientEchoTrainLength: + d.echoTrainLength = dcmInt(lLength, &buffer[lPos], d.isLittleEndian); + break; case kNumberOfImagesInMosaic: if (d.manufacturer == kMANUFACTURER_SIEMENS) numberOfImagesInMosaic = dcmInt(lLength, &buffer[lPos], d.isLittleEndian); @@ -7912,6 +7918,10 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); //FD d.diffCyclingModeGE = kGE_DIFF_CYCLING_OFF; } } + if ((d.accelFactPE < accelFactPE) && (accelFactPE > 1.0)) { + d.accelFactPE = accelFactPE; + //printf("Determining accelFactPE from 0018,9069 not 0021,1009 or 0051,1011\n"); + } //detect pepolar https://github.com/nipy/heudiconv/issues/479 if ((d.epiVersionGE == kGE_EPI_PEPOLAR_FWD) && (userData12GE == 1)) d.epiVersionGE = kGE_EPI_PEPOLAR_REV; diff --git a/console/nii_dicom.h b/console/nii_dicom.h index 4f243502..aa86ef41 100644 --- a/console/nii_dicom.h +++ b/console/nii_dicom.h @@ -50,7 +50,7 @@ extern "C" { #define kCPUsuf " " //unknown CPU #endif -#define kDCMdate "v1.0.20230404" +#define kDCMdate "v1.0.20230411" #define kDCMvers kDCMdate " " kJP2suf kLSsuf kCCsuf kCPUsuf static const int kMaxEPI3D = 1024; //maximum number of EPI images in Siemens Mosaic diff --git a/console/nii_dicom_batch.cpp b/console/nii_dicom_batch.cpp index 790f7e20..2ba4e0ad 100644 --- a/console/nii_dicom_batch.cpp +++ b/console/nii_dicom_batch.cpp @@ -1834,9 +1834,12 @@ tse3d: T2*/ json_Str(fp, "\t\"ReceiveCoilActiveElements\": \"%s\",\n", d.coilElements); if (strcmp(d.coilElements, d.coilName) != 0) json_Str(fp, "\t\"CoilString\": \"%s\",\n", d.coilName); - if ((d.manufacturer == kMANUFACTURER_SIEMENS) && (!d.is3DAcq) && (d.phaseEncodingLines > d.echoTrainLength) && (d.echoTrainLength > 1)) { + int phaseEncodingLines = d.phaseEncodingLines; + if (phaseEncodingLines < 1) //support enhanced DICOM terminology + phaseEncodingLines = d.phaseEncodingSteps; + if ((d.manufacturer == kMANUFACTURER_SIEMENS) && (!d.is3DAcq) && (phaseEncodingLines > d.echoTrainLength) && (d.echoTrainLength > 1)) { //ETL is > 1, as some GE files list 1, as an example see series mr_0005 in dcm_qa_nih - float pf = (float)d.phaseEncodingLines; + float pf = (float)phaseEncodingLines; if (d.accelFactPE > 1) pf = (float)pf / (float)d.accelFactPE; //estimate: not sure if we round up or down pf = (float)d.echoTrainLength / (float)pf; From 4aa258b8012b8892a35c3ffa09af95af87acf151 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Wed, 19 Apr 2023 16:00:18 -0400 Subject: [PATCH 78/85] STYLE: Update external projects describing & re-organizing CMake options --- SuperBuild/External-CLOUDFLARE-ZLIB.cmake | 1 + SuperBuild/External-OPENJPEG.cmake | 1 + SuperBuild/External-YAML-CPP.cmake | 1 + SuperBuild/SuperBuild.cmake | 4 ++++ 4 files changed, 7 insertions(+) diff --git a/SuperBuild/External-CLOUDFLARE-ZLIB.cmake b/SuperBuild/External-CLOUDFLARE-ZLIB.cmake index 9bc4d691..abc5aec6 100644 --- a/SuperBuild/External-CLOUDFLARE-ZLIB.cmake +++ b/SuperBuild/External-CLOUDFLARE-ZLIB.cmake @@ -9,6 +9,7 @@ ExternalProject_Add(zlib -Wno-dev ${OSX_ARCHITECTURES} -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} + # Install directories -DCMAKE_INSTALL_PREFIX:PATH=${DEP_INSTALL_DIR} ) diff --git a/SuperBuild/External-OPENJPEG.cmake b/SuperBuild/External-OPENJPEG.cmake index f1175884..2cdfb368 100644 --- a/SuperBuild/External-OPENJPEG.cmake +++ b/SuperBuild/External-OPENJPEG.cmake @@ -10,6 +10,7 @@ ExternalProject_Add(openjpeg --no-warn-unused-cli ${OSX_ARCHITECTURES} -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} + # Install directories -DCMAKE_INSTALL_PREFIX:PATH=${DEP_INSTALL_DIR} ) diff --git a/SuperBuild/External-YAML-CPP.cmake b/SuperBuild/External-YAML-CPP.cmake index 95d009f0..152b20c1 100644 --- a/SuperBuild/External-YAML-CPP.cmake +++ b/SuperBuild/External-YAML-CPP.cmake @@ -10,6 +10,7 @@ ExternalProject_Add(yaml-cpp --no-warn-unused-cli ${OSX_ARCHITECTURES} -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} + # Install directories -DCMAKE_INSTALL_PREFIX:PATH=${DEP_INSTALL_DIR} ) diff --git a/SuperBuild/SuperBuild.cmake b/SuperBuild/SuperBuild.cmake index d0635308..2ac94ac1 100644 --- a/SuperBuild/SuperBuild.cmake +++ b/SuperBuild/SuperBuild.cmake @@ -153,15 +153,19 @@ ExternalProject_Add(console --no-warn-unused-cli ${OSX_ARCHITECTURES} -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} + # Install directories -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_BINARY_DIR} + # Compiler settings -DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS} -DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS} + # Options -DCMAKE_VERBOSE_MAKEFILE:BOOL=${CMAKE_VERBOSE_MAKEFILE} -DUSE_STATIC_RUNTIME:BOOL=${USE_STATIC_RUNTIME} -DUSE_TURBOJPEG:BOOL=${USE_TURBOJPEG} -DUSE_JASPER:BOOL=${USE_JASPER} -DUSE_JPEGLS:BOOL=${USE_JPEGLS} -DUSE_JNIFTI:BOOL=${USE_JNIFTI} + # ZLIB -DZLIB_IMPLEMENTATION:STRING=${ZLIB_IMPLEMENTATION} -DZLIB_ROOT:PATH=${ZLIB_ROOT} # OpenJPEG From baf9c75bb810af8bc0eb984c53763079c2257956 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Wed, 19 Apr 2023 17:42:48 -0400 Subject: [PATCH 79/85] COMP: Ensure external projects are built with the expected compilers This ensures the C & C++ compilers associated with the top-level project are used consistently. Note that CMAKE_CXX_COMPILER is not associated with the "openjpeg" external project because the project only specifies C as a language. --- SuperBuild/External-CLOUDFLARE-ZLIB.cmake | 3 +++ SuperBuild/External-OPENJPEG.cmake | 3 +++ SuperBuild/External-YAML-CPP.cmake | 3 +++ SuperBuild/SuperBuild.cmake | 2 ++ 4 files changed, 11 insertions(+) diff --git a/SuperBuild/External-CLOUDFLARE-ZLIB.cmake b/SuperBuild/External-CLOUDFLARE-ZLIB.cmake index abc5aec6..44d7c93c 100644 --- a/SuperBuild/External-CLOUDFLARE-ZLIB.cmake +++ b/SuperBuild/External-CLOUDFLARE-ZLIB.cmake @@ -9,6 +9,9 @@ ExternalProject_Add(zlib -Wno-dev ${OSX_ARCHITECTURES} -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} + # Compiler settings + -DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER} + -DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER} # Install directories -DCMAKE_INSTALL_PREFIX:PATH=${DEP_INSTALL_DIR} ) diff --git a/SuperBuild/External-OPENJPEG.cmake b/SuperBuild/External-OPENJPEG.cmake index 2cdfb368..6d3afcb3 100644 --- a/SuperBuild/External-OPENJPEG.cmake +++ b/SuperBuild/External-OPENJPEG.cmake @@ -10,6 +10,9 @@ ExternalProject_Add(openjpeg --no-warn-unused-cli ${OSX_ARCHITECTURES} -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} + # Compiler settings + -DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER} + # Not used -DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER} # Install directories -DCMAKE_INSTALL_PREFIX:PATH=${DEP_INSTALL_DIR} ) diff --git a/SuperBuild/External-YAML-CPP.cmake b/SuperBuild/External-YAML-CPP.cmake index 152b20c1..5febe95b 100644 --- a/SuperBuild/External-YAML-CPP.cmake +++ b/SuperBuild/External-YAML-CPP.cmake @@ -10,6 +10,9 @@ ExternalProject_Add(yaml-cpp --no-warn-unused-cli ${OSX_ARCHITECTURES} -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} + # Compiler settings + -DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER} + -DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER} # Install directories -DCMAKE_INSTALL_PREFIX:PATH=${DEP_INSTALL_DIR} ) diff --git a/SuperBuild/SuperBuild.cmake b/SuperBuild/SuperBuild.cmake index 2ac94ac1..d093bc2f 100644 --- a/SuperBuild/SuperBuild.cmake +++ b/SuperBuild/SuperBuild.cmake @@ -156,7 +156,9 @@ ExternalProject_Add(console # Install directories -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_BINARY_DIR} # Compiler settings + -DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER} -DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS} + -DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER} -DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS} # Options -DCMAKE_VERBOSE_MAKEFILE:BOOL=${CMAKE_VERBOSE_MAKEFILE} From cdc755cfc59e7a106618cf917e879353151f0e1a Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Wed, 19 Apr 2023 18:17:06 -0400 Subject: [PATCH 80/85] COMP: Fix initialization of build-type to support multi-config CMake generator This commit introduces the module "dcm2niixInitializeBuildType" It allows to consistently manage the initialization and setting of build type CMake variables. It sets the variable EXTERNAL_PROJECT_BUILD_TYPE_CMAKE_ARGS based on the CMake generator being used: * If a multi-config generator (e.g Visual Studio) is used, it sets the variable with CMAKE_CONFIGURATION_TYPES. * If a single-config generator (e.g Unix Makefiles) is used, it sets the variable with CMAKE_BUILD_TYPE. Adapted from https://github.com/Slicer/Slicer/blob/5.2/CMake/SlicerInitializeBuildType.cmake --- SuperBuild/External-CLOUDFLARE-ZLIB.cmake | 2 +- SuperBuild/External-OPENJPEG.cmake | 2 +- SuperBuild/External-YAML-CPP.cmake | 2 +- SuperBuild/SuperBuild.cmake | 10 ++--- cmake/dcm2niixInitializeBuildType.cmake | 47 +++++++++++++++++++++++ 5 files changed, 53 insertions(+), 10 deletions(-) create mode 100644 cmake/dcm2niixInitializeBuildType.cmake diff --git a/SuperBuild/External-CLOUDFLARE-ZLIB.cmake b/SuperBuild/External-CLOUDFLARE-ZLIB.cmake index 44d7c93c..4c6a6acb 100644 --- a/SuperBuild/External-CLOUDFLARE-ZLIB.cmake +++ b/SuperBuild/External-CLOUDFLARE-ZLIB.cmake @@ -7,8 +7,8 @@ ExternalProject_Add(zlib BINARY_DIR cloudflare-zlib-build CMAKE_ARGS -Wno-dev + ${EXTERNAL_PROJECT_BUILD_TYPE_CMAKE_ARGS} ${OSX_ARCHITECTURES} - -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} # Compiler settings -DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER} -DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER} diff --git a/SuperBuild/External-OPENJPEG.cmake b/SuperBuild/External-OPENJPEG.cmake index 6d3afcb3..1d99ac28 100644 --- a/SuperBuild/External-OPENJPEG.cmake +++ b/SuperBuild/External-OPENJPEG.cmake @@ -8,8 +8,8 @@ ExternalProject_Add(openjpeg CMAKE_ARGS -Wno-dev --no-warn-unused-cli + ${EXTERNAL_PROJECT_BUILD_TYPE_CMAKE_ARGS} ${OSX_ARCHITECTURES} - -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} # Compiler settings -DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER} # Not used -DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER} diff --git a/SuperBuild/External-YAML-CPP.cmake b/SuperBuild/External-YAML-CPP.cmake index 5febe95b..ed85ca76 100644 --- a/SuperBuild/External-YAML-CPP.cmake +++ b/SuperBuild/External-YAML-CPP.cmake @@ -8,8 +8,8 @@ ExternalProject_Add(yaml-cpp CMAKE_ARGS -Wno-dev --no-warn-unused-cli + ${EXTERNAL_PROJECT_BUILD_TYPE_CMAKE_ARGS} ${OSX_ARCHITECTURES} - -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} # Compiler settings -DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER} -DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER} diff --git a/SuperBuild/SuperBuild.cmake b/SuperBuild/SuperBuild.cmake index d093bc2f..98f20c6c 100644 --- a/SuperBuild/SuperBuild.cmake +++ b/SuperBuild/SuperBuild.cmake @@ -4,12 +4,8 @@ if(NOT GIT_FOUND) message(FATAL_ERROR "Cannot find Git. Git is required for Superbuild") endif() -# Basic CMake build settings -if(NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE "Release" CACHE STRING - "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE) - set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug;Release;RelWithDebInfo;MinSizeRel") -endif() +include(${CMAKE_SOURCE_DIR}/cmake/dcm2niixInitializeBuildType.cmake) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) option(USE_STATIC_RUNTIME "Use static runtime" ON) @@ -151,8 +147,8 @@ ExternalProject_Add(console CMAKE_ARGS -Wno-dev --no-warn-unused-cli + ${EXTERNAL_PROJECT_BUILD_TYPE_CMAKE_ARGS} ${OSX_ARCHITECTURES} - -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} # Install directories -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_BINARY_DIR} # Compiler settings diff --git a/cmake/dcm2niixInitializeBuildType.cmake b/cmake/dcm2niixInitializeBuildType.cmake new file mode 100644 index 00000000..b21ba4a8 --- /dev/null +++ b/cmake/dcm2niixInitializeBuildType.cmake @@ -0,0 +1,47 @@ +# This module allows to consistently manage the initialization and setting of build type +# CMake variables. +# +# It sets the variable EXTERNAL_PROJECT_BUILD_TYPE_CMAKE_ARGS based on the CMake generator +# being used: +# * If a multi-config generator (e.g Visual Studio) is used, it sets the variable with +# CMAKE_CONFIGURATION_TYPES. +# * If a single-config generator (e.g Unix Makefiles) is used, it sets the variable with +# CMAKE_BUILD_TYPE. +# +# Adapted from https://github.com/Slicer/Slicer/blob/5.2/CMake/SlicerInitializeBuildType.cmake + +# Default build type to use if none was specified +if(NOT DEFINED dcm2niix_DEFAULT_BUILD_TYPE) + set(dcm2niix_DEFAULT_BUILD_TYPE "Release") +endif() + +# Set a default build type if none was specified +if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + + message(STATUS "Setting build type to '${dcm2niix_DEFAULT_BUILD_TYPE}' as none was specified.") + + set(CMAKE_BUILD_TYPE ${dcm2niix_DEFAULT_BUILD_TYPE} CACHE STRING "Choose the type of build." FORCE) + mark_as_advanced(CMAKE_BUILD_TYPE) + + # Set the possible values of build type for cmake-gui + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS + "Debug" + "Release" + "MinSizeRel" + "RelWithDebInfo" + ) +endif() + +# Pass variables to dependent projects +if(COMMAND ExternalProject_Add) + if(NOT CMAKE_CONFIGURATION_TYPES) + set(EXTERNAL_PROJECT_BUILD_TYPE_CMAKE_ARGS + -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} + ) + else() + set(EXTERNAL_PROJECT_BUILD_TYPE_CMAKE_ARGS + -DCMAKE_CONFIGURATION_TYPES:STRING=${CMAKE_CONFIGURATION_TYPES} + ) + endif() +endif() + From 6f0f9b77db0f3bff2bea5d28b37d55f0f3cba5a1 Mon Sep 17 00:00:00 2001 From: Yujing Huang Date: Fri, 21 Apr 2023 11:32:00 -0400 Subject: [PATCH 81/85] dcm2niix_fswrapper and libdcm2niixfs.a 1. set isForceStackSameSeries = 1 by default 2. make adjustments for MGH bvecs output --- console/dcm2niix_fswrapper.cpp | 16 +++- console/dcm2niix_fswrapper.h | 4 +- console/nii_dicom_batch.cpp | 132 ++++++++++++++++++++++++++++----- console/nii_dicom_batch.h | 15 ++-- 4 files changed, 139 insertions(+), 28 deletions(-) diff --git a/console/dcm2niix_fswrapper.cpp b/console/dcm2niix_fswrapper.cpp index 28db86d6..e8eedfc6 100644 --- a/console/dcm2niix_fswrapper.cpp +++ b/console/dcm2niix_fswrapper.cpp @@ -52,7 +52,7 @@ numSeries = 0 */ // set TDCMopts defaults, overwrite settings to output in mgz orientation -void dcm2niix_fswrapper::setOpts(const char* dcmindir, const char* niioutdir) +void dcm2niix_fswrapper::setOpts(const char* dcmindir, const char* niioutdir, bool createBIDS) { memset(&tdcmOpts, 0, sizeof(tdcmOpts)); setDefaultOpts(&tdcmOpts, NULL); @@ -62,13 +62,15 @@ void dcm2niix_fswrapper::setOpts(const char* dcmindir, const char* niioutdir) if (niioutdir != NULL) strcpy(tdcmOpts.outdir, niioutdir); + strcpy(tdcmOpts.filename, "%4s.%p"); + // set the options for freesurfer mgz orientation tdcmOpts.isRotate3DAcq = false; tdcmOpts.isFlipY = false; tdcmOpts.isIgnoreSeriesInstanceUID = true; - tdcmOpts.isCreateBIDS = false; + tdcmOpts.isCreateBIDS = createBIDS; tdcmOpts.isGz = false; - //tdcmOpts.isForceStackSameSeries = 1; // merge 2D slice '-m y' + tdcmOpts.isForceStackSameSeries = 1; // merge 2D slice '-m y' tdcmOpts.isForceStackDCE = false; //tdcmOpts.isForceOnsetTimes = false; } @@ -119,3 +121,11 @@ const unsigned char* dcm2niix_fswrapper::getMRIimg(void) return mrifsStruct->imgM; } +void dcm2niix_fswrapper::dicomDump(const char* dicomdir) +{ + strcpy(tdcmOpts.indir, dicomdir); + tdcmOpts.isDumpNotConvert = true; + nii_loadDirCore(tdcmOpts.indir, &tdcmOpts); + + return; +} diff --git a/console/dcm2niix_fswrapper.h b/console/dcm2niix_fswrapper.h index f9e45702..8cb0189f 100644 --- a/console/dcm2niix_fswrapper.h +++ b/console/dcm2niix_fswrapper.h @@ -17,7 +17,7 @@ class dcm2niix_fswrapper { public: // set TDCMopts defaults, overwrite settings to output in mgz orientation. - static void setOpts(const char* dcmindir, const char* niioutdir); + static void setOpts(const char* dcmindir, const char* niioutdir=NULL, bool createBIDS=false); // interface to isDICOMfile() in nii_dicom.cpp static bool isDICOM(const char* file); @@ -35,6 +35,8 @@ class dcm2niix_fswrapper // return image data saved in MRIFSSTRUCT static const unsigned char* getMRIimg(void); + static void dicomDump(const char* dicomdir); + private: static struct TDCMopts tdcmOpts; }; diff --git a/console/nii_dicom_batch.cpp b/console/nii_dicom_batch.cpp index 2ba4e0ad..82da424c 100644 --- a/console/nii_dicom_batch.cpp +++ b/console/nii_dicom_batch.cpp @@ -2539,6 +2539,82 @@ int *nii_saveDTI(char pathoutname[], int nConvert, struct TDCMsort dcmSort[], st vx[i].V[1] = -vx[i].V[1]; } //for each direction } //if not a mosaic + +#ifdef USING_DCM2NIIXFSWRAPPER + // make adjustments for MGH bvecs output + for (int i = 0; i < (numDti); i++) { + if (sliceDir < 0) + { + // at this point, bvecs output is calculated as not isFlipY, assuming isFlipZ, determinant is positive. + // So, bvecs first column is reversed for FSL. + // MGH conversion: not isFlipY, slice direction not flipped, determinant is negative, + // 1. we need to reverse bvecs column 1 back, + // 2. also need to reverse bvecs collumn 3 + + float tmp = vx[i].V[1]; + vx[i].V[1] = -vx[i].V[1]; + if (getenv("DCM2NIIXFSWRAPPER_DEBUG") != NULL && strcmp(getenv("DCM2NIIXFSWRAPPER_DEBUG"), "yes") == 0) + { + if (i < 6) + printf("nii_saveDTI() (BVECS_DEBUG) (mgh adj. sliceDir < 0) flip bvecs sign column 1: %f => %f\n", tmp, vx[i].V[1]); + } + + if (fabs(vx[i].V[3]) > FLT_EPSILON) + { + tmp = vx[i].V[3]; + vx[i].V[3] = -vx[i].V[3]; + if (getenv("DCM2NIIXFSWRAPPER_DEBUG") != NULL && strcmp(getenv("DCM2NIIXFSWRAPPER_DEBUG"), "yes") == 0) + { + if (i < 6) + printf("nii_saveDTI() (BVECS_DEBUG) (mgh adj. sliceDir < 0) flip bvecs sign column 3: %f => %f\n", tmp, vx[i].V[3]); + } + } + } + else if (abs(sliceDir) == kSliceOrientMosaicNegativeDeterminant) + { + // swap signs for every column + for (int j = 1; j < 4; j++) + { + if (fabs(vx[i].V[j]) > FLT_EPSILON) + { + float tmp = vx[i].V[j]; + vx[i].V[j] = -vx[i].V[j]; + if (getenv("DCM2NIIXFSWRAPPER_DEBUG") != NULL && strcmp(getenv("DCM2NIIXFSWRAPPER_DEBUG"), "yes") == 0) + { + if (i < 6) + printf("nii_saveDTI() (BVECS_DEBUG) (mgh adj. abs(sliceDir) == kSliceOrientMosaicNegativeDeterminant) flip bvecs sign column j: %f => %f\n", tmp, vx[i].V[j]); + } + } + } + } + else // sliceDir >= 0 && abs(sliceDir) != kSliceOrientMosaicNegativeDeterminant + { + // MGH conversion: not flip Y, image determinant is positive, bvecs first column is reversed for FSL. + // So, we need to flip bvecs first column. + if (fabs(vx[i].V[1]) > FLT_EPSILON) + { + float tmp = vx[i].V[1]; + vx[i].V[1] = -vx[i].V[1]; + if (getenv("DCM2NIIXFSWRAPPER_DEBUG") != NULL && strcmp(getenv("DCM2NIIXFSWRAPPER_DEBUG"), "yes") == 0) + { + if (i < 6) + printf("nii_saveDTI() (BVECS_DEBUG) (mgh adj. abs(sliceDir) != kSliceOrientMosaicNegativeDeterminant) flip bvecs sign column 1: %f => %f\n", tmp, vx[i].V[1]); + } + } + } + } //for each direction + + mrifsStruct.numDti = numDti; + mrifsStruct.tdti = (TDTI *)malloc(numDti * sizeof(TDTI)); + for (int i = 0; i < numDti; i++) + { + mrifsStruct.tdti[i].V[0] = vx[i].V[0]; + mrifsStruct.tdti[i].V[1] = vx[i].V[1]; + mrifsStruct.tdti[i].V[2] = vx[i].V[2]; + mrifsStruct.tdti[i].V[3] = vx[i].V[3]; + } +#endif + if (opts.isVerbose) { for (int i = 0; i < (numDti); i++) { printMessage("%d\tB=\t%g\tVec=\t%g\t%g\t%g\n", i, vx[i].V[0], vx[i].V[1], vx[i].V[2], vx[i].V[3]); @@ -2564,12 +2640,7 @@ int *nii_saveDTI(char pathoutname[], int nConvert, struct TDCMsort dcmSort[], st for (int v = 0; v < 4; v++) //for each vector+B-value dti4D->S[i].V[v] = vx[i].V[v]; } -#ifdef USING_DCM2NIIXFSWRAPPER - mrifsStruct.tdti = vx; - mrifsStruct.numDti = numDti; -#else free(vx); -#endif return volOrderIndex; } @@ -2594,12 +2665,7 @@ int *nii_saveDTI(char pathoutname[], int nConvert, struct TDCMsort dcmSort[], st fclose(fp); #endif if (isIsotropic) { //issue 405: ISOTROPIC images have bval but not bvec -#ifdef USING_DCM2NIIXFSWRAPPER - mrifsStruct.tdti = vx; - mrifsStruct.numDti = numDti; -#else free(vx); -#endif return volOrderIndex; } @@ -2629,12 +2695,7 @@ int *nii_saveDTI(char pathoutname[], int nConvert, struct TDCMsort dcmSort[], st #endif #endif -#ifdef USING_DCM2NIIXFSWRAPPER - mrifsStruct.tdti = vx; - mrifsStruct.numDti = numDti; -#else free(vx); -#endif return volOrderIndex; } // nii_saveDTI() @@ -7448,6 +7509,27 @@ int saveDcm2NiiCore(int nConvert, struct TDCMsort dcmSort[], struct TDICOMdata d } // saveDcm2NiiCore() int saveDcm2Nii(int nConvert, struct TDCMsort dcmSort[], struct TDICOMdata dcmList[], struct TSearchList *nameList, struct TDCMopts opts, struct TDTI4D *dti4D) { +#ifdef USING_DCM2NIIXFSWRAPPER + if (opts.isDumpNotConvert) { + int indx0 = dcmSort[0].indx; + if (opts.isIgnoreSeriesInstanceUID) + printMessage("%d %s %s (total %d)\n", dcmList[indx0].seriesUidCrc, dcmList[indx0].protocolName, nameList->str[indx0], nConvert); + else + printMessage("%d %ld %s %s (total %d)\n", dcmList[indx0].seriesUidCrc, dcmList[indx0].seriesNum, dcmList[indx0].protocolName, nameList->str[indx0], nConvert); + +#if 1 + for (int i = 0; i < nConvert; i++) { + int indx = dcmSort[i].indx; + if (opts.isIgnoreSeriesInstanceUID) + printMessage("\t#\%d: %d %s\n", i+1, dcmList[indx].seriesUidCrc, nameList->str[indx]); + else + printMessage("\t#\%d: %d %ld %s\n", i+1, dcmList[indx].seriesUidCrc, dcmList[indx].seriesNum, nameList->str[indx]); + } +#endif + } + + return 0; +#endif //this wrapper does nothing if all the images share the same echo time and scale // however, it segments images when these properties vary uint64_t indx = dcmSort[0].indx; @@ -7772,7 +7854,18 @@ bool isSameSet(struct TDICOMdata d1, struct TDICOMdata d2, struct TDCMopts *opts // *isMultiEcho = true; //} #ifdef USING_DCM2NIIXFSWRAPPER - printf("isForceStackSameSeries = true, seriesNum %ld, %ld, seriesInstanceUidCrc %d, %d\n", d1.seriesNum, d2.seriesNum, d1.seriesUidCrc, d2.seriesUidCrc); + /* for mgh conversion set opts->isForceStackSameSeries = 1 by default, *isMultiEcho, *isNonParallelSlices, and *isCoilVaries remain unchanged. + * + * local variable isForceStackSeries is set to true if following condition met: + * if ((opts->isForceStackDCE) && (d1.isStackableSeries) && (d2.isStackableSeries) && (d1.seriesNum != d2.seriesNum)) { + * if (!warnings->forceStackSeries) + * printMessage("Volumes stacked despite varying series number (use '-m o' to turn off merging).\n"); + * warnings->forceStackSeries = true; + * isForceStackSeries = true; + * } + */ + + //printf("isForceStackSameSeries = true, seriesNum %ld, %ld, seriesInstanceUidCrc %d, %d\n", d1.seriesNum, d2.seriesNum, d1.seriesUidCrc, d2.seriesUidCrc); #endif return true; //we will stack these images, even if they differ in the following attributes } @@ -8466,7 +8559,8 @@ int nii_loadDirCore(char *indir, struct TDCMopts *opts) { fillTDCMsort(dcmSort[nConvert], j, dcmList[j]); nConvert++; } else { - if (isNonParallelSlices) { + // ??? isMultiEcho, isCoilVaries, isNonParallelSlices are false here ??? + if (isNonParallelSlices) { dcmList[i].isNonParallelSlices = true; dcmList[j].isNonParallelSlices = true; } @@ -8535,6 +8629,8 @@ int nii_loadDirCore(char *indir, struct TDCMopts *opts) { nConvert++; } } //for all images with same seriesUID as first one + + // MGH set Opts.isForceStackSameSeries = 1 by default, isMultiEcho, isNonParallelSlices, isCoilVaries remain false for MGH default run after isSameSet if ((isNonParallelSlices) && (dcmList[ii].CSA.mosaicSlices > 1) && (nConvert > 0)) { //issue481: if ANY volumes are non-parallel, save ALL as 3D printWarning("Saving mosaics with non-parallel slices as 3D (issue 481)\n"); for (int j = i; j < (int)nDcm; j++) { @@ -8986,6 +9082,8 @@ void setDefaultOpts(struct TDCMopts *opts, const char *argv[]) { //either "setDe opts->numSeries = 0; memset(opts->seriesNumber, 0, sizeof(opts->seriesNumber)); strcpy(opts->filename, "%f_%p_%t_%s"); + + opts->isDumpNotConvert = false; } // setDefaultOpts() #if defined(_WIN64) || defined(_WIN32) diff --git a/console/nii_dicom_batch.h b/console/nii_dicom_batch.h index 6271016e..00ab73ec 100644 --- a/console/nii_dicom_batch.h +++ b/console/nii_dicom_batch.h @@ -25,15 +25,15 @@ extern "C" { typedef struct { - struct nifti_1_header hdr0; + struct nifti_1_header hdr0; - size_t imgsz; - unsigned char *imgM; + size_t imgsz; + unsigned char *imgM; - struct TDICOMdata tdicomData; + struct TDICOMdata tdicomData; - struct TDTI *tdti; - int numDti; + struct TDTI *tdti; + int numDti; } MRIFSSTRUCT; MRIFSSTRUCT* nii_getMrifsStruct(); @@ -57,6 +57,7 @@ void nii_clrMrifsStruct(); #define kOptsStr 512 struct TDCMopts { + bool isDumpNotConvert; bool isIgnoreTriggerTimes, isTestx0021x105E, isAddNamePostFixes, isSaveNativeEndian, isOneDirAtATime, isRenameNotConvert, isSave3D, isGz, isPipedGz, isFlipY, isCreateBIDS, isSortDTIbyBVal, isAnonymizeBIDS, isOnlyBIDS, isCreateText, isForceOnsetTimes,isIgnoreDerivedAnd2D, isPhilipsFloatNotDisplayScaling, isTiltCorrect, isRGBplanar, isOnlySingleFile, isForceStackDCE, isIgnoreSeriesInstanceUID, isRotate3DAcq, isCrop; int saveFormat, isMaximize16BitRange, isForceStackSameSeries, nameConflictBehavior, isVerbose, isProgress, compressFlag, dirSearchDepth, onlySearchDirForDICOM, gzLevel, diffCyclingModeGE; //support for compressed data 0=none, char filename[kOptsStr], outdir[kOptsStr], indir[kOptsStr], pigzname[kOptsStr], optsname[kOptsStr], indirParent[kOptsStr], imageComments[24]; @@ -78,7 +79,7 @@ void nii_clrMrifsStruct(); void readIniFile (struct TDCMopts *opts, const char * argv[]); int nii_saveNIIx(char * niiFilename, struct nifti_1_header hdr, unsigned char* im, struct TDCMopts opts); int nii_loadDir(struct TDCMopts *opts); - int nii_loadDirCore(char *indir, struct TDCMopts* opts); + int nii_loadDirCore(char *indir, struct TDCMopts* opts); void nii_SaveBIDS(char pathoutname[], struct TDICOMdata d, struct TDCMopts opts, struct nifti_1_header *h, const char * filename); int nii_createFilename(struct TDICOMdata dcm, char * niiFilename, struct TDCMopts opts); void nii_createDummyFilename(char * niiFilename, struct TDCMopts opts); From 647096f81d239397b076f2445c72e908ee457ee5 Mon Sep 17 00:00:00 2001 From: Yujing Huang Date: Fri, 21 Apr 2023 11:49:43 -0400 Subject: [PATCH 82/85] fix spelling error --- console/nii_dicom_batch.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/console/nii_dicom_batch.cpp b/console/nii_dicom_batch.cpp index 82da424c..936069b8 100644 --- a/console/nii_dicom_batch.cpp +++ b/console/nii_dicom_batch.cpp @@ -2549,7 +2549,7 @@ int *nii_saveDTI(char pathoutname[], int nConvert, struct TDCMsort dcmSort[], st // So, bvecs first column is reversed for FSL. // MGH conversion: not isFlipY, slice direction not flipped, determinant is negative, // 1. we need to reverse bvecs column 1 back, - // 2. also need to reverse bvecs collumn 3 + // 2. also need to reverse bvecs column 3 float tmp = vx[i].V[1]; vx[i].V[1] = -vx[i].V[1]; From 48a3063e184c8d152a6e33b52897bbb90226215d Mon Sep 17 00:00:00 2001 From: Yujing Huang Date: Fri, 21 Apr 2023 13:07:25 -0400 Subject: [PATCH 83/85] saveDcm2Nii() - bug fix when opts.isDumpNotConvert is true --- console/nii_dicom_batch.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/console/nii_dicom_batch.cpp b/console/nii_dicom_batch.cpp index 936069b8..71052e03 100644 --- a/console/nii_dicom_batch.cpp +++ b/console/nii_dicom_batch.cpp @@ -7526,9 +7526,9 @@ int saveDcm2Nii(int nConvert, struct TDCMsort dcmSort[], struct TDICOMdata dcmLi printMessage("\t#\%d: %d %ld %s\n", i+1, dcmList[indx].seriesUidCrc, dcmList[indx].seriesNum, nameList->str[indx]); } #endif - } - return 0; + return 0; + } #endif //this wrapper does nothing if all the images share the same echo time and scale // however, it segments images when these properties vary From 1cae4ee869985facab14df054f4bcd2bb5c0aae4 Mon Sep 17 00:00:00 2001 From: Yujing Huang Date: Fri, 21 Apr 2023 13:30:35 -0400 Subject: [PATCH 84/85] fix the comment --- console/nii_dicom_batch.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/console/nii_dicom_batch.cpp b/console/nii_dicom_batch.cpp index 71052e03..cadeb2bb 100644 --- a/console/nii_dicom_batch.cpp +++ b/console/nii_dicom_batch.cpp @@ -8559,7 +8559,6 @@ int nii_loadDirCore(char *indir, struct TDCMopts *opts) { fillTDCMsort(dcmSort[nConvert], j, dcmList[j]); nConvert++; } else { - // ??? isMultiEcho, isCoilVaries, isNonParallelSlices are false here ??? if (isNonParallelSlices) { dcmList[i].isNonParallelSlices = true; dcmList[j].isNonParallelSlices = true; From 1c6794d88cbea1f44bf93c4972ae16752e0b8fae Mon Sep 17 00:00:00 2001 From: neurolabusc Date: Sat, 22 Apr 2023 11:16:22 -0400 Subject: [PATCH 85/85] Notes on Canon phase encoding --- Canon/README.md | 3 +-- README.md | 23 ++++++++--------------- console/nii_dicom_batch.cpp | 2 +- 3 files changed, 10 insertions(+), 18 deletions(-) diff --git a/Canon/README.md b/Canon/README.md index 829f4cc7..6a9186a5 100644 --- a/Canon/README.md +++ b/Canon/README.md @@ -37,8 +37,7 @@ In contrast, Canon software [V6.1](https://github.com/neurolabusc/dcm_qa_canon_6 The [BIDS format](https://bids.neuroimaging.io) can record several sequence properties that are useful for processing MRI data. The DICOM headers created by Toshiba scanners are very clean and minimalistic, and do not report several of these advanced properties. Therefore, dcm2niix is unable to populate these properties of the JSON file. This reflects a limitation of the DICOM images, not of dcm2niix. - SliceTiming is not recorded. This can be useful for slice time correction. - - Phase encoding polarity is not record. This is useful for undistortion with [TOPUP](https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/topup). Clément Debacker notes that this parameter can be encoded into a XML field called `` inserted in the private tag700D,1119. However, this requires the user to explicitly request these details and uses XML rather than DICOM so it is not easily parsed. To enable this, choose `Utility` > `Maintenance` > `Config.` > `DICOM management` > `Remote Node` > Select desired node > `Edit` > Beside Storage click on `Details` > `Advanced 1` > `Private tag for MRI image`. - + - Phase encoding polarity is not recorded. This is useful for undistortion with [TOPUP](https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/topup). Clément Debacker notes that this parameter can be encoded into a XML field called `` inserted in the private tag 700D,1119. However, this requires the user to explicitly request these details and uses XML rather than DICOM so it is not easily parsed. To enable this, you must have the option "Private tag for MRI image" activated on the scanner. You can ask your local clinical scientist/application specialist to enable it. ## Sample Datasets diff --git a/README.md b/README.md index 7de22ccb..1a9f26ff 100644 --- a/README.md +++ b/README.md @@ -67,38 +67,30 @@ Ubuntu: `sudo apt-get install cmake pkg-config` MacOS: `brew install cmake pkg-config` or `sudo port install cmake pkgconfig` -**Basic build:** +Once these tools are available, you can compile with cmake: + ```bash git clone https://github.com/rordenlab/dcm2niix.git cd dcm2niix mkdir build && cd build -cmake .. +cmake -DZLIB_IMPLEMENTATION=Cloudflare -DUSE_JPEGLS=ON -DUSE_OPENJPEG=ON .. make ``` `dcm2niix` will be created in the `bin` subfolder. To install on the system run `make install` instead of `make` - this will copy the executable to your path so you do not have to provide the full path to the executable. In rare case if cmake fails with the message like `"Generator: execution of make failed"`, it could be fixed by ``sudo ln -s `which make` /usr/bin/gmake``. -**Advanced build:** +### Building the command line version without cmake -As noted in the `Image Conversion and Compression Support` section, the software provides many optional modules with enhanced features. A common choice might be to include support for JPEG2000, [JPEG-LS](https://github.com/team-charls/charls) (this option requires a c++14 compiler), as well as using the high performance Cloudflare zlib library (this option requires a CPU built after 2008). To build with these options simply request them when configuring cmake: +This is the simplest way to compile dcm2niix on a Linux or MacOS computer. Be warned that this minimal version will not be able to extract DICOM images compressed with the (rarely used) JPEG2000 or JPEG-LS formats. ```bash git clone https://github.com/rordenlab/dcm2niix.git -cd dcm2niix -mkdir build && cd build -cmake -DZLIB_IMPLEMENTATION=Cloudflare -DUSE_JPEGLS=ON -DUSE_OPENJPEG=ON .. +cd dcm2niix/console make +./dcm2niix ``` -**optional batch processing version:** - -The batch processing binary `dcm2niibatch` is optional. To build `dcm2niibatch` as well change the cmake command to `cmake -DBATCH_VERSION=ON ..`. This requires a compiler that supports c++11. - -### Building the command line version without cmake - -If you have any problems with the cmake build script described above or want to customize the software see the [COMPILE.md file for details on manual compilation](./COMPILE.md). - ## Referencing - Li X, Morgan PS, Ashburner J, Smith J, Rorden C (2016) The first step for neuroimaging data analysis: DICOM to NIfTI conversion. J Neurosci Methods. 264:47-56. doi: 10.1016/j.jneumeth.2016.03.001. [PMID: 26945974](https://www.ncbi.nlm.nih.gov/pubmed/26945974) @@ -141,6 +133,7 @@ The following tools exploit dcm2niix - [bidskit](https://github.com/jmtyszka/bidskit) uses dcm2niix to create [BIDS](http://bids.neuroimaging.io/) datasets. - [BioImage Suite Web Project](https://github.com/bioimagesuiteweb/bisweb) is a JavaScript project that uses dcm2niix for its DICOM conversion module. - [birc-bids](https://github.com/bircibrain/birc-bids) provides a Docker/Singularity container with various BIDS conversion utilities. + - [BMAT](https://github.com/ColinVDB/BMAT) translates data from MRI scanners to the BIDS structure. - [BOLD5000_autoencoder](https://github.com/nmningmei/BOLD5000_autoencoder) uses dcm2niix to pipe imaging data into an unsupervised machine learning algorithm. - [boutiques-dcm2niix](https://github.com/lalet/boutiques-dcm2niix) is a dockerfile for installing and validating dcm2niix. - [Brain imAgiNg Analysis iN Arcana (Banana)](https://pypi.org/project/banana/) is a collection of brain imaging analysis workflows, it uses dcm2niix for format conversions. diff --git a/console/nii_dicom_batch.cpp b/console/nii_dicom_batch.cpp index cadeb2bb..f913f2ff 100644 --- a/console/nii_dicom_batch.cpp +++ b/console/nii_dicom_batch.cpp @@ -1897,7 +1897,7 @@ tse3d: T2*/ fprintf(fp, "\t\"MultibandAccelerationFactor\": %d,\n", d.CSA.multiBandFactor); json_Float(fp, "\t\"PercentPhaseFOV\": %g,\n", d.phaseFieldofView); json_Float(fp, "\t\"PercentSampling\": %g,\n", d.percentSampling); - if (d.echoTrainLength > 1) //>1 as for Siemens EPI this is 1, Siemens uses EPI factor http://mriquestions.com/echo-planar-imaging.html + if (d.echoTrainLength > 1) //>1 as for Siemens EPI this is 1, Siemens uses EPI factor http://mriquestions.com/echo-planar-imaging.html fprintf(fp, "\t\"EchoTrainLength\": %d,\n", d.echoTrainLength); //0018,0091 Combination of partial fourier and in-plane parallel imaging if (d.partialFourierDirection == kPARTIAL_FOURIER_DIRECTION_PHASE) fprintf(fp, "\t\"PartialFourierDirection\": \"PHASE\",\n");