Operating system: Windows 10 Enterprise
Slicer version: 5.2.2
Expected behavior: Polygonal mesh data generated by segmentation/model generation of resampled volumetric data should have the same transform as the “parent” data
Actual behavior: The polygonal mesh data (.stl or .obj) generated/exported does not overlay the “source data”
I’m registering a collection of data that should overlap in space. The registration seems to work fine, and so I then resampled the registered data to generate new volumetric data that should share a common (overlapping) region in space.
When I visualize the resultant .nrrd files in ParaView they do indeed overlap in space. Great!
However, when I segment/model the resampled data in Slicer to generate polygon meshes, these meshes do not seem to inherit the same coordinate system; they do not overlap the source data when viewed in ParaView!
How do I make sure the polygon mesh data generated by segmentation/model generation of the resampled volumetric data actually inherits vertex positions that are commensurate with the resampled data? I would assume the vertex positions would be automatically transformed by whatever underlying transform is present in the volumetric data that was used to generate that model?
ParaView only shows 3D volumes in correct location in special cases (when IJK axes of the volumes have the same direction as LPS axes), so you cannot verify alignment of images and models in ParaView. The only software other than Slicer that quickly comes to mind that can load meshes and 3D volumes corectly is MITK.
If you have a model under a transform then saving the model will not apply the parent transform, because when you save a node you want that data saved, not some modified version of it. To get the transformed model into a file you can either:
A. Harden the transform on the model before saving
B. Do not save the model but export the transformed model: in Data module you can right-click on the node you want to export. choose “Export to file…” and check “Apply transforms”
Unfortunately, I have tried hardening the transforms to no avail.
I’ve also looked for the “Apply Transforms” option in “Export to file…” and the “Apply Transforms” option doesn’t seem to be present for any of the available export file formats. I went down the list selecting all of them and looking for an “Apply Transforms” option and none appeared. The only export option seemed to be “Compress” (see example screenshot below).
Can I simply create an empty volume via an axis-aligned region of interest? Presumably that would have a transform basically equivalent to the identity matrix, and then if I resample data via “Registration → Resample Image (BRAINS)” using that empty volume as the “Reference Image” I should end up with voxel data that’s all axis aligned and doesn’t then require any external software to understand any transform that needs to be applied to the data?
The only result I can find from a Google search regarding creation of an empty volume is this (using the “Image Maker” CLI extension):
… which I’d rather not do because I’m trying to keep this GUI based for future reference by other users.
There’s also this post from yourself back in 2018:
… but I’m not sure if that’s still valid. You did mention “We’ll figure out some way to not require this step (maybe create a blank volume), but right now you need to do this” and it seems you still need to do this five years later?
Do I have to create a suitable empty volume data set in e.g. FIJI and then load it into Slicer?
“Apply transform” option only appears if the node is under a transform.
If you hardened the transform (or exported with “apply transform” option) then it is all good, everything is in correct (LPS) coordinate system. You can confirm it by loading the data sets into Slicer or MITK. If you share your scene (upload somewhere and post the link here) then we can have a look, but based on what you described everything should be good.
Maybe the only thing that confuses you is that ParaView shows the volume in incorrect position. ParaView is great software for mesh visualization but 3D image and transforms support has serious limitations and bugs that have not been fixed for many years, so probably funding sources of ParaView are just not that interested these. If you work with 3D images then I would not recommend to rely too much on ParaView.