18 #ifndef itkMorphologicalContourInterpolator_h 19 #define itkMorphologicalContourInterpolator_h 21 #include "itkBinaryThresholdImageFilter.h" 22 #include "itkConnectedComponentImageFilter.h" 23 #include "itkExtractImageFilter.h" 24 #include "itkImageToImageFilter.h" 25 #include "itksys/hash_map.hxx" 64 template<
typename TImage >
66 public ImageToImageFilter< TImage, TImage >
68 template<
typename T >
76 typedef Image<
typename TImage::PixelType, TImage::ImageDimension - 1 >
SliceType;
182 typename TImage::PixelType label,
183 const std::vector< typename TImage::IndexValueType >& indices )
237 ImagesEqual(
typename BoolSliceType::Pointer& a,
typename BoolSliceType::Pointer& b );
247 typename TImage::PixelType label,
248 typename TImage::IndexValueType i,
249 typename TImage::IndexValueType j,
250 typename SliceType::Pointer& iconn,
251 typename SliceType::Pointer& jconn,
252 ThreadIdType threadId );
266 typename TImage::PixelType label,
267 typename TImage::IndexValueType i,
268 typename TImage::IndexValueType j,
269 typename SliceType::Pointer& iConn,
270 typename TImage::PixelType iRegionId,
271 ThreadIdType threadId );
274 typename FloatSliceType::Pointer
275 MaurerDM( typename BoolSliceType::Pointer& inImage, ThreadIdType threadId );
279 std::vector< typename BoolSliceType::Pointer >
281 typename BoolSliceType::Pointer& end,
282 ThreadIdType threadId );
285 typename BoolSliceType::Pointer
287 typename BoolSliceType::Pointer& iMask,
288 typename BoolSliceType::Pointer& jMask,
289 ThreadIdType threadId );
292 typename BoolSliceType::Pointer
294 typename BoolSliceType::Pointer& iMask,
295 typename BoolSliceType::Pointer& jMask,
296 ThreadIdType threadId );
302 typename TImage::PixelType label,
303 typename TImage::IndexValueType i,
304 typename TImage::IndexValueType j,
305 typename SliceType::Pointer& iConn,
306 typename TImage::PixelType iRegionId,
307 typename SliceType::Pointer& jConn,
308 typename TImage::PixelType jRegionId,
309 const typename SliceType::IndexType& translation,
311 ThreadIdType threadId );
319 typename TImage::PixelType label,
320 typename TImage::IndexValueType i,
321 typename TImage::IndexValueType j,
322 typename SliceType::Pointer& iConn,
323 typename TImage::PixelType iRegionId,
324 typename SliceType::Pointer& jConn,
325 const PixelList& jRegionIds,
326 const typename SliceType::IndexType& translation,
327 ThreadIdType threadId );
330 typename SliceType::Pointer
332 const typename SliceType::IndexType& translation,
333 typename SliceType::RegionType newRegion );
338 CardSymDifference( typename BoolSliceType::Pointer& shape1, typename BoolSliceType::Pointer& shape2 );
345 typename SliceType::IndexType
346 Centroid( typename SliceType::Pointer& conn, const PixelList& regionIds );
352 typename SliceType::RegionType& iRegion,
353 typename SliceType::RegionType& jRegion );
358 typename TImage::PixelType iRegionId,
359 typename SliceType::Pointer& jConn,
360 const PixelList& jRegionIds,
361 const typename SliceType::IndexType& translation );
364 typename SliceType::IndexType
365 Align( typename SliceType::Pointer& iConn,
366 typename TImage::PixelType iRegionId,
367 typename SliceType::Pointer& jConn,
368 const PixelList& jRegionIds );
370 typedef itksys::hash_map< typename TImage::PixelType, typename TImage::RegionType >
BoundingBoxesType;
374 typename SliceType::RegionType
382 ExpandRegion( typename T2::RegionType& region, const typename T2::IndexType& index );
385 typename SliceType::Pointer
387 typename TImage::PixelType label,
388 IdentifierType& objectCount );
391 typename BoolSliceType::Pointer
392 Dilate1( typename BoolSliceType::Pointer& seed, typename BoolSliceType::Pointer& mask, ThreadIdType threadId );
394 typedef ExtractImageFilter< TImage, SliceType >
RoiType;
397 typedef BinaryThresholdImageFilter< SliceType, BoolSliceType >
BinarizerType;
406 operator=( const Self & ) ITK_DELETE_FUNCTION;
410 #ifndef ITK_MANUAL_INSTANTIATION 411 #include "itkMorphologicalContourInterpolator.hxx" 414 #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
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)
itkSetMacro(Label, typename TImage::PixelType)
TImage::PixelType m_Label
Simplified inverse ITK transforms.
ConnectedComponentsType::Pointer m_ConnectedComponents
itkTypeMacro(MorphologicalContourInterpolator, ImageToImageFilter)
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()
ExtractImageFilter< TImage, SliceType > RoiType
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
virtual void GenerateData() ITK_OVERRIDE
bool m_UseBallStructuringElement
itkGetConstMacro(Label, typename TImage::PixelType)
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)
BinaryThresholdImageFilter< SliceType, BoolSliceType > BinarizerType
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
ConnectedComponentImageFilter< BoolSliceType, SliceType > ConnectedComponentsType
virtual void AllocateOutputs() ITK_OVERRIDE
Image< bool, TImage::ImageDimension > BoolImageType
itksys::hash_map< typename TImage::PixelType, SliceSetType > LabeledSlicesType
SliceIndicesType GetLabeledSliceIndices()
IdentifierType m_MaxAlignIters
void ExpandRegion(typename T2::RegionType ®ion, const typename T2::IndexType &index)
itkGetMacro(Label, typename TImage::PixelType)
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)
SliceType::RegionType BoundingBox(itk::SmartPointer< SliceType > image)
IdentifierType Intersection(typename SliceType::Pointer &iConn, typename TImage::PixelType iRegionId, typename SliceType::Pointer &jConn, const PixelList &jRegionIds, const typename SliceType::IndexType &translation)
void ClearLabeledSliceIndices()
void InterpolateAlong(int axis, TImage *out)
SmartPointer< Self > Pointer
bool m_UseDistanceTransform