Presentation is loading. Please wait.

Presentation is loading. Please wait.

Surgical Planning Laboratory -1- Brigham and Womens Hospital Diffusion Tensor Imaging: from Dicom to Nrrd Sonia Pujol, Ph.D. Randy.

Similar presentations


Presentation on theme: "Surgical Planning Laboratory -1- Brigham and Womens Hospital Diffusion Tensor Imaging: from Dicom to Nrrd Sonia Pujol, Ph.D. Randy."— Presentation transcript:

1 Surgical Planning Laboratory -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 -2- Brigham and Womens Hospital Acknowledgments National Alliance for Medical Image Computing NIH U54EB Neuroimage Analysis Center NIH P41RR 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 -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 -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 -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 -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 -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 -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 -9- Brigham and Womens Hospital Which image is correct ?

10 Surgical Planning Laboratory Brigham and Womens Hospital Which image is correct ?

11 Surgical Planning Laboratory Brigham and Womens Hospital The left one is correct

12 Surgical Planning Laboratory 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 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 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 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 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 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 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 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 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 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 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 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 Slicer includes a Nrrd reader to load DWI volumes in Nrrd format

24 Surgical Planning Laboratory 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 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 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 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 /Lib/darwin-ppc/teem-build/bin

28 Surgical Planning Laboratory 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 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 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 Brigham and Womens Hospital DWI Training Data The dataset is composed of 504 images named S4.xxx

32 Surgical Planning Laboratory Brigham and Womens Hospital unu make -h --input S4.%03d 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 Brigham and Womens Hospital unu make -h --input S4.%03d 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 /Lib/darwin- ppc/teem-build/bin

34 Surgical Planning Laboratory 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 encoding raw --byteskip -1

35 Surgical Planning Laboratory Brigham and Womens Hospital Read the DICOM Header Click on AddVolume

36 Surgical Planning Laboratory Brigham and Womens Hospital Select the Properties Dicom The Props panel appears. Read the DICOM Header

37 Surgical Planning Laboratory 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 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 Brigham and Womens Hospital Click on Extract Header to display the content of the Dicom Header. Read the Dicom Header

40 Surgical Planning Laboratory 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 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 Brigham and Womens Hospital - Data Type: Short - Endianess: Little Extracting the volume characteristics

43 Surgical Planning Laboratory Brigham and Womens Hospital Unu Command Add the fields endian and type to the unu command --endian little --type short

44 Surgical Planning Laboratory 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 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 Brigham and Womens Hospital The dataset was acquired with Nb=2 Baselines and Ng=12 Gradients n=NbxNg = = 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 Brigham and Womens Hospital Unu Command --size 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 Brigham and Womens Hospital Slice Thickness Extract the slice thickness from the Dicom header

49 Surgical Planning Laboratory Brigham and Womens Hospital Slice Thickness slice thickness = 3.00 mm

50 Surgical Planning Laboratory Brigham and Womens Hospital Slice Thickness --thickness nan nan 3.0 nan Add the field thickness to the unu command

51 Surgical Planning Laboratory 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 Brigham and Womens Hospital Space Directions Add the field space to the unu command --space right-anterior-superior

53 Surgical Planning Laboratory Brigham and Womens Hospital Space Directions Extract the pixel size from the Dicom Header.

54 Surgical Planning Laboratory Brigham and Womens Hospital Space Directions Pixel size = mm x mm The dataset was acquired with Superior-Inferior slice ordering

55 Surgical Planning Laboratory Brigham and Womens Hospital Space Directions --directions ( ,0,0) (0, ,0) (0,0,-3) none Add the fields directions and unit to the unu command DICOM: LPSSLICER: RAS

56 Surgical Planning Laboratory 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 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 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 Brigham and Womens Hospital Space Origin Click Add Volume select the tab Props, and the format DICOM

60 Surgical Planning Laboratory Brigham and Womens Hospital Space Origin Click on Select DICOM Volume Select the directory / FirstSlice containing the first slice

61 Surgical Planning Laboratory 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 Brigham and Womens Hospital Space Origin Slicer displays the content of the header of the first image.

63 Surgical Planning Laboratory Brigham and Womens Hospital Space Origin Scroll down to display the value of the tag [0020,0032, Image Position Patient ]

64 Surgical Planning Laboratory Brigham and Womens Hospital Space Origin [0020,0032, Image Position Patient ] = , , 79.30

65 Surgical Planning Laboratory Brigham and Womens Hospital Space Origin Click on OK to close the Dicom Header Window

66 Surgical Planning Laboratory Brigham and Womens Hospital Space Origin --origin "(+125.0, ,79.30)" Add the field origin to the unu command DICOM: LPSSLICER: RAS

67 Surgical Planning Laboratory Brigham and Womens Hospital Measurement Frame

68 Surgical Planning Laboratory Brigham and Womens Hospital Measurement Frame

69 Surgical Planning Laboratory 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 Brigham and Womens Hospital Axis Ordering Courtesy G.Kindlmann

71 Surgical Planning Laboratory 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 Brigham and Womens Hospital Output File Add the field output to the unu command --output myNrrdDWI.nhdr

73 Surgical Planning Laboratory 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 Brigham and Womens Hospital Acquisition parameters Open the file MyNrrdDWI.nhdr with a text Editor

75 Surgical Planning Laboratory Brigham and Womens Hospital Acquisition parameters Open a web browser at the location

76 Surgical Planning Laboratory 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 Brigham and Womens Hospital Result Final result of the tutorial: Nrrd header for the DWI training dataset

78 Surgical Planning Laboratory 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 Brigham and Womens Hospital Loading the Nrrd Volume Click on Cancel to come back to the Main Menu

80 Surgical Planning Laboratory 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 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 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 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 Brigham and Womens Hospital Loading the Nrrd Volume Change the FOV to 2000

85 Surgical Planning Laboratory 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 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 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 Brigham and Womens Hospital Converting the DWI data to tensors Slicer displays the anatomical views of the Average Gradient volume.

89 Surgical Planning Laboratory 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 Brigham and Womens Hospital Glyphs Orientation of the glyphs in the Corpus Callosum

91 Surgical Planning Laboratory 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:


Download ppt "Surgical Planning Laboratory -1- Brigham and Womens Hospital Diffusion Tensor Imaging: from Dicom to Nrrd Sonia Pujol, Ph.D. Randy."

Similar presentations


Ads by Google