19#ifndef itkFreeSurferBinaryMeshIO_h
20#define itkFreeSurferBinaryMeshIO_h
21#include "ITKIOMeshFreeSurferExport.h"
119 template <
typename T>
123 const auto data = make_unique_for_overwrite<float[]>(this->m_NumberOfPoints * this->m_PointDimension);
125 for (
SizeValueType ii = 0; ii < this->m_NumberOfPoints; ++ii)
127 for (
unsigned int jj = 0; jj < this->m_PointDimension; ++jj)
129 data[ii * this->m_PointDimension + jj] =
static_cast<float>(buffer[ii * this->m_PointDimension + jj]);
134 data.get(), this->m_NumberOfPoints * this->m_PointDimension, &outputFile);
138 template <
typename T>
142 constexpr itk::uint32_t numberOfCellPoints = 3;
144 const auto data = make_unique_for_overwrite<itk::uint32_t[]>(this->m_NumberOfCells * numberOfCellPoints);
146 ReadCellsBuffer(buffer, data.get());
148 data.get(), this->m_NumberOfCells * numberOfCellPoints, &outputFile);
152 template <
typename TInput,
typename TOutput>
160 for (
unsigned int jj = 0; jj < 3; ++jj)
165 output[ii * 3 + jj] =
static_cast<TOutput
>(input[5 * ii + jj + 2]);
172 template <
typename T>
176 const auto data = make_unique_for_overwrite<float[]>(this->m_NumberOfPointPixels);
178 for (
SizeValueType ii = 0; ii < this->m_NumberOfPointPixels; ++ii)
180 data[ii] =
static_cast<float>(buffer[ii]);
201 itk::uint32_t m_FileTypeIdentifier{ 0 };
202 std::ifstream m_InputFile{};
static void SwapWriteRangeFromSystemToBigEndian(const T *p, int num, std::ostream *fp)
This class defines how to read Freesurfer binary surface file format. To use IO factory,...
~FreeSurferBinaryMeshIO() override
void WritePoints(T *buffer, std::ofstream &outputFile)
void PrintSelf(std::ostream &os, Indent indent) const override
void ReadMeshInformation() override
void ReadCells(void *buffer) override
void WriteMeshInformation() override
void ReadPoints(void *buffer) override
void WriteCellData(void *buffer) override
void ReadCellData(void *buffer) override
void WritePoints(void *buffer) override
void WriteCells(T *buffer, std::ofstream &outputFile)
void WriteCells(void *buffer) override
void ReadCellsBuffer(TInput *input, TOutput *output)
void WritePointData(T *buffer, std::ofstream &outputFile)
bool CanReadFile(const char *fileName) override
void ReadPointData(void *buffer) override
void WritePointData(void *buffer) override
bool CanWriteFile(const char *fileName) override
Control indentation during Print() invocation.
Light weight base class for most itk classes.
Abstract superclass defines mesh IO interface.
IdentifierType SizeValueType
std::streamoff StreamOffsetType
Base class for most ITK classes.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
unsigned long SizeValueType