19 #ifndef itkFreeSurferAsciiMeshIO_h
20 #define itkFreeSurferAsciiMeshIO_h
21 #include "ITKIOMeshFreeSurferExport.h"
63 CanReadFile(
const char *
fileName)
override;
67 ReadMeshInformation()
override;
71 ReadPoints(
void * buffer)
override;
74 ReadCells(
void * buffer)
override;
77 ReadPointData(
void * buffer)
override;
80 ReadCellData(
void * buffer)
override;
90 CanWriteFile(
const char *
fileName)
override;
94 WriteMeshInformation()
override;
99 WritePoints(
void * buffer)
override;
102 WriteCells(
void * buffer)
override;
105 WritePointData(
void * buffer)
override;
108 WriteCellData(
void * buffer)
override;
115 template <
typename T>
119 outputFile.precision(6);
121 for (
SizeValueType ii = 0; ii < this->m_NumberOfPoints; ii++)
123 for (
unsigned int jj = 0; jj < this->m_PointDimension; jj++)
125 outputFile << std::fixed << buffer[index++] <<
" ";
127 outputFile << label <<
'\n';
132 template <
typename T>
136 constexpr
unsigned int numberOfCellPoints = 3;
139 auto * data =
new T[this->m_NumberOfCells * numberOfCellPoints];
141 ReadCellsBuffer(buffer, data);
145 for (
unsigned int jj = 0; jj < numberOfCellPoints; jj++)
147 outputFile << data[index++] <<
" ";
149 outputFile << label <<
'\n';
155 template <
typename TInput,
typename TOutput>
163 for (
unsigned int jj = 0; jj < 3; jj++)
168 output[ii * 3 + jj] = static_cast<TOutput>(input[5 * ii + jj + 2]);
178 PrintSelf(std::ostream & os,
Indent indent)
const override;