Microscope Measurement plugin for FIJI
This set of FIJI plugins provides a quick way to save distance/length calibrations for various microscopes/objectives in a simple text file, and then draw calibrated distances onto your images.
You can then choose any of your prior calibrations to be applied to an open image (or all open images), as so:
The "Draw Measurement" plugin then allows you to draw a line with the calibrated measurement length, as so:
- Download and install the scientific image analysis program FIJI
- Download the most recent Microscope Tools Release from Github
- Extract/Unzip the file you downloaded from Github called:
Microscope-Measurment-tools - Move the folder contents (or just the plugins and macros directories) into the FIJI directory (Fiji.app). When prompted, choose to overwrite the file StartupMacros.fiji.ijm
- Extract/Unzip the file you downloaded from Github called:
note MacOS may prevent you from opening an unverified application follow steps below to open
- In System Preferences, click
Security & Privacy > General, then click the Lock button to allow you to make changes to your settings. You will need to provide your password, or use Touch ID, to unlock this. - The last app you attempted to open will be listed underneath your App Store security options. To launch the app (or rather, the DMG image file containing your app), click Open Anyway.
- Once installed, if you have not previously opened the app, macOS will warn you that you are attempting to open an app from the internet. You’ll need to approve it for launch, so click the Open button to do this
- Take photos of a known measurment sample with your microscope, at each magnification you want to calibrate
- Open FIJI
- Open an image file taken at the desired maginification with a measurment marker. e.g. Open a photo of a micrometer slide
- Zoom in on the photo to view the scale
- Draw a line
ROI(Region Of Interest) along the calibration measurment feature. e.g. along the micrometer
- Navigate to and select
Analyze > Set Scale - The "Distance in Pixels" will already be set by your line ROI
- Type in the "Known Distance" from your measurement feature

- (Optional) Check 'Global' to apply this same scale to all images opened during this session
- (Optional) Add the scale as a preset that can be accessed at Plugins\Analyze\Microscope Measurement Tools\Choose Microscope Calibration (F1)
- Record the resulting "Scale" value, e.g. 31.1716 pixel/unit, where unit is cm, mm, μm, etc
- The "Scale" value will be used in your
Microscope_Calibrations_user_settings.pyfile, so recored both a name and the scale value. e.g:these are just dummy valuesSwift 350T 4x: 0.9058 px/μm Swift 350T 10x: 1.81 px/μm Swift 350T 40X: 12.5455 px/μm Swift 350T 100X: 31.1716 px/μm - Open up
/Fiji.app/plugins/Analyze/Microscope Measurement Tools/Microscope_Calibrations_user_settings.pyin your preferred text editor or python IDE - Edit the
nameslist to reflect the name of each calibration on line 21:names = [ 'Swift 350T 4x', 'Swift 350T 10x', 'Swift 350T 40x', 'Swift 350T 100x', ] - Edit the
calslist to reflect the correspondingpixel-per-unitcalibration for each setting, from your previous records, on line 30:cals = [ 0.9058, 1.81, 12.5455, 31.1716, ] - Save the file, and delete the file "Microscope_Calibrations_user_settings$py.pyclass" (if present)
- Quit FIJI
- Re-start the FIJI application. This will allow the application to register the changes you made to the plugin note for any subsquent changes, you will have to repeat the last three steps to see the changes
Several files are included, which will show up at Plugins\Analyze\Microscope Measurement Tools. Shortcuts are also added to the tool bar.
-
Choose_Microscope_Calibration.py
- Opens the "Choose Calibration" window, for setting the measurement scale to a preconfigured value (hotkey F1)
-
Draw_Measurement_-_Line.py
- Converts a Line ROI into a drawn annotation with the measurement length indicated
-
Draw_Rectangle_Long_Length.py
- Adds a drawn annotation of the length of a rectangle ROI along the long side (hotkey 'q')
-
Draw_Rectangle_Short_Length.py
- Adds a drawn annotation of the length of a rectangle ROI along the short side (hotkey 'g')
-
Draw_Rectangle_Length_x_Width.py
- Adds a drawn annotation of the length and width of a rectangle ROI (hotkey 'u')
-
Microscope_Calibrations_user_settings.py
- User-editable Settings file that contains your pre-configured scale calibrations, along with settings for drawing annotations (background/text color etc.)
View the How-To Calibrate an Ocular Micrometer
(Recommended) Set a scale either manually using the procedure outlined in the 'Calibration' Section, or from the presets by going to Plugins > Analyze > Microscope Measurement Tools > Choose Microscope Calibration (F1)
You can now drag a Line or Rectangle (or other type of ROI) on any feature, and the FIJI toolbar will show you the measurement dynamically. Other FIJI functions can now also be used for calibrated measurements (areas etc.).
To draw this measurement on your image, drag the Line or Rectangle at the desired location, and select the desired measurement from Plugins > Analyze > Microscope Measurement Tools, click the toolbar icon, or type the hotkey (details for each measurement option are in 'Usage' section)
A custom function can be added to the list of available calibrations (as opposed to a static scale value). A sub-folder is included showing an example of how to do this. The example is for a JEOL SEM (scanning electron microscope), and the example function will determine the scale of the SEM image by parsing an accompanying text file.
See the files in the sub-folder "MScopeCals - custom function example" for more info, and move both of the *.py files into the main Microscope Measurement Tools folder to see how they can be used. An example SEM image and TXT file from a JEOM 7600F SEM are included.

