Class DijkstraMinCostPath
- java.lang.Object
-
- gov.nih.mipav.view.renderer.flythroughview.DijkstraMinCostPath
-
public class DijkstraMinCostPath extends java.lang.Object
Implementation of the Dijkstra minimum cost path algorithm through a binary volume.
-
-
Field Summary
Fields Modifier and Type Field Description private DijkstraCostItem[]
m_akVolumeCost
Array of cost information for each sample.private int
m_iIndexFurthestDistance
Linear array index of the sample that is the furthest away from the starting sample.
-
Constructor Summary
Constructors Constructor Description DijkstraMinCostPath(ModelImage3DLayout kVolumeLayout, short[] asVolumeData, int iMaskConnected, int iIndexStart, float[] afBoundaryDist, int iMaskPreviousPath, int iMaskPreviousPathNeighbor)
Compute the minimum cost path through the 26-connected specified volume of samples, only considering those samples which are marked with the specified mask and starting at the specified sample.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dispose()
Called to free up object memory for member data.void
finalize()
Called by garbage collector to free up object memory.int
getIndexFurthestDistance()
Get the index of the volume sample stored in a linear array which is at the end of the longest minimum cost path.int[]
getIndexPath()
Get the indexes of the samples extracted along the longest minimum cost path.
-
-
-
Field Detail
-
m_akVolumeCost
private DijkstraCostItem[] m_akVolumeCost
Array of cost information for each sample. If an item in the array is null, then that means the sample in the volume is not being considered for being in the path.
-
m_iIndexFurthestDistance
private int m_iIndexFurthestDistance
Linear array index of the sample that is the furthest away from the starting sample.
-
-
Constructor Detail
-
DijkstraMinCostPath
DijkstraMinCostPath(ModelImage3DLayout kVolumeLayout, short[] asVolumeData, int iMaskConnected, int iIndexStart, float[] afBoundaryDist, int iMaskPreviousPath, int iMaskPreviousPathNeighbor)
Compute the minimum cost path through the 26-connected specified volume of samples, only considering those samples which are marked with the specified mask and starting at the specified sample.- Parameters:
kVolumeLayout
- description of the layout of the volumeasVolumeData
- linear array of signed 16-bit data values for each sample in the volume. The values are assumed to be bit masks which are being used to classify each sample.iMaskConnected
- bit mask used to select which classification of samples to consider for the pathiIndexStart
- linear array index into the volume for the sample which is assumed to be the starting point for all paths to be consideredafBoundaryDist
- linear array of floating distances to the nearest boundary. This can be used to create a penalty cost for being close to the boundary, depending on whether the iMaskPreviousPath and iMaskPreviousPathNeighbor are not zero.iMaskPreviousPath
- bit mask used to classify which samples are already part of a previously defined path. If this value is zero, then the penalty cost is not applied.iMaskPreviousPathNeighbor
- bit mask used to classify which samples are neighbors of a previously defined path. If this value is zero, then the penalty cost is not applied.
-
-
Method Detail
-
dispose
public void dispose()
Called to free up object memory for member data.
-
finalize
public void finalize()
Called by garbage collector to free up object memory.- Overrides:
finalize
in classjava.lang.Object
-
getIndexFurthestDistance
public int getIndexFurthestDistance()
Get the index of the volume sample stored in a linear array which is at the end of the longest minimum cost path.- Returns:
- int Index of volume sample stored in a linear array.
-
getIndexPath
public int[] getIndexPath()
Get the indexes of the samples extracted along the longest minimum cost path.- Returns:
- int[] Array of indexes into volume stored in a linear array for the samples extracted along the longest minimum cost path. The order of the points in the array defines the connectivity of the points to create the path.
-
-