SlideShare ist ein Scribd-Unternehmen logo
1 von 19
Downloaden Sie, um offline zu lesen
DICOM and
NIfTI Data
Standards in
R
Summary
DICOM
NIfTI
Visualization
Conversion
End
Bibliography
DICOM and NIfTI Data Standards
in R
Brandon Whitcher PhD CStat
Mango Solutions
London, United Kingdom
www.mango-solutions.com
bwhitcher@mango-solutions.com
@MangoImaging
12 June 2012 – useR!2012 Tutorial
DICOM and
NIfTI Data
Standards in
R
Summary
DICOM
NIfTI
Visualization
Conversion
End
Bibliography
Outline
1 Summary
2 Digital Imaging and Communications in Medicine
3 Neuroimaging Informatics Technology Initiative
4 Data Visualization
5 DICOM-to-NIfTI Conversion
6 Conclusions
DICOM and
NIfTI Data
Standards in
R
Summary
DICOM
NIfTI
Visualization
Conversion
End
Bibliography
Goal
• Content presented here provides users with the skills to
manipulate DICOM / ANALYZE / NIfTI files in R.
• Real-world data sets are used to illustrate the basic
functionality of oro.dicom and oro.nifti.
• S4 classes “nifti” and “anlz” enable further statistical
analysis in R without losing contextual information from
the original ANALYZE or NIfTI files.
• Images in the metadata-rich DICOM format may be
converted to NIfTI semi-automatically using as much
information from the DICOM files as possible.
• Basic visualization functions, are provided for “nifti” and
“anlz” objects.
• The oro.nifti package allows one to track every
operation on a nifti object in an XML-based audit trail.
DICOM and
NIfTI Data
Standards in
R
Summary
DICOM
NIfTI
Visualization
Conversion
End
Bibliography
Alternatives to oro.dicom and oro.nifti
• There are several R packages that are able to access
the DICOM / ANALYZE / NIfTI data formats:
• AnalyzeFMRI (Bordier et al. 2009)
• fmri (Polzehl and Tabelow 2007)
• Rniftilib (Granert 2010)
• tractor.base (Clayden 2010)
Question #1
What are the (dis)advantages to having a single R package
that performs input / output for medical imaging data?
Question #2
Should R packages be discouraged from writing output in
formats other than ANALYZE or NIfTI?
DICOM and
NIfTI Data
Standards in
R
Summary
DICOM
NIfTI
Visualization
Conversion
End
Bibliography
The DICOM “Standard”
• The DICOM “standard” for data acquired using a
clinical imaging device is very broad and complex.
• Each DICOM-compliant file is a collection of fields
organized into two two-byte sequences (group,element)
that are represented as hexadecimal numbers and form
a tag.
• The (group,element) combination establishes what type
of information is forthcoming in the file.
• There is no fixed number of bytes for a DICOM header.
• The final (group,element) tag should be the PixelData
tag (7FE0,0010), such that all subsequent information
is related to the image.
DICOM
Digital Imaging and Communications in Medicine
http://medical.nema.org
DICOM and
NIfTI Data
Standards in
R
Summary
DICOM
NIfTI
Visualization
Conversion
End
Bibliography
The Structure of a DICOM File
Data element with explicit VR of OB, OF, OW, SQ, UT or UN:
+-----------------------------------------------------------+
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
+----+----+----+----+----+----+----+----+----+----+----+----+
|<Group-->|<Element>|<VR----->|<0x0000->|<Length----------->|<Value->
Data element with explicit VR other than as shown above:
+---------------------------------------+
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
+----+----+----+----+----+----+----+----+
|<Group-->|<Element>|<VR----->|<Length->|<Value->
Data element with implicit VR:
+---------------------------------------+
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
+----+----+----+----+----+----+----+----+
|<Group-->|<Element>|<Length----------->|<Value->
• Byte ordering for a single (group,element) tag in the
DICOM standard.
• Explicit VRs store the VR as text characters in two
bytes.
DICOM and
NIfTI Data
Standards in
R
Summary
DICOM
NIfTI
Visualization
Conversion
End
Bibliography
Reading DICOM Files
readDICOMFile()
Accessing information stored in a single DICOM file
• The resulting object is a list with two elements: the
DICOM header (hdr) and the DICOM image (img).
• Header information is organized in a data frame with six
columns and an unknown number of rows.
• First five columns taken from DICOM header
information (group, element, code, length and value) or
inferred (name).
• (group,element) values are stored as character strings
– not hexadecimal numbers.
readDICOM()
Accessing multiple DICOM files in a single directory or
directory tree
DICOM and
NIfTI Data
Standards in
R
Summary
DICOM
NIfTI
Visualization
Conversion
End
Bibliography
Stacking DICOM Images
create3D() and create4D()
Create arrays from DICOM headers / images
• Minimum input = “dcm” structure
• PixelData may be read on-the-fly
• Siemens MOSAIC format allowed
• 4D volumes may require additional information
• nslices = ?
• ntimes = ?
DICOM and
NIfTI Data
Standards in
R
Summary
DICOM
NIfTI
Visualization
Conversion
End
Bibliography
The ANALYZE Format
• The ANALYZE format was originally developed in
conjunction with an image processing system (of the
same name) at the Mayo Foundation.
• A common version of the format, although not the most
recent, is called ANALYZE 7.5.
• An ANALYZE 7.5 format image is comprised of two
files, the “.hdr” and “.img” files, that contain information
about the acquisition and the acquisition itself,
respectively.
The ANALYZE Format
.hdr = 348-byte binary file of header information
.img = binary flat file of images (multi-dimensional array)
DICOM and
NIfTI Data
Standards in
R
Summary
DICOM
NIfTI
Visualization
Conversion
End
Bibliography
The NIfTI-1 Format
• The NIfTI-1 data format is almost identical to the
ANALYZE format, but offers a few improvements:
• Merging of the header and image information into one
file “.nii”
• Re-organization of the 348-byte fixed header into more
relevant categories
• Possibility of extending the header information
• Discussions have begun on the NIfTI-2 data format.
NIfTI
Neuroimaging Informatics Technology Initiative
http://nifti.nimh.nih.gov
DICOM and
NIfTI Data
Standards in
R
Summary
DICOM
NIfTI
Visualization
Conversion
End
Bibliography
S4 Classes for ANALYZE and NIfTI-1
• “nifti”
• Inherits from class “array”
• Slots contain NIfTI header information
• Basic methods: show(), nifti(), is.nifti(), as(<obj>, “nifti”)
• Input / output: readNIfTI(), writeNIfTI()
• Slot access: pixdim(), qform(), sform(), descrip(),
aux.file(), audit.trail()
• Additional classes: “niftiExtension” and
“niftiExtensionSection”
• “anlz”
• Inherits from class “array”
• Slots contain ANALYZE header information
DICOM and
NIfTI Data
Standards in
R
Summary
DICOM
NIfTI
Visualization
Conversion
End
Bibliography
Visualization
• oro.nifti offers three functions for visualization
• image() = overloaded function for “anlz”, “array” and
“nifti” classes
• overlay() = extension of image() with x and y input
parameters
• orthographic() = mid-axial, mid-sagittal, mid-coronal
views
Interactive Visualization
FSLView
http://www.fmrib.ox.ac.uk/fsl/fslview/
MRIcron
http://www.cabiatl.com/mricro/mricron/
VolView
http://www.kitware.com/products/volview.html
DICOM and
NIfTI Data
Standards in
R
Summary
DICOM
NIfTI
Visualization
Conversion
End
Bibliography
DICOM-to-NIfTI Conversion
• oro.dicom and oro.nifti were designed to use as much
information as possible from the metadata-rich DICOM
format and apply that information in the construction of
the NIfTI data volume.
• Read in a single series using dicomSeperate()
• dicom2nifti() converts the list of DICOM images into a
multidimensional “nifti” object
• dicom2analyze() converts the list of DICOM images into
a multidimensional “anlz” object
• Additional scripting in R is required to deal with multiple
series
DICOM and
NIfTI Data
Standards in
R
Summary
DICOM
NIfTI
Visualization
Conversion
End
Bibliography
Goal
• Content presented here provides users with the skills to
manipulate DICOM / ANALYZE / NIfTI files in R.
• Real-world data sets are used to illustrate the basic
functionality of oro.dicom and oro.nifti.
• S4 classes “nifti” and “anlz” enable further statistical
analysis in R without losing contextual information from
the original ANALYZE or NIfTI files.
• Images in the metadata-rich DICOM format may be
converted to NIfTI semi-automatically using as much
information from the DICOM files as possible.
• Basic visualization functions, are provided for “nifti” and
“anlz” objects.
• The oro.nifti package allows one to track every
operation on a nifti object in an XML-based audit trail.
DICOM and
NIfTI Data
Standards in
R
Summary
DICOM
NIfTI
Visualization
Conversion
End
Bibliography
Help
• http://rigorousanalytics.blogspot.com
• https://r-forge.r-project.org/projects/
rigorous
• rigorous-dicom@lists.r-forge.r-project.org
• rigorous-nifti@lists.r-forge.r-project.org
•
rigorous-dcemris4@lists.r-forge.r-project.org
Volume 44 in the Journal of Statistical Software
Special volume on “Magnetic Resonance Imaging in R”
• 13 articles on fMRI, DTI, DCE-MRI, etc.
• www.jstatsoft.org/v44
DICOM and
NIfTI Data
Standards in
R
Summary
DICOM
NIfTI
Visualization
Conversion
End
Bibliography
Bibliography I
C. Bordier, M. Dojat, and P. Lafaye de Micheaux.
AnalyzeFMRI: an R package to perform statistical
analysis on fmri datasets. 2009. URL http:
//www.biostatisticien.eu/AnalyzeFMRI/.
Software: R Package, AnalyzeFMRI, version 1.1-12.
J. Clayden. tractor.base: A Package for Reading,
Manipulating and Visualising Magnetic Resonance
Images, 2010. URL http:
//CRAN.R-project.org/package=tractor.base.
R package version 1.5.0.
O. Granert. Rniftilib: R Interface to NIFTICLIB (V1.1.0),
2010. URL http:
//CRAN.R-project.org/package=Rniftilib. R
package version 0.0-29.
DICOM and
NIfTI Data
Standards in
R
Summary
DICOM
NIfTI
Visualization
Conversion
End
Bibliography
Bibliography II
J. Polzehl and K. Tabelow. fmri: A package for analyzing
fmri data. RNews, 7(2):13–17, 2007. URL
http://www.r-project.org/doc/Rnews/Rnews_
2007-2.pdf.
DICOM and
NIfTI Data
Standards in
R
Appendix
R Package: oro.dicom
• Title: Rigorous - DICOM Input / Output
• Description: Data input/output functions for data that
conform to the Digital Imaging and Communications in
Medicine (DICOM) standard, part of the Rigorous
Analytics bundle.
• Depends: R (>= 2.13.0), utils
• Suggests: hwriter, oro.nifti (>= 0.2.9)
• License: BSD
• URL: http://rigorousanalytics.blogspot.com
DICOM and
NIfTI Data
Standards in
R
Appendix
R Package: oro.nifti
• Title: Rigorous - NIfTI+ANALYZE+AFNI Input / Output
• Description: Functions for the input/output and
visualization of medical imaging data that follow either
the ANALYZE, NIfTI or AFNI formats. This package is
part of the Rigorous Analytics bundle.
• Depends: R (>= 2.13.0), bitops, graphics, grDevices,
methods, utils
• Suggests: XML
• Imports: splines
• Enhances: fmri
• License: BSD
• URL: http://rigorousanalytics.blogspot.com

Weitere ähnliche Inhalte

Andere mochten auch

A review on Rich dad's "The Business School"
A review on Rich dad's "The Business School"A review on Rich dad's "The Business School"
A review on Rich dad's "The Business School"Deepika Bommu
 
EDUCANDO CON CARIÑO LA SEGURIDAD VIAL
EDUCANDO CON CARIÑO LA SEGURIDAD VIALEDUCANDO CON CARIÑO LA SEGURIDAD VIAL
EDUCANDO CON CARIÑO LA SEGURIDAD VIALAlexis Rodriguez
 
Παρουσίαση της Ελληνικής Επαγγελματικής και Επιστημονικής Ένωση των Βιβλιοθηκ...
Παρουσίαση της Ελληνικής Επαγγελματικής και Επιστημονικής Ένωση των Βιβλιοθηκ...Παρουσίαση της Ελληνικής Επαγγελματικής και Επιστημονικής Ένωση των Βιβλιοθηκ...
Παρουσίαση της Ελληνικής Επαγγελματικής και Επιστημονικής Ένωση των Βιβλιοθηκ...Department of Library Science AΤEI Thessaloniki
 
Up to date 4A0-103 Exam Questions and Info
Up to date 4A0-103 Exam Questions and InfoUp to date 4A0-103 Exam Questions and Info
Up to date 4A0-103 Exam Questions and Infodevonpaul
 
Открытое внеклассное мероприятие "Золотая Осень"
Открытое внеклассное мероприятие "Золотая Осень"Открытое внеклассное мероприятие "Золотая Осень"
Открытое внеклассное мероприятие "Золотая Осень"mizieva
 
Font questionnaire analysis
Font questionnaire analysisFont questionnaire analysis
Font questionnaire analysisScoley1996
 
Основи програмування
Основи програмуванняОснови програмування
Основи програмуванняHelenSm007
 
MS POWER POINT 2007 BAB 1
MS POWER POINT 2007 BAB 1MS POWER POINT 2007 BAB 1
MS POWER POINT 2007 BAB 1nicko9h
 

Andere mochten auch (16)

A review on Rich dad's "The Business School"
A review on Rich dad's "The Business School"A review on Rich dad's "The Business School"
A review on Rich dad's "The Business School"
 
Neminath electricals
Neminath electricalsNeminath electricals
Neminath electricals
 
EDUCANDO CON CARIÑO LA SEGURIDAD VIAL
EDUCANDO CON CARIÑO LA SEGURIDAD VIALEDUCANDO CON CARIÑO LA SEGURIDAD VIAL
EDUCANDO CON CARIÑO LA SEGURIDAD VIAL
 
Media studies
Media studiesMedia studies
Media studies
 
Props
PropsProps
Props
 
Παρουσίαση της Ελληνικής Επαγγελματικής και Επιστημονικής Ένωση των Βιβλιοθηκ...
Παρουσίαση της Ελληνικής Επαγγελματικής και Επιστημονικής Ένωση των Βιβλιοθηκ...Παρουσίαση της Ελληνικής Επαγγελματικής και Επιστημονικής Ένωση των Βιβλιοθηκ...
Παρουσίαση της Ελληνικής Επαγγελματικής και Επιστημονικής Ένωση των Βιβλιοθηκ...
 
Karma infrastructure
Karma infrastructureKarma infrastructure
Karma infrastructure
 
Up to date 4A0-103 Exam Questions and Info
Up to date 4A0-103 Exam Questions and InfoUp to date 4A0-103 Exam Questions and Info
Up to date 4A0-103 Exam Questions and Info
 
Открытое внеклассное мероприятие "Золотая Осень"
Открытое внеклассное мероприятие "Золотая Осень"Открытое внеклассное мероприятие "Золотая Осень"
Открытое внеклассное мероприятие "Золотая Осень"
 
Font questionnaire analysis
Font questionnaire analysisFont questionnaire analysis
Font questionnaire analysis
 
Asif javaid chattha
Asif javaid chatthaAsif javaid chattha
Asif javaid chattha
 
ppti
pptippti
ppti
 
Story board
Story boardStory board
Story board
 
Shannon media
Shannon mediaShannon media
Shannon media
 
Основи програмування
Основи програмуванняОснови програмування
Основи програмування
 
MS POWER POINT 2007 BAB 1
MS POWER POINT 2007 BAB 1MS POWER POINT 2007 BAB 1
MS POWER POINT 2007 BAB 1
 

Ähnlich wie Using DICOM and NIfTI in R

Building a Knowledge Graph using NLP and Ontologies
Building a Knowledge Graph using NLP and OntologiesBuilding a Knowledge Graph using NLP and Ontologies
Building a Knowledge Graph using NLP and OntologiesNeo4j
 
Data ingestion using NiFi - Quick Overview
Data ingestion using NiFi - Quick OverviewData ingestion using NiFi - Quick Overview
Data ingestion using NiFi - Quick OverviewDurga Gadiraju
 
Canllawiau CBHC ar gyfer Archifau Archaeolegol Digidol – Ymagwedd Gynaliadwy ...
Canllawiau CBHC ar gyfer Archifau Archaeolegol Digidol – Ymagwedd Gynaliadwy ...Canllawiau CBHC ar gyfer Archifau Archaeolegol Digidol – Ymagwedd Gynaliadwy ...
Canllawiau CBHC ar gyfer Archifau Archaeolegol Digidol – Ymagwedd Gynaliadwy ...RCAHMW
 
London useR Meeting 21-Jul-09
London useR Meeting 21-Jul-09London useR Meeting 21-Jul-09
London useR Meeting 21-Jul-09bwhitcher
 
Using Crowdsourced Images to Create Image Recognition Models with Analytics Z...
Using Crowdsourced Images to Create Image Recognition Models with Analytics Z...Using Crowdsourced Images to Create Image Recognition Models with Analytics Z...
Using Crowdsourced Images to Create Image Recognition Models with Analytics Z...Maurice Nsabimana
 
GraphTour 2020 - Neo4j: What's New?
GraphTour 2020 - Neo4j: What's New?GraphTour 2020 - Neo4j: What's New?
GraphTour 2020 - Neo4j: What's New?Neo4j
 
The Role of OAIS Representation Information in the Digital Curation of Crysta...
The Role of OAIS Representation Information in the Digital Curation of Crysta...The Role of OAIS Representation Information in the Digital Curation of Crysta...
The Role of OAIS Representation Information in the Digital Curation of Crysta...ManjulaPatel
 
Using Crowdsourced Images to Create Image Recognition Models with Analytics Z...
Using Crowdsourced Images to Create Image Recognition Models with Analytics Z...Using Crowdsourced Images to Create Image Recognition Models with Analytics Z...
Using Crowdsourced Images to Create Image Recognition Models with Analytics Z...Databricks
 
Towards Flexible Indices for Distributed Graph Data: The Formal Schema-level...
Towards Flexible Indices for  Distributed Graph Data: The Formal Schema-level...Towards Flexible Indices for  Distributed Graph Data: The Formal Schema-level...
Towards Flexible Indices for Distributed Graph Data: The Formal Schema-level...Till Blume
 
An Emerging Standard for Research-Quality Images: What IIIF Means for Digital...
An Emerging Standard for Research-Quality Images: What IIIF Means for Digital...An Emerging Standard for Research-Quality Images: What IIIF Means for Digital...
An Emerging Standard for Research-Quality Images: What IIIF Means for Digital...tseneca
 
DRI Introductory Training: Preparing Your Collections for the DRI
DRI Introductory Training: Preparing Your Collections for the DRIDRI Introductory Training: Preparing Your Collections for the DRI
DRI Introductory Training: Preparing Your Collections for the DRIdri_ireland
 
Kevin Long - Preparing your collection for DRI
Kevin Long - Preparing your collection for DRIKevin Long - Preparing your collection for DRI
Kevin Long - Preparing your collection for DRIdri_ireland
 
CNI 2018: A Research Object Authoring Tool for the Data Commons
CNI 2018: A Research Object Authoring Tool for the Data CommonsCNI 2018: A Research Object Authoring Tool for the Data Commons
CNI 2018: A Research Object Authoring Tool for the Data CommonsAnita de Waard
 
e-Services to Keep Your Digital Files Current
e-Services to Keep Your Digital Files Currente-Services to Keep Your Digital Files Current
e-Services to Keep Your Digital Files Currentpbajcsy
 
How to store, organize and use petabytes of heterogenous data
How to store, organize and use petabytes of heterogenous dataHow to store, organize and use petabytes of heterogenous data
How to store, organize and use petabytes of heterogenous dataOVHcloud
 
ISO 15926 Reference Data Engineering Methodology
ISO 15926 Reference Data Engineering MethodologyISO 15926 Reference Data Engineering Methodology
ISO 15926 Reference Data Engineering MethodologyAnatoly Levenchuk
 

Ähnlich wie Using DICOM and NIfTI in R (20)

Building a Knowledge Graph using NLP and Ontologies
Building a Knowledge Graph using NLP and OntologiesBuilding a Knowledge Graph using NLP and Ontologies
Building a Knowledge Graph using NLP and Ontologies
 
Data ingestion using NiFi - Quick Overview
Data ingestion using NiFi - Quick OverviewData ingestion using NiFi - Quick Overview
Data ingestion using NiFi - Quick Overview
 
Canllawiau CBHC ar gyfer Archifau Archaeolegol Digidol – Ymagwedd Gynaliadwy ...
Canllawiau CBHC ar gyfer Archifau Archaeolegol Digidol – Ymagwedd Gynaliadwy ...Canllawiau CBHC ar gyfer Archifau Archaeolegol Digidol – Ymagwedd Gynaliadwy ...
Canllawiau CBHC ar gyfer Archifau Archaeolegol Digidol – Ymagwedd Gynaliadwy ...
 
London useR Meeting 21-Jul-09
London useR Meeting 21-Jul-09London useR Meeting 21-Jul-09
London useR Meeting 21-Jul-09
 
Using Crowdsourced Images to Create Image Recognition Models with Analytics Z...
Using Crowdsourced Images to Create Image Recognition Models with Analytics Z...Using Crowdsourced Images to Create Image Recognition Models with Analytics Z...
Using Crowdsourced Images to Create Image Recognition Models with Analytics Z...
 
GraphTour 2020 - Neo4j: What's New?
GraphTour 2020 - Neo4j: What's New?GraphTour 2020 - Neo4j: What's New?
GraphTour 2020 - Neo4j: What's New?
 
The Role of OAIS Representation Information in the Digital Curation of Crysta...
The Role of OAIS Representation Information in the Digital Curation of Crysta...The Role of OAIS Representation Information in the Digital Curation of Crysta...
The Role of OAIS Representation Information in the Digital Curation of Crysta...
 
Using Crowdsourced Images to Create Image Recognition Models with Analytics Z...
Using Crowdsourced Images to Create Image Recognition Models with Analytics Z...Using Crowdsourced Images to Create Image Recognition Models with Analytics Z...
Using Crowdsourced Images to Create Image Recognition Models with Analytics Z...
 
Towards Flexible Indices for Distributed Graph Data: The Formal Schema-level...
Towards Flexible Indices for  Distributed Graph Data: The Formal Schema-level...Towards Flexible Indices for  Distributed Graph Data: The Formal Schema-level...
Towards Flexible Indices for Distributed Graph Data: The Formal Schema-level...
 
An Emerging Standard for Research-Quality Images: What IIIF Means for Digital...
An Emerging Standard for Research-Quality Images: What IIIF Means for Digital...An Emerging Standard for Research-Quality Images: What IIIF Means for Digital...
An Emerging Standard for Research-Quality Images: What IIIF Means for Digital...
 
Neo4j in Depth
Neo4j in DepthNeo4j in Depth
Neo4j in Depth
 
Python meetup
Python meetupPython meetup
Python meetup
 
dicom.ppt
dicom.pptdicom.ppt
dicom.ppt
 
DRI Introductory Training: Preparing Your Collections for the DRI
DRI Introductory Training: Preparing Your Collections for the DRIDRI Introductory Training: Preparing Your Collections for the DRI
DRI Introductory Training: Preparing Your Collections for the DRI
 
One Core Preservation System for all your Data. No Exceptions! Marco Klindt a...
One Core Preservation System for all your Data. No Exceptions! Marco Klindt a...One Core Preservation System for all your Data. No Exceptions! Marco Klindt a...
One Core Preservation System for all your Data. No Exceptions! Marco Klindt a...
 
Kevin Long - Preparing your collection for DRI
Kevin Long - Preparing your collection for DRIKevin Long - Preparing your collection for DRI
Kevin Long - Preparing your collection for DRI
 
CNI 2018: A Research Object Authoring Tool for the Data Commons
CNI 2018: A Research Object Authoring Tool for the Data CommonsCNI 2018: A Research Object Authoring Tool for the Data Commons
CNI 2018: A Research Object Authoring Tool for the Data Commons
 
e-Services to Keep Your Digital Files Current
e-Services to Keep Your Digital Files Currente-Services to Keep Your Digital Files Current
e-Services to Keep Your Digital Files Current
 
How to store, organize and use petabytes of heterogenous data
How to store, organize and use petabytes of heterogenous dataHow to store, organize and use petabytes of heterogenous data
How to store, organize and use petabytes of heterogenous data
 
ISO 15926 Reference Data Engineering Methodology
ISO 15926 Reference Data Engineering MethodologyISO 15926 Reference Data Engineering Methodology
ISO 15926 Reference Data Engineering Methodology
 

Kürzlich hochgeladen

WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfkalichargn70th171
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...masabamasaba
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareJim McKeeth
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...SelfMade bd
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...Jittipong Loespradit
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdfPearlKirahMaeRagusta1
 
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT  - Elevating Productivity in Today's Agile EnvironmentHarnessing ChatGPT  - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT - Elevating Productivity in Today's Agile EnvironmentVictorSzoltysek
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...masabamasaba
 

Kürzlich hochgeladen (20)

WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT  - Elevating Productivity in Today's Agile EnvironmentHarnessing ChatGPT  - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 

Using DICOM and NIfTI in R

  • 1. DICOM and NIfTI Data Standards in R Summary DICOM NIfTI Visualization Conversion End Bibliography DICOM and NIfTI Data Standards in R Brandon Whitcher PhD CStat Mango Solutions London, United Kingdom www.mango-solutions.com bwhitcher@mango-solutions.com @MangoImaging 12 June 2012 – useR!2012 Tutorial
  • 2. DICOM and NIfTI Data Standards in R Summary DICOM NIfTI Visualization Conversion End Bibliography Outline 1 Summary 2 Digital Imaging and Communications in Medicine 3 Neuroimaging Informatics Technology Initiative 4 Data Visualization 5 DICOM-to-NIfTI Conversion 6 Conclusions
  • 3. DICOM and NIfTI Data Standards in R Summary DICOM NIfTI Visualization Conversion End Bibliography Goal • Content presented here provides users with the skills to manipulate DICOM / ANALYZE / NIfTI files in R. • Real-world data sets are used to illustrate the basic functionality of oro.dicom and oro.nifti. • S4 classes “nifti” and “anlz” enable further statistical analysis in R without losing contextual information from the original ANALYZE or NIfTI files. • Images in the metadata-rich DICOM format may be converted to NIfTI semi-automatically using as much information from the DICOM files as possible. • Basic visualization functions, are provided for “nifti” and “anlz” objects. • The oro.nifti package allows one to track every operation on a nifti object in an XML-based audit trail.
  • 4. DICOM and NIfTI Data Standards in R Summary DICOM NIfTI Visualization Conversion End Bibliography Alternatives to oro.dicom and oro.nifti • There are several R packages that are able to access the DICOM / ANALYZE / NIfTI data formats: • AnalyzeFMRI (Bordier et al. 2009) • fmri (Polzehl and Tabelow 2007) • Rniftilib (Granert 2010) • tractor.base (Clayden 2010) Question #1 What are the (dis)advantages to having a single R package that performs input / output for medical imaging data? Question #2 Should R packages be discouraged from writing output in formats other than ANALYZE or NIfTI?
  • 5. DICOM and NIfTI Data Standards in R Summary DICOM NIfTI Visualization Conversion End Bibliography The DICOM “Standard” • The DICOM “standard” for data acquired using a clinical imaging device is very broad and complex. • Each DICOM-compliant file is a collection of fields organized into two two-byte sequences (group,element) that are represented as hexadecimal numbers and form a tag. • The (group,element) combination establishes what type of information is forthcoming in the file. • There is no fixed number of bytes for a DICOM header. • The final (group,element) tag should be the PixelData tag (7FE0,0010), such that all subsequent information is related to the image. DICOM Digital Imaging and Communications in Medicine http://medical.nema.org
  • 6. DICOM and NIfTI Data Standards in R Summary DICOM NIfTI Visualization Conversion End Bibliography The Structure of a DICOM File Data element with explicit VR of OB, OF, OW, SQ, UT or UN: +-----------------------------------------------------------+ | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | +----+----+----+----+----+----+----+----+----+----+----+----+ |<Group-->|<Element>|<VR----->|<0x0000->|<Length----------->|<Value-> Data element with explicit VR other than as shown above: +---------------------------------------+ | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | +----+----+----+----+----+----+----+----+ |<Group-->|<Element>|<VR----->|<Length->|<Value-> Data element with implicit VR: +---------------------------------------+ | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | +----+----+----+----+----+----+----+----+ |<Group-->|<Element>|<Length----------->|<Value-> • Byte ordering for a single (group,element) tag in the DICOM standard. • Explicit VRs store the VR as text characters in two bytes.
  • 7. DICOM and NIfTI Data Standards in R Summary DICOM NIfTI Visualization Conversion End Bibliography Reading DICOM Files readDICOMFile() Accessing information stored in a single DICOM file • The resulting object is a list with two elements: the DICOM header (hdr) and the DICOM image (img). • Header information is organized in a data frame with six columns and an unknown number of rows. • First five columns taken from DICOM header information (group, element, code, length and value) or inferred (name). • (group,element) values are stored as character strings – not hexadecimal numbers. readDICOM() Accessing multiple DICOM files in a single directory or directory tree
  • 8. DICOM and NIfTI Data Standards in R Summary DICOM NIfTI Visualization Conversion End Bibliography Stacking DICOM Images create3D() and create4D() Create arrays from DICOM headers / images • Minimum input = “dcm” structure • PixelData may be read on-the-fly • Siemens MOSAIC format allowed • 4D volumes may require additional information • nslices = ? • ntimes = ?
  • 9. DICOM and NIfTI Data Standards in R Summary DICOM NIfTI Visualization Conversion End Bibliography The ANALYZE Format • The ANALYZE format was originally developed in conjunction with an image processing system (of the same name) at the Mayo Foundation. • A common version of the format, although not the most recent, is called ANALYZE 7.5. • An ANALYZE 7.5 format image is comprised of two files, the “.hdr” and “.img” files, that contain information about the acquisition and the acquisition itself, respectively. The ANALYZE Format .hdr = 348-byte binary file of header information .img = binary flat file of images (multi-dimensional array)
  • 10. DICOM and NIfTI Data Standards in R Summary DICOM NIfTI Visualization Conversion End Bibliography The NIfTI-1 Format • The NIfTI-1 data format is almost identical to the ANALYZE format, but offers a few improvements: • Merging of the header and image information into one file “.nii” • Re-organization of the 348-byte fixed header into more relevant categories • Possibility of extending the header information • Discussions have begun on the NIfTI-2 data format. NIfTI Neuroimaging Informatics Technology Initiative http://nifti.nimh.nih.gov
  • 11. DICOM and NIfTI Data Standards in R Summary DICOM NIfTI Visualization Conversion End Bibliography S4 Classes for ANALYZE and NIfTI-1 • “nifti” • Inherits from class “array” • Slots contain NIfTI header information • Basic methods: show(), nifti(), is.nifti(), as(<obj>, “nifti”) • Input / output: readNIfTI(), writeNIfTI() • Slot access: pixdim(), qform(), sform(), descrip(), aux.file(), audit.trail() • Additional classes: “niftiExtension” and “niftiExtensionSection” • “anlz” • Inherits from class “array” • Slots contain ANALYZE header information
  • 12. DICOM and NIfTI Data Standards in R Summary DICOM NIfTI Visualization Conversion End Bibliography Visualization • oro.nifti offers three functions for visualization • image() = overloaded function for “anlz”, “array” and “nifti” classes • overlay() = extension of image() with x and y input parameters • orthographic() = mid-axial, mid-sagittal, mid-coronal views Interactive Visualization FSLView http://www.fmrib.ox.ac.uk/fsl/fslview/ MRIcron http://www.cabiatl.com/mricro/mricron/ VolView http://www.kitware.com/products/volview.html
  • 13. DICOM and NIfTI Data Standards in R Summary DICOM NIfTI Visualization Conversion End Bibliography DICOM-to-NIfTI Conversion • oro.dicom and oro.nifti were designed to use as much information as possible from the metadata-rich DICOM format and apply that information in the construction of the NIfTI data volume. • Read in a single series using dicomSeperate() • dicom2nifti() converts the list of DICOM images into a multidimensional “nifti” object • dicom2analyze() converts the list of DICOM images into a multidimensional “anlz” object • Additional scripting in R is required to deal with multiple series
  • 14. DICOM and NIfTI Data Standards in R Summary DICOM NIfTI Visualization Conversion End Bibliography Goal • Content presented here provides users with the skills to manipulate DICOM / ANALYZE / NIfTI files in R. • Real-world data sets are used to illustrate the basic functionality of oro.dicom and oro.nifti. • S4 classes “nifti” and “anlz” enable further statistical analysis in R without losing contextual information from the original ANALYZE or NIfTI files. • Images in the metadata-rich DICOM format may be converted to NIfTI semi-automatically using as much information from the DICOM files as possible. • Basic visualization functions, are provided for “nifti” and “anlz” objects. • The oro.nifti package allows one to track every operation on a nifti object in an XML-based audit trail.
  • 15. DICOM and NIfTI Data Standards in R Summary DICOM NIfTI Visualization Conversion End Bibliography Help • http://rigorousanalytics.blogspot.com • https://r-forge.r-project.org/projects/ rigorous • rigorous-dicom@lists.r-forge.r-project.org • rigorous-nifti@lists.r-forge.r-project.org • rigorous-dcemris4@lists.r-forge.r-project.org Volume 44 in the Journal of Statistical Software Special volume on “Magnetic Resonance Imaging in R” • 13 articles on fMRI, DTI, DCE-MRI, etc. • www.jstatsoft.org/v44
  • 16. DICOM and NIfTI Data Standards in R Summary DICOM NIfTI Visualization Conversion End Bibliography Bibliography I C. Bordier, M. Dojat, and P. Lafaye de Micheaux. AnalyzeFMRI: an R package to perform statistical analysis on fmri datasets. 2009. URL http: //www.biostatisticien.eu/AnalyzeFMRI/. Software: R Package, AnalyzeFMRI, version 1.1-12. J. Clayden. tractor.base: A Package for Reading, Manipulating and Visualising Magnetic Resonance Images, 2010. URL http: //CRAN.R-project.org/package=tractor.base. R package version 1.5.0. O. Granert. Rniftilib: R Interface to NIFTICLIB (V1.1.0), 2010. URL http: //CRAN.R-project.org/package=Rniftilib. R package version 0.0-29.
  • 17. DICOM and NIfTI Data Standards in R Summary DICOM NIfTI Visualization Conversion End Bibliography Bibliography II J. Polzehl and K. Tabelow. fmri: A package for analyzing fmri data. RNews, 7(2):13–17, 2007. URL http://www.r-project.org/doc/Rnews/Rnews_ 2007-2.pdf.
  • 18. DICOM and NIfTI Data Standards in R Appendix R Package: oro.dicom • Title: Rigorous - DICOM Input / Output • Description: Data input/output functions for data that conform to the Digital Imaging and Communications in Medicine (DICOM) standard, part of the Rigorous Analytics bundle. • Depends: R (>= 2.13.0), utils • Suggests: hwriter, oro.nifti (>= 0.2.9) • License: BSD • URL: http://rigorousanalytics.blogspot.com
  • 19. DICOM and NIfTI Data Standards in R Appendix R Package: oro.nifti • Title: Rigorous - NIfTI+ANALYZE+AFNI Input / Output • Description: Functions for the input/output and visualization of medical imaging data that follow either the ANALYZE, NIfTI or AFNI formats. This package is part of the Rigorous Analytics bundle. • Depends: R (>= 2.13.0), bitops, graphics, grDevices, methods, utils • Suggests: XML • Imports: splines • Enhances: fmri • License: BSD • URL: http://rigorousanalytics.blogspot.com