HandleExtraFileTypes does not preserve subtitle "Label" property
Posted by
Alan Brooks on
Mar 13, 2015; 8:34pm
URL: http://imagej.273.s1.nabble.com/HandleExtraFileTypes-does-not-preserve-subtitle-Label-property-tp5011960.html
While implementing a custom reader that extends ImagePlus, I was trying to set the "Label" property (via imp.setProperty("Label")) so that the subtitle shows up nicely in ImageJ.
When I call my custom file format reader plugin directly from File>Import>My Custom File..., the Label property is shown in the ImageWindow's subtitle.
However, when I integrate my reader into HandleExtraFileTypes.java, the Label property is not shown in the ImageWindow's subtitle for images opened by File>Open... or by drag and drop.
I was able to fix this by inserting the following code to preserves "Label" property in the HandleExtraFileTypes.run() method, as follows:
// also copy the subtitle ("Label") field over if it exists
if (imp.getProperty("Label") != null)
setProperty("Label", imp.getProperty("Label"));
I am not sure how to locate the canonical HandleExtraFileTypes.java. There seems to be one hosted on the
ImageJ1 plugin server (
source). I do not see one on the
ImageJ1 git mirror. Perhaps the
version in the ij1-installer project is canonical?
Anyway, I am not sure where or how to submit a patch, so I am just posting to this mailing list. Let me know if there is a better place.
For use at my company, customizing HandleExtraFileTypes is ok. But I figure it would be get to get this fix to other users if possible.
Note I only tested this with ImageJ1, version 1.49p.