I guess there are multiple ways to tackle this. The “straighten selection” option sounds reasonable. However, shells are stored as area ROIs that cannot be straightened by default, so a way to ‘fool’ the straighten command would be to create a nick on the perimeter of each shell, effectively creating line-based ROIs. Here is a python example that exploits this hack to display all of the rasterized shells in a single image (smallest radius on top, largest at the bottom):
#@UIService uiService
from ij import IJ, ImagePlus
from ij.gui import Overlay, Roi
from ij.plugin import ImagesToStack, Straightener
def error():
uiService.showDialog("No 'shell' ROIs found in frontmost image.\
Make sure image has '2D Sholl Shells' in its overlay.")
shell_width = 10
imp = IJ.getImage()
overlay = imp.getOverlay()
raster_shells = []
if imp and overlay:
for i in range(overlay.size()):
roi = overlay.get(i)
if roi.getName() and "Shell" in roi.getName():
imp.setRoi(roi)
IJ.run(imp, "Area to Line", "")
raster = ImagePlus(roi.getName(), Straightener().straighten(imp, roi, shell_width))
raster_shells.append(raster)
if raster_shells:
holding_imp = ImagesToStack.run(raster_shells)
IJ.run(holding_imp, "Make Montage...", "columns=1 rows={} scale=1".format(holding_imp.getNSlices()))
measurable_imp = IJ.getImage()
measurable_imp.setTitle("Rasterized Shells")
IJ.setAutoThreshold(measurable_imp, "Default dark");
IJ.run(measurable_imp, "Analyze Particles...", " show=[Overlay Masks] display clear overlay");
else:
error()
else:
error()
Each straightened row is separated from the next by a row of empty pixels so that each shell can be analyzed separately (e.g., using IJ’s Analyze Particles command, or some other alternative). This is how it looks like for the ddaC sample image: