Help! Block Dialog Boxes in Macro

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

Help! Block Dialog Boxes in Macro

Jacob Keller
Hi All,

this is killing my macro--is there any way to block the dialogs from
coming up when opening images? I read the documentation, and it
doesn't seem that this should happen. I've tried batch mode as well,
to no avail.

JPK

--
*******************************************
Jacob Pearson Keller, PhD
Postdoctoral Associate
HHMI Janelia Farms Research Campus
email: [hidden email]
*******************************************

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

Re: Help! Block Dialog Boxes in Macro

ctrueden
Hi Jacob,

Can you send an example macro that demonstrates the issue?

-Curtis


On Tue, Jan 15, 2013 at 4:08 PM, Jacob Keller <
[hidden email]> wrote:

> Hi All,
>
> this is killing my macro--is there any way to block the dialogs from
> coming up when opening images? I read the documentation, and it
> doesn't seem that this should happen. I've tried batch mode as well,
> to no avail.
>
> JPK
>
> --
> *******************************************
> Jacob Pearson Keller, PhD
> Postdoctoral Associate
> HHMI Janelia Farms Research Campus
> email: [hidden email]
> *******************************************
>
> --
> 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: Help! Block Dialog Boxes in Macro

Jacob Keller
Here's the [probably poorly-written] code for the macro.

JPK



   for (i=0; i<10; i++) {
   for (j=0; j<10; j++) {
   for (k=0; k<10; k++) {
one = d2s(i, 0);
two = d2s(j, 0);
thr = d2s(k, 0);
setBatchMode(true);
filename = "C:\\Users\\Jacob\\Desktop\\ZfishBrains\\SPC00_TM00"+one+two+thr+"_ANG000_CM0_CHN00_PH0.jp2";
print(filename);
open(filename);
saveAs("Tiff", "X:\\Zebrafish_Brain_Images\\tifs\\SPC00_TM00"+one+two+thr+"_ANG000_CM0_CHN00_PH0x.tif");
close();
   }}}


On Tue, Jan 15, 2013 at 5:13 PM, Curtis Rueden <[hidden email]> wrote:

> Hi Jacob,
>
> Can you send an example macro that demonstrates the issue?
>
> -Curtis
>
>
> On Tue, Jan 15, 2013 at 4:08 PM, Jacob Keller <
> [hidden email]> wrote:
>
>> Hi All,
>>
>> this is killing my macro--is there any way to block the dialogs from
>> coming up when opening images? I read the documentation, and it
>> doesn't seem that this should happen. I've tried batch mode as well,
>> to no avail.
>>
>> JPK
>>
>> --
>> *******************************************
>> Jacob Pearson Keller, PhD
>> Postdoctoral Associate
>> HHMI Janelia Farms Research Campus
>> email: [hidden email]
>> *******************************************
>>
>> --
>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>>
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html



--
*******************************************
Jacob Pearson Keller, PhD
Postdoctoral Associate
HHMI Janelia Farms Research Campus
email: [hidden email]
*******************************************

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

Re: Help! Block Dialog Boxes in Macro

Jacob Keller
Maybe it has something to do with the source files being
z-slice-stacks themselves and not individual images? But manually this
works fine....

JPK

On Tue, Jan 15, 2013 at 6:23 PM, Jacob Keller
<[hidden email]> wrote:

> Here's the [probably poorly-written] code for the macro.
>
> JPK
>
>
>
>    for (i=0; i<10; i++) {
>    for (j=0; j<10; j++) {
>    for (k=0; k<10; k++) {
> one = d2s(i, 0);
> two = d2s(j, 0);
> thr = d2s(k, 0);
> setBatchMode(true);
> filename = "C:\\Users\\Jacob\\Desktop\\ZfishBrains\\SPC00_TM00"+one+two+thr+"_ANG000_CM0_CHN00_PH0.jp2";
> print(filename);
> open(filename);
> saveAs("Tiff", "X:\\Zebrafish_Brain_Images\\tifs\\SPC00_TM00"+one+two+thr+"_ANG000_CM0_CHN00_PH0x.tif");
> close();
>    }}}
>
>
> On Tue, Jan 15, 2013 at 5:13 PM, Curtis Rueden <[hidden email]> wrote:
>> Hi Jacob,
>>
>> Can you send an example macro that demonstrates the issue?
>>
>> -Curtis
>>
>>
>> On Tue, Jan 15, 2013 at 4:08 PM, Jacob Keller <
>> [hidden email]> wrote:
>>
>>> Hi All,
>>>
>>> this is killing my macro--is there any way to block the dialogs from
>>> coming up when opening images? I read the documentation, and it
>>> doesn't seem that this should happen. I've tried batch mode as well,
>>> to no avail.
>>>
>>> JPK
>>>
>>> --
>>> *******************************************
>>> Jacob Pearson Keller, PhD
>>> Postdoctoral Associate
>>> HHMI Janelia Farms Research Campus
>>> email: [hidden email]
>>> *******************************************
>>>
>>> --
>>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>>>
>>
>> --
>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>
>
>
> --
> *******************************************
> Jacob Pearson Keller, PhD
> Postdoctoral Associate
> HHMI Janelia Farms Research Campus
> email: [hidden email]
> *******************************************



--
*******************************************
Jacob Pearson Keller, PhD
Postdoctoral Associate
HHMI Janelia Farms Research Campus
email: [hidden email]
*******************************************

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

Re: Help! Block Dialog Boxes in Macro

ctrueden
Hi Jacob,

Since you sent a very similar question to ome-users, I link to my reply
there:

http://lists.openmicroscopy.org.uk/pipermail/ome-users/2013-January/003491.html

For the ImageJ archives: the link above suggests two macros that may do the
job (batch conversion of all image files in a particular directory and/or
of a particular format), thus avoiding the original issue of blocking
dialog boxes.

As I wrote in the other thread:

Your macro looks OK to me. Using Plugins > Macros > Record I created a
similar macro (which uses the open() and saveAs() functions), and it works
without popping up any dialog boxes, even if the output image already
exists. So I am not sure what is causing your problem. That said, hopefully
one of the above macros will work for you and the issue will be moot.

Regards,
Curtis


On Tue, Jan 15, 2013 at 5:25 PM, Jacob Keller <
[hidden email]> wrote:

> Maybe it has something to do with the source files being
> z-slice-stacks themselves and not individual images? But manually this
> works fine....
>
> JPK
>
> On Tue, Jan 15, 2013 at 6:23 PM, Jacob Keller
> <[hidden email]> wrote:
> > Here's the [probably poorly-written] code for the macro.
> >
> > JPK
> >
> >
> >
> >    for (i=0; i<10; i++) {
> >    for (j=0; j<10; j++) {
> >    for (k=0; k<10; k++) {
> > one = d2s(i, 0);
> > two = d2s(j, 0);
> > thr = d2s(k, 0);
> > setBatchMode(true);
> > filename =
> "C:\\Users\\Jacob\\Desktop\\ZfishBrains\\SPC00_TM00"+one+two+thr+"_ANG000_CM0_CHN00_PH0.jp2";
> > print(filename);
> > open(filename);
> > saveAs("Tiff",
> "X:\\Zebrafish_Brain_Images\\tifs\\SPC00_TM00"+one+two+thr+"_ANG000_CM0_CHN00_PH0x.tif");
> > close();
> >    }}}
> >
> >
> > On Tue, Jan 15, 2013 at 5:13 PM, Curtis Rueden <[hidden email]>
> wrote:
> >> Hi Jacob,
> >>
> >> Can you send an example macro that demonstrates the issue?
> >>
> >> -Curtis
> >>
> >>
> >> On Tue, Jan 15, 2013 at 4:08 PM, Jacob Keller <
> >> [hidden email]> wrote:
> >>
> >>> Hi All,
> >>>
> >>> this is killing my macro--is there any way to block the dialogs from
> >>> coming up when opening images? I read the documentation, and it
> >>> doesn't seem that this should happen. I've tried batch mode as well,
> >>> to no avail.
> >>>
> >>> JPK
> >>>
> >>> --
> >>> *******************************************
> >>> Jacob Pearson Keller, PhD
> >>> Postdoctoral Associate
> >>> HHMI Janelia Farms Research Campus
> >>> email: [hidden email]
> >>> *******************************************
> >>>
> >>> --
> >>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
> >>>
> >>
> >> --
> >> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
> >
> >
> >
> > --
> > *******************************************
> > Jacob Pearson Keller, PhD
> > Postdoctoral Associate
> > HHMI Janelia Farms Research Campus
> > email: [hidden email]
> > *******************************************
>
>
>
> --
> *******************************************
> Jacob Pearson Keller, PhD
> Postdoctoral Associate
> HHMI Janelia Farms Research Campus
> email: [hidden email]
> *******************************************
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

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