TePDILevelRemap Class Reference
[General purpose algorithms.]

#include <TePDILevelRemap.hpp>

Inheritance diagram for TePDILevelRemap:

TePDIAlgorithm

Detailed Description

This is the base class for level remapping algorithms.
Author:
Emiliano F. Castejon <castejon@dpi.inpe.br>

Definition at line 39 of file TePDILevelRemap.hpp.


Public Types

typedef const
TeSharedPtr
< TePDILevelRemap
const_pointer
 Type definition for a const algorithm instance pointer.
typedef TeSharedPtr
< TePDILevelRemap
pointer
 Type definition for an algorithm instance pointer.

Public Member Functions

bool Apply (const TePDIParameters &params)
bool Apply ()
virtual bool CheckParameters (const TePDIParameters &parameters) const =0
const TePDIParametersGetParameters () const
bool Reset (const TePDIParameters &params)
void ToggleProgInt (bool enabled)
virtual ~TePDILevelRemap ()

Static Public Member Functions

static TePDIAlgorithmDefaultObject (const TePDIParameters &params)

Protected Types

typedef double(* remap_func_3_ptr_type )(double, double, double)
typedef double(* remap_func_4_ptr_type )(double, double, double, double)

Protected Member Functions

void BuildHistograms (TePDITypes::TePDIRasterPtrType &inRaster, unsigned int histo_levels, std::vector< int > &channels, bool force=false)
bool CheckInternalParameters () const
TePDIHistogram::pointer GetHistRef (TePDITypes::TePDIRasterPtrType &inRaster, unsigned int band)
bool IncProgInt ()
bool RemapLevels (TePDITypes::TePDIRasterPtrType &inRaster1, TePDITypes::TePDIRasterPtrType &inRaster2, remap_func_4_ptr_type remapp_func, int in_channel1, int in_channel2, int out_channel, double gain, double offset, bool normalize_output, TePDITypes::TePDIRasterPtrType &outRaster)
bool RemapLevels (TePDITypes::TePDIRasterPtrType &inRaster, remap_func_3_ptr_type remapp_func, int in_channel, int out_channel, double gain, double offset, bool normalize_output, TePDITypes::TePDIRasterPtrType &outRaster)
virtual void ResetState (const TePDIParameters &params)
virtual bool RunImplementation ()=0
void StartProgInt (const std::string &message, unsigned int steps)
void StopProgInt ()
 TePDILevelRemap ()
bool UpdateProgInt (unsigned int step)

Protected Attributes

std::map< std::pair
< TeRaster *,
unsigned int >,
TePDIHistogram::pointer
histo_cache_
TePDIParameters params_
TePDIPIManager pi_manager_
bool progress_enabled_

Member Typedef Documentation

typedef const TeSharedPtr< TePDILevelRemap > TePDILevelRemap::const_pointer

Reimplemented from TePDIAlgorithm.

Definition at line 44 of file TePDILevelRemap.hpp.

typedef TeSharedPtr< TePDILevelRemap > TePDILevelRemap::pointer

Reimplemented from TePDIAlgorithm.

Definition at line 42 of file TePDILevelRemap.hpp.

typedef double(* TePDILevelRemap::remap_func_3_ptr_type)(double, double, double) [protected]

A level remap function pointer ( 3 arguments ).

Parameters:
double Level to be remapped.
double Gain.
double Offset.
Returns:
The remapped level.

Definition at line 60 of file TePDILevelRemap.hpp.

typedef double(* TePDILevelRemap::remap_func_4_ptr_type)(double, double, double, double) [protected]

A level remap function pointer ( 4 arguments ).

Parameters:
double Input Level 1 ( from image 1 ) to be remapped.
double Input Level 2 ( from image 2 ) to be remapped.
double Gain.
double Offset.
Returns:
The remapped level.

Definition at line 71 of file TePDILevelRemap.hpp.


Constructor & Destructor Documentation

TePDILevelRemap::~TePDILevelRemap (  )  [virtual]

Default Destructor

Definition at line 19 of file TePDILevelRemap.cpp.

00020 {
00021 }

TePDILevelRemap::TePDILevelRemap (  )  [protected]

Default Constructor.

Definition at line 14 of file TePDILevelRemap.cpp.

00015 {
00016 }


Member Function Documentation

bool TePDIAlgorithm::Apply ( const TePDIParameters params  )  [inherited]

Applies the algorithm following the state defined by the supplied parameters.

Parameters:
params The new supplied parameters.
Returns:
true if OK. false on error.

Definition at line 66 of file TePDIAlgorithm.cpp.

References TePDIAlgorithm::CheckParameters(), TePDIParameters::Clear(), TeException::message(), TePDIAlgorithm::params_, TePDIAlgorithm::ResetState(), TePDIAlgorithm::RunImplementation(), TEAGN_LOG_AND_RETURN, and TEAGN_TRUE_OR_RETURN.

00067 {
00068   TEAGN_TRUE_OR_RETURN( CheckParameters( params ),
00069     "Invalid parameters" )
00070     
00071   ResetState( params );
00072 
00073   /* This line must come after the ResetState line, because some algorithms
00074      checks the difference between the current internal parameters and the
00075      new supplied parameters */
00076   params_.Clear();
00077   params_ = params;
00078   
00079   #ifdef NDEBUG
00080     try
00081     {
00082       return RunImplementation();
00083     }
00084     catch( const TeException& exc )
00085     {
00086       TEAGN_LOG_AND_RETURN( "Exception raised from algorithm - " +
00087         exc.message() );
00088     }
00089     catch(...)
00090     {
00091       TEAGN_LOG_AND_RETURN( "Unhandled exception raised from algorithm" );
00092     }
00093   #else
00094     return RunImplementation();
00095   #endif    
00096 }

bool TePDIAlgorithm::Apply (  )  [inherited]

Applies the algorithm following the current state and internal stored parameters.

Returns:
true if OK. false on error.
Examples:
TePDIArithmetic_test.cpp, TePDIBDFilter_test.cpp, TePDIClassification_test.cpp, TePDIColorTransform_test.cpp, TePDIContrast_test.cpp, TePDICorrelationMatching_test.cpp, TePDIDecorrelationEnhancement_test.cpp, TePDIFFT_test.cpp, TePDIFusion_test.cpp, TePDIHants_test.cpp, TePDILinearFilter_test.cpp, TePDIMIMatching_test.cpp, TePDIMixModel_test.cpp, TePDIMMIOMatching_test.cpp, TePDIMorfFilter_test.cpp, TePDIMosaic_test.cpp, TePDIParallelSegmenter_test.cpp, TePDIPrincipalComponents_test.cpp, TePDIRadarFilters_test.cpp, TePDIRaster2Vector_test.cpp, TePDIRegister_test.cpp, TePDISegmentation_test.cpp, TePDISensorSimulator_test.cpp, TePDISimplex_test.cpp, and TePDIWavelets_test.cpp.

Definition at line 34 of file TePDIAlgorithm.cpp.

References TePDIAlgorithm::CheckInternalParameters(), TeException::message(), TePDIAlgorithm::RunImplementation(), TePDIAlgorithm::StopProgInt(), TEAGN_LOG_AND_RETURN, and TEAGN_LOGERR.

Referenced by Avg3x3_test(), Avg7x7_test(), Baatz_Strategy_test(), BatchGeoMosaic_test1(), BatchGeoMosaic_test2(), buildData(), Dilation_1_iteration_test(), Dilation_2_iterations_test(), Dilation_3_iterations_test(), Dilation_4_iterations_test(), Dilation_with_dummy_test(), DummyMask_RGB_test(), EMClassification_test(), Erosion_1_iteration_test(), Erosion_2_iterations_test(), Erosion_3_iterations_test(), Erosion_4_iterations_test(), Erosion_with_dummy_test(), TePDIParaSegRegGrowStrategy::execute(), TePDIParaSegBaatzStrategy::execute(), Frost_test(), Gamma_test(), GarguetFusion_test(), GeoMosaic_test1(), GeoMosaic_test2(), GeoMosaic_test3(), GeoMosaic_test4(), halfsampledImageTest(), halfsampledImageTest2(), halfsampledRotadedImageTest(), halfsampledRotadedImageWithDownsampleTest(), HRCxCCDTest(), IHSFusion_test(), IsosegClassification_test(), KMeansClassification_test(), KuanAdaptative_test(), KuanFixed_test(), LeeAdaptative_test(), LeeFixed_test(), main(), Mallat_GetPyramid_and_RecomposePyramid_test(), Mallat_low_low_swap_test(), Median_1_iteration_test(), Median_2_iterations_test(), Median_3_iterations_test(), Median_4_iterations_test(), Median_with_dummy_test(), Mode_1_iteration_test(), Mode_2_iteration_test(), Mode_3_iteration_test(), NDHigh_test(), pca_test(), PrincoMixModel_test(), Raster2Vector_test(), RegionGrowing_Strategy_pattern1_test(), RegionGrowing_Strategy_test(), Register_test1(), RGB2IHS_IHS2RGB_image_test(), RGB2IHS_IHS2RGB_numeric_test(), Roberts_test(), TePDIWiSpeRFusion::RunImplementation(), TePDIWaveletAtrousFusion::RunImplementation(), TePDIVenturaFusion::RunImplementation(), TePDISensorSimulator::RunImplementation(), TePDIRegGrowSeg::RunImplementation(), TePDIPrincipalComponentsFusion::RunImplementation(), TePDIPCAWaveletFusion::RunImplementation(), TePDIIHSWaveletFusion::RunImplementation(), TePDIIHSFusion::RunImplementation(), TePDIGeneralizedIHSFusion::RunImplementation(), TePDIGarguetFusion::RunImplementation(), TePDIDecorrelationEnhancement::RunImplementation(), TePDIBatchGeoMosaic::RunImplementation(), TePDIBaatz::RunImplementation(), S_test(), sameImageAndBoxesTest(), sameImageAndBoxesWithMaskTest(), sameImageDifBoxesTest(), sameImageGreenXBlueTest(), sameImageGreenXRedTest(), sameImageTest(), sameImageTest2(), sameImageTestWithMultiThread(), sameInvertedImageTest(), Sobel_test(), TePDIArithmetic_operator_test1(), TePDIArithmetic_precedence_test(), TePDIArithmetic_real_number_test(), TePDIBaatz_test(), TePDIContrastHistEqualizer_test(), TePDIContrastLinear_plus_histo_test(), TePDIContrastLog_test(), TePDIContrastLog_with_use_dummy_test(), TePDIContrastMinMax_autolevels_test(), TePDIContrastMinMax_no_input_image_test(), TePDIContrastNegative_test(), TePDIContrastSimpleSlicer_test(), TePDIContrastSquare_test(), TePDIContrastSquareRoot_test(), TePDIContrastStat_test(), TePDIDecorrelationEnhancement_test(), TePDIFFT_test(), TePDIGeneralizedIHSFusion_test(), TePDIHants_test(), TePDIIHSWaveletFusion_test(), TePDIPCAWaveletFusion_test(), TePDIPrincipalComponentsFusion_test(), TePDIRegGrowSeg_test(), TePDISAMClassifier_test(), TePDISensorSimulator_test(), TePDIWaveletAtrous_test(), TePDIWaveletAtrousFusion_test(), TePDIWiSpeRFusion_test(), TPMosaic_test1(), TPMosaic_test2(), and VenturaFusion_test().

00035 {
00036   bool return_value = false;
00037   
00038   if( CheckInternalParameters() ) {
00039     #ifdef NDEBUG
00040       try
00041       {
00042         return_value = RunImplementation();
00043       }
00044       catch( const TeException& exc )
00045       {
00046         TEAGN_LOGERR( "Exception raised from algorithm - " +
00047           exc.message() );
00048       }
00049       catch(...)
00050       {
00051         TEAGN_LOGERR( "Unhandled exception raised from algorithm" );
00052       }
00053     #else
00054       return_value = RunImplementation();
00055     #endif
00056     
00057     StopProgInt();
00058   } else {
00059     TEAGN_LOG_AND_RETURN( "Invalid supplied parameters" );
00060   }
00061   
00062   return return_value;
00063 }

void TePDILevelRemap::BuildHistograms ( TePDITypes::TePDIRasterPtrType inRaster,
unsigned int  histo_levels,
std::vector< int > &  channels,
bool  force = false 
) [protected]

Build level ordered histograms from the required raster channels.

Note:
The result histograms will remain inside the protected object histo_cache_
Parameters:
inRaster The input Raster.
histo_levels Number of histogram interpolated levels.
channels Channels to use for histogram generation.
force Force histogram regeneratin even if already in cache.

Definition at line 468 of file TePDILevelRemap.cpp.

References histo_cache_, TeSharedPtr< T >::isActive(), TeSharedPtr< T >::nakedPointer(), TeSharedPtr< T >::reset(), TEAGN_TRUE_OR_THROW, TeBoxPixelIn, and TeRasterParams::TeNotReady.

00473 {
00474   TEAGN_TRUE_OR_THROW( inRaster.isActive(),
00475     "inRaster inactive" );
00476   TEAGN_TRUE_OR_THROW( inRaster->params().status_ != TeRasterParams::TeNotReady,
00477     "inRaster not ready" );
00478 
00479   std::pair< TeRaster*, unsigned int  > mapkey;
00480   mapkey.first = inRaster.nakedPointer();
00481 
00482   for( unsigned int channels_index = 0 ; channels_index < channels.size() ;
00483        ++channels_index ) {
00484 
00485     TEAGN_TRUE_OR_THROW( channels[ channels_index ] < inRaster->nBands(),
00486       "Trying to creat histogram from an invalid band" );
00487 
00488     mapkey.second = channels_index;
00489 
00490     if( ( histo_cache_.find( mapkey ) ==  histo_cache_.end() ) || force ) {
00491 
00492       TePDIHistogram::pointer temp_hist( new TePDIHistogram );
00493 
00494       TEAGN_TRUE_OR_THROW( temp_hist->reset( inRaster,
00495         channels[ channels_index ], histo_levels, 
00496         TeBoxPixelIn ),
00497         "Histogram Generation Error" );
00498 
00499       histo_cache_[ mapkey ] = temp_hist;
00500     }
00501   }
00502 }

bool TePDIAlgorithm::CheckInternalParameters (  )  const [protected, inherited]

Checks if current internal parameters fits the requirements of each PDI algorithm implementation.

Note:
Error log messages must be generated. No exceptions generated.
Returns:
true if the internal parameters are OK. false if not.

Definition at line 105 of file TePDIAlgorithm.cpp.

References TePDIAlgorithm::CheckParameters(), and TePDIAlgorithm::params_.

Referenced by TePDIAlgorithm::Apply().

00106 {
00107   return CheckParameters( params_ );
00108 }

virtual bool TePDIAlgorithm::CheckParameters ( const TePDIParameters parameters  )  const [pure virtual, inherited]

Checks if the supplied parameters fits the requirements of each PDI algorithm implementation.

Note:
Error log messages must be generated. No exceptions generated.
Parameters:
parameters The parameters to be checked.
Returns:
true if the parameters are OK. false if not.

Implemented in TePDIArithmetic, TePDIBaatz, TePDIBatchGeoMosaic, TePDIBDFilter, TePDIColorTransform, TePDIContrast, TePDICorrelationMatching, TePDIDecorrelationEnhancement, TePDIEMClas, TePDIFFT, TePDIFusionIndexes, TePDIGarguetFusion, TePDIGeneralizedIHSFusion, TePDIGeoMosaic, TePDIHants, TePDIHaralick, TePDIIHSFusion, TePDIIHSWaveletFusion, TePDIIsosegClas, TePDIKMeansClas, TePDILinearFilter, TePDIMallatWavelets, TePDIMIMatching, TePDIMixModel, TePDIMMIOMatching, TePDIMorfFilter, TePDIOFMatching, TePDIParallelSegmenter, TePDIPCAWaveletFusion, TePDIPrincipalComponents, TePDIPrincipalComponentsFusion, TePDIRadarFrostFilter, TePDIRadarGammaFilter, TePDIRadarKuanFilter, TePDIRadarLeeFilter, TePDIRaster2Vector, TePDIRegGrowSeg, TePDIRegister, TePDISAMClassifier, TePDISensorSimulator, TePDISimplex, TePDIStatistic, TePDITPMosaic, TePDIVenturaFusion, TePDIWaveletAtrous, TePDIWaveletAtrousFusion, and TePDIWiSpeRFusion.

Referenced by TePDIAlgorithm::Apply(), TePDIAlgorithm::CheckInternalParameters(), and TePDIAlgorithm::Reset().

TePDIAlgorithm * TePDIAlgorithm::DefaultObject ( const TePDIParameters params  )  [static, inherited]

Returns a default object.

Returns:
A default object.

Definition at line 119 of file TePDIAlgorithm.cpp.

References TEAGN_LOG_AND_THROW.

00120 {
00121   TEAGN_LOG_AND_THROW( "Trying to create an invalid algorithm instance" );
00122   
00123   TePDIParameters dummy_params = params;
00124 
00125   return 0;
00126 }

TePDIHistogram::pointer TePDILevelRemap::GetHistRef ( TePDITypes::TePDIRasterPtrType inRaster,
unsigned int  band 
) [protected]

Returns the histogram reference stored inside the histogram cache.

Note:
The result histograms will remain inside the protected object histo_cache_
Parameters:
inRaster The input Raster.
band Band number.
Returns:
The histogram reference.

Definition at line 505 of file TePDILevelRemap.cpp.

References histo_cache_, TeSharedPtr< T >::nakedPointer(), and TEAGN_TRUE_OR_THROW.

00508 {
00509   std::pair< TeRaster*, unsigned int  > mapkey;
00510   mapkey.first = inRaster.nakedPointer();
00511   mapkey.second = band;
00512 
00513   TEAGN_TRUE_OR_THROW(
00514     ( histo_cache_.find( mapkey ) != histo_cache_.end() ),
00515     "Histogram not stored inside cache" );
00516 
00517   return histo_cache_[ mapkey ];
00518 }

const TePDIParameters & TePDIAlgorithm::GetParameters (  )  const [inherited]

Returns a reference to the current internal parameters.

Returns:
A reference to the current internal parameters.

Definition at line 99 of file TePDIAlgorithm.cpp.

References TePDIAlgorithm::params_.

00100 {
00101   return params_;
00102 }

bool TePDIAlgorithm::IncProgInt (  )  [protected, inherited]

Increments the the current progress by one step.

Returns:
true if the interface was canceled, false otherwise.
Deprecated:
DEPRECATED - This method will be removed in the future (each algorithm must check the variable TePDIAlgorithm::progress_enabled_ and instantiate its own TePDIPIManager when necessary).

Definition at line 155 of file TePDIAlgorithm.cpp.

References TePDIPIManager::Increment(), and TePDIAlgorithm::pi_manager_.

Referenced by TePDIContrast::GetHistEqualizerLut(), and TePDIRegister::RunImplementation().

00156 {
00157   return pi_manager_.Increment();
00158 }

bool TePDILevelRemap::RemapLevels ( TePDITypes::TePDIRasterPtrType inRaster1,
TePDITypes::TePDIRasterPtrType inRaster2,
remap_func_4_ptr_type  remapp_func,
int  in_channel1,
int  in_channel2,
int  out_channel,
double  gain,
double  offset,
bool  normalize_output,
TePDITypes::TePDIRasterPtrType outRaster 
) [protected]

Do level remapping from two input rasters to another.

Parameters:
inRaster1 The input Raster 1.
inRaster2 The input Raster 2.
outRaster The Output Raster.
remapp_func The level remapping function pointer.
in_channel1 in_raster1 channel to remap.
in_channel2 in_raster2 channel to remap.
out_channel out_raster channel to write on.
gain Level Gain.
offset Level Offset.
normalize_output Do output normalization following the output raster channel allowed values range
Returns:
true if ok, false on errors.

Definition at line 231 of file TePDILevelRemap.cpp.

References TeRaster::getElement(), TeSharedPtr< T >::isActive(), TeSharedPtr< T >::nakedPointer(), TePDIMatrix< ElementType >::Reset(), TeRaster::setElement(), TePDIAlgorithm::StartProgInt(), TePDIAlgorithm::StopProgInt(), Te2String(), TEAGN_CHECK_EQUAL, TEAGN_FALSE_OR_RETURN, TEAGN_TRUE_OR_RETURN, TEAGN_TRUE_OR_THROW, TeDOUBLE, TePDIUtils::TeGetRasterMinMaxBounds(), TeRasterParams::TeNotReady, and TePDIAlgorithm::UpdateProgInt().

00242 {
00243   TEAGN_TRUE_OR_THROW( inRaster1.isActive(),
00244     "inRaster1 inactive" );
00245   TEAGN_TRUE_OR_THROW( inRaster2.isActive(),
00246     "inRaster2 inactive" );
00247   TEAGN_TRUE_OR_THROW( outRaster.isActive(),
00248     "outRaster inactive" );
00249   TEAGN_TRUE_OR_THROW( 
00250     ( inRaster1->params().status_ != TeRasterParams::TeNotReady ),
00251     "inRaster1 not ready" );
00252   TEAGN_TRUE_OR_THROW( 
00253     ( inRaster2->params().status_ != TeRasterParams::TeNotReady ),
00254     "inRaster2 not ready" );
00255   TEAGN_TRUE_OR_THROW( 
00256     ( outRaster->params().status_ != TeRasterParams::TeNotReady ),
00257     "outRaster not ready" );
00258   TEAGN_CHECK_EQUAL( inRaster1->params().nlines_,
00259     outRaster->params().nlines_,
00260     "Lines number mismatch between input1 and output image" );
00261   TEAGN_CHECK_EQUAL( inRaster1->params().ncols_,
00262     outRaster->params().ncols_,
00263     "Columns number mismatch between input1 and output image" );
00264   TEAGN_CHECK_EQUAL( inRaster2->params().nlines_,
00265     outRaster->params().nlines_,
00266     "Lines number mismatch between input2 and output image" );
00267   TEAGN_CHECK_EQUAL( inRaster2->params().ncols_,
00268     outRaster->params().ncols_,
00269     "Columns number mismatch between input2 and output image" );
00270   TEAGN_TRUE_OR_THROW( in_channel1 < inRaster1->nBands(), "Invalid input1 band" );
00271   TEAGN_TRUE_OR_THROW( in_channel2 < inRaster2->nBands(), "Invalid input2 band" );
00272   TEAGN_TRUE_OR_THROW( out_channel < outRaster->nBands(), "Invalid output band" );
00273   
00274   if( normalize_output ) {
00275     TEAGN_TRUE_OR_THROW( 
00276       ( outRaster->params().dataType_[ out_channel ] != TeDOUBLE ),
00277       "Cannot apply normalization for TeDOUBLE pixel type output bands" );
00278   }
00279   
00280   TeRaster* inRaster1NPtr = inRaster1.nakedPointer();
00281   TeRaster* inRaster2NPtr = inRaster2.nakedPointer();
00282   TeRaster* outRasterNPtr = outRaster.nakedPointer();
00283   const int in_raster_lines = inRaster1->params().nlines_;
00284   const int in_raster_columns = inRaster1->params().ncols_;    
00285   
00286   /* Guessing dummy use */
00287   
00288   bool inRaster1_uses_dummy = inRaster1->params().useDummy_;
00289   bool inRaster2_uses_dummy = inRaster2->params().useDummy_;
00290   bool outRaster_uses_dummy = outRaster->params().useDummy_;
00291   double outRaster_dummy = 0;
00292   if( outRaster_uses_dummy ) {
00293     outRaster_dummy = outRaster->params().dummy_[ out_channel ];
00294   }   
00295   
00296   /* Guessing channel bounds */
00297   
00298   double in_channel1_min_level = 0;
00299   double in_channel1_max_level = 0;
00300 
00301   TEAGN_TRUE_OR_THROW( TePDIUtils::TeGetRasterMinMaxBounds(
00302     inRaster1, in_channel1, in_channel1_min_level,
00303     in_channel1_max_level ), 
00304     "Unable to get raster1 input channel level bounds" );  
00305     
00306   double in_channel2_min_level = 0;
00307   double in_channel2_max_level = 0;
00308 
00309   TEAGN_TRUE_OR_THROW( TePDIUtils::TeGetRasterMinMaxBounds(
00310     inRaster2, in_channel2, in_channel2_min_level,
00311     in_channel2_max_level ), 
00312     "Unable to get raster2 input channel level bounds" );  
00313 
00314   double out_channel_min_level = 0;
00315   double out_channel_max_level = 0;
00316 
00317   TEAGN_TRUE_OR_THROW( TePDIUtils::TeGetRasterMinMaxBounds(
00318     outRaster, out_channel, out_channel_min_level,
00319     out_channel_max_level ), 
00320     "Unable to get raster output channel level bounds" );
00321     
00322   /* Level remapping */
00323     
00324   if( normalize_output ) {
00325     /* Guessing normalization factors */
00326     
00327     double norm_factor = 0;
00328     double norm_off = 0;
00329     
00330     TePDIMatrix< double > mapped_matrix;
00331     TEAGN_TRUE_OR_THROW( mapped_matrix.Reset( in_raster_lines, 
00332       in_raster_columns, TePDIMatrix< double >::AutoMemPol ),
00333       "Mapped levels matrix reset error" );    
00334   
00335     StartProgInt( "Guessing normalization factors...", in_raster_lines );
00336   
00337     double norm_min_level = DBL_MAX;
00338     double norm_max_level = -1.0 * norm_min_level;
00339     int line = 0;
00340     int column = 0;
00341     double value1 = 0;
00342     double value2= 0;
00343     bool got_element1 = false;
00344     bool got_element2 = false;
00345     double mapped_level = 0;
00346     
00347     for( line = 0 ; line < in_raster_lines ; ++line ) {
00348       TEAGN_FALSE_OR_RETURN( UpdateProgInt( line ), "Canceled by the user" );
00349   
00350       for( column = 0 ; column < in_raster_columns ; ++column ) {
00351         got_element1 = inRaster1NPtr->getElement( column, line, value1, 
00352           in_channel1 );
00353         got_element2 = inRaster2NPtr->getElement( column, line, value2, 
00354           in_channel2 );
00355           
00356         if( got_element1 && got_element2 ) {
00357           mapped_level = remapp_func( value1, value2 , gain, offset );    
00358         
00359           mapped_matrix( line, column ) = mapped_level;
00360             
00361           if( mapped_level < norm_min_level ) {
00362             norm_min_level = mapped_level;
00363           } 
00364           if( mapped_level > norm_max_level ) {
00365             norm_max_level = mapped_level;
00366           }
00367         } else {
00368           if( got_element1 ) {
00369             TEAGN_TRUE_OR_RETURN( inRaster2_uses_dummy, 
00370               "Raster2 read error" );
00371           } else {
00372             TEAGN_TRUE_OR_RETURN( inRaster1_uses_dummy, 
00373               "Raster1 read error" );
00374           }        
00375         
00376           mapped_matrix( line, column ) = outRaster_dummy;
00377         }
00378       }
00379     }
00380      
00381     StopProgInt();
00382     
00383     norm_factor = ( out_channel_max_level - out_channel_min_level ) /
00384       ( norm_max_level - norm_min_level );
00385     norm_off = out_channel_min_level - norm_min_level;
00386     
00387     /* Remapping levels */
00388     
00389     double output_level = 0;
00390     
00391     StartProgInt( "Remapping Levels...", in_raster_lines );
00392     
00393     for( line = 0 ; line < in_raster_lines ; ++line ) {
00394       TEAGN_FALSE_OR_RETURN( UpdateProgInt( line ), "Canceled by the user" );
00395     
00396       for( column = 0 ; column < in_raster_columns ; ++column ) {
00397         output_level = mapped_matrix( line, column );
00398               
00399         output_level = ( output_level + norm_off ) * norm_factor;
00400         
00401         TEAGN_TRUE_OR_RETURN( outRasterNPtr->setElement( column, line,
00402           output_level, out_channel ),
00403           "Level remmaping error at " + Te2String( line ) +
00404           "," + Te2String( column ) );        
00405       }  
00406     }
00407   } else {
00408     int line = 0;
00409     int column = 0;  
00410     double current_level1 = 0;
00411     double current_level2 = 0;
00412     double output_level = 0;
00413     bool got_element1 = false;
00414     bool got_element2 = false;
00415     
00416     StartProgInt( "Remapping Levels...", in_raster_lines );
00417   
00418     for( line = 0 ; line < in_raster_lines ; ++line ) {
00419       TEAGN_FALSE_OR_RETURN( UpdateProgInt( line ), "Canceled by the user" );
00420     
00421       for( column = 0 ; column < in_raster_columns ; ++column ) {
00422         got_element1 = inRaster1NPtr->getElement( column, line, 
00423           current_level1, in_channel1 );
00424         got_element2 = inRaster2NPtr->getElement( column, line, 
00425           current_level2, in_channel2 );
00426               
00427         if( got_element1 && got_element2 ) {
00428   
00429           /* Finding mapped level by using the level remapping function */
00430   
00431           output_level = remapp_func( current_level1, current_level2 , gain, 
00432             offset );
00433   
00434           /* Level range filtering */
00435           
00436           if( output_level < out_channel_min_level ) {
00437             output_level = out_channel_min_level;
00438           } else if( output_level > out_channel_max_level ) {
00439             output_level = out_channel_max_level;
00440           }
00441 
00442           TEAGN_TRUE_OR_RETURN( outRasterNPtr->setElement( column, line,
00443             output_level, out_channel ),
00444             "Level remmaping error at " + Te2String( line ) +
00445             "," + Te2String( column ) );
00446         } else {
00447           if( got_element1 ) {
00448             TEAGN_TRUE_OR_RETURN( inRaster2_uses_dummy, 
00449               "Raster2 read error" );
00450           } else {
00451             TEAGN_TRUE_OR_RETURN( inRaster1_uses_dummy, 
00452               "Raster1 read error" );
00453           }
00454             
00455           TEAGN_TRUE_OR_RETURN( outRaster->setElement( column, line,
00456             outRaster_dummy, out_channel ),
00457             "Level remmaping error at " + Te2String( line ) +
00458             "," + Te2String( column ) );
00459         }
00460       }  
00461     }
00462   }
00463   
00464   return true;
00465 }

bool TePDILevelRemap::RemapLevels ( TePDITypes::TePDIRasterPtrType inRaster,
remap_func_3_ptr_type  remapp_func,
int  in_channel,
int  out_channel,
double  gain,
double  offset,
bool  normalize_output,
TePDITypes::TePDIRasterPtrType outRaster 
) [protected]

Do level remapping from one raster to another.

Parameters:
inRaster The input Raster.
outRaster The Output Raster.
remapp_func The level remapping function pointer.
in_channel in_raster channel to remap.
out_channel out_raster channel to write on.
gain Level Gain.
offset Level Offset.
normalize_output Do output normalization following the output raster channel allowed values range.
Returns:
true if ok, false on errors.

Definition at line 33 of file TePDILevelRemap.cpp.

References TeRaster::getElement(), TeSharedPtr< T >::isActive(), TeSharedPtr< T >::nakedPointer(), TePDIMatrix< ElementType >::Reset(), TeRaster::setElement(), TePDIAlgorithm::StartProgInt(), TePDIAlgorithm::StopProgInt(), Te2String(), TEAGN_CHECK_EQUAL, TEAGN_FALSE_OR_RETURN, TEAGN_TRUE_OR_RETURN, TEAGN_TRUE_OR_THROW, TeDOUBLE, TePDIUtils::TeGetRasterMinMaxBounds(), TeRasterParams::TeNotReady, and TePDIAlgorithm::UpdateProgInt().

00042 {
00043   TEAGN_TRUE_OR_THROW( inRaster.isActive(),
00044     "inRaster inactive" );
00045   TEAGN_TRUE_OR_THROW( outRaster.isActive(),
00046     "outRaster inactive" );
00047   TEAGN_TRUE_OR_THROW( 
00048     ( inRaster->params().status_ != TeRasterParams::TeNotReady ),
00049     "inRaster not ready" );
00050   TEAGN_TRUE_OR_THROW( 
00051     ( outRaster->params().status_ != TeRasterParams::TeNotReady ),
00052     "outRaster not ready" );
00053   TEAGN_CHECK_EQUAL( inRaster->params().nlines_,
00054     outRaster->params().nlines_,
00055     "Lines number mismatch between input and output image" );
00056   TEAGN_CHECK_EQUAL( inRaster->params().ncols_,
00057     outRaster->params().ncols_,
00058     "Columns number mismatch between input and output image" );
00059   TEAGN_TRUE_OR_THROW( in_channel < inRaster->nBands(), "Invalid input band" );
00060   TEAGN_TRUE_OR_THROW( out_channel < outRaster->nBands(), "Invalid output band" );
00061   
00062   if( normalize_output ) {
00063     TEAGN_TRUE_OR_THROW( 
00064       ( outRaster->params().dataType_[ out_channel ] != TeDOUBLE ),
00065       "Cannot apply normalization for TeDOUBLE pixel type output bands" );
00066   }
00067   
00068   TeRaster* inRasterNPtr = inRaster.nakedPointer();
00069   TeRaster* outRasterNPtr = outRaster.nakedPointer();
00070   const int in_raster_lines = inRaster->params().nlines_;
00071   const int in_raster_columns = inRaster->params().ncols_;  
00072   
00073   /* Guessing channel bounds */
00074   
00075   double in_channel_min_level = 0;
00076   double in_channel_max_level = 0;
00077 
00078   TEAGN_TRUE_OR_THROW( TePDIUtils::TeGetRasterMinMaxBounds(
00079     inRaster, in_channel, in_channel_min_level,
00080     in_channel_max_level ), 
00081     "Unable to get raster input channel level bounds" );  
00082 
00083   double out_channel_min_level = 0;
00084   double out_channel_max_level = 0;
00085 
00086   TEAGN_TRUE_OR_THROW( TePDIUtils::TeGetRasterMinMaxBounds(
00087     outRaster, out_channel, out_channel_min_level,
00088     out_channel_max_level ), 
00089     "Unable to get raster output channel level bounds" );
00090     
00091   /* Guessing dummy use */
00092   
00093   bool inRaster_uses_dummy = inRaster->params().useDummy_;
00094   double inRaster_dummy = 0;
00095   if( inRaster_uses_dummy ) {
00096     inRaster_dummy = inRaster->params().dummy_[ in_channel ];
00097   }
00098   
00099   bool outRaster_uses_dummy = outRaster->params().useDummy_;
00100   double outRaster_dummy = 0;
00101   if( outRaster_uses_dummy ) {
00102     outRaster_dummy = outRaster->params().dummy_[ out_channel ];
00103   }
00104   
00105   /* Level remapping */
00106   
00107   if( normalize_output ) {
00108     /* Guessing normalization factors */
00109   
00110     double norm_min_level = DBL_MAX;
00111     double norm_max_level = -1.0 * norm_min_level;
00112     double norm_factor = 0;
00113     double norm_off = 0;
00114     
00115     double current_level = 0;
00116     
00117     TePDIMatrix< double > mapped_matrix;
00118     TEAGN_TRUE_OR_THROW( mapped_matrix.Reset( in_raster_lines, 
00119       in_raster_columns, TePDIMatrix< double >::AutoMemPol ),
00120       "Mapped levels matrix reset error" );
00121     
00122     StartProgInt( "Guessing normalization factors...", in_raster_lines );
00123     
00124     int line = 0;
00125     int column = 0;
00126       
00127     for( line = 0 ; line < in_raster_lines ; ++line ) {
00128       TEAGN_FALSE_OR_RETURN( UpdateProgInt( line ), "Canceled by the user" );
00129     
00130       for( column = 0 ; column < in_raster_columns ; ++column ) {
00131         if( ! inRasterNPtr->getElement( column, line, current_level, 
00132           in_channel ) ) {
00133           
00134           TEAGN_TRUE_OR_RETURN( inRaster_uses_dummy, "Raster read error" );
00135           
00136           current_level = inRaster_dummy;
00137         }
00138         
00139         current_level = remapp_func( current_level, gain, offset ); 
00140           
00141         mapped_matrix( line, column ) = current_level;
00142           
00143         if( current_level < norm_min_level ) {
00144           norm_min_level = current_level;
00145         } 
00146         if( current_level > norm_max_level ) {
00147           norm_max_level = current_level;
00148         }                  
00149       }
00150     }
00151        
00152     StopProgInt();
00153     
00154     norm_factor = ( out_channel_max_level - out_channel_min_level ) /
00155       ( norm_max_level - norm_min_level );
00156     norm_off = out_channel_min_level - norm_min_level;
00157     
00158     /* Output Level remapping */
00159     
00160     double output_level = 0;
00161     double matrix_level = 0;
00162     
00163     StartProgInt( "Remapping Levels...", in_raster_lines );
00164   
00165     for( line = 0 ; line < in_raster_lines ; ++line ) {
00166       TEAGN_FALSE_OR_RETURN( UpdateProgInt( line ), "Canceled by the user" );
00167     
00168       for( column = 0 ; column < in_raster_columns ; ++column ) {
00169         matrix_level = mapped_matrix( line, column );
00170         output_level = ( matrix_level + norm_off ) * norm_factor;
00171         
00172         TEAGN_TRUE_OR_RETURN( outRasterNPtr->setElement( column, line,
00173           output_level, out_channel ),
00174           "Level remmaping error at " + Te2String( line ) +
00175           "," + Te2String( column ) );            
00176       }
00177     }
00178     
00179     StopProgInt();
00180   } else {
00181     /* Level remapping */
00182   
00183     double current_level;
00184     double output_level;
00185     
00186     StartProgInt( "Remapping Levels...", in_raster_lines );
00187   
00188     int line = 0;
00189     int column = 0;
00190     for( line = 0 ; line < in_raster_lines ; ++line ) {
00191       TEAGN_FALSE_OR_RETURN( UpdateProgInt( line ), "Canceled by the user" );
00192     
00193       for( column = 0 ; column < in_raster_columns ; ++column ) {
00194         if( inRasterNPtr->getElement( column, line, current_level,
00195             in_channel ) ) {
00196   
00197           /* Finding mapped level by using the level remapping function */
00198   
00199           output_level = remapp_func( current_level, gain, offset );
00200   
00201           /* Level range filtering */
00202           
00203           if( output_level < out_channel_min_level ) {
00204             output_level = out_channel_min_level;
00205           } else if( output_level > out_channel_max_level ) {
00206             output_level = out_channel_max_level;
00207           }
00208   
00209           TEAGN_TRUE_OR_RETURN( outRasterNPtr->setElement( column, line,
00210             output_level, out_channel ),
00211             "Level remmaping error at " + Te2String( line ) +
00212             "," + Te2String( column ) );
00213         } else {
00214           TEAGN_TRUE_OR_RETURN( inRaster_uses_dummy, "Raster read error" );
00215             
00216           TEAGN_TRUE_OR_RETURN( outRasterNPtr->setElement( column, line,
00217             outRaster_dummy, out_channel ),
00218             "Level remmaping error at " + Te2String( line ) +
00219             "," + Te2String( column ) );          
00220         }
00221       }
00222     }
00223     
00224     StopProgInt();
00225   }
00226   
00227   return true;
00228 }

bool TePDIAlgorithm::Reset ( const TePDIParameters params  )  [inherited]

Reset the internal state with new supplied parameters.

Parameters:
params The new supplied parameters.
Returns:
true if parameters OK, false on error.
Examples:
TePDIBDFilter_test.cpp, TePDIClassification_test.cpp, TePDIColorTransform_test.cpp, TePDIContrast_test.cpp, TePDICorrelationMatching_test.cpp, TePDIDecorrelationEnhancement_test.cpp, TePDIFFT_test.cpp, TePDIFusion_test.cpp, TePDIHants_test.cpp, TePDIHaralick_test.cpp, TePDILinearFilter_test.cpp, TePDIMIMatching_test.cpp, TePDIMixModel_test.cpp, TePDIMMIOMatching_test.cpp, TePDIMorfFilter_test.cpp, TePDIOFMatching_test.cpp, TePDIPrincipalComponents_test.cpp, TePDIRadarFilters_test.cpp, TePDIRaster2Vector_test.cpp, TePDIRegister_test.cpp, TePDISegmentation_test.cpp, TePDISensorSimulator_test.cpp, TePDISimplex_test.cpp, TePDIStatistic_test.cpp, and TePDIWavelets_test.cpp.

Definition at line 16 of file TePDIAlgorithm.cpp.

References TePDIAlgorithm::CheckParameters(), TePDIParameters::Clear(), TePDIAlgorithm::params_, TePDIAlgorithm::ResetState(), and TEAGN_LOG_AND_RETURN.

Referenced by TePDIMallatWavelets::AllocateTopLevel(), Avg3x3_test(), Avg7x7_test(), TePDIFusionIndexes::bias_index(), TePDISensorSimulatorFactory::build(), TePDIRegisterFactory::build(), TePDIRegGrowSegFactory::build(), TePDIRaster2VectorFactory::build(), TePDIRadarLeeFilterFactory::build(), TePDIRadarKuanFilterFactory::build(), TePDIRadarFrostFilterFactory::build(), TePDIPrincipalComponentsFactory::build(), TePDIMorfFilterFactory::build(), TePDIMixModelFactory::build(), TePDILinearFilterFactory::build(), TePDIKMeansClasFactory::build(), TePDIIsosegClasFactory::build(), TePDIEMClasFactory::build(), TePDIContrastFactory::build(), TePDIColorTransformFactory::build(), TePDIBDFilterFactory::build(), TePDIArithmeticFactory::build(), buildData(), TePDIFusionIndexes::correlation_coefficient_index(), TePDIMallatWavelets::Decompose(), Dilation_1_iteration_test(), Dilation_2_iterations_test(), Dilation_3_iterations_test(), Dilation_4_iterations_test(), Dilation_with_dummy_test(), DummyMask_RGB_test(), EMClassification_test(), TePDIFusionIndexes::ergas_index(), Erosion_1_iteration_test(), Erosion_2_iterations_test(), Erosion_3_iterations_test(), Erosion_4_iterations_test(), Erosion_with_dummy_test(), TePDIFusionIndexes::fit_histogram(), Frost_test(), Gamma_test(), GarguetFusion_test(), halfsampledImageTest(), halfsampledImageTest2(), halfsampledRotadedImageTest(), halfsampledRotadedImageWithDownsampleTest(), HRCxCCDTest(), IHSFusion_test(), IsosegClassification_test(), KMeansClassification_test(), KuanAdaptative_test(), KuanFixed_test(), LeeAdaptative_test(), LeeFixed_test(), main(), Mallat_GetPyramid_and_RecomposePyramid_test(), Mallat_low_low_swap_test(), Median_1_iteration_test(), Median_2_iterations_test(), Median_3_iterations_test(), Median_4_iterations_test(), Median_with_dummy_test(), Mode_1_iteration_test(), Mode_2_iteration_test(), Mode_3_iteration_test(), NDHigh_test(), numeric_test_with_polygonset(), numeric_with_histograms_test(), pca_test(), PrincoMixModel_test(), Raster2Vector_test(), Register_test1(), RGB2IHS_IHS2RGB_image_test(), RGB2IHS_IHS2RGB_numeric_test(), Roberts_test(), TePDIWiSpeRFusion::RunImplementation(), TePDIWaveletAtrousFusion::RunImplementation(), TePDIVenturaFusion::RunImplementation(), TePDISensorSimulator::RunImplementation(), TePDIRegGrowSeg::RunImplementation(), TePDIPrincipalComponentsFusion::RunImplementation(), TePDIPCAWaveletFusion::RunImplementation(), TePDIIHSWaveletFusion::RunImplementation(), TePDIIHSFusion::RunImplementation(), TePDIGeneralizedIHSFusion::RunImplementation(), TePDIGarguetFusion::RunImplementation(), TePDIDecorrelationEnhancement::RunImplementation(), TePDIBaatz::RunImplementation(), TePDIPrincipalComponents::RunImplementation_direct(), S_test(), sameImageAndBoxesTest(), sameImageAndBoxesWithMaskTest(), sameImageDifBoxesTest(), sameImageGreenXBlueTest(), sameImageGreenXRedTest(), sameImageTest(), sameImageTest2(), sameImageTestWithMultiThread(), sameInvertedImageTest(), Sobel_test(), TePDIFusionIndexes::standard_deviation_diff_index(), TePDIFusionIndexes::structural_similarity_index(), TePDIBaatz_test(), TePDIContrastHistEqualizer_test(), TePDIContrastLinear_plus_histo_test(), TePDIContrastLog_test(), TePDIContrastLog_with_use_dummy_test(), TePDIContrastMinMax_autolevels_test(), TePDIContrastMinMax_no_input_image_test(), TePDIContrastNegative_test(), TePDIContrastSimpleSlicer_test(), TePDIContrastSquare_test(), TePDIContrastSquareRoot_test(), TePDIContrastStat_test(), TePDIDecorrelationEnhancement_test(), TePDIFFT_test(), TePDIHants_test(), TePDIPrincipalComponentsFusion_test(), TePDIRegGrowSeg_test(), TePDISAMClassifier_test(), TePDISensorSimulator_test(), TePDIFusionIndexes::uiqi_index(), TePDIFusionIndexes::variance_difference_index(), and VenturaFusion_test().

00017 {
00018   if( CheckParameters( params ) ) {
00019     ResetState( params );
00020 
00021     /* This line must come after the ResetState line, because some algorithms
00022        checks the difference between the current internal parameters and the
00023        new supplied parameters */
00024     params_.Clear();
00025     params_ = params;
00026 
00027     return true;
00028   } else {
00029     TEAGN_LOG_AND_RETURN( "Invalid supplied parameters" );
00030   }
00031 }

void TePDILevelRemap::ResetState ( const TePDIParameters params  )  [protected, virtual]

Reset the internal state to the initial state.

Parameters:
params The new parameters referente at initial state.

Implements TePDIAlgorithm.

Definition at line 25 of file TePDILevelRemap.cpp.

References histo_cache_.

00026 {
00027   TePDIParameters dummy_params = params;
00028 
00029   histo_cache_.clear();
00030 }

virtual bool TePDIAlgorithm::RunImplementation (  )  [protected, pure virtual, inherited]

Runs the current algorithm implementation.

Returns:
true if OK. false on error.

Implemented in TePDIArithmetic, TePDIBaatz, TePDIBatchGeoMosaic, TePDIBDFilter, TePDIColorTransform, TePDIContrast, TePDICorrelationMatching, TePDIDecorrelationEnhancement, TePDIEMClas, TePDIFFT, TePDIFusionIndexes, TePDIGarguetFusion, TePDIGeneralizedIHSFusion, TePDIGeoMosaic, TePDIHants, TePDIHaralick, TePDIIHSFusion, TePDIIHSWaveletFusion, TePDIIsosegClas, TePDIKMeansClas, TePDILinearFilter, TePDIMallatWavelets, TePDIMIMatching, TePDIMixModel, TePDIMMIOMatching, TePDIMorfFilter, TePDIOFMatching, TePDIParallelSegmenter, TePDIPCAWaveletFusion, TePDIPrincipalComponents, TePDIPrincipalComponentsFusion, TePDIRadarFrostFilter, TePDIRadarGammaFilter, TePDIRadarKuanFilter, TePDIRadarLeeFilter, TePDIRaster2Vector, TePDIRegGrowSeg, TePDIRegister, TePDISAMClassifier, TePDISensorSimulator, TePDISimplex, TePDIStatistic, TePDITPMosaic, TePDIVenturaFusion, TePDIWaveletAtrous, TePDIWaveletAtrousFusion, and TePDIWiSpeRFusion.

Referenced by TePDIAlgorithm::Apply().

void TePDIAlgorithm::StartProgInt ( const std::string message,
unsigned int  steps 
) [protected, inherited]

Start the progress interface.

Parameters:
message Progress window message.
steps Progress window total steps.
Deprecated:
DEPRECATED - This method will be removed in the future (each algorithm must check the variable TePDIAlgorithm::progress_enabled_ and instantiate its own TePDIPIManager when necessary).

Definition at line 139 of file TePDIAlgorithm.cpp.

References TePDIAlgorithm::pi_manager_, TePDIAlgorithm::progress_enabled_, TePDIPIManager::Reset(), and TePDIPIManager::Toggle().

Referenced by TePDIContrast::FullRangeLutRemapLevels(), TePDIContrast::GetHistEqualizerLut(), TePDIContrast::GetLinearLut(), TePDIContrast::GetLogLut(), TePDIContrast::GetNegativeLut(), TePDIContrast::GetSimpleSlicerLut(), TePDIContrast::GetSquareLut(), TePDIContrast::GetSquareRootLut(), RemapLevels(), TePDIContrast::RemapLevels(), TePDIRadarLeeFilter::RunAdaptImplementation(), TePDIRadarKuanFilter::RunAdaptImplementation(), TePDIMorfFilter::RunDilation(), TePDIMorfFilter::RunErosion(), TePDIRadarLeeFilter::RunFixedImplementation(), TePDIRadarKuanFilter::RunFixedImplementation(), TePDIRadarGammaFilter::RunFixedImplementation(), TePDIColorTransform::RunIhs2Rgb(), TePDIRegister::RunImplementation(), TePDIRaster2Vector::RunImplementation(), TePDIRadarFrostFilter::RunImplementation(), TePDIMorfFilter::RunMedian(), TePDIMorfFilter::RunMode(), TePDIBDFilter::RunRoberts(), and TePDIBDFilter::RunSobel().

00141 {
00142   if( progress_enabled_ ) {
00143     pi_manager_.Reset( message, steps );
00144     pi_manager_.Toggle( true );
00145   }
00146 }

void TePDIAlgorithm::StopProgInt (  )  [protected, inherited]

Stop the progress interface.

Deprecated:
DEPRECATED - This method will be removed in the future (each algorithm must check the variable TePDIAlgorithm::progress_enabled_ and instantiate its own TePDIPIManager when necessary).

Definition at line 161 of file TePDIAlgorithm.cpp.

References TePDIAlgorithm::pi_manager_, and TePDIPIManager::Toggle().

Referenced by TePDIAlgorithm::Apply(), TePDIContrast::FullRangeLutRemapLevels(), TePDIContrast::GetHistEqualizerLut(), RemapLevels(), TePDIContrast::RemapLevels(), and TePDIRegister::RunImplementation().

00162 {
00163   pi_manager_.Toggle( false );
00164 }

void TePDIAlgorithm::ToggleProgInt ( bool  enabled  )  [inherited]

Enable / Disable the progress interface.

Parameters:
enabled Flag to enable ( true ) or disable ( false ).
Examples:
TePDICorrelationMatching_test.cpp, TePDIMIMatching_test.cpp, and TePDIOFMatching_test.cpp.

Definition at line 129 of file TePDIAlgorithm.cpp.

References TePDIAlgorithm::pi_manager_, TePDIAlgorithm::progress_enabled_, and TePDIPIManager::Toggle().

Referenced by TePDIFusionIndexes::bias_index(), TePDIFusionIndexes::correlation_coefficient_index(), TePDIFusionIndexes::ergas_index(), TePDIFusionIndexes::fit_histogram(), halfsampledImageTest(), halfsampledImageTest2(), halfsampledRotadedImageTest(), halfsampledRotadedImageWithDownsampleTest(), TePDIWiSpeRFusion::RunImplementation(), TePDIWaveletAtrousFusion::RunImplementation(), TePDIVenturaFusion::RunImplementation(), TePDIPrincipalComponentsFusion::RunImplementation(), TePDIPCAWaveletFusion::RunImplementation(), TePDIIHSWaveletFusion::RunImplementation(), TePDIIHSFusion::RunImplementation(), TePDIGarguetFusion::RunImplementation(), TePDIDecorrelationEnhancement::RunImplementation(), TePDIPrincipalComponents::RunImplementation_direct(), sameImageAndBoxesTest(), sameImageDifBoxesTest(), sameImageGreenXBlueTest(), sameImageGreenXRedTest(), sameImageTest(), sameImageTest2(), sameImageTestWithMultiThread(), sameInvertedImageTest(), TePDIFusionIndexes::standard_deviation_diff_index(), TePDIFusionIndexes::structural_similarity_index(), TePDIParaSegBaatzStrategy::TePDIParaSegBaatzStrategy(), TePDIParaSegRegGrowStrategy::TePDIParaSegRegGrowStrategy(), TePDIFusionIndexes::uiqi_index(), and TePDIFusionIndexes::variance_difference_index().

00130 {
00131   progress_enabled_ = enabled;
00132   
00133   if( ! enabled ) {
00134     pi_manager_.Toggle( false );
00135   }
00136 }

bool TePDIAlgorithm::UpdateProgInt ( unsigned int  step  )  [protected, inherited]

Update the current progress interface to the current step.

Parameters:
step Current step.
Returns:
true if the interface was canceled, false otherwise.
Deprecated:
DEPRECATED - This method will be removed in the future (each algorithm must check the variable TePDIAlgorithm::progress_enabled_ and instantiate its own TePDIPIManager when necessary).

Definition at line 149 of file TePDIAlgorithm.cpp.

References TePDIAlgorithm::pi_manager_, and TePDIPIManager::Update().

Referenced by TePDIContrast::FullRangeLutRemapLevels(), TePDIContrast::GetLinearLut(), TePDIContrast::GetLogLut(), TePDIContrast::GetNegativeLut(), TePDIContrast::GetSimpleSlicerLut(), TePDIContrast::GetSquareLut(), TePDIContrast::GetSquareRootLut(), RemapLevels(), TePDIContrast::RemapLevels(), TePDIRadarLeeFilter::RunAdaptImplementation(), TePDIRadarKuanFilter::RunAdaptImplementation(), TePDIMorfFilter::RunDilation(), TePDIMorfFilter::RunErosion(), TePDIRadarLeeFilter::RunFixedImplementation(), TePDIRadarKuanFilter::RunFixedImplementation(), TePDIRadarGammaFilter::RunFixedImplementation(), TePDIColorTransform::RunIhs2Rgb(), TePDIRaster2Vector::RunImplementation(), TePDIRadarFrostFilter::RunImplementation(), TePDIMorfFilter::RunMedian(), TePDIMorfFilter::RunMode(), TePDIBDFilter::RunRoberts(), and TePDIBDFilter::RunSobel().

00150 {
00151   return pi_manager_.Update( step );
00152 }


Field Documentation

std::map< std::pair< TeRaster*, unsigned int >, TePDIHistogram::pointer > TePDILevelRemap::histo_cache_ [protected]

A cache of level ordered histograms to avoid rebuilding histograms all the times.

Parameters:
TeRaster A raster naked pointer reference.
unsigned int Raster band.
TePDIHistogram::pointer A Histogram shared pointer reference.

Definition at line 83 of file TePDILevelRemap.hpp.

Referenced by BuildHistograms(), GetHistRef(), and ResetState().

TePDIParameters TePDIAlgorithm::params_ [mutable, protected, inherited]

Internal parameters reference

Definition at line 119 of file TePDIAlgorithm.hpp.

Referenced by TePDIAlgorithm::Apply(), TePDIAlgorithm::CheckInternalParameters(), TePDIHants::CheckParameters(), TePDIContrast::getBaseLut(), TePDIContrast::getHistogram(), TePDIAlgorithm::GetParameters(), TePDIContrast::GetStatLut(), TePDIAlgorithm::Reset(), TePDIStatistic::ResetState(), TePDIRegGrowSeg::ResetState(), TePDIContrast::ResetState(), TePDIRadarLeeFilter::RunAdaptImplementation(), TePDIRadarKuanFilter::RunAdaptImplementation(), TePDIMorfFilter::RunDilation(), TePDIMorfFilter::RunErosion(), TePDIRadarLeeFilter::RunFixedImplementation(), TePDIRadarKuanFilter::RunFixedImplementation(), TePDIRadarGammaFilter::RunFixedImplementation(), TePDIWiSpeRFusion::RunImplementation(), TePDIWaveletAtrousFusion::RunImplementation(), TePDIWaveletAtrous::RunImplementation(), TePDIVenturaFusion::RunImplementation(), TePDITPMosaic::RunImplementation(), TePDISimplex::RunImplementation(), TePDISensorSimulator::RunImplementation(), TePDISAMClassifier::RunImplementation(), TePDIRegister::RunImplementation(), TePDIRegGrowSeg::RunImplementation(), TePDIRaster2Vector::RunImplementation(), TePDIRadarLeeFilter::RunImplementation(), TePDIRadarKuanFilter::RunImplementation(), TePDIRadarGammaFilter::RunImplementation(), TePDIRadarFrostFilter::RunImplementation(), TePDIPrincipalComponentsFusion::RunImplementation(), TePDIPrincipalComponents::RunImplementation(), TePDIPCAWaveletFusion::RunImplementation(), TePDIParallelSegmenter::RunImplementation(), TePDIOFMatching::RunImplementation(), TePDIMorfFilter::RunImplementation(), TePDIMMIOMatching::RunImplementation(), TePDIMixModel::RunImplementation(), TePDIMIMatching::RunImplementation(), TePDIMallatWavelets::RunImplementation(), TePDILinearFilter::RunImplementation(), TePDIKMeansClas::RunImplementation(), TePDIIsosegClas::RunImplementation(), TePDIIHSWaveletFusion::RunImplementation(), TePDIIHSFusion::RunImplementation(), TePDIHants::RunImplementation(), TePDIGeoMosaic::RunImplementation(), TePDIGeneralizedIHSFusion::RunImplementation(), TePDIGarguetFusion::RunImplementation(), TePDIFusionIndexes::RunImplementation(), TePDIFFT::RunImplementation(), TePDIEMClas::RunImplementation(), TePDIDecorrelationEnhancement::RunImplementation(), TePDICorrelationMatching::RunImplementation(), TePDIContrast::RunImplementation(), TePDIColorTransform::RunImplementation(), TePDIBDFilter::RunImplementation(), TePDIBatchGeoMosaic::RunImplementation(), TePDIBaatz::RunImplementation(), TePDIArithmetic::RunImplementation(), TePDIWaveletAtrous::RunImplementation_decompose(), TePDIPrincipalComponents::RunImplementation_direct(), TePDIPrincipalComponents::RunImplementation_inverse(), TePDIWaveletAtrous::RunImplementation_recompose(), TePDIMorfFilter::RunMedian(), TePDIMorfFilter::RunMode(), TePDIBDFilter::RunRoberts(), and TePDIBDFilter::RunSobel().

TePDIPIManager TePDIAlgorithm::pi_manager_ [protected, inherited]

The internal progress interface.

Deprecated:
DEPRECATED - This object will be removed in the future (each algorithm must check the variable TePDIAlgorithm::progress_enabled_ and instantiate its own TePDIPIManager when necessary).

Definition at line 134 of file TePDIAlgorithm.hpp.

Referenced by TePDIAlgorithm::IncProgInt(), TePDIAlgorithm::StartProgInt(), TePDIAlgorithm::StopProgInt(), TePDIAlgorithm::ToggleProgInt(), and TePDIAlgorithm::UpdateProgInt().

bool TePDIAlgorithm::progress_enabled_ [protected, inherited]

A flag to indicate when the algorithm should initiate a progress interface.

Definition at line 125 of file TePDIAlgorithm.hpp.

Referenced by TePDIFusionIndexes::bias_index(), TePDITPMosaic::calcStats(), TePDIGeoMosaic::calcStats(), TePDIKMeansClas::classifyPixels(), TePDIFusionIndexes::correlation_coefficient_index(), TePDIFusionIndexes::ergas_index(), TePDIFusionIndexes::fit_histogram(), TePDIKMeansClas::GenerateClassificationParameters(), TePDIMallatWavelets::GenerateLevel(), TePDIStatistic::getHistogram(), TePDIStatistic::getJointHistogram(), TePDIKMeansClas::kmeans(), TePDIMMIOMatching::matchFeatures(), TePDIFusionIndexes::raster_mean(), TePDIFusionIndexes::rasters_difference(), TePDIMallatWavelets::Recompose(), TePDIWiSpeRFusion::RunImplementation(), TePDIWaveletAtrousFusion::RunImplementation(), TePDIVenturaFusion::RunImplementation(), TePDITPMosaic::RunImplementation(), TePDISensorSimulator::RunImplementation(), TePDISAMClassifier::RunImplementation(), TePDIRegGrowSeg::RunImplementation(), TePDIPrincipalComponentsFusion::RunImplementation(), TePDIPCAWaveletFusion::RunImplementation(), TePDIParallelSegmenter::RunImplementation(), TePDIOFMatching::RunImplementation(), TePDIMMIOMatching::RunImplementation(), TePDIMIMatching::RunImplementation(), TePDILinearFilter::RunImplementation(), TePDIIHSWaveletFusion::RunImplementation(), TePDIIHSFusion::RunImplementation(), TePDIGeoMosaic::RunImplementation(), TePDIGeneralizedIHSFusion::RunImplementation(), TePDIGarguetFusion::RunImplementation(), TePDIEMClas::RunImplementation(), TePDIDecorrelationEnhancement::RunImplementation(), TePDICorrelationMatching::RunImplementation(), TePDIBaatz::RunImplementation(), TePDIArithmetic::RunImplementation(), TePDIWaveletAtrous::RunImplementation_decompose(), TePDIPrincipalComponents::RunImplementation_direct(), TePDIPrincipalComponents::RunImplementation_inverse(), TePDIWaveletAtrous::RunImplementation_recompose(), TePDIColorTransform::RunRgb2Ihs(), TePDIFusionIndexes::sergas_index(), TePDIFusionIndexes::spatial_correlation_coefficient_index(), TePDIFusionIndexes::standard_deviation_diff_index(), TePDIAlgorithm::StartProgInt(), TePDIFusionIndexes::structural_similarity_index(), TePDIAlgorithm::TePDIAlgorithm(), TePDIAlgorithm::ToggleProgInt(), TePDIFusionIndexes::uiqi_index(), and TePDIFusionIndexes::variance_difference_index().


The documentation for this class was generated from the following files:
Generated on Sun Jul 29 04:07:55 2012 for TerraLib - Development Source by  doxygen 1.5.3