Bio-Formats Exporter not working properly, images mixed up

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Bio-Formats Exporter not working properly, images mixed up

Menelaos Symeonides
Hello,

Bio-Formats Exporter is exporting hyperstacks all mixed up when
exporting channels/slices/frames as individual files. There is some kind
of confusion going on as to which dimension is which, even if the source
hyperstack is correctly ordered and was even imported using Bio-Formats.

Fiji is 1.52c (up to date). My Bio-Formats version is
5.9.0-20180607.161801-5 (latest daily build). I reproduced this on two
different Windows 10 x64 computers, including on a fresh installation of
Fiji with no settings altered anywhere (which runs the released 5.8.2
version of Bio-Formats).

The slice label pattern under Configuration > General is set to default
(%c%z%t- %n), though I have tried altering it with no effect.

How to reproduce:

1. File > Open Samples > Mitosis (26 MB, 5D stack)

2. Execute the following macro to label slices according to their C/Z/T:


setFont("Arial bold",30,"antialiased");
setColor(65535);

for(z=1; z<=nSlices; z++){
     setSlice(z);
     Stack.getPosition(channel, slice, frame);
        drawString("C = " + channel, 20, 50);
        drawString("Z = " + slice, 20, 100);
        drawString("T = " + frame, 20, 150);
}


3. File > Save As, save the labeled file as a single TIFF hyperstack
(not using BF), then close the file.

4. Plugins > Bio-Formats > Bio-Formats Importer, select the labeled TIFF
hyperstack, make sure Hyperstack is selected at the top left of the
dialog and nothing else is checked. View in grayscale mode and scroll
through various slices/channels to verify that it has been loaded
correctly, which it should.

5. Plugins > Bio-Formats > Bio-Formats Exporter, create a folder to put
the images into, name the file mitosis_labeled, change file type to
TIFF, then in the popup dialog check all 4 boxes (write each Z/C/T to a
separate file, and use zero padding). Click OK and then again OK to
export as Uncompressed with ROIs (doesn't matter).

6. Navigate to the folder where the individual slices were saved, and
pick any file and open in Fiji (not as a sequence). The filename of that
image should correspond to the actual labels visible in the image, but
they do not. E.g. the Z0_C0_T18 filename actually shows up as C=1, Z=5,
T=2 in the image, or the Z2_C1_T49 filename shows up as C=1, Z=3, T=31,
obviously these are wrong.

7. To verify that the file was exported incorrectly, re-import with BF
(Plugins > Bio-Formats > Bio-Formats Importer) and check "Group files
with similar names" to import the sequence, click OK through the next
dialog (with Dimensions checked). Adjust LUTs to see the text in the
image and scroll through stacks. They should not correspond to the
actual position you are in. You can also try importing again with
Pattern checked in the last dialog, it should behave the same.

Things get even weirder if you use OME-TIFF at step 5 to export the
single files. Step 6 still looks like things are wrong, i.e. the
filename of each slice does not correspond to the label on the image.
However, Step 7 now behaves differently. The imported image sequence is
in the correct order, despite the files being named incorrectly!

Am I missing something?

Mel


P.S. Step 7 (importing an image sequence with BF) runs VERY slow, is
that expected?


--
Menelaos Symeonides
Post-Doctoral Associate, Thali Lab
Department of Microbiology and Molecular Genetics
University of Vermont
318 Stafford Hall
95 Carrigan Dr
Burlington, VT 05405
[hidden email]
Phone: 802-656-1161

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Bio-Formats Exporter not working properly, images mixed up

David Gault (Staff)
Hi Menelaos,

Thank you for raising this issue and providing comprehensive test steps. I have been able to reproduce and debug the problem and it appears that the Bio-Formats exporter had mismatched the dimension order when generating the filenames to be used for the split planes. I have opened a card to track the issue on the Bio-Formats Trello board https://trello.com/c/5MUA4ZqG/36-plugins-exporter-dimension-splitting and I have also opened a PR to test and review a potential fix for the issue https://github.com/openmicroscopy/bioformats/pull/3162

With Thanks,
David Gault

On 11 Jun 2018, at 03:54, Menelaos Symeonides <[hidden email]<mailto:[hidden email]>> wrote:

Hello,

Bio-Formats Exporter is exporting hyperstacks all mixed up when exporting channels/slices/frames as individual files. There is some kind of confusion going on as to which dimension is which, even if the source hyperstack is correctly ordered and was even imported using Bio-Formats.

Fiji is 1.52c (up to date). My Bio-Formats version is 5.9.0-20180607.161801-5 (latest daily build). I reproduced this on two different Windows 10 x64 computers, including on a fresh installation of Fiji with no settings altered anywhere (which runs the released 5.8.2 version of Bio-Formats).

The slice label pattern under Configuration > General is set to default (%c%z%t- %n), though I have tried altering it with no effect.

How to reproduce:

1. File > Open Samples > Mitosis (26 MB, 5D stack)

2. Execute the following macro to label slices according to their C/Z/T:


setFont("Arial bold",30,"antialiased");
setColor(65535);

for(z=1; z<=nSlices; z++){
   setSlice(z);
   Stack.getPosition(channel, slice, frame);
drawString("C = " + channel, 20, 50);
drawString("Z = " + slice, 20, 100);
drawString("T = " + frame, 20, 150);
}


3. File > Save As, save the labeled file as a single TIFF hyperstack (not using BF), then close the file.

4. Plugins > Bio-Formats > Bio-Formats Importer, select the labeled TIFF hyperstack, make sure Hyperstack is selected at the top left of the dialog and nothing else is checked. View in grayscale mode and scroll through various slices/channels to verify that it has been loaded correctly, which it should.

5. Plugins > Bio-Formats > Bio-Formats Exporter, create a folder to put the images into, name the file mitosis_labeled, change file type to TIFF, then in the popup dialog check all 4 boxes (write each Z/C/T to a separate file, and use zero padding). Click OK and then again OK to export as Uncompressed with ROIs (doesn't matter).

6. Navigate to the folder where the individual slices were saved, and pick any file and open in Fiji (not as a sequence). The filename of that image should correspond to the actual labels visible in the image, but they do not. E.g. the Z0_C0_T18 filename actually shows up as C=1, Z=5, T=2 in the image, or the Z2_C1_T49 filename shows up as C=1, Z=3, T=31, obviously these are wrong.

7. To verify that the file was exported incorrectly, re-import with BF (Plugins > Bio-Formats > Bio-Formats Importer) and check "Group files with similar names" to import the sequence, click OK through the next dialog (with Dimensions checked). Adjust LUTs to see the text in the image and scroll through stacks. They should not correspond to the actual position you are in. You can also try importing again with Pattern checked in the last dialog, it should behave the same.

Things get even weirder if you use OME-TIFF at step 5 to export the single files. Step 6 still looks like things are wrong, i.e. the filename of each slice does not correspond to the label on the image. However, Step 7 now behaves differently. The imported image sequence is in the correct order, despite the files being named incorrectly!

Am I missing something?

Mel


P.S. Step 7 (importing an image sequence with BF) runs VERY slow, is that expected?


--
Menelaos Symeonides
Post-Doctoral Associate, Thali Lab
Department of Microbiology and Molecular Genetics
University of Vermont
318 Stafford Hall
95 Carrigan Dr
Burlington, VT 05405
[hidden email]<mailto:[hidden email]>
Phone: 802-656-1161

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html


The University of Dundee is a registered Scottish Charity, No: SC015096

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html