Skip to content

Commit

Permalink
Notes on Canon phase encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
neurolabusc committed Apr 22, 2023
1 parent 8df37c7 commit 1c6794d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 18 deletions.
3 changes: 1 addition & 2 deletions Canon/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<VG>` 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 `<VG>` 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

Expand Down
23 changes: 8 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion console/nii_dicom_batch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 1c6794d

Please sign in to comment.