@ALDParametrizedClass public class MTBRegion2DSet extends de.unihalle.informatik.Alida.operator.ALDData implements Cloneable, MTBRegionSetInterface, Iterable<MTBRegion2D>
Modifier and Type | Class and Description |
---|---|
private class |
MTBRegion2DSet.RegionSelector |
Modifier and Type | Field and Description |
---|---|
private boolean |
debug |
private String |
info
Information about this region set
|
protected Vector<MTBRegion2D> |
regionSet
The set of regions represented as a Vector.
|
private double |
xMax
Maximal x coordinate of the domain of this region set.
|
private double |
xMin
Minimal x coordinate of the domain of this region set.
|
private double |
yMax
Maximal y coordinate of the domain of this region set.
|
private double |
yMin
Minimal y coordinate of the domain of this region set.
|
Constructor and Description |
---|
MTBRegion2DSet()
Standard constructor.
|
MTBRegion2DSet(double _xMin,
double _yMin,
double _xMax,
double _yMax)
Construct an empty set of regions with given extent of domain
|
MTBRegion2DSet(MTBImage labelimage)
Construct a set of regions from a label image.
|
MTBRegion2DSet(MTBImage labelimage,
int backgroundLabel)
Construct a set of regions from a label image.
|
MTBRegion2DSet(de.unihalle.informatik.MiToBo_xml.MTBXMLRegion2DSetType xmlregion2Dset)
Construct a new MTBRegion2DSet from a region set object that was
constructed from a xml-representation.
|
MTBRegion2DSet(String filename)
Construct a set of regions from a xml-file that was written by the
write method of this class. |
MTBRegion2DSet(Vector<MTBRegion2D> regions,
double _xMin,
double _yMin,
double _xMax,
double _yMax)
Construct an empty set of regions with given extent of domain
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(MTBRegion2D region)
Append a region (at the end) to the set of regions.
|
double |
calcAverageSize()
Calculates the average size of the set.
|
int |
calcMaxSize()
Calculates the maximum size of the set.
|
int |
calcMinSize()
Calculates the minimum size of the set.
|
void |
clear()
Remove all regions from this set
|
MTBRegion2DSet |
clone() |
MTBRegion2D |
elementAt(int i)
Get a region by index
|
MTBRegion2D |
get(int i)
Get a region by index
|
String |
getInfo() |
double |
getXmax() |
double |
getXmin() |
double |
getYmax() |
double |
getYmin() |
Iterator<MTBRegion2D> |
iterator() |
void |
remove(MTBRegion2D regionToRemove)
Delete the given region object from the set,
if contained.
|
void |
removeElementAt(int i)
Delete the i-th region from the set
|
MTBRegion2DSet |
selectLargeRegions(int minSize) |
void |
setElementAt(MTBRegion2D region,
int i)
Set the i-th region from the set
|
void |
setInfo(String info) |
void |
setXmax(double v)
Set maximal x coordinate of region set domain.
|
void |
setXmin(double v)
Set minimal x coordinate of region set domain.
|
void |
setYmax(double v)
Set maximal y coordinate of region set domain.
|
void |
setYmin(double v)
Set minimal y coordinate of region set domain.
|
int |
size()
Get the number of regions of this region set
|
de.unihalle.informatik.MiToBo_xml.MTBXMLRegion2DSetType |
toXMLType()
Construct an object that represents this region by xml.
|
void |
write(String filename)
Write this region set to disk in XML format using MiToBo's xml-scheme
MTBRegion2DSet.xsd
|
cloneProperties, getLocation, getProperty, getPropertyKeys, print, setLocation, setProperty
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
private boolean debug
@ALDClassParameter(label="Minimal x in domain.") private double xMin
@ALDClassParameter(label="Minimal y in domain") private double yMin
@ALDClassParameter(label="Maximal x in domain") private double xMax
@ALDClassParameter(label="Maximal y in domain") private double yMax
@ALDClassParameter(label="Set of regions") protected Vector<MTBRegion2D> regionSet
private String info
public MTBRegion2DSet()
public MTBRegion2DSet(double _xMin, double _yMin, double _xMax, double _yMax)
public MTBRegion2DSet(Vector<MTBRegion2D> regions, double _xMin, double _yMin, double _xMax, double _yMax)
public MTBRegion2DSet(String filename) throws org.apache.xmlbeans.XmlException, IOException
write
method of this class. (These xml-files conform to xml-scheme
MTBXMLRegion2DSet.xsd defined for MiToBo)filename
- path to the xml-fileIOException
- thrown if parsing of xml-file failedorg.apache.xmlbeans.XmlException
- thrown if parsing of xml-file failedpublic MTBRegion2DSet(MTBImage labelimage)
filename
- path to the xml-fileIOException
- thrown if parsing of xml-file failedorg.apache.xmlbeans.XmlException
- thrown if parsing of xml-file failedpublic MTBRegion2DSet(MTBImage labelimage, int backgroundLabel)
backgroundLabel
is excluded.
Admissible image types are BYTE, SHORT and INT.
filename
- path to the xml-fileIOException
- thrown if parsing of xml-file failedorg.apache.xmlbeans.XmlException
- thrown if parsing of xml-file failedpublic MTBRegion2DSet(de.unihalle.informatik.MiToBo_xml.MTBXMLRegion2DSetType xmlregion2Dset)
MTBRegion2DSetBag
) from file.xmlregion2Dset
- object that represents the region set read from xmlpublic MTBRegion2DSet clone()
public de.unihalle.informatik.MiToBo_xml.MTBXMLRegion2DSetType toXMLType()
MTBRegion2DSetBag
) to file.public void write(String filename) throws IOException, de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException, de.unihalle.informatik.Alida.exceptions.ALDOperatorException
IOException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
public int size()
public void setXmin(double v)
v
- Value to set.public double getXmin()
public void setXmax(double v)
v
- Value to set.public double getXmax()
public void setYmin(double v)
v
- Value to set.public double getYmin()
public void setYmax(double v)
v
- Value to set.public double getYmax()
public String getInfo()
public void setInfo(String info)
public void clear()
public MTBRegion2D get(int i)
public MTBRegion2D elementAt(int i)
public boolean add(MTBRegion2D region)
region
- region to addpublic void setElementAt(MTBRegion2D region, int i)
i
- index of region to removepublic void removeElementAt(int i)
i
- index of region to removepublic void remove(MTBRegion2D regionToRemove)
regionToRemove
- public int calcMinSize()
public int calcMaxSize()
public double calcAverageSize()
public MTBRegion2DSet selectLargeRegions(int minSize) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException, de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
public Iterator<MTBRegion2D> iterator()
iterator
in interface Iterable<MTBRegion2D>
Copyright © 2010–2020 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.