Re: Extensible Persistent Properties for ImageJ Images
Posted by
Wayne Rasband-2 on
URL: http://imagej.273.s1.nabble.com/Extensible-Persistent-Properties-for-ImageJ-Images-tp5023228p5023270.html
> On Apr 28, 2020, at 9:09 AM, Michael Ellis <
[hidden email]> wrote:
>
> 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”
This bug is fixed in the latest ImageJ daily build (1.53a21).
> 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 sounds like a good solution.
> 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?
There must be a way to tell maven that ImageJ is not dependent on the MacAdapter class.
> 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.
The MacAdapter plugin was designed to handle the “About ImageJ" and “Quit ImageJ" commands in the Apple menu and to open files dropped on the ImageJ app and double-clicked files with creator code "imgJ". It appears that with Java 8 the “About ImageJ" and “Quit ImageJ” commands work without MacAdapter.
-wayne
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html