From 66f98024f6c58da88c60bcb58834b322398afc63 Mon Sep 17 00:00:00 2001 From: Albert Cardona Date: Thu, 27 Jun 2024 10:34:02 +0100 Subject: [PATCH] New method getSegmenter() So that one can, on a script, getSegmenter().getClassifier(), to then e.g., call setNumThreads(1) on the underlying FastRandomForest instance. At the moment there's no way to set the number of threads used to 1 except via Prefs.setThreads(1), which is fragile. --- .../ui/segmentation/weka/TrainableSegmentationSegmenter.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/sc/fiji/labkit/ui/segmentation/weka/TrainableSegmentationSegmenter.java b/src/main/java/sc/fiji/labkit/ui/segmentation/weka/TrainableSegmentationSegmenter.java index 0fbbef8f..354ac610 100644 --- a/src/main/java/sc/fiji/labkit/ui/segmentation/weka/TrainableSegmentationSegmenter.java +++ b/src/main/java/sc/fiji/labkit/ui/segmentation/weka/TrainableSegmentationSegmenter.java @@ -348,6 +348,10 @@ public void openModel(final String path) { featureSettings = segmenter.features().settings(); } + public sc.fiji.labkit.pixel_classification.classification.Segmenter getSegmenter() { + return segmenter; + } + @Override public int[] suggestCellSize(ImgPlus image) { if (ImgPlusViewsOld.hasAxis(image, Axes.CHANNEL))