ITK  4.8.0
Insight Segmentation and Registration Toolkit
itkTxtTransformIO.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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  * http://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 itkTxtTransformIO_h
19 #define itkTxtTransformIO_h
20 #include "itkTransformIOBase.h"
21 
22 namespace itk
23 {
28 template<typename TParametersValueType>
29 class TxtTransformIOTemplate:public TransformIOBaseTemplate<TParametersValueType>
30 {
31 public:
38  typedef typename TransformIOBaseTemplate<
39  TParametersValueType>::ConstTransformListType
41 
43  itkTypeMacro(TxtTransformIOTemplate, Superclass);
44  itkNewMacro(Self);
46 
49  virtual bool CanReadFile(const char *) ITK_OVERRIDE;
50 
53  virtual bool CanWriteFile(const char *) ITK_OVERRIDE;
54 
56  virtual void Read() ITK_OVERRIDE;
57 
61  virtual void Write() ITK_OVERRIDE;
62 
63  /* Helper function for Read method, used for CompositeTransform reading. */
64  void ReadComponentFile( std::string Value );
65 
66 protected:
68  virtual ~TxtTransformIOTemplate();
69 
70 private:
72  std::string trim(std::string const & source, char const *delims = " \t\r\n");
73 };
74 
76 typedef TxtTransformIOTemplate<double> TxtTransformIO;
77 
78 }
79 
80 #ifndef ITK_MANUAL_INSTANTIATION
81 #include "itkTxtTransformIO.hxx"
82 #endif
83 
84 #endif // itkTxtTransformIO_h
Light weight base class for most itk classes.
virtual bool CanWriteFile(const char *) override
SmartPointer< Self > Pointer
std::string trim(std::string const &source, char const *delims=" \t\r\n")
virtual void Read() override
virtual bool CanReadFile(const char *) override
virtual void Write() override
Superclass::TransformPointer TransformPointer
Abstract superclass defining the Transform IO interface.
void ReadComponentFile(std::string Value)
TxtTransformIOTemplate Self
TransformType::Pointer TransformPointer
Superclass::TransformType TransformType
std::list< TransformPointer > TransformListType
TransformBaseTemplate< ParametersValueType > TransformType
std::list< ConstTransformPointer > ConstTransformListType
TransformIOBaseTemplate< TParametersValueType >::ConstTransformListType ConstTransformListType
TransformIOBaseTemplate< TParametersValueType > Superclass
Superclass::TransformListType TransformListType
Base class for most ITK classes.
Definition: itkObject.h:57
Create instances of TxtTransformIOTemplate objects.