18#ifndef itkMetaArrayWriter_h
19#define itkMetaArrayWriter_h
20#include "ITKIOMetaExport.h"
47 itkSetStringMacro(FileName);
48 itkGetStringMacro(FileName);
53 itkSetStringMacro(DataFileName);
54 itkGetStringMacro(DataFileName);
61 itkBooleanMacro(Binary);
62 itkSetMacro(Binary,
bool);
63 itkGetConstMacro(Binary,
bool);
67 template <
typename TValue>
71 m_Buffer = (
const void *)(_array->data_block());
72 m_MetaArray.InitializeEssential(_array->
Size(), _metaElementType);
77 template <
typename TValue,
unsigned int VLength>
82 m_MetaArray.InitializeEssential(VLength, _metaElementType);
87 template <
typename TValue,
unsigned int VLength>
92 m_MetaArray.InitializeEssential(VLength, _metaElementType);
97 template <
typename TValue,
unsigned int VLength>
102 m_MetaArray.InitializeEssential(VLength, _metaElementType);
107 template <
typename TValue>
111 m_Buffer = (
const void *)(_vector->GetDataPointer());
112 m_MetaArray.InitializeEssential(_vector->Size(), _metaElementType);
123 template <
typename TValue>
128 int cols = (*_array)[0].GetSize();
131 m_MetaArray.InitializeEssential(rows, _metaElementType, cols,
nullptr,
true,
true);
132 m_Buffer = m_MetaArray.ElementData();
133 for (
int i = 0; i < rows; ++i)
135 for (
int j = 0; j < cols; ++j)
137 m_MetaArray.ElementData(i * cols + j,
static_cast<double>((*_array)[i][j]));
143 itkSetMacro(Precision,
unsigned int);
144 itkGetConstMacro(Precision,
unsigned int);
162 bool m_Binary{
false };
164 unsigned int m_Precision{ 6 };
166 std::string m_FileName{};
167 std::string m_DataFileName{};
169 MetaArray m_MetaArray{};
171 const void * m_Buffer{
nullptr };
Array class with size defined at construction time.
SizeValueType Size() const
SizeValueType GetSize() const
A templated class holding a n-Dimensional covariant vector.
Simulate a standard C array with copy semantics.
ValueType * GetDataPointer()
Control indentation during Print() invocation.
Light weight base class for most itk classes.
LightProcessObject is the base class for all process objects (source, filters, mappers) in the Insigh...
Base class for most ITK classes.
A templated class holding a n-Dimensional vector.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....