diffusion tensor imaging from dicom to nrrd l.
Download
Skip this Video
Download Presentation
Diffusion Tensor Imaging: from Dicom to Nrrd

Loading in 2 Seconds...

play fullscreen
1 / 91

Diffusion Tensor Imaging: from Dicom to Nrrd - PowerPoint PPT Presentation


  • 127 Views
  • Uploaded on

National Alliance for Medical Image Computing. Diffusion Tensor Imaging: from Dicom to Nrrd. Sonia Pujol, Ph.D. Randy Gollub, M.D., Ph.D. Acknowledgments. National Alliance for Medical Image Computing NIH U54EB005149 Neuroimage Analysis Center NIH P41RR013218

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Diffusion Tensor Imaging: from Dicom to Nrrd' - content


Download Now An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
acknowledgments
Acknowledgments

National Alliance for Medical Image Computing

NIH U54EB005149

Neuroimage Analysis Center

NIH P41RR013218

Laboratory of Mathematics in Imaging,

Brigham and Women’s Hospital

Thanks to Dr. Gordon Kindlmann

Dartmouth Hitchcock Medical Center

Thanks to Dr. Andy Saykin

goal of the tutorial

Raw Data

Raw Data

Raw Data

Dicom Header

Dicom Header

Dicom Header

Dicom Header

Raw Data

Nrrd

Header

Goal of the Tutorial

Training on how to convert DICOM DWI data to the Nrrd File format, compatible with Slicer visualization and analysis

overview
Overview
  • Part 1: DWI data specificity
  • Part 2: Nrrd description
  • Part 3: Generating Nrrd Files
  • Part 4: Working with DICOM DWI training data
  • Part 5: Orientation validation within Slicer
diffusion weighted imaging
Diffusion Weighted Imaging

Diffusion Weighted Images

Diffusion Sensitizing Gradients

The signal is dimmer when the direction of the applied gradient is parallel to the principal direction of diffusion.

diffusion weighted imaging dwi
Diffusion Weighted Imaging (DWI)

Example: Correlation between the orientation of the 11th gradient and the signal intensity in the Splenium of the Corpus Callosum

diffusion weighted imaging7
Diffusion Weighted Imaging

(Stejskal and Tanner 1965, Basser 1994 )

Diffusion Weighted Images

{Si} represent the signal intensities in presence of the diffusion sensitizing gradients gi

b is the diffusion weighted parameter

background
Background
  • Challenge: Concise and standardized description of the information contained in DWI data.
  • Current situation:
    • DICOM (Supplement 49) contains information on how to represent b-value and gradient directions of DWI
    • However every MR Scanner manufacturer has their own unique way of archiving the relevant image acquisition parameters
    • The definition of the coordinate frame of the diffusion gradients is not explicitly recorded in the header
  • Proposed Solution:Nrrd format
overview12
Overview
  • Part 1: DWI data specificity
  • Part 2: Nrrd description
  • Part 3: Generating Nrrd Files
  • Part 4: Working with DICOM DWI training data
  • Part 5: Orientation validation within Slicer
nearly raw raster data nrrd

Raw Data

Raw Data

Raw Data

Nearly Raw Raster Data (Nrrd)
  • The flexible Nrrd format includes a single header file and image file(s) that can be separate or combined.
  • A Nrrd header accurately represents N-dimensional raster information for scientific visualization and medical image processing.

+

Nrrd

Header

nrrd file format
Nrrd file format
  • NA-MIC has developed a robust way of using the Nrrd format to represent DWI volumes
nrrd file format15
Nrrd file format
  • DWI data written into Nrrd format with appropriate parameters can be read into 3D Slicer
coordinate frames

(X,Y,Z)

(I,J,K)

Coordinate Frames

Courtesy G.Kindlmann

Diffusion Weighted Images

Diffusion Sensitizing Gradients

Courtesy G.Kindlmann

coordinate frames17

(X,Y,Z)

(I,J,K)

Coordinate Frames

Diffusion Sensitizing Gradients

(X,Y,Z)

DWI Image Orientation

(I,J,K)

Patient Space

Courtesy G.Kindlmann

transformation matrices
Transformation matrices

T: IJKRAS

(I,J,K)

(X,Y,Z)

T: XYZRAS

(R,A,S)

Courtesy G.Kindlmann

nrrd terminology
Nrrd Terminology

T: XYZRAS

(X,Y,Z)

(I,J,K)

T: IJKRAS

(R,A,S)

Courtesy G.Kindlmann

nrrd requirements for dwi data
Nrrd requirements for DWI data

To generate a Nrrd header for DWI data, you’ll

need to know information about data representation:

  • DWI Volume characteristics
    • Data Type
    • Endianess
    • Dimensions
  • Disk Storage
    • Axis Ordering
nrrd requirements for dwi data21
Nrrd requirements for DWI data

To generate a Nrrd header for DWI data, you’ll

need to know the acquisition parameters:

  • Coordinate Frames
    • DWI Image Orientation
    • Gradient Measurement Frame
overview22
Overview
  • Part 1: DWI data specificity
  • Part 2: Nrrd description
  • Part 3: Generating Nrrd Files
  • Part 4: Working with DICOM DWI training data
  • Part 5: Orientation validation within Slicer
generating nrrd files
Generating Nrrd Files
  • Nrrd files can be generated from the Tk console of Slicer using the “unu” command line tool
  • unu is part of set of libraries called “Teem” compiled into Slicer 2.6

http://teem.sourceforge.net/

  • Slicer includes a Nrrd reader to load DWI volumes in Nrrd format
unu syntax
Unu syntax
  • General Syntax:

unucmd-iinput-ooutput

  • Tips:

“unu”  list of unu commands

“unucmd” help on cmd

unu syntax make command
Unu syntax: ‘make’ command
  • ‘make’ syntax:

unumake-iinput-ooutput

  • ‘make’ documentation:

unumakehelp on make

running unu on windows
Running unu on Windows

To run the unu command from the Tk

console, type unu.

On Windows, you do not need to be in the

directory win32/bin/teem-build/bin

 the unu commands run from any location.

running unu on mac linux solaris
Running unu on Mac/Linux/Solaris

To run the unu command from the Tk console,

you need to enter the whole path to the /bin

directory

Ex: Mac ../slicer2.6-opt-darwin-ppc-2006-05-18/Lib/darwin-ppc/teem-build/bin

overview28
Overview
  • Part 1: DWI data specificity
  • Part 2: Nrrd description
  • Part 3: Generating Nrrd Files
  • Part 4: Working with DICOM DWI training data
  • Part 5: Orientation validation within Slicer
dicom dwi training data
DICOM DWI Training Data
  • 2 Baselines and 12 Gradients
  • 504 DICOM images named S4.xxx where xxx is the image number
dwi training data
DWI Training Data

Type the command cd and enter the path to your data in the Tk Console. Type ls to list all the data files.

dwi training data31
DWI Training Data

The dataset is composed of 504 images named S4.xxx

unu command windows
Unu command (Windows)

Type the unu command with the input, encoding and byteskip fields

unu make -h --input S4.%03d 1 504 1 2 --encoding raw --byteskip -1

Do not hit Enter

2D Image

Read backwards from end of file

Min index

Increment

Max index

unu command mac linux
Unu command (Mac/Linux)

Type the unu command with the input, encoding and byteskip fields

slicer2.6-opt-darwin-ppc-2006-05-18/Lib/darwin-ppc/teem-build/bin

unu make -h --input S4.%03d 1 504 1 2 --encoding raw --byteskip -1

2D Image

Read backwards from end of file

Min index

Increment

Max index

numbers as file naming convention
Numbers as file naming convention (*)

unu make -h --input S4.%03d 1 504 1 2 --encoding raw --byteskip -1

  • % is a special character to be replaced by the specific file number (cf C/C++ printf command)
  • %03d means a 3 digit number with zero “padding”: Padding means there will be zeros instead of spaces at the beginning of the number

Ex: %03d  S4.001 for file number 1 %03d  S4.024 for file number 24

  • This is a compact way to refer to the whole image sequence

(*) Background information

read the dicom header
Read the DICOM Header

Click on AddVolume

read the dicom header36
Read the DICOM Header

The Props panel appears.

Select the Properties Dicom

read the dicom header37
Read the DICOM Header

The Dicom Props panel appears.

Click on Select Dicom

Volume and browse to

load the dataset located in

the directory dwi-dicom

read the dicom header38
Read the Dicom Header

Slicer displays the list of

Dicom files in the directory.

Click on OK

read the dicom header39
Read the Dicom Header

Click on Extract Header to display the content of the Dicom Header.

read the dicom header40
Read the Dicom Header

Slicer displays the content of the Dicom Header.

This information will be used to generate the Nrrd header.

extracting the volume characteristics
Extracting the volume characteristics
  • Extract the values corresponding to the following information:
  • - Data Type
  • Endianess
  • Image Dimensions
extracting the volume characteristics42
Extracting the volume characteristics

- Data Type: Short

- Endianess: Little

unu command
Unu Command

Add the fields endian and type to the unu command

--endian little --type short

extracting the volume characteristics44
Extracting the volume characteristics

Image Dimensions: 256 pixels x 256 pixels

The dataset was acquired with Nb=2 Baselines and Ng=12 Gradients

dicom dwi training data45
DICOM DWI Training Data
  • 2 Baselines and 12 Gradients
  • 504 DICOM images named S4.xxx where xxx is the image number
extracting the volume characteristics46
Extracting the volume characteristics

Image Dimensions: 256 pixels x 256 pixels

The dataset was acquired with Nb=2 Baselines and Ng=12 Gradients

  • n=NbxNg = 12 + 2 = 14 intensity values/voxel
  • NSlices= NdicomImages/n = 504/14 = 36 slices
unu command47
Unu Command

Add the fields size and centering to the unu command

Medical images are cell-centered samples

--size 256 256 36 14

--centering cell cell cell none

slice thickness
Slice Thickness

Extract the slice thickness from the Dicom header

slice thickness49
Slice Thickness

slice thickness = 3.00 mm

slice thickness50
Slice Thickness

Add the field thickness to the unu command

--thickness nan nan 3.0 nan

building the transformation matrices
Building the transformation matrices

We specifically change orientation from the DICOM default of Left

Posterior-Superior(LPS) to Right-Anterior-Superior(RAS)

so that the data can be viewed in Slicer coordinate space

DICOM: LPS

SLICER: RAS

space directions
Space Directions

Add the field space to the unu command

--space right-anterior-superior

space directions53
Space Directions

Extract the pixel size from the Dicom Header.

space directions54
Space Directions

Pixel size = 0.9375 mm x 0.9375 mm

The dataset was acquired with Superior-Inferior slice ordering

space directions55

DICOM: LPS

SLICER: RAS

Space Directions

Add the fields directions and unit to the unu command

--directions “(-0.9375,0,0) (0,-0.9375,0) (0,0,-3) none“

space origin
Space Origin

The space origin is the position of the first pixel in the first image.

This information is contained in the Dicom Header of the first slice.

Courtesy G.Kindlmann

space origin57
Space Origin

The space origin information is located in the Dicom header

[0020,0032, Image Position Patient ]

Courtesy G.Kindlmann

space origin58
Create a directory called

FirstSlice and copy the first file

S4.001 of the Dicom-dwi

dataset

Space Origin

Click on Cancel to come back to the Main menu

space origin59
Space Origin

Click Add Volume

select the tab Props,

and the format DICOM

space origin60
Space Origin

Click on Select DICOM Volume

Select the directory /FirstSlice

containing the first slice

space origin61
Space Origin

Click on List Headers to

display the content of the

header of the first image.

space origin62
Space Origin

Slicer displays the content of

the header of the first image.

space origin63
Space Origin

Scroll down to display the value of the tag [0020,0032, Image Position Patient ]

space origin64
Space Origin

[0020,0032, Image Position Patient ]

= -125.0, -124.09, 79.30

space origin65
Space Origin

Click on OK to close the Dicom Header Window

space origin66

DICOM: LPS

SLICER: RAS

Space Origin

Add the field origin to the unu command

--origin "(+125.0,+124.10,79.30)"

measurement frame69
Measurement Frame

Add the field measurement frame to the unu command

--measurementframe “(0,-1,0) (1,0,0) (0,0,-1)"

axis ordering
Axis Ordering

Courtesy G.Kindlmann

axis ordering71

Axis Ordering: columns, rows, slices, intensity values

Axis Ordering

Add the field kinds to the unu command

--kind space space space list

output file
Output File

Add the field output to the unu command

--output myNrrdDWI.nhdr

output file73
Output File

Type ls in the Tk Console

The file myNrrdDWI.nhdr is listed in the directory

acquisition parameters
Acquisition parameters

Open the file MyNrrdDWI.nhdr with a text Editor

acquisition parameters75
Acquisition parameters

Open a web browser at the location

http://www.na-mic.org/Wiki/index.php/Dartmouth-DWI-parameters

acquisition parameters76
Acquisition parameters

Copy the acquisition parameters from this wiki page to the end of the file MyNrrdDWI.nhdr, hit Enter and save the resulting file

result
Result

Final result of the tutorial: Nrrd header for the DWI training dataset

overview78
Overview
  • Part 1: DWI data specificity
  • Part 2: Nrrd description
  • Part 3: Generating Nrrd Files
  • Part 4: Working with DICOM DWI training data
  • Part 5: Orientation validation within Slicer
loading the nrrd volume
Loading the Nrrd Volume

Click on Cancel to come back to the Main Menu

loading the nrrd volume80
Loading the Nrrd Volume

Click on Add Volume to load the DWI training dataset using the Nrrd header

loading the nrrd volume81
Loading the Nrrd Volume

The Props Panel of the module Volumes appears.

Select Nrrd Reader in the Properties field

loading the nrrd volume82
Loading the Nrrd Volume

Browse to load the file myNrrdDWI.nhdr

Check that the path to the file myNrrdDWI.nhdr is correct. If needed, manually enter it

Click on Apply

loading the nrrd volume83
Loading the Nrrd Volume

Slicer loads the Nrrd DWI dataset

Left-click on Or and change the orientation to Slices

loading the nrrd volume84
Loading the Nrrd Volume

Change the FOV to 2000

loading the nrrd volume85
Loading the Nrrd Volume

The sagittal and coronal viewers display the 14 DWI volumes: 2 baselines and 12 gradients

loading the nrrd volume86
Loading the Nrrd Volume

Display the axial and sagittal slices inside the viewer.

Use the axial slider to observe the baselines and gradient volumes.

converting the dwi data to tensors
Converting the DWI data to tensors

Select the module DTMRI and click on the tab Conv

Select the Input volume myNrrdDWI.nhdr and click on ConvertVolume

converting the dwi data to tensors88
Converting the DWI data to tensors

Slicer displays the anatomical views of the Average Gradient volume.

glyphs
Glyphs

Select the panel Glyphs in the DTMRI module

Select the Active DTMRI volume myNrrdDWI-nhdr_Tensor

Select Glyphs on Slice for the axial (red) view

Set Display Glyphs On

glyphs90
Glyphs

Orientation of the glyphs in the Corpus Callosum

conclusion
Conclusion
  • Standardized description of the information contained in DWI data.
  • Rapid, intuitive visual assessment of orientation results within Slicer
  • Open-Source: http://teem.sourceforge.net/nrrd/