Hi,
I have a number of meshes (corresponding to bones on CT images) on which I want to apply particle optimization. When I load the meshes in the Shapeworks studio, align them using ICP (only used grooming step) and then do particle optimization, the saved local particles will match the CT images (correspond to the correct location). !!! = wanted outcome, this functions perfectly !!!
The problem that I have is that when I try to do the same in Python (first do a rigid transform as grooming step and then do the particle optimization), neither the local or world particles will match the CT images. I’ve tried several things to solve this, but can’t find the problem as I think that the same things are done as in ShapeworksStudio.
Therefore I was wondering what the problem could be. I can provide you the full code, but here is already some more inforation on the Python code:
- The original meshes are set in Python using: subject.set_original_filenames(rel_mesh_files)
→ should correspond to the meshes I normally load into ShapeworksStudio - The groomed meshes are found by applying finding a rigid transformation and then saved and set as groomed meshes using: subject.set_groomed_filenames(rel_groom_files).
→ should correspond to the grooming step in ShapeworksStudio using the ICP - The rigid transformations are also saved and set using:
transform = [train_rigid_transforms[i].flatten()]
subject.set_groomed_transforms(transform)
→ defines transformation between local and world particles I think?
UPDATE:
After an extra check, I saw that the local particles indeed do not match the position of the original meshes when using the Python code. When using ShapeworksStudio they do.
So I guess there must be a problem doing the world to local particle transformation, but I have no idea where the problem is located.
If anyone can help, I would be very glad!
Thanks in advance