Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
itkSkeletonizationFilter.h
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef ITKSKELETONIZATIONFILTER_H_
18 #define ITKSKELETONIZATIONFILTER_H_
19 
20 #include "itkImageToImageFilter.h"
21 #include "itkImage.h"
22 #include "mitkImage.h"
23 #include <itkVectorImage.h>
24 
25 namespace itk
26 {
27 
39 template < class TInputImage, class TOutputImage >
40 class SkeletonizationFilter : public ImageToImageFilter<TInputImage, TOutputImage>
41 {
42 
43 
44 public:
45 
47  typedef TInputImage InputImageType;
48 
49  typedef itk::CovariantVector<int,3> VectorType;
50 
51  typedef itk::Image<VectorType, 3> VectorImageType;
52 
53 
55  typedef TOutputImage OutputImageType;
56 
57  typedef itk::VectorImage<int, 3> GradientImageType;
58 
59 
62 
64  typedef ImageToImageFilter<InputImageType, OutputImageType> Superclass;
65 
67 
69 
70  itkFactorylessNewMacro(Self)
71  itkCloneMacro(Self)
72 
74  virtual void GenerateData();
75 
76 
81  GradientImageType::Pointer GetGradientImage();
82 
84  VectorImageType::Pointer GetVectorImage()
85  {
86  return m_DirectionImage;
87  }
88 
89 
90 
91 
92 protected:
93 
95 
96  virtual ~SkeletonizationFilter();
97 
99 
100  int round(float x)
101  {
102  if (x>0.0) return ((int) (x+0.5));
103  else return ((int) (x-0.5));
104  }
105 
106 
107 protected:
108 
109 
110 
111 };
112 
113 }
114 
115 #ifndef ITK_MANUAL_INSTANTIATION
117 #endif
118 
119 #endif
itk::SmartPointer< Self > Pointer
virtual void GenerateData()
Performs the work.
VectorImageType::Pointer m_DirectionImage
itk::Image< VectorType, 3 > VectorImageType
ImageToImageFilter< InputImageType, OutputImageType > Superclass
itk::CovariantVector< int, 3 > VectorType
VectorImageType::Pointer GetVectorImage()
Output the gradient image as an itkImage containing vector.
SmartPointer< const Self > ConstPointer
Skeletonization part of the TBSS pipeline.
GradientImageType::Pointer GetGradientImage()
Output the gradient image as itkVectorImage.
itk::VectorImage< int, 3 > GradientImageType