How to calculate actual size of an object in a dicom image?

I have a dicom image of CT scan. Regionprops returns area in pixels. Is there any other way in Matlab to get the actual sizein cms/mms?

 Réponse acceptée

Image Analyst
Image Analyst le 30 Mar 2019
Hopefully there is something in your dicom header that gives the spatial calibration in real world units per pixel.

4 commentaires

I found a parameter called PixelSpacing in the dicom header. Is that equivalent to XResolution and YResolution in PNG file header?
PixelSpacing is what you want for 2D. It measures pixel center distance so you can get outer distance by multiplying the number of pixels by the spacing.
The situation in 3d is more complicated.
Thank you Sir.
Pixelspacing returns spacing in mms.
Therefore is the following calculation of size obtained by multiplying area obtained from regioprops by [pixelspacing.x pixelspacing.y] correct?
%PixelSpacing value from dicom header
% area returned by regionprops
area_in_mm = area .* [PixelSpacing.xvalue PixelSpacing.yvalue];
No, more like
area_in_mm = area * PixelSpacing.xvalue * PixelSpacing.yvalue;

Connectez-vous pour commenter.

Plus de réponses (2)

nehad mohamed
nehad mohamed le 7 Jan 2021
I want a tool like a ruler to measure distances in dicom images. In cm. using matlab

9 commentaires

See my attached spatial calibration demo. Adapt as needed.
error
i want measure distance between to selected point on dicom image and save this distance on excel file
What error did you run into?
Looks like you forgot to read the posting guidelines. Here they are again:
error in measure distance with cm on dicom image
You already said that you get an error when doing that, but you did not tell us what the error message is, and you did not make your code available for us to review.
error in function draw line[]
Image Analyst
Image Analyst le 9 Jan 2021
Modifié(e) : Image Analyst le 9 Jan 2021
nehad, it looks to me like you totally ignored my comment when I asked you to read this link:
Your last comment proves that. So after you read that, start your own discussion thread since this is not an official Answer to Sparkle89's question, and we don't want to be sending them emails with every post about this non-Answer.
Take. A. Picture. Of. The. Error. Message. And. Attach. The. Picture. 🥺

Connectez-vous pour commenter.

nehad mohamed
nehad mohamed le 10 Jan 2021

2 commentaires

nehad mohamed
nehad mohamed le 10 Jan 2021
Modifié(e) : nehad mohamed le 10 Jan 2021
this my error and my code
iwant tools like ruler to measure distance and save this distance in excel sheet
Again:
nehad, it looks to me like you totally ignored my comment when I asked you to read this link:
Your last comment proves that. So after you read that, start your own discussion thread since this is not an official Answer to Sparkle89's question, and we don't want to be sending them emails with every post about this non-Answer.
If you want, you can put a link to your new thread back here. That's all.

Connectez-vous pour commenter.

Catégories

En savoir plus sur DICOM Format dans Centre d'aide et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by