java versus macro recording on hyperstack transformation

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

java versus macro recording on hyperstack transformation

CARL Philippe (LBP)
Dear all,
I would like to make a stack to hyperstack transformation of RGB pictures in
java.
And in the case I use the macro recorder set on java, I get the following
command line:
        StackImp2 = HyperStackConverter.toHyperStack(StackImp, 1, 2,
2, "Color");
Which once run gives me then the exception message found at the line 59 of
the ij.plugin.HyperStackConverter.java file.
Alternatively, if I use the recorder in macro mode I get the following
command line:
        run("Stack to Hyperstack...", "order=xyczt(default) channels=1
slices=2 frames=2 display=Color");
that I can then successfully transform into:
        IJ.run("Stack to Hyperstack...", "order=xyczt(default) channels=1
slices=2 frames=2 display=Color");
But I would like to understand the code that is actually run by the "Stack
to Hyperstack..." menu which I'm not able to figure out.
Especially the only reference I found to "Stack to Hyperstack..." is on the
line 338 of the IJ.java file with:
        commandTable.put("Stack to HyperStack...", "Stack to
Hyperstack...");
and no further connection with the code used behind.
I thank you very much in advance for your lightings.
My best regards,
Philippe

Philippe CARL
Laboratoire de Bioimagerie et Pathologies
UMR 7021 CNRS - Université de Strasbourg
Faculté de Pharmacie
74 route du Rhin
67401 ILLKIRCH
Tel : +33(0)3 68 85 41 84

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

Re: java versus macro recording on hyperstack transformation

Wayne Rasband-2
> On May 3, 2019, at 3:54 AM, Philippe CARL <[hidden email]> wrote:
>
> Dear all,
> I would like to make a stack to hyperstack transformation of RGB pictures in
> java.
> And in the case I use the macro recorder set on java, I get the following
> command line:
> StackImp2 = HyperStackConverter.toHyperStack(StackImp, 1, 2,
> 2, "Color");
> Which once run gives me then the exception message found at the line 59 of
> the ij.plugin.HyperStackConverter.java file.

This bug is fixed in the latest ImageJ daily build (1.52p16). Here is a small script that reproduces the bug:

  imp = IJ.openImage("http://wsr.imagej.net/images/flybrain.zip");
  imp2 = HyperStackConverter.toHyperStack(imp, 1, 19, 3, "Color");
  imp2.show();

-wayne


> Alternatively, if I use the recorder in macro mode I get the following
> command line:
> run("Stack to Hyperstack...", "order=xyczt(default) channels=1
> slices=2 frames=2 display=Color");
> that I can then successfully transform into:
> IJ.run("Stack to Hyperstack...", "order=xyczt(default) channels=1
> slices=2 frames=2 display=Color");
> But I would like to understand the code that is actually run by the "Stack
> to Hyperstack..." menu which I'm not able to figure out.
> Especially the only reference I found to "Stack to Hyperstack..." is on the
> line 338 of the IJ.java file with:
> commandTable.put("Stack to HyperStack...", "Stack to
> Hyperstack...");
> and no further connection with the code used behind.
> I thank you very much in advance for your lightings.
> My best regards,
> Philippe

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

Re: java versus macro recording on hyperstack transformation

CARL Philippe (LBP)
Dear Wayne,
Thanks a lot for your, as always, very fast and efficient answer!
Have a nice week-end.
Kindest regards,
Philippe

Le Vendredi 3 Mai 2019 20:30 CEST, Wayne Rasband <[hidden email]> a écrit:

> > On May 3, 2019, at 3:54 AM, Philippe CARL <[hidden email]> wrote:
> >
> > Dear all,
> > I would like to make a stack to hyperstack transformation of RGB pictures in
> > java.
> > And in the case I use the macro recorder set on java, I get the following
> > command line:
> > StackImp2 = HyperStackConverter.toHyperStack(StackImp, 1, 2,
> > 2, "Color");
> > Which once run gives me then the exception message found at the line 59 of
> > the ij.plugin.HyperStackConverter.java file.
>
> This bug is fixed in the latest ImageJ daily build (1.52p16). Here is a small script that reproduces the bug:
>
>   imp = IJ.openImage("http://wsr.imagej.net/images/flybrain.zip");

>   imp2 = HyperStackConverter.toHyperStack(imp, 1, 19, 3, "Color");

>   imp2.show();
>
> -wayne
>
>
> > Alternatively, if I use the recorder in macro mode I get the following
> > command line:
> > run("Stack to Hyperstack...", "order=xyczt(default) channels=1> slices=2 frames=2 display=Color");
> > that I can then successfully transform into:
> > IJ.run("Stack to Hyperstack...", "order=xyczt(default) channels=1
> > slices=2 frames=2 display=Color");
> > But I would like to understand the code that is actually run by the "Stack
> > to Hyperstack..." menu which I'm not able to figure out.
> > Especially the only reference I found to "Stack to Hyperstack..." is on the
> > line 338 of the IJ.java file with:
> > commandTable.put("Stack to HyperStack...", "Stack to
> > Hyperstack...");
> > and no further connection with the code used behind.
> > I thank you very much in advance for your lightings.
> > My best regards,
> > Philippe
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html





--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html