Re: Extensible Persistent Properties for ImageJ Images

Posted by Michael P Ellis on
URL: http://imagej.273.s1.nabble.com/Extensible-Persistent-Properties-for-ImageJ-Images-tp5023228p5023269.html

Dear Wayne, hi

I have just found  that whilst String properties are preserved when saved/restored with “.tif” format (ij.jar 1.53a15+), they are not preserved when saved as “.tif.zip”

img = new CompositeImage(IJ.createImage("Untitled", "8-bit black", 500, 500, 3));

img.setProp("Banana", "Yellow");
IJ.showMessage("Bananas are " + img.getProp("Banana") );

path = IJ.getDir("home")+"Downloads/Untitled.tif";
IJ.saveAs(img, "Tiff", path);
img2 = IJ.openImage(path);
IJ.showMessage("From TIFF Bananas are " + img2.getProp("Banana") );

path = IJ.getDir("home")+"Downloads/Untitled.tif.zip";
IJ.saveAs(img, "Zip", path);
img3 = IJ.openImage(path);
IJ.showMessage("From Zipped TIFF Bananas are " + img3.getProp("Banana") );

This is quite surprising as I would have assumed that the .tif.zip is just a zipping/unzipping of the .tif stream/file?

ALSO It turns out that the MacAdapter.class that is packaged with ImageJ prevents the ij.jar being loaded when using the Modular Java Platform. I *think* this is a matter of not being allowed any classes in the default package. I can, (as documented elsewhere) get around this by building the ImageJ ij.jar and omitting the line from the ant script that builds adds the MacAdapter class to the ij.jar.

This however precludes a simple reliance on a maven dependency (as and when it becomes available). Can MacAdapter removed altogether or moved into a package?

I was unsure about the MacAdapter class in any case since after removal, selecting “About Image” from the menu still seemed to work and I had assumed (mistakenly) that that was what it is for.

Thanking you in anticipation of any help.

Keep healthy - Keep safe

— Michael Ellis


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