Can't call 3D viewer static methods in macro

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Can't call 3D viewer static methods in macro

Steve Huntley
I get an error message whenever I try to use a macro to call a static
method in the 3D viewer plugin.  For example, after starting the 3d
viewer, trying to execute the following:

call("ImageJ_3D_Viewer.resetView");

leads to the following message in a popup window:

"Could not find the method resetView with 0 parameter(s) in class
ImageJ_3D_Viewer in line 1."

I am a beginner with ImageJ, and this is my first attempt at writing a
macro.  I am using Ubuntu Jaunty.  I just downloaded the latest release
of ImageJ for Linux bundled with Java from the ImageJ site, and replaced
the included ImageJ 3D Viewer plugin jar with the latest release from
the 3D Viewer site.

The 3D viewer plugin works fine when operated manually.  I can load,
display and manipulate an image stack in the viewer window.  I can also
run the command:

run("3D Viewer");

and the plugin viewer will start up.  But any attempt to call any of the
plugin's static methods from a macro results in an error message similar
to above.

What am I doing wrong?  Do I have to manipulate CLASSPATH values before
starting ImageJ?  Any help or hints would be appreciated, since my
project is dead in the water until I can get past this obstacle.

Thanks,
Steve Huntley
Reply | Threaded
Open this post in threaded view
|

Re: Can't call 3D viewer static methods in macro

Benjamin Schmid-2
Hi Stephen,

> I get an error message whenever I try to use a macro to call a
> static method in the 3D viewer plugin.  For example, after starting
> the 3d viewer, trying to execute the following:
>
> call("ImageJ_3D_Viewer.resetView");
>
> leads to the following message in a popup window:
>
> "Could not find the method resetView with 0 parameter(s) in class
> ImageJ_3D_Viewer in line 1."
>
[...]

The syntax for the macro support has changed slightly some time ago. The
above command would now read

call("ij3d.ImageJ3DViewer.resetView");

In general, all 'ImageJ_3D_Viewer' need to be replaced by
'ij3d.ImageJ3DViewer'.

By the way, you can check this also by starting the macro recorder and
manually perform a 'reset view'; it's recorded correctly.

Best wishes,
Bene