|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.unihalle.informatik.Alida.operator.ALDOperator
de.unihalle.informatik.MiToBo.core.operator.MTBOperator
de.unihalle.informatik.MiToBo.visualization.drawing.DrawRegion2DSet
@ALDAOperator(genericExecutionMode=ALL) public class DrawRegion2DSet
A class to visualize 2D regions. Background is always 0, regions can be drawn in different ways. The following kinds of region images can be created or drawn to an existing image:
Constructors take the kind of image and the regions to be drawn as well as an eventual target image. Default configurations are set by the constructors. Use the different get/set methods to specify non default parameters like color, grayvalue etc.
Be sure to set the xMin, xMax, yMin, yMax values of the input MTBRegion2DSet, because these values are used to determine the image size!!
Nested Class Summary | |
---|---|
static class |
DrawRegion2DSet.DrawType
Type of image to be drawn: LABEL_IMAGE: draw gray value image where regions are labeled by their index in the set + 1 ID_IMAGE: draw gray value image where regions are labeled by their region id (see MTBRegion2D.id) MASK_IMAGE: draw a mask image with equal gray values for all regions COLOR_IMAGE: draw a mask with colored regions TRANSPARENT_IMAGE: draw a mask with colored regions, but the regions are transparent to show the underlying intensity structure of the given target image CONTOURS: draw contours of the regions in a given colour |
Nested classes/interfaces inherited from class de.unihalle.informatik.Alida.operator.ALDOperator |
---|
de.unihalle.informatik.Alida.operator.ALDOperator.HidingMode |
Field Summary |
---|
Fields inherited from class de.unihalle.informatik.Alida.operator.ALDOperator |
---|
completeDAG, name, operatorExecutionEventlistenerList, portHashAccess, verbose, versionProvider |
Constructor Summary | |
---|---|
DrawRegion2DSet()
Default constructor where NO parameters are set. |
|
DrawRegion2DSet(DrawRegion2DSet.DrawType dtype,
MTBRegion2DSet regions)
Simple constructor to create the most common region image types: see DrawType |
|
DrawRegion2DSet(DrawRegion2DSet.DrawType dtype,
MTBRegion2DSet regions,
Boolean cloneTargetImage)
Simple constructor to create the most common region image types: see DrawType |
|
DrawRegion2DSet(DrawRegion2DSet.DrawType dtype,
MTBRegion2DSet regions,
MTBImage targetimage)
Simple constructor to draw the most common region image types to a given image: |
Method Summary | |
---|---|
protected int |
color2int(Color c)
|
Color |
getColor()
Get the uniform color of the regions in a color image (COLOR_IMAGE only). |
DrawRegion2DSet.DrawType |
getDrawType()
Get the kind of region image drawn by the operator |
Double |
getGrayValue()
Get the gray value of the regions in a mask image (MASK_IMAGE only). |
MTBImage.MTBImageType |
getImageType()
Get the datatype of the resulting image |
MTBRegion2DSet |
getInputRegions()
Get the regions that have to be drawn |
Random |
getRandom()
Get the random number generator which is responsable to draw each region in a random color (COLOR_IMAGE only). |
MTBImage |
getResultImage()
Get the resulting region image. |
MTBImage |
getTargetImage()
Get the target image to which the regions are drawn, if one was specified. |
protected Color |
int2Color(int color)
|
protected void |
operate()
|
protected int |
randomColor(Random r)
|
void |
setColor(Color c)
Set the uniform color of the regions in a color image (COLOR_IMAGE only). |
void |
setDrawType(DrawRegion2DSet.DrawType dtype)
Set the kind of region image to be drawn |
void |
setGrayValue(Double value)
Set the gray value of the regions in a mask image (MASK_IMAGE only). |
void |
setImageType(MTBImage.MTBImageType type)
Set the resulting image's datatype. |
void |
setInputRegions(MTBRegion2DSet regions)
Set the input regions to be drawn |
void |
setRandom(Random r)
Set a random number generator to draw each region in a random color (COLOR_IMAGE only). |
protected void |
setResultImage(MTBImage image)
Set the resulting image. |
void |
setTargetImage(MTBImage targetimage)
Specify a target image to which the regions are drawn, specify 'null' to create a new image |
void |
validateCustom()
|
Methods inherited from class de.unihalle.informatik.MiToBo.core.operator.MTBOperator |
---|
readResolve |
Methods inherited from class de.unihalle.informatik.Alida.operator.ALDOperator |
---|
addOperatorExecutionProgressEventListener, fieldContained, fireOperatorExecutionProgressEvent, getALDPortHashAccessKey, getConstructionMode, getHidingMode, getInInoutNames, getInInoutNames, getInNames, getInOutNames, getMissingRequiredInputs, getName, getNumParameters, getOutInoutNames, getOutNames, getParameter, getParameterDescriptor, getParameterNames, getSupplementalNames, getVerbose, getVersion, handleOperatorExecutionProgressEvent, isConfigured, print, print, print, printInterface, printInterface, readHistory, reinitializeParameterDescriptors, removeOperatorExecutionProgressEventListener, runOp, runOp, runOp, setConstructionMode, setHidingMode, setName, setParameter, setVerbose, toStringVerbose, unconfiguredItems, validate, validateGeneric, writeHistory, writeHistory, writeHistory |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DrawRegion2DSet() throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
public DrawRegion2DSet(DrawRegion2DSet.DrawType dtype, MTBRegion2DSet regions) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
dtype
- drawing typeregions
- a set of regions (set xMin,xMax,yMin,yMax which are used to determine image size)
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
public DrawRegion2DSet(DrawRegion2DSet.DrawType dtype, MTBRegion2DSet regions, Boolean cloneTargetImage) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
dtype
- drawing typeregions
- a set of regions (set xMin,xMax,yMin,yMax which are used to determine image size)
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
public DrawRegion2DSet(DrawRegion2DSet.DrawType dtype, MTBRegion2DSet regions, MTBImage targetimage) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
dtype
- drawing typeregions
- a set of regionstargetimage
- target image to draw the regions to
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Method Detail |
---|
public void validateCustom() throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
validateCustom
in class de.unihalle.informatik.Alida.operator.ALDOperator
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
public void setInputRegions(MTBRegion2DSet regions)
public MTBRegion2DSet getInputRegions()
public void setTargetImage(MTBImage targetimage)
public MTBImage getTargetImage()
public void setDrawType(DrawRegion2DSet.DrawType dtype)
dtype
- see DrawTypepublic DrawRegion2DSet.DrawType getDrawType()
public void setImageType(MTBImage.MTBImageType type)
type
- result image typepublic MTBImage.MTBImageType getImageType()
public void setGrayValue(Double value)
public Double getGrayValue()
public void setColor(Color c)
public Color getColor()
public void setRandom(Random r)
public Random getRandom()
protected void setResultImage(MTBImage image)
public MTBImage getResultImage()
protected void operate() throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException, de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
operate
in class de.unihalle.informatik.Alida.operator.ALDOperator
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
protected int randomColor(Random r)
protected int color2int(Color c)
protected Color int2Color(int color)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |