-
Notifications
You must be signed in to change notification settings - Fork 243
Description
Another issue is about the need to take note of the parameters used for the rendering of the scale bar, like e.g. the font size and the bar thickness, especially during the writing of a paper or during the revision process, to add images in a consistent manner.
To address this second issue I embedded in the image the scale bar parameters as image properties when the scale bar is added. These properties are named as in the following list:
hidden.scalebar.thickness hidden.scalebar.fontSize
hidden.scalebar.color hidden.scalebar.background
hidden.scalebar.location hidden.scalebar.horizontal
hidden.scalebar.vertical hidden.scalebar.boldText
hidden.scalebar.hideText hidden.scalebar.serifFont
hidden.scalebar.useOverlay hidden.scalebar.labelAllSlices
The reason of the "hidden." prefix is probably best discussed in a dedicated issue, but briefly I also changed ImageInfo.java to not add properties whose name start with "hidden." to the "Show Info..." window, to not fill the output with properties that are intended for internal use only (I know that there is the "HideInfo" property, but it hides all properties, while it seems useful to me to hide only some).
Then, I added a popup menu and a button to the "Scale Bar" dialog (see image) to load the settings from another open image (only images which contain the scalebar properties are added to this choice list). If an image is selected in the choice requester, hitting the "Load settings" button adjusts the values of the "Scale Bar" dialog to the values contained in the selected image (and are shown in real time in the active image).
If you believe that these changes are of some interest, I can make a PR.
Best,
Lorenzo
P.S., some more details below:
If the active image already has the above properties when the plugin is started, their values are stored in a temporary ScaleBarConfiguration structure, to be written to the image again if the requester is canceled. This information, if exist, is also used to rebuild the original scalebar, without using the restoreOverlayScaleBar method. restoreOverlayScaleBar is only used if no scalebar properties info exist (sometimes restoreOverlayScaleBar does not correctly restore the scale bar, while redrawing it from the stored info does. e.g. if the scale bar has the background color set, in some situations).