|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbr.usp.ime.klava.segmentit.structures.TreeOfCriticalLakes
public class TreeOfCriticalLakes
Represents an hierarchical set of nested partitions.
Extensions of this class can be used in SegmentIt by setting an
implementation of TreeOfCriticalLakesBuilderIF
in
HierarchyManager.setTreeOfCriticalLakesBuilder(TreeOfCriticalLakesBuilderIF)
.
Constructor Summary | |
---|---|
TreeOfCriticalLakes(PrimitiveCatchmentBasinsGraph graph,
HierarchyCriterion criterion,
int[] labels,
java.awt.Point selectedPixel,
int[] desiredLabels)
Creates a hierarchy of nested partitions. |
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. |
HierarchyNode |
getActiveBasin(int x,
int y)
Returns the the active basin that contains the pixel located at ( x ,y ). |
int[] |
getActiveLabels()
Returns the active labels of each leaf node of the hierarchy. |
int |
getEdgeWeightIndex(int index)
Returns the hierarchy weight associated with index |
HierarchyCriterion |
getHierarchyCriterion()
Returns the HierarchyCriterion utilized to build the nested
partitions set. |
HierarchyNode |
getHierarchyRoot()
Returns the root node of the hierarchy. |
int |
getLabelActiveBasin(int x,
int y)
Returns the label of the active basin that contains the pixel located at ( x ,y ). |
int |
getMaxEdgeValue()
Returns the greatest edge weight existing in the spanning tree from which the hierarchy was built. |
int |
getMaxLabel()
Returns the last nextAvailableLabel used for a
HierarchyNode in this hierarchy. |
int |
getNextAvailableLabel()
Returns the nextAvailableLabel for a HierarchyNode in
this hierarchy, incrementing in. |
HierarchyNode |
getNode(int label)
Returns the PrimitiveCatchmentBasin labeled by
label . |
int |
getNumNodes()
Returns the number of nodes in this hierarchy. |
PrimitiveCatchmentBasinsGraph |
getRAG()
Returns the PrimitiveCatchmentBasinsGraph from which this
hierarchy was built. |
int[] |
getWeights()
Returns the weights of the edges in the hierarchy. |
boolean |
isDerivedFromInitialPartition()
|
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(boolean onlySelectedRegion)
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 Color s associated with the HierarchyNode s
of this TreeOfCriticalLakes . |
void |
rebuildTCLUsingLabels(int[] desiredLabels)
Rebuilds the hierarchy in order to contain and selecting the partition defined by desiredLabels . |
HierarchyNode |
refine(int x,
int y)
Splits the region that contains the pixel located at ( x ,
y ). |
void |
setThreshold(int threshold)
Selects a partition on the hierarchy according to a threshold value. |
void |
weldLabels(java.util.Collection<java.lang.Integer> labelsToWeld)
Rebuilds the hierarchy welding the regions whose labels are in labelsToWeld . |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TreeOfCriticalLakes(PrimitiveCatchmentBasinsGraph graph, HierarchyCriterion criterion, int[] labels, java.awt.Point selectedPixel, int[] desiredLabels)
desiredLabels
.
graph
- the PrimitiveCatchmentBasinsGraph
which nodes will be
the leafs of this hierarchycriterion
- the HierarchyCriterion
used to build the hierarchylabels
- a labeling for the hierarchy nodes that defines an initial
partition that must be localized in the hierarchyselectedPixel
- a Pixel
belonging to the region of the initial
partitiondesiredLabels
- a labeling for the hierarchy nodes that defines a partition
that must be localized in the hierarchy, partition which will
be the active (selected) oneMethod Detail |
---|
public HierarchyCriterion getHierarchyCriterion()
HierarchyCriterion
utilized to build the nested
partitions set.
HierarchyCriterion
utilized to build the nested
partitions setpublic int getNextAvailableLabel()
nextAvailableLabel
for a HierarchyNode
in
this hierarchy, incrementing in.
nextAvailableLabel
for a HierarchyNode
in
this hierarchypublic int getMaxLabel()
nextAvailableLabel
used for a
HierarchyNode
in this hierarchy.
nextAvailableLabel
used for a
HierarchyNode
in this hierarchypublic PrimitiveCatchmentBasinsGraph getRAG()
PrimitiveCatchmentBasinsGraph
from which this
hierarchy was built.
PrimitiveCatchmentBasinsGraph
from which this
hierarchy was builtpublic int getMaxEdgeValue()
public int getNumNodes()
public void weldLabels(java.util.Collection<java.lang.Integer> labelsToWeld)
labelsToWeld
.
labelsToWeld
- the labels of the regions to be weldedpublic void rebuildTCLUsingLabels(int[] desiredLabels)
desiredLabels
.
desiredLabels
- a labeling for this hierarchy leaf nodes, defining a desired
partitionpublic int getLabelActiveBasin(int x, int y)
x
,y
).
x
- the x-coordinate of a pixely
- the y-coordinate of a pixel
x
,y
)public HierarchyNode getActiveBasin(int x, int y)
x
,y
).
x
- the x-coordinate of a pixely
- the y-coordinate of a pixel
x
,y
)public HierarchyNode getNode(int label)
PrimitiveCatchmentBasin
labeled by
label
.
label
- a label associate to a PrimitiveCatchmentBasin
PrimitiveCatchmentBasin
labeled by
label
public int[] getWeights()
public void setThreshold(int threshold)
threshold
value.
threshold
- the threshold value to select a partition in the hierarchypublic java.awt.image.BufferedImage paintSelectedPartition(boolean onlySelectedRegion)
public java.awt.image.BufferedImage paintSelectedPartition(HierarchyNode hierarchyNode)
hierarchyNode
- the HierarchyNode
that needs to be painted
public int[] getActiveLabels()
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 enabledpublic 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 enabledpublic 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 boolean isRootActive()
public int getEdgeWeightIndex(int index)
index
index
- the order of the desired weight in the ordered weights
index
public boolean isDerivedFromInitialPartition()
public HierarchyNode getHierarchyRoot()
public void randomizeColors()
Color
s associated with the HierarchyNode
s
of this TreeOfCriticalLakes
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |