Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
33 lines (28 sloc) 1.16 KB
# @Context context
# @Dataset dataset
# @ImageJ ij
# @LogService log
# This script exemplifies how to instruct KymographBuilder to
# process all the line ROIs present in the ROI Manager. For more
# details see
import ij.plugin.frame.RoiManager as RM
import sc.fiji.kymographBuilder.KymographFactory as KFactory
def validDataset(dataset):
"""Assess if dataset has suitable dimensions"""
from net.imagej.axis import Axes
z = dataset.dimension(dataset.dimensionIndex(Axes.Z))
t = dataset.dimension(dataset.dimensionIndex(Axes.TIME))
return z * t > 1
rm = RM.getInstance()
counter = 0
if validDataset(dataset) and rm and rm.getCount():
for roi in rm.getRoisAsArray():
if roi.isLine():
kfactory = KFactory(context, dataset, roi)
counter += 1
title = "Kymograph" + str(counter).zfill(3) + "_" + roi.getName()
ij.ui().show(title, kfactory.getKymograph())"MultiKymographBuilder Finished. " + str(counter) + " ROIs processed")
log.error("Either the ROI Manager is empty or " + dataset.getName() +" has invalid dimensions")
You can’t perform that action at this time.