Export CT voxel data aligned with SAR/EM grid for use in Python
-
I am working with Sim4Life and exporting simulation results for analysis in Python.
I can successfully export SAR volumes and the corresponding grid coordinates. When I plot these in Python, they are correctly aligned. Inside Sim4Life, the SAR and CT images overlap perfectly.
But if I load the original DICOM CT outside of S4L (e.g. with SimpleITK), the CT and SAR do not overlap, origins and orientations differ. This makes me believe that Sim4Life uses its own internal coordinate system for CT, and I need to export the CT from S4L directly in that system (instead of reloading the raw DICOM).My questions are:
How can I export CT (HU values) with the proper coordinate system used inside S4L?
Either on its native voxel grid, Or resampled onto the EM/SAR grid (preferred for direct overlay).
What is the correct way in the Python API to access the CT voxel dataset from the project tree?Thank you in advance!
-
Sim4Life does not use any special coordinate system. It just correctly applies origin, spacing and orientation (a rotation matrix) as specified in the dicom/nifti (medical image) formats. When you extract a surface model Sim4Life preserves the correct global position by applying the origin, spacing/orientation. When the gridder/voxeler creates the simulation grid it is aligned but at a different resolution (spacing is different). Actually the gridder uses a rectilinear grid which is axis aligned, so you need to uses the axis information but the orientation is an identity matrix.
If you are using simple tools like matplotlib that take an image or array but are not aware of the underlying grid that defines the location and distribution of the fields/image values, you could interpolate one field (e.g. SAR) onto the grid of the other field (e.g. the CT image).
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login