te::rp::ComposerRuleValidNeighborhood Class Reference

A basic composer rule capable of choosing the valid pixels (all bands with no no-data values). More...

#include <ComposerRuleValidNeighborhood.h>

Inheritance diagram for te::rp::ComposerRuleValidNeighborhood:
te::rp::ComposerRule

Public Member Functions

 ComposerRuleValidNeighborhood ()
 
const std::string & getErrorMessage () const
 Return the current error message if there is any. More...
 
double getNeiborMinValidPercent () const
 Get the mimimum percentual of valid pixels considering the entire neighborhood for a center pixel to be considered valid. More...
 
void getValidValuesRanges (std::vector< std::pair< double, double > > &ranges1, std::vector< std::pair< double, double > > &ranges2) const
 Get the valid values ranges. More...
 
unsigned int getWindowRadius () const
 Get the valid values neighbors window radius. More...
 
void setNeiborMinValidPercent (const double newPercent)
 Set the mimimum percentual of valid pixels considering the entire neighborhood for a center pixel to be considered valid. More...
 
void setValidValuesRanges (const std::vector< std::pair< double, double > > &ranges1, const std::vector< std::pair< double, double > > &ranges2)
 Set the valid values ranges. More...
 
void setWindowRadius (const unsigned int newRadius)
 Set the valid values neighbors window radius. More...
 
 ~ComposerRuleValidNeighborhood ()
 

Protected Member Functions

ComposerRuleclone () const
 Create a clone of this instance. More...
 
void getComposedValues (const double &line, const double &col, double *const composedValuesPtr) const
 Compose a pixel value using the current parameters. More...
 
bool initialize (const te::rst::Raster &raster1, const std::vector< unsigned int > &raster1Bands, const te::rst::Raster &raster2, const std::vector< unsigned int > &raster2Bands, te::rst::Raster &raster3, const std::vector< unsigned int > &raster3Bands, const te::rst::Interpolator::Method &interpMethod1, const te::rst::Interpolator::Method &interpMethod2, const double &noDataValue, const bool forceRaster1NoDataValue, const bool forceRaster2NoDataValue, const std::vector< double > &pixelOffsets1, const std::vector< double > &pixelScales1, const std::vector< double > &pixelOffsets2, const std::vector< double > &pixelScales2)
 Inititate the instance. More...
 
void setErrorMessage (const std::string &newErrorMessage)
 Set the current error message. More...
 

Protected Attributes

std::string m_errorMessage
 Current error message. More...
 
bool m_forceRaster1NoDataValue
 Use noDataValue as the input raster 1 no-data value (The original rasters no-data values will be ignored) More...
 
bool m_forceRaster2NoDataValue
 Use noDataValue as the input raster 2 no-data value (The original rasters no-data values will be ignored)
More...
 
te::rst::Interpolator::Method m_interpMethod1
 The interpolation method to use when reading raster 1 data. More...
 
te::rst::Interpolator::Method m_interpMethod2
 The interpolation method to use when reading raster 2 data. More...
 
double m_outputNoDataValue
 The output raster no-data value. More...
 
std::vector< double > m_pixelOffsets1
 The values offset to be applied to raster 1 pixel values before the composed value calcule (one element for each used raster channel/band). More...
 
std::vector< double > m_pixelOffsets2
 The values offset to be applied to raster 2 pixel values before the composed value calcule (one element for each used raster channel/band). More...
 
std::vector< double > m_pixelScales1
 The values scale to be applied to raster 1 pixel values before the composed value calcule (one element for each used raster channel/band). More...
 
std::vector< double > m_pixelScales2
 The values scale to be applied to raster 2 pixel values before the composed value calcule (one element for each used raster channel/band). More...
 
std::vector< unsigned int > m_raster1Bands
 Input raster 1 band indexes to use. More...
 
te::rst::Raster const * m_raster1Ptr
 Input raster 1. More...
 
std::vector< unsigned int > m_raster2Bands
 Input raster 2 band indexes to use. More...
 
te::rst::Raster const * m_raster2Ptr
 Input raster 2. More...
 
std::vector< unsigned int > m_raster3Bands
 Input raster 3 band indexes to use. More...
 
te::rst::Rasterm_raster3Ptr
 Input raster 3. More...
 

Private Member Functions

void clear ()
 
 ComposerRuleValidNeighborhood (const ComposerRuleValidNeighborhood &other)
 
void initState ()
 
const ComposerRuleValidNeighborhoodoperator= (const ComposerRuleValidNeighborhood &other)
 

Private Attributes

te::srs::Converter m_converter1
 
te::srs::Converter m_converter2
 
unsigned int m_getComposedValues_bandIdx
 
double m_getComposedValues_centerCol
 
long int m_getComposedValues_centerCol1
 
long int m_getComposedValues_centerCol2
 
double m_getComposedValues_centerRow
 
long int m_getComposedValues_centerRow1
 
long int m_getComposedValues_centerRow2
 
double m_getComposedValues_centerX
 
double m_getComposedValues_centerX3
 
double m_getComposedValues_centerY
 
double m_getComposedValues_centerY3
 
long int m_getComposedValues_col
 
long int m_getComposedValues_colBound
 
bool m_getComposedValues_pixelIsValid
 
double m_getComposedValues_pixelValue
 
unsigned int m_getComposedValues_r1PixelQuality
 
unsigned int m_getComposedValues_r2PixelQuality
 
long int m_getComposedValues_row
 
long int m_getComposedValues_rowBound
 
long int m_getComposedValues_startCol
 
long int m_getComposedValues_startRow
 
unsigned int m_NBands
 
double m_neiborMinValidPercent
 
long int m_r1NCols
 
long int m_r1NRows
 
long int m_r2NCols
 
long int m_r2NRows
 
std::vector< std::pair< double, double > > m_ranges1
 Valid values ranges for each raster 1 band (first=min, second=max). More...
 
std::vector< std::pair< double, double > > m_ranges2
 Valid values ranges for each raster 1 band (first=min, second=max). More...
 
std::vector< double > m_raster1NoDataValues
 Raster 1 no-data values (on value per band). More...
 
std::vector< double > m_raster2NoDataValues
 Raster 2 no-data values (on value per band).
More...
 
long int m_windowMaxNPixels
 Maximum number of pixels in a window (center included) More...
 
long int m_windowRadius
 Valid pixels windows radius. More...
 

Detailed Description

A basic composer rule capable of choosing the valid pixels (all bands with no no-data values).

composer rule capable of choosing the valid pixels (all bands with no no-data values).

Definition at line 37 of file ComposerRuleValidNeighborhood.h.

Constructor & Destructor Documentation

◆ ComposerRuleValidNeighborhood() [1/2]

te::rp::ComposerRuleValidNeighborhood::ComposerRuleValidNeighborhood ( )

◆ ~ComposerRuleValidNeighborhood()

te::rp::ComposerRuleValidNeighborhood::~ComposerRuleValidNeighborhood ( )

◆ ComposerRuleValidNeighborhood() [2/2]

te::rp::ComposerRuleValidNeighborhood::ComposerRuleValidNeighborhood ( const ComposerRuleValidNeighborhood other)
private

Member Function Documentation

◆ clear()

void te::rp::ComposerRuleValidNeighborhood::clear ( )
private

◆ clone()

ComposerRule* te::rp::ComposerRuleValidNeighborhood::clone ( ) const
protectedvirtual

Create a clone of this instance.

Returns
A clone of this instance.
Note
The caller of this method must take othe owndershipd of the returned pointer.

Implements te::rp::ComposerRule.

◆ getComposedValues()

void te::rp::ComposerRuleValidNeighborhood::getComposedValues ( const double &  line,
const double &  col,
double *const  composedValuesPtr 
) const
protectedvirtual

Compose a pixel value using the current parameters.

Parameters
lineLine (raster 3 reference).
colColumn (raster 3 reference).
composedValuesPtrA pointer to a pre-allocated vector where the composed values will be stored.
Note
The caller of this method must be aware that the returned composed value may be outside the original input rasters valid values range.
Raster 1 values have precedence over raster 2 values (when applicable).

Implements te::rp::ComposerRule.

◆ getErrorMessage()

const std::string& te::rp::ComposerRule::getErrorMessage ( ) const
inherited

Return the current error message if there is any.

Returns
Return the current error message if there is any.

◆ getNeiborMinValidPercent()

double te::rp::ComposerRuleValidNeighborhood::getNeiborMinValidPercent ( ) const

Get the mimimum percentual of valid pixels considering the entire neighborhood for a center pixel to be considered valid.

Returns
Get the mimimum percentual of valid pixels considering the entire neighborhood for a center pixel to be considered valid.

◆ getValidValuesRanges()

void te::rp::ComposerRuleValidNeighborhood::getValidValuesRanges ( std::vector< std::pair< double, double > > &  ranges1,
std::vector< std::pair< double, double > > &  ranges2 
) const

Get the valid values ranges.

Parameters
ranges1Raster 1 values ranges.
ranges2Raster 2 values ranges.

◆ getWindowRadius()

unsigned int te::rp::ComposerRuleValidNeighborhood::getWindowRadius ( ) const

Get the valid values neighbors window radius.

Returns
Get the valid values neighbors window radius.

◆ initialize()

bool te::rp::ComposerRuleValidNeighborhood::initialize ( const te::rst::Raster raster1,
const std::vector< unsigned int > &  raster1Bands,
const te::rst::Raster raster2,
const std::vector< unsigned int > &  raster2Bands,
te::rst::Raster raster3,
const std::vector< unsigned int > &  raster3Bands,
const te::rst::Interpolator::Method interpMethod1,
const te::rst::Interpolator::Method interpMethod2,
const double &  noDataValue,
const bool  forceRaster1NoDataValue,
const bool  forceRaster2NoDataValue,
const std::vector< double > &  pixelOffsets1,
const std::vector< double > &  pixelScales1,
const std::vector< double > &  pixelOffsets2,
const std::vector< double > &  pixelScales2 
)
protectedvirtual

Inititate the instance.

Parameters
raster1Raster 1.
raster1BandsRaster 1 band indexes to use.
raster2Raster 2.
raster2BandsRaster 2 band indexes to use (this vector has the same size as raster1Bands).
raster3Raster 3.
raster3BandsRaster 3 band indexes to use (this vector has the same size as raster1Bands).
interpMethod1The interpolation method to use when reading raster 1 data.
interpMethod2The interpolation method to use when reading raster 2 data.
noDataValueThe value returned where there is no pixel data.
forceRaster1NoDataValueUse noDataValue as the input raster 1 no-data value (The original rasters no-data values will be ignored)
forceRaster2NoDataValueUse noDataValue as the input raster 1 no-data value (The original rasters no-data values will be ignored)
pixelOffsets1The values offset to be applied to raster 1 pixel values before the composed value calcule (one element for each used raster channel/band).
pixelScales1The values scale to be applied to raster 1 pixel values before the composed value calcule (one element for each used raster channel/band).
pixelOffsets2The values offset to be applied to raster 2 pixel values before the composed value calcule (one element for each used raster channel/band).
pixelScales2The values scale to be applied to raster 2 pixel values before the composed value calcule (one element for each used raster channel/band).
Returns
true if ok, false on errors
Note
Aboute scale and offset parametrs: outValue = ( inputValue * scale ) + offset

Reimplemented from te::rp::ComposerRule.

◆ initState()

void te::rp::ComposerRuleValidNeighborhood::initState ( )
private

◆ operator=()

const ComposerRuleValidNeighborhood& te::rp::ComposerRuleValidNeighborhood::operator= ( const ComposerRuleValidNeighborhood other)
private

◆ setErrorMessage()

void te::rp::ComposerRule::setErrorMessage ( const std::string &  newErrorMessage)
protectedinherited

Set the current error message.

Parameters
newErrorMessageNew error message;

◆ setNeiborMinValidPercent()

void te::rp::ComposerRuleValidNeighborhood::setNeiborMinValidPercent ( const double  newPercent)

Set the mimimum percentual of valid pixels considering the entire neighborhood for a center pixel to be considered valid.

Parameters
newPercentNew value (Range 0 -> 100).

◆ setValidValuesRanges()

void te::rp::ComposerRuleValidNeighborhood::setValidValuesRanges ( const std::vector< std::pair< double, double > > &  ranges1,
const std::vector< std::pair< double, double > > &  ranges2 
)

Set the valid values ranges.

Parameters
ranges1Raster 1 values ranges.
ranges2Raster 2 values ranges.
Note
Valid values ranges for each band (first=min, second=max).
Ranges min and max are considered valid values.

◆ setWindowRadius()

void te::rp::ComposerRuleValidNeighborhood::setWindowRadius ( const unsigned int  newRadius)

Set the valid values neighbors window radius.

Parameters
newRadiusNew radius.
Note
All pixels within the radius must be valid for the center pixel be considered valid.

Member Data Documentation

◆ m_converter1

te::srs::Converter te::rp::ComposerRuleValidNeighborhood::m_converter1
private

Definition at line 119 of file ComposerRuleValidNeighborhood.h.

◆ m_converter2

te::srs::Converter te::rp::ComposerRuleValidNeighborhood::m_converter2
private

Definition at line 121 of file ComposerRuleValidNeighborhood.h.

◆ m_errorMessage

std::string te::rp::ComposerRule::m_errorMessage
protectedinherited

Current error message.

Definition at line 75 of file ComposerRule.h.

◆ m_forceRaster1NoDataValue

bool te::rp::ComposerRule::m_forceRaster1NoDataValue
protectedinherited

Use noDataValue as the input raster 1 no-data value (The original rasters no-data values will be ignored)

Definition at line 60 of file ComposerRule.h.

◆ m_forceRaster2NoDataValue

bool te::rp::ComposerRule::m_forceRaster2NoDataValue
protectedinherited

Use noDataValue as the input raster 2 no-data value (The original rasters no-data values will be ignored)

Definition at line 61 of file ComposerRule.h.

◆ m_getComposedValues_bandIdx

unsigned int te::rp::ComposerRuleValidNeighborhood::m_getComposedValues_bandIdx
mutableprivate

Definition at line 170 of file ComposerRuleValidNeighborhood.h.

◆ m_getComposedValues_centerCol

double te::rp::ComposerRuleValidNeighborhood::m_getComposedValues_centerCol
mutableprivate

Definition at line 164 of file ComposerRuleValidNeighborhood.h.

◆ m_getComposedValues_centerCol1

long int te::rp::ComposerRuleValidNeighborhood::m_getComposedValues_centerCol1
mutableprivate

Definition at line 172 of file ComposerRuleValidNeighborhood.h.

◆ m_getComposedValues_centerCol2

long int te::rp::ComposerRuleValidNeighborhood::m_getComposedValues_centerCol2
mutableprivate

Definition at line 174 of file ComposerRuleValidNeighborhood.h.

◆ m_getComposedValues_centerRow

double te::rp::ComposerRuleValidNeighborhood::m_getComposedValues_centerRow
mutableprivate

Definition at line 165 of file ComposerRuleValidNeighborhood.h.

◆ m_getComposedValues_centerRow1

long int te::rp::ComposerRuleValidNeighborhood::m_getComposedValues_centerRow1
mutableprivate

Definition at line 171 of file ComposerRuleValidNeighborhood.h.

◆ m_getComposedValues_centerRow2

long int te::rp::ComposerRuleValidNeighborhood::m_getComposedValues_centerRow2
mutableprivate

Definition at line 173 of file ComposerRuleValidNeighborhood.h.

◆ m_getComposedValues_centerX

double te::rp::ComposerRuleValidNeighborhood::m_getComposedValues_centerX
mutableprivate

Definition at line 162 of file ComposerRuleValidNeighborhood.h.

◆ m_getComposedValues_centerX3

double te::rp::ComposerRuleValidNeighborhood::m_getComposedValues_centerX3
mutableprivate

Definition at line 160 of file ComposerRuleValidNeighborhood.h.

◆ m_getComposedValues_centerY

double te::rp::ComposerRuleValidNeighborhood::m_getComposedValues_centerY
mutableprivate

Definition at line 163 of file ComposerRuleValidNeighborhood.h.

◆ m_getComposedValues_centerY3

double te::rp::ComposerRuleValidNeighborhood::m_getComposedValues_centerY3
mutableprivate

Definition at line 161 of file ComposerRuleValidNeighborhood.h.

◆ m_getComposedValues_col

long int te::rp::ComposerRuleValidNeighborhood::m_getComposedValues_col
mutableprivate

Definition at line 169 of file ComposerRuleValidNeighborhood.h.

◆ m_getComposedValues_colBound

long int te::rp::ComposerRuleValidNeighborhood::m_getComposedValues_colBound
mutableprivate

Definition at line 178 of file ComposerRuleValidNeighborhood.h.

◆ m_getComposedValues_pixelIsValid

bool te::rp::ComposerRuleValidNeighborhood::m_getComposedValues_pixelIsValid
mutableprivate

Definition at line 179 of file ComposerRuleValidNeighborhood.h.

◆ m_getComposedValues_pixelValue

double te::rp::ComposerRuleValidNeighborhood::m_getComposedValues_pixelValue
mutableprivate

Definition at line 180 of file ComposerRuleValidNeighborhood.h.

◆ m_getComposedValues_r1PixelQuality

unsigned int te::rp::ComposerRuleValidNeighborhood::m_getComposedValues_r1PixelQuality
mutableprivate

Definition at line 166 of file ComposerRuleValidNeighborhood.h.

◆ m_getComposedValues_r2PixelQuality

unsigned int te::rp::ComposerRuleValidNeighborhood::m_getComposedValues_r2PixelQuality
mutableprivate

Definition at line 167 of file ComposerRuleValidNeighborhood.h.

◆ m_getComposedValues_row

long int te::rp::ComposerRuleValidNeighborhood::m_getComposedValues_row
mutableprivate

Definition at line 168 of file ComposerRuleValidNeighborhood.h.

◆ m_getComposedValues_rowBound

long int te::rp::ComposerRuleValidNeighborhood::m_getComposedValues_rowBound
mutableprivate

Definition at line 177 of file ComposerRuleValidNeighborhood.h.

◆ m_getComposedValues_startCol

long int te::rp::ComposerRuleValidNeighborhood::m_getComposedValues_startCol
mutableprivate

Definition at line 176 of file ComposerRuleValidNeighborhood.h.

◆ m_getComposedValues_startRow

long int te::rp::ComposerRuleValidNeighborhood::m_getComposedValues_startRow
mutableprivate

Definition at line 175 of file ComposerRuleValidNeighborhood.h.

◆ m_interpMethod1

te::rst::Interpolator::Method te::rp::ComposerRule::m_interpMethod1
protectedinherited

The interpolation method to use when reading raster 1 data.

Definition at line 65 of file ComposerRule.h.

◆ m_interpMethod2

te::rst::Interpolator::Method te::rp::ComposerRule::m_interpMethod2
protectedinherited

The interpolation method to use when reading raster 2 data.

Definition at line 66 of file ComposerRule.h.

◆ m_NBands

unsigned int te::rp::ComposerRuleValidNeighborhood::m_NBands
private

Definition at line 149 of file ComposerRuleValidNeighborhood.h.

◆ m_neiborMinValidPercent

double te::rp::ComposerRuleValidNeighborhood::m_neiborMinValidPercent
private

Definition at line 137 of file ComposerRuleValidNeighborhood.h.

◆ m_outputNoDataValue

double te::rp::ComposerRule::m_outputNoDataValue
protectedinherited

The output raster no-data value.

Definition at line 67 of file ComposerRule.h.

◆ m_pixelOffsets1

std::vector< double > te::rp::ComposerRule::m_pixelOffsets1
protectedinherited

The values offset to be applied to raster 1 pixel values before the composed value calcule (one element for each used raster channel/band).

Definition at line 71 of file ComposerRule.h.

◆ m_pixelOffsets2

std::vector< double > te::rp::ComposerRule::m_pixelOffsets2
protectedinherited

The values offset to be applied to raster 2 pixel values before the composed value calcule (one element for each used raster channel/band).

Definition at line 73 of file ComposerRule.h.

◆ m_pixelScales1

std::vector< double > te::rp::ComposerRule::m_pixelScales1
protectedinherited

The values scale to be applied to raster 1 pixel values before the composed value calcule (one element for each used raster channel/band).

Definition at line 72 of file ComposerRule.h.

◆ m_pixelScales2

std::vector< double > te::rp::ComposerRule::m_pixelScales2
protectedinherited

The values scale to be applied to raster 2 pixel values before the composed value calcule (one element for each used raster channel/band).

Definition at line 74 of file ComposerRule.h.

◆ m_r1NCols

long int te::rp::ComposerRuleValidNeighborhood::m_r1NCols
private

Definition at line 153 of file ComposerRuleValidNeighborhood.h.

◆ m_r1NRows

long int te::rp::ComposerRuleValidNeighborhood::m_r1NRows
private

Definition at line 151 of file ComposerRuleValidNeighborhood.h.

◆ m_r2NCols

long int te::rp::ComposerRuleValidNeighborhood::m_r2NCols
private

Definition at line 157 of file ComposerRuleValidNeighborhood.h.

◆ m_r2NRows

long int te::rp::ComposerRuleValidNeighborhood::m_r2NRows
private

Definition at line 155 of file ComposerRuleValidNeighborhood.h.

◆ m_ranges1

std::vector< std::pair< double, double > > te::rp::ComposerRuleValidNeighborhood::m_ranges1
private

Valid values ranges for each raster 1 band (first=min, second=max).

Definition at line 142 of file ComposerRuleValidNeighborhood.h.

◆ m_ranges2

std::vector< std::pair< double, double > > te::rp::ComposerRuleValidNeighborhood::m_ranges2
private

Valid values ranges for each raster 1 band (first=min, second=max).

Definition at line 147 of file ComposerRuleValidNeighborhood.h.

◆ m_raster1Bands

std::vector< unsigned int > te::rp::ComposerRule::m_raster1Bands
protectedinherited

Input raster 1 band indexes to use.

Definition at line 68 of file ComposerRule.h.

◆ m_raster1NoDataValues

std::vector< double > te::rp::ComposerRuleValidNeighborhood::m_raster1NoDataValues
private

Raster 1 no-data values (on value per band).

Definition at line 123 of file ComposerRuleValidNeighborhood.h.

◆ m_raster1Ptr

te::rst::Raster const* te::rp::ComposerRule::m_raster1Ptr
protectedinherited

Input raster 1.

Definition at line 62 of file ComposerRule.h.

◆ m_raster2Bands

std::vector< unsigned int > te::rp::ComposerRule::m_raster2Bands
protectedinherited

Input raster 2 band indexes to use.

Definition at line 69 of file ComposerRule.h.

◆ m_raster2NoDataValues

std::vector< double > te::rp::ComposerRuleValidNeighborhood::m_raster2NoDataValues
private

Raster 2 no-data values (on value per band).

Definition at line 125 of file ComposerRuleValidNeighborhood.h.

◆ m_raster2Ptr

te::rst::Raster const* te::rp::ComposerRule::m_raster2Ptr
protectedinherited

Input raster 2.

Definition at line 63 of file ComposerRule.h.

◆ m_raster3Bands

std::vector< unsigned int > te::rp::ComposerRule::m_raster3Bands
protectedinherited

Input raster 3 band indexes to use.

Definition at line 70 of file ComposerRule.h.

◆ m_raster3Ptr

te::rst::Raster* te::rp::ComposerRule::m_raster3Ptr
protectedinherited

Input raster 3.

Definition at line 64 of file ComposerRule.h.

◆ m_windowMaxNPixels

long int te::rp::ComposerRuleValidNeighborhood::m_windowMaxNPixels
private

Maximum number of pixels in a window (center included)

Definition at line 135 of file ComposerRuleValidNeighborhood.h.

◆ m_windowRadius

long int te::rp::ComposerRuleValidNeighborhood::m_windowRadius
private

Valid pixels windows radius.

Definition at line 130 of file ComposerRuleValidNeighborhood.h.


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