Package gov.nih.mipav.model.algorithms
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) classclassNested classes/interfaces inherited from class java.lang.Thread
Thread.Builder, Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate floatprivate intprivate intprivate floatprivate ModelImageFields inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
destFlag, destImage, image25D, mask, maxProgressValue, minProgressValue, multiThreadingEnabled, nthreads, progress, progressModulus, progressStep, runningInSeparateThread, separable, srcImage, threadStoppedFields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintfactorial(int num) intget_permutation_index(int[] permutation, int size) floatneigh_cmp(LocalIntensityOrderPattern.VlLiopDesc liop, int i, int j) voidneigh_sort(LocalIntensityOrderPattern.VlLiopDesc array, int size) voidneigh_sort_recursive(LocalIntensityOrderPattern.VlLiopDesc array, int begin, int end) voidneigh_swap(LocalIntensityOrderPattern.VlLiopDesc liop, int i, int j) floatpatch_cmp(LocalIntensityOrderPattern.VlLiopDesc liop, int i, int j) voidpatch_sort(LocalIntensityOrderPattern.VlLiopDesc array, int size) voidpatch_sort_recursive(LocalIntensityOrderPattern.VlLiopDesc array, int begin, int end) voidpatch_swap(LocalIntensityOrderPattern.VlLiopDesc liop, int i, int j) voidActually runs the algorithm.setup()voidvoidvoidvoidfloat[][]vl_liop(float[][][] data, int numNeighbors, int numSpatialBins, float radius, float intensityThreshold) float[][]vl_liop(float[][] data, int numNeighbors, int numSpatialBins, float radius, float intensityThreshold) voidintfloatdoubleintintvl_liopdesc_new(int numNeighbours, int numSpatialBins, float radius, int sideLength) vl_liopdesc_new_basic(int sideLength) voidvl_liopdesc_process(LocalIntensityOrderPattern.VlLiopDesc self, float[] desc, float[] patch) voidMethods inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
actionPerformed, addListener, addProgressChangeListener, calculateImageSize, calculatePrincipleAxis, computeElapsedTime, computeElapsedTime, convertIntoFloat, delinkProgressToAlgorithm, delinkProgressToAlgorithmMulti, displayError, errorCleanUp, finalize, fireProgressStateChanged, fireProgressStateChanged, fireProgressStateChanged, fireProgressStateChanged, fireProgressStateChanged, generateProgressValues, getDestImage, getElapsedTime, getMask, getMaxProgressValue, getMinProgressValue, getNumberOfThreads, getProgress, getProgressChangeListener, getProgressChangeListeners, getProgressModulus, getProgressStep, getProgressValues, getSrcImage, isCompleted, isImage25D, isMultiThreadingEnabled, isRunningInSeparateThread, isThreadStopped, linkProgressToAlgorithm, linkProgressToAlgorithm, makeProgress, notifyListeners, removeListener, removeProgressChangeListener, run, setCompleted, setImage25D, setMask, setMaxProgressValue, setMinProgressValue, setMultiThreadingEnabled, setNumberOfThreads, setProgress, setProgressModulus, setProgressStep, setProgressValues, setProgressValues, setRunningInSeparateThread, setSrcImage, setStartTime, setThreadStopped, startMethod, windowActivated, windowClosed, windowClosing, windowDeactivated, windowDeiconified, windowIconified, windowOpenedMethods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, isVirtual, join, join, join, join, ofPlatform, ofVirtual, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, sleep, start, startVirtualThread, stop, suspend, threadId, toString, yield
-
Field Details
-
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
-
patch_swap
-
neigh_cmp
-
neigh_swap
-
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
- Parameters:
sideLength- size of the patches to be processed.- Returns:
- new object.
-
vl_liopdesc_delete
- Parameters:
self- object instance.
-
patch_sort
- Parameters:
array- (in/out) pointer to the array.size- size of the array. The function sorts the array using quick-sort.
-
patch_sort_recursive
- 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
- Parameters:
array- (in/out) pointer to the array.size- size of the array. The function sorts the array using quick-sort.
-
neigh_sort_recursive
- 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 instancedesc- 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
- Parameters:
self- object.- Returns:
- dimension.
-
vl_liopdesc_get_num_neighbours
- Parameters:
self- object.- Returns:
- number of neighbours.
-
vl_liopdesc_get_intensity_threshold
- 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
- Parameters:
self- object.- Returns:
- neighbourhood radius.
-
vl_liopdesc_get_num_spatial_bins
- 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:AlgorithmBaseActually runs the algorithm. Implemented by inheriting algorithms.- Specified by:
runAlgorithmin classAlgorithmBase
-