@ALDParametrizedClass public class MTBBorder2DSet extends de.unihalle.informatik.Alida.operator.ALDData implements Cloneable
A border is an unordered list of border pixels. The border set is living in
a common domain which is a rectangular subset of R x R. Each border is of
type MTBBorder2D
.
Modifier and Type | Field and Description |
---|---|
protected Vector<MTBBorder2D> |
borderSet
The set of borders represented as a
Vector . |
protected double |
xMax
Maximal x-coordinate of the domain of this border set.
|
protected double |
xMin
Minimal x-coordinate of the domain of this border set.
|
protected double |
yMax
Maximal y-coordinate of the domain of this border set.
|
protected double |
yMin
Minimal y-coordinate of the domain of this border set.
|
Constructor and Description |
---|
MTBBorder2DSet()
Standard constructor.
|
MTBBorder2DSet(double _xMin,
double _yMin,
double _xMax,
double _yMax)
Construct an empty set of borders with given extent of domain.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(MTBBorder2D border)
Append a border (at the end) to the set of borders.
|
MTBBorder2DSet |
clone() |
MTBBorder2D |
elementAt(int i)
Get a border by index.
|
double |
getXMax()
Get the maximal x-coordinate of the domain of this border set.
|
double |
getXMin()
Get the minimal x-coordinate of the domain of this border set.
|
double |
getYMax()
Get the maximal y-coordinate of the domain of this border set.
|
double |
getYMin()
Get the minimal y-coordinate of the domain of this border set.
|
static MTBBorder2DSet |
readBordersFromASCIIFiles(String dir,
String delim,
int skipLines)
Read a set of 2D border objects from ASCII files in xSV format from the
given directory.
|
void |
removeElementAt(int i)
Delete the i-th border from the set.
|
void |
setElementAt(MTBBorder2D border,
int i)
Set the i-th border of the set.
|
int |
size()
Get the number of borders of this set.
|
@ALDClassParameter(label="Minimal x in domain.") protected double xMin
@ALDClassParameter(label="Minimal y in domain") protected double yMin
@ALDClassParameter(label="Maximal x in domain") protected double xMax
@ALDClassParameter(label="Maximal y in domain") protected double yMax
@ALDClassParameter(label="Set of borders") protected Vector<MTBBorder2D> borderSet
Vector
.public MTBBorder2DSet()
public MTBBorder2DSet(double _xMin, double _yMin, double _xMax, double _yMax)
_xMin
- Minimal x-coordinate of the domain._yMin
- Minimal y-coordinate of the domain._xMax
- Maximal x-coordinate of the domain._yMax
- Maximal y-coordinate of the domain.public MTBBorder2DSet clone()
public int size()
public MTBBorder2D elementAt(int i)
i
- Index of border to retrieve.public double getXMin()
public double getXMax()
public double getYMin()
public double getYMax()
public boolean add(MTBBorder2D border)
border
- Border to be added.public void setElementAt(MTBBorder2D border, int i)
border
- New border element.i
- Index of position where to put it.public void removeElementAt(int i)
i
- Index of border to be removed.public static MTBBorder2DSet readBordersFromASCIIFiles(String dir, String delim, int skipLines)
It is assumed that all files have the same format and that there are only files containing borders in the directory. Not that the directory is not processed recursively.
dir
- Directory from where to read the files.delim
- Delimiter in the file.skipLines
- Number of header lines to skip.Copyright © 2010–2020 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.