Skip to content

Commit

Permalink
Merge commit 'v1.0.20200427-97-g0587941' into debian
Browse files Browse the repository at this point in the history
* commit 'v1.0.20200427-97-g0587941': (22 commits)
  Overflow for Siemens data [missing protocol name] (rordenlab#466)
  MacOS notarization, minor tweaks
  Increase details for series stacking, enhance merge override mode (rordenlab#463)
  Bump version date
  Retain Philips Scaling Values for images where scaling does not vary but volumes must be separated (rordenlab#461)
  Support huge PAR/REC files (rordenlab#460)
  Prevent dti4D overflow
  Fix PAR/REC ADC detection (rordenlab#462)
  DICOM field map calibrated in Hz given name _fieldmaphz (rordenlab#455)
  PAR/REC field map calibrated in Hz given name _fieldmaphz (rordenlab#455)
  Ignore LocationsInAcquisition (0020,1002) if number of slices is not evenly divisible with this value (rordenlab#459)
  Convert DICOM series where bit allocated (0028,0100) varies across slices (rordenlab#458)
  Clear RepetitionTimeExcitation (rordenlab#457)
  leak (rordenlab#454)
  Single file mode memory allocation (rordenlab#454)
  When -n is specified, only save BIDS for requested series (rordenlab#453)
  Use 1st study time if multiple times provided.
  Apple. M1. use C++ not. C
  Fix CMake for Apple Silicon (note similar change required for CloudFlare zlib)
  Only report b-value for GE data with 0043,1039 if EPI (0018,9018) (rordenlab#449)
  ...
  • Loading branch information
yarikoptic committed Dec 23, 2020
2 parents f71e1f8 + 0587941 commit 825cec6
Show file tree
Hide file tree
Showing 7 changed files with 329 additions and 153 deletions.
1 change: 1 addition & 0 deletions FILENAMING.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ In general dcm2niix creates images with 3D dimensions, or 4 dimensions when the

Some post-fixes are specific to Philips DICOMs
- _ADC Philips specific case. A DWI image where derived isotropic, ADC or trace volume was appended to the series. Since this image will disrupt subsequent processing, and because subsequent processing (dwidenoise, topup, eddy) will yield better derived images, dcm2niix will also create an additional image without this volume. Therefore, the _ADC file should typically be discarded. If you want dcm2niix to discard these useless derived images, use the ignore feature ('-i y').
- _fieldmaphz unwrapped B0 field map (in Hz) generated by a Philips scanner. Suggests Image Type (0008,0008) includes the terms 'B0' and 'MAP'.
- _Raw Philips XX_* DICOMs (Raw Data Storage).
- _PS Philips PS_* DICOMs (Grayscale Softcopy Presentation State).

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ The following tools exploit dcm2niix
- [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.
- [NiftyPET](https://niftypet.readthedocs.io/en/latest/install.html) provides PET image reconstruction and analysis, and uses dcm2niix to handle DICOM images.
- [nipype](https://github.com/nipy/nipype) can use dcm2niix to convert images.
- [PNL-nipype](https://github.com/pnlbwh/Dummy-PNL-nipype) is a Python script 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.
- [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.
- [pydcm2niix is a Python module for working with dcm2niix](https://github.com/jstutters/pydcm2niix).
- [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.
- [qsm](https://github.com/CAIsr/qsm) Quantitative Susceptibility Mapping software.
Expand Down
13 changes: 9 additions & 4 deletions console/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,15 @@ endif()
# Compiler dependent flags
include (CheckCXXCompilerFlag)
if(UNIX)
check_cxx_compiler_flag(-msse2 HAS_SSE2)
if(HAS_SSE2)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2 -mfpmath=sse")
endif()
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)
Expand Down
124 changes: 75 additions & 49 deletions console/nii_dicom.cpp

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions console/nii_dicom.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ extern "C" {
#define kCPUsuf " " //unknown CPU
#endif

#define kDCMdate "v1.0.20201102"
#define kDCMdate "v1.0.20201224"
#define kDCMvers kDCMdate " " kJP2suf kLSsuf kCCsuf kCPUsuf

static const int kMaxEPI3D = 1024; //maximum number of EPI images in Siemens Mosaic
static const int kMaxDTI4D = 18000; //maximum number of DTI directions for 4D (Philips) images, also maximum number of 3D slices for Philips 3D and 4D images
static const int kMaxSlice2D = 64000; //maximum number of 2D slices in 4D (Philips) images
static const int kMaxSlice2D = 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
#define kDICOMStrLarge 256
Expand Down Expand Up @@ -139,7 +139,7 @@ static const uint8_t MAX_NUMBER_OF_DIMENSIONS = 8;
bool isReal[kMaxDTI4D];
bool isImaginary[kMaxDTI4D];
bool isPhase[kMaxDTI4D];
float repetitionTimeExcitation, repetitionTimeInversion;
float repetitionTimeExcitation, repetitionTimeInversion;
};

#ifdef _MSC_VER //Microsoft nomenclature for packed structures is different...
Expand Down Expand Up @@ -192,7 +192,7 @@ static const uint8_t MAX_NUMBER_OF_DIMENSIONS = 8;
char institutionAddress[kDICOMStrLarge], imageComments[kDICOMStrLarge];
uint32_t dimensionIndexValues[MAX_NUMBER_OF_DIMENSIONS];
struct TCSAdata CSA;
bool isPrivateCreatorRemap, isHasOverlay, isEPI, isIR, isPartialFourier, isDiffusion, isVectorFromBMatrix, isRawDataStorage, isGrayscaleSoftcopyPresentationState, isStackableSeries, isCoilVaries, isNonParallelSlices, isSegamiOasis, isXA10A, isScaleOrTEVaries, isScaleVariesEnh, isDerived, isXRay, isMultiEcho, isValid, is3DAcq, is2DAcq, isExplicitVR, isLittleEndian, isPlanarRGB, isSigned, isHasPhase, isHasImaginary, isHasReal, isHasMagnitude,isHasMixed, isFloat, isResampled, isLocalizer;
bool isRealIsPhaseMapHz, isPrivateCreatorRemap, isHasOverlay, isEPI, isIR, isPartialFourier, isDiffusion, isVectorFromBMatrix, isRawDataStorage, isGrayscaleSoftcopyPresentationState, isStackableSeries, isCoilVaries, isNonParallelSlices, 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;
};

Expand Down
Loading

0 comments on commit 825cec6

Please sign in to comment.