#include <Contrast.h>
Classes | |
class | InputParameters |
Contrast input parameters. More... | |
class | OutputParameters |
Contrast output parameters. More... | |
Public Member Functions | |
Contrast () | |
bool | execute (AlgorithmOutputParameters &outputParams) throw ( te::rp::Exception ) |
Executes the algorithm using the supplied parameters. More... | |
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... | |
~Contrast () | |
Protected Types | |
typedef void(Contrast::* | RemapFuncPtrT) (const double &inValue, double &outValue) |
Type definition for a remapping function pointer. More... | |
Protected Member Functions | |
bool | execDecorrelationEnhancement () |
Execute the decorrelation enhancement contrast following the internal parameters. More... | |
bool | execHistogramEqualizationContrast () |
Execute the histogram equalization contrast following the internal parameters. More... | |
bool | execLinearContrast () |
Execute a linear contrast following the internal parameters. More... | |
bool | execLogContrast () |
Execute a log contrast following the internal parameters. More... | |
bool | execSetMeanAndStdContrast () |
Execute the histogram equalization contrast following the internal parameters. More... | |
bool | execSquareContrast () |
Execute a square contrast following the internal parameters. More... | |
bool | execSquareRootContrast () |
Execute a square root contrast following the internal parameters. More... | |
void | logRemap (const double &inValue, double &outValue) |
Remap on gray level using a log. More... | |
void | offSetGainRemap (const double &inValue, double &outValue) |
Remap on gray level using an offset and gain. More... | |
bool | remapBandLevels (const te::rst::Band &inRasterBand, te::rst::Band &outRasterBand, RemapFuncPtrT remapFuncPtr, const bool enableProgress) |
Band gray levels remap using a remap function. More... | |
void | squareRemap (const double &inValue, double &outValue) |
Remap on gray level using a square. More... | |
void | squareRootRemap (const double &inValue, double &outValue) |
Remap on gray level using a square root. More... | |
Protected Attributes | |
Contrast::InputParameters | m_inputParameters |
Contrast input execution parameters. More... | |
bool | m_isInitialized |
Tells if this instance is initialized. More... | |
double | m_logRemap_gain |
double | m_logRemap_offset |
double | m_offSetGainRemap_gain |
double | m_offSetGainRemap_offset1 |
double | m_offSetGainRemap_offset2 |
Contrast::OutputParameters * | m_outputParametersPtr |
Contrast input execution parameters. More... | |
double | m_squareRemap_factor |
double | m_squareRootRemap_gain |
Contrast enhancement.
Apply contrast enhencement on the selected bands.
Definition at line 57 of file Contrast.h.
|
protected |
Type definition for a remapping function pointer.
Definition at line 234 of file Contrast.h.
te::rp::Contrast::Contrast | ( | ) |
Definition at line 169 of file Contrast.cpp.
References reset().
te::rp::Contrast::~Contrast | ( | ) |
Definition at line 174 of file Contrast.cpp.
|
protected |
Execute the decorrelation enhancement contrast following the internal parameters.
Definition at line 794 of file Contrast.cpp.
References te::rp::DirectPrincipalComponents(), te::dt::DOUBLE_TYPE, te::rst::Raster::getBand(), te::rst::Raster::getGrid(), te::rp::GetMeanValue(), te::rst::Band::getProperty(), te::rp::GetStdDevValue(), te::sa::Grid, te::rp::InversePrincipalComponents(), te::rp::Contrast::InputParameters::m_enableProgress, m_inputParameters, te::rp::Contrast::InputParameters::m_inRasterBands, te::rp::Contrast::InputParameters::m_inRasterPtr, m_offSetGainRemap_gain, m_offSetGainRemap_offset1, m_offSetGainRemap_offset2, m_outputParametersPtr, te::rp::Contrast::OutputParameters::m_outRasterBands, te::rp::Contrast::OutputParameters::m_outRasterPtr, offSetGainRemap(), remapBandLevels(), TERP_LOG_AND_RETURN_FALSE, TERP_TRUE_OR_RETURN_FALSE, and te::common::Exception::what().
Referenced by execute().
|
protected |
Execute the histogram equalization contrast following the internal parameters.
Definition at line 476 of file Contrast.cpp.
References te::rst::ConstBandIterator< T >::begin(), te::rst::ConstBandIterator< T >::end(), te::rst::Raster::getBand(), te::rp::GetDataTypeRange(), te::common::Singleton< RasterSummaryManager >::getInstance(), te::rst::Raster::getNumberOfColumns(), te::rst::Raster::getNumberOfRows(), te::rst::Band::getProperty(), te::rst::BandProperty::getType(), te::rp::Contrast::InputParameters::m_enableProgress, te::rp::Contrast::InputParameters::m_hECMaxInput, m_inputParameters, te::rp::Contrast::InputParameters::m_inRasterBands, te::rp::Contrast::InputParameters::m_inRasterPtr, m_outputParametersPtr, te::rp::Contrast::OutputParameters::m_outRasterBands, te::rp::Contrast::OutputParameters::m_outRasterPtr, te::rst::Band::setValue(), and te::rst::SUMMARY_R_HISTOGRAM.
Referenced by execute().
|
protected |
Execute a linear contrast following the internal parameters.
Definition at line 414 of file Contrast.cpp.
References te::rst::Raster::getBand(), te::rp::GetDataTypeRange(), te::rst::Band::getProperty(), te::rst::BandProperty::getType(), te::rp::Contrast::InputParameters::m_enableProgress, m_inputParameters, te::rp::Contrast::InputParameters::m_inRasterBands, te::rp::Contrast::InputParameters::m_inRasterPtr, te::rp::Contrast::InputParameters::m_lCMaxInput, te::rp::Contrast::InputParameters::m_lCMinInput, m_offSetGainRemap_gain, m_offSetGainRemap_offset1, m_offSetGainRemap_offset2, m_outputParametersPtr, te::rp::Contrast::OutputParameters::m_outRasterBands, te::rp::Contrast::OutputParameters::m_outRasterPtr, offSetGainRemap(), and remapBandLevels().
Referenced by execute().
|
protected |
Execute a log contrast following the internal parameters.
Definition at line 665 of file Contrast.cpp.
References te::rst::Raster::getBand(), te::rp::GetDataTypeRange(), te::rst::Band::getProperty(), te::rst::BandProperty::getType(), logRemap(), te::rp::Contrast::InputParameters::m_enableProgress, m_inputParameters, te::rp::Contrast::InputParameters::m_inRasterBands, te::rp::Contrast::InputParameters::m_inRasterPtr, te::rp::Contrast::InputParameters::m_logCMaxInput, te::rp::Contrast::InputParameters::m_logCMinInput, m_logRemap_gain, m_logRemap_offset, m_outputParametersPtr, te::rp::Contrast::OutputParameters::m_outRasterBands, te::rp::Contrast::OutputParameters::m_outRasterPtr, and remapBandLevels().
Referenced by execute().
|
protected |
Execute the histogram equalization contrast following the internal parameters.
Definition at line 725 of file Contrast.cpp.
References te::rst::ConstBandIterator< T >::begin(), te::rst::ConstBandIterator< T >::end(), te::rst::Raster::getBand(), te::rp::GetDataTypeRange(), te::common::Singleton< RasterSummaryManager >::getInstance(), te::rst::Raster::getNumberOfColumns(), te::rst::Raster::getNumberOfRows(), te::rst::Band::getProperty(), te::rst::Band::getRaster(), te::rst::BandProperty::getType(), te::rst::Band::getValue(), te::rp::Contrast::InputParameters::m_enableProgress, m_inputParameters, te::rp::Contrast::InputParameters::m_inRasterBands, te::rp::Contrast::InputParameters::m_inRasterPtr, m_outputParametersPtr, te::rp::Contrast::OutputParameters::m_outRasterBands, te::rp::Contrast::OutputParameters::m_outRasterPtr, te::rp::Contrast::InputParameters::m_sMASCMeanInput, te::rp::Contrast::InputParameters::m_sMASCStdInput, te::rst::Band::setValue(), te::rst::SUMMARY_MEAN, and te::rst::SUMMARY_STD.
Referenced by execute().
|
protected |
Execute a square contrast following the internal parameters.
Definition at line 549 of file Contrast.cpp.
References te::rst::Raster::getBand(), te::rp::GetDataTypeRange(), te::rst::Band::getProperty(), te::rst::BandProperty::getType(), te::rp::Contrast::InputParameters::m_enableProgress, m_inputParameters, te::rp::Contrast::InputParameters::m_inRasterBands, te::rp::Contrast::InputParameters::m_inRasterPtr, m_outputParametersPtr, te::rp::Contrast::OutputParameters::m_outRasterBands, te::rp::Contrast::OutputParameters::m_outRasterPtr, te::rp::Contrast::InputParameters::m_squareCMaxInput, te::rp::Contrast::InputParameters::m_squareCMinInput, m_squareRemap_factor, remapBandLevels(), and squareRemap().
Referenced by execute().
|
protected |
Execute a square root contrast following the internal parameters.
Definition at line 607 of file Contrast.cpp.
References te::rst::Raster::getBand(), te::rp::GetDataTypeRange(), te::rst::Band::getProperty(), te::rst::BandProperty::getType(), te::rp::Contrast::InputParameters::m_enableProgress, m_inputParameters, te::rp::Contrast::InputParameters::m_inRasterBands, te::rp::Contrast::InputParameters::m_inRasterPtr, m_outputParametersPtr, te::rp::Contrast::OutputParameters::m_outRasterBands, te::rp::Contrast::OutputParameters::m_outRasterPtr, te::rp::Contrast::InputParameters::m_squareRootCMaxInput, te::rp::Contrast::InputParameters::m_squareRootCMinInput, m_squareRootRemap_gain, remapBandLevels(), and squareRootRemap().
Referenced by execute().
|
virtual |
Executes the algorithm using the supplied parameters.
outputParams | Output parameters. |
Implements te::rp::Algorithm.
Definition at line 178 of file Contrast.cpp.
References te::rp::Contrast::InputParameters::DecorrelationEnhancementT, execDecorrelationEnhancement(), execHistogramEqualizationContrast(), execLinearContrast(), execLogContrast(), execSetMeanAndStdContrast(), execSquareContrast(), execSquareRootContrast(), te::rst::Raster::getAccessPolicy(), te::rst::Raster::getBand(), te::rst::Raster::getGrid(), te::rst::Raster::getNumberOfBands(), te::rst::Raster::getNumberOfColumns(), te::rst::Raster::getNumberOfRows(), te::rst::Band::getProperty(), te::rp::Contrast::InputParameters::HistogramEqualizationContrastT, te::rp::Contrast::InputParameters::LinearContrastT, te::rp::Contrast::InputParameters::LogContrastT, te::rp::Contrast::OutputParameters::m_createdOutRasterDSType, te::rp::Contrast::OutputParameters::m_createdOutRasterInfo, te::rp::Contrast::OutputParameters::m_createdOutRasterPtr, m_inputParameters, te::rp::Contrast::InputParameters::m_inRasterBands, te::rp::Contrast::InputParameters::m_inRasterPtr, m_isInitialized, m_outputParametersPtr, te::rp::Contrast::OutputParameters::m_outRasterBands, te::rp::Contrast::OutputParameters::m_outRasterPtr, te::rp::Contrast::InputParameters::m_type, te::rst::RasterFactory::make(), te::rp::Contrast::InputParameters::MeanAndStdContrastT, te::rp::Contrast::InputParameters::SquareContrastT, te::rp::Contrast::InputParameters::SquareRootContrastT, TERP_LOG_AND_RETURN_FALSE, TERP_LOG_AND_THROW, TERP_TRUE_OR_RETURN_FALSE, and te::common::WAccess.
Referenced by te::qt::widgets::ContrastWizardPage::apply(), te::qt::widgets::ContrastWizard::execute(), and te::qt::widgets::ContrastDialog::on_okPushButton_clicked().
|
virtual |
Initialize the algorithm instance making it ready for execution.
inputParams | Input parameters. |
Implements te::rp::Algorithm.
Definition at line 299 of file Contrast.cpp.
References te::rp::Contrast::InputParameters::DecorrelationEnhancementT, te::rst::Raster::getAccessPolicy(), te::rst::Raster::getNumberOfBands(), te::rp::Contrast::InputParameters::HistogramEqualizationContrastT, te::rp::Contrast::InputParameters::LinearContrastT, te::rp::Contrast::InputParameters::LogContrastT, te::rp::Contrast::InputParameters::m_hECMaxInput, m_inputParameters, te::rp::Contrast::InputParameters::m_inRasterBands, te::rp::Contrast::InputParameters::m_inRasterPtr, m_isInitialized, te::rp::Contrast::InputParameters::m_lCMaxInput, te::rp::Contrast::InputParameters::m_lCMinInput, te::rp::Contrast::InputParameters::m_logCMaxInput, te::rp::Contrast::InputParameters::m_logCMinInput, te::rp::Contrast::InputParameters::m_sMASCMeanInput, te::rp::Contrast::InputParameters::m_sMASCStdInput, te::rp::Contrast::InputParameters::m_squareCMaxInput, te::rp::Contrast::InputParameters::m_squareCMinInput, te::rp::Contrast::InputParameters::m_squareRootCMaxInput, te::rp::Contrast::InputParameters::m_squareRootCMinInput, te::rp::Contrast::InputParameters::m_type, te::rp::Contrast::InputParameters::MeanAndStdContrastT, te::common::RAccess, reset(), te::rp::Contrast::InputParameters::SquareContrastT, te::rp::Contrast::InputParameters::SquareRootContrastT, TERP_LOG_AND_THROW, and TERP_TRUE_OR_RETURN_FALSE.
Referenced by te::qt::widgets::ContrastWizardPage::apply(), te::qt::widgets::ContrastWizard::execute(), and te::qt::widgets::ContrastDialog::on_okPushButton_clicked().
|
virtual |
Returns true if the algorithm instance is initialized and ready for execution.
Implements te::rp::Algorithm.
Definition at line 409 of file Contrast.cpp.
References m_isInitialized.
|
inlineprotected |
Remap on gray level using a log.
inValue | Input gray level. |
outValue | Output gray level. |
Definition at line 352 of file Contrast.h.
Referenced by execLogContrast().
|
inlineprotected |
Remap on gray level using an offset and gain.
inValue | Input gray level. |
outValue | Output gray level. |
Definition at line 318 of file Contrast.h.
Referenced by execDecorrelationEnhancement(), and execLinearContrast().
|
protected |
Band gray levels remap using a remap function.
inRasterBand | Input raster band. |
outRasterBand | Output raster band. |
remapFuncPtr | The remap function pointer used. |
enableProgress | Enable the use of a progress interface. |
Definition at line 916 of file Contrast.cpp.
References te::rp::Convert2DoublesVector(), te::rp::ConvertDoublesVector(), te::rst::Band::getBlockSize(), te::rp::GetDataTypeRange(), te::rst::Raster::getNumberOfColumns(), te::rst::Raster::getNumberOfRows(), te::rst::Band::getProperty(), te::rst::BandProperty::getType(), te::rst::Band::getValue(), te::rst::BandProperty::m_blkh, te::rst::BandProperty::m_blkw, m_inputParameters, te::rp::Contrast::InputParameters::m_inRasterPtr, te::rst::BandProperty::m_nblocksx, te::rst::BandProperty::m_nblocksy, te::rst::Band::read(), te::rst::Band::setValue(), and te::rst::Band::write().
Referenced by execDecorrelationEnhancement(), execLinearContrast(), execLogContrast(), execSquareContrast(), and execSquareRootContrast().
|
virtual |
Clear all internal allocated objects and reset the algorithm to its initial state.
Implements te::rp::Algorithm.
Definition at line 292 of file Contrast.cpp.
References m_inputParameters, m_isInitialized, m_outputParametersPtr, and te::rp::Contrast::InputParameters::reset().
Referenced by Contrast(), initialize(), te::rp::Contrast::InputParameters::operator=(), te::rp::Contrast::OutputParameters::operator=(), te::rp::Contrast::OutputParameters::OutputParameters(), te::rp::Contrast::InputParameters::~InputParameters(), and te::rp::Contrast::OutputParameters::~OutputParameters().
|
inlineprotected |
Remap on gray level using a square.
inValue | Input gray level. |
outValue | Output gray level. |
Definition at line 330 of file Contrast.h.
Referenced by execSquareContrast().
|
inlineprotected |
Remap on gray level using a square root.
inValue | Input gray level. |
outValue | Output gray level. |
Definition at line 341 of file Contrast.h.
Referenced by execSquareRootContrast().
|
protected |
Contrast input execution parameters.
Definition at line 237 of file Contrast.h.
Referenced by execDecorrelationEnhancement(), execHistogramEqualizationContrast(), execLinearContrast(), execLogContrast(), execSetMeanAndStdContrast(), execSquareContrast(), execSquareRootContrast(), execute(), initialize(), remapBandLevels(), and reset().
|
protected |
Tells if this instance is initialized.
Definition at line 240 of file Contrast.h.
Referenced by execute(), initialize(), isInitialized(), and reset().
|
protected |
Definition at line 309 of file Contrast.h.
Referenced by execLogContrast().
|
protected |
Definition at line 310 of file Contrast.h.
Referenced by execLogContrast().
|
protected |
Definition at line 299 of file Contrast.h.
Referenced by execDecorrelationEnhancement(), and execLinearContrast().
|
protected |
Definition at line 297 of file Contrast.h.
Referenced by execDecorrelationEnhancement(), and execLinearContrast().
|
protected |
Definition at line 298 of file Contrast.h.
Referenced by execDecorrelationEnhancement(), and execLinearContrast().
|
protected |
Contrast input execution parameters.
Definition at line 238 of file Contrast.h.
Referenced by execDecorrelationEnhancement(), execHistogramEqualizationContrast(), execLinearContrast(), execLogContrast(), execSetMeanAndStdContrast(), execSquareContrast(), execSquareRootContrast(), execute(), and reset().
|
protected |
Definition at line 302 of file Contrast.h.
Referenced by execSquareContrast().
|
protected |
Definition at line 306 of file Contrast.h.
Referenced by execSquareRootContrast().