I tried to apply a transform matirx to specific slice view. For example…
I have volume or model data A, B, C, D, and a transform matrix T (non-linear). I want to apply T only in the Red View and not in the Yellow and Green views.
The easiest way would be to copy A, B, C, D to create A’, B’, C’, D’, and then apply T to display them in the red view. However, this doesn’t seem efficient.
I don’t think there’s a way to only apply the transform in one view currently, although it’s conceivable that this could be added as a per-view display node option.
If this is all under the control of your custom code, then managing copies of the nodes is probably the easiest and depending on the application the extra data may not be a practical issue. Or if the memory overhead is too great then another option could be to share the underlying vtkImageData or vtkPolyData between multiple nodes - we don’t usually do this but I believe it should work.
I tried to solve this issue through copying, but it seems too cumbersome to manage the data as there are over 10 nodes to copy, and all these nodes need to be synced.
Therefore, I’m considering implementing the application of gridTransform only to specific views. It seems applying module transform to the vtkactor entering that view would suffice, but is there a way to implement this?
If so, would it require modifying the slicer source?
Hi @park - Yes, it makes sense that keeping nodes in sync would involve a lot of bookkeeping. It’s probably doable with the right abstraction but may not be worth it for you.
Updating the slice display to enable/disable specific transforms is also possible. It would involve updates to the C++ implementation, but since you have a custom app you have this option. It would be best to follow the example of the other view-specific display options, perhaps generalizing to have multiple transform nodes just as there are multiple display nodes curently.
Hello @park
Please, can you tell me which version of Slicer are you using?
I used to have the “Apply Matrix” extension on Slicer 4.0.0. But now that I am using Slicer 5.6.0 I can’t install the extension.