JIU 0.12.0 Homepage

net.sourceforge.jiu.color.analysis
Class Histogram1DCreator

java.lang.Object
  extended bynet.sourceforge.jiu.ops.Operation
      extended bynet.sourceforge.jiu.color.analysis.Histogram1DCreator

public class Histogram1DCreator
extends Operation

This class creates one-dimensional histograms for images with integer samples. Only IntegerImage objects are supported.

Existing histogram objects can be given to this operation to be reused. Give an existing Histogram1D object to this operation via setHistogram(Histogram1D).

The histogram can be created for any channel of an IntegerImage. The first channel (index 0) is the default channel. Use setImage(IntegerImage, int) to specify another one.

Note: Before JIU 0.10.0 there was a single HistogramCreator class.

Usage example

Creates a histogram for the third channel of an image.
 Histogram1DCreator hc = new Histogram1DCreator();
 hc.setImage(image, 2);
 hc.process();
 Histogram1D hist = hc.getHistogram();
 

Since:
0.10.0
Author:
Marco Schmidt

Constructor Summary
Histogram1DCreator()
           
 
Method Summary
 Histogram1D getHistogram()
          Returns the histogram used in this operation.
 void process()
          This method does the actual work of the operation.
 void setHistogram(Histogram1D histogram)
          Sets a histogram object to be used for this operation.
 void setImage(IntegerImage newImage)
          Set the image for which the histogram is to be initialized.
 void setImage(IntegerImage newImage, int imageChannelIndex)
          Set the image and the channel index for which the histogram is to be initialized.
 
Methods inherited from class net.sourceforge.jiu.ops.Operation
addProgressListener, addProgressListeners, getAbort, removeProgressListener, setAbort, setProgress, setProgress
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Histogram1DCreator

public Histogram1DCreator()
Method Detail

getHistogram

public Histogram1D getHistogram()
Returns the histogram used in this operation.

Returns:
histogram object, newly-created or reused one
See Also:
setHistogram(net.sourceforge.jiu.color.data.Histogram1D)

process

public void process()
             throws MissingParameterException,
                    WrongParameterException
Description copied from class: Operation
This method does the actual work of the operation. It must be called after all parameters have been given to the operation object.

Overrides:
process in class Operation
Throws:
MissingParameterException - if any mandatory parameter was not given to the operation
WrongParameterException - if at least one of the input parameters was not initialized appropriately (values out of the valid interval, etc.)

setHistogram

public void setHistogram(Histogram1D histogram)
Sets a histogram object to be used for this operation. Within process() it will be checked if this histogram is large enough for the image.

See Also:
getHistogram()

setImage

public void setImage(IntegerImage newImage)
Set the image for which the histogram is to be initialized. The first channel (index 0) is used by default.

Parameters:
newImage - image object to be used
See Also:
setImage(IntegerImage, int)

setImage

public void setImage(IntegerImage newImage,
                     int imageChannelIndex)
Set the image and the channel index for which the histogram is to be initialized.

Parameters:
newImage - image object to be used
imageChannelIndex - must not be negative and must be smaller than newImage.getNumChannels()
See Also:
setImage(IntegerImage)

JIU 0.12.0 Homepage

Copyright © 2000, 2001, 2002, 2003, 2004 Marco Schmidt