问题描述
从 DICOM 标头提供以下信息,如何计算体素大小的第三个值?我假设前两个值是 0.515625 和 0.515625。
BitsAllocated: "16"
Bitsstored: "12"
Columns: 512
HighBit: "11"
ImageOrientation: "1\0\0\0\-1\0"
ImagePosition: "-144\-34.7242241\925.599976"
ImageType: "ORIGINAL\PRIMARY\AXIAL\HELIX"
InstanceNumber: "456"
Modality: "CT"
PhotometricInterpretation: "MONOCHROME2"
PixelRepresentation: "0"
PixelSpacing: "0.515625\0.515625"
RescaleIntercept: "1"
Rows: 512
SamplesPerPixel: "1"
SeriesDescription: "CERVEAU SANS IV"
SeriesNumber: "3"
SliceThickness: "1.50"
WindowCenter: "00040\00040"
WindowWidth: "00120\00120"
imagesFormat: "jpg"
modality: "CT"
name: "soft tissue"
nodeId: "557621"
pixelHeight: "0.515625"
pixelWidth: "0.515625"
注意:我收到的是 JPEG 图像堆栈,而不是 DICOM,并且它带有一个包含我上面发布的值的文件。如果需要,我可以返回并询问文件中的其他信息。
解决方法
仅给定一个切片的标签,您必须使用 SliceThickness
作为第三维,但我建议不要这样做,因为这不能保证给出切片之间的距离。有提供此信息的标签 SpacingBetweenSlices
,但在您的案例中似乎不存在。
最好的方法是利用相邻切片之间 ImagePositionPatient
的差异。为此,您当然还需要下一个切片的标签。附带说明:在您的列表中,ImageOrientation
和 ImagePosition
应该更好地阅读 ImageOrientationPatient
和 ImagePositionPatient
,因为 ImageOrientation
和 ImagePosition
是其他标签(在 CT 图像中不存在)。
ImagePositionPatient
给出切片左上角在 DICOM 患者坐标中的位置,要计算距离,您必须考虑切片在该坐标系中的方向。这由 ImageOrientationPatient
给出,它包含 DICOM 坐标中切片的归一化行和列方向余弦向量。您可以在 DICOM standard 中阅读该内容。
方向矩阵的前两个分量由ImageOrientationPatient
提供(例如第一个和第二个三个数),第三个分量可以通过取这两个分量的叉积来计算。
所以,在伪代码中,这看起来像这样:
orient1 = vector(ImageOrientationPatient[0],ImageOrientationPatient[1],ImageOrientationPatient[2])
orient2 = vector(ImageOrientationPatient[3],ImageOrientationPatient[4],ImageOrientationPatient[5])
orient3 = orient1 x orient2 // cross product
orient_matrix = matrix(orient1,orient2,orient3)
pos1 = vector(ImagePositionPatient[0],ImagePositionPatient[1],ImagePositionPatient[2]) // from current slice
pos2 = vector(ImagePositionPatient[0],ImagePositionPatient[2]) // from adjacent slice
diff_pos = pos2 - pos1
image_pos = orient_matrix o diff_pos / length(orient3) // normalized dot product
voxel_z = image_pos.z
更新:正如@gofal 所指出的,第一个版本是不正确的。我还包括了规范化(例如通过 length(orient3)
删除),但严格来说这些值应该已经规范化了。
PixelSpacing (0028,0030) 为您提供图像中列和行方向的两种尺寸。您要求的第三个值是切片厚度 (0018,0050)。
在某些重建(MIP 或类似)的情况下,切片厚度可能比两个相邻图像的距离更高。 因此,如果您将此单个图像用作自己的图像,则必须使用切片厚度。但是,如果您有一堆图像并且想要进行 3d 渲染或重建或类似操作,那么我建议您通过两个相邻图像的距离来计算第三个体素大小。
参考资料: https://dicom.innolitics.com/ciods/ct-image/image-plane http://dicom.nema.org/medical/dicom/current/output/chtml/part03/sect_C.34.12.html