什么是MHD文件
一种医学影像图像头文件(多用于CT影像),一般一个.mhd
文件对应一个.raw
文件,那个.raw
文件包含了多张slice(CT切片)。头文件类似于C++编程中.h
与.cpp
的关系。
MHD文件格式
ObjectType = Image
NDims = 3
BinaryData = True
BinaryDataByteOrderMSB = False
CompressedData = False
TransformMatrix = 1 0 0 0 1 0 0 0 1
Offset = -150 -140 -314
CenterOfRotation = 0 0 0
AnatomicalOrientation = RAI
ElementSpacing = 0.60546880960464478 0.60546880960464478 10
seriesuid = 000
DimSize = 512 512 33
ElementType = MET_SHORT
ElementDataFile = 318713.raw
介绍几个重要的元素
NDims
三维坐标
Offset
原点坐标
ElementSpacing
一个体素(图像像素)在xyz(真实世界CT采样)方向上的大小,其中一般xy对应的spacing是相同的
DimSize
每张slice的二维大小与张数
ElementType
MET_SHORT类型,数值有正负
ElementDataFile
头文件对应的原始数据
使用.mhd
文件可以将世界转换到体素(voxel)坐标,即世界坐标到计算机图像坐标的转换
注意到,slic为512x512
,xy对应的spacing是相同的,则转换后的slice长宽比必然保持1:1
留言