21#include "IOMeshSWCExport.h"
27#include <unordered_map>
53extern IOMeshSWC_EXPORT std::ostream &
201 template <
typename T>
212 m_PointsBuffer->SetElement(index,
static_cast<float>(buffer[index]));
219 template <
typename T>
268 template <
typename T>
280 itkExceptionMacro(
"Unexpected cell type -- line cell expected. Found: " << buffer[index]);
283 if (
static_cast<uint8_t
>(buffer[index]) != 2)
285 itkExceptionMacro(
"Unexpected number of cell points -- expected 2. Found: " << buffer[index]);
288 const auto parentPoint =
static_cast<IdentifierType>(buffer[index]);
290 const auto samplePoint =
static_cast<IdentifierType>(buffer[index]);
295 itkExceptionMacro(
"SWC cell references point index out of range [0, "
296 << this->
GetNumberOfPoints() <<
"): parent=" << parentPoint <<
" sample=" << samplePoint);
300 ? parentEntry->second
Control indentation during Print() invocation.
SizeValueType m_NumberOfPoints
IdentifierType SizeValueType
unsigned int m_PointDimension
std::streamoff StreamOffsetType
virtual SizeValueType GetNumberOfPoints() const
SizeValueType m_NumberOfCells
enums for the SWCMeshIO class.
std::unordered_map< SampleIdentifierType, IdentifierType > SampleIdentifierToPointIndexType
PointIndexToSampleIdentifierType m_PointIndexToSampleIdentifier
const SampleIdentifierContainerType * GetSampleIdentifiers() const
ParentIdentifierContainerType::Pointer m_ParentIdentifiers
void WriteMeshInformation() override
const ParentIdentifierContainerType * GetParentIdentifiers() const
SampleIdentifierContainerType::Pointer m_SampleIdentifiers
float SampleIdentifierType
void ReadPoints(void *buffer) override
void WriteCells(T *buffer)
PointsBufferContainerType::Pointer m_PointsBuffer
void SetRadii(const RadiusContainerType *)
void PrintSelf(std::ostream &os, Indent indent) const override
VectorContainer< float > PointsBufferContainerType
void WritePointData(void *buffer) override
VectorContainer< TypeIdentifierType > TypeIdentifierContainerType
VectorContainer< RadiusType > RadiusContainerType
const TypeIdentifierContainerType * GetTypeIdentifiers() const
void ReadPointData(void *buffer) override
VectorContainer< uint32_t > CellsBufferContainerType
PointIndexToParentPointIndexType m_PointIndexToParentPointIndex
SampleIdentifierToPointIndexType m_SampleIdentifierToPointIndex
void WritePoints(T *buffer)
std::unordered_map< IdentifierType, SampleIdentifierType > PointIndexToSampleIdentifierType
Superclass::SizeValueType SizeValueType
const RadiusContainerType * GetRadii() const
void SetParentIdentifiers(const ParentIdentifierContainerType *)
void WritePointData(T *buffer)
void SetSampleIdentifiers(const SampleIdentifierContainerType *)
void WritePoints(void *buffer) override
VectorContainer< SampleIdentifierType > SampleIdentifierContainerType
SmartPointer< const Self > ConstPointer
void WriteCellData(void *buffer) override
std::unordered_map< IdentifierType, IdentifierType > PointIndexToParentPointIndexType
void ReadCellData(void *buffer) override
float ParentIdentifierType
void ReadMeshInformation() override
HeaderContentType m_HeaderContent
void SetTypeIdentifiers(const TypeIdentifierContainerType *)
bool CanReadFile(const char *fileName) override
std::vector< std::string > HeaderContentType
void ReadCells(void *buffer) override
void SetHeaderContent(const HeaderContentType &headerContent)
SWCMeshIOEnums::SWCPointData m_PointDataContent
CellsBufferContainerType::Pointer m_CellsBuffer
Superclass::StreamOffsetType StreamOffsetType
VectorContainer< ParentIdentifierType > ParentIdentifierContainerType
RadiusContainerType::Pointer m_Radii
TypeIdentifierContainerType::Pointer m_TypeIdentifiers
bool CanWriteFile(const char *fileName) override
SmartPointer< Self > Pointer
void WriteCells(void *buffer) override
Implements transparent reference counting.
SmartPointer< Self > Pointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
SizeValueType IdentifierType
detail::VectorContainer< std::conditional_t< std::is_void_v< T2 >, SizeValueType, T1 >, std::conditional_t< std::is_void_v< T2 >, T1, T2 > > VectorContainer
ITKCommon_EXPORT std::ostream & operator<<(std::ostream &out, AnatomicalOrientation::CoordinateEnum value)
#define itkSetMacro(name, type)