Options for Bio-Formats windowless importer

I am using a slightly modified version of @bramalingam Omero-Imagej script " omero_batch_analysis.py" to batch fetch-and-process images from our OMERO server with Fiji.

As far as I understand, the original script uses the Bio-Formats windowless importer to import the images from OMERO into Fiji, see line 38 of the original script below:

def openImagePlus(HOST,USERNAME,PASSWORD,groupId,imageId):
    
    options = ""
        options += "location=[OMERO] open=[omero:server="
        options += HOST
        options += "\nuser="
        options += USERNAME
        options += "\npass="
        options += PASSWORD
        options += "\ngroupID="
        options += groupId
        options += "\niid="
        options += imageId
        options += "]"
        options += " windowless=true "
        
        IJ.runPlugIn("loci.plugins.LociImporter", options);

Since it is very important to control all options of the windowless importer in order to have a defined import, I tried to modify the code and to include all options:

def openImagePlus(HOST,USERNAME,PASSWORD,groupId,imageId):
    stackview = "viewhyperstack=true stackorder=XYCZT "
    datasetorg = "groupfiles=false swapdimensions=false openallseries=false concatenate=false stitchtiles=false"
    coloropt = "colormode=Default autoscale=true"
    metadataview = "showmetadata=false showomexml=false showrois=true setroismode=roimanager"
    memorymanage = "virtual=false specifyranges=false setcrop=false"
    split = "splitchannels=false splitfocalplanes=false splittimepoints=false"
    other = "windowless=true"
    options = ("location=[OMERO] open=[omero:server=%s\nuser=%s\npass=%s\ngroupID=%s\niid=%s] %s %s %s %s %s %s %s " %
    		   (HOST, USERNAME, PASSWORD, groupId, imageId, stackview, datasetorg, coloropt, metadataview, memorymanage, split, other ))
    IJ.runPlugIn("loci.plugins.LociImporter", options);

However, I just now noticed that for example “split” is silently ignored, i.e. if in a previous manual import or file opening this option was set to “true”, then it will stay that way and will not be set to “false” by my script.
I had a look at the API of the LociImporter that is used here but I could not figure out how to properly script all options.

tagging also @melissa since she is listed as the author of loci.plugins.LociImporter :slight_smile:
Thanks for your help!

You may get some insight by taking a look at the source code if you are so inclined:


1 Like

Hi @CellKai, when using the options manually like that you will want to use the Strings exactly as in the ImporterOptions https://github.com/openmicroscopy/bioformats/blob/develop/components/bio-formats-plugins/src/loci/plugins/in/ImporterOptions.java#L53.

So for the split options the Strings will be:

splitFocalPlanes
splitTimepoints
splitWindows         // This is split channels
1 Like

thank you @markkitt and @dgault! Thats the perfect answer, all options are clearly explained in the source code :slight_smile: