18 #ifndef itkMorphologicalContourInterpolator_h
19 #define itkMorphologicalContourInterpolator_h
25 #include "itksys/hash_map.hxx"
64 template<
typename TImage >
68 template<
typename T >
76 typedef Image<
typename TImage::PixelType, TImage::ImageDimension - 1 >
SliceType;
85 itkSetMacro( Label,
typename TImage::PixelType );
88 itkGetMacro( Label,
typename TImage::PixelType );
91 itkGetConstMacro( Label,
typename TImage::PixelType );
94 itkSetMacro( Axis,
int );
97 itkGetMacro( Axis,
int );
100 itkGetConstMacro( Axis,
int );
104 itkSetMacro( HeuristicAlignment,
bool );
108 itkGetMacro( HeuristicAlignment,
bool );
112 itkGetConstMacro( HeuristicAlignment,
bool );
117 itkSetMacro( UseDistanceTransform,
bool );
122 itkGetMacro( UseDistanceTransform,
bool );
127 itkGetConstMacro( UseDistanceTransform,
bool );
131 itkSetMacro( UseCustomSlicePositions,
bool );
135 itkGetMacro( UseCustomSlicePositions,
bool );
139 itkGetConstMacro( UseCustomSlicePositions,
bool );
155 itkGetMacro( UseBallStructuringElement,
bool );
158 itkGetConstMacro( UseBallStructuringElement,
bool );
184 typename TImage::PixelType label,
185 const std::vector< typename TImage::IndexValueType >& indices )
188 sliceSet.insert( indices.begin(), indices.end() );
253 typename TImage::PixelType label,
272 typename TImage::PixelType label,
276 typename TImage::PixelType iRegionId,
308 typename TImage::PixelType label,
312 typename TImage::PixelType iRegionId,
314 typename TImage::PixelType jRegionId,
319 typedef std::vector< typename TImage::PixelType >
PixelList;
325 typename TImage::PixelType label,
329 typename TImage::PixelType iRegionId,
331 const PixelList& jRegionIds,
339 typename
SliceType::RegionType newRegion );
359 typename
SliceType::RegionType& jRegion );
364 typename TImage::PixelType iRegionId,
366 const PixelList& jRegionIds,
372 typename TImage::PixelType iRegionId,
374 const PixelList& jRegionIds );
376 typedef itksys::hash_map< typename TImage::PixelType, typename TImage::RegionType >
BoundingBoxesType;
386 template< typename T2 >
393 typename TImage::PixelType label,
412 operator=( const
Self & ) ITK_DELETE_FUNCTION;
416 #ifndef ITK_MANUAL_INSTANTIATION
417 #include "itkMorphologicalContourInterpolator.hxx"
420 #endif // itkMorphologicalContourInterpolator_h
IdentifierType CardSymDifference(typename BoolSliceType::Pointer &shape1, typename BoolSliceType::Pointer &shape2)
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
Image< float, TImage::ImageDimension-1 > FloatSliceType
void IntersectionRegions(const typename SliceType::IndexType &translation, typename SliceType::RegionType &iRegion, typename SliceType::RegionType &jRegion)
std::vector< typename TImage::PixelType > PixelList
MorphologicalContourInterpolator Self
itksys::hash_map< typename TImage::PixelType, typename TImage::RegionType > BoundingBoxesType
BoolSliceType::Pointer FindMedianImageDistances(typename BoolSliceType::Pointer &intersection, typename BoolSliceType::Pointer &iMask, typename BoolSliceType::Pointer &jMask, ThreadIdType threadId)
SliceSetType GetLabeledSliceIndices(unsigned int axis, typename TImage::PixelType label)
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, ThreadIdType threadId)
signed long IndexValueType
virtual void AllocateOutputs() override
TImage::PixelType m_Label
ConnectedComponentsType::Pointer m_ConnectedComponents
BoolSliceType::Pointer Dilate1(typename BoolSliceType::Pointer &seed, typename BoolSliceType::Pointer &mask, ThreadIdType threadId)
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, ThreadIdType threadId)
std::vector< LabeledSlicesType > SliceIndicesType
bool m_HeuristicAlignment
Image< bool, TImage::ImageDimension-1 > BoolSliceType
void SetLabeledSliceIndices(unsigned int axis, typename TImage::PixelType label, const std::vector< typename TImage::IndexValueType > &indices)
MorphologicalContourInterpolator()
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, ThreadIdType threadId)
std::vector< typename BoolSliceType::Pointer > GenerateDilationSequence(typename BoolSliceType::Pointer &begin, typename BoolSliceType::Pointer &end, ThreadIdType threadId)
void DetermineSliceOrientations()
std::set< typename TImage::IndexValueType > SliceSetType
Binarize an input image by thresholding.
bool m_UseBallStructuringElement
SizeValueType IdentifierType
bool ImagesEqual(typename BoolSliceType::Pointer &a, typename BoolSliceType::Pointer &b)
Image< typename TImage::PixelType, TImage::ImageDimension-1 > SliceType
BoolSliceType::Pointer FindMedianImageDilations(typename BoolSliceType::Pointer &intersection, typename BoolSliceType::Pointer &iMask, typename BoolSliceType::Pointer &jMask, ThreadIdType threadId)
SliceType::IndexType Centroid(typename SliceType::Pointer &conn, const PixelList ®ionIds)
bool m_UseCustomSlicePositions
SliceType::Pointer TranslateImage(typename SliceType::Pointer &image, const typename SliceType::IndexType &translation, typename SliceType::RegionType newRegion)
FloatSliceType::Pointer MaurerDM(typename BoolSliceType::Pointer &inImage, ThreadIdType threadId)
void SetUseBallStructuringElement(bool useBall)
Interpolates contours between slices. Based on a paper by Albu et al.
SliceIndicesType m_LabeledSlices
IdentifierType m_ThreadCount
virtual void Modified() const
unsigned int ThreadIdType
Image< bool, TImage::ImageDimension > BoolImageType
virtual void GenerateData() override
itksys::hash_map< typename TImage::PixelType, SliceSetType > LabeledSlicesType
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)
~MorphologicalContourInterpolator()
BoundingBoxesType m_BoundingBoxes
SliceType::IndexType Align(typename SliceType::Pointer &iConn, typename TImage::PixelType iRegionId, typename SliceType::Pointer &jConn, const PixelList &jRegionIds)
ImageToImageFilter< TImage, TImage > Superclass
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, ThreadIdType threadId)
Templated n-dimensional image class.
Represent and compute information about bounding boxes.
IdentifierType Intersection(typename SliceType::Pointer &iConn, typename TImage::PixelType iRegionId, typename SliceType::Pointer &jConn, const PixelList &jRegionIds, const typename SliceType::IndexType &translation)
ImageBaseType::IndexType IndexType
void ClearLabeledSliceIndices()
void InterpolateAlong(int axis, TImage *out)
SmartPointer< Self > Pointer
bool m_UseDistanceTransform
Label the objects in a binary image.