Filename problem leading to exception in latest Bioformat ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Filename problem leading to exception in latest Bioformat ?

lechristophe
Hi,

My macros that use the BioFormat macro extensions stopped working lately. I
finally got some time to try to narrow the problem and it was actually quite
puzzling. I finally isolated a minimal set of images and a test macro that
reproduce the problem. I'm using the latest (updated) Fiji with its current
BioFormats version, which is dev 4.2 rev 7334 (6 dec. 2010), under OSX
10.6.5 Java 1.6.0_22 (64bits).

The files necessary to reproduce the bug are available in this archive zip:
http://www.cleterrier.net/up/BioFormats_Filename.zip

Just run the Test.ijm macro, point it to the "Test Images" folder. It will
get the file name for the three images inside the folder and open it using
BioFormats through the macro extensions interface. It will progress through
the images but will throw an error message that I captured in Error.png (it
is a non-text window where you cannot copy and paste the text,
unfortunately).

Here is the text of the macro :

DIR_PATH=getDirectory("Select a directory");
ALL_NAMES=getFileList(DIR_PATH);
for (i=0; i<ALL_NAMES.length; i++) {
 run("Bio-Formats Macro Extensions");
FILE_PATH=DIR_PATH+ALL_NAMES[i];
 Ext.setId(FILE_PATH);
run("Bio-Formats Importer", "open=["+ FILE_PATH + "] " + "view=[Standard
ImageJ]" + " stack_order=Default split_channels ");
}


What I understand is that the three images are named 16.tif, 17.tif and
26.tif in the folder. For some reason BioFormats interprets that as a
logical serie of names and throws an error at the Ext.setId() instruction
because it expects for a fourth image called 27.tif that doesn't exist. In
fact the error appears for any combination of numbered images that have N,
N+1 and N+10 as indexes.

Is there something wrong in the code or some new option that I've missed and
that has to be taken care of when using Ext.setId() ? Thanks for your help
in solving this.

Christophe
Reply | Threaded
Open this post in threaded view
|

Re: Filename problem leading to exception in latest Bioformat ?

Melissa Linkert-2
Hi Christophe,

You can solve this problem by adding this line:

Ext.setGroupFiles("false");

right before Ext.setId(FILE_PATH).  That will disable the file grouping
logic, and so each file should be read individually.   If you still see
an error message after adding that line, please let us know.

Regards,
-Melissa

On Fri, Dec 17, 2010 at 06:09:14AM +0100, Christophe Leterrier wrote:

> Hi,
>
> My macros that use the BioFormat macro extensions stopped working lately. I
> finally got some time to try to narrow the problem and it was actually quite
> puzzling. I finally isolated a minimal set of images and a test macro that
> reproduce the problem. I'm using the latest (updated) Fiji with its current
> BioFormats version, which is dev 4.2 rev 7334 (6 dec. 2010), under OSX
> 10.6.5 Java 1.6.0_22 (64bits).
>
> The files necessary to reproduce the bug are available in this archive zip:
> http://www.cleterrier.net/up/BioFormats_Filename.zip
>
> Just run the Test.ijm macro, point it to the "Test Images" folder. It will
> get the file name for the three images inside the folder and open it using
> BioFormats through the macro extensions interface. It will progress through
> the images but will throw an error message that I captured in Error.png (it
> is a non-text window where you cannot copy and paste the text,
> unfortunately).
>
> Here is the text of the macro :
>
> DIR_PATH=getDirectory("Select a directory");
> ALL_NAMES=getFileList(DIR_PATH);
> for (i=0; i<ALL_NAMES.length; i++) {
>  run("Bio-Formats Macro Extensions");
> FILE_PATH=DIR_PATH+ALL_NAMES[i];
>  Ext.setId(FILE_PATH);
> run("Bio-Formats Importer", "open=["+ FILE_PATH + "] " + "view=[Standard
> ImageJ]" + " stack_order=Default split_channels ");
> }
>
>
> What I understand is that the three images are named 16.tif, 17.tif and
> 26.tif in the folder. For some reason BioFormats interprets that as a
> logical serie of names and throws an error at the Ext.setId() instruction
> because it expects for a fourth image called 27.tif that doesn't exist. In
> fact the error appears for any combination of numbered images that have N,
> N+1 and N+10 as indexes.
>
> Is there something wrong in the code or some new option that I've missed and
> that has to be taken care of when using Ext.setId() ? Thanks for your help
> in solving this.
>
> Christophe
Reply | Threaded
Open this post in threaded view
|

Re: Filename problem leading to exception in latest Bioformat ?

lechristophe
That fixed the problem, thank you Melissa. Do you have a link to
documentation about the file grouping and its logic ?

Thanks,

Christophe

On Fri, Dec 17, 2010 at 17:30, Melissa Linkert
<[hidden email]>wrote:

> Hi Christophe,
>
> You can solve this problem by adding this line:
>
> Ext.setGroupFiles("false");
>
> right before Ext.setId(FILE_PATH).  That will disable the file grouping
> logic, and so each file should be read individually.   If you still see
> an error message after adding that line, please let us know.
>
> Regards,
> -Melissa
>
> On Fri, Dec 17, 2010 at 06:09:14AM +0100, Christophe Leterrier wrote:
> > Hi,
> >
> > My macros that use the BioFormat macro extensions stopped working lately.
> I
> > finally got some time to try to narrow the problem and it was actually
> quite
> > puzzling. I finally isolated a minimal set of images and a test macro
> that
> > reproduce the problem. I'm using the latest (updated) Fiji with its
> current
> > BioFormats version, which is dev 4.2 rev 7334 (6 dec. 2010), under OSX
> > 10.6.5 Java 1.6.0_22 (64bits).
> >
> > The files necessary to reproduce the bug are available in this archive
> zip:
> > http://www.cleterrier.net/up/BioFormats_Filename.zip
> >
> > Just run the Test.ijm macro, point it to the "Test Images" folder. It
> will
> > get the file name for the three images inside the folder and open it
> using
> > BioFormats through the macro extensions interface. It will progress
> through
> > the images but will throw an error message that I captured in Error.png
> (it
> > is a non-text window where you cannot copy and paste the text,
> > unfortunately).
> >
> > Here is the text of the macro :
> >
> > DIR_PATH=getDirectory("Select a directory");
> > ALL_NAMES=getFileList(DIR_PATH);
> > for (i=0; i<ALL_NAMES.length; i++) {
> >  run("Bio-Formats Macro Extensions");
> > FILE_PATH=DIR_PATH+ALL_NAMES[i];
> >  Ext.setId(FILE_PATH);
> > run("Bio-Formats Importer", "open=["+ FILE_PATH + "] " + "view=[Standard
> > ImageJ]" + " stack_order=Default split_channels ");
> > }
> >
> >
> > What I understand is that the three images are named 16.tif, 17.tif and
> > 26.tif in the folder. For some reason BioFormats interprets that as a
> > logical serie of names and throws an error at the Ext.setId() instruction
> > because it expects for a fourth image called 27.tif that doesn't exist.
> In
> > fact the error appears for any combination of numbered images that have
> N,
> > N+1 and N+10 as indexes.
> >
> > Is there something wrong in the code or some new option that I've missed
> and
> > that has to be taken care of when using Ext.setId() ? Thanks for your
> help
> > in solving this.
> >
> > Christophe
>