de.unihalle.informatik.MiToBo.tools.image
Class ImageContrastReducer

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.tools.image.ImageContrastReducer
All Implemented Interfaces:
de.unihalle.informatik.Alida.datatypes.ALDConfigurationValidator, de.unihalle.informatik.Alida.operator.events.ALDOperatorExecutionProgressEventListener, EventListener

@ALDAOperator(genericExecutionMode=ALL,
              level=STANDARD,
              allowBatchMode=true)
public class ImageContrastReducer
extends MTBOperator

Contrast-reduction of images by reducing number of gray-scale values.

This operator performs a reduction of the contrast in an image by reducing the number of gray-scale values to, e.g., 4-bit or 2-bit. Different modes for choosing the gray values in the result image are available. Currently only byte and short gray-scale images are handled, passing color images or images of another type to the operator results in an error.

Note that the result image always shares the type of the input image, irrespective of the actual number of bits used for representing the values. In addition, it is not guaranteed that the whole range of available gray values is used.

Author:
moeller

Nested Class Summary
static class ImageContrastReducer.ResultValueMode
          Modes for choosing result values.
static class ImageContrastReducer.TargetContrast
          Available target contrast modes.
 
Nested classes/interfaces inherited from class de.unihalle.informatik.Alida.operator.ALDOperator
de.unihalle.informatik.Alida.operator.ALDOperator.HidingMode
 
Field Summary
protected  MTBImage inImg
          Input image.
protected  MTBImage resultImg
          Result image.
protected  ImageContrastReducer.ResultValueMode resultValueMode
          Result value mode.
protected  ImageContrastReducer.TargetContrast targetContrast
          Target contrast of result image.
 
Fields inherited from class de.unihalle.informatik.Alida.operator.ALDOperator
completeDAG, name, operatorExecutionEventlistenerList, portHashAccess, verbose, versionProvider
 
Constructor Summary
ImageContrastReducer()
          Default constructor.
 
Method Summary
 MTBImage getInImg()
          Get input image.
 MTBImage getResultImg()
          Get result image.
protected  void operate()
           
 void setInImg(MTBImage img)
          Set input image.
 void setResultValueSelectionMode(ImageContrastReducer.ResultValueMode vsm)
          Set value selection mode.
 void setTargetContrast(ImageContrastReducer.TargetContrast tc)
          Set target contrast.
 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
 

Field Detail

inImg

@Parameter(label="Input Image",
           required=true,
           direction=IN,
           mode=STANDARD,
           dataIOOrder=0,
           description="Input image to transform.")
protected MTBImage inImg
Input image.


targetContrast

@Parameter(label="Target Contrast",
           required=true,
           direction=IN,
           mode=STANDARD,
           dataIOOrder=1,
           description="Target contrast, i.e., number of bits.")
protected ImageContrastReducer.TargetContrast targetContrast
Target contrast of result image.


resultValueMode

@Parameter(label="Result Value Mode",
           required=true,
           direction=IN,
           mode=STANDARD,
           dataIOOrder=2,
           description="Mode for selecting the result values.")
protected ImageContrastReducer.ResultValueMode resultValueMode
Result value mode.


resultImg

@Parameter(label="Result Image",
           required=true,
           direction=OUT,
           mode=STANDARD,
           dataIOOrder=0,
           description="Result image.")
protected MTBImage resultImg
Result image.

Constructor Detail

ImageContrastReducer

public ImageContrastReducer()
                     throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Default constructor.

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

setInImg

public void setInImg(MTBImage img)
Set input image.

Parameters:
img - Input image to process.

getInImg

public MTBImage getInImg()
Get input image.

Returns:
Current input image.

setTargetContrast

public void setTargetContrast(ImageContrastReducer.TargetContrast tc)
Set target contrast.

Parameters:
tc - Target contrast.

setResultValueSelectionMode

public void setResultValueSelectionMode(ImageContrastReducer.ResultValueMode vsm)
Set value selection mode.

Parameters:
vsm - Mode for selecting result values.

getResultImg

public MTBImage getResultImg()
Get result image.

Returns:
Result image with reduced contrast.


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