Login  Register

Re: Bioformats importer in macro

Posted by Aryeh Weiss on May 11, 2017; 4:51am
URL: http://imagej.273.s1.nabble.com/Bioformats-importer-in-macro-tp5018696p5018698.html

On 11/05/2017 0:11, Curtis Rueden wrote:

> Hi Ed,
>
>> Is there a parameter that will open all series?
> Yes, the "Open all series" option.
>
> This records to macro something like:
>
>     run("Bio-Formats", "open=" + myFile + " autoscale color_mode=Default
> open_all_series rois_import=[ROI manager] view=Hyperstack
> stack_order=XYCZT");
>
> If you need to customize which series get opened in a dynamic way, you can
> use the Bio-Formats Macro Extensions to get the number of series via
> the Ext.getSeriesCount(seriesCount) command. From that, you could
> concatenate a string variable in a loop to build up which series get
> included.
Here is an example of what Curtis suggested:

// The Bio-Formats extensions enable us to get the image dimensions,
number of series
// and other metadata without actually opening the images.
run("Bio-Formats Macro Extensions");
Ext.setId(inputPath);

Ext.getSeriesCount(seriesCount);
print(seriesCount);

Ext.getSizeX(sizeX);
Ext.getSizeY(sizeY);
Ext.getPixelType(pixelType);

// j is a loop variable -- I was opening each series in a loop to
individually process each series
run("Bio-Formats Importer", "open=["+inputPath+"] autoscale
color_mode=Default view=Hyperstack stack_order=XYCZT series_"+d2s(j,0));

inputId = getImageID();    // always grab the ID and title of the opened
image


Best regards
--aryeh

> Regards,
> Curtis
>
> --
> Curtis Rueden
> LOCI software architect - https://loci.wisc.edu/software
> ImageJ2 lead, Fiji maintainer - https://imagej.net/User:Rueden
> Did you know ImageJ has a forum? http://forum.imagej.net/
>
>
> On Wed, May 10, 2017 at 4:00 PM, Ed Siefker <[hidden email]> wrote:
>
>> I would like to import a multi scene .czi file into ImageJ with a macro.
>> I can't predict the number of series in the file.
>>
>> When using the GUI there is a "select all" function.  Looking at the
>> macro recorder, it passes a parameter for each series.  Since I can't
>> predict the number of series, I can't pass a parameter for each.
>>
>> Is there a parameter that will open all series?
>> -Ed
>>
>> --
>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>>
> --
> 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