http://imagej.273.s1.nabble.com/Retrieving-value-from-IJ-runMacro-tp5018046p5018054.html
this is a strange way to get the dimension of an image. Why not use the
> Hello folks,
>
> Currently I am working on a plugin for ImageJ but I've gotten a bit stuck. I
> want to get the value of height and width of the currently selected window
> but I'm having some problems. Currently what my code looks like is this:
>
> String s2_strWidth = null;
> String s2_strHeight = null;
> int s2_width = 0;
> int s2_height = 0;
> s2_strWidth = IJ.runMacro("getWidth();");
> if(s2_strWidth != null) {
> s2_width = Integer.valueOf(s2_strWidth);
> IJ.log("Wait what's going on");
> }
> else {
> IJ.log("You are throwing an exception at s2_strWidth");
> return;
> }
> s2_strHeight = IJ.runMacro("getHeight();");
> if(s2_strHeight != null) {
> s2_height = Integer.valueOf(s2_strHeight);
> IJ.log("Wait what's going on");
> }
> else {
> IJ.log("You are throwing an exception at getHeight");
> return;
> }
>
> However, s2_strWidth and s2_strHeight are always returning null so I cannot
> physically get the value right now. I'm sure that I am missing something
> here that I need to get the values that I need. Can someone see what I am
> missing? Or is there a better way of trying to use IJ.runMacro ?
>
>
>
> --
> View this message in context:
http://imagej.1557.x6.nabble.com/Retrieving-value-from-IJ-runMacro-tp5018046.html> Sent from the ImageJ mailing list archive at Nabble.com.
>
> --
> ImageJ mailing list:
http://imagej.nih.gov/ij/list.html>