ITK  5.1.0
Insight Segmentation and Registration Toolkit
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes | List of all members

#include <itkFreeSurferAsciiMeshIO.h>

+ Inheritance diagram for itk::FreeSurferAsciiMeshIO:
+ Collaboration diagram for itk::FreeSurferAsciiMeshIO:

Public Types

using ConstPointer = SmartPointer< const Self >
 
using Pointer = SmartPointer< Self >
 
using Self = FreeSurferAsciiMeshIO
 
using SizeValueType = Superclass::SizeValueType
 
using Superclass = MeshIOBase
 
- Public Types inherited from itk::MeshIOBase
using ArrayOfExtensionsType = std::vector< std::string >
 
enum  ByteOrder {
  BigEndian,
  LittleEndian,
  OrderNotApplicable
}
 
enum  CellGeometryType {
  VERTEX_CELL = 0,
  LINE_CELL,
  TRIANGLE_CELL,
  QUADRILATERAL_CELL,
  POLYGON_CELL,
  TETRAHEDRON_CELL,
  HEXAHEDRON_CELL,
  QUADRATIC_EDGE_CELL,
  QUADRATIC_TRIANGLE_CELL,
  LAST_ITK_CELL,
  MAX_ITK_CELLS = 255
}
 
using ConstPointer = SmartPointer< const Self >
 
enum  FileType {
  ASCII,
  BINARY,
  TYPENOTAPPLICABLE
}
 
enum  IOComponentType {
  UNKNOWNCOMPONENTTYPE,
  UCHAR,
  CHAR,
  USHORT,
  SHORT,
  UINT,
  INT,
  ULONG,
  LONG,
  LONGLONG,
  ULONGLONG,
  FLOAT,
  DOUBLE,
  LDOUBLE
}
 
enum  IOPixelType {
  UNKNOWNPIXELTYPE,
  SCALAR,
  RGB,
  RGBA,
  OFFSET,
  VECTOR,
  POINT,
  COVARIANTVECTOR,
  SYMMETRICSECONDRANKTENSOR,
  DIFFUSIONTENSOR3D,
  COMPLEX,
  FIXEDARRAY,
  ARRAY,
  MATRIX,
  VARIABLELENGTHVECTOR,
  VARIABLESIZEMATRIX
}
 
using Pointer = SmartPointer< Self >
 
using Self = MeshIOBase
 
using SizeValueType = IdentifierType
 
using StreamOffsetType = std::streamoff
 
using Superclass = LightProcessObject
 
- Public Types inherited from itk::LightProcessObject
using ConstPointer = SmartPointer< const Self >
 
using Pointer = SmartPointer< Self >
 
using Self = LightProcessObject
 
using Superclass = Object
 
- Public Types inherited from itk::Object
using ConstPointer = SmartPointer< const Self >
 
using Pointer = SmartPointer< Self >
 
using Self = Object
 
using Superclass = LightObject
 
- Public Types inherited from itk::LightObject
using ConstPointer = SmartPointer< const Self >
 
using Pointer = SmartPointer< Self >
 
using Self = LightObject
 

Public Member Functions

bool CanReadFile (const char *FileNameToRead) override
 
bool CanWriteFile (const char *FileNameToWrite) override
 
virtual ::itk::LightObject::Pointer CreateAnother () const
 
virtual const char * GetNameOfClass () const
 
void ReadCellData (void *buffer) override
 
void ReadCells (void *buffer) override
 
void ReadMeshInformation () override
 
void ReadPointData (void *buffer) override
 
void ReadPoints (void *buffer) override
 
void Write () override
 
void WriteCellData (void *buffer) override
 
void WriteCells (void *buffer) override
 
void WriteMeshInformation () override
 
void WritePointData (void *buffer) override
 
void WritePoints (void *buffer) override
 
- Public Member Functions inherited from itk::MeshIOBase
std::string GetByteOrderAsString (ByteOrder) const
 
unsigned int GetComponentSize (IOComponentType componentType) const
 
std::string GetComponentTypeAsString (IOComponentType) const
 
std::string GetFileTypeAsString (FileType) const
 
std::string GetPixelTypeAsString (IOPixelType) const
 
const ArrayOfExtensionsTypeGetSupportedReadExtensions () const
 
const ArrayOfExtensionsTypeGetSupportedWriteExtensions () const
 
void SetByteOrderToBigEndian ()
 
void SetByteOrderToLittleEndian ()
 
void SetFileTypeToASCII ()
 
void SetFileTypeToBinary ()
 
template<typename T >
void SetPixelType (const T &, bool UsePointPixel=true)
 
template<typename T >
void SetPixelType (const RGBPixel< T > &, bool UsePointPixel=true)
 
template<typename T >
void SetPixelType (const RGBAPixel< T > &, bool UsePointPixel=true)
 
template<typename T , unsigned int VLength>
void SetPixelType (const Vector< T, VLength > &, bool UsePointPixel=true)
 
template<typename T , unsigned int VLength>
void SetPixelType (const CovariantVector< T, VLength > &, bool UsePointPixel=true)
 
template<typename T , unsigned int VLength>
void SetPixelType (const FixedArray< T, VLength > &, bool UsePointPixel=true)
 
template<typename T , unsigned int VLength>
void SetPixelType (const SymmetricSecondRankTensor< T, VLength >, bool UsePointPixel=true)
 
template<typename T >
void SetPixelType (const DiffusionTensor3D< T > &, bool UsePointPixel=true)
 
template<typename T , unsigned int NR, unsigned int NC>
void SetPixelType (const Matrix< T, NR, NC > &, bool UsePointPixel=true)
 
template<typename T >
void SetPixelType (const std::complex< T > &, bool UsePointPixel=true)
 
template<typename T >
void SetPixelType (const Array< T > &array, bool UsePointPixel=true)
 
template<typename T >
void SetPixelType (const VariableLengthVector< T > &vector, bool UsePointPixel=true)
 
template<typename T >
void SetPixelType (const VariableSizeMatrix< T > &matrix, bool UsePointPixel=true)
 
virtual void SetFileName (const char *_arg)
 
virtual const char * GetFileName () const
 
virtual void SetPointPixelType (const IOPixelType _arg)
 
virtual IOPixelType GetPointPixelType () const
 
virtual void SetCellPixelType (const IOPixelType _arg)
 
virtual IOPixelType GetCellPixelType () const
 
virtual void SetPointComponentType (const IOComponentType _arg)
 
virtual IOComponentType GetPointComponentType () const
 
virtual void SetCellComponentType (const IOComponentType _arg)
 
virtual IOComponentType GetCellComponentType () const
 
virtual void SetPointPixelComponentType (const IOComponentType _arg)
 
virtual IOComponentType GetPointPixelComponentType () const
 
virtual void SetCellPixelComponentType (const IOComponentType _arg)
 
virtual IOComponentType GetCellPixelComponentType () const
 
virtual void SetNumberOfPointPixelComponents (unsigned int _arg)
 
virtual unsigned int GetNumberOfPointPixelComponents () const
 
virtual void SetNumberOfCellPixelComponents (unsigned int _arg)
 
virtual unsigned int GetNumberOfCellPixelComponents () const
 
virtual void SetPointDimension (unsigned int _arg)
 
virtual unsigned int GetPointDimension () const
 
virtual void SetNumberOfPoints (SizeValueType _arg)
 
virtual SizeValueType GetNumberOfPoints () const
 
virtual void SetNumberOfCells (SizeValueType _arg)
 
virtual SizeValueType GetNumberOfCells () const
 
virtual void SetNumberOfPointPixels (SizeValueType _arg)
 
virtual SizeValueType GetNumberOfPointPixels () const
 
virtual void SetNumberOfCellPixels (SizeValueType _arg)
 
virtual SizeValueType GetNumberOfCellPixels () const
 
virtual void SetCellBufferSize (SizeValueType _arg)
 
virtual SizeValueType GetCellBufferSize () const
 
virtual void SetUpdatePoints (bool _arg)
 
virtual bool GetUpdatePoints () const
 
virtual void SetUpdateCells (bool _arg)
 
virtual bool GetUpdateCells () const
 
virtual void SetUpdatePointData (bool _arg)
 
virtual bool GetUpdatePointData () const
 
virtual void SetUpdateCellData (bool _arg)
 
virtual bool GetUpdateCellData () const
 
virtual void SetFileType (const FileType _arg)
 
virtual FileType GetFileType () const
 
virtual void SetByteOrder (const ByteOrder _arg)
 
virtual ByteOrder GetByteOrder () const
 
virtual void SetUseCompression (bool _arg)
 
virtual bool GetUseCompression () const
 
virtual void UseCompressionOn ()
 
virtual void UseCompressionOff ()
 
- Public Member Functions inherited from itk::LightProcessObject
virtual void AbortGenerateDataOff ()
 
virtual void AbortGenerateDataOn ()
 
virtual const bool & GetAbortGenerateData () const
 
virtual void SetAbortGenerateData (bool _arg)
 
virtual void UpdateOutputData ()
 
void UpdateProgress (float amount)
 
virtual void SetProgress (float _arg)
 
virtual const float & GetProgress () const
 
- Public Member Functions inherited from itk::Object
unsigned long AddObserver (const EventObject &event, Command *)
 
unsigned long AddObserver (const EventObject &event, Command *) const
 
virtual void DebugOff () const
 
virtual void DebugOn () const
 
CommandGetCommand (unsigned long tag)
 
bool GetDebug () const
 
MetaDataDictionaryGetMetaDataDictionary ()
 
const MetaDataDictionaryGetMetaDataDictionary () const
 
virtual ModifiedTimeType GetMTime () const
 
virtual const TimeStampGetTimeStamp () const
 
bool HasObserver (const EventObject &event) const
 
void InvokeEvent (const EventObject &)
 
void InvokeEvent (const EventObject &) const
 
virtual void Modified () const
 
void Register () const override
 
void RemoveAllObservers ()
 
void RemoveObserver (unsigned long tag)
 
void SetDebug (bool debugFlag) const
 
void SetReferenceCount (int) override
 
void UnRegister () const noexcept override
 
void SetMetaDataDictionary (const MetaDataDictionary &rhs)
 
void SetMetaDataDictionary (MetaDataDictionary &&rrhs)
 
virtual void SetObjectName (std::string _arg)
 
virtual const std::string & GetObjectName () const
 
- Public Member Functions inherited from itk::LightObject
virtual void Delete ()
 
virtual int GetReferenceCount () const
 
 itkCloneMacro (Self)
 
void Print (std::ostream &os, Indent indent=0) const
 

Static Public Member Functions

static Pointer New ()
 
- Static Public Member Functions inherited from itk::LightProcessObject
static Pointer New ()
 
- Static Public Member Functions inherited from itk::Object
static bool GetGlobalWarningDisplay ()
 
static void GlobalWarningDisplayOff ()
 
static void GlobalWarningDisplayOn ()
 
static Pointer New ()
 
static void SetGlobalWarningDisplay (bool flag)
 
- Static Public Member Functions inherited from itk::LightObject
static void BreakOnError ()
 
static Pointer New ()
 

Protected Member Functions

void CloseFile ()
 
 FreeSurferAsciiMeshIO ()
 
void OpenFile ()
 
void PrintSelf (std::ostream &os, Indent indent) const override
 
template<typename TInput , typename TOutput >
void ReadCellsBuffer (TInput *input, TOutput *output)
 
template<typename T >
void WriteCells (T *buffer, std::ofstream &outputFile, T label=itk::NumericTraits< T >::ZeroValue())
 
 ~FreeSurferAsciiMeshIO () override
 
template<typename T >
void WritePoints (T *buffer, std::ofstream &outputFile, T label=itk::NumericTraits< T >::ZeroValue())
 
- Protected Member Functions inherited from itk::MeshIOBase
void AddSupportedReadExtension (const char *extension)
 
void AddSupportedWriteExtension (const char *extension)
 
 MeshIOBase ()
 
template<typename T >
void ReadBufferAsBinary (T *buffer, std::ifstream &inputFile, SizeValueType numberOfComponents)
 
 ~MeshIOBase () override=default
 
template<typename T >
void ReadBufferAsAscii (T *buffer, std::ifstream &inputFile, SizeValueType numberOfComponents)
 
template<typename T >
void WriteBufferAsAscii (T *buffer, std::ofstream &outputFile, SizeValueType numberOfLines, SizeValueType numberOfComponents)
 
template<typename TOutput , typename TInput >
void WriteBufferAsBinary (TInput *buffer, std::ofstream &outputFile, SizeValueType numberOfComponents)
 
template<typename TInput , typename TOutput >
void ReadCellsBuffer (TInput *input, TOutput *output)
 
template<typename TInput , typename TOutput >
void ReadCellsBuffer (TInput *input, TOutput *output, MeshIOBase::CellGeometryType type)
 
template<typename TInput , typename TOutput >
void WriteCellsBuffer (TInput *input, TOutput *output, CellGeometryType cellType, unsigned int numberOfPoints, SizeValueType numberOfCells)
 
template<typename TInput , typename TOutput >
void WriteCellsBuffer (TInput *input, TOutput *output, CellGeometryType cellType, SizeValueType numberOfCells)
 
- Protected Member Functions inherited from itk::LightProcessObject
virtual void GenerateData ()
 
 LightProcessObject ()
 
 ~LightProcessObject () override
 
- Protected Member Functions inherited from itk::Object
 Object ()
 
bool PrintObservers (std::ostream &os, Indent indent) const
 
virtual void SetTimeStamp (const TimeStamp &time)
 
 ~Object () override
 
- Protected Member Functions inherited from itk::LightObject
virtual LightObject::Pointer InternalClone () const
 
 LightObject ()
 
virtual void PrintHeader (std::ostream &os, Indent indent) const
 
virtual void PrintTrailer (std::ostream &os, Indent indent) const
 
virtual ~LightObject ()
 

Private Attributes

std::ifstream m_InputFile
 

Additional Inherited Members

- Protected Attributes inherited from itk::MeshIOBase
ByteOrder m_ByteOrder {OrderNotApplicable}
 
SizeValueType m_CellBufferSize
 
IOComponentType m_CellComponentType {UNKNOWNCOMPONENTTYPE}
 
IOComponentType m_CellPixelComponentType {UNKNOWNCOMPONENTTYPE}
 
IOPixelType m_CellPixelType {SCALAR}
 
std::string m_FileName
 
FileType m_FileType {ASCII}
 
unsigned int m_NumberOfCellPixelComponents {0}
 
SizeValueType m_NumberOfCellPixels
 
SizeValueType m_NumberOfCells
 
unsigned int m_NumberOfPointPixelComponents {0}
 
SizeValueType m_NumberOfPointPixels
 
SizeValueType m_NumberOfPoints
 
IOComponentType m_PointComponentType {UNKNOWNCOMPONENTTYPE}
 
unsigned int m_PointDimension {3}
 
IOComponentType m_PointPixelComponentType {UNKNOWNCOMPONENTTYPE}
 
IOPixelType m_PointPixelType {SCALAR}
 
bool m_UpdateCellData {false}
 
bool m_UpdateCells {false}
 
bool m_UpdatePointData {false}
 
bool m_UpdatePoints {false}
 
bool m_UseCompression {false}
 
- Protected Attributes inherited from itk::LightObject
std::atomic< int > m_ReferenceCount
 

Detailed Description

This class defines how to read and write freesurfer ASCII surface format. To use IO factory, define the suffix as *.fsa.

Definition at line 36 of file itkFreeSurferAsciiMeshIO.h.

Member Typedef Documentation

◆ ConstPointer

Definition at line 45 of file itkFreeSurferAsciiMeshIO.h.

◆ Pointer

Definition at line 46 of file itkFreeSurferAsciiMeshIO.h.

◆ Self

Standard class type aliases.

Definition at line 43 of file itkFreeSurferAsciiMeshIO.h.

◆ SizeValueType

using itk::FreeSurferAsciiMeshIO::SizeValueType = Superclass::SizeValueType

Definition at line 48 of file itkFreeSurferAsciiMeshIO.h.

◆ Superclass

Definition at line 44 of file itkFreeSurferAsciiMeshIO.h.

Constructor & Destructor Documentation

◆ FreeSurferAsciiMeshIO()

itk::FreeSurferAsciiMeshIO::FreeSurferAsciiMeshIO ( )
protected

◆ ~FreeSurferAsciiMeshIO()

itk::FreeSurferAsciiMeshIO::~FreeSurferAsciiMeshIO ( )
overrideprotected

Member Function Documentation

◆ CanReadFile()

bool itk::FreeSurferAsciiMeshIO::CanReadFile ( const char *  FileNameToRead)
overridevirtual

Determine if the file can be read with this MeshIO implementation.

Parameters
FileNameToReadThe name of the file to test for reading.
Postcondition
Sets classes MeshIOBase::m_FileName variable to be FileNameToWrite
Returns
Returns true if this MeshIO can read the file specified.

Implements itk::MeshIOBase.

◆ CanWriteFile()

bool itk::FreeSurferAsciiMeshIO::CanWriteFile ( const char *  FileNameToWrite)
overridevirtual

Determine if the file can be written with this MeshIO implementation.

Parameters
FileNameToWriteThe name of the file to test for writing.
Postcondition
Sets classes MeshIOBase::m_FileName variable to be FileNameToWrite
Returns
Returns true if this MeshIO can write the file specified.

Implements itk::MeshIOBase.

◆ CloseFile()

void itk::FreeSurferAsciiMeshIO::CloseFile ( )
protected

◆ CreateAnother()

virtual::itk::LightObject::Pointer itk::FreeSurferAsciiMeshIO::CreateAnother ( ) const
virtual

Create an object from an instance, potentially deferring to a factory. This method allows you to create an instance of an object that is exactly the same type as the referring object. This is useful in cases where an object has been cast back to a base class.

Reimplemented from itk::LightProcessObject.

◆ GetNameOfClass()

virtual const char* itk::FreeSurferAsciiMeshIO::GetNameOfClass ( ) const
virtual

Run-time type information (and related methods).

Reimplemented from itk::MeshIOBase.

◆ New()

static Pointer itk::FreeSurferAsciiMeshIO::New ( )
static

Method for creation through the object factory.

◆ OpenFile()

void itk::FreeSurferAsciiMeshIO::OpenFile ( )
protected

◆ PrintSelf()

void itk::FreeSurferAsciiMeshIO::PrintSelf ( std::ostream &  os,
Indent  indent 
) const
overrideprotectedvirtual

Methods invoked by Print() to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from itk::MeshIOBase.

◆ ReadCellData()

void itk::FreeSurferAsciiMeshIO::ReadCellData ( void *  buffer)
overridevirtual

Implements itk::MeshIOBase.

◆ ReadCells()

void itk::FreeSurferAsciiMeshIO::ReadCells ( void *  buffer)
overridevirtual

Implements itk::MeshIOBase.

◆ ReadCellsBuffer()

template<typename TInput , typename TOutput >
void itk::FreeSurferAsciiMeshIO::ReadCellsBuffer ( TInput *  input,
TOutput *  output 
)
inlineprotected

Read cells from a data buffer, used when writting cells

point identifiers start from the third elements, first element is cellType, the second is numberOfPoints

Definition at line 142 of file itkFreeSurferAsciiMeshIO.h.

◆ ReadMeshInformation()

void itk::FreeSurferAsciiMeshIO::ReadMeshInformation ( )
overridevirtual

Set the spacing and dimension information for the set filename.

Implements itk::MeshIOBase.

◆ ReadPointData()

void itk::FreeSurferAsciiMeshIO::ReadPointData ( void *  buffer)
overridevirtual

Implements itk::MeshIOBase.

◆ ReadPoints()

void itk::FreeSurferAsciiMeshIO::ReadPoints ( void *  buffer)
overridevirtual

Reads the data from disk into the memory buffer provided.

Implements itk::MeshIOBase.

◆ Write()

void itk::FreeSurferAsciiMeshIO::Write ( )
overridevirtual

Implements itk::MeshIOBase.

◆ WriteCellData()

void itk::FreeSurferAsciiMeshIO::WriteCellData ( void *  buffer)
overridevirtual

Implements itk::MeshIOBase.

◆ WriteCells() [1/2]

void itk::FreeSurferAsciiMeshIO::WriteCells ( void *  buffer)
overridevirtual

Implements itk::MeshIOBase.

◆ WriteCells() [2/2]

template<typename T >
void itk::FreeSurferAsciiMeshIO::WriteCells ( T *  buffer,
std::ofstream &  outputFile,
label = itk::NumericTraits< T >::ZeroValue() 
)
inlineprotected

Definition at line 120 of file itkFreeSurferAsciiMeshIO.h.

◆ WriteMeshInformation()

void itk::FreeSurferAsciiMeshIO::WriteMeshInformation ( )
overridevirtual

Set the spacing and dimension information for the set filename.

Implements itk::MeshIOBase.

◆ WritePointData()

void itk::FreeSurferAsciiMeshIO::WritePointData ( void *  buffer)
overridevirtual

Implements itk::MeshIOBase.

◆ WritePoints() [1/2]

void itk::FreeSurferAsciiMeshIO::WritePoints ( void *  buffer)
overridevirtual

Writes the data to disk from the memory buffer provided. Make sure that the IORegions has been set properly.

Implements itk::MeshIOBase.

◆ WritePoints() [2/2]

template<typename T >
void itk::FreeSurferAsciiMeshIO::WritePoints ( T *  buffer,
std::ofstream &  outputFile,
label = itk::NumericTraits< T >::ZeroValue() 
)
inlineprotected

Write points to output stream

Definition at line 104 of file itkFreeSurferAsciiMeshIO.h.

Member Data Documentation

◆ m_InputFile

std::ifstream itk::FreeSurferAsciiMeshIO::m_InputFile
private

Definition at line 168 of file itkFreeSurferAsciiMeshIO.h.


The documentation for this class was generated from the following file: