Login  Register

3D Viewer Transformations

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options Options
Embed post
Permalink
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

3D Viewer Transformations

Jürgen Gluch
Hi!
I want to apply transformations to an volume in 3d viewer from within a
macro. It works and I can rotate the selected volume around the Origin of
the volume. e.g. around the x-Axis:

// 1      0        0    0
// 0 cos(a) -sin(a) 0
// 0 sin(a)  cos(a) 0
// 0      0         0   1
call("ij3d.ImageJ3DViewer.applyTransform", "1 0 0 0 0 "+cos(a)+"
"+(-sin(a))+" 0 0 "+sin(a)+" "+cos(a)+" 0 0 0 0 1 ");

But how can I access the volume size or coordinates of the center to
calculate the affine matrix for rotation around the center from within the
macro?

JG

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: 3D Viewer Transformations

Jürgen Gluch
I got a reply from Benjamin Schmid directly and like to share it here for
completeness:

> But how can I access the volume size or coordinates of the center to
calculate
> the affine matrix for rotation around the center from within the macro?

This depends actually. Do you also add the volume via the macro? Then
you can get the center from the image you added:

getVoxelSize(pw, ph, pd, unit);
centerx = pw * getWidth();
centery = ph * getHeight();
centerz = pd * nSlices;

> Is it possible to get a list of visualized volumes and select them from a
> imagej macro?

Not yet, I can add that if you need it. You can select an object in the
3D Viewer using

call("ij3d.ImageJ3DViewer.select", nameOfObject);

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: 3D Viewer Transformations

zhifeng_sd
What do you mean?
Is it mean we can get the volume center or centroid from 3D Viewer ?

Then get the local coordinate system? How to do that?
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: 3D Viewer Transformations

zhifeng_sd
What do you mean?
Is it mean we can get the volume center or centroid from 3D Viewer ?

Then get the local coordinate system? How to do that?