Download presentation
Presentation is loading. Please wait.
Published byRyan Walton Modified over 11 years ago
1
Surgical Planning Laboratory http://www.slicer.org -1- Brigham and Womens Hospital Diffusion Tensor Imaging: from Dicom to Nrrd Sonia Pujol, Ph.D. Randy Gollub, M.D., Ph.D. National Alliance for Medical Image Computing
2
Surgical Planning Laboratory http://www.slicer.org -2- Brigham and Womens Hospital Acknowledgments National Alliance for Medical Image Computing NIH U54EB005149 Neuroimage Analysis Center NIH P41RR013218 Laboratory of Mathematics in Imaging, Brigham and Womens Hospital Thanks to Dr. Gordon Kindlmann Dartmouth Hitchcock Medical Center Thanks to Dr. Andy Saykin
3
Surgical Planning Laboratory http://www.slicer.org -3- Brigham and Womens Hospital Raw Data Goal of the Tutorial Training on how to convert DICOM DWI data to the Nrrd File format, compatible with Slicer visualization and analysis Raw Data Nrrd Header Dicom Header Raw Data
4
Surgical Planning Laboratory http://www.slicer.org -4- Brigham and Womens Hospital 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
5
Surgical Planning Laboratory http://www.slicer.org -5- Brigham and Womens Hospital Diffusion Weighted Imaging The signal is dimmer when the direction of the applied gradient is parallel to the principal direction of diffusion. Diffusion Sensitizing Gradients Diffusion Weighted Images
6
Surgical Planning Laboratory http://www.slicer.org -6- Brigham and Womens Hospital Diffusion Weighted Imaging (DWI) Example: Correlation between the orientation of the 11 th gradient and the signal intensity in the Splenium of the Corpus Callosum
7
Surgical Planning Laboratory http://www.slicer.org -7- Brigham and Womens Hospital Diffusion Weighted Imaging (Stejskal and Tanner 1965, Basser 1994 ) {Si} represent the signal intensities in presence of the diffusion sensitizing gradients gi b is the diffusion weighted parameter Diffusion Weighted Images
8
Surgical Planning Laboratory http://www.slicer.org -8- Brigham and Womens Hospital 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
9
Surgical Planning Laboratory http://www.slicer.org -9- Brigham and Womens Hospital Which image is correct ?
10
Surgical Planning Laboratory http://www.slicer.org -10- Brigham and Womens Hospital Which image is correct ?
11
Surgical Planning Laboratory http://www.slicer.org -11- Brigham and Womens Hospital The left one is correct
12
Surgical Planning Laboratory http://www.slicer.org -12- Brigham and Womens Hospital 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
13
Surgical Planning Laboratory http://www.slicer.org -13- Brigham and Womens Hospital 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. Raw Data Nrrd Header +
14
Surgical Planning Laboratory http://www.slicer.org -14- Brigham and Womens Hospital Nrrd file format NA-MIC has developed a robust way of using the Nrrd format to represent DWI volumes
15
Surgical Planning Laboratory http://www.slicer.org -15- Brigham and Womens Hospital Nrrd file format DWI data written into Nrrd format with appropriate parameters can be read into 3D Slicer
16
Surgical Planning Laboratory http://www.slicer.org -16- Brigham and Womens Hospital Coordinate Frames Diffusion Weighted Images Diffusion Sensitizing Gradients (X,Y,Z)(I,J,K) Courtesy G.Kindlmann
17
Surgical Planning Laboratory http://www.slicer.org -17- Brigham and Womens Hospital Coordinate Frames DWI Image Orientation (I,J,K) Diffusion Sensitizing Gradients (X,Y,Z) (I,J,K) Patient Space Courtesy G.Kindlmann
18
Surgical Planning Laboratory http://www.slicer.org -18- Brigham and Womens Hospital Transformation matrices T: IJK RAS (X,Y,Z) (I,J,K) T: XYZ RAS (R,A,S) Courtesy G.Kindlmann
19
Surgical Planning Laboratory http://www.slicer.org -19- Brigham and Womens Hospital Nrrd Terminology T: XYZ RAS (X,Y,Z)(I,J,K) (R,A,S) T: IJK RAS Courtesy G.Kindlmann
20
Surgical Planning Laboratory http://www.slicer.org -20- Brigham and Womens Hospital Nrrd requirements for DWI data To generate a Nrrd header for DWI data, youll need to know information about data representation: DWI Volume characteristics –Data Type –Endianess –Dimensions Disk Storage –Axis Ordering
21
Surgical Planning Laboratory http://www.slicer.org -21- Brigham and Womens Hospital Nrrd requirements for DWI data To generate a Nrrd header for DWI data, youll need to know the acquisition parameters: Coordinate Frames –DWI Image Orientation –Gradient Measurement Frame
22
Surgical Planning Laboratory http://www.slicer.org -22- Brigham and Womens Hospital 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
23
Surgical Planning Laboratory http://www.slicer.org -23- Brigham and Womens Hospital 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
24
Surgical Planning Laboratory http://www.slicer.org -24- Brigham and Womens Hospital Unu syntax General Syntax: unu cmd -i input -o output Tips: unu list of unu commands unu cmd help on cmd
25
Surgical Planning Laboratory http://www.slicer.org -25- Brigham and Womens Hospital Unu syntax: make command make syntax: unu make -i input -o output make documentation: unu make help on make
26
Surgical Planning Laboratory http://www.slicer.org -26- Brigham and Womens Hospital 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.
27
Surgical Planning Laboratory http://www.slicer.org -27- Brigham and Womens Hospital 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
28
Surgical Planning Laboratory http://www.slicer.org -28- Brigham and Womens Hospital 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
29
Surgical Planning Laboratory http://www.slicer.org -29- Brigham and Womens Hospital DICOM DWI Training Data 2 Baselines and 12 Gradients 504 DICOM images named S4.xxx where xxx is the image number
30
Surgical Planning Laboratory http://www.slicer.org -30- Brigham and Womens Hospital 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.
31
Surgical Planning Laboratory http://www.slicer.org -31- Brigham and Womens Hospital DWI Training Data The dataset is composed of 504 images named S4.xxx
32
Surgical Planning Laboratory http://www.slicer.org -32- Brigham and Womens Hospital unu make -h --input S4.%03d 1 504 1 2 --encoding raw --byteskip -1 Unu command (Windows) Type the unu command with the input, encoding and byteskip fields Min index Max index Increment 2D Image Read backwards from end of file Do not hit Enter
33
Surgical Planning Laboratory http://www.slicer.org -33- Brigham and Womens Hospital unu make -h --input S4.%03d 1 504 1 2 --encoding raw --byteskip -1 Unu command (Mac/Linux) Type the unu command with the input, encoding and byteskip fields Min index Max index Increment 2D Image Read backwards from end of file slicer2.6-opt-darwin-ppc- 2006-05-18/Lib/darwin- ppc/teem-build/bin
34
Surgical Planning Laboratory http://www.slicer.org -34- Brigham and Womens Hospital Numbers as file naming convention (*) % 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 unu make -h --input S4.%03d 1 504 1 2 --encoding raw --byteskip -1
35
Surgical Planning Laboratory http://www.slicer.org -35- Brigham and Womens Hospital Read the DICOM Header Click on AddVolume
36
Surgical Planning Laboratory http://www.slicer.org -36- Brigham and Womens Hospital Select the Properties Dicom The Props panel appears. Read the DICOM Header
37
Surgical Planning Laboratory http://www.slicer.org -37- Brigham and Womens Hospital Click on Select Dicom Volume and browse to load the dataset located in the directory dwi-dicom The Dicom Props panel appears. Read the DICOM Header
38
Surgical Planning Laboratory http://www.slicer.org -38- Brigham and Womens Hospital Slicer displays the list of Dicom files in the directory. Click on OK Read the Dicom Header
39
Surgical Planning Laboratory http://www.slicer.org -39- Brigham and Womens Hospital Click on Extract Header to display the content of the Dicom Header. Read the Dicom Header
40
Surgical Planning Laboratory http://www.slicer.org -40- Brigham and Womens Hospital Slicer displays the content of the Dicom Header. This information will be used to generate the Nrrd header. Read the Dicom Header
41
Surgical Planning Laboratory http://www.slicer.org -41- Brigham and Womens Hospital Extract the values corresponding to the following information: - Data Type - Endianess - Image Dimensions Extracting the volume characteristics
42
Surgical Planning Laboratory http://www.slicer.org -42- Brigham and Womens Hospital - Data Type: Short - Endianess: Little Extracting the volume characteristics
43
Surgical Planning Laboratory http://www.slicer.org -43- Brigham and Womens Hospital Unu Command Add the fields endian and type to the unu command --endian little --type short
44
Surgical Planning Laboratory http://www.slicer.org -44- Brigham and Womens Hospital The dataset was acquired with Nb=2 Baselines and Ng=12 Gradients Extracting the volume characteristics Image Dimensions: 256 pixels x 256 pixels
45
Surgical Planning Laboratory http://www.slicer.org -45- Brigham and Womens Hospital DICOM DWI Training Data 2 Baselines and 12 Gradients 504 DICOM images named S4.xxx where xxx is the image number
46
Surgical Planning Laboratory http://www.slicer.org -46- Brigham and Womens Hospital The dataset was acquired with Nb=2 Baselines and Ng=12 Gradients n=NbxNg = 12 + 2 = 14 intensity values/voxel N Slices = N dicomImages /n = 504/14 = 36 slices Extracting the volume characteristics Image Dimensions: 256 pixels x 256 pixels
47
Surgical Planning Laboratory http://www.slicer.org -47- Brigham and Womens Hospital Unu Command --size 256 256 36 14 --centering cell cell cell none Medical images are cell-centered samples Add the fields size and centering to the unu command
48
Surgical Planning Laboratory http://www.slicer.org -48- Brigham and Womens Hospital Slice Thickness Extract the slice thickness from the Dicom header
49
Surgical Planning Laboratory http://www.slicer.org -49- Brigham and Womens Hospital Slice Thickness slice thickness = 3.00 mm
50
Surgical Planning Laboratory http://www.slicer.org -50- Brigham and Womens Hospital Slice Thickness --thickness nan nan 3.0 nan Add the field thickness to the unu command
51
Surgical Planning Laboratory http://www.slicer.org -51- Brigham and Womens Hospital 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: LPSSLICER: RAS
52
Surgical Planning Laboratory http://www.slicer.org -52- Brigham and Womens Hospital Space Directions Add the field space to the unu command --space right-anterior-superior
53
Surgical Planning Laboratory http://www.slicer.org -53- Brigham and Womens Hospital Space Directions Extract the pixel size from the Dicom Header.
54
Surgical Planning Laboratory http://www.slicer.org -54- Brigham and Womens Hospital Space Directions Pixel size = 0.9375 mm x 0.9375 mm The dataset was acquired with Superior-Inferior slice ordering
55
Surgical Planning Laboratory http://www.slicer.org -55- Brigham and Womens Hospital Space Directions --directions (-0.9375,0,0) (0,-0.9375,0) (0,0,-3) none Add the fields directions and unit to the unu command DICOM: LPSSLICER: RAS
56
Surgical Planning Laboratory http://www.slicer.org -56- Brigham and Womens Hospital Space Origin Courtesy G.Kindlmann 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.
57
Surgical Planning Laboratory http://www.slicer.org -57- Brigham and Womens Hospital Space Origin The space origin information is located in the Dicom header [ 0020,0032, Image Position Patient ] Courtesy G.Kindlmann
58
Surgical Planning Laboratory http://www.slicer.org -58- Brigham and Womens Hospital Space Origin Click on Cancel to come back to the Main menu Create a directory called FirstSlice and copy the first file S4.001 of the Dicom-dwi dataset
59
Surgical Planning Laboratory http://www.slicer.org -59- Brigham and Womens Hospital Space Origin Click Add Volume select the tab Props, and the format DICOM
60
Surgical Planning Laboratory http://www.slicer.org -60- Brigham and Womens Hospital Space Origin Click on Select DICOM Volume Select the directory / FirstSlice containing the first slice
61
Surgical Planning Laboratory http://www.slicer.org -61- Brigham and Womens Hospital Space Origin Click on List Headers to display the content of the header of the first image.
62
Surgical Planning Laboratory http://www.slicer.org -62- Brigham and Womens Hospital Space Origin Slicer displays the content of the header of the first image.
63
Surgical Planning Laboratory http://www.slicer.org -63- Brigham and Womens Hospital Space Origin Scroll down to display the value of the tag [0020,0032, Image Position Patient ]
64
Surgical Planning Laboratory http://www.slicer.org -64- Brigham and Womens Hospital Space Origin [0020,0032, Image Position Patient ] = -125.0, -124.09, 79.30
65
Surgical Planning Laboratory http://www.slicer.org -65- Brigham and Womens Hospital Space Origin Click on OK to close the Dicom Header Window
66
Surgical Planning Laboratory http://www.slicer.org -66- Brigham and Womens Hospital Space Origin --origin "(+125.0,+124.10,79.30)" Add the field origin to the unu command DICOM: LPSSLICER: RAS
67
Surgical Planning Laboratory http://www.slicer.org -67- Brigham and Womens Hospital Measurement Frame
68
Surgical Planning Laboratory http://www.slicer.org -68- Brigham and Womens Hospital Measurement Frame
69
Surgical Planning Laboratory http://www.slicer.org -69- Brigham and Womens Hospital Measurement Frame --measurementframe (0,-1,0) (1,0,0) (0,0,-1)" Add the field measurement frame to the unu command
70
Surgical Planning Laboratory http://www.slicer.org -70- Brigham and Womens Hospital Axis Ordering Courtesy G.Kindlmann
71
Surgical Planning Laboratory http://www.slicer.org -71- Brigham and Womens Hospital Axis Ordering --kind space space space list Add the field kinds to the unu command Axis Ordering: columns, rows, slices, intensity values
72
Surgical Planning Laboratory http://www.slicer.org -72- Brigham and Womens Hospital Output File Add the field output to the unu command --output myNrrdDWI.nhdr
73
Surgical Planning Laboratory http://www.slicer.org -73- Brigham and Womens Hospital Output File Type ls in the Tk Console The file myNrrdDWI.nhdr is listed in the directory
74
Surgical Planning Laboratory http://www.slicer.org -74- Brigham and Womens Hospital Acquisition parameters Open the file MyNrrdDWI.nhdr with a text Editor
75
Surgical Planning Laboratory http://www.slicer.org -75- Brigham and Womens Hospital Acquisition parameters Open a web browser at the location http://www.na-mic.org/Wiki/index.php/Dartmouth-DWI-parameters
76
Surgical Planning Laboratory http://www.slicer.org -76- Brigham and Womens Hospital 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
77
Surgical Planning Laboratory http://www.slicer.org -77- Brigham and Womens Hospital Result Final result of the tutorial: Nrrd header for the DWI training dataset
78
Surgical Planning Laboratory http://www.slicer.org -78- Brigham and Womens Hospital 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
79
Surgical Planning Laboratory http://www.slicer.org -79- Brigham and Womens Hospital Loading the Nrrd Volume Click on Cancel to come back to the Main Menu
80
Surgical Planning Laboratory http://www.slicer.org -80- Brigham and Womens Hospital Loading the Nrrd Volume Click on Add Volume to load the DWI training dataset using the Nrrd header
81
Surgical Planning Laboratory http://www.slicer.org -81- Brigham and Womens Hospital Loading the Nrrd Volume Select Nrrd Reader in the Properties field The Props Panel of the module Volumes appears.
82
Surgical Planning Laboratory http://www.slicer.org -82- Brigham and Womens Hospital Loading the Nrrd Volume Click on Apply Check that the path to the file myNrrdDWI.nhdr is correct. If needed, manually enter it Browse to load the file myNrrdDWI.nhdr
83
Surgical Planning Laboratory http://www.slicer.org -83- Brigham and Womens Hospital Loading the Nrrd Volume Slicer loads the Nrrd DWI dataset Left-click on Or and change the orientation to Slices
84
Surgical Planning Laboratory http://www.slicer.org -84- Brigham and Womens Hospital Loading the Nrrd Volume Change the FOV to 2000
85
Surgical Planning Laboratory http://www.slicer.org -85- Brigham and Womens Hospital Loading the Nrrd Volume The sagittal and coronal viewers display the 14 DWI volumes: 2 baselines and 12 gradients
86
Surgical Planning Laboratory http://www.slicer.org -86- Brigham and Womens Hospital Loading the Nrrd Volume Display the axial and sagittal slices inside the viewer. Use the axial slider to observe the baselines and gradient volumes.
87
Surgical Planning Laboratory http://www.slicer.org -87- Brigham and Womens Hospital 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
88
Surgical Planning Laboratory http://www.slicer.org -88- Brigham and Womens Hospital Converting the DWI data to tensors Slicer displays the anatomical views of the Average Gradient volume.
89
Surgical Planning Laboratory http://www.slicer.org -89- Brigham and Womens Hospital 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
90
Surgical Planning Laboratory http://www.slicer.org -90- Brigham and Womens Hospital Glyphs Orientation of the glyphs in the Corpus Callosum
91
Surgical Planning Laboratory http://www.slicer.org -91- Brigham and Womens Hospital 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/
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.