ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkVTKImageImport.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#ifndef itkVTKImageImport_h
19#define itkVTKImageImport_h
20
21#include "itkImageSource.h"
23
24#define itkSetMacro2(name, type) \
25 virtual void Set##name(type _arg) \
26 { \
27 itkDebugMacro("setting " #name " to " << _arg); \
28 if (this->m_##name != _arg) \
29 { \
30 this->m_##name = _arg; \
31 this->Modified(); \
32 } \
33 }
34
35namespace itk
36{
56template <typename TOutputImage>
57class ITK_TEMPLATE_EXPORT VTKImageImport : public ImageSource<TOutputImage>
58{
59public:
60 ITK_DISALLOW_COPY_AND_MOVE(VTKImageImport);
61
66
68 itkNewMacro(Self);
69
71 itkOverrideGetNameOfClassMacro(VTKImageImport);
72
74 using OutputImageType = TOutputImage;
75 using OutputImagePointer = typename OutputImageType::Pointer;
76 using OutputPixelType = typename OutputImageType::PixelType;
77 using OutputSizeType = typename OutputImageType::SizeType;
78 using OutputIndexType = typename OutputImageType::IndexType;
79 using OutputRegionType = typename OutputImageType::RegionType;
80
82 static constexpr unsigned int OutputImageDimension = OutputImageType::ImageDimension;
83
86 using UpdateInformationCallbackType = void (*)(void *);
87 using PipelineModifiedCallbackType = int (*)(void *);
88 using WholeExtentCallbackType = int * (*)(void *);
89 using SpacingCallbackType = double * (*)(void *);
90 using OriginCallbackType = double * (*)(void *);
91 using DirectionCallbackType = double * (*)(void *);
92 using ScalarTypeCallbackType = const char * (*)(void *);
93 using NumberOfComponentsCallbackType = int (*)(void *);
94 using PropagateUpdateExtentCallbackType = void (*)(void *, int *);
95 using UpdateDataCallbackType = void (*)(void *);
96 using DataExtentCallbackType = int * (*)(void *);
97 using BufferPointerCallbackType = void * (*)(void *);
99
101 using FloatSpacingCallbackType = float * (*)(void *);
102 using FloatOriginCallbackType = float * (*)(void *);
104
106 itkSetMacro(UpdateInformationCallback, UpdateInformationCallbackType);
107 itkGetConstMacro(UpdateInformationCallback, UpdateInformationCallbackType);
109
111 itkSetMacro(PipelineModifiedCallback, PipelineModifiedCallbackType);
112 itkGetConstMacro(PipelineModifiedCallback, PipelineModifiedCallbackType);
114
116 itkSetMacro(WholeExtentCallback, WholeExtentCallbackType);
117 itkGetConstMacro(WholeExtentCallback, WholeExtentCallbackType);
119
121 itkSetMacro(SpacingCallback, SpacingCallbackType);
122 itkGetConstMacro(SpacingCallback, SpacingCallbackType);
123 itkSetMacro(FloatSpacingCallback, FloatSpacingCallbackType);
124 itkGetConstMacro(FloatSpacingCallback, FloatSpacingCallbackType);
125 void
130
131
133 itkSetMacro(OriginCallback, OriginCallbackType);
134 itkGetConstMacro(OriginCallback, OriginCallbackType);
135 itkSetMacro(FloatOriginCallback, FloatOriginCallbackType);
136 itkGetConstMacro(FloatOriginCallback, FloatOriginCallbackType);
137 void
142
143
145 itkSetMacro(DirectionCallback, DirectionCallbackType);
146 itkGetConstMacro(DirectionCallback, DirectionCallbackType);
148
150 itkSetMacro(ScalarTypeCallback, ScalarTypeCallbackType);
151 itkGetConstMacro(ScalarTypeCallback, ScalarTypeCallbackType);
153
155 itkSetMacro(NumberOfComponentsCallback, NumberOfComponentsCallbackType);
156 itkGetConstMacro(NumberOfComponentsCallback, NumberOfComponentsCallbackType);
158
160 itkSetMacro(PropagateUpdateExtentCallback, PropagateUpdateExtentCallbackType);
161 itkGetConstMacro(PropagateUpdateExtentCallback, PropagateUpdateExtentCallbackType);
163
165 itkSetMacro(UpdateDataCallback, UpdateDataCallbackType);
166 itkGetConstMacro(UpdateDataCallback, UpdateDataCallbackType);
168
170 itkSetMacro(DataExtentCallback, DataExtentCallbackType);
171 itkGetConstMacro(DataExtentCallback, DataExtentCallbackType);
173
175 itkSetMacro(BufferPointerCallback, BufferPointerCallbackType);
176 itkGetConstMacro(BufferPointerCallback, BufferPointerCallbackType);
178
180 itkSetMacro2(CallbackUserData, void *);
181 itkGetConstMacro(CallbackUserData, void *);
183
184protected:
186 ~VTKImageImport() override = default;
187 void
188 PrintSelf(std::ostream & os, Indent indent) const override;
189
190 void
192
193 void
195
196 void
197 GenerateData() override;
198
199 void
201
202private:
203 void * m_CallbackUserData{ nullptr };
218
219 std::string m_ScalarTypeName{};
220};
221} // namespace itk
222
223#ifndef ITK_MANUAL_INSTANTIATION
224# include "itkVTKImageImport.hxx"
225#endif
226
227#endif // itkVTKImageImport_h
Base class for all data objects in ITK.
Control indentation during Print() invocation.
Definition itkIndent.h:50
Implements transparent reference counting.
ScalarTypeCallbackType m_ScalarTypeCallback
void GenerateOutputInformation() override
UpdateDataCallbackType m_UpdateDataCallback
void(*)(void *) UpdateDataCallbackType
void *(*)(void *) BufferPointerCallbackType
static constexpr unsigned int OutputImageDimension
virtual void SetFloatSpacingCallback(FloatSpacingCallbackType _arg)
void SetOriginCallback(FloatOriginCallbackType f)
float *(*)(void *) FloatSpacingCallbackType
PipelineModifiedCallbackType m_PipelineModifiedCallback
~VTKImageImport() override=default
SpacingCallbackType m_SpacingCallback
typename OutputImageType::IndexType OutputIndexType
void PropagateRequestedRegion(DataObject *) override
typename OutputImageType::Pointer OutputImagePointer
PropagateUpdateExtentCallbackType m_PropagateUpdateExtentCallback
void PrintSelf(std::ostream &os, Indent indent) const override
NumberOfComponentsCallbackType m_NumberOfComponentsCallback
void(*)(void *, int *) PropagateUpdateExtentCallbackType
DataExtentCallbackType m_DataExtentCallback
const char *(*)(void *) ScalarTypeCallbackType
double *(*)(void *) SpacingCallbackType
int(*)(void *) PipelineModifiedCallbackType
void GenerateData() override
typename OutputImageType::SizeType OutputSizeType
double *(*)(void *) OriginCallbackType
OriginCallbackType m_OriginCallback
double *(*)(void *) DirectionCallbackType
SmartPointer< Self > Pointer
virtual void SetFloatOriginCallback(FloatOriginCallbackType _arg)
UpdateInformationCallbackType m_UpdateInformationCallback
WholeExtentCallbackType m_WholeExtentCallback
FloatOriginCallbackType m_FloatOriginCallback
typename OutputImageType::RegionType OutputRegionType
BufferPointerCallbackType m_BufferPointerCallback
typename OutputImageType::PixelType OutputPixelType
DirectionCallbackType m_DirectionCallback
int(*)(void *) NumberOfComponentsCallbackType
void UpdateOutputInformation() override
Update the information describing the output data.
itkSetMacro2(CallbackUserData, void *)
TOutputImage OutputImageType
FloatSpacingCallbackType m_FloatSpacingCallback
float *(*)(void *) FloatOriginCallbackType
int *(*)(void *) DataExtentCallbackType
void(*)(void *) UpdateInformationCallbackType
int *(*)(void *) WholeExtentCallbackType
ImageSource< TOutputImage > Superclass
void SetSpacingCallback(FloatSpacingCallbackType f)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....