Skip to content

Commit

Permalink
Update SForm formula for images with shear (#697)
Browse files Browse the repository at this point in the history
  • Loading branch information
neurolabusc committed Apr 5, 2023
1 parent 66424af commit a0dfcc3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion console/nii_dicom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
2 changes: 1 addition & 1 deletion console/nii_dicom.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions console/nii_dicom_batch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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
Expand Down

0 comments on commit a0dfcc3

Please sign in to comment.