Jan 10, 2026

Public workspaceAn ImageJ/FIJI Preprocessing Workflow for Multi-Series Confocal Microscopy Datasets Prior To CellProfiler Analysis

  • Aaran Vijayakumaran1,2,
  • Suzanne Pfeffer1,2
  • 1Department of Biochemistry, Stanford University School of Medicine;
  • 2Aligning Science Across Parkinson's
  • Team Alessi
Icon indicating open access to content
QR code linking to this content
Protocol CitationAaran Vijayakumaran, Suzanne Pfeffer 2026. An ImageJ/FIJI Preprocessing Workflow for Multi-Series Confocal Microscopy Datasets Prior To CellProfiler Analysis. protocols.io https://dx.doi.org/10.17504/protocols.io.5jyl8xjzdv2w/v1
License: This is an open access protocol distributed under the terms of the Creative Commons Attribution License,  which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited
Protocol status: Working
We use this protocol and it's working
Created: January 09, 2026
Last Modified: January 10, 2026
Protocol Integer ID: 238352
Keywords: cellprofiler analysis the overall aim, cellprofiler analysis, tiff file, cellprofiler, using cellprofiler, intensity projection, intensity projections for user, independent image dataset, step imagej, container of independent image dataset, dimensional image, fiji preprocessing workflow, embedded dataset, imagej, standalone ome
Funders Acknowledgements:
Aligning Science Across Parkinson's
Grant ID: ASAP-000463
Abstract
The overall aim of this workflow is to generate three-slice maximum-intensity projections (MIPs) in an effort to preserve weak, spatially localized signals that can be missed when projecting across the entire Z-stack. For this purpose, a two-step ImageJ/FIJI workflow was developed.

In the first step, a multi-series .czi file is treated as a container of independent image datasets, and each embedded dataset is extracted and exported as a standalone OME-TIFF file, preserving all acquired channels as full Z-stacks. In the second step, these per-dataset stacks are processed to generate three-slice maximum-intensity projections for user-defined channels. The resulting two-dimensional images are saved with a consistent naming scheme, enabling straightforward downstream grouping and high-throughput quantitative analysis using CellProfiler.
Troubleshooting
Method Summary
Prompt the user to select a multi-series .czi input file
Prompt the user to select an output directory
Import the multi-series .czi file using Bio-Formats
Separate the embedded datasets (series) within the file
Export each dataset as an individual OME-TIFF file containing all channels
Prompt the user to select the folder containing the per-dataset stacks generated in Script A
Open each dataset as a hyperstack and read its dimensions
Process the Z-stack in consecutive groups of three slices
For each Z-block, extract user-defined channels
Generate a maximum-intensity projection for each channel and save as a 2D TIFF image
Procedure
Drag and drop the Script A macro into ImageJ/Fiji (or run via Plugins → Macros → Run…)
Select the multi-series .czi file when prompted
Select an output folder when prompted
The macro automatically exports each embedded image dataset as a separate OME-TIFF file like this: ‘Series cindexe_AllChannels.ome.tiff’
No additional parameters need to be set or modified
Close Script A
Drag and drop the Script B macro into ImageJ/Fiji (or run via Plugins → Macros → Run…)
Select the folder containing the per-dataset OME-TIFF stacks (these are the output files generated by Script A)
For each input stack, the macro automatically creates a subfolder named after the input file (excluding the file extension) [Series_cindexe_AllChannels]
Each dataset is processed independently as follows:
The image is opened as a hyperstack
The Z-stack is processed in consecutive groups of three slices
For each set of three slices, a maximum-intensity projection (MIP) is generated for each user-defined channel
Projected images are saved as 2D TIFF files using the naming convention: ‘MIP_cstartSlicee_cchannelNamee.tif’, where cstartSlicee indicates the first slice of the three-slice group.
User-Editable Settings
Line 48-51: which channels are exported and what they are named.
saveChannelMIP(1, "DARFF32");
saveChannelMIP(2, "pSNCA");
saveChannelMIP(3, "DAPI");
saveChannelMIP(4, "CHAT");
How to edit:
Replace the channel index (first argument) to match your acquisition order
Replace the channel name (second argument) to match the label you want in the output filename
Example: To change to “DAPI and GFP”, replace the code above with this:
saveChannelMIP(1, "DAPI");
saveChannelMIP(2, "GFP");
Line 39: Projection Type
This code is currently for maximum intensity projection on Z-stacks. This can be changed to
Average intensity (projection=[Average Intensity]) or
sumslices (projection=[Sum Slices])
Line 25 - 29: Number of Z-slices per projection
Three-slice grouping is controlled by the Z-loop step size and the stop calculation.
How to edit:
For example, for 5-slice projections (rather than 3):
change z += 3 to z += 5 (line 25)
and stop = z + 2 to stop = z + 4 (line 28)
Protocol references
Stirling DR, Swain-Bowden MJ, Lucas AM, Carpenter AE, Cimini BA, Goodman A (2021). CellProfiler 4: improvements in speed, utility and usability. BMC Bioinformatics, 22 (1), 433. PMID: 34507520 PMCID: PMC8431850.

Schindelin J, Arganda-Carreras I, Frise E, Kaynig V, Longair M, Pietzsch T, Preibisch S, Rueden C, Saalfeld S, Schmid B, Tinevez JY, White DJ, Hartenstein V, Eliceiri K, Tomancak P, Cardona A. Fiji: an open-source platform for biological-image analysis. Nat Methods. 2012 Jun 28;9(7):676-82. doi: 10.1038/nmeth.2019. PMID: 22743772; PMCID: PMC3855844.
Acknowledgements
Procedure:

1. Drag and drop the Script A macro into ImageJ/Fiji (or run via Plugins → Macros → Run…)
2. Select the multi-series .czi file when prompted
3. Select an output folder when prompted
4. The macro automatically exports each embedded image dataset as a separate OME-TIFF file like this: ‘Series cindexe_AllChannels.ome.tiff’

No additional parameters need to be set or modified

5. Close Script A
6. Drag and drop the Script B macro into ImageJ/Fiji (or run via Plugins → Macros → Run…)
7. Select the folder containing the per-dataset OME-TIFF stacks (these are the output files generated by Script A)
8. For each input stack, the macro automatically creates a subfolder named after the input file (excluding the file extension) [Series_cindexe_AllChannels]
9. Each dataset is processed independently as follows:
a. The image is opened as a hyperstack
b. The Z-stack is processed in consecutive groups of three slices
c. For each set of three slices, a maximum-intensity projection (MIP) is generated for each user-defined channel

10. Projected images are saved as 2D TIFF files using the naming convention: ‘MIP_cstartSlicee_cchannelNamee.tif’, where cstartSlicee indicates the first slice of the three-slice group.

User-Editable Settings:

**Line 48-51**: which channels are exported and what they are named.

- `saveChannelMIP(1, "DARFF32");`
- `saveChannelMIP(2, "pSNCA");`
- `saveChannelMIP(3, "DAPI");`
- `saveChannelMIP(4, "CHAT");`

How to edit:

- Replace the channel index (first argument) to match your acquisition order
- Replace the channel name (second argument) to match the label you want in the output filename

Example: To change to “DAPI and GFP”, replace the code above with this:

- `saveChannelMIP(1, "DAPI");`
- `saveChannelMIP(2, "GFP");`

**Line 39: Projection Type**

This code is currently for maximum intensity projection on Z-stacks. This can be changed to

- Average intensity (projection=[Average Intensity]) or
- sumslices (projection=[Sum Slices])

**Line 25 - 29: Number of Z-slices per projection**

Three-slice grouping is controlled by the Z-loop step size and the stop calculation.

How to edit:

- For example, for 5-slice projections (rather than 3):
- change z += 3 to z += 5 (line 25)
- and stop = z + 2 to stop = z + 4 (line 28).