// python wrapper for vtkImageHistogramStatistics // #define VTK_WRAPPING_CXX #define VTK_STREAMS_FWD_ONLY #include "vtkPythonArgs.h" #include "vtkPythonOverload.h" #include "vtkConfigure.h" #include #include #include "vtkVariant.h" #include "vtkIndent.h" #include "vtkImageHistogramStatistics.h" extern "C" { VTK_ABI_EXPORT void PyVTKAddFile_vtkImageHistogramStatistics(PyObject *); } extern "C" { VTK_ABI_EXPORT PyObject *PyvtkImageHistogramStatistics_ClassNew(); } #ifndef DECLARED_PyvtkImageHistogram_ClassNew extern "C" { PyObject *PyvtkImageHistogram_ClassNew(); } #define DECLARED_PyvtkImageHistogram_ClassNew #endif static const char *PyvtkImageHistogramStatistics_Doc = "vtkImageHistogramStatistics - Compute statistics for an image\n\n" "Superclass: vtkImageHistogram\n\n" "vtkImageHistogramStatistics computes statistics such as mean, median,\n" "and standard deviation. These statistics are computed from the\n" "histogram of the image, rather than from the image itself, because\n" "this is more efficient than computing the statistics while traversing\n" "the pixels. If the input image is of type float or double, then the\n" "precision of the Mean, Median, and StandardDeviation will depend on\n" "the number of histogram bins. By default, 65536 bins are used for\n" "float data, giving at least 16 bits of precision.@par Thanks: Thanks\n" "to David Gobbi at the Seaman Family MR Centre and Dept. of Clinical\n" "Neurosciences, Foothills Medical Centre, Calgary, for providing this\n" "class.\n\n"; static PyObject * PyvtkImageHistogramStatistics_IsTypeOf(PyObject *, PyObject *args) { vtkPythonArgs ap(args, "IsTypeOf"); char *temp0 = nullptr; PyObject *result = nullptr; if (ap.CheckArgCount(1) && ap.GetValue(temp0)) { int tempr = vtkImageHistogramStatistics::IsTypeOf(temp0); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkImageHistogramStatistics_IsA(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "IsA"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkImageHistogramStatistics *op = static_cast(vp); char *temp0 = nullptr; PyObject *result = nullptr; if (op && ap.CheckArgCount(1) && ap.GetValue(temp0)) { int tempr = (ap.IsBound() ? op->IsA(temp0) : op->vtkImageHistogramStatistics::IsA(temp0)); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkImageHistogramStatistics_SafeDownCast(PyObject *, PyObject *args) { vtkPythonArgs ap(args, "SafeDownCast"); vtkObjectBase *temp0 = nullptr; PyObject *result = nullptr; if (ap.CheckArgCount(1) && ap.GetVTKObject(temp0, "vtkObjectBase")) { vtkImageHistogramStatistics *tempr = vtkImageHistogramStatistics::SafeDownCast(temp0); if (!ap.ErrorOccurred()) { result = ap.BuildVTKObject(tempr); } } return result; } static PyObject * PyvtkImageHistogramStatistics_NewInstance(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "NewInstance"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkImageHistogramStatistics *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { vtkImageHistogramStatistics *tempr = (ap.IsBound() ? op->NewInstance() : op->vtkImageHistogramStatistics::NewInstance()); if (!ap.ErrorOccurred()) { result = ap.BuildVTKObject(tempr); if (result && PyVTKObject_Check(result)) { PyVTKObject_GetObject(result)->UnRegister(0); PyVTKObject_SetFlag(result, VTK_PYTHON_IGNORE_UNREGISTER, 1); } } } return result; } static PyObject * PyvtkImageHistogramStatistics_GetMinimum(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetMinimum"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkImageHistogramStatistics *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { double tempr = (ap.IsBound() ? op->GetMinimum() : op->vtkImageHistogramStatistics::GetMinimum()); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkImageHistogramStatistics_GetMaximum(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetMaximum"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkImageHistogramStatistics *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { double tempr = (ap.IsBound() ? op->GetMaximum() : op->vtkImageHistogramStatistics::GetMaximum()); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkImageHistogramStatistics_GetMean(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetMean"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkImageHistogramStatistics *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { double tempr = (ap.IsBound() ? op->GetMean() : op->vtkImageHistogramStatistics::GetMean()); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkImageHistogramStatistics_GetMedian(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetMedian"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkImageHistogramStatistics *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { double tempr = (ap.IsBound() ? op->GetMedian() : op->vtkImageHistogramStatistics::GetMedian()); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkImageHistogramStatistics_GetStandardDeviation(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetStandardDeviation"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkImageHistogramStatistics *op = static_cast(vp); PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { double tempr = (ap.IsBound() ? op->GetStandardDeviation() : op->vtkImageHistogramStatistics::GetStandardDeviation()); if (!ap.ErrorOccurred()) { result = ap.BuildValue(tempr); } } return result; } static PyObject * PyvtkImageHistogramStatistics_SetAutoRangePercentiles_s1(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetAutoRangePercentiles"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkImageHistogramStatistics *op = static_cast(vp); double temp0; double temp1; PyObject *result = nullptr; if (op && ap.CheckArgCount(2) && ap.GetValue(temp0) && ap.GetValue(temp1)) { if (ap.IsBound()) { op->SetAutoRangePercentiles(temp0, temp1); } else { op->vtkImageHistogramStatistics::SetAutoRangePercentiles(temp0, temp1); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkImageHistogramStatistics_SetAutoRangePercentiles_s2(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetAutoRangePercentiles"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkImageHistogramStatistics *op = static_cast(vp); const int size0 = 2; double temp0[2]; PyObject *result = nullptr; if (op && ap.CheckArgCount(1) && ap.GetArray(temp0, size0)) { if (ap.IsBound()) { op->SetAutoRangePercentiles(temp0); } else { op->vtkImageHistogramStatistics::SetAutoRangePercentiles(temp0); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkImageHistogramStatistics_SetAutoRangePercentiles(PyObject *self, PyObject *args) { int nargs = vtkPythonArgs::GetArgCount(self, args); switch(nargs) { case 2: return PyvtkImageHistogramStatistics_SetAutoRangePercentiles_s1(self, args); case 1: return PyvtkImageHistogramStatistics_SetAutoRangePercentiles_s2(self, args); } vtkPythonArgs::ArgCountError(nargs, "SetAutoRangePercentiles"); return nullptr; } static PyObject * PyvtkImageHistogramStatistics_GetAutoRangePercentiles(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetAutoRangePercentiles"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkImageHistogramStatistics *op = static_cast(vp); int sizer = 2; PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { double *tempr = (ap.IsBound() ? op->GetAutoRangePercentiles() : op->vtkImageHistogramStatistics::GetAutoRangePercentiles()); if (!ap.ErrorOccurred()) { result = ap.BuildTuple(tempr, sizer); } } return result; } static PyObject * PyvtkImageHistogramStatistics_SetAutoRangeExpansionFactors_s1(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetAutoRangeExpansionFactors"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkImageHistogramStatistics *op = static_cast(vp); double temp0; double temp1; PyObject *result = nullptr; if (op && ap.CheckArgCount(2) && ap.GetValue(temp0) && ap.GetValue(temp1)) { if (ap.IsBound()) { op->SetAutoRangeExpansionFactors(temp0, temp1); } else { op->vtkImageHistogramStatistics::SetAutoRangeExpansionFactors(temp0, temp1); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkImageHistogramStatistics_SetAutoRangeExpansionFactors_s2(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetAutoRangeExpansionFactors"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkImageHistogramStatistics *op = static_cast(vp); const int size0 = 2; double temp0[2]; PyObject *result = nullptr; if (op && ap.CheckArgCount(1) && ap.GetArray(temp0, size0)) { if (ap.IsBound()) { op->SetAutoRangeExpansionFactors(temp0); } else { op->vtkImageHistogramStatistics::SetAutoRangeExpansionFactors(temp0); } if (!ap.ErrorOccurred()) { result = ap.BuildNone(); } } return result; } static PyObject * PyvtkImageHistogramStatistics_SetAutoRangeExpansionFactors(PyObject *self, PyObject *args) { int nargs = vtkPythonArgs::GetArgCount(self, args); switch(nargs) { case 2: return PyvtkImageHistogramStatistics_SetAutoRangeExpansionFactors_s1(self, args); case 1: return PyvtkImageHistogramStatistics_SetAutoRangeExpansionFactors_s2(self, args); } vtkPythonArgs::ArgCountError(nargs, "SetAutoRangeExpansionFactors"); return nullptr; } static PyObject * PyvtkImageHistogramStatistics_GetAutoRangeExpansionFactors(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetAutoRangeExpansionFactors"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkImageHistogramStatistics *op = static_cast(vp); int sizer = 2; PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { double *tempr = (ap.IsBound() ? op->GetAutoRangeExpansionFactors() : op->vtkImageHistogramStatistics::GetAutoRangeExpansionFactors()); if (!ap.ErrorOccurred()) { result = ap.BuildTuple(tempr, sizer); } } return result; } static PyObject * PyvtkImageHistogramStatistics_GetAutoRange(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetAutoRange"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkImageHistogramStatistics *op = static_cast(vp); int sizer = 2; PyObject *result = nullptr; if (op && ap.CheckArgCount(0)) { double *tempr = (ap.IsBound() ? op->GetAutoRange() : op->vtkImageHistogramStatistics::GetAutoRange()); if (!ap.ErrorOccurred()) { result = ap.BuildTuple(tempr, sizer); } } return result; } static PyMethodDef PyvtkImageHistogramStatistics_Methods[] = { {"IsTypeOf", PyvtkImageHistogramStatistics_IsTypeOf, METH_VARARGS, "V.IsTypeOf(string) -> int\nC++: static vtkTypeBool IsTypeOf(const char *type)\n\nReturn 1 if this class type is the same type of (or a subclass\nof) the named class. Returns 0 otherwise. This method works in\ncombination with vtkTypeMacro found in vtkSetGet.h.\n"}, {"IsA", PyvtkImageHistogramStatistics_IsA, METH_VARARGS, "V.IsA(string) -> int\nC++: vtkTypeBool IsA(const char *type) override;\n\nReturn 1 if this class is the same type of (or a subclass of) the\nnamed class. Returns 0 otherwise. This method works in\ncombination with vtkTypeMacro found in vtkSetGet.h.\n"}, {"SafeDownCast", PyvtkImageHistogramStatistics_SafeDownCast, METH_VARARGS, "V.SafeDownCast(vtkObjectBase) -> vtkImageHistogramStatistics\nC++: static vtkImageHistogramStatistics *SafeDownCast(\n vtkObjectBase *o)\n\n"}, {"NewInstance", PyvtkImageHistogramStatistics_NewInstance, METH_VARARGS, "V.NewInstance() -> vtkImageHistogramStatistics\nC++: vtkImageHistogramStatistics *NewInstance()\n\n"}, {"GetMinimum", PyvtkImageHistogramStatistics_GetMinimum, METH_VARARGS, "V.GetMinimum() -> float\nC++: double GetMinimum()\n\nGet the minimum value present in the image. This value is\ncomputed when Update() is called.\n"}, {"GetMaximum", PyvtkImageHistogramStatistics_GetMaximum, METH_VARARGS, "V.GetMaximum() -> float\nC++: double GetMaximum()\n\nGet the maximum value present in the image. This value is\ncomputed when Update() is called.\n"}, {"GetMean", PyvtkImageHistogramStatistics_GetMean, METH_VARARGS, "V.GetMean() -> float\nC++: double GetMean()\n\nGet the mean value of the image. This value is computed when\nUpdate() is called.\n"}, {"GetMedian", PyvtkImageHistogramStatistics_GetMedian, METH_VARARGS, "V.GetMedian() -> float\nC++: double GetMedian()\n\nGet the median value. This is computed when Update() is called.\n"}, {"GetStandardDeviation", PyvtkImageHistogramStatistics_GetStandardDeviation, METH_VARARGS, "V.GetStandardDeviation() -> float\nC++: double GetStandardDeviation()\n\nGet the standard deviation of the values in the image. This is\ncomputed when Update() is called.\n"}, {"SetAutoRangePercentiles", PyvtkImageHistogramStatistics_SetAutoRangePercentiles, METH_VARARGS, "V.SetAutoRangePercentiles(float, float)\nC++: void SetAutoRangePercentiles(double, double)\nV.SetAutoRangePercentiles((float, float))\nC++: void SetAutoRangePercentiles(double a[2])\n\n"}, {"GetAutoRangePercentiles", PyvtkImageHistogramStatistics_GetAutoRangePercentiles, METH_VARARGS, "V.GetAutoRangePercentiles() -> (float, float)\nC++: double *GetAutoRangePercentiles()\n\n"}, {"SetAutoRangeExpansionFactors", PyvtkImageHistogramStatistics_SetAutoRangeExpansionFactors, METH_VARARGS, "V.SetAutoRangeExpansionFactors(float, float)\nC++: void SetAutoRangeExpansionFactors(double, double)\nV.SetAutoRangeExpansionFactors((float, float))\nC++: void SetAutoRangeExpansionFactors(double a[2])\n\n"}, {"GetAutoRangeExpansionFactors", PyvtkImageHistogramStatistics_GetAutoRangeExpansionFactors, METH_VARARGS, "V.GetAutoRangeExpansionFactors() -> (float, float)\nC++: double *GetAutoRangeExpansionFactors()\n\n"}, {"GetAutoRange", PyvtkImageHistogramStatistics_GetAutoRange, METH_VARARGS, "V.GetAutoRange() -> (float, float)\nC++: double *GetAutoRange()\n\n"}, {nullptr, nullptr, 0, nullptr} }; static PyTypeObject PyvtkImageHistogramStatistics_Type = { PyVarObject_HEAD_INIT(&PyType_Type, 0) "vtkImagingStatisticsPython.vtkImageHistogramStatistics", // tp_name sizeof(PyVTKObject), // tp_basicsize 0, // tp_itemsize PyVTKObject_Delete, // tp_dealloc 0, // tp_print nullptr, // tp_getattr nullptr, // tp_setattr nullptr, // tp_compare PyVTKObject_Repr, // tp_repr nullptr, // tp_as_number nullptr, // tp_as_sequence nullptr, // tp_as_mapping nullptr, // tp_hash nullptr, // tp_call PyVTKObject_String, // tp_str PyObject_GenericGetAttr, // tp_getattro PyObject_GenericSetAttr, // tp_setattro &PyVTKObject_AsBuffer, // tp_as_buffer Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_BASETYPE, // tp_flags PyvtkImageHistogramStatistics_Doc, // tp_doc PyVTKObject_Traverse, // tp_traverse nullptr, // tp_clear nullptr, // tp_richcompare offsetof(PyVTKObject, vtk_weakreflist), // tp_weaklistoffset nullptr, // tp_iter nullptr, // tp_iternext nullptr, // tp_methods nullptr, // tp_members PyVTKObject_GetSet, // tp_getset nullptr, // tp_base nullptr, // tp_dict nullptr, // tp_descr_get nullptr, // tp_descr_set offsetof(PyVTKObject, vtk_dict), // tp_dictoffset nullptr, // tp_init nullptr, // tp_alloc PyVTKObject_New, // tp_new PyObject_GC_Del, // tp_free nullptr, // tp_is_gc nullptr, // tp_bases nullptr, // tp_mro nullptr, // tp_cache nullptr, // tp_subclasses nullptr, // tp_weaklist VTK_WRAP_PYTHON_SUPPRESS_UNINITIALIZED }; static vtkObjectBase *PyvtkImageHistogramStatistics_StaticNew() { return vtkImageHistogramStatistics::New(); } PyObject *PyvtkImageHistogramStatistics_ClassNew() { PyVTKClass_Add( &PyvtkImageHistogramStatistics_Type, PyvtkImageHistogramStatistics_Methods, "vtkImageHistogramStatistics", &PyvtkImageHistogramStatistics_StaticNew); PyTypeObject *pytype = &PyvtkImageHistogramStatistics_Type; if ((pytype->tp_flags & Py_TPFLAGS_READY) != 0) { return (PyObject *)pytype; } #if !defined(VTK_PY3K) && PY_VERSION_HEX >= 0x02060000 pytype->tp_flags |= Py_TPFLAGS_HAVE_NEWBUFFER; #endif pytype->tp_base = (PyTypeObject *)PyvtkImageHistogram_ClassNew(); PyType_Ready(pytype); return (PyObject *)pytype; } void PyVTKAddFile_vtkImageHistogramStatistics( PyObject *dict) { PyObject *o; o = PyvtkImageHistogramStatistics_ClassNew(); if (o && PyDict_SetItemString(dict, "vtkImageHistogramStatistics", o) != 0) { Py_DECREF(o); } }