Login  Register

Re: Batch processes through plugins

Posted by Aryeh Weiss on Aug 06, 2015; 3:59am
URL: http://imagej.273.s1.nabble.com/Batch-processes-through-plugins-tp5013914p5013917.html

On 8/5/15 10:34 PM, jswalker wrote:

> Hi all,
>
> I'm trying to do a couple operations on many files in a folder, but these
> operations must be done through plugins (eg BioFormats, or ND2Reader).
>
> The recorder spits this out:
>
> run("Bio-Formats Importer", "open=[C:\\file\\path\\file.tif]
> insertoptionshere");
>
> How do I make this perform the same action on all files in a list? I
> understand how to do this when I'm not doing it through a plugin -- my
> question is specifically about doing this within the plugin syntax shown
> above.
You can get your file list and insert the string variables into the
argument string, Here is an example from something I wrote:

run("Bio-Formats Importer", "open=["+inputPath+"] autoscale
color_mode=Default view=Hyperstack stack_order=XYCZT series_"+d2s(j,0));

your argument list will look different, but the idea is the same. In my
example, I have variable for the input path (a complete path to my
file). Since I needed to loop over a set of fields in a multifield
image, I also have  "series_"+d2s(j,0) which constructs the correct
argument to get a particular field (i is a loop variable)

hope this helps
--aryeh




> I'm working with the following script:
>
>
>
> I've tried universalizing the line that the recorder spits out, but it gives
> me an error.
>
> I tried looking for this in the archives but may have been using the wrong
> search terms -- sorry if so. Many thanks in advance!
>
>
>
> --
> View this message in context: http://imagej.1557.x6.nabble.com/Batch-processes-through-plugins-tp5013914.html
> Sent from the ImageJ mailing list archive at Nabble.com.
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>


--
Aryeh Weiss
Faculty of Engineering
Bar Ilan University
Ramat Gan 52900 Israel

Ph:  972-3-5317638
FAX: 972-3-7384051

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