Possible bug in "Make Substack..."

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

Possible bug in "Make Substack..."

jbalsam
I have written a macro which works, but is slow. So I tried hiding all of the images using setBatchMode(true) and setBatchMode("exit and display") at the beginning and end of the code. However, when the code arrives at the first call to run("Make Substack..." --- it throws an error that says [Invalid input string: "1-5"]. This doesn't happen when I comment out the two lines for batch mode.

So, it seems to me that "Make Substack..." just doesn't play well with batch mode. I have searched for other mentions of this and haven't found anything.

-Josh
Reply | Threaded
Open this post in threaded view
|

Re: Possible bug in "Make Substack..."

LIM Soon Yew John (IMB)
Hi Josh,

I had also encounter a problem with macro "setBatchMode(true)" last week. Wayne had kindly fixed it in the daily build. Maybe you can try to update ImageJ to the daily build.

Best Regards,
John
________________________________________
From: ImageJ Interest Group [[hidden email]] On Behalf Of jbalsam [[hidden email]]
Sent: Friday, February 28, 2014 5:11 AM
To: [hidden email]
Subject: Possible bug in "Make Substack..."

I have written a macro which works, but is slow. So I tried hiding all of the
images using setBatchMode(true) and setBatchMode("exit and display") at the
beginning and end of the code. However, when the code arrives at the first
call to run("Make Substack..." --- it throws an error that says [Invalid
input string: "1-5"]. This doesn't happen when I comment out the two lines
for batch mode.

So, it seems to me that "Make Substack..." just doesn't play well with batch
mode. I have searched for other mentions of this and haven't found anything.

-Josh



--
View this message in context: http://imagej.1557.x6.nabble.com/Possible-bug-in-Make-Substack-tp5006704.html
Sent from the ImageJ mailing list archive at Nabble.com.

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

Re: Possible bug in "Make Substack..."

jbalsam
I figured out a work-around for the problem, but a problem still exists. Wayne emailed me directly about it, and I explained (I hope clearly enough) what the issue is. I am using 1.48r (updated this morning via the built-in update function).

"Make Substack..." works OK by itself in batch mode. The specific case with my macro was that it was trying to target a window that was just produced by the Concatenate function. For some reason that caused it to fail. My work-around was to "exit and display" from batch mode and then re-enter batch mode right after Concatenate finished and before "Make Substack" tried to find the new window. See here:

for (...){
... ... ...
selectImage(dataStack);
run("Make Substack...", "delete slices=1-"+nMed);
... ... ...
run("Concatenate...", "  title=["+dataStack+"] image1=["+dataStack+"] image2=["+subStack+"] image3=[-- None --]");
setBatchMode("exit and display");
setBatchMode(true);
}

Previously, I had setBatchMode("exit and display") outside of the for loop at the end. However with that setup, when the loop got back up to run("Make Substack...), Substack threw an error saying that the range I gave it was incorrect.
Reply | Threaded
Open this post in threaded view
|

Re: Possible bug in "Make Substack..."

Rasband, Wayne (NIH/NIMH) [E]
In reply to this post by jbalsam
On Feb 27, 2014, at 4:11 PM, jbalsam wrote:

> I have written a macro which works, but is slow. So I tried hiding all of the
> images using setBatchMode(true) and setBatchMode("exit and display") at the
> beginning and end of the code. However, when the code arrives at the first
> call to run("Make Substack..." --- it throws an error that says [Invalid
> input string: "1-5"]. This doesn't happen when I comment out the two lines
> for batch mode.
>
> So, it seems to me that "Make Substack..." just doesn't play well with batch
> mode. I have searched for other mentions of this and haven't found anything.

The latest ImageJ daily build (1.48s20) fixes a bug in the Image>Stacks>Tools>Make Substack command that caused it to fail in batch mode macros.

-wayne

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