19 #ifndef __itkFreeSurferBinaryMeshIO_h
20 #define __itkFreeSurferBinaryMeshIO_h
21 #include "ITKIOMeshExport.h"
63 virtual bool CanReadFile(
const char *FileNameToRead);
66 virtual void ReadMeshInformation();
69 virtual void ReadPoints(
void *buffer);
71 virtual void ReadCells(
void *buffer);
73 virtual void ReadPointData(
void *buffer);
75 virtual void ReadCellData(
void *buffer);
84 virtual bool CanWriteFile(
const char *FileNameToWrite);
87 virtual void WriteMeshInformation();
91 virtual void WritePoints(
void *buffer);
93 virtual void WriteCells(
void *buffer);
95 virtual void WritePointData(
void *buffer);
97 virtual void WriteCellData(
void *buffer);
103 template<
typename T >
106 float *data =
new float[this->m_NumberOfPoints * this->m_PointDimension];
108 for (
SizeValueType ii = 0; ii < this->m_NumberOfPoints; ii++ )
110 for (
unsigned int jj = 0; jj < this->m_PointDimension; jj++ )
112 data[ii * this->m_PointDimension + jj] =
static_cast< float >( buffer[ii * this->m_PointDimension + jj] );
121 template<
typename T >
128 ReadCellsBuffer(buffer, data);
135 template<
typename TInput,
typename TOutput >
138 if ( input && output )
140 for (
SizeValueType ii = 0; ii < this->m_NumberOfCells; ii++ )
142 for (
unsigned int jj = 0; jj < 3; jj++ )
147 output[ii * 3 + jj] =
static_cast< TOutput
>( input[5 * ii + jj + 2] );
154 template<
typename T >
157 float *data =
new float[this->m_NumberOfPointPixels];
159 for (
SizeValueType ii = 0; ii < this->m_NumberOfPointPixels; ii++ )
161 data[ii] =
static_cast< float >( buffer[ii] );
172 void PrintSelf(std::ostream & os,
Indent indent)
const;
180 void operator=(
const Self &);
FreeSurferBinaryMeshIO Self
virtual ~FreeSurferBinaryMeshIO()
SmartPointer< const Self > ConstPointer
Light weight base class for most itk classes.
std::streamoff StreamOffsetType
std::ifstream m_InputFile
unsigned long SizeValueType
SmartPointer< Self > Pointer
void WritePoints(T *buffer, std::ofstream &outputFile)
void WritePointData(T *buffer, std::ofstream &outputFile)
StreamOffsetType m_FilePosition
Superclass::StreamOffsetType StreamOffsetType
itk::uint32_t m_FileTypeIdentifier
void WriteCells(T *buffer, std::ofstream &outputFile)
Superclass::SizeValueType SizeValueType
typedef::itksysFundamentalType_UInt32 uint32_t
void ReadCellsBuffer(TInput *input, TOutput *output)
Control indentation during Print() invocation.
static void SwapWriteRangeFromSystemToBigEndian(T *p, int num, OStreamType *fp)
This class defins how to read Freesurfer binary surface file format. To use IO factory, define the suffix as *.fsb.
Abstract superclass defines mesh IO interface.