19#ifndef itkCuberilleImageToMeshFilter_h
20#define itkCuberilleImageToMeshFilter_h
112template <
typename TInputImage,
113 typename TOutputMesh,
114 typename TInterpolator = itk::LinearInterpolateImageFunction<TInputImage>>
168 using SizeType =
typename InputImageType::SizeType;
172 static_assert(InputImageType::ImageDimension == 3,
"CuberilleImageToMeshFilter supports only 3D images.");
211 itkGetMacro(GenerateTriangleFaces,
bool);
213 itkBooleanMacro(GenerateTriangleFaces);
217 itkGetMacro(ProjectVerticesToIsoSurface,
bool);
219 itkBooleanMacro(ProjectVerticesToIsoSurface);
223 itkGetMacro(SavePixelAsCellData,
bool);
225 itkBooleanMacro(SavePixelAsCellData);
233 itkGetMacro(ProjectVertexSurfaceDistanceThreshold,
double);
239 itkGetMacro(ProjectVertexStepLength,
double);
240 itkSetClampMacro(ProjectVertexStepLength,
double, 0.0, 100000.0);
246 itkGetMacro(ProjectVertexStepLengthRelaxationFactor,
double);
247 itkSetClampMacro(ProjectVertexStepLengthRelaxationFactor,
double, 0.0, 1.0);
251 itkGetMacro(ProjectVertexMaximumNumberOfSteps,
unsigned int);
336 template <
typename TMeshType>
342 using MapType = std::map<VertexLookupNode, PointVectorType>;
359 m_Map.insert(
typename MapType::value_type(node, ids));
370 auto it =
m_Map.find(node);
371 if (it !=
m_Map.end())
374 id = it->second.at(component);
410 const size_t numComponents);
415 std::array<PointIdentifier, 4> f,
444#ifndef ITK_MANUAL_INSTANTIATION
445# include "itkCuberilleImageToMeshFilter.hxx"
An abstract interface for cells.
Const version of ShapedNeighborhoodIterator, defining iteration of a local N-dimensional neighborhood...
void AddVertex(unsigned int x, unsigned int y, unsigned int z, PointVectorType ids)
std::map< VertexLookupNode, PointVectorType > MapType
bool GetVertex(unsigned int x, unsigned int y, unsigned int z, const vcl_size_t component, PointIdentifier &id)
VertexLookupMap()=default
bool operator>(const Self &node) const
bool operator>=(const Self &node) const
VertexLookupNode(unsigned long x, unsigned long y, unsigned long z)
bool operator<=(const Self &node) const
bool operator<(const Self &node) const
VertexLookupNode()=default
typename GradientFilterType::OutputImageType GradientImageType
virtual void SetInput(const InputImageType *inputImage)
std::conditional_t< UseGradientRecursiveGaussian, GradientRecursiveGaussianImageFilter< InputImageType >, GradientImageFilter< InputImageType > > GradientFilterType
typename TriangleCellType::CellAutoPointer TriangleCellAutoPointer
void CalculateLabelsArray()
InterpolatorPointer m_Interpolator
void GenerateData() override
typename OutputMeshTraits::PixelType OutputPixelType
typename std::vector< PointIdentifier > PointVectorType
double m_ProjectVertexStepLengthRelaxationFactor
typename OutputMeshType::Pointer OutputMeshPointer
typename InputImageType::Pointer InputImagePointer
void SetVerticesFromFace(unsigned int face, std::array< bool, 8 > &vertexHasQuad)
typename InputImageType::ConstPointer InputImageConstPointer
TInterpolator InterpolatorType
double m_ProjectVertexStepLength
void AddQuadFace(CellIdentifier &id, std::array< PointIdentifier, 4 > f, OutputMeshType *mesh, const InputPixelType &pixel)
PointVectorType AddVertex(PointIdentifier &id, IndexType index, const InputImageType *image, OutputMeshType *mesh, const vcl_size_t numComponents)
bool m_SavePixelAsCellData
bool m_GenerateTriangleFaces
CuberilleImageToMeshFilter Self
typename QuadrilateralCellType::CellAutoPointer QuadrilateralCellAutoPointer
typename InputImageType::SizeType SizeType
typename OutputMeshType::PointIdentifier PointIdentifier
vcl_size_t CalculateBitmaskIDForVertexIndex(const IndexType &vindex)
unsigned int m_ProjectVertexMaximumNumberOfSteps
typename OutputMeshType::CellsContainerPointer CellsContainerPointer
double m_ProjectVertexSurfaceDistanceThreshold
void ComputeGradientImage()
InputPixelType m_IsoSurfaceValue
typename OutputMeshType::CellsContainer CellsContainer
ImageToMeshFilter< TInputImage, TOutputMesh > Superclass
static constexpr bool UseAdvancedProjection
typename GradientFilterType::Pointer GradientFilterPointer
typename InputImageType::SpacingType SpacingType
typename OutputMeshType::PointType OutputPointType
SpacingValueType m_MaxSpacing
TriangleCell< CellInterfaceType > TriangleCellType
CellInterface< OutputPixelType, CellTraits > CellInterfaceType
SmartPointer< Self > Pointer
typename GradientInterpolatorType::Pointer GradientInterpolatorPointer
typename OutputMeshType::MeshTraits OutputMeshTraits
std::array< TLabels, 256 > TLabelsArray
typename GradientImageType::Pointer GradientImagePointer
typename InputImageType::IndexType IndexType
TOutputMesh OutputMeshType
std::array< TLabel, 8 > TLabels
TLabelsArray m_LabelsArray
VertexLookupMap< OutputMeshType > VertexLookupMapType
typename OutputMeshType::CellIdentifier CellIdentifier
typename GradientFilterType::OutputPixelType GradientPixelType
typename OutputMeshType::CellTraits CellTraits
static constexpr bool UseGradientRecursiveGaussian
typename OutputMeshType::PointsContainerPointer PointsContainerPointer
typename OutputMeshType::PointType PointType
typename InterpolatorType::Pointer InterpolatorPointer
typename InterpolatorType::OutputType InterpolatorOutputType
IndexType GetVertexLookupIndex(unsigned int vertex, IndexType index)
CuberilleImageToMeshFilter()
typename InputImageType::SpacingValueType SpacingValueType
void ProjectVertexToIsoSurface(PointType &vertex)
bool m_ProjectVerticesToIsoSurface
QuadrilateralCell< CellInterfaceType > QuadrilateralCellType
~CuberilleImageToMeshFilter() override
typename OutputMeshType::PointsContainer PointsContainer
typename TriangleCellType::SelfAutoPointer TriangleAutoPointer
ConstShapedNeighborhoodIterator< InputImageType > InputImageIteratorType
SmartPointer< const Self > ConstPointer
GradientInterpolatorPointer m_GradientInterpolator
TInputImage InputImageType
itk::VectorLinearInterpolateImageFunction< GradientImageType > GradientInterpolatorType
typename InputImageType::PixelType InputPixelType
typename QuadrilateralCellType::SelfAutoPointer QuadrilateralAutoPointer
void PrintSelf(std::ostream &os, Indent indent) const override
static constexpr bool UseLineSearchProjection
void GenerateOutputInformation() override
Computes the gradient of an image using directional derivatives.
Computes the gradient of an image by convolution with the first derivative of a Gaussian.
void SetInput(unsigned int idx, const InputImageType *input)
Control indentation during Print() invocation.
static constexpr T max(const T &)
Represents a quadrilateral for a Mesh.
Implements transparent reference counting.
Linearly interpolate a vector image at specified positions.
SmartPointer< Self > Pointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
#define itkSetMacro(name, type)