de.unihalle.informatik.MiToBo.core.datatypes
Class MTBStructuringElement

java.lang.Object
  extended by de.unihalle.informatik.MiToBo.core.datatypes.MTBStructuringElement

@ALDParametrizedClass
public class MTBStructuringElement
extends java.lang.Object

class representing a 2D flat (, i.e. without different gray values) structuring element
for the use with morphological operations
values are stored in a recatangular 2D array (rows: 1st dimension, columns: 2nd dimension)
whereas onValue represents set locations and 0 represents unset locations

Author:
glass

Field Summary
private  int centerX
           
private  int centerY
           
private  int[][] mask
           
private static int onValue
           
 
Constructor Summary
MTBStructuringElement()
           
MTBStructuringElement(int[][] mask)
          creates structuring element from given 2D-array, center is assumed to be at the center of the array
MTBStructuringElement(int[][] mask, int centerX, int centerY)
          creates structuring element from given 2D-array
 
Method Summary
static MTBStructuringElement createCircularElement(int size)
           
static MTBStructuringElement createHorizontalLineElement(int length)
           
static MTBStructuringElement createQuadraticElement(int size)
           
static MTBStructuringElement createRectangularElement(int sizeX, int sizeY)
           
static MTBStructuringElement createVerticalLineElement(int length)
           
 int getCenterX()
           
 int getCenterY()
           
 int getSizeX()
           
 int getSizeY()
           
 int getValue(int x, int y)
           
 MTBStructuringElement invert()
          inverts the values of the structuring element
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

centerX

@ALDClassParameter(label="centerX")
private int centerX

centerY

@ALDClassParameter(label="centerY")
private int centerY

mask

@ALDClassParameter(label="mask")
private int[][] mask

onValue

private static final int onValue
See Also:
Constant Field Values
Constructor Detail

MTBStructuringElement

public MTBStructuringElement()

MTBStructuringElement

public MTBStructuringElement(int[][] mask)
creates structuring element from given 2D-array, center is assumed to be at the center of the array

Parameters:
mask -

MTBStructuringElement

public MTBStructuringElement(int[][] mask,
                             int centerX,
                             int centerY)
creates structuring element from given 2D-array

Parameters:
mask -
centerX -
centerY -
Method Detail

createCircularElement

public static MTBStructuringElement createCircularElement(int size)
Parameters:
size -
Returns:
circular shaped structuring element

createHorizontalLineElement

public static MTBStructuringElement createHorizontalLineElement(int length)
Parameters:
length -
value -
Returns:
line shaped structuring element, horizontally (in x-direction) oriented

createQuadraticElement

public static MTBStructuringElement createQuadraticElement(int size)
Parameters:
size -
Returns:
quadratic shaped structuring element

createRectangularElement

public static MTBStructuringElement createRectangularElement(int sizeX,
                                                             int sizeY)
Parameters:
sizeX -
sizeY -
Returns:
rectangular shaped structuring element

createVerticalLineElement

public static MTBStructuringElement createVerticalLineElement(int length)
Parameters:
length -
Returns:
line shaped structuring element, vertically (in y-direction) oriented

getCenterX

public int getCenterX()
Returns:
x-coordinate of center

getCenterY

public int getCenterY()
Returns:
y-coordinate of center

getSizeX

public int getSizeX()
Returns:
size in x-direction (width)

getSizeY

public int getSizeY()
Returns:
size in y-direction (height)

getValue

public int getValue(int x,
                    int y)
Parameters:
x -
y -
Returns:
value at (x,y)

invert

public MTBStructuringElement invert()
inverts the values of the structuring element

Returns:
inverted structuring element