# user matrix on vtk reslice cursor widget

**URL:** https://discourse.vtk.org/t/user-matrix-on-vtk-reslice-cursor-widget/2981
**Category:** Support
**Created:** [April 8, 2020, 10:50am UTC](https://discourse.vtk.org/t/user-matrix-on-vtk-reslice-cursor-widget/2981 "2020-04-08T10:50:50Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![tom1](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/t/b487fb/32.png) [@tom1](https://discourse.vtk.org/u/tom1)
#### Post date: [April 8, 2020, 10:50am UTC](https://discourse.vtk.org/t/user-matrix-on-vtk-reslice-cursor-widget/2981/1 "2020-04-08T10:50:50Z")

</div>

Hi, VTK experts.

I am trying to setup a reslice cursor widget with a user matrix.  
Currently, I am trying to assign the user matrix to the reslice cursor line representation, which I set to the rsc widget.  
In result, the user matrix is applied on all actors/pops (axis lines and texture plane). Unfortunately, the appearance and interaction is not as expected. First, axis and the textured plane are not centered in the render window. Second, the visible axis do not trigger any events, but there are some invisible axis (centered in the render window) that work.  
How can I achive that the user matrix is not just applied on the actors, but is also considered on interaction? What do I miss?

Thanks, Tom.

---

<div class="post-metadata">

### Author: ![tom1](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/t/b487fb/32.png) [@tom1](https://discourse.vtk.org/u/tom1)
#### Post date: [April 8, 2020, 12:01pm UTC](https://discourse.vtk.org/t/user-matrix-on-vtk-reslice-cursor-widget/2981/2 "2020-04-08T12:01:10Z")

</div>

I have attached some code from a previous post, where I added a simple translation-user matrix.  
[TestResliceCursorV2.java](https://discourse.vtk.org/uploads/short-url/rMTUo4VJzuHaJPTqX1Nly36yAJs.java) (4.8 KB)

The setup is: Win10 x64, Java 1.8.202, JOGAMP 2.3.2.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [April 8, 2020, 12:06pm UTC](https://discourse.vtk.org/t/user-matrix-on-vtk-reslice-cursor-widget/2981/3 "2020-04-08T12:06:19Z")

</div>

User transforms are not recommended. [https://gitlab.kitware.com/vtk/vtk/issues/17807](https://gitlab.kitware.com/vtk/vtk/issues/17807) @ken-martin

---

<div class="post-metadata">

### Author: ![tom1](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/t/b487fb/32.png) [@tom1](https://discourse.vtk.org/u/tom1)
#### Post date: [April 8, 2020, 12:21pm UTC](https://discourse.vtk.org/t/user-matrix-on-vtk-reslice-cursor-widget/2981/4 "2020-04-08T12:21:43Z")

</div>

Hi, Ben.  
I read some pdf that explicitly recommended that approach in order to “undo” flips and other transforms with the renderer.  
If you advise not to use the user matrix or user transform, what would be the approch to apply the transform, w/o reformatting (or even resampling) the raw data array?

Thanks,  
Tom

---

<div class="post-metadata">

### Author: ![tom1](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/t/b487fb/32.png) [@tom1](https://discourse.vtk.org/u/tom1)
#### Post date: [April 8, 2020, 12:48pm UTC](https://discourse.vtk.org/t/user-matrix-on-vtk-reslice-cursor-widget/2981/5 "2020-04-08T12:48:52Z")

</div>

To be more precise. My biggest concern are reflections/mirroring along one axis. If I decompose the user matrix I know which axis are flipped. Can I utilize the camera (interactor style) to undo them?

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [April 8, 2020, 1:39pm UTC](https://discourse.vtk.org/t/user-matrix-on-vtk-reslice-cursor-widget/2981/6 "2020-04-08T13:39:32Z")

</div>

Ah, maybe the use cases aren’t as similar as I thought at first. Ken would know better here.
