ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkMINCTransformIO.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 itkMINCTransformIO_h
19#define itkMINCTransformIO_h
20
21#include "ITKIOTransformMINCExport.h"
22
23#include "itkTransformIOBase.h"
24
25#include <string>
26#include <vector>
27#include <itk_minc2.h>
29
30namespace itk
31{
32
44template <typename TParametersValueType>
45class ITK_TEMPLATE_EXPORT MINCTransformIOTemplate : public TransformIOBaseTemplate<TParametersValueType>
46{
47public:
52
53 using typename Superclass::TransformType;
54 using typename Superclass::TransformPointer;
55 using typename Superclass::TransformListType;
58
60
63
65 itkOverrideGetNameOfClassMacro(MINCTransformIOTemplate);
66 itkNewMacro(Self);
67
70 bool
71 CanReadFile(const char * fileName) override;
72
75 bool
76 CanWriteFile(const char * fileName) override;
77
79 void
80 Read() override;
81
82 void
83 Write() override;
84
87 itkSetMacro(RAStoLPS, bool);
88 itkGetConstMacro(RAStoLPS, bool);
89 itkBooleanMacro(RAStoLPS);
90
91protected:
94
95 VIO_General_transform m_XFM{};
97
98private:
99 void
101 void
102 WriteOneTransform(const int transformIndex,
103 const TransformType * transform,
104 std::vector<VIO_General_transform> & _xfm,
105 const char * xfm_file_base,
106 int & serial);
107
108 void
109 ReadOneTransform(VIO_General_transform * xfm);
111};
112
115
116} // end namespace itk
117
118// Note: Explicit instantiation is done in itkMINCTransformIO.cxx
119
120#endif // itkMINCTransformIO_h
121
123#ifndef ITK_TEMPLATE_EXPLICIT_MINCTransformIO
124// Explicit instantiation is required to ensure correct dynamic_cast
125// behavior across shared libraries.
126//
127// IMPORTANT: Since within the same compilation unit,
128// ITK_TEMPLATE_EXPLICIT_<classname> defined and undefined states
129// need to be considered. This code *MUST* be *OUTSIDE* the header
130// guards.
131//
132#if defined(ITKIOTransformMINC_EXPORTS)
133// We are building this library
134# define ITKIOTransformMINC_EXPORT_EXPLICIT ITK_FORWARD_EXPORT
135#else
136// We are using this library
137# define ITKIOTransformMINC_EXPORT_EXPLICIT ITKIOTransformMINC_EXPORT
138#endif
139namespace itk
140{
141
142ITK_GCC_PRAGMA_DIAG_PUSH()
143ITK_GCC_PRAGMA_DIAG(ignored "-Wattributes")
144
147
148ITK_GCC_PRAGMA_DIAG_POP()
149
150} // end namespace itk
151#undef ITKIOTransformMINC_EXPORT_EXPLICIT
152#endif
Read and write transforms in MINC format (.xfm). Takes into account PositiveCoordinateOrientation RAS...
TransformBaseTemplate< ParametersValueType > TransformType
typename MatrixOffsetTransformBaseType::OffsetType OffsetType
bool CanReadFile(const char *fileName) override
MINCTransformIOTemplate Self
void WriteOneTransform(const int transformIndex, const TransformType *transform, std::vector< VIO_General_transform > &_xfm, const char *xfm_file_base, int &serial)
typename MatrixOffsetTransformBaseType::MatrixType MatrixType
bool CanWriteFile(const char *fileName) override
typename TransformType::ParametersType ParametersType
SmartPointer< const Self > ConstPointer
TransformIOBaseTemplate< TParametersValueType > Superclass
MatrixOffsetTransformBase< TParametersValueType, 3, 3 > MatrixOffsetTransformBaseType
void ReadOneTransform(VIO_General_transform *xfm)
Matrix and Offset transformation of a vector space (e.g. space coordinates)
Matrix< TParametersValueType, Self::OutputSpaceDimension, Self::InputSpaceDimension > MatrixType
Implements transparent reference counting.
OptimizerParameters< ParametersValueType > ParametersType
TransformBaseTemplate< ParametersValueType > TransformType
typename TransformType::Pointer TransformPointer
std::list< TransformPointer > TransformListType
std::list< ConstTransformPointer > ConstTransformListType
#define ITKIOTransformMINC_EXPORT_EXPLICIT
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
template class ITKIOTransformMINC_EXPORT_EXPLICIT MINCTransformIOTemplate< float >
MINCTransformIOTemplate< double > MINCTransformIO
template class ITKIOTransformMINC_EXPORT_EXPLICIT MINCTransformIOTemplate< double >
#define itkSetMacro(name, type)