I’ve generated a 3D shell of the left ventricle of a heart using the IGT → Markups to Model module. I
have fiducial points marked in the model that correspond to points of scientific interest in an excised heart.
I want to cut planes in 5mm intervals from apex to base in the model. I have cut the excised heart in 5mm increments from apex to base and want to eventually figure out in which slice # I can find respective fiducial points.
You can simply use the divide the third (S) coordinate of the fiducial point coordinate to get the slice index. If you use oblique slices (not aligned to patient axes directions) then you can apply a linear transform first that transforms the point coordinates to this rotated coordinate system and use these transformed coordinate values.
Thank you for your answer! I’m not certain I completely understand, is there any documentation or examples for performing this divide? What modules would accomplish this?
I will definitely need to perform a linear transformation but am already comfortable with that aspect.
No modules are needed, you should be able to implement what you need with a couple of lines of Python code, in a Slicer Jupyter notebook or just by copy-pasting the code into the Python console in Slicer. The division is just a simple division of a number (third coordinate value) by another (interval of 5mm).
Gotcha, in which case I have a more rudimentary question since I have not interacted with the python side of this.
How do I export my model to python? I have thus far created this all with the GUI.
How do I establish the apex of this model in the code? I’m guessing that this matrix will be part of the code and I’ll just the minimum value of the relevant plane and go from there?
All the models are already “in Python”. If you want to get point coordinates as numpy array then you can use slicer.util.arrayFromModelPoints(). You can get minimum coordinate value using standard numpy functions (for example, min). There are lots of examples in the script repository.