ITK  6.0.0
Insight Toolkit
itkTransformFactoryBase.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 *
20 * Portions of this file are subject to the VTK Toolkit Version 3 copyright.
21 *
22 * Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
23 *
24 * For complete copyright, license and disclaimer of warranty information
25 * please refer to the NOTICE file at the top of the ITK source tree.
26 *
27 *=========================================================================*/
28#ifndef itkTransformFactoryBase_h
29#define itkTransformFactoryBase_h
30
32
33namespace itk
34{
41{
42public:
43 ITK_DISALLOW_COPY_AND_MOVE(TransformFactoryBase);
44
50
52 const char *
53 GetITKSourceVersion() const override;
54
55 const char *
56 GetDescription() const override;
57
59 itkOverrideGetNameOfClassMacro(TransformFactoryBase);
60
62 itkFactorylessNewMacro(Self);
63
65 static void
67
71
86 void
87 RegisterTransform(const char * classOverride,
88 const char * overrideClassName,
89 const char * description,
90 bool enableFlag,
91 CreateObjectFunctionBase * createFunction)
92 {
93
94 // Ensure there is only one transform registered by a name, this
95 // may happen on windows where this library is static, and the
96 // global init flag may not be unique.
97 LightObject::Pointer test = this->CreateInstance(classOverride);
98 if (test.IsNotNull())
99 {
100 itkDebugMacro("Refusing to register transform \"" << classOverride << "\" again!");
101 test->UnRegister();
102 }
103 else
104 {
105 this->RegisterOverride(classOverride, overrideClassName, description, enableFlag, createFunction);
106 }
107 }
108
109protected:
112
113private:
114 // Sub private functions of RegisterDefaultTransforms
115 static void
117 static void
119
120
121 // Called by the type specific methods
122 template <typename TParameterType>
123 static void
125
127};
128} // end namespace itk
129
130#endif
Define API for object creation callback functions.
Light weight base class for most itk classes.
Create instances of classes using an object factory.
static LightObject::Pointer CreateInstance(const char *itkclassname)
void RegisterOverride(const char *classOverride, const char *subclass, const char *description, bool enableFlag, CreateObjectFunctionBase *createFunction)
Create instances of Transforms.
~TransformFactoryBase() override
static void RegisterDefaultTransforms()
static void RegisterTransformFactoryFloatParameters()
static TransformFactoryBase * m_Factory
static void RegisterTransformFactory()
static TransformFactoryBase * GetFactory()
const char * GetITKSourceVersion() const override
static void RegisterTransformFactoryDoubleParameters()
void RegisterTransform(const char *classOverride, const char *overrideClassName, const char *description, bool enableFlag, CreateObjectFunctionBase *createFunction)
const char * GetDescription() const override
int test(char *inputFileName, char *outputFileName, bool isBinary)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....