diff --git a/src/main/java/fr/pasteur/ida/zellige/gui/interactor/SelectionInteractor.java b/src/main/java/fr/pasteur/ida/zellige/gui/interactor/SelectionInteractor.java index 058aa0d5092ef7a86d84e10192d0b1dd181ae23e..b3c26c38cf5f4b90b4b8d87ff74d060e997e28ad 100644 --- a/src/main/java/fr/pasteur/ida/zellige/gui/interactor/SelectionInteractor.java +++ b/src/main/java/fr/pasteur/ida/zellige/gui/interactor/SelectionInteractor.java @@ -31,7 +31,7 @@ public class SelectionInteractor public void runOtsuTask() { - OtsuThresholdingTask otsuTask = new OtsuThresholdingTask( model.pretreatedImgProperty(), model.imagesProperty().get().getOtsuImg(), model.otsuProperty().getValue().intValue() ); + OtsuThresholdingTask otsuTask = new OtsuThresholdingTask( model.pretreatedImgProperty().get(), model.imagesProperty().get().getOtsuImg(), model.otsuProperty().getValue().intValue() ); otsuTask.setOnSucceeded( workerStateEvent -> model.selectedOtsuProperty().setValue( otsuTask.getValue() ) ); // otsuTask.setOnFailed( workerStateEvent -> LOGGER.debug( "Otsu classification has failed." ) ); @@ -40,14 +40,14 @@ public class SelectionInteractor public void runInterClassification() { - InterClassificationTask interClassificationTask = new InterClassificationTask( model.selectedAmplitudeProperty(), model.selectedOtsuProperty() ); + InterClassificationTask interClassificationTask = new InterClassificationTask( model.selectedAmplitudeProperty().get(), model.selectedOtsuProperty().get() ); interClassificationTask.setOnSucceeded( event -> model.interClassifiedImageProperty().setValue( interClassificationTask.getValue() ) ); interClassificationTask.start(); } public void runIslandSearch() { - IslandSearchTask islandSearchTask = new IslandSearchTask( model.interClassifiedImageProperty(), model.islandProperty() ); + IslandSearchTask islandSearchTask = new IslandSearchTask( model.interClassifiedImageProperty().get(), model.islandProperty().get() ); islandSearchTask.setOnSucceeded( workerStateEvent -> model.islandSearchImageProperty().setValue( islandSearchTask.getValue() ) ); // islandSearchTask.setOnFailed( workerStateEvent -> LOGGER.debug( "FAILED" ) ); @@ -56,7 +56,10 @@ public class SelectionInteractor public void runSmoothing() { - SmoothingTask smoothingTask = new SmoothingTask( model.islandSearchImageProperty(), model.xyBlurProperty(), model.zBlurProperty() ); + SmoothingTask smoothingTask = new SmoothingTask( + model.islandSearchImageProperty().get(), + model.xyBlurProperty().get(), + model.zBlurProperty().get() ); smoothingTask.setOnSucceeded( event -> model.selectedPixelsProperty().setValue( smoothingTask.getValue() ) ); smoothingTask.start(); diff --git a/src/main/java/fr/pasteur/ida/zellige/gui/task/InterClassificationTask.java b/src/main/java/fr/pasteur/ida/zellige/gui/task/InterClassificationTask.java index 20b064b3f633f25c8294c3ae63e886ba8fab99dc..99f372674444dee115229bf11b7521aa7532912e 100644 --- a/src/main/java/fr/pasteur/ida/zellige/gui/task/InterClassificationTask.java +++ b/src/main/java/fr/pasteur/ida/zellige/gui/task/InterClassificationTask.java @@ -29,7 +29,6 @@ package fr.pasteur.ida.zellige.gui.task; import fr.pasteur.ida.zellige.steps.selection.classification.Classification; -import javafx.beans.property.SimpleObjectProperty; import net.imglib2.img.Img; import net.imglib2.type.logic.BitType; import org.slf4j.Logger; @@ -41,10 +40,10 @@ public class InterClassificationTask extends AbstractTask< Img< BitType > > { private final static Logger LOGGER = LoggerFactory.getLogger( InterClassificationTask.class ); - private final SimpleObjectProperty< Img< BitType > > selectedAmplitude; - private final SimpleObjectProperty< Img< BitType > > selectedOtsu; + private final Img< BitType >selectedAmplitude; + private final Img< BitType >selectedOtsu; - public InterClassificationTask( SimpleObjectProperty< Img< BitType > > selectedAmplitude, SimpleObjectProperty< Img< BitType > > selectedOtsu ) + public InterClassificationTask( Img< BitType > selectedAmplitude, Img< BitType > selectedOtsu ) { this.selectedAmplitude = selectedAmplitude; this.selectedOtsu = selectedOtsu; @@ -56,7 +55,7 @@ public class InterClassificationTask extends AbstractTask< Img< BitType > > { LOGGER.info(GUI_MARKER, "Computing inter-classification..." ); - return Classification.interClassification( selectedAmplitude.getValue(), selectedAmplitude.getValue().factory(), selectedOtsu.getValue() ); + return Classification.interClassification( selectedAmplitude, selectedAmplitude.factory(), selectedOtsu ); } diff --git a/src/main/java/fr/pasteur/ida/zellige/gui/task/IslandSearchTask.java b/src/main/java/fr/pasteur/ida/zellige/gui/task/IslandSearchTask.java index b20c2eaa2f61f93ffbc98255d305880169a4dd56..b0935401d6ac7b9219b5913561580ad4106add2b 100644 --- a/src/main/java/fr/pasteur/ida/zellige/gui/task/IslandSearchTask.java +++ b/src/main/java/fr/pasteur/ida/zellige/gui/task/IslandSearchTask.java @@ -29,8 +29,6 @@ package fr.pasteur.ida.zellige.gui.task; import fr.pasteur.ida.zellige.steps.selection.postTreatment.PostTreatment; -import javafx.beans.property.IntegerProperty; -import javafx.beans.property.SimpleObjectProperty; import net.imglib2.img.Img; import net.imglib2.type.logic.BitType; import org.slf4j.Logger; @@ -42,10 +40,10 @@ public class IslandSearchTask extends AbstractTask< Img< BitType > > { private final static Logger LOGGER = LoggerFactory.getLogger( IslandSearchTask.class ); - private final SimpleObjectProperty< Img< BitType > > image; - private final IntegerProperty islandSize; + private final Img< BitType > image; + private final int islandSize; - public IslandSearchTask( SimpleObjectProperty< Img< BitType > > image, IntegerProperty islandSize ) + public IslandSearchTask( Img< BitType > image, int islandSize ) { this.image = image; this.islandSize = islandSize; @@ -55,7 +53,7 @@ public class IslandSearchTask extends AbstractTask< Img< BitType > > protected Img< BitType > call() { LOGGER.info( GUI_MARKER,"Computing Island Search..." ); - Img< BitType > img = PostTreatment.runIslandSearch( image.getValue(), islandSize.intValue() ); + Img< BitType > img = PostTreatment.runIslandSearch( image, islandSize ); LOGGER.info( GUI_MARKER,"Task's end." ); return img; // return iSImage; diff --git a/src/main/java/fr/pasteur/ida/zellige/gui/task/OtsuThresholdingTask.java b/src/main/java/fr/pasteur/ida/zellige/gui/task/OtsuThresholdingTask.java index 0c47372cea3055a2692b6e2eabccbf34d768a962..62bbef2359ea83aeaa05d746056932e1f5737299 100644 --- a/src/main/java/fr/pasteur/ida/zellige/gui/task/OtsuThresholdingTask.java +++ b/src/main/java/fr/pasteur/ida/zellige/gui/task/OtsuThresholdingTask.java @@ -29,7 +29,6 @@ package fr.pasteur.ida.zellige.gui.task; import fr.pasteur.ida.zellige.steps.selection.classification.OtsuClassification; -import javafx.beans.property.SimpleObjectProperty; import net.imglib2.img.Img; import net.imglib2.type.logic.BitType; import net.imglib2.type.numeric.real.FloatType; @@ -42,12 +41,12 @@ public class OtsuThresholdingTask extends AbstractTask< Img< BitType > > { private final static Logger LOGGER = LoggerFactory.getLogger( OtsuThresholdingTask.class ); - private final SimpleObjectProperty< Img< FloatType > > pretreatedImage; + private final Img< FloatType > pretreatedImage; private final Img<FloatType> input; private final int otsuThreshold; - public OtsuThresholdingTask( SimpleObjectProperty< Img< FloatType > > pretreatedImage, Img<FloatType> input, int otsuThreshold ) + public OtsuThresholdingTask( Img< FloatType > pretreatedImage, Img<FloatType> input, int otsuThreshold ) { this.pretreatedImage = pretreatedImage; this.input = input; @@ -58,7 +57,7 @@ public class OtsuThresholdingTask extends AbstractTask< Img< BitType > > protected Img< BitType > call() { LOGGER.info( GUI_MARKER,"Computing otsu thresholding..." ); - Img< BitType > output = OtsuClassification.applyLocalThreshold( pretreatedImage.getValue(), input, otsuThreshold ); + Img< BitType > output = OtsuClassification.applyLocalThreshold( pretreatedImage, input, otsuThreshold ); LOGGER.info( GUI_MARKER,"Amplitude thresholds computed..." ); return output; } diff --git a/src/main/java/fr/pasteur/ida/zellige/gui/task/SmoothingTask.java b/src/main/java/fr/pasteur/ida/zellige/gui/task/SmoothingTask.java index dd3d7110363b1237eeb3d15dba76650e4e77ef49..9d077bccdc9ba74fa93fc1c9af2506f035713b86 100644 --- a/src/main/java/fr/pasteur/ida/zellige/gui/task/SmoothingTask.java +++ b/src/main/java/fr/pasteur/ida/zellige/gui/task/SmoothingTask.java @@ -29,8 +29,6 @@ package fr.pasteur.ida.zellige.gui.task; import fr.pasteur.ida.zellige.steps.selection.postTreatment.PostTreatment; -import javafx.beans.property.IntegerProperty; -import javafx.beans.property.SimpleObjectProperty; import net.imglib2.img.Img; import net.imglib2.type.logic.BitType; import net.imglib2.type.numeric.real.FloatType; @@ -43,11 +41,11 @@ public class SmoothingTask extends AbstractTask<Img < FloatType >> { private final static Logger LOGGER = LoggerFactory.getLogger( SmoothingTask.class ); - private final SimpleObjectProperty< Img< BitType > > islandSearchImage; - private final IntegerProperty sigmaXY; - private final IntegerProperty sigmaZ; + private final Img< BitType > islandSearchImage; + private final int sigmaXY; + private final int sigmaZ; - public SmoothingTask( SimpleObjectProperty< Img< BitType > > islandSearchImage, IntegerProperty sigmaXY, IntegerProperty sigmaZ ) + public SmoothingTask( Img< BitType > islandSearchImage, int sigmaXY, int sigmaZ ) { this.islandSearchImage = islandSearchImage; this.sigmaXY = sigmaXY; @@ -58,6 +56,6 @@ public class SmoothingTask extends AbstractTask<Img < FloatType >> protected Img<FloatType> call() throws Exception { LOGGER.info( GUI_MARKER,"Computing first smoothing..." ); - return PostTreatment.runSmoothing( islandSearchImage.getValue(), sigmaXY.intValue(), sigmaZ.intValue() ); + return PostTreatment.runSmoothing( islandSearchImage, sigmaXY, sigmaZ ); } }