Select channel to open using Bioformats and Jython

Hi all,

I’m trying to rewrite a macro in Jython. The macro uses Bioformats then duplicate only one channel.

I was wondering if it was possible to tell Bioformats to only open the 1st channel or the 2nd channel ?
That would allow to speed up the process and take less memory for some big data.

I saw that there was setCBegin(int s, int value) and setCEnd(int s, int value), would that be a solution ? If so, what is s in that case ?


Dear @lguerard,
I’ve implemented something like that using the ImporterOptions api

with the Loci plugins BF api

this is a little snippet that I hope that could help you:

from loci.plugins import BF
from import ImporterOptions

options = ImporterOptions()
options.setCBegin(s, c)

imps = BF.openImagePlus(options)

I hope this will help you,
have a nice day
Emanuele Martini

1 Like

Dear @emartini,

Thanks ! So I was in the good direction ! :slight_smile:

About the snippet, I guess that to keep only the 1st channel, c would be 1, but what is s ?

Thanks again for your help !
Have a nice day.

eheh sorry…
my acquisition had more than one series so you have to specify which series as an integer number you want to open.

1 Like

S for series, makes sense, I didn’t even think of it ! :smiley:

Thanks a lot, that works ! :slight_smile:

Have a very nice day.

Stumbled upon this while trying to understand what this elusive ‘s’ is! Wish it was bit clearer in the API documentation! Thank you :slight_smile:

1 Like