public class ConnectedComponents2D extends Object
Constructor and Description |
---|
ConnectedComponents2D(ij.process.ImageProcessor proc)
Prepares a workspace for performing a connect components routine on the provided image.
|
Modifier and Type | Method and Description |
---|---|
int |
get(int i) |
int |
get(int x,
int y) |
List<double[]> |
getCentroids()
Returns the centroids associated with this connected components.
|
int |
getHeight() |
List<int[]> |
getLabelledPoints(int labelB) |
Map<Integer,List<int[]>> |
getRegions()
A map of label -> region for all of the connected components.
|
int |
getWidth() |
void |
label(int[] p,
int label)
Moves the unlabelled pixel to a labelled region.
|
static void |
main(String[] args) |
void |
process()
This method needs to be called before any of the centroids can be accessed.
|
void |
removeRegion(int label)
Removes a region from this cc2d by removing the label from the map, and setting all of the pixels associated
with the provided label to 0.
|
public ConnectedComponents2D(ij.process.ImageProcessor proc)
proc
- thresholded image that will be modified during processing.public void process()
public List<double[]> getCentroids()
public int get(int x, int y)
public Map<Integer,List<int[]>> getRegions()
public void removeRegion(int label)
label
- public static void main(String[] args)
public int getWidth()
public int getHeight()
public List<int[]> getLabelledPoints(int labelB)
public int get(int i)
public void label(int[] p, int label)
p
- {x, y}label
- region to be associated with.Copyright © 2013–2022 Francis Crick Institute. All rights reserved.