|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbr.usp.ime.klava.segmentit.structures.HierarchyManager
public class HierarchyManager
Manages hierarchical operations over an image.
| Constructor Summary | |
|---|---|
HierarchyManager(PrimitiveCatchmentBasinsGraph graph,
HierarchyCriterion hierarchyCriterion,
java.awt.image.BufferedImage originalImage)
Constructs a hierarchical set of nested partitions of graph |
|
HierarchyManager(PrimitiveCatchmentBasinsGraph graph,
HierarchyCriterion hierarchyCriterion,
int[] labels,
java.awt.Point selectedPixel,
java.awt.image.BufferedImage originalImage)
Constructs a hierarchical set of nested partitions of graph |
|
HierarchyManager(PrimitiveCatchmentBasinsGraph graph,
HierarchyCriterion hierarchyCriterion,
Pixel[][] initialPartition,
java.awt.Point selectedPixel,
java.awt.image.BufferedImage originalImage)
Constructs a hierarchical set of nested partitions of the vertices of the graph |
|
| Method Summary | |
|---|---|
boolean |
belongsToEnabledRegion(int x,
int y)
Returns if the pixel located at ( x,y) belongs
to the region where the hierarchy operations are restricted to. |
int[] |
getActiveLabels()
Returns the active labels of each leaf node of the hierarchy. |
int |
getEdgeWeightIndex(int weight)
Returns the index of the given weight in the array of
existing edges weights. |
PrimitiveCatchmentBasinsGraph |
getGraphFromFilteredImage()
Returns the PrimitiveCatchmentBasinsGraph derived from the
filtered imaged used in this HierarchyManager. |
HierarchyNode |
getHierarchyRoot()
Returns the root node of the hierarchy. |
java.awt.image.BufferedImage |
getMarkersImage()
Returns markers that recovers exactly the selected partition when applied back on the RAG. |
int[] |
getTCLWeights()
Returns the weights of the edges in the hierarchy. |
int |
getWeight(int index)
Returns the hierarchy weight associated with index |
boolean |
isMergeEnabled(int x,
int y)
Returns if the merge local operation is available for the current active region that contains the pixel located at ( x,y
). |
boolean |
isRefineEnabled(int x,
int y)
Returns if the split local operation is available in the current active region that contains the pixel located at ( x,y
). |
boolean |
isRootActive()
Returns if the hierarchy root is active (the selected partitions is the coarsest possible). |
HierarchyNode |
merge(int x,
int y)
Merges the region that contains the pixel located at ( x,
y). |
java.awt.image.BufferedImage |
paintSelectedPartition()
Returns an image with the selected partition painted. |
java.awt.image.BufferedImage |
paintSelectedPartition(HierarchyNode hierarchyNode)
Returns an image with the selected partition painted. |
void |
randomizeColors()
Randomizes the Colors of the underlying
TreeOfCriticalLakes. |
HierarchyState |
redo()
Redoes an action, if possible. |
HierarchyNode |
refine(int x,
int y)
Splits the region that contains the pixel located at ( x,
y). |
void |
setCriterion(HierarchyCriterion hierarchyCriterion,
boolean storeState)
Derives a nested partitions set using the given hierarchyCriterion. |
void |
setDisplayOnlySelectedRegion(boolean displayOnlySelectedRegion)
Sets if only the region where the operation are restricted to should be displayed. |
void |
setThreshold(int threshold,
boolean storeState)
Selects a partition on the hierarchy according to a threshold value. |
static void |
setTreeOfCriticalLakesBuilder(TreeOfCriticalLakesBuilderIF treeOfCriticalLakesBuilder)
Sets a TreeOfCriticalLakesBuilderIF to build
TreeOfCriticalLakes in this HierarchyManager |
HierarchyState |
undo()
Undoes an action, if possible. |
void |
weldLabels(java.util.Collection<java.lang.Integer> labelsToWeld)
Welds the regions whose labels are in labelsToWeld. |
boolean |
weldMarkedPixels(java.lang.Boolean[][] markedPixels)
Welds the regions that contains any markedPixels. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HierarchyManager(PrimitiveCatchmentBasinsGraph graph,
HierarchyCriterion hierarchyCriterion,
Pixel[][] initialPartition,
java.awt.Point selectedPixel,
java.awt.image.BufferedImage originalImage)
throws ColorImageException
graph.
- Parameters:
graph - a PrimitiveCatchmentBasinsGraph from which the
hierarchy will be builthierarchyCriterion - the criterion from which the partitions are derivedinitialPartition - a partition desired to be localized at the hierarchyselectedPixel - the coordinates of a pixel of the region of
initialPartition which the operations will be
restricted tooriginalImage - the original image
- Throws:
ColorImageException - if originalImage is not a gray level image and the
hierarchyCriterion do not support color images
public HierarchyManager(PrimitiveCatchmentBasinsGraph graph,
HierarchyCriterion hierarchyCriterion,
int[] labels,
java.awt.Point selectedPixel,
java.awt.image.BufferedImage originalImage)
throws ColorImageException
graph.
- Parameters:
graph - a graph of primitive catchment basins from which the hierarchy
will be builthierarchyCriterion - the criterion from which the partitions are derivedlabels - a labeling that corresponds to a partition desired to be
localized at the hierarchyselectedPixel - a pixel of the region of initialPartition which
the operations will be restricted tooriginalImage - the original image
- Throws:
ColorImageException - if originalImage is not a gray level image and the
hierarchyCriterion do not support color images
public HierarchyManager(PrimitiveCatchmentBasinsGraph graph,
HierarchyCriterion hierarchyCriterion,
java.awt.image.BufferedImage originalImage)
throws ColorImageException
graph.
- Parameters:
graph - a graph of primitive catchment basins from which the hierarchy
will be builthierarchyCriterion - the criterion from which the partitions are derivedoriginalImage - the original image
- Throws:
ColorImageException - if originalImage is not a gray level image and the
hierarchyCriterion do not support color images
| Method Detail |
|---|
public boolean weldMarkedPixels(java.lang.Boolean[][] markedPixels)
markedPixels.
markedPixels - Boolean matrix indicating which pixels are markedpublic void weldLabels(java.util.Collection<java.lang.Integer> labelsToWeld)
labelsToWeld.
labelsToWeld - the labels of the regions to be welded
public void setCriterion(HierarchyCriterion hierarchyCriterion,
boolean storeState)
hierarchyCriterion.
hierarchyCriterion - a HierarchyCriterion from which the partitions
are derivedstoreState - if the new state must be store for undo/redo
public void setThreshold(int threshold,
boolean storeState)
threshold value.
threshold - the threshold value to select a partition in the hierarchystoreState - if the new state must be store for undo/redopublic int[] getActiveLabels()
public java.awt.image.BufferedImage paintSelectedPartition()
public java.awt.image.BufferedImage paintSelectedPartition(HierarchyNode hierarchyNode)
hierarchyNode - the HierarchyNode that needs to be painted
public HierarchyNode refine(int x,
int y)
x,
y).
x - the x-coordinate of a pixely - the y-coordinate of a pixel
HierarchyNode that was refined, null if
the refine operation was not enabled
public boolean isRefineEnabled(int x,
int y)
x,y
).
x - the x-coordinate of a pixely - the y-coordinate of a pixel
true if the split local operation is available for
the current active region that contains the pixel located at (
x,y)
public HierarchyNode merge(int x,
int y)
x,
y).
x - the x-coordinate of a pixely - the y-coordinate of a pixel
HierarchyNode selected by this merging operation,
null if the merge operation was not enabled
public boolean isMergeEnabled(int x,
int y)
x,y
).
x - the x-coordinate of a pixely - the y-coordinate of a pixel
true if the merge local operation is available for
the current active region that contains the pixel located at (
x,y)
public boolean belongsToEnabledRegion(int x,
int y)
x,y) belongs
to the region where the hierarchy operations are restricted to.
x - the x-coordinate of a pixely - the y-coordinate of a pixel
true if the pixel located at (x,
y) belongs to the region where the hierarchy
operations are restricted topublic java.awt.image.BufferedImage getMarkersImage()
public void setDisplayOnlySelectedRegion(boolean displayOnlySelectedRegion)
displayOnlySelectedRegion - true if only the region where the operation are
restricted to should be displayedpublic HierarchyState undo()
null if not action was undone.public HierarchyState redo()
null if not action was redone.public boolean isRootActive()
public int[] getTCLWeights()
public int getWeight(int index)
index
index - the order of the desired weight in the ordered weights
indexpublic int getEdgeWeightIndex(int weight)
weight in the array of
existing edges weights.
weight - the weight of an edge
weight in the array of
existing edges weights, or a negative int if there
is none edge whose weight is equal to weightpublic HierarchyNode getHierarchyRoot()
public PrimitiveCatchmentBasinsGraph getGraphFromFilteredImage()
PrimitiveCatchmentBasinsGraph derived from the
filtered imaged used in this HierarchyManager.
PrimitiveCatchmentBasinsGraph used in this
HierarchyManagerpublic void randomizeColors()
Colors of the underlying
TreeOfCriticalLakes.
public static void setTreeOfCriticalLakesBuilder(TreeOfCriticalLakesBuilderIF treeOfCriticalLakesBuilder)
TreeOfCriticalLakesBuilderIF to build
TreeOfCriticalLakes in this HierarchyManager
treeOfCriticalLakesBuilder - an implementation of TreeOfCriticalLakesBuilderIF
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||