This script is designed to analyze mouse brain sections for CFOS based on Stardist DAPI nuclei segmentation.
DOI:
Daniel Waiger
-
Email: [email protected]
-
Image.sc forum: Daniel_Waiger
-
Institution: CSI – Center for Scientific Imaging at The Robert H. Smith Faculty of Agriculture, Food and Environment of the Hebrew University of Jerusalem
The script performs the following steps:
- Opens the selected image file.
- Performs a sum projection of the image.
- Splits the image into channels.
- Applies LUTs (Look-Up Tables) to the channels.
- Prompts the user to select an ROI (Region of Interest) or processes the entire image.
- Processes the selected channels.
- Runs StarDist segmentation on the DAPI channel.
- Saves the results and ROI sets.
- Prints the total run time.
- ImageJ/Fiji
- Bio-Formats Plugin
- StarDist Plugin
- Install ImageJ/Fiji from the official website.
- Install the Bio-Formats plugin.
- To load
.ims
files and select theResolution Level
(Defined asSeries
in the script).
- To load
- Install the StarDist plugin.
- Open ImageJ/Fiji.
- Load the macro script into ImageJ/Fiji.
- Run the script.
- Follow the prompts to select the image file, save directory, channel names, and ROI selection.
graph TD
A[Start Script] --> B[Close all open images]
B --> C[Collect user-defined parameters]
C --> D{Validate inputs}
D -->|Invalid| E[Exit: No image file, .ims, or output directory selected]
D -->|Valid| F[Open image and set measurements]
F --> G[Perform sum projection]
G --> H[Split channels]
H --> I[Apply LUTs to split images]
I --> J{Select ROI?}
J -->|Yes| K[Prompt user to select ROI]
K --> L[Confirm and save ROI selection]
L -->|Confirmed| M[Process selected ROI]
J -->|No| N[Process entire image with the risk of crashing
Fiji when loading big images]
M --> O[Process Channel 1]
N --> O[Process Channel 1 + 2]
O --> P[Run StarDist segmentation on Channel 1]
P --> Q[Measure Channel 2 with Stardist Labels]
Q --> R[Save results and ROI sets]
R --> S[Clear Results table]
S --> T[Print total run time]
T --> U[End Script]