template<typename TOutputMesh, typename ConvertPointPixelTraits = MeshConvertPixelTraits<typename TOutputMesh::PixelType>, typename ConvertCellPixelTraits = MeshConvertPixelTraits<typename TOutputMesh::CellPixelType>>
class itk::MeshFileReader< TOutputMesh, ConvertPointPixelTraits, ConvertCellPixelTraits >
Mesh source that reads mesh data from a single file.
This source object is a general filter to read data from a variety of file formats. It works with a MeshIOBase subclass to actually do the reading of the data. Object factory machinery can be used to automatically create the MeshIOBase, or the MeshIOBase can be manually created and set.
TOutputMesh is the type expected by the external users of the filter. If data stored in the file is stored in a different format then specified by TOutputMesh, than this filter converts data between the file type and the external expected type. The ConvertTraits template argument is used to do the conversion.
A Pluggable factory pattern is used this allows different kinds of readers to be registered (even at run time) without having to modify the code in this class. Normally just setting the FileName with the appropriate suffix is enough to get the reader to instantiate the correct MeshIO and read the file properly. However, some files have no accepted suffix, so you will have to manually create the MeshIO instance of the write type.
- See also
- MeshIOBase
- Author
- Wanlin Zhu. University of New South Wales, Australia.
- ITK Sphinx Examples:
-
- Examples
- SphinxExamples/src/Core/Mesh/ConvertTriangleMeshToBinaryImage/Code.cxx, SphinxExamples/src/Core/Mesh/TranslateOneMesh/Code.cxx, SphinxExamples/src/Core/QuadEdgeMesh/CutMesh/Code.cxx, SphinxExamples/src/Core/QuadEdgeMesh/GetListOfFacesAroundAGivenVertex/Code.cxx, SphinxExamples/src/Core/QuadEdgeMesh/PrintVertexNeighbors/Code.cxx, SphinxExamples/src/Filtering/FastMarching/ComputeGeodesicDistanceOnMesh/Code.cxx, SphinxExamples/src/Filtering/QuadEdgeMeshFiltering/CleanQuadEdgeMesh/Code.cxx, SphinxExamples/src/Filtering/QuadEdgeMeshFiltering/ComputeNormalsOfAMesh/Code.cxx, SphinxExamples/src/Filtering/QuadEdgeMeshFiltering/ComputePlanarParameterizationOfAMesh/Code.cxx, SphinxExamples/src/Filtering/QuadEdgeMeshFiltering/DelaunayConformEdgeFlipping/Code.cxx, and SphinxExamples/src/IO/Mesh/ReadMesh/Code.cxx.
Definition at line 81 of file itkMeshFileReader.h.
|
template<typename T > |
void | ConvertCellPixelBuffer (void *inputData, T *outputData, vcl_size_t numberOfPixels) |
|
template<typename T > |
void | ConvertPointPixelBuffer (void *inputData, T *outputData, vcl_size_t numberOfPixels) |
|
void | GenerateData () override |
|
| MeshFileReader () |
|
void | PrintSelf (std::ostream &os, Indent indent) const override |
|
void | TestFileExistanceAndReadability () |
|
| ~MeshFileReader () override=default |
|
void | GenerateInputRequestedRegion () override |
|
| MeshSource () |
|
| ~MeshSource () override=default |
|
virtual void | AddInput (DataObject *input) |
|
void | AddOptionalInputName (const DataObjectIdentifierType &) |
|
void | AddOptionalInputName (const DataObjectIdentifierType &, DataObjectPointerArraySizeType idx) |
|
virtual void | AddOutput (DataObject *output) |
|
bool | AddRequiredInputName (const DataObjectIdentifierType &) |
|
bool | AddRequiredInputName (const DataObjectIdentifierType &, DataObjectPointerArraySizeType idx) |
|
virtual void | CacheInputReleaseDataFlags () |
|
virtual void | GenerateOutputRequestedRegion (DataObject *output) |
|
DataObject * | GetInput (const DataObjectIdentifierType &key) |
|
const DataObject * | GetInput (const DataObjectIdentifierType &key) const |
|
virtual const DataObjectPointerArraySizeType & | GetNumberOfRequiredInputs () const |
|
virtual const DataObjectPointerArraySizeType & | GetNumberOfRequiredOutputs () const |
|
bool | IsIndexedInputName (const DataObjectIdentifierType &) const |
|
bool | IsIndexedOutputName (const DataObjectIdentifierType &) const |
|
bool | IsRequiredInputName (const DataObjectIdentifierType &) const |
|
DataObjectPointerArraySizeType | MakeIndexFromInputName (const DataObjectIdentifierType &name) const |
|
DataObjectPointerArraySizeType | MakeIndexFromOutputName (const DataObjectIdentifierType &name) const |
|
DataObjectIdentifierType | MakeNameFromInputIndex (DataObjectPointerArraySizeType idx) const |
|
DataObjectIdentifierType | MakeNameFromOutputIndex (DataObjectPointerArraySizeType idx) const |
|
virtual void | PopBackInput () |
|
virtual void | PopFrontInput () |
|
| ProcessObject () |
|
virtual void | PropagateResetPipeline () |
|
virtual void | PushBackInput (const DataObject *input) |
|
virtual void | PushFrontInput (const DataObject *input) |
|
virtual void | ReleaseInputs () |
|
virtual void | RemoveInput (const DataObjectIdentifierType &key) |
|
virtual void | RemoveInput (DataObjectPointerArraySizeType) |
|
virtual void | RemoveOutput (const DataObjectIdentifierType &key) |
|
virtual void | RemoveOutput (DataObjectPointerArraySizeType idx) |
|
bool | RemoveRequiredInputName (const DataObjectIdentifierType &) |
|
virtual void | RestoreInputReleaseDataFlags () |
|
virtual void | SetInput (const DataObjectIdentifierType &key, DataObject *input) |
|
virtual void | SetNthInput (DataObjectPointerArraySizeType idx, DataObject *input) |
|
virtual void | SetNthOutput (DataObjectPointerArraySizeType idx, DataObject *output) |
|
void | SetNumberOfIndexedInputs (DataObjectPointerArraySizeType num) |
|
void | SetNumberOfIndexedOutputs (DataObjectPointerArraySizeType num) |
|
virtual void | SetNumberOfRequiredInputs (DataObjectPointerArraySizeType) |
|
virtual void | SetNumberOfRequiredOutputs (DataObjectPointerArraySizeType _arg) |
|
virtual void | SetOutput (const DataObjectIdentifierType &name, DataObject *output) |
|
virtual void | SetPrimaryInput (DataObject *object) |
|
virtual void | SetPrimaryOutput (DataObject *object) |
|
void | SetRequiredInputNames (const NameArray &) |
|
virtual void | VerifyInputInformation () const |
|
virtual void | VerifyPreconditions () const |
|
| ~ProcessObject () override |
|
DataObject * | GetInput (DataObjectPointerArraySizeType idx) |
|
const DataObject * | GetInput (DataObjectPointerArraySizeType idx) const |
|
DataObject * | GetPrimaryInput () |
|
const DataObject * | GetPrimaryInput () const |
|
virtual void | SetPrimaryInputName (const DataObjectIdentifierType &key) |
|
virtual const char * | GetPrimaryInputName () const |
|
DataObject * | GetOutput (const DataObjectIdentifierType &key) |
|
const DataObject * | GetOutput (const DataObjectIdentifierType &key) const |
|
virtual void | SetPrimaryOutputName (const DataObjectIdentifierType &key) |
|
virtual const char * | GetPrimaryOutputName () const |
|
DataObject * | GetOutput (DataObjectPointerArraySizeType i) |
|
const DataObject * | GetOutput (DataObjectPointerArraySizeType i) const |
|
DataObject * | GetPrimaryOutput () |
|
const DataObject * | GetPrimaryOutput () const |
|
virtual bool | GetThreaderUpdateProgress () const |
|
virtual void | ThreaderUpdateProgressOn () |
|
virtual void | SetThreaderUpdateProgress (bool arg) |
|
| Object () |
|
bool | PrintObservers (std::ostream &os, Indent indent) const |
|
virtual void | SetTimeStamp (const TimeStamp &timeStamp) |
|
| ~Object () override |
|
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 () |
|
template<typename TOutputMesh , typename ConvertPointPixelTraits = MeshConvertPixelTraits<typename TOutputMesh::PixelType>, typename ConvertCellPixelTraits = MeshConvertPixelTraits<typename TOutputMesh::CellPixelType>>
Set/Get the MeshIO helper class. Often this is created via the object factory mechanism that determines whether a particular MeshIO can read a certain file. This method provides a way to get the MeshIO instance that is created. Or you can directly specify the MeshIO to use to read a particular file in case the factory mechanism will not work properly (e.g., unknown or unusual extension).
template<typename TOutputMesh , typename ConvertPointPixelTraits = MeshConvertPixelTraits<typename TOutputMesh::PixelType>, typename ConvertCellPixelTraits = MeshConvertPixelTraits<typename TOutputMesh::CellPixelType>>
void itk::MeshFileReader< TOutputMesh, ConvertPointPixelTraits, ConvertCellPixelTraits >::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::MeshSource< TOutputMesh >.
template<typename TOutputMesh , typename ConvertPointPixelTraits = MeshConvertPixelTraits<typename TOutputMesh::PixelType>, typename ConvertCellPixelTraits = MeshConvertPixelTraits<typename TOutputMesh::CellPixelType>>
Set/Get the MeshIO helper class. Often this is created via the object factory mechanism that determines whether a particular MeshIO can read a certain file. This method provides a way to get the MeshIO instance that is created. Or you can directly specify the MeshIO to use to read a particular file in case the factory mechanism will not work properly (e.g., unknown or unusual extension).
template<typename TOutputMesh , typename ConvertPointPixelTraits = MeshConvertPixelTraits<typename TOutputMesh::PixelType>, typename ConvertCellPixelTraits = MeshConvertPixelTraits<typename TOutputMesh::CellPixelType>>
void itk::MeshFileReader< TOutputMesh, ConvertPointPixelTraits, ConvertCellPixelTraits >::TestFileExistanceAndReadability |
( |
| ) |
|
|
protected |
Test whether the given filename exist and it is readable, this is intended to be called before attempting to use MeshIO classes for actually reading the file. If the file doesn't exist or it is not readable, and exception with an appropriate message will be thrown.