Presentation is loading. Please wait.

Presentation is loading. Please wait.

Medical Image File Formats and Converters

Similar presentations


Presentation on theme: "Medical Image File Formats and Converters"— Presentation transcript:

1 Medical Image File Formats and Converters
MBI Data Tutorial 7 June 2012 Amanda Ng

2 Outline DICOM HDF5 MINC Analyze/NIfTI RAW DaRIS built-in converters
FILE FORMATS CONVERTERS DICOM HDF5 MINC Analyze/NIfTI RAW DaRIS built-in converters Matlab ITK dcm2nii (MRICron) MRTrix MRConvert MIPAV

3 Image file formats (general)
Consists of: Metadata (information about the data, eg file size, image dimensions, scan date, patient id) Data (usually big long string of bytes) Organised as: Header (metadata) followed by data Containers (each has an identifier, metadata, data) Header Data 352 EOF bytes Example: NIfTI file format Container Example: DICOM file format Tag Data Type # elements Data

4 Medical image file formats
Lots of information Only data DICOM HDF5 MINC NIfTI Analyze7.5 RAW

5 DICOM Digital Imaging and Communications in Medicine
File format and network communications protocol Developed/maintained by ACR/NEMA Current version is 3.0 (since 1993), however updates are released and numbered according to year. Container-based format ACR = American College of Radiology NEMA = National Electrical Manufacturers Association

6 DICOM Advantages Disadvantages
Store infinite amount (well, a lot) of metadata Easily appendable Recognised by most software packages (eg Matlab, SPM, MRTrix, MPIAV, Freesurfer) Usually in the form of a converter to the native format Except FSL. Grrr… 3D volumes are usually stored as separate DICOM files for each slice Metadata repeated in every file 100 slices means 100 separate files … ewww For multi-volume datasets (eg fMRI, diffusion) manufacturers implemented custom embedding of 3D volumes in single files.

7 Value Representation (VR)
DICOM Data Element DICOM file Data Element Tag Value Representation (VR) Value Length (VL) Value Field Tag Unique Id Index to the DICOM dictionary Even numbers are standard (eg Patient Name) Odd numbers are ‘user defined’ (eg Siemens CSA entry) VR Description AE Application Entity AS Age String AT Attribute Tag CS Code String DA Date DS Decimal String DT Date/Time FL Floating Point Single FD Floating Point Double IS Integer String LO Long String LT Long Text OB Other Byte OF Other Float OW Other Word PN Person Name SH Short String SL Signed Long SQ Sequence of Items SS Signed Short ST Short Text TM Time UI Unique Identifier UL Unsigned Long UN Unknown US Unsigned Short UT Unlimited Text Value Length Number of values in ‘Value Field’ VL > 1 for arrays (eg voxel dimensions) Value Field Contains actual metadata

8 Browsing Data Elements
Most DICOM packages have facility to browse data elements or “metadata” (DCMTK) dcmdump dcmdump 0001.dcm | grep ‘Manufacturer’ (python) pydicom import dicom ds = dicom.read_file(‘0001.dcm’) ds[0x ] ds.Manufacturer Most important data element: Pixel Data 7FE0 0010 OW 1 Tag VR VL Value Field

9 HDF5 Hierarchical Data Format
“data model, library and file format for storing and managing data” Not medical image specific Container based format (sort of)

10 HDF5 MINC2 Advantages Disadvantages general self-describing
unlimited *cough* amount of metadata can embed compressed data still require some sort of convention for storing medical data (eg metadata fields that should be included, such as voxel size) MINC2

11 HDF5 Format (basic) … … … HDF5 File Data Descriptor
Data Descriptor Block Block Size Offset to Next Block Data Descriptor Every DD Block is the same size. Usually 16 descriptors, but can be changed. Data Descriptor Tag Reference # Offset Length 2 4 8 12 HDF File Header Data Descriptor Block Data Descriptor Block Data Element Data Element

12 MINC Medical Image NetCDF
Originally (1992) an extension to the NetCDF file format specific for medical imaging purposes Reworked into MINC2 in 2003 because of huge datasets, based on HDF5 format Advantages Disadvantages All the HDF5 advantages! Woo!! Loads of metadata Doesn’t seem to be well supported by non-MNI applications. Some software doesn’t support MINC2

13 NIfTI/Analyze 7.5 Analyze 7.5 NIfTI Created by Mayo clinic
Considered old and superseded by Mayo Clinic Header + data format (but in two separate files) Ambiguous/limited support for orientation schemes NIfTI Specified by NIH Modified Analyze 7.5 format (backward compatible) Extended header Single file Also an SPM version of NIfTI

14 NIfTI Advantages Disadvantages
Recognised by many software packages (including FSL! Yay!) Stores translations from patient to image space. Although facility to extend the header, not usually done and therefore limited in the metadata contained Limited to 7 dimensions

15 Dim 3 (slices in a volume)
Analyze 7.5 Format Header Key Dimensions History (description) (aux_file) Orientation Number of dimensions Dim 1 (voxels in a row) Dim 2 (rows in a slice) Dim 3 (slices in a volume) Dim 4 (time points) Dim 5 Dim 6 Dim 7 Datatype Bits per pixel Voxel width Voxel height Slice thickness Size of Header (data type) (db_name) (extents) (session_error) (regular) (hkey_un0) Header Orientation Dim 1 Dim 2 Dim 3 Transverse unflipped R  L P  A I  S Coronal unflipped Sagittal unflipped Transverse flipped A  P Coronal flipped S  I Sagittal flipped Data

16 NIfTI changes Header is 4 bytes longer
Optional extended header (though not yet used) History section of header different Specifies translation between patient space and image space Quaternion representation (rotation matrix and offsets), or Affine matrix representation Complete set of data types Standardised storage of data Dual (.hdr, .img) or single (.nii) file storage

17 Raw Binary Files No header, just the data. Need to know
The dimensions of the data The datatype (integer, float) and datatype size (8 bit, 16 bit, 32 bit) Endian-ness Ordering of the data Column-major order Row-major order

18 File Format Support Software DICOM MINC Analyze NIfTI RAW Matlab ✔
EMMA File XΔ SPM via Matlab FSL MNI Tools MRTrix MPIAV FreeSurfer MRICron ITK Python pydicom nibabel

19 Converters DaRIS built-in converters Matlab MRIConvert MIPAV ITK
dcm2nii (MRICron) MRTrix

20 DaRIS built-in converters
Datasets stored as Can convert to DICOM Analyze (neurological) Analyze (radiological) MINC NIfTI Siemens Spectrum Doesn’t play nice with Skyra frames data *sad face* Doesn’t appear to convert translation matrix to MINC. Issues with translation matrix in NIfTI

21 Matlab Can read in these Can write these DICOM NIfTI/Analyze MINC RAW
HDF5 NIfTI DICOM MINC RAW HDF5 Reads Skyra data fMRI/Diffusion data! *happy face* Not straight-forward click-a-button (may need to download files from file exchange)

22 Converts these formats
MRIConvert Converts these formats to these formats DICOM FSL NIfTI SPM Analyze Meta Image NIfTI Analyze 7.5 BrainVoyager Doesn’t play nice with Skyra frames data *sad face* Creates bvec and bvals files for FSL Diffusion Toolkit *happy face* Comes with command line version “mcverter”

23 MIPAV Opens these formats Saves these formats DICOM Analyze NIfTI MINC
… others DICOM Analyze NIfTI MINC … others Opens Skyra frames data!!! *big happy face*

24 Other converters dcm2nii (comes with MRICron) ITK MRTrix
Converts DICOM to all forms of NIfTI Has a GUI ITK Sounds amazing! I’m yet to install and play. MRTrix Diffusion imaging package Easy to use command line converter (mrconvert)

25 File Format Links HDF5 MINC MRTrix NIfTI Analyze 7.5
Basic format outline e_html/UG_Fundmtls.html Detailed format description: MINC MRTrix NIfTI Analyze 7.5


Download ppt "Medical Image File Formats and Converters"

Similar presentations


Ads by Google