From b0af87596a1e8f182c347914c8c1e19afeb46d60 Mon Sep 17 00:00:00 2001 From: schlda00 <kai.schleicher@unibas.ch> Date: Wed, 16 Apr 2025 10:15:16 +0200 Subject: [PATCH] Remove unused function and imports --- 2d_spots_in_fibers.py | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/2d_spots_in_fibers.py b/2d_spots_in_fibers.py index 181b435..f6ec4ba 100644 --- a/2d_spots_in_fibers.py +++ b/2d_spots_in_fibers.py @@ -29,11 +29,6 @@ from loci.plugins.in import ImporterOptions from loci.formats import ImageReader, MetadataTools, Memoizer # MorpholibJ imports from inra.ijpb.binary import BinaryImages -# imglib2 imports -from net.imglib2.img.display.imagej import ImageJFunctions -from net.imglib2.roi import Regions -from net.imglib2.roi.labeling import LabelRegions -from net.imglib2.algorithm.labeling import ConnectedComponents # BIOP imports from ch.epfl.biop.ij2command import Labels2Rois, Rois2Labels # python imports @@ -288,32 +283,6 @@ def save_image_as_IJtif(imp, filename, suffix, target): IJ.saveAs(imp, "Tiff", savepath) -def convert_labelimage_to_imglib2regions(imp): - """Convert a ImagePlus label image to imglib2 regions - - Parameters - ---------- - imp : ImagePlus - the input label image - - Returns - ------- - Imglib2 LabelRegions - the imglib2 label regions - """ - - # fist convert ImagePlus to img as suggested by curtis: - # from https://forum.image.sc/t/how-to-wrap-any-kind-of-imageplus-to-an-imglib2-img-floattype/178/6 - wrapImg = ImageJFunctions.wrap(imp) - # workaround to convert a label image into an imglib2 ImgLabeling (which contains not only an image) - img_labeling = ops.labeling().cca(wrapImg, ConnectedComponents.StructuringElement.EIGHT_CONNECTED) - # img = img_labeling.getIndexImg() # the img label image - # ImageJFunctions.show(img) - regions = LabelRegions(img_labeling) - - return regions - - def convert_labelimage_to_binary(label_imp, scale_binary=True): """Convert a label image to a mask / binary image -- GitLab