19 #ifndef itkFreeSurferBinaryMeshIO_h
20 #define itkFreeSurferBinaryMeshIO_h
21 #include "ITKIOMeshFreeSurferExport.h"
66 CanReadFile(
const char *
fileName)
override;
70 ReadMeshInformation()
override;
74 ReadPoints(
void * buffer)
override;
77 ReadCells(
void * buffer)
override;
80 ReadPointData(
void * buffer)
override;
83 ReadCellData(
void * buffer)
override;
93 CanWriteFile(
const char *
fileName)
override;
97 WriteMeshInformation()
override;
102 WritePoints(
void * buffer)
override;
105 WriteCells(
void * buffer)
override;
108 WritePointData(
void * buffer)
override;
111 WriteCellData(
void * buffer)
override;
118 template <
typename T>
122 auto * data =
new float[this->m_NumberOfPoints * this->m_PointDimension];
124 for (
SizeValueType ii = 0; ii < this->m_NumberOfPoints; ii++)
126 for (
unsigned int jj = 0; jj < this->m_PointDimension; jj++)
128 data[ii * this->m_PointDimension + jj] = static_cast<float>(buffer[ii * this->m_PointDimension + jj]);
133 data, this->m_NumberOfPoints * this->m_PointDimension, &outputFile);
138 template <
typename T>
144 auto * data =
new itk::uint32_t[this->m_NumberOfCells * numberOfCellPoints];
146 ReadCellsBuffer(buffer, data);
148 data, this->m_NumberOfCells * numberOfCellPoints, &outputFile);
154 template <
typename TInput,
typename TOutput>
162 for (
unsigned int jj = 0; jj < 3; jj++)
167 output[ii * 3 + jj] = static_cast<TOutput>(input[5 * ii + jj + 2]);
174 template <
typename T>
178 auto * data =
new float[this->m_NumberOfPointPixels];
180 for (
SizeValueType ii = 0; ii < this->m_NumberOfPointPixels; ii++)
182 data[ii] = static_cast<float>(buffer[ii]);
194 PrintSelf(std::ostream & os,
Indent indent)
const override;