Interface SpatialFilter

All Known Implementing Classes:
AbstractComplexKernelFilter, AbstractKernelFilter, BoxBlurFilter, ColourImageFilter, FixedWeightsComplexKernelFilter, FixedWeightsKernelFilter, GaussianBlurFilter, LaplacianFilter, MedianFilter, MorphologicalOperator, PatchSimilarityFilter, SharpenFilter, SobelFilter, SobelFilter.MagnitudeFilter

public interface SpatialFilter
Interface implemented by classes that can spatially filter images.
  • Field Details

    • FILTERING_STRING

      static final String FILTERING_STRING
      A String showing what action is being performed.
      See Also:
  • Method Details

    • filter

      Filter a ReadableImage, returning a new image which is a filtered version of the supplied image.
      Parameters:
      image - the image to be filtered.
      logger - the Logger for verbose reporting and error messages.
      Returns:
      a filtered version of the supplied image.
      Throws:
      InvalidImageException - if the supplied image cannot be filtered with this filter.
      IOException - if an I/O error occurs.
    • filter

      Filter a ReadableImage, returning a new image which is a filtered version of the supplied image.
      Parameters:
      image - the image to be filtered.
      worker - the MonitorWorker that may be used to cancel the filter operation.
      logger - the Logger for verbose reporting and error messages.
      Returns:
      a filtered version of the supplied image.
      Throws:
      InvalidImageException - if the supplied image cannot be filtered with this filter.
      IOException - if an I/O error occurs.
      CancelledException - if the filter operation is cancelled by the user or programmatically.
    • filterInPlace

      void filterInPlace(WritableImage image, Logger logger) throws InvalidImageException, IOException
      Filter a WritableImage "in place".
      Parameters:
      image - the image to be filtered.
      logger - the Logger for verbose reporting and error messages.
      Throws:
      InvalidImageException - if the supplied image cannot be filtered with this filter.
      IOException - if an I/O error occurs.
    • filterInPlace

      void filterInPlace(WritableImage image, MonitorWorker worker, Logger logger) throws InvalidImageException, IOException, CancelledException
      Filter a WritableImage "in place".
      Parameters:
      image - the image to be filtered.
      worker - the MonitorWorker that may be used to cancel the filter operation.
      logger - the Logger for verbose reporting and error messages.
      Throws:
      InvalidImageException - if the supplied image cannot be filtered with this filter.
      CancelledException - if the filter operation is cancelled by the user or programmatically.
      IOException - if an I/O error occurs.
    • filterInPlace

      void filterInPlace(Object pixels, PixelDataType dataType, int nCols, int nRows, int nSlices, Logger logger)
      Filter an array of pixel values "in place".
      Parameters:
      pixels - the array of image pixel values.
      dataType - the PixelDataType of the pixels.
      nCols - the number of image columns.
      nRows - the number of image rows.
      nSlices - the number of image slices.
      logger - the Logger for verbose reporting and error messages.
    • filterInPlace

      void filterInPlace(Object pixels, PixelDataType dataType, int nCols, int nRows, int nSlices, MonitorWorker worker, Logger logger) throws CancelledException
      Filter an array of pixel values "in place".
      Parameters:
      pixels - the array of image pixel values.
      dataType - the PixelDataType of the pixels.
      nCols - the number of image columns.
      nRows - the number of image rows.
      nSlices - the number of image slices.
      worker - the MonitorWorker that may be used to cancel the filter operation.
      logger - the Logger for verbose reporting and error messages.
      Throws:
      CancelledException - if the filter operation is cancelled by the user or programmatically.
    • removeNaNs

      static void removeNaNs(float[] pixels, int nCols, int nRows, int nSlices, int maxIterations, BoundaryCondition bc, MonitorWorker worker) throws CancelledException
      Remove NaN (not-a-number) pixel intensity values from an array of single-precision floating-point pixel values. The NaN values are substituted by averaging the (non-NaN) pixel intensity values in the adjacent pixels. This is done iteratively until either all NaNs are removed or the maximum number of iterations is exceeded.
      Not necessarily all non-NaN values will be substituted, since there may be large patches of NaNs where the adjacent non-NaNs do not propagate to cover the NaNs.
      Parameters:
      pixels - the pixel values that may contain NaN values and on return will have NaN values substituted.
      nCols - the number of columns in the float pixel array.
      nRows - the number of rows in the float pixel array.
      nSlices - the number of slices in the float pixel array.
      maxIterations - the maximum number of iterations of substitution.
      bc - the BoundaryCondition for pixels at the boundary of the image.
      worker - if non-null, the MonitorWorker by which the operation can be cancelled.
      Throws:
      CancelledException - if the operation is cancelled by the user.
    • removeNaNs

      static void removeNaNs(double[] pixels, int nCols, int nRows, int nSlices, int maxIterations, BoundaryCondition bc, MonitorWorker worker) throws CancelledException
      Remove NaN (not-a-number) pixel intensity values from an array of double-precision floating-point pixel values. The NaN values are substituted by averaging the (non-NaN) pixel intensity values in the adjacent pixels. This is done iteratively until either all NaNs are removed or the maximum number of iterations is exceeded.
      Not necessarily all non-NaN values will be substituted, since there may be large patches of NaNs where the adjacent non-NaNs do not propagate to cover the NaNs.
      Parameters:
      pixels - the pixel values that may contain NaN values and on return will have NaN values substituted.
      nCols - the number of columns in the float pixel array.
      nRows - the number of rows in the float pixel array.
      nSlices - the number of slices in the float pixel array.
      maxIterations - the maximum number of iterations of substitution.
      bc - the BoundaryCondition for pixels at the boundary of the image.
      worker - if non-null, the MonitorWorker by which the operation can be cancelled.
      Throws:
      CancelledException - if the operation is cancelled by the user.