A series of well-known filtering algorithms for images, linear and non-linear.. More...

#include <Filter.h>

Inheritance diagram for te::rp::Filter:
te::rp::Algorithm

Classes

class  InputParameters
 Filter input parameters. More...
 
class  OutputParameters
 Filter output parameters. More...
 

Public Member Functions

bool execute (AlgorithmOutputParameters &outputParams) throw ( te::rp::Exception )
 Executes the algorithm using the supplied parameters. More...
 
 Filter ()
 
bool initialize (const AlgorithmInputParameters &inputParams) throw ( te::rp::Exception )
 Initialize the algorithm instance making it ready for execution. More...
 
bool isInitialized () const
 Returns true if the algorithm instance is initialized and ready for execution. More...
 
void reset () throw ( te::rp::Exception )
 Clear all internal allocated objects and reset the algorithm to its initial state. More...
 
 ~Filter ()
 

Protected Types

typedef bool(Filter::* FilterMethodPointerT) (const te::rst::Raster &srcRaster, const unsigned int srcBandIdx, te::rst::Raster &dstRaster, const unsigned int dstBandIdx, const bool useProgress)
 Type definition for a filter method pointer. More...
 

Protected Member Functions

bool DilationFilter (const te::rst::Raster &srcRaster, const unsigned int srcBandIdx, te::rst::Raster &dstRaster, const unsigned int dstBandIdx, const bool useProgress)
 Applay the dilation filter over the source raster band. More...
 
bool ErosionFilter (const te::rst::Raster &srcRaster, const unsigned int srcBandIdx, te::rst::Raster &dstRaster, const unsigned int dstBandIdx, const bool useProgress)
 Applay the erosion filter over the source raster band. More...
 
bool MeanFilter (const te::rst::Raster &srcRaster, const unsigned int srcBandIdx, te::rst::Raster &dstRaster, const unsigned int dstBandIdx, const bool useProgress)
 Applay the mean filter over the source raster band. More...
 
bool MedianFilter (const te::rst::Raster &srcRaster, const unsigned int srcBandIdx, te::rst::Raster &dstRaster, const unsigned int dstBandIdx, const bool useProgress)
 Applay the median filter over the source raster band. More...
 
bool ModeFilter (const te::rst::Raster &srcRaster, const unsigned int srcBandIdx, te::rst::Raster &dstRaster, const unsigned int dstBandIdx, const bool useProgress)
 Applay the mode filter over the source raster band. More...
 
bool RobertsFilter (const te::rst::Raster &srcRaster, const unsigned int srcBandIdx, te::rst::Raster &dstRaster, const unsigned int dstBandIdx, const bool useProgress)
 Applay the Roberts filter over the source raster band. More...
 
bool SobelFilter (const te::rst::Raster &srcRaster, const unsigned int srcBandIdx, te::rst::Raster &dstRaster, const unsigned int dstBandIdx, const bool useProgress)
 Applay the Sobel filter over the source raster band. More...
 
bool UserDefinedFilter (const te::rst::Raster &srcRaster, const unsigned int srcBandIdx, te::rst::Raster &dstRaster, const unsigned int dstBandIdx, const bool useProgress)
 Applay the user defined filter over the source raster band. More...
 

Static Protected Member Functions

static bool OrderFunction (double i, double j)
 Returns true if i < j. More...
 

Protected Attributes

Filter::InputParameters m_inputParameters
 Input parameters. More...
 
bool m_isInitialized
 Is this instance already initialized? More...
 

Detailed Description

A series of well-known filtering algorithms for images, linear and non-linear..

Definition at line 47 of file Filter.h.

Member Typedef Documentation

typedef bool(Filter::* te::rp::Filter::FilterMethodPointerT) (const te::rst::Raster &srcRaster, const unsigned int srcBandIdx, te::rst::Raster &dstRaster, const unsigned int dstBandIdx, const bool useProgress)
protected

Type definition for a filter method pointer.

Parameters
srcRasterSource raster.
srcBandIdxSource raster band index.
dstRasterDestination raster.
dstBandIdxDestination raster band index.
useProgressif true, the progress interface must be used.
Returns
true if ok, false on errors.

Definition at line 162 of file Filter.h.

Constructor & Destructor Documentation

Filter::Filter ( )

Definition at line 136 of file Filter.cpp.

References reset().

Filter::~Filter ( )

Definition at line 141 of file Filter.cpp.

Member Function Documentation

bool Filter::DilationFilter ( const te::rst::Raster srcRaster,
const unsigned int  srcBandIdx,
te::rst::Raster dstRaster,
const unsigned int  dstBandIdx,
const bool  useProgress 
)
protected
bool Filter::ErosionFilter ( const te::rst::Raster srcRaster,
const unsigned int  srcBandIdx,
te::rst::Raster dstRaster,
const unsigned int  dstBandIdx,
const bool  useProgress 
)
protected
bool Filter::execute ( AlgorithmOutputParameters outputParams)
throw (te::rp::Exception
)
virtual

Executes the algorithm using the supplied parameters.

Parameters
outputParamsOutput parameters.
Returns
true if OK, false on errors.

Implements te::rp::Algorithm.

Definition at line 145 of file Filter.cpp.

References DilationFilter(), te::rp::Filter::InputParameters::DilationFilterT, te::dt::DOUBLE_TYPE, ErosionFilter(), te::rp::Filter::InputParameters::ErosionFilterT, te::rst::Raster::getBand(), te::rst::Raster::getGrid(), te::rst::Raster::getNumberOfBands(), te::rst::Band::getProperty(), te::rp::Filter::InputParameters::m_enableProgress, te::rp::Filter::InputParameters::m_filterType, m_inputParameters, te::rp::Filter::InputParameters::m_inRasterBands, te::rp::Filter::InputParameters::m_inRasterPtr, m_isInitialized, te::rp::Filter::InputParameters::m_iterationsNumber, te::rp::Filter::OutputParameters::m_outputRasterPtr, te::rp::Filter::OutputParameters::m_rInfo, te::rp::Filter::OutputParameters::m_rType, te::rst::RasterFactory::make(), MeanFilter(), te::rp::Filter::InputParameters::MeanFilterT, MedianFilter(), te::rp::Filter::InputParameters::MedianFilterT, ModeFilter(), te::rp::Filter::InputParameters::ModeFilterT, RobertsFilter(), te::rp::Filter::InputParameters::RobertsFilterT, SobelFilter(), te::rp::Filter::InputParameters::SobelFilterT, TE_TR, TERP_LOG_AND_RETURN_FALSE, TERP_LOG_AND_THROW, TERP_TRUE_OR_RETURN_FALSE, TERP_TRUE_OR_THROW, te::common::TaskProgress::UNDEFINED, UserDefinedFilter(), and te::rp::Filter::InputParameters::UserDefinedWindowT.

Referenced by te::qt::widgets::FilterWizardPage::apply(), and te::qt::widgets::FilterWizard::execute().

bool Filter::isInitialized ( ) const
virtual

Returns true if the algorithm instance is initialized and ready for execution.

Returns
true if the algorithm instance is initialized and ready for execution.

Implements te::rp::Algorithm.

Definition at line 423 of file Filter.cpp.

References m_isInitialized.

bool Filter::MeanFilter ( const te::rst::Raster srcRaster,
const unsigned int  srcBandIdx,
te::rst::Raster dstRaster,
const unsigned int  dstBandIdx,
const bool  useProgress 
)
protected
bool Filter::MedianFilter ( const te::rst::Raster srcRaster,
const unsigned int  srcBandIdx,
te::rst::Raster dstRaster,
const unsigned int  dstBandIdx,
const bool  useProgress 
)
protected
bool Filter::ModeFilter ( const te::rst::Raster srcRaster,
const unsigned int  srcBandIdx,
te::rst::Raster dstRaster,
const unsigned int  dstBandIdx,
const bool  useProgress 
)
protected
bool Filter::OrderFunction ( double  i,
double  j 
)
staticprotected

Returns true if i < j.

Returns
Returns true if i < j.

Definition at line 1126 of file Filter.cpp.

Referenced by MedianFilter().

bool Filter::RobertsFilter ( const te::rst::Raster srcRaster,
const unsigned int  srcBandIdx,
te::rst::Raster dstRaster,
const unsigned int  dstBandIdx,
const bool  useProgress 
)
protected

Applay the Roberts filter over the source raster band.

Parameters
srcRasterSource raster.
srcBandIdxSource raster band index.
dstRasterDestination raster.
dstBandIdxDestination raster band index.
useProgressif true, the progress interface must be used.

Definition at line 428 of file Filter.cpp.

References te::rst::Raster::getBand(), te::rp::GetDataTypeRange(), te::rst::Raster::getNumberOfBands(), te::rst::Raster::getNumberOfColumns(), te::rst::Raster::getNumberOfRows(), te::rst::Band::getProperty(), te::rst::BandProperty::getType(), te::rst::Band::getValue(), te::rst::BandProperty::m_noDataValue, te::rst::Band::setValue(), TE_TR, TERP_DEBUG_TRUE_OR_THROW, and te::common::TaskProgress::UNDEFINED.

Referenced by execute().

bool Filter::SobelFilter ( const te::rst::Raster srcRaster,
const unsigned int  srcBandIdx,
te::rst::Raster dstRaster,
const unsigned int  dstBandIdx,
const bool  useProgress 
)
protected

Applay the Sobel filter over the source raster band.

Parameters
srcRasterSource raster.
srcBandIdxSource raster band index.
dstRasterDestination raster.
dstBandIdxDestination raster band index.
useProgressif true, the progress interface must be used.

Definition at line 537 of file Filter.cpp.

References te::rst::Raster::getBand(), te::rp::GetDataTypeRange(), te::rst::Raster::getNumberOfBands(), te::rst::Raster::getNumberOfColumns(), te::rst::Raster::getNumberOfRows(), te::rst::Band::getProperty(), te::rst::BandProperty::getType(), te::rst::Band::getValue(), te::rst::BandProperty::m_noDataValue, te::rst::Band::setValue(), TE_TR, TERP_DEBUG_TRUE_OR_THROW, and te::common::TaskProgress::UNDEFINED.

Referenced by execute().

bool Filter::UserDefinedFilter ( const te::rst::Raster srcRaster,
const unsigned int  srcBandIdx,
te::rst::Raster dstRaster,
const unsigned int  dstBandIdx,
const bool  useProgress 
)
protected

Member Data Documentation

Filter::InputParameters te::rp::Filter::m_inputParameters
protected

Input parameters.

Definition at line 168 of file Filter.h.

Referenced by DilationFilter(), ErosionFilter(), execute(), initialize(), MeanFilter(), MedianFilter(), ModeFilter(), reset(), and UserDefinedFilter().

bool te::rp::Filter::m_isInitialized
protected

Is this instance already initialized?

Definition at line 166 of file Filter.h.

Referenced by execute(), initialize(), isInitialized(), and reset().


The documentation for this class was generated from the following files: