Is it possible to move and rotate a model in 3d view and get the transformtion matrix?

I can change the transformation matrix to make a model moves in 3d view.
But how can I do the opposite that move and rotate a model in 3d view and get its transformation matrix?
Any method or suggestion?
Thanks.

https://slicer.readthedocs.io/en/latest/user_guide/modules/transforms.html

Thank you pieper.
But I can’t understand.
In fact, the key of my problem is how I can move a model directly in the 3D view,not in the transformation panel.
Perhapes, it need a widget?

What do you mean by that? You can use the mouse clicks to rotate/translate a model in 3D view. But that only changes the angle camera is seeing the model. If you want to modify its orientation, you need to use the transforms module.

I think there’s no such feature available at the moment.
If I understood correctly, you would like to interact with the module similarly as you do with a markup list.

We achieve a similar behaviour with some custom models (e.g. screws), by reusing a set of slicer nodes (markuplist, model_nodes and tranformnodes), programming a custom object class (it requires a bit of programming).
We use a two-point markup list, aligned with the main direction of the model that we want to interact with, and linked the “markup modified event” to recompute a transform that is then applied automatically to the model node, any time one of the markups is updated.

It is a workaround for a similar behaviour I guess you want to achieve, but it requires to program that part.

Davide

Thank you muratmaga
Yes, I can change orientation of models with transform module. But it is uneasy to control. I want to design a cutting position with mouse in 3d view, and get the corresponding transform.

You understand me, Davide_Scorza.
I really want to know if there is an available module to do it.
Now that you’ve told me, I’m ready to program.
Sorry for my poor English.

I never find a way to do that easily with slicer, so I use to do a reslicing with the 3D MPR(multi planar rendering) tool in Horos, export the new set then import this volume to slicer, which give you the volume and the .h5 file which is the transform, you can just aply or harden, as you wish

Hello tdchen,
As per my knowledge, To extract a transformation matrix from a 3D model’s movement and rotation, track applied transformations programmatically or use 3D graphics libraries. In code, maintain variables for translation and rotation, composing them into a final matrix. In addition, leverage libraries with functions for model manipulation and matrix retrieval. Some 3D software offer APIs for direct access to transformation data. Choose the method based on project needs and development environment, ensuring efficiency and accuracy in representing the model’s position and orientation.

I hope this will help you.

Thanks
Emma wilson

If I understand correctly what you’d like to do, here are the steps:

  1. Turn on interactive transform for the model in the Data module (right click the eye not the name)
    image

  2. Transform the model using the controls

  3. See the matrix in the Transforms module
    image

You’ll need a recent 5.7 preview version to be able to access the new transform interactions.

1 Like

Yes, philippepellerin. We have plan that export data to other software and get the transformation.

Thanks for your suggestion, emmawilson.
I think Slicer must have the ability to realize your plan, and I need to find it.

Thank you for your feedback. I perfectly know this way, as well as in 2D using the interaction in the cross, which is very useful, but it is very difficult to get a new volume oriented as a series .dicom or.NRRD. It is much more convenient in Horos.
It depend what you want to do, if it is just to oriente the 3D use the cross interaction to get the plane you want, then draw a plane, it is efficient.

Great! That is what I want!
It appears in the document now.
But how did you find it? I have never installed the beta version.

Download the preview version from https://download.slicer.org/

That is a different function. Look at my screenshots please and you’ll see.

I am running 5.7.0, easily found; let me know if you have any problems. Are you specifically interested in drawing a reference plane? I can make a tutorial if you want.

Thank you cpinter.
I was using the stable version 5.2, and I found out it already have this feature, which I never noticed.

Thank you philippepellerin
Let me try it first and contact you if I have any questions.

Now, I understand what you told me.
Thanks.

You are right, muratmaga.
I should read the document carefully.
It is not a problem in slicer.