How to convert dicom image world coordinates into Cartesian coordinates

I have coordinates of arteries seed points in world coordinate system how can I convert them to the Cartesian ones, by using the DICOM header information of CTA image.
E.g I have 512x512x299volume of dicom images and Ihave a seedpoint represented in world coordinates say (54.3057 56.3043 78.9999), how could I get the corresponding cartesian coordinate of this world coordinate using header information in Matlab??

5 Kommentare

Can you share the list of dicom headers you have available? If you share the names, but not the content, we can help you write the code, without the need for you to share patient information.
Thank you Rik for your help. These are the available dicom headers
Width: 512
Height: 512
BitDepth: 16
SpacingBetweenSlices: 0.4000
ImagePositionPatient: [3×1 double]
ImageOrientationPatient: [6×1 double]
NumberOfFrames: 1
Rows: 512
Columns: 512
PixelSpacing: [2×1 double]
BitsAllocated: 16
BitsStored: 16
HighBit: 15
SmallestImagePixelValue: 1024
LargestImagePixelValue: 3138
WindowCenter: 200
WindowWidth: 900
RescaleIntercept: -1024
RescaleSlope: 1
PixelDimensions: [0.3066 0.3066 0.4000]
Dimensions: [512 512 299]
The PixelDimensions is probably enough. You can divide your offset by the size to convert mm to voxel location:
info=struct;
info.PixelDimensions=[0.3066 0.3066 0.4000];
coordinates_in_mm=[54.3057 56.3043 78.9999];
coordinates_in_px=coordinates_in_mm./info.PixelDimensions;
This doesn't return rounded values (nor values close to integers), so you might need to subtract ImagePositionPatient before converting to pixel units. This is all caused by poor documentation about what units the coordinates are in, and how to get there. Learn from their mistake and document your steps.
Rik Thank you for your help but after subtracting from the ImagePositionPatient tag it still not gives integer values of coordinates.
Are you certain they should be integers?
Contact the person who created those coordinates.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Walter Roberson
Walter Roberson am 8 Dez. 2019
I suspect that when you talk about cartesian coordinates, you are referring to row, column, layer coordinates.
Note that typically for images, what you care about is coordinates relative to corner of the volume, rather than absolute coordinates. In such cases, you can typically translate coordinate systems just by knowing the x, y, and z resolution. However, you specifically asked for world coordinates, so you will have to pay attention to the Image Position (0020,0032) and Image Orientation (0020,0037). I have to say, though, that it is very rare to see an imaging scanner with an attached GPS, as would be necessary to work with world coordinates.

3 Kommentare

yes I need to get row , column layer coordinate of seed points to get the voxel intensity of my image but I don't know how can I get this from these two dicom tags
CT is generally the easiest to work with. You only need to worry about the physical dimensions of the voxels. Then you can simply use one corner voxel as the origin, and use the voxel dimensions to translate coordinates in voxel offsets.
Note that the slice thickness sounds like the distance between two slice, but that information is actually encoded in the slice interval (which is an optional tag, so you might have to calculate it from the z position of two slices).
@Rik I only wanted to change coordinates my seedpoint (54.3057 56.3043 78.9999) so I don"t know which tag from dicom hearder is used and how it will be done.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu DICOM Format finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 6 Dez. 2019

Kommentiert:

Rik
am 8 Dez. 2019

Community Treasure Hunt

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

Start Hunting!

Translated by