Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
itkConnectednessFilter.h
Go to the documentation of this file.
1 #ifndef __itkConnectednessFilter_h
2 #define __itkConnectednessFilter_h
3 
4 #include "itkImageRegionIterator.h"
5 #include "itkImageToImageFilter.h"
6 #include <itkDiffusionTensor3D.h>
7 
8 namespace itk
9 {
22  template <class TFeatureImage, class TSeedImage, typename TTensorImagePixelType = double>
23  class ConnectednessFilter : public ImageToImageFilter<TFeatureImage, TFeatureImage>
24  {
25  public:
28  typedef ImageToImageFilter<TFeatureImage, TFeatureImage> Superclass;
30 
31  typedef typename itk::Image<itk::DiffusionTensor3D<TTensorImagePixelType>, 3> TTensorImage;
32 
36 
37  typedef typename TFeatureImage::IndexType IndexType;
38  typedef typename TSeedImage::IndexType IndexSeedType;
39  typedef typename TTensorImage::IndexType IndexTensorType;
40 
41  typedef typename itk::ImageRegionIterator<TSeedImage> SeedIteratorType;
42  typedef typename itk::ImageRegionIterator<TFeatureImage> FeatureIteratorType;
43 
45  itkNewMacro(Self)
46 
47 
48  itkTypeMacro(PropagateLocalFeaturesFilter, ImageToImageFilter)
49 
53  enum DistanceMode {
57  };
58 
59  void SetInputImage(const TFeatureImage *image);
60 
65  void SetInputSeed(const TSeedImage *mask);
66 
71  void SetInputMask(const TSeedImage *mask);
72 
77  void SetInputVectorField(const TTensorImage *vecs);
78 
83  void SetInputVectorFieldConfidenceMap(const TFeatureImage *conf);
84 
90  void SetPropagationImage(const TFeatureImage *prop);
91 
97 
105 
106  void SetMode(DistanceMode mode = FeatureSimilarity) { m_Mode = mode; }
112  void SetApplyRankFilter(bool applyFilter) { m_ApplyRankFilter = applyFilter; }
113  protected:
114  ConnectednessFilter() { m_ApplyRankFilter = false; }
117  virtual void GenerateData();
118 
119  virtual double GetDistanceValue(IndexType idxStart, IndexType idxEnd);
120 
121  private:
122  ConnectednessFilter(const Self &); // purposely not implemented
123  void operator=(const Self &); // purposely not implemented
124 
125  typename TFeatureImage::Pointer m_InputImage;
126  typename TTensorImage::Pointer m_TensorImage;
127  typename TFeatureImage::Pointer m_ConfidenceImage;
128  // Distance image w.r.t. to metric
129  typename TFeatureImage::Pointer m_DistanceImage;
130  // Euclidean distance, that keeps track of distance of shortest path
131  typename TFeatureImage::Pointer m_EuclideanDistance;
132 
133  DistanceMode m_Mode;
134 
135  bool m_ApplyRankFilter;
136  };
137 } // namespace ITK
138 
139 #ifndef ITK_MANUAL_INSTANTIATION
141 #endif
142 
143 #endif // itkConnectednessFilter_h
ImageToImageFilter< TFeatureImage, TFeatureImage > Superclass
itk::ImageRegionIterator< TSeedImage > SeedIteratorType
itk::SmartPointer< Self > Pointer
TSeedImage::PixelType SeedPixelType
void SetMode(DistanceMode mode=FeatureSimilarity)
void SetInputVectorField(const TTensorImage *vecs)
SetInputVectorField.
TFeatureImage::IndexType IndexType
TTensorImage::PixelType TensorPixelType
void SetInputSeed(const TSeedImage *mask)
SetInputSeed - seed area from which features are to be propagated.
itk::Image< itk::DiffusionTensor3D< TTensorImagePixelType >, 3 > TTensorImage
void SetInputImage(const TFeatureImage *image)
itk::ImageRegionIterator< TFeatureImage > FeatureIteratorType
void SetInputMask(const TSeedImage *mask)
SetInputMask - Filter only operates in masked area.
TSeedImage::IndexType IndexSeedType
void SetPropagationImage(const TFeatureImage *prop)
SetPropagationImage - OPTIONAL. Set image which values are propagated, it this is not supplied the In...
TTensorImage::IndexType IndexTensorType
void SetApplyRankFilter(bool applyFilter)
SetApplyRankFilter - if true the values propagated are determined by calculating the median within th...
void SetInputVectorFieldConfidenceMap(const TFeatureImage *conf)
SetInputVectorFieldConfidenceMap - Map that assigned a weight/confidence to each vector.
TFeatureImage::Pointer GetDistanceImage()
GetDistanceImage - Return the distance image using the specified metric.
SmartPointer< Self > Pointer
unsigned short PixelType
TFeatureImage::PixelType FeaturePixelType
DistanceMode
The DistanceMode enum Available distance metrics.
virtual double GetDistanceValue(IndexType idxStart, IndexType idxEnd)
TFeatureImage::Pointer GetEuclideanDistanceImage()
GetEuclideanDistanceImage - Return distance image that provides distance of shortest path for each vo...