#include <imageanalysis/ImageAnalysis/ImageBoxcarSmoother.h>
template<class T> ImageBoxcarSmoother<T>::ImageBoxcarSmoother(
const casacore::Record *const region,
const casacore::String& mask,
const casacore::String& outname, casacore::Bool overwrite
image, region, mask, outname, overwrite
this->_setNMinPixels(_width);
template<class T> SPIIT ImageBoxcarSmoother<T>::_smooth(
const casacore::ImageInterface<T>& image
auto shape = image.shape();
auto axis = this->_getAxis();
&& this->_getDecimationFunction() == ImageDecimatorData::MEAN
&& shape[axis] < 2*_width,
"The convolution axis of selected image region must have length "
"of at least 2*width when using the mean decimation function"
auto inTileShape = image.niceCursorShape();
casacore::TiledLineStepper inNav(image.shape(), inTileShape, axis);
casacore::RO_MaskedLatticeIterator<T> inIter(image, inNav);
casacore::IPosition sliceShape(image.ndim(), 1);
sliceShape[axis] = shape[axis];
casacore::Record emptyRecord;
casacore::IPosition blc(image.ndim(), 0);
trc[axis] = this->_getDecimate()
&& this->_getDecimationFunction() == ImageDecimatorData::COPY
? shape[axis]/_width*_width - _width
casacore::LCBox lcbox(blc, trc, shape);
auto region = lcbox.toRecord("");
SubImageFactory<T>::createImage(
image, empty, region, empty,
false, false, false, false
// fix up smoothed axis metadata
auto csys = out->coordinates();
auto shift = csys.increment()[axis]*(_width - 1)/2.0;
auto rval = csys.referenceValue();
csys.setReferenceValue(rval);
out->setCoordinateInfo(csys);
sliceShape[axis] = out->shape()[axis];
casacore::Array<T> slice(sliceShape);
while (!inIter.atEnd()) {
_boxcarSmooth(slice, inIter.cursor());
out->putSlice(slice, inIter.position());