Skip to content
Snippets Groups Projects
Commit 2c6afe8e authored by Kai Schleicher's avatar Kai Schleicher
Browse files

Remove RoiManager import, get from script parameter instead.

parent d34dc6c3
No related branches found
No related tags found
1 merge request!2Initial commit
......@@ -18,7 +18,6 @@ from fiji.plugin.trackmate.action import LabelImgExporter
# ij imports
from ij import IJ
from ij.plugin import ImageCalculator
from ij.plugin.frame import RoiManager
from ij.measure import ResultsTable
from ij.measure import Measurements as M
from ij.plugin.filter import Analyzer
......@@ -386,7 +385,7 @@ def save_results_table(results_table, filename, suffix, target):
results_table.save(savepath)
def save_labelimage_as_ijroiset(label_imp, filename, suffix, target):
def save_labelimage_as_ijroiset(label_imp, rm, filename, suffix, target):
"""Save all labels i a label Images as IJ-ROIset to target location.
Only 2D, requires PTBIOP update site.
......@@ -401,10 +400,6 @@ def save_labelimage_as_ijroiset(label_imp, filename, suffix, target):
target : str
the target directory in which to save the table
"""
rm = RoiManager.getInstance()
if not rm:
rm = RoiManager()
rm.reset()
command.run( Labels2Rois , False , 'imp' , label_imp , 'rm', rm).get()
savename = filename + "_" + str(suffix) + ".zip"
savepath = os.path.join(target, savename)
......@@ -412,19 +407,16 @@ def save_labelimage_as_ijroiset(label_imp, filename, suffix, target):
rm.reset()
def load_rois_from_zip(path):
def load_rois_from_zip(path, rm):
"""Load ROIs from the given zip file and add them to the RoiManager.
Parameters
----------
path : string
Path to the ROI zip file.
rm : RoiManager
The ROI Manager.
"""
rm = RoiManager.getInstance()
if not rm:
rm = RoiManager()
rm.reset()
rm.runCommand("Open", path)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment