ITK  4.4.0
Insight Segmentation and Registration Toolkit
itkHDF5TransformIO.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 __itkHDF5TransformIO_h
19 #define __itkHDF5TransformIO_h
20 #include "itkTransformIOBase.h"
21 
22 #include <string>
23 
24 // Avoids KWStyle error from forward declaration below.
25 namespace itk
26 {
27 }
28 
29 // Forward declaration of class H5::H5File
30 namespace H5
31 {
32 class H5File;
33 }
34 
35 namespace itk
36 {
47 {
48 public:
57  itkTypeMacro(HDF5TransformIO, TransformIOBase);
58  itkNewMacro(Self);
60 
63  virtual bool CanReadFile(const char *);
64 
67  virtual bool CanWriteFile(const char *);
68 
70  virtual void Read();
71 
75  virtual void Write();
76 
77 protected:
79  virtual ~HDF5TransformIO();
80 
81 private:
83  ParametersType ReadParameters(const std::string &DataSetName);
84 
86  void WriteParameters(const std::string &name,
87  const ParametersType &parameters);
88 
90  void WriteString(const std::string &path, const std::string &value);
91  void WriteString(const std::string &path, const char *value);
92  void WriteOneTransform(const int transformIndex,
93  const TransformType *transform);
95 
96  H5::H5File *m_H5File;
97 };
98 }
99 #endif // __itkHDF5TransformIO_h
100