How to go from a coordinate in a 3D slicer software to a coordinate on the new STL

7 vues (au cours des 30 derniers jours)
Andrew
Andrew le 13 Nov 2023
Réponse apportée : Anurag le 24 Nov 2023
I was wanting to take a 3D image and use a 3D slicer tool (ITKSNAP, 3D Object Slicer, or any other reccomended software) to obtain a new mesh file.
How could I design a pipeline to go from a coordinate of a specific pixel in a 3D image to identifying the coordinates of the same pixel on a mesh generated from the original 3D image?
Thanks

Réponses (1)

Anurag
Anurag le 24 Nov 2023
Hi Andrew,
I understand that you want to generate and identify the coordinates of 3D of pixels on a mesh generated from the original 3D image.
Refer to the pipeline below for doing the same:
  • Acquire your 3D image and use segmentation tools to segment the region of interest containing the structure you are interested in.
  • Generate mesh. In MATLAB you can use “generateMesh” for that.
  • Use the transformation matrix to transform the pixel coordinates from the image space to the mesh space.
Example in MATLAB using NIfTL Header information:
% Load NIfTI image
image = load_nii('path/to/your/image.nii');
% Voxel coordinates
voxel_coords = [i, j, k];
% Apply transformation to get physical world coordinates
world_coords = image.hdr.hist.qform * [voxel_coords, 1]';
In this example, image.hdr.hist.qform is the transformation matrix stored in the NIfTI header.
"World_coords" now represent the physical world coordinates.
Hope this helps!
Regards,
Anurag
Please refer to the below documentation to know more about the “generateMesh” and further readings:

Catégories

En savoir plus sur 3-D Volumetric Image Processing dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by