medical image file formats

62
Medical Image File Formats Justin Senseney, DCB/CIT/NIH http://mipav.cit.nih.gov http ://dcb.cit.nih.gov/~sense neyj

Upload: chandler-nelson

Post on 02-Jan-2016

60 views

Category:

Documents


6 download

DESCRIPTION

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 - PowerPoint PPT Presentation

TRANSCRIPT

Medical Image File Formats

Justin Senseney, DCB/CIT/NIHhttp://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

2

Imaging – Why?• NIH has 27 institutes and centers

– 14 are here• http://

www.idoimaging.com/index.shtml

3

Imaging – How?

• Data communication• Standards

4

Part 1.A – Data Basics

• Bits vs Bytes

• Endianess

• Sign

• Compression

• Data types5

Bits vs Bytes

• Bit – a number system

• Byte – a language

6

Bits vs BytesBits 1 1 0 1 0 1 0 1

7

Decimal Binary bits Hexadecimal

0 0000 0

1 0001 1

2 0010 2

3 0011 3

4 0100 4

5 0101 5

6 0110 6

7 0111 7

8 1000 8

9 1001 9

10 1010 A

11 1011 B

12 1100 C

13 1101 D

14 1110 E

15 1111 F

Byte = 8 bits:D5

CT image with HU = 213at position (4,9)

binary

Sign

• 2’s complement– Unsigned 213 = -43 signed, just fat

– Recognize sign bits

• Offset scaling– Discrete to decimal– Common in dicom

8

Bits 1 1 0 1 0 1 0 1

Comp.

0 0 1 0 1 0 1 1

Sub 1 1 1 0 1 0 1 0 0

Endianness

• Big Endian – most sig. = lowest address

– In DICOM: Film destination

• Little Endian - least sig. = lowest address

– In DICOM: Image comments 9

Little (0020, 4000)

Big (2000, 0040)

Address

0 1 2 3

Bytes 20 00 00 40

Compression

• RLE – run length

• LZW - dictionary

• Huffman – variable length

• DCT - discrete cosine transform– lossy

10

Data Types• Boolean – 1 bit

• Byte – 1 byte

• Short – 2 bytes– Dicom

• Int – 4 bytes

• Long – 8 bytes11

Data Types (2)

• Decimal – IEEE standard

– Float – 4 bytes

– Double – 8 bytes

12

Raw Data Demo• Hex Editor NEO

13

Part 1.B – Image Basics

• Resolution• Dimensions/Extents• Color• Orientation• Origin• Transformations• Encoding

14

Resolution

• Level of detail

• Width of dimension unit– Computing area, volume

– Time in seconds

15

Dimensions/Extents

• 3D– As stacks

• 4D – Multi-file

• Complex– Multi-channel

16

Color

• Channels– RGB or HSV

– CMYK

• N-bit color is 2^n possible colors

17

Orientation

• Axial/Transverse

• Sagittal

• Coronal

18

Origin

• In n-dimensions

• Scanner space vs image space

19

Transformations

• Image space to scanner space

• Dicom

• NIfTI

20

Encoding

• Encapsulating image – JPEG compression in DICOM, Tiff

• Embedding image– Thumbnail image

21

Header• Text based

• Binary

• XML

22

Header Demo

23

Bruker BioSpin format

Part 2 – Medical File Formats

• XML

• DICOM

• NIfTI

24

XML - Basic

• Instance is .xml file

• Schema is .xsd file

25

XML - Basic

26

DICOM

• NEMA standard– ftp://medical.nema.org/medical/dicom/2

011/

• Header– Communication– Storage

27

Dicom - Tags

• Chapter 6

• Group – 2 bytes• Element – 2 bytes

• Public vs private

28

Dicom – Tag values

• Chapter 5

• Value representation (VR)

• Little endian, explicit VR default

29

Dicom – Tag construction

30

• VR can be implicit for public tags

From 2011 standard

Dicomv.3.0 -

Standard

31

• Chapter 3From 2011 standard

Dicom properties

• Dimensions– (0028,0010) and (0028,0011)

• Image– (7FE0, 0010)

• Transfer syntax– (0002, 0010)

32

Dicom – Pixel map

• (0028, 1052) is slope• (0028, 1053) is intercept

• Y (true value) = ax+b for x short

33

DICOM Mosaic

• Matrix of image slices:

– Concatenate into 3D/4D volume

– Calculate relevant DICOM tags

34

Dicom Demo

35

NIfTI - Data

• Allows complex data, 64 bit integer

• Provides patient-space coordinates

37

NIfTI - Orientation

• +x = right

• +y = anterior

• +z = superior

• Is default, but in Analyze 7.5, +x = left

38

NIfTI – q_form, s_form

• Matrix of offsets

• Codes for orientation

39

NIfTI Demo

40

Part 3 – Image File Formats

• Vector Images

• Graphics/Bitmap Images

41

Vector Images

• CAD applications

• Lines/ROI/VOI

42

Graphics Images• GIF

• TIFF

• BMP

• PNG

• JPEG43

GIF

• LZW

• Small (8 bit) color range

• Little endian

• Sequence of 2D possible

44

TIFF

• RLE, JPEG

• Larger color range (to 24 bit)

• Microscopy

• Image File Directory

45

BMP

• RLE

• Up to 32-bit

46

PNG

• 48 bit color range (outside of vision)

• Best for large, lossless compression

47

JPEG

• DCT (lossy), Huffman

• Down-sampling

• Markers

48

General Image Demo• ImageJ + batteriesn =Fiji

49

Part 4 – All together

• Afni• Bruker BioSpin• GESigna• LSM• Minc• MATLAB• Parrec• Raw

50

Afni

• Needed to use AFNI tools for fMRI

• Latest paper: http://dx.doi.org/10.1016/j.neuroimage.2011.08.056

• .BRIK with data, .HEAD header

• Allows PET, CT, SPECT

51

Bruker BioSpin

• Unlike Siemens/GE DICOM data

• Text based header

• Raw data

52

GESigna

• Predecessor to DICOM

• Fixed image data bit location

53

LSM

• Microscopy extension of Tiff

• Pixel resolution

• Uses LZW

54

Minc

• Based on NetCDF

• Extends using:– Intensity scaling– Resolution– Position

55

Matlab

• *.mat files (not *.m)

• Array data as “raw” image

• No encoding of image information

• http://www.mathworks.com/help/pdf_doc/matlab/matfile_format.pdf

56

Parrec

• Raw Philips format

• Easy to convert to DICOM MR

57

Raw

• Raw images as described in previous formats

• Byte, Long, Complex, Float, Double

58

Demo

• Mango

59

Conclusion

• http://www.idoimaging.com/index.shtml

60

Questions

[email protected]• http://dcb.cit.nih.gov/~senseneyj• http://mipav.cit.nih.gov• http://imagej.nih.gov

61