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 "itkMacro.h"
22#include "itkImageSource.h"
24
25#ifndef ITK_LEGACY_REMOVE
26// This macro is intended to be removed from ITK 6. Please use `itkSetMacro` instead!
27# define itkSetMacro2(name, type) \
28 virtual void Set##name(type _arg) \
29 { \
30 itkDebugMacro("setting " #name " to " << _arg); \
31 if (this->m_##name != _arg) \
32 { \
33 this->m_##name = _arg; \
34 this->Modified(); \
35 } \
36 } \
37 ITK_MACROEND_NOOP_STATEMENT
38#endif
39
40namespace itk
41{
61template <typename TOutputImage>
62class ITK_TEMPLATE_EXPORT VTKImageImport : public ImageSource<TOutputImage>
63{
64public:
65 ITK_DISALLOW_COPY_AND_MOVE(VTKImageImport);
66
71
73 itkNewMacro(Self);
74
76 itkOverrideGetNameOfClassMacro(VTKImageImport);
77
79 using OutputImageType = TOutputImage;
80 using OutputImagePointer = typename OutputImageType::Pointer;
81 using OutputPixelType = typename OutputImageType::PixelType;
82 using OutputSizeType = typename OutputImageType::SizeType;
83 using OutputIndexType = typename OutputImageType::IndexType;
84 using OutputRegionType = typename OutputImageType::RegionType;
85
87 static constexpr unsigned int OutputImageDimension = OutputImageType::ImageDimension;
88
92 using UpdateInformationCallbackType = void (*)(void *);
93 using PipelineModifiedCallbackType = int (*)(void *);
94 using WholeExtentCallbackType = int * (*)(void *);
95 using SpacingCallbackType = double * (*)(void *);
96 using OriginCallbackType = double * (*)(void *);
97 using DirectionCallbackType = double * (*)(void *);
98 using ScalarTypeCallbackType = const char * (*)(void *);
99 using NumberOfComponentsCallbackType = int (*)(void *);
100 using PropagateUpdateExtentCallbackType = void (*)(void *, int *);
101 using UpdateDataCallbackType = void (*)(void *);
102 using DataExtentCallbackType = int * (*)(void *);
103 using BufferPointerCallbackType = void * (*)(void *);
107 using FloatSpacingCallbackType = float * (*)(void *);
108 using FloatOriginCallbackType = float * (*)(void *);
112 itkSetMacro(UpdateInformationCallback, UpdateInformationCallbackType);
113 itkGetConstMacro(UpdateInformationCallback, UpdateInformationCallbackType);
117 itkSetMacro(PipelineModifiedCallback, PipelineModifiedCallbackType);
118 itkGetConstMacro(PipelineModifiedCallback, PipelineModifiedCallbackType);
122 itkSetMacro(WholeExtentCallback, WholeExtentCallbackType);
123 itkGetConstMacro(WholeExtentCallback, WholeExtentCallbackType);
127 itkSetMacro(SpacingCallback, SpacingCallbackType);
128 itkGetConstMacro(SpacingCallback, SpacingCallbackType);
129 itkSetMacro(FloatSpacingCallback, FloatSpacingCallbackType);
130 itkGetConstMacro(FloatSpacingCallback, FloatSpacingCallbackType);
131 void
136
139 itkSetMacro(OriginCallback, OriginCallbackType);
140 itkGetConstMacro(OriginCallback, OriginCallbackType);
141 itkSetMacro(FloatOriginCallback, FloatOriginCallbackType);
142 itkGetConstMacro(FloatOriginCallback, FloatOriginCallbackType);
143 void
148
151 itkSetMacro(DirectionCallback, DirectionCallbackType);
152 itkGetConstMacro(DirectionCallback, DirectionCallbackType);
156 itkSetMacro(ScalarTypeCallback, ScalarTypeCallbackType);
157 itkGetConstMacro(ScalarTypeCallback, ScalarTypeCallbackType);
161 itkSetMacro(NumberOfComponentsCallback, NumberOfComponentsCallbackType);
162 itkGetConstMacro(NumberOfComponentsCallback, NumberOfComponentsCallbackType);
166 itkSetMacro(PropagateUpdateExtentCallback, PropagateUpdateExtentCallbackType);
167 itkGetConstMacro(PropagateUpdateExtentCallback, PropagateUpdateExtentCallbackType);
171 itkSetMacro(UpdateDataCallback, UpdateDataCallbackType);
172 itkGetConstMacro(UpdateDataCallback, UpdateDataCallbackType);
176 itkSetMacro(DataExtentCallback, DataExtentCallbackType);
177 itkGetConstMacro(DataExtentCallback, DataExtentCallbackType);
181 itkSetMacro(BufferPointerCallback, BufferPointerCallbackType);
182 itkGetConstMacro(BufferPointerCallback, BufferPointerCallbackType);
186 itkSetMacro(CallbackUserData, void *);
187 itkGetConstMacro(CallbackUserData, void *);
189protected:
191 ~VTKImageImport() override = default;
192 void
193 PrintSelf(std::ostream & os, Indent indent) const override;
194
195 void
197
198 void
200
201 void
202 GenerateData() override;
203
204 void
206
207private:
208 void * m_CallbackUserData{ nullptr };
223
224 std::string m_ScalarTypeName{};
225};
226} // namespace itk
227
228#ifndef ITK_MANUAL_INSTANTIATION
229# include "itkVTKImageImport.hxx"
230#endif
231
232#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.
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....