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 );
Dummy strategy (just for testing purposes).
void reset()
Clear all internal allocated resources and go back to the initial not-initialized state...
double getMemUsageEstimation(const unsigned int bandsToProcess, const unsigned int pixelsNumber) const
Returns a memory estimation (bytes).
bool initialize(SegmenterStrategyParameters const *const strategyParams)
Initialize the segmentation strategy.
unsigned int SegmentIdDataType
~SegmenterDummyStrategy()
unsigned int getOptimalBlocksOverlapSize() const
Returns a optimal blocks overlap size (number of border pixels overlapped between blocks...
Segmenter segments IDs manager.
Segmenter Strategy Parameters.
Raster segmenter strategy base class.
Dummy strategy (just for testing purposes).
Raster dummy segmenter strategy factory.
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.
An abstract class for raster data strucutures.
This class can be used to inform the progress of a task.
Raster segmenter strategy factory base class.
SegmenterDummyStrategyFactory()
te::rp::SegmenterStrategy * build()
Concrete factories (derived from this one) must implement this method in order to create objects...
~SegmenterDummyStrategyFactory()