Skip to content

Commit

Permalink
Merge pull request #7 from HealthBioscienceIDEAS/4-add-quick-dcm2niix…
Browse files Browse the repository at this point in the history
…-intro

Stray commit that wasn't done before
  • Loading branch information
davecash75 authored Sep 23, 2024
2 parents 5bbf9f0 + 8773fff commit 1085750
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions episodes/imaging-data-structure-and-formats.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ example [dcm2niix](https://www.nitrc.org/plugins/mwiki/index.php/dcm2nii:MainPag

:::::::::::::::::::::: discussion
If you are interested in trying out converting DICOM data to Nifti, we have some
sample DICOM data for you. Please see the [bonus exercise](#bonus_dicom) at the end of this lesson
sample DICOM data for you. Please see the [bonus exercise](#bonus-exercise-dicom-to-nifti) at the end of this lesson
if you would like to give this a go.
::::::::::::::::::::::

Expand Down Expand Up @@ -786,14 +786,17 @@ As discussed earlier, if you have received medical imaging data from a hosptial
DICOM format. However, most of the software you are likely to use wants medical images in a
more manageable format, typically NIfTI images. There are many ways to convert between the two,
but probably the most widely used is [dcm2niix](https://www.nitrc.org/plugins/mwiki/index.php/dcm2nii:MainPage)).
You can find the sample data in `~/data/ImageDataVisualization/DICOM`
Let's first change into this directory
You can find the sample data in `~/data/ImageDataVisualization/DICOM`. Let's first change into this directory
```bash
cd data/ImageDataVisualization/DICOM
cd ~/data/ImageDataVisualization/DICOM
```
If you list the contents, you will see a single folder called `Subject01`
Let's first make a directory for the Nifti output
```bash
mkdir Nifti
```
Expand All @@ -810,20 +813,24 @@ We covered how to get help for a command in an earlier section.
::::::::::::::::::::: solution
1. To get help, we use the -h option:
```bash
dcm2niix -h
```
2. The simplest command to do this is
```bash
dcm2niix -o Nifti Subject01
```
3. To zip the file, we use the -z function:
```bash
dcm2niix -z y -o Nifti Subject01
```
4. TO change the naming structure, we use the -f function. How you name them
4. To change the naming structure, we use the -f function. How you name them
tends to be your personal choice, and many people choose to use the BIDS
standard for naming the data.
```bash
dcm2niix -f %i_%s_%d -z y -o Nifti Subject01
```
Expand Down

0 comments on commit 1085750

Please sign in to comment.