ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkPyImageFilter.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * https://www.apache.org/licenses/LICENSE-2.0.txt
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 *=========================================================================*/
18
19#ifndef itkPyImageFilter_h
20#define itkPyImageFilter_h
21
23
24// The python header defines _POSIX_C_SOURCE without a preceding #undef
25#undef _POSIX_C_SOURCE
26#undef _XOPEN_SOURCE
27#include "Python.h"
28
29namespace itk
30{
31
41template <class TInputImage, class TOutputImage>
42class ITK_TEMPLATE_EXPORT PyImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
43{
44public:
45 ITK_DISALLOW_COPY_AND_MOVE(PyImageFilter);
46
52
54 itkNewMacro(Self);
55
57 itkOverrideGetNameOfClassMacro(PyImageFilter);
58
60 using InputImageType = TInputImage;
61 using InputImagePointer = typename InputImageType::Pointer;
62 using InputImageRegionType = typename InputImageType::RegionType;
63 using InputImagePixelType = typename InputImageType::PixelType;
64 using OutputImageType = TOutputImage;
65 using OutputImagePointer = typename OutputImageType::Pointer;
66 using OutputImageRegionType = typename OutputImageType::RegionType;
67 using OutputImagePixelType = typename OutputImageType::PixelType;
68
70 static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
71 static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
72
76 void
78
82 void
84
88 void
90
94 void
95 SetPyGenerateData(PyObject * obj);
96
98 void
99 _SetSelf(PyObject * self)
100 {
101 this->m_Self = self;
102 }
103
104protected:
105 PyImageFilter() = default;
106 ~PyImageFilter() override;
107
108 void
110
111 void
113
114 void
116
117 void
118 GenerateData() override;
119
120private:
121 PyObject * m_Self;
125 PyObject * m_GenerateDataCallable{ nullptr };
126};
127
128} // end namespace itk
129
130
131#ifndef ITK_MANUAL_INSTANTIATION
132# include "itkPyImageFilter.hxx"
133#endif
134
135#endif // _itkPyImageFilter_h
Base class for all data objects in ITK.
PyObject * m_GenerateInputRequestedRegionCallable
void SetPyGenerateOutputInformation(PyObject *obj)
typename OutputImageType::RegionType OutputImageRegionType
PyObject * m_EnlargeOutputRequestedRegionCallable
void _SetSelf(PyObject *self)
void SetPyGenerateData(PyObject *obj)
typename InputImageType::Pointer InputImagePointer
PyObject * m_GenerateDataCallable
PyObject * m_GenerateOutputInformationCallable
static constexpr unsigned int OutputImageDimension
void SetPyEnlargeOutputRequestedRegion(PyObject *obj)
SmartPointer< Self > Pointer
static constexpr unsigned int InputImageDimension
void SetPyGenerateInputRequestedRegion(PyObject *obj)
TOutputImage OutputImageType
void EnlargeOutputRequestedRegion(DataObject *dataObject) override
void GenerateOutputInformation() override
TInputImage InputImageType
typename OutputImageType::PixelType OutputImagePixelType
~PyImageFilter() override
typename OutputImageType::Pointer OutputImagePointer
SmartPointer< const Self > ConstPointer
void GenerateInputRequestedRegion() override
typename InputImageType::RegionType InputImageRegionType
PyImageFilter()=default
void GenerateData() override
typename InputImageType::PixelType InputImagePixelType
ImageToImageFilter< TInputImage, TOutputImage > Superclass
Implements transparent reference counting.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....