780 likes | 1.29k Views
Medical Image File Formats. Justin Senseney, DCB/CIT/NIH http://mipav.cit.nih.gov http ://dcb.cit.nih.gov/~senseneyj. Overview. Part 1 – Basics Data Image Part 2 – Medical File Formats Practical: See underlying data Part 3 – General File Formats
E N D
Medical Image File Formats Justin Senseney, DCB/CIT/NIH http://mipav.cit.nih.gov http://dcb.cit.nih.gov/~senseneyj
Overview • Part 1 – Basics • Data • Image • Part 2 – Medical File Formats • Practical: See underlying data • Part 3 – General File Formats • Part 4 – All together and everything else • Practical: Use file formats
Imaging – Why? • NIH has 27 institutes and centers • 14 are here • http://www.idoimaging.com/index.shtml
Imaging – How? • Data communication • Standards
Part 1.A – Data Basics • Bits vs Bytes • Endianess • Sign • Compression • Data types
Bits vs Bytes • Bit – a number system • Byte – a language
Bits vs Bytes binary CT image with HU = 213 at position (4,9) Byte = 8 bits: D5
Sign • 2’s complement • Unsigned 213 = -43 signed, just fat • Recognize sign bits • Offset scaling • Discrete to decimal • Common in dicom
Endianness • Big Endian – most sig. = lowest address • In DICOM: Film destination • Little Endian - least sig. = lowest address • In DICOM: Image comments
Compression • RLE – run length • LZW - dictionary • Huffman – variable length • DCT - discrete cosine transform • lossy
Data Types • Boolean – 1 bit • Byte – 1 byte • Short – 2 bytes • Dicom • Int – 4 bytes • Long – 8 bytes
Data Types (2) • Decimal – IEEE standard • Float – 4 bytes • Double – 8 bytes
Raw Data Demo • Hex Editor NEO
Part 1.B – Image Basics • Resolution • Dimensions/Extents • Color • Orientation • Origin • Transformations • Encoding
Resolution • Level of detail • Width of dimension unit • Computing area, volume • Time in seconds
Dimensions/Extents • 3D • As stacks • 4D • Multi-file • Complex • Multi-channel
Color • Channels • RGB or HSV • CMYK • N-bit color is 2^n possible colors
Orientation • Axial/Transverse • Sagittal • Coronal
Origin • In n-dimensions • Scanner space vs image space
Transformations • Image space to scanner space • Dicom • NIfTI
Encoding • Encapsulating image • JPEG compression in DICOM, Tiff • Embedding image • Thumbnail image
Header • Text based • Binary • XML
Header Demo BrukerBioSpin format
Part 2 – Medical File Formats • XML • DICOM • NIfTI
XML - Basic • Instance is .xml file • Schema is .xsd file
DICOM • NEMA standard • ftp://medical.nema.org/medical/dicom/2011/ • Header • Communication • Storage
Dicom - Tags • Chapter 6 • Group – 2 bytes • Element – 2 bytes • Public vs private
Dicom – Tag values • Chapter 5 • Value representation (VR) • Little endian, explicit VR default
Dicom – Tag construction From 2011 standard • VR can be implicit for public tags
Dicomv.3.0 - Standard • Chapter 3 From 2011 standard
Dicom properties • Dimensions • (0028,0010)and (0028,0011) • Image • (7FE0, 0010) • Transfer syntax • (0002, 0010)
Dicom – Pixel map • (0028, 1052) is slope • (0028, 1053) is intercept • Y (true value) = ax+b for x short
DICOM Mosaic • Matrix of image slices: • Concatenate into 3D/4D volume • Calculate relevant DICOM tags
NIfTI • Standard for ANALYZE by NIMH • See : http://nifti.nimh.nih.gov/pub/dist/src/niftilib/nifti1.h
NIfTI - Data • Allows complex data, 64 bit integer • Provides patient-space coordinates
NIfTI - Orientation • +x = right • +y = anterior • +z = superior • Is default, but in Analyze 7.5, +x = left
NIfTI – q_form, s_form • Matrix of offsets • Codes for orientation
Part 3 – Image File Formats • Vector Images • Graphics/Bitmap Images
Vector Images • CAD applications • Lines/ROI/VOI
Graphics Images • GIF • TIFF • BMP • PNG • JPEG
GIF • LZW • Small (8 bit) color range • Little endian • Sequence of 2D possible
TIFF • RLE, JPEG • Larger color range (to 24 bit) • Microscopy • Image File Directory
BMP • RLE • Up to 32-bit
PNG • 48 bit color range (outside of vision) • Best for large, lossless compression
JPEG • DCT (lossy), Huffman • Down-sampling • Markers
General Image Demo • ImageJ + batteriesn=Fiji
Part 4 – All together • Afni • BrukerBioSpin • GESigna • LSM • Minc • MATLAB • Parrec • Raw