FIJI dropdown menu for mFISH registration, segmentation, and quantification.
AUTHOR: Kaitlin Sullivan (UBC) 2019-2025
TECHNICAL CONTACT: Margo Kapustina (UBC) 2025-Present
See in-depth video tutorials coming shortly:
- 🔧 INSTALLATION (for your local computer ONLY)
- 📂 FILE CONVENTIONS
- 🔬 IMAGE ANALYSIS
- 📊 DATA ANALYSIS
- 🐛 BUGS AND ISSUES
A note to UBC TeamShare users:
Skip installation and use the TeamShare app DO NOT CHANGE OR ALTER THE TEAMSHARE APP!
This installation ensures each time you open up FIJI the menu is already installed. To update you will simply replace the existing code with the new version.
- Copy the raw contents of the latest version of the menu
- Open your FIJI app
- Plug-ins -> Macros -> Startup Macros
- Paste the code at the very bottom of the StartupMacros.txt
- Download LUT files and put in the FIJI lut folder (only if you want to use the HiPlex Overlay function)
- Close and restart your FIJI app
- You will now see the happy hippocampus icon in your FIJI!
This installation is useful for using the menu when on shared computers or read-only versions of FIJI. You will need to re-install the macro each time you open a new FIJI session.
- Save the latest version of the menu as a
.ijm
file - Open your FIJI app
- From the top menu select: Plug-ins -> Macros -> Install
- Select
FijiFISH-v5.ijm
from wherever you have it saved - You will now see the happy hippocampus icon in your FIJI for the remainder of your session.
- HiPlex Overlay currently does not work on read-only versions of FIJI
Tips for smooth image analysis:
- Save ROI for first round on the microscope and re-load it for subsequent imaging rounds
- Ensure same zoom and resolution across rounds
- Be wary of high laser gain and intensity with low expressers
Files used in the FIJI app must be:
.tif
files8-bit
images- Scaled in microns
- Named as such: R#_XXX_Genename (eg:
R1_405_DAPI
)- #= the imaging round number
- XXX= the fluorophore excitation wavelength
- Files from all rounds must be saved in the same file folder
Example file folder for analysis...
Example output file folder structure after analysis is complete...
├── max
└── crop
└── regImages
├── composite
DAPI overlays from registration
└── nonLinear
├── analyzedImages
binarized images with ROIs
├── analyzedTables
tables for RUHi
├── correctedImages
images with background correction
└── overlay
binarized images
This option takes the original images and registers them together based on their DAPI expression.
TO RUN:
- Drag-and-drop
R1_405_DAPI.tif
into FIJI and selectRegistration
.
WHAT HAPPENS:
- Images will have maximum intensity projections taken and saved in a
max
folder - Images will be croped to be the same size and saved in a
crop
folder- Automatic Cropping: puts a box in the upper left corner of each image (auto-choice for
Automated Run
) - Manual Cropping: allows one to move the location of the box (be careful not to change the size of the box or move it form the limits however)
- Automatic Cropping: puts a box in the upper left corner of each image (auto-choice for
- Images will be linearly registered to eachother and saved in a
regImages
folder - Images will be nonlinearly registered to eachother and saved in a
nonLinear
folder
This option takes the registered DAPI images from the nonLinear
folder and segments them.
The DAPI from each round will be binarized then multiplied by eachother to remove cells from out-of-focus planes.
TO RUN:
- Drag-and-drop
R1_405_DAPI.tif_registered.tif_NL.tif
from thenonLinear
folder into FIJI and selectSegmentation
.
Run from the nonLinear
folder...
├── max
└── crop
└── regImages
├── composite
└── nonLinear
<- drag DAPI file from this folder***
**WHAT HAPPENS: **
-
Segmentation Type: select DAPI
- Segment based on DAPI signal from every round (to ensure registration in the z-axis)
- If there is a round where DAPI is not segmentable, uncheck it
-
Threshold Type: binarize the images for segmentation
- Automatic Thresholding
- Manual Thresholding: (select threshold manually with a slider if some DAPI rounds look strange via Automatic Thresholding)
-
Dialation Value: dilate ROIs to include the surrounding cytosol
- Suggested Value =
3 microns
- For densly packed regions or nuclear expression only, change value to
0 microns
- Suggested Value =
-
Segmented image is saved in an
analyzedImages
folder -
Segmented ROIs are saved in
analyzedTables
folder -
IF USING EXTERNAL SEGMENTATION ALGORITHMS: for Baysor, Weka, or CellPose, place your Fiji-readable ROIs as
RoiSet.zip
inanalyzedTables
and skip straight to Quantification.
This option takes individual gene expression images from the nonLinear
folder and quantifies their expression into tables saved in the analyzedTables
folder.
Run from the nonLinear
folder...
├── max
└── crop
└── regImages
├── composite
└── nonLinear
<- Drag first channel from this folder***
└── analyzedTables
TO RUN:
- Drag-and-drop your first gene image from the
nonLinear
folder into FIJI and selectQuantification
from the menu
WHAT HAPPENS:
Automatic thresholding
will take the provided tail of the image's cumulative histogram via MaxEntropyManual thresholding
allows one to manually select the threshold for each image (useful in cases of autofluorescence)
OUTPUT:
- Quantified tables for
RUHi
analysis inanalyzedTables
folder` - Quantified image overlays for quality control in the
analyzedImages
folder
This option allows one to manually threshold and quantify a single channel that may not look exactly right with automated thresholding.
Simply drag-and-drop your image from the nonLinear
folder and run this option to manually threshold. This will overwrite the original quantified table in the analyzedTables
folder.
This option creates a representative overlay image of your binarized gene expression images.
- Download the
.lut
files from here - Place them in the FIJI
lut
folder - Re-start Fiji
TO RUN:
- Drag-and-drop your first gene image from the
overlay
folder into FIJI and selectHiPlex Overlay
from the menu
WHAT HAPPENS:
- When running, images will be opaquely overlaid and the order and colours of the images will print out in the
Log
box.
OUTPUT:
- The image will save in the
overlay
folder asTestCOMP.png
.
DRAWBACKS AND WORKAROUNDS In the future, there will be an plug-in option to change the colours and order of overlay images
- Right now this only allows up to 12 colours without any control over their order or assigned colour.
- To create a manual overlay image: pseudocolour according to prefered image colours and and use FIJI's
Image
->Overlay...
->Add Image
with zero background checked!
It is suggested to only use AutoRun once you are comfortable with each individual analysis step
This option runs a full analysis from Registration
-> Segmentation ->
Quantification` without many pauses for options.
It will automatically: crop, segment, and quantify - there will be no option to choose.
TO RUN:
- simply drag and drop
R1_405_DAPI.tif
into FIJI and selectAutomated Run
.
OUTPUT:
- All files and folders generated from
Registration
,Segmentation
,Quantification
, andHiPlex Overlay
See the RUHi Package for how to: visualize, dimensionally reduce, and cluster the data generated from Quantification
!
Ctrl + F for Troubleshoot
and SPEED
throughout the code to find points where you can optimize the code to your liking based on your data and imaging parameters. Please feel free to fork and update anything you feel could be enhanced!!!
Take a screenshot of the Log, the Debug Window, and any other relevant info or messages and open up an issue on our Cembrowski Lab GitHub - we will try and get to it as soon as we can 😺!