.. java:import:: ch.epfl.leb.defcon.predictors ImageBitDepthException .. java:import:: ch.epfl.leb.defcon.predictors SessionClosedException .. java:import:: ch.epfl.leb.defcon.predictors NoLocalCountMapException .. java:import:: ch.epfl.leb.defcon.predictors UninitializedPredictorException .. java:import:: ch.epfl.leb.defcon.predictors Predictor .. java:import:: ij.gui Roi .. java:import:: ij ImagePlus .. java:import:: ij.process ByteProcessor .. java:import:: ij.process FloatProcessor .. java:import:: ij.process ShortProcessor .. java:import:: ij.process ImageProcessor .. java:import:: ij.plugin.filter Convolver .. java:import:: java.awt Rectangle .. java:import:: java.util Arrays .. java:import:: java.util.logging Level .. java:import:: java.util.logging Logger .. java:import:: org.tensorflow Tensor DefaultPredictor ================ .. java:package:: ch.epfl.leb.defcon.predictors.internal :noindex: .. java:type:: public class DefaultPredictor extends AbstractPredictor implements Predictor Makes density map predictions from images. :author: Baptiste Ottino, Kyle M. Douglass Methods ------- finalize ^^^^^^^^ .. java:method:: @Override protected void finalize() throws Throwable :outertype: DefaultPredictor Failsafe in case the TensorFlow session has not been closed. :throws java.lang.Throwable: getCount ^^^^^^^^ .. java:method:: @Override public double getCount() throws UninitializedPredictorException :outertype: DefaultPredictor Returns the most recent count. :throws ch.epfl.leb.defcon.predictors.UninitializedPredictorException: :return: The predicted count from the density map. getDensityMap ^^^^^^^^^^^^^ .. java:method:: public FloatProcessor getDensityMap() throws UninitializedPredictorException :outertype: DefaultPredictor Returns the most recently calculated density map prediction. :throws ch.epfl.leb.defcon.predictors.UninitializedPredictorException: :return: The predicted density map. getLocalCountMap ^^^^^^^^^^^^^^^^ .. java:method:: @Override public FloatProcessor getLocalCountMap() throws NoLocalCountMapException :outertype: DefaultPredictor Returns the most recently-calculated local count map. :throws ch.epfl.leb.defcon.predictors.NoLocalCountMapException: :return: The most recently calculated local count map. getMaximumLocalCount ^^^^^^^^^^^^^^^^^^^^ .. java:method:: @Override public double getMaximumLocalCount(int boxSize) throws UninitializedPredictorException :outertype: DefaultPredictor Returns the maximum local count value. This value is obtained by convolving the density map with a square kernel whose values are all 1 and then taking the maximum of the resulting map. It effectively produces the highest count value over length scales equal to the size of the kernel. :param boxSize: The width of the square kernel. :throws ch.epfl.leb.defcon.predictors.UninitializedPredictorException: :return: The maximum local count from the density map. predict ^^^^^^^ .. java:method:: @Override public void predict(ImageProcessor ip) throws ImageBitDepthException, SessionClosedException :outertype: DefaultPredictor Makes a density map prediction from a 2D image. If either of the image's width or height is not divisible by 4, they will be cropped to the next largest multiple of four. :param ip: The image to perform a prediction on. :throws ch.epfl.leb.defcon.predictors.ImageBitDepthException: :throws ch.epfl.leb.defcon.predictors.SessionClosedException: