@@ -35,8 +35,6 @@ DIP_OUTPUT_TYPE_CASTER( Measurement::FeatureInformation, "FeatureInformation", "
35
35
DIP_OUTPUT_TYPE_CASTER ( Feature::ValueInformation, " ValueInformation" , " name units" , src.name, src.units )
36
36
DIP_OUTPUT_TYPE_CASTER ( FeretValues, " FeretValues" , " maxDiameter minDiameter maxPerpendicular maxAngle minAngle" , src.maxDiameter, src.minDiameter, src.maxPerpendicular, src.maxAngle, src.minAngle )
37
37
DIP_OUTPUT_TYPE_CASTER ( RadiusValues, " RadiusValues" , " mean standardDev maximum minimum circularity" , src.Mean(), src.StandardDeviation(), src.Maximum(), src.Minimum(), src.Circularity() )
38
- DIP_OUTPUT_TYPE_CASTER ( CircleParameters, " CircleParameters" , " center diameter" , src.center, src.diameter )
39
- DIP_OUTPUT_TYPE_CASTER ( EllipseParameters, " EllipseParameters" , " center majorAxis minorAxis orientation eccentricity" , src.center, src.majorAxis, src.minorAxis, src.orientation, src.eccentricity )
40
38
41
39
} // namespace detail
42
40
} // namespace pybind11
@@ -150,6 +148,40 @@ class type_caster< dip::BoundingBoxInteger > {
150
148
PYBIND11_TYPE_CASTER ( type, _( " BoundingBoxInteger" ));
151
149
};
152
150
151
+ template <>
152
+ class type_caster < dip::CircleParameters > {
153
+ public:
154
+ using type = dip::CircleParameters;
155
+
156
+ bool load ( handle /* src*/ , bool /* convert*/ ) {
157
+ return false ; // Disallow casting to the type, this is not an input argument anywhere
158
+ }
159
+
160
+ static handle cast ( dip::CircleParameters const & src, return_value_policy /* policy*/ , handle /* parent*/ ) {
161
+ auto center = VertexTuple ( src.center );
162
+ return CreateNamedTuple ( " CircleParameters" , " topLeft bottomRight" , center, src.diameter ).release ();
163
+ }
164
+
165
+ PYBIND11_TYPE_CASTER ( type, _( " CircleParameters" ));
166
+ };
167
+
168
+ template <>
169
+ class type_caster < dip::EllipseParameters > {
170
+ public:
171
+ using type = dip::EllipseParameters;
172
+
173
+ bool load ( handle /* src*/ , bool /* convert*/ ) {
174
+ return false ; // Disallow casting to the type, this is not an input argument anywhere
175
+ }
176
+
177
+ static handle cast ( dip::EllipseParameters const & src, return_value_policy /* policy*/ , handle /* parent*/ ) {
178
+ auto center = VertexTuple ( src.center );
179
+ return CreateNamedTuple ( " EllipseParameters" , " center majorAxis minorAxis orientation eccentricity" , center, src.majorAxis , src.minorAxis , src.orientation , src.eccentricity ).release ();
180
+ }
181
+
182
+ PYBIND11_TYPE_CASTER ( type, _( " EllipseParameters" ));
183
+ };
184
+
153
185
} // namespace detail
154
186
} // namespace pybind11
155
187
0 commit comments