#include "pybind11/pybind11.h"
#include "pybind11/stl.h"
#include <memory>
#include <string>
using namespace pybind11::literals;
namespace ip {
namespace diffim {
namespace {
template <typename PixelT>
wrappers.
wrapType(PyImageStatistics(wrappers.
module,
name.c_str()), [](
auto &mod,
auto &cls) {
cls.def(py::init<daf::base::PropertySet const &>(), "ps"_a);
cls.def("reset", &ImageStatistics<PixelT>::reset);
cls.def("apply", (void (ImageStatistics<PixelT>::*)(afw::image::MaskedImage<PixelT> const &)) &
ImageStatistics<PixelT>::apply,
"image"_a);
cls.def("apply", (void (ImageStatistics<PixelT>::*)(afw::image::MaskedImage<PixelT> const &, int)) &
ImageStatistics<PixelT>::apply,
"image"_a, "core"_a);
cls.def("setBpMask", &ImageStatistics<PixelT>::setBpMask, "bpMask"_a);
cls.def("getBpMask", &ImageStatistics<PixelT>::getBpMask);
cls.def("getMean", &ImageStatistics<PixelT>::getMean);
cls.def("getVariance", &ImageStatistics<PixelT>::getVariance);
cls.def("getRms", &ImageStatistics<PixelT>::getRms);
cls.def("getNpix", &ImageStatistics<PixelT>::getNpix);
cls.def("evaluateQuality", &ImageStatistics<PixelT>::evaluateQuality, "ps"_a);
});
}
}
declareImageStatistics<int>(wrappers, "I");
declareImageStatistics<float>(wrappers, "F");
declareImageStatistics<double>(wrappers, "D");
}
}
}
}
table::Key< std::string > name
Image Subtraction helper functions.
A helper class for subdividing pybind11 module across multiple translation units (i....
PyType wrapType(PyType cls, ClassWrapperCallback function, bool setModuleName=true)
Add a type (class or enum) wrapper, deferring method and other attribute definitions until finish() i...
pybind11::module module
The module object passed to the PYBIND11_MODULE block that contains this WrapperCollection.
void wrapImageStatistics(WrapperCollection &wrappers)