Closed topinfrassi01 closed 9 months ago
Applying transforms to an images/segmentations involves resampling the image into to the new space. The typical workflow for transforming based on the center of mass involves trying to center the desired object within the resulting image. The center of mass transform typically won't be translating by multiples of the unit spacing, so the resampling is probably going to produce some artifact at the edges (e.g. partial volume effect). Resampling it again back to the original space is going to give a very similar but likely slightly different image on the edges.
I suppose if you altered the transform to have x, y, and z values being an exact multiple of the image spacing, then you could probably do this exercise and get back the same result. This would not be possible with rotations from rigid transforms, the more common case.
Does that make sense?
Hi @akenmorris, thanks for your explanation I do understand. I think this issue can be closed as it answers my question :)
I'm using Image.createCenterOfMassTransformon a segmentation I loaded using shapeworks.Image(path).
I think there might be a problem in the code of applyTransform, however I'm not certain.
While we can see the differences are not so big, I don't understand why applying these two transforms one after another doesn't give back the same center of mass as before. Is there a problem with my understanding of the transforms API or is this a bug?