I am using imageJ for automated microscopy of live cells.
The microscope centers the stage on a desired cell, takes a Z-stack, and passes this stack to imageJ.
I want to then use Analyze Particles to output the area of the cell in each Z-slice. (this works well)
To do this I use a macro which performs the following:
- A region is selected.
- The selected region stack is duplicated
- the stack is autothresholded.
- Analyze particles is run for the stack (with objects on border excluded)
- the maximal area result is found
- the corresponding z-slice is printed in a file for further work.
This all works well except the duplicate step is far too slow for the pipeline. I need to avoid the duplication step somehow.
Is there any way to crop the stack without first duplicating? (currently this loses information from all but one slice)
Or, can I apply the threshold and analyze particles only to the selected region?
Cropping a stack can be done in a macro using
run("Crop");
following an appropriate selection.