[ome-devel] Possible bug in BF ICS/IDS exporter writing to existing files

Melissa Linkert melissa at glencoesoftware.com
Mon Nov 12 18:56:52 GMT 2018


Hi Niko,

Thank you for reporting this, and for including a test macro.  I can
reproduce the problematic ICS/IDS behavior, although it seems like the
overwritten OME-TIFF dataset is not correct either.

This is now recorded on our issue tracker:

https://trello.com/c/CJP1cNxV/292-consistent-behavior-when-writing-to-a-file-that-exists

The safest thing to do for now is to check if the file exists before
running the exporter, and delete or rename it as needed (independent
of the output format).

Regards,
-Melissa
On Sun, Nov 11, 2018 at 6:27 AM Niko Ehrenfeuchter
<nikolaus.ehrenfeuchter at unibas.ch> wrote:
>
> Dear all,
>
> I think we have come across a bug in the Bio-Formats ICS/IDS writer. The
> macro code below illustrates an issue when saving / exporting an image
> to ICS/IDS using a previously existing filename (i.e. "overwrite" the file).
>
> The macro produces four images (six files due to the ICS/IDS separate
> metadata files), that are supposed to have the same pixel-content
> independent of their format / suffix (i.e. both "overwrite" images
> should look identical). Unfortunately the ICS/IDS differs when exporting
> was done to a previously existing file.
>
> Tested it with an up-to-date Fiji + Bio-Formats on Linux and Windows.
>
> Cheers,
> Niko
>
>
> ---- IJ1 macro ----
> // make sure no images are currently open, clear log:
> run("Close All");
> print("\\Clear");
>
> // prepare file names and delete them if existing:
> untouched_omt = getDirectory("temp") + "untouched.ome.tif";
> untouched_icd = getDirectory("temp") + "untouched.ids";
> untouched_icc = getDirectory("temp") + "untouched.ics";
> File.delete(untouched_omt);
> File.delete(untouched_icd);
> File.delete(untouched_icc);
>
> overwrite_omt = getDirectory("temp") + "overwrite.ome.tif";
> overwrite_icd = getDirectory("temp") + "overwrite.ids";
> overwrite_icc = getDirectory("temp") + "overwrite.ics";
> File.delete(overwrite_omt);
> File.delete(overwrite_icd);
> File.delete(overwrite_icc);
>
> // create a test image (works with hyperstacks and normal):
> //newImage("HyperStack", "16-bit color-mode label", 200, 100, 1, 8, 1);
> newImage("Untitled", "16-bit ramp", 200, 100, 8);
>
>
> // now save the ones to be overwritten:
> run("Bio-Formats Exporter", "save=[" + overwrite_omt + "]");
> run("Bio-Formats Exporter", "save=[" + overwrite_icd + "]");
>
>
> // change the test image (rotate by 90 deg, close original):
> /*
> id = getImageID();
> run("TransformJ Rotate", "z-angle=90 adjust");
> selectImage(id);
> close();
> */
> run("Rotate 90 Degrees Right");
>
>
> // save to "fresh" files:
> run("Bio-Formats Exporter", "save=[" + untouched_omt + "]");
> run("Bio-Formats Exporter", "save=[" + untouched_icd + "]");
>
> // save (overwrite) to previously existing files:
> run("Bio-Formats Exporter", "save=[" + overwrite_omt + "]");
> run("Bio-Formats Exporter", "save=[" + overwrite_icd + "]");
>
> // print saving location to log:
> print(getDirectory("temp"));
>
> ---- IJ1 macro ----
>
> --
> Niko Ehrenfeuchter | Image Analysis Specialist
> University of Basel | Biozentrum | Imaging Core Facility
> Klingelbergstr. 50/70 | 4056 Basel | Switzerland
> www.biozentrum.unibas.ch | www.microscopynetwork.unibas.ch
> Phone: +41 (61) 207 26 73 | nikolaus.ehrenfeuchter at unibas.ch
> _______________________________________________
> ome-devel mailing list
> ome-devel at lists.openmicroscopy.org.uk
> http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel


More information about the ome-devel mailing list