Class LocalIntensityOrderPattern

java.lang.Object
java.lang.Thread
gov.nih.mipav.model.algorithms.AlgorithmBase
gov.nih.mipav.model.algorithms.LocalIntensityOrderPattern
All Implemented Interfaces:
ActionListener, WindowListener, Runnable, EventListener

public class LocalIntensityOrderPattern extends AlgorithmBase
  • Field Details

    • image

      private ModelImage image
    • DEFAULT_INTENSITY_THRESHOLD

      private float DEFAULT_INTENSITY_THRESHOLD
    • DEFAULT_RADIUS

      private float DEFAULT_RADIUS
    • DEFAULT_NUM_SPATIAL_BINS

      private int DEFAULT_NUM_SPATIAL_BINS
    • DEFAULT_NUM_NEIGHBOURS

      private int DEFAULT_NUM_NEIGHBOURS
  • Constructor Details

    • LocalIntensityOrderPattern

      public LocalIntensityOrderPattern()
  • Method Details

    • factorial

      public int factorial(int num)
    • get_permutation_index

      public int get_permutation_index(int[] permutation, int size)
      Parameters:
      permutation - array containing all values from 0 to (size - 1) (input/output).
      size - size of the permutation array.
      Returns:
      permutation index. Compute the position of @a permutation in the lexycographcial sorting of permutations of the given @a size. For example, in the lexicographical ordering, permutations of four elements are listed as [1 2 3 4], [1 2 4 3], [1 3 2 4], [1 3 4 2], [1 4 2 3], [1 4 3 2], [2 1 3 4], ..., [4 3 2 1]. The index can be computed as follows. First pick the first digit perm[1]. This is either 1,2,...,n. For each choice of the first digits, there are (n-1)! other permutations, separated therefore by (n-1)! elements in lexicographical order. Process then the second digit perm[2]. This can be though as finding the lexycotraphical index of perm[2], ..., perm[n], a permutation of n-1 elements. This can be explicitly obtained by taking out 1 from all elements perm[i] > perm[1].
    • patch_cmp

      public float patch_cmp(LocalIntensityOrderPattern.VlLiopDesc liop, int i, int j)
    • patch_swap

      public void patch_swap(LocalIntensityOrderPattern.VlLiopDesc liop, int i, int j)
    • neigh_cmp

      public float neigh_cmp(LocalIntensityOrderPattern.VlLiopDesc liop, int i, int j)
    • neigh_swap

      public void neigh_swap(LocalIntensityOrderPattern.VlLiopDesc liop, int i, int j)
    • vl_liopdesc_new

      public LocalIntensityOrderPattern.VlLiopDesc vl_liopdesc_new(int numNeighbours, int numSpatialBins, float radius, int sideLength)
      Parameters:
      numNeighbours - number of neighbours.
      numSpatialBins - number of bins.
      radius - radius of the cirucal sample neighbourhoods.
      sideLength - width of the input image patch (the patch is square).
      Returns:
      new object instance. The value of @a radius should be at least less than half the @a sideLength of the patch.
    • vl_liopdesc_new_basic

      public LocalIntensityOrderPattern.VlLiopDesc vl_liopdesc_new_basic(int sideLength)
      Parameters:
      sideLength - size of the patches to be processed.
      Returns:
      new object.
    • vl_liopdesc_delete

      public void vl_liopdesc_delete(LocalIntensityOrderPattern.VlLiopDesc self)
      Parameters:
      self - object instance.
    • patch_sort

      public void patch_sort(LocalIntensityOrderPattern.VlLiopDesc array, int size)
      Parameters:
      array - (in/out) pointer to the array.
      size - size of the array. The function sorts the array using quick-sort.
    • patch_sort_recursive

      public void patch_sort_recursive(LocalIntensityOrderPattern.VlLiopDesc array, int begin, int end)
      Parameters:
      array - (in/out) pointer to the array.
      begin - first element of the array portion.
      end - last element of the array portion. The function sorts the array using quick-sort. Note that
    • neigh_sort

      public void neigh_sort(LocalIntensityOrderPattern.VlLiopDesc array, int size)
      Parameters:
      array - (in/out) pointer to the array.
      size - size of the array. The function sorts the array using quick-sort.
    • neigh_sort_recursive

      public void neigh_sort_recursive(LocalIntensityOrderPattern.VlLiopDesc array, int begin, int end)
      Parameters:
      array - (in/out) pointer to the array.
      begin - first element of the array portion.
      end - last element of the array portion. The function sorts the array using quick-sort. Note that
    • vl_liopdesc_process

      public void vl_liopdesc_process(LocalIntensityOrderPattern.VlLiopDesc self, float[] desc, float[] patch)
      Parameters:
      self - object instance
      desc - descriptor to be computed (output).
      patch - patch to process Use ::vl_liopdesc_get_dimension to get the size of the descriptor
    • vl_liopdesc_get_dimension

      public int vl_liopdesc_get_dimension(LocalIntensityOrderPattern.VlLiopDesc self)
      Parameters:
      self - object.
      Returns:
      dimension.
    • vl_liopdesc_get_num_neighbours

      public int vl_liopdesc_get_num_neighbours(LocalIntensityOrderPattern.VlLiopDesc self)
      Parameters:
      self - object.
      Returns:
      number of neighbours.
    • vl_liopdesc_get_intensity_threshold

      public float vl_liopdesc_get_intensity_threshold(LocalIntensityOrderPattern.VlLiopDesc self)
      Parameters:
      self - object.
      Returns:
      intensity threshold.
    • vl_liopdesc_set_intensity_threshold

      public void vl_liopdesc_set_intensity_threshold(LocalIntensityOrderPattern.VlLiopDesc self, float x)
      Parameters:
      self - object.
      x - intensity threshold. If non-negative, the threshold as is is used when comparing intensities. If negative, the absolute value of the specified number is multipled by the maximum intensity difference inside a patch to obtain the threshold.
    • vl_liopdesc_get_neighbourhood_radius

      public double vl_liopdesc_get_neighbourhood_radius(LocalIntensityOrderPattern.VlLiopDesc self)
      Parameters:
      self - object.
      Returns:
      neighbourhood radius.
    • vl_liopdesc_get_num_spatial_bins

      public int vl_liopdesc_get_num_spatial_bins(LocalIntensityOrderPattern.VlLiopDesc self)
      Parameters:
      self - object.
      Returns:
      number of spatial bins.
    • setup

    • test_basic

      public void test_basic()
    • test_blob

      public void test_blob()
    • test_neighbors

      public void test_neighbors()
    • test_multiple

      public void test_multiple()
    • vl_liop

      public float[][] vl_liop(float[][] data, int numNeighbors, int numSpatialBins, float radius, float intensityThreshold)
    • vl_liop

      public float[][] vl_liop(float[][][] data, int numNeighbors, int numSpatialBins, float radius, float intensityThreshold)
    • runAlgorithm

      public void runAlgorithm()
      Description copied from class: AlgorithmBase
      Actually runs the algorithm. Implemented by inheriting algorithms.
      Specified by:
      runAlgorithm in class AlgorithmBase