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

Remove unnecessary function, its use, import and prints

Roi enlargement is not needed when using Cellpose for fiber detection
parent e4613605
No related branches found
No related tags found
No related merge requests found
......@@ -12,7 +12,6 @@
# @ Integer (label="Min perimeter [um]", value=5) minPer
# @ Integer (label="Max perimeter [um]", value=300) maxPer
# @ String (visibility=MESSAGE, value="<html><b> Expand ROIS to match fibers </b></html>") msg3
# @ Double (label="ROI expansion [microns]", value=1) enlarge_radius
# @ String (visibility=MESSAGE, value="<html><b> channel positions in the hyperstack </b></html>") msg5
# @ Integer (label="Membrane staining channel number", style="slider", min=1, max=5, value=1) membrane_channel
# @ Integer (label="Fiber staining (MHC) channel number (0=skip)", style="slider", min=0, max=5, value=3) fiber_channel
......@@ -63,7 +62,7 @@ from fiji.plugin.trackmate.tracking.jaqaman import SparseLAPTrackerFactory
from ij import IJ
from ij import WindowManager as wm
from ij.measure import ResultsTable
from ij.plugin import Duplicator, ImageCalculator, RoiEnlarger
from ij.plugin import Duplicator, ImageCalculator
from imcflibs import pathtools
from imcflibs.imagej import bioformats as bf
from imcflibs.imagej import misc
......@@ -490,26 +489,6 @@ def save_selected_rois(rm, selected_rois, target):
rm.runCommand("Deselect")
def enlarge_all_rois(amount_in_um, rm, pixel_size_in_um):
"""Enlarges all ROIs in the RoiManager by x scaled units.
Parameters
----------
amount_in_um : float
the value by which to enlarge in scaled units, e.g 3.5
rm : RoiManager
a reference of the IJ-RoiManager
pixel_size_in_um : float
the pixel size, e.g. 0.65 px/um
"""
amount_px = amount_in_um / pixel_size_in_um
all_rois = rm.getRoisAsArray()
rm.reset()
for roi in all_rois:
enlarged_roi = RoiEnlarger.enlarge(roi, amount_px)
rm.addRoi(enlarged_roi)
def select_positive_fibers(imp, channel, rm, min_intensity):
"""Select ROIs in ROIManager based on intensity in specific channel.
......@@ -735,7 +714,6 @@ if __name__ == "__main__":
IJ.log("area = " + str(minAr) + "-" + str(maxAr))
IJ.log("perimeter = " + str(minPer) + "-" + str(maxPer))
IJ.log("circularity = " + str(minCir) + "-" + str(maxCir))
IJ.log("ROI expansion [microns] = " + str(enlarge_radius))
IJ.log("Membrane channel = " + str(membrane_channel))
IJ.log("MHC positive fiber channel = " + str(fiber_channel))
# IJ.log("sub-tiling = " + str(tiling_factor))
......@@ -793,8 +771,6 @@ if __name__ == "__main__":
misc.timed_log("Getting the ROIs")
command.run(Labels2Rois, True, "rm", rm, "imp", imp_result).get()
misc.timed_log("Enlarging and renumbering the ROIs")
enlarge_all_rois(enlarge_radius, rm, raw_image_calibration.pixelWidth)
renumber_rois(rm)
misc.timed_log("Saving the ROIs")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment