Scripting the ZAxisProfiler

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

Scripting the ZAxisProfiler

Greg
Hi,

I was wondering if the ZProfiler API documentation/implementation is complete?

Starting from

https://imagej.nih.gov/ij/developer/api/ij/plugin/ZAxisProfiler.html

I always get a Java Null pointer exception when trying to run it e.g. like:

zprof = ZAxisProfiler()                                                          
zprof.getPlot()

which for me isn't suprising as there is no way of initialising it on an ImagePlus and Roi, or am I missing sth?

Best,
Greg

Reply | Threaded
Open this post in threaded view
|

Re: Scripting the ZAxisProfiler

Rasband, Wayne (NIH/NIMH) [E]
> On Nov 22, 2016, at 11:16 AM, Greg <[hidden email]> wrote:
>
> Hi,
>
> I was wondering if the ZProfiler API documentation/implementation is
> complete?
>
>
> Starting from
> https://imagej.nih.gov/ij/developer/api/ij/plugin/ZAxisProfiler.html
>
> I always get a Java Null pointer exception when trying to run it e.g. like:
>
> zprof = ZAxisProfiler()                                                          
> zprof.getPlot()
>
> which for me isn't suprising as there is no way of initialising it on an
> ImagePlus and Roi, or am I missing sth?

Thanks to Michael Schmid, the ZAxisProfiler in the latest ImageJ daily build (1.51i5) adds a static getPlot(ImagePlus) method. This JavaScript example shows how to use it:

  img = IJ.openImage("http://wsr.imagej.net/images/t1-head.zip");
  img.setRoi(100,84,86,66);
  plot = ZAxisProfiler.getPlot(img);
  plot.show();

For hyperstacks, there is a version of the method accepts a string argument that can be either “time” or “z-axis”. If the argument is omitted, the default is “time”. Here is an example:

  img = IJ.openImage("http://wsr.imagej.net/images/Spindly-GFP.zip");
  img.setRoi(61,92,51,39);
  plot = ZAxisProfiler.getPlot(img, "z-axis");
  plot.show();

-wayne




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