ITK
4.3.0
Insight Segmentation and Registration Toolkit
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
ITK
Modules
IO
CSV
include
itkCSVNumericObjectFileWriter.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
19
#ifndef __itkCSVNumericObjectFileWriter_h
20
#define __itkCSVNumericObjectFileWriter_h
21
22
#include "
itkLightProcessObject.h
"
23
#include "
itkMacro.h
"
24
#include "
itkArray2D.h
"
25
#include "vnl/vnl_matrix.h"
26
#include "vnl/vnl_matrix_fixed.h"
27
#include "
itkMatrix.h
"
28
#include <vector>
29
#include "
itkSize.h
"
30
31
namespace
itk
32
{
60
template
<
class
TValueType,
unsigned
int
NRows = 0,
unsigned
int
NColumns = 0>
61
class
ITK_EXPORT
CSVNumericObjectFileWriter
:
public
LightProcessObject
62
{
63
public
:
65
typedef
CSVNumericObjectFileWriter
Self
;
66
typedef
LightProcessObject
Superclass
;
67
typedef
SmartPointer <Self>
Pointer
;
68
typedef
SmartPointer <const Self>
ConstPointer
;
69
71
itkNewMacro(
Self
);
72
74
itkTypeMacro(
Self
,
Superclass
);
75
76
// Matrix types
77
typedef
vnl_matrix<TValueType>
vnlMatrixType
;
78
typedef
vnl_matrix_fixed<TValueType, NRows, NColumns>
vnlFixedMatrixType
;
79
typedef
itk::Matrix<TValueType,NRows,NColumns>
itkMatrixType
;
80
81
typedef
std::vector<std::string>
StringVectorType
;
82
83
typedef
itk::Size<2>::SizeValueType
SizeValueType
;
84
85
/* Specify the name of the output file */
86
itkSetStringMacro(FileName);
87
itkSetMacro(FieldDelimiterCharacter,
char
);
88
90
void
SetInput(
const
vnlMatrixType
* obj);
91
93
void
SetInput(
const
vnlFixedMatrixType
* obj);
94
96
void
SetInput(
const
itkMatrixType
* obj);
97
98
void
ColumnHeadersPushBack(
const
std::string & );
99
void
RowHeadersPushBack(
const
std::string & );
100
void
SetColumnHeaders(
const
StringVectorType
& columnheaders);
101
void
SetRowHeaders(
const
StringVectorType
& rowheaders);
102
103
/* Checks that all essential components are plugged in */
104
void
PrepareForWriting();
105
107
virtual
void
Write();
108
111
virtual
void
Update();
112
113
protected
:
114
115
CSVNumericObjectFileWriter
();
116
virtual
~CSVNumericObjectFileWriter
() {}
117
void
PrintSelf(std::ostream &os,
Indent
indent)
const
;
118
119
private
:
120
std::string
m_FileName
;
121
TValueType *
m_InputObject
;
122
char
m_FieldDelimiterCharacter
;
123
SizeValueType
m_Rows
;
124
SizeValueType
m_Columns
;
125
StringVectorType
m_ColumnHeaders
;
126
StringVectorType
m_RowHeaders
;
127
128
CSVNumericObjectFileWriter
(
const
Self
&);
//purposely not implemented
129
void
operator=(
const
Self
&);
//purposely not implemented
130
};
131
132
}
//end namespace itk
133
134
#ifndef ITK_MANUAL_INSTANTIATION
135
#include "itkCSVNumericObjectFileWriter.hxx"
136
#endif
137
138
#endif
139
Generated on Sun Dec 9 2012 00:54:45 for ITK by
1.8.2