How to calculate a Voxel size?

帅比萌擦擦* 提交于 2021-02-16 19:22:19

问题


Provided following information from a DICOM header, how can I calculate the third value of voxel size? I assume the first two values are 0.515625 and 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"

Note: I receive a JPEG image stack, not DICOM, and it come with a file that had the values I posted above. I can go back and ask for additional information in file if needed.


回答1:


Given only the tags of one slice, you have to use SliceThickness as the third dimension, though I would advice against this, as this is not guaranteed to give the distance between slices. There is the tag SpacingBetweenSlices that provides this information, though it seems not to be present in your case.

The best way is to use the difference in ImagePositionPatient between adjacent slices. For this, you need of course the tag of the next slice, additionally. As a side note: in your listing, ImageOrientation and ImagePosition should better read ImageOrientationPatient and ImagePositionPatient, as ImageOrientation and ImagePosition are other tags (not present in CT images).

ImagePositionPatient gives the position of the upper left hand corner of the slice in DICOM patient coordinates, and to calculate the distance you have to take into account the orientation of the slice in that coordinate system. This is given by ImageOrientationPatient, which contains the normalized rows and columns direction cosine vectors of the slices in DICOM coordinates. You can read that up in the DICOM standard.

The first two components of the orientation matrix is provided by ImageOrientationPatient (e.g. the first and second three numbers), the third component can be calculated by taking the cross product of these 2 components.

So, in pseudo code this will look something like this:

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[1], 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

Update: As pointed out by @gofal, the first version was incorrect. I also included the normalization (e.g. delete by length(orient3)), though strictly speaking the values should already be normalized.




回答2:


PixelSpacing (0028,0030) gives you the two sizes in direction of Columns and Row in the image. The third value you are asking for is Slice Thickness (0018,0050).

In case of some reconstructions (MIP or similar), the Slice thickness may be a higher value than the distance of two neighboring images. So if you are using this single image as its own, then you will have to use Slice Thickness. But if you have a stack of images and want do do 3d-rendering or reconstruction or similar, then I would recommend to calculate the third voxel size by the distance of two adjacent images.

References: https://dicom.innolitics.com/ciods/ct-image/image-plane http://dicom.nema.org/medical/dicom/current/output/chtml/part03/sect_C.34.12.html



来源:https://stackoverflow.com/questions/65389506/how-to-calculate-a-voxel-size

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!