26 #include "../common/progress/TaskProgress.h"
31 segmenterDummyStrategyFactoryInstance;
49 throw( te::rp::Exception )
61 const std::vector< unsigned int >& inputRasterBands,
62 const std::vector< double >&,
63 const std::vector< double >&,
65 const unsigned int outputRasterBand,
66 const bool enableProgressInterface )
67 throw( te::rp::Exception )
70 segmenterIdsManager.getNewID();
72 const unsigned int nLines = outputRaster.getNumberOfRows();
73 const unsigned int nCols = outputRaster.getNumberOfColumns();
77 std::auto_ptr< te::common::TaskProgress > progressPtr;
78 if( enableProgressInterface )
81 progressPtr->setTotalSteps( nLines );
82 progressPtr->setMessage(
"Segmentation" );
87 for(
unsigned int line = 0 ; line < nLines ; ++line )
89 for( col = 0 ; col < nCols ; ++col )
91 outputRaster.setValue( col, line, segmentId, outputRasterBand );
94 if( enableProgressInterface )
96 if( ! progressPtr->isActive() )
101 progressPtr->pulse();
109 const unsigned int bandsToProcess,
const unsigned int pixelsNumber )
const
111 return (
double)(
sizeof(double) * bandsToProcess * pixelsNumber );
Segmenter segments IDs manager.
Dummy strategy (just for testing purposes).
~SegmenterDummyStrategyFactory()
bool initialize(SegmenterStrategyParameters const *const strategyParams)
Initialize the segmentation strategy.
SegmenterDummyStrategyFactory()
This class can be used to inform the progress of a task.
unsigned int getOptimalBlocksOverlapSize() const
Returns a optimal blocks overlap size (number of border pixels overlapped between blocks...
double getMemUsageEstimation(const unsigned int bandsToProcess, const unsigned int pixelsNumber) const
Returns a memory estimation (bytes).
~SegmenterDummyStrategy()
Raster dummy segmenter strategy factory.
void reset()
Clear all internal allocated resources and go back to the initial not-initialized state...
Segmenter Strategy Parameters.
Raster segmenter strategy factory base class.
unsigned int SegmentIdDataType
An abstract class for raster data strucutures.
Raster segmenter strategy base class.
te::rp::SegmenterStrategy * build()
Concrete factories (derived from this one) must implement this method in order to create objects...
bool execute(SegmenterIdsManager &segmenterIdsManager, const te::rst::Raster &inputRaster, const std::vector< unsigned int > &inputRasterBands, const std::vector< double > &inputRasterGains, const std::vector< double > &inputRasterOffsets, te::rst::Raster &outputRaster, const unsigned int outputRasterBand, const bool enableProgressInterface)
Executes the segmentation strategy.
Dummy strategy (just for testing purposes).