#include <imageanalysis/ImageAnalysis/Image1DSmoother.h>
#include <imageanalysis/ImageAnalysis/ImageDecimator.h>
#include <imageanalysis/ImageAnalysis/ImageMaskedPixelReplacer.h>
template<class T> Image1DSmoother<T>::Image1DSmoother(
const casacore::Record *const region,
const casacore::String& maskInp,
const casacore::String& outname, casacore::Bool overwrite
image, "", region, "", "", "",
maskInp, outname, overwrite
_axis(0), _nMinPixels(2), _decimate(false),
_decimationFunction(ImageDecimatorData::COPY) {}
template<class T> void Image1DSmoother<T>::setAxis(casacore::uInt n) {
casacore::uInt ndim = this->_getImage()->ndim();
"The axis number along which the smoothing "
"is to occur must be less than the number of "
"axes in the image which is " + casacore::String::toString(ndim)
template<class T> SPIIT Image1DSmoother<T>::smooth() const {
*this->_getLog() << casacore::LogOrigin(getClass(), __func__);
SubImageFactory<T>::createImage(
*this->_getImage(), "", *this->_getRegion(),
this->_getMask(), false, false, false, this->_getStretch()
subImage->shape()[_axis] < _nMinPixels,
"The selected region of the image must have at least "
+ casacore::String::toString(_nMinPixels)
+ " pixels along the axis to be smoothed."
if (subImage->isMasked() || subImage->hasPixelMask()) {
ImageMaskedPixelReplacer<T> impr(
impr.replace("0", false, false);
SPIIT smoothed(_smooth(*subImage));
this->_reportOldNewImageShapes(*smoothed);
return this->_prepareOutputImage(*smoothed);