18 #ifndef itkMorphologicalContourInterpolator_h
19 #define itkMorphologicalContourInterpolator_h
25 #include "itksys/hash_map.hxx"
64 template<
typename TImage >
68 template<
typename T >
78 using SliceType =
Image<
typename TImage::PixelType, TImage::ImageDimension - 1 >;
87 itkSetMacro( Label,
typename TImage::PixelType );
90 itkGetMacro( Label,
typename TImage::PixelType );
93 itkGetConstMacro( Label,
typename TImage::PixelType );
96 itkSetMacro( Axis,
int );
99 itkGetMacro( Axis,
int );
102 itkGetConstMacro( Axis,
int );
106 itkSetMacro( HeuristicAlignment,
bool );
110 itkGetMacro( HeuristicAlignment,
bool );
114 itkGetConstMacro( HeuristicAlignment,
bool );
119 itkSetMacro( UseDistanceTransform,
bool );
124 itkGetMacro( UseDistanceTransform,
bool );
129 itkGetConstMacro( UseDistanceTransform,
bool );
133 itkSetMacro( UseCustomSlicePositions,
bool );
137 itkGetMacro( UseCustomSlicePositions,
bool );
141 itkGetConstMacro( UseCustomSlicePositions,
bool );
157 itkGetMacro( UseBallStructuringElement,
bool );
160 itkGetConstMacro( UseBallStructuringElement,
bool );
186 typename TImage::PixelType label,
187 const std::vector< typename TImage::IndexValueType >& indices )
190 sliceSet.insert( indices.begin(), indices.end() );
255 typename TImage::PixelType label,
267 InterpolateAlong(
int axis, TImage* out,
float startProgress,
float endProgress);
273 typename TImage::PixelType label,
277 typename TImage::PixelType iRegionId );
285 std::vector< typename BoolSliceType::Pointer >
305 typename TImage::PixelType label,
309 typename TImage::PixelType iRegionId,
311 typename TImage::PixelType jRegionId,
315 using PixelList = std::vector< typename TImage::PixelType >;
321 typename TImage::PixelType label,
325 typename TImage::PixelType iRegionId,
359 typename TImage::PixelType iRegionId,
367 typename TImage::PixelType iRegionId,
371 using BoundingBoxesType = itksys::hash_map< typename TImage::PixelType, typename TImage::RegionType >;
381 template<
typename T2 >
388 typename TImage::PixelType label,
406 #ifndef ITK_MANUAL_INSTANTIATION
407 #include "itkMorphologicalContourInterpolator.hxx"
410 #endif // itkMorphologicalContourInterpolator_h
SliceType::Pointer RegionedConnectedComponents(const typename TImage::RegionType ®ion, typename TImage::PixelType label, IdentifierType &objectCount)
IdentifierType m_MinAlignIters
BinarizerType::Pointer m_Binarizer
Light weight base class for most itk classes.
friend class MorphologicalContourInterpolatorParallelInvoker
void IntersectionRegions(const typename SliceType::IndexType &translation, typename SliceType::RegionType &iRegion, typename SliceType::RegionType &jRegion)
void InterpolateBetweenTwo(int axis, TImage *out, typename TImage::PixelType label, typename TImage::IndexValueType i, typename TImage::IndexValueType j, typename SliceType::Pointer &iconn, typename SliceType::Pointer &jconn)
SliceSetType GetLabeledSliceIndices(unsigned int axis, typename TImage::PixelType label)
void GenerateData() override
TImage::PixelType m_Label
void AllocateOutputs() override
ConnectedComponentsType::Pointer m_ConnectedComponents
std::set< typename TImage::IndexValueType > SliceSetType
bool m_HeuristicAlignment
void SetLabeledSliceIndices(unsigned int axis, typename TImage::PixelType label, const std::vector< typename TImage::IndexValueType > &indices)
MorphologicalContourInterpolator()
void Interpolate1toN(int axis, TImage *out, typename TImage::PixelType label, typename TImage::IndexValueType i, typename TImage::IndexValueType j, typename SliceType::Pointer &iConn, typename TImage::PixelType iRegionId, typename SliceType::Pointer &jConn, const PixelList &jRegionIds, const typename SliceType::IndexType &translation)
std::vector< typename TImage::PixelType > PixelList
void DetermineSliceOrientations()
Binarize an input image by thresholding.
~MorphologicalContourInterpolator() override
bool m_UseBallStructuringElement
bool ImagesEqual(typename BoolSliceType::Pointer &a, typename BoolSliceType::Pointer &b)
std::vector< typename BoolSliceType::Pointer > GenerateDilationSequence(typename BoolSliceType::Pointer &begin, typename BoolSliceType::Pointer &end)
SliceType::IndexType Centroid(typename SliceType::Pointer &conn, const PixelList ®ionIds)
SizeValueType IdentifierType
ImageBaseType::IndexType IndexType
bool m_UseCustomSlicePositions
SliceType::Pointer TranslateImage(typename SliceType::Pointer &image, const typename SliceType::IndexType &translation, typename SliceType::RegionType newRegion)
itksys::hash_map< typename TImage::PixelType, typename TImage::RegionType > BoundingBoxesType
signed long IndexValueType
BoolSliceType::Pointer FindMedianImageDilations(typename BoolSliceType::Pointer &intersection, typename BoolSliceType::Pointer &iMask, typename BoolSliceType::Pointer &jMask)
typename Superclass::RegionType RegionType
void SetUseBallStructuringElement(bool useBall)
itksys::hash_map< typename TImage::PixelType, SliceSetType > LabeledSlicesType
Interpolates contours between slices. Based on a paper by Albu et al.
SliceIndicesType m_LabeledSlices
IdentifierType m_ThreadCount
BoolSliceType::Pointer Dilate1(typename BoolSliceType::Pointer &seed, typename BoolSliceType::Pointer &mask)
virtual void Modified() const
void Extrapolate(int axis, TImage *out, typename TImage::PixelType label, typename TImage::IndexValueType i, typename TImage::IndexValueType j, typename SliceType::Pointer &iConn, typename TImage::PixelType iRegionId)
BoolSliceType::Pointer FindMedianImageDistances(typename BoolSliceType::Pointer &intersection, typename BoolSliceType::Pointer &iMask, typename BoolSliceType::Pointer &jMask)
typename Superclass::IndexType IndexType
std::vector< LabeledSlicesType > SliceIndicesType
SliceIndicesType GetLabeledSliceIndices()
IdentifierType m_MaxAlignIters
void ExpandRegion(typename T2::RegionType ®ion, const typename T2::IndexType &index)
Base class for filters that take an image as input and produce an image as output.
void SetLabeledSliceIndices(unsigned int axis, typename TImage::PixelType label, const SliceSetType &indices)
IdentifierType CardinalSymmetricDifference(typename BoolSliceType::Pointer &shape1, typename BoolSliceType::Pointer &shape2)
void Interpolate1to1(int axis, TImage *out, typename TImage::PixelType label, typename TImage::IndexValueType i, typename TImage::IndexValueType j, typename SliceType::Pointer &iConn, typename TImage::PixelType iRegionId, typename SliceType::Pointer &jConn, typename TImage::PixelType jRegionId, const typename SliceType::IndexType &translation, bool recursive)
FloatSliceType::Pointer MaurerDM(typename BoolSliceType::Pointer &inImage)
BoundingBoxesType m_BoundingBoxes
ImageBaseType::RegionType RegionType
SliceType::IndexType Align(typename SliceType::Pointer &iConn, typename TImage::PixelType iRegionId, typename SliceType::Pointer &jConn, const PixelList &jRegionIds)
void InterpolateAlong(int axis, TImage *out, float startProgress, float endProgress)
SliceType::RegionType BoundingBox(itk::SmartPointer< SliceType > image)
Templated n-dimensional image class.
IdentifierType Intersection(typename SliceType::Pointer &iConn, typename TImage::PixelType iRegionId, typename SliceType::Pointer &jConn, const PixelList &jRegionIds, const typename SliceType::IndexType &translation)
void ClearLabeledSliceIndices()
bool m_UseDistanceTransform
Label the objects in a binary image.