42 {
43 m.doc() =
"Gauss2D Gaussian Python bindings";
44
47
48 auto _g = py::class_<gauss2d::GaussianIntegral, std::shared_ptr<gauss2d::GaussianIntegral>>(
49 m,
"GaussianIntegral");
52 .def(py::init<double>(), "value"_a = 1)
53 .def_property("value", &gauss2d::GaussianIntegralValue::get_value,
54 &gauss2d::GaussianIntegralValue::set_value)
55 .def(py::self == py::self)
56 .def(py::self != py::self)
57 .def("__repr__",
60 })
61 .def("__str__", &gauss2d::GaussianIntegralValue::str);
62
63 py::class_<gauss2d::Gaussian, std::shared_ptr<gauss2d::Gaussian>>(
m,
"Gaussian")
66 "centroid"_a = nullptr, "ellipse"_a = nullptr, "integral"_a = nullptr)
67 .def_property_readonly("centroid", &gauss2d::Gaussian::get_centroid)
68 .def_property_readonly("ellipse", &gauss2d::Gaussian::get_ellipse)
69 .def_property_readonly("integral", &gauss2d::Gaussian::get_integral)
70 .def_property("const_normal", &gauss2d::Gaussian::get_const_normal,
71 &gauss2d::Gaussian::set_const_normal)
72 .def_property("integral_value", &gauss2d::Gaussian::get_integral_value,
73 &gauss2d::Gaussian::set_integral_value)
74 .def(py::self == py::self)
75 .def(py::self != py::self)
76 .def("__repr__",
78 .def("__str__", &gauss2d::Gaussian::str);
79 py::class_<gauss2d::Gaussians, std::shared_ptr<gauss2d::Gaussians>>(
m,
"Gaussians")
80 .def(py::init<std::optional<const gauss2d::Gaussians::Data>>(), "gaussians"_a)
81 .def("at", &gauss2d::Gaussians::at, py::return_value_policy::copy)
82 .def_property_readonly("size", &gauss2d::Gaussians::size)
83 .def("__getitem__", &gauss2d::Gaussians::at_ptr, py::return_value_policy::copy)
84 .def("__len__", &gauss2d::Gaussians::size)
85 .def("__repr__",
87 .def("__str__", &gauss2d::Gaussians::str);
88 py::class_<gauss2d::ConvolvedGaussian, std::shared_ptr<gauss2d::ConvolvedGaussian>>(
m,
89 "ConvolvedGaussian")
91 "source"_a = nullptr, "kernel"_a = nullptr)
92 .def_property_readonly("kernel", &gauss2d::ConvolvedGaussian::get_kernel)
93 .def_property_readonly("source", &gauss2d::ConvolvedGaussian::get_source)
94 .def(py::self == py::self)
95 .def(py::self != py::self)
96 .def("__repr__",
99 })
100 .def("__str__", &gauss2d::ConvolvedGaussian::str);
101 py::class_<gauss2d::ConvolvedGaussians, std::shared_ptr<gauss2d::ConvolvedGaussians>>(
102 m,
"ConvolvedGaussians")
103 .def(py::init<std::optional<const gauss2d::ConvolvedGaussians::Data>>(), "convolvedbgaussians"_a)
104 .def("at", &gauss2d::ConvolvedGaussians::at_ptr, py::return_value_policy::copy)
105 .def_property_readonly("size", &gauss2d::ConvolvedGaussians::size)
106 .def("__getitem__", &gauss2d::ConvolvedGaussians::at_ptr, py::return_value_policy::copy)
107 .def("__len__", &gauss2d::ConvolvedGaussians::size)
108 .def("__repr__",
111 })
112 .def("__str__", &gauss2d::ConvolvedGaussians::str);
113}
A convolution of a Gaussian source and kernel.
std::string repr(bool name_keywords=false, std::string_view namespace_separator=Object::CC_NAMESPACE_SEPARATOR) const override
Return a full, callable string representation of this.
A collection of ConvolvedGaussian objects.
std::string repr(bool name_keywords=false, std::string_view namespace_separator=Object::CC_NAMESPACE_SEPARATOR) const override
Return a full, callable string representation of this.
A 2D Gaussian with a Centroid, Ellipse, and integral.
std::string repr(bool name_keywords=false, std::string_view namespace_separator=Object::CC_NAMESPACE_SEPARATOR) const override
Return a full, callable string representation of this.
Interface for the normalization (total integrated value) of a 2D Gaussian.
A GaussianIntegral storing a float value.
std::string repr(bool name_keywords=false, std::string_view namespace_separator=Object::CC_NAMESPACE_SEPARATOR) const override
Return a full, callable string representation of this.
An array of Gaussian objects.
std::string repr(bool name_keywords=false, std::string_view namespace_separator=Object::CC_NAMESPACE_SEPARATOR) const override
Return a full, callable string representation of this.
static constexpr std::string_view PY_NAMESPACE_SEPARATOR
const double M_SIGMA_HWHM
const double M_HWHM_SIGMA