You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+74-26Lines changed: 74 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,41 +20,53 @@ Batch conversion of SEM images (``Process -> Batch -> Macro...``) from tiff to p
20
20
21
21
##### QuickScaleBar Tool (Icon: <u>SB</u>)
22
22
23
-
* One-click action to add a scale bar to an image.
23
+
* One-click action to add a scale bar to an image. Right click opens the options menu.
24
24
25
-
* The scale bar height and font size is adjusted based on image height.
25
+
* The scale bar height and font size is adjusted based on image height (or width).
26
26
27
-
* The scale bar width is adjusted based on scaled image width and rounded to next "good looking" number.
27
+
* The scale bar width is adjusted based on scaled image width (or height, or larger/smaller of the two) and rounded to next "good looking" number.
28
28
29
-
* Will automatically switch units to make scale bar more appealing: E.g. an image with horizontal field width of 0.25 µm will be switched to 250 nm. The scale bar will then also be in nm.
29
+
* The scale bar appearance can be set up just like the normal settings for `Analyze -> Tools -> Scale bar...`.
30
+
31
+
* Optional: Automatically switch units to make scale bar more appealing. E.g., an image with horizontal field width of 0.25 µm will be switched to 250 nm. The scale bar will then also be in nm.
32
+
33
+
* Optional: Automatically re-scale image to (at least) a specified image size in pixels without interpolation (= nearest neighbor interpolation). This is convenient for programs like PowerPoint which like to automatically interpolate "small" images.
34
+
35
+
* Optional: Run custom macro commands provided in the options menu, e.g. `run('mpl-viridis');` to change LUT to viridis.
30
36
31
37
##### FEI Crop Scalebar Tool (Icon: FEI)
32
38
33
-
* One-click action to crop away the databar from an FEI/TFS SEM/FIB image and to add a scale bar.
39
+
* One-click action to crop away the databar from an FEI/TFS SEM/FIB image and to add a scale bar. Right click opens the options menu.
34
40
35
-
* Scale bar behaviour is the same as for QuickScaleBar tool.
41
+
* Scale bar behaviour is the same as for QuickScaleBar tool and settings are taken from the QuickScaleBar options.
36
42
37
-
*Other image operations can be specified in the script (`process_image()` function). By default a simple "Auto Contrast/Brightness" contrast stretching is run.
43
+
*Optional: Run custom macro commands provided in the options menu, e.g. `run('mpl-viridis');` to change LUT to viridis.
38
44
39
-
* Especially useful for batch conversion of SEM/FIB images (run from `Process->Batch->Macro...` )
45
+
* Especially useful for batch conversion of SEM/FIB images (run from `Process -> Batch -> Macro...` ): In the batch processing menu insert the macro command `runMacro('FEI_Crop_Scalebar.ijm');`.
40
46
41
47
***Note:** The boundaries for the cropping area **depend on the microscope system type** because older FIB/SEMs use a nearly quadratic image format whereas modern microscope use landscape mode by default. You may need to adjust the microscope list once in the macro for your SEM, see instructions below.
42
48
43
-
*
49
+
##### Move Overlays Tool (Circle icon)
50
+
51
+
* Move around scale bar for fine tuning of the position. Will anchor to special positions for easier alignment.
52
+
53
+
* Taken from: [Overlay Editing Tools](https://imagej.nih.gov/ij/source/macros/Overlay%20Editing%20Tools.txt)
54
+
55
+
##### Remove Overlays Tool (x icon)
44
56
45
-
##### Edit ScaleBarTools macros... Tool (Icon: ?)
57
+
* Remove all overlays including the scale bar.
46
58
47
-
* Opens the Fiji code editor to quickly edit the macros for future use.
59
+
##### About EMScaleBarTools (Icon: ?)
48
60
49
-
*Adjust the scalebar looks here and add fancy image operations for the FEI Crop Scalebar Tool!
61
+
*Opens a short help dialog.
50
62
51
63
## Requirements and Installation
52
64
53
65
* Requires the useful [EM tool](https://imagej.net/plugins/imbalence) plugin by **IMBalENce** as FEI/TFS images are scaled with [SEM FEI metadata scale](https://imagej.net/plugins/sem-fei-metadata-scale). Install via the Fiji update site.
54
66
55
-
* Download the latest [release](https://github.com/lukmuk/em-scalebartools/releases), extract the `macros` folder, and copy it to your Fiji installation folder. It will add the`QuickScaleTools.ijm` and `FEI_Crop_Scalebar.ijm` macros to the macros folder and the `ScaleBarTools.ijm` toolset to the `macros/toolset` folder.
67
+
* Download the latest [release](https://github.com/lukmuk/em-scalebartools/releases), extract the `macros` folder, and copy it to your Fiji installation folder. It will add the``FEI_Crop_Scalebar.ijm`` macro to the macros folder and the `EMScaleBarTools.ijm` toolset to the `macros/toolset` folder.
56
68
57
-
* Restart Fiji and select the `ScaleBarTools` from `More Tools...` (>>) menu.
69
+
* Restart Fiji and select the `EMScaleBarTools` from `More Tools...` (>>) menu.
58
70
59
71
##### Add a new microscope system type
60
72
@@ -70,31 +82,49 @@ Currently, only the system types `Helios G4 FX`, `Strata DB`, and `Quanta FEG` a
70
82
71
83
Warning: Code is not optimized in any way, but should work (?). :-)
72
84
73
-
###### Scalebar looks:
85
+
###### QuickScaleBar Options
86
+
87
+
``Relative height``: Height of scale bar wrt image height in pixel (default: ``0.02``, 2% of image height)
88
+
89
+
`Relative width`: Width of scale bar with respect to `Scalebar size reference`option (default: `0.2`, 20% of image width), will get rounded to next smaller "nice" value, see (``vals`` array in the code).
90
+
91
+
`Relative fontsize`: Font size wrt `Scalebar height` (default: `3`, point size of scale bar height).
92
+
93
+
`Scalebar color`: Font size color (default: ``'Black'``).
94
+
95
+
`Background color`: Background color (default: `'White'`). Use ``'None'`` to remove background.
96
+
97
+
``Scalebar location``: Location/position of scale bar (default: ``'Lower Right'``).
74
98
75
-
``sb_hfac``: Height of scale bar wrt image height in pixel (default: ``0.02``, 2% of image height)
99
+
`Bold`: Bold font (default: `true`).
76
100
77
-
`sb_wfac`: Width of scale bar wrt image width (default: `0.2`, 20% of image width), will get rounded to next smaller "nice" value, see (``vals`` array in the code).
101
+
`Overlay`: Add scale bar as an overlay (default: `true`).
78
102
79
-
`sb_fsfac`: Font size wrt `sb_hfac`(default: `2`, double of point size of scale bar height).
103
+
`Serif font`: Serif font (default: `false`).
80
104
81
-
`sb_col`: Font size color (default: ``'Black'``).
105
+
`Hide`: Hide font, only plot scale bar (default: `false`). Will create a copy of the image with the scale-bar length in the title.
82
106
83
-
`sb_bg`: Background color (default: `'White'`). Use ``'None'``to remove background.
107
+
`Scalebar size reference`: Base scale bar size on width/height/smaller/larger edge of the image (default: `'Larger'`). You can adjust this for narrow images to modify scale bar appearance. Use `Height`/`Width` if you want to have identical scale bar sizes for images of same `Height`/`Width`.
84
108
85
-
``sb_loc``: Location/position of scale bar (default: ``'Lower Right'``).
109
+
`Auto unit-switching`: Automatically adjusts units between m and Angstrom based on `Check`and `U` values. (default: `true`).
110
+
111
+
`(Auto unit-switching) Check`: Check width/height/both of image for unit switching (default: `'Width'`).
86
112
87
113
``U``: Unit switching factor (default: ``3``). Example: Will switch from µm to nm if image width is below 3 µm. Will switch from nm to µm if image width is larger than 3000 nm.
88
114
89
-
###### QuickScaleBar
115
+
`Auto re-scale images`: If true/1, automatically rescale (using no interpolation/nearest interpolation) small image width or height to at least `rescale_target_px` value. (default: `0`, false). Useful to resize small cropped areas of larger images. This is the same as using `CTRL+E` and rescaling with `Interpolation: None`.
116
+
117
+
`rescale_target_px`: Target minimum pixel size for `auto_rescale`. (default: `512`)
118
+
119
+
`Run custom macro commands`: Run commands specified in next line (default: `false`). In the `Custom macro commands` field, multiple commands must be separated by `;`.
90
120
91
-
``auto_rescale``: If true/1, automatically rescale (using no interpolation/nearest interpolation) small image width or height to at least ``rescale_target_px`` value. (default: ``0``, false). Useful to resize small cropped areas of larger images. This is the same as using ``CTRL+E`` and rescaling with ``Interpolation: None``.
121
+
###### FEI Crop Scalebar Options
92
122
93
-
`rescale_target_px`: Target minimum pixel size for ``auto_rescale``. (default: ``800``)
123
+
`Crop data bar`: Crop data bar of FEI/TFS image (default: `true`)
94
124
95
-
###### FEI Crop Scalebar
125
+
`Show metadata in log window`: Keep log window open or close it (default: `false`).
96
126
97
-
``function process_image()``: Add image processing here, especially useful for batch conversion. (default: Auto C/B, i.e. ``run("Enhance Contrast", "saturated=0.35")``)
127
+
`Run custom macro commands`: Run commands specified in next line (default: `false`). In the `Custom macro commands` field, multiple commands must be separated by `;`.
98
128
99
129
## Other useful scalebar tools
100
130
@@ -103,3 +133,21 @@ Warning: Code is not optimized in any way, but should work (?). :-)
103
133
* DM/GMS: [Scale Bar Control](http://www.dmscripting.com/scalebarcontrol.html) by D. R. G. Mitchell
104
134
105
135
* Fiji/ImageJ: [asc-ImageJ-Fancy-Labels](https://github.com/peterjlee/asc-ImageJ-Fancy-Labels) by peterjlee
136
+
137
+
* Fiji/ImageJ: [Scale Bar Tools for Microscopes](http://image.bio.methods.free.fr/ImageJ/?Scale-Bar-Tools-for-Microscopes.html&lang=en) by Gilles Carpentier
138
+
139
+
## Changelog
140
+
141
+
### v0.2
142
+
143
+
* Renamed `ScaleBarTools.ijm` to `EMScaleBarTools.ijm` because there is also a plugin by [Gilles Carpentier](http://image.bio.methods.free.fr/ImageJ/?Scale-Bar-Tools-for-Microscopes.html&lang=en) with a similar name. Makes it clear that is meant for EM.
144
+
145
+
* Reorganization of the code: `QuickScaleBar.ijm` was merged into `EMScaleBarTools.ijm`. `FEI_Crop_Scalebar.ijm` is still a stand-alone macro for easier use with batch processing.
146
+
147
+
* Included option menus for some icon tools, which can be accessed by right-click. More convenient editing than in the source code.
148
+
149
+
* Options parameters are stored internally in java variables and saved for future sessions (`ij.get` and `ij.set` calls). I took inspiration from another toolsets macro: [Roi 1-click tools](https://imagej.net/plugins/roi-1-click-tools)
150
+
151
+
* Added more options for scale bar appearance (serif font, bold, hide, ...).
152
+
153
+
* Added two additional tools in the menu: Move Overlays and Remove Overlays for quick manipulation of the scale bar (which is often an overlay).
0 commit comments