Posted by
ctrueden on
Jun 28, 2011; 4:39pm
URL: http://imagej.273.s1.nabble.com/problem-using-LOCI-tools-in-macro-tp3684104p3684107.html
Hi Aryeh,
I wonder if the macro extensions allow setting of these options.
>
Fairly recently, we updated the Bio-Formats Importer API to be more
powerful. From Java or a Java-based scripting language such as Javascript or
Beanshell, you can now write:
import loci.plugins.BF;
...
ImagePlus[] imps = BF.openImagePlus("/path/to/myfile");
for (ImagePlus imp : imps) imp.show();
This will open the given file using the default options, and display all
resultant ImagePlus objects. Or if you want to configure the options
yourself, you can write:
import loci.plugins.BF;
import loci.plugins.in.ImporterOptions;
...
ImporterOptions options = new ImporterOptions();
options.setId("/path/to/myfile");
options.setCrop(true);
options.setCropRegion(0, new Region(0, 0, 100, 120));
options.setColorMode(ImporterOptions.COLOR_MODE_COMPOSITE);
//...etc.
ImagePlus[] imps = BF.openImagePlus(options);
for (ImagePlus imp : imps) imp.show();
This should work from many of Fiji's scripting languages that utilize the
Java API. However, apart from the openImagePlus(String) method with default
settings, we have not updated the Bio-Formats macro extensions to support
this API in the ImageJ macro language.
-Curtis
On Tue, Jun 28, 2011 at 11:20 AM, Aryeh Weiss <
[hidden email]> wrote:
> On 6/28/11 6:14 PM, Martin Höhne wrote:
>
>> Aryeh,
>>
>> open a file with the LOCI-Bioformats importer while the macro recorder is
>> running. This will show how to use the command in a macro.
>>
>> I got this when selecting grayscale and split channels:
>>
>> run("Bio-Formats Importer", "open=[D:\\science\\slice1.**lsm]
>> color_mode=Grayscale split_channels view=Hyperstack stack_order=XYCZT");
>>
>>
> Thank you for your reply. This works. When I saw the macro extensions, I
> assumed that it had to done through them, but I see that I was wrong.
>
> I wonder if the macro extensions allow setting of these options.
>
> Regards,
>
> --aryeh
> --
> Aryeh Weiss
> School of Engineering
> Bar Ilan University
> Ramat Gan 52900 Israel
>
> Ph: 972-3-5317638
> FAX: 972-3-7384051
>