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

Niko Ehrenfeuchter nikolaus.ehrenfeuchter at unibas.ch
Sun Nov 11 12:26:43 GMT 2018


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


More information about the ome-devel mailing list