de.unihalle.informatik.MiToBo.math.images
Class ImageArithmetics

java.lang.Object
  extended by de.unihalle.informatik.Alida.operator.ALDOperator
      extended by de.unihalle.informatik.MiToBo.core.operator.MTBOperator
          extended by de.unihalle.informatik.MiToBo.math.images.ImageArithmetics
All Implemented Interfaces:
de.unihalle.informatik.Alida.datatypes.ALDConfigurationValidator, de.unihalle.informatik.Alida.operator.events.ALDOperatorExecutionProgressEventListener, EventListener

@ALDMetaInfo(export=ALLOWED)
@ALDAOperator(genericExecutionMode=ALL,
              level=STANDARD)
public class ImageArithmetics
extends MTBOperator

Image arithmetics class for MTBImage objects. The arithmetic operations are sub-divided into operations regarding two images (ADD, SUB, MULT, DIV, MIN, MAX, AND, OR) and operations regarding one image and one constant (ADD_CONST, MULT_CONST, POW_CONST, INV). Operations with one input image result in images of the same type!! Operations with two input images result in an image of type of the higher input image precision!! If two input images do not have the same size the resulting image is null. Each operation is elementwise.

Author:
gress

Nested Class Summary
static class ImageArithmetics.ArithOp
          Arithmetic operations:
ADD, SUB, MULT, DIV, MIN, MAX, AND, OR, ABS_DIFF require two input images,
ADD_CONST, MULT_CONST, POW_CONST require one input image and a constant
INV, ABS require one input image only
 
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
  ImageArithmetics()
          Create empty ImageArithmetics object.
protected ImageArithmetics(ImageArithmetics.ArithOp op, MTBImage inputImage, double inputConstant)
          Constructor for arithmetic operations considering one image and a constant.
protected ImageArithmetics(ImageArithmetics.ArithOp op, MTBImage inputImage1, MTBImage inputImage2)
          Constructor for arithmetic operations considering two images.
 
Method Summary
protected  MTBImage abs_diff(MTBImage img1, MTBImage img2)
          Absolute difference of the elements of two images
protected  MTBImage abs(MTBImage img)
          Absolute values of the image elements.
protected  MTBImage add(MTBImage img, double constant)
          Add a constant to each image value
protected  MTBImage add(MTBImage img1, MTBImage img2)
          Add the elements of two images
protected  MTBImage and(MTBImage img1, MTBImage img2)
          Bitwise logical AND of two images.
protected  MTBImage div(MTBImage img1, MTBImage img2)
          Divide the elements of two images (img1/img2)
protected  ImageArithmetics.ArithOp getArithmeticOperation()
           
protected  Double getInConst()
           
protected  MTBImage getInImg1()
           
protected  MTBImage getInImg2()
           
protected  MTBImage getResultImg()
           
protected  MTBImage inv(MTBImage img)
          Inverts the image.
protected  MTBImage max(MTBImage img1, MTBImage img2)
          Pixelwise maximum
protected  MTBImage min(MTBImage img1, MTBImage img2)
          Pixelwise minimum
protected  MTBImage mult(MTBImage img, double constant)
          Multiply each image value by a constant
protected  MTBImage mult(MTBImage img1, MTBImage img2)
          Multiply the elements of two images
protected  void operate()
           
protected  MTBImage or(MTBImage img1, MTBImage img2)
          Bitwise OR of the elements of two images
protected  MTBImage pow(MTBImage img, double constant)
          Raise image values to the power of 'constant'
protected  void setArithmeticOperation(ImageArithmetics.ArithOp op)
           
protected  void setInConst(double inConst)
           
protected  void setInImg1(MTBImage inImg1)
           
protected  void setInImg2(MTBImage inImg2)
           
protected  void setResultImg(MTBImage img)
           
protected  MTBImage sub(MTBImage img1, MTBImage img2)
          Subtract the elements of two images (img1 - img2)
 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

ImageArithmetics

public ImageArithmetics()
                 throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Create empty ImageArithmetics object. Remember to set parameters manually.

Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException

ImageArithmetics

protected ImageArithmetics(ImageArithmetics.ArithOp op,
                           MTBImage inputImage1,
                           MTBImage inputImage2)
                    throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Constructor for arithmetic operations considering two images.

Parameters:
op - arithmetic operation
inputImage1 - first input image
inputImage2 - second input image
Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException

ImageArithmetics

protected ImageArithmetics(ImageArithmetics.ArithOp op,
                           MTBImage inputImage,
                           double inputConstant)
                    throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Constructor for arithmetic operations considering one image and a constant.

Parameters:
op - arithmetic operation
inputImage - input image
inputConstant - input constant
Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Method Detail

validateCustom

public void validateCustom()
                    throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Overrides:
validateCustom in class de.unihalle.informatik.Alida.operator.ALDOperator
Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException

operate

protected void operate()
                throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Specified by:
operate in class de.unihalle.informatik.Alida.operator.ALDOperator
Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException

getInImg1

protected MTBImage getInImg1()

setInImg1

protected void setInImg1(MTBImage inImg1)

getInImg2

protected MTBImage getInImg2()

setInImg2

protected void setInImg2(MTBImage inImg2)

getInConst

protected Double getInConst()

setInConst

protected void setInConst(double inConst)

getArithmeticOperation

protected ImageArithmetics.ArithOp getArithmeticOperation()

setArithmeticOperation

protected void setArithmeticOperation(ImageArithmetics.ArithOp op)

getResultImg

protected MTBImage getResultImg()

setResultImg

protected void setResultImg(MTBImage img)

add

protected MTBImage add(MTBImage img,
                       double constant)
Add a constant to each image value

Parameters:
img - input image
constant -
Returns:

mult

protected MTBImage mult(MTBImage img,
                        double constant)
Multiply each image value by a constant

Parameters:
img - input image
constant -
Returns:

pow

protected MTBImage pow(MTBImage img,
                       double constant)
Raise image values to the power of 'constant'

Parameters:
img -
constant -
Returns:

inv

protected MTBImage inv(MTBImage img)
Inverts the image.

Parameters:
img - Input image.
Returns:
Result image.

abs

protected MTBImage abs(MTBImage img)
Absolute values of the image elements.

Parameters:
img - Input image.
Returns:
Result image.

add

protected MTBImage add(MTBImage img1,
                       MTBImage img2)
Add the elements of two images


sub

protected MTBImage sub(MTBImage img1,
                       MTBImage img2)
Subtract the elements of two images (img1 - img2)


mult

protected MTBImage mult(MTBImage img1,
                        MTBImage img2)
Multiply the elements of two images


div

protected MTBImage div(MTBImage img1,
                       MTBImage img2)
Divide the elements of two images (img1/img2)


min

protected MTBImage min(MTBImage img1,
                       MTBImage img2)
Pixelwise minimum


max

protected MTBImage max(MTBImage img1,
                       MTBImage img2)
Pixelwise maximum


and

protected MTBImage and(MTBImage img1,
                       MTBImage img2)
Bitwise logical AND of two images.

Parameters:
img1 - First image.
img2 - Second image.
Returns:
Result image.

or

protected MTBImage or(MTBImage img1,
                      MTBImage img2)
Bitwise OR of the elements of two images

Parameters:
img1 - First image.
img2 - Second image.
Returns:
Result image.

abs_diff

protected MTBImage abs_diff(MTBImage img1,
                            MTBImage img2)
Absolute difference of the elements of two images



Copyright © 2010–2015 Martin Luther University Halle-Wittenberg. All rights reserved.