NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
itkNormaliseVectorFilter.h
Go to the documentation of this file.
1 /*=============================================================================
2 
3  NifTK: A software platform for medical image computing.
4 
5  Copyright (c) University College London (UCL). All rights reserved.
6 
7  This software is distributed WITHOUT ANY WARRANTY; without even
8  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
9  PURPOSE.
10 
11  See LICENSE.txt in the top level directory for details.
12 
13 =============================================================================*/
14 
15 #ifndef itkNormaliseVectorFilter_h
16 #define itkNormaliseVectorFilter_h
17 
18 #include <itkVector.h>
19 #include <itkImage.h>
20 #include <itkImageToImageFilter.h>
21 
22 namespace itk {
27 template < typename TScalarType, unsigned int NDimensions = 3>
28 class ITK_EXPORT NormaliseVectorFilter :
29 public ImageToImageFilter<
30  Image< Vector<TScalarType, NDimensions>, NDimensions>, // Input images
31  Image< Vector<TScalarType, NDimensions>, NDimensions> // Output image
32  >
33 {
34  public:
35 
38  typedef ImageToImageFilter<Image< Vector<TScalarType, NDimensions>, NDimensions>,
41  typedef SmartPointer<Self> Pointer;
42  typedef SmartPointer<const Self> ConstPointer;
43 
45  typedef Vector< TScalarType, NDimensions > InputPixelType;
50  typedef InputPixelType OutputPixelType;
51  typedef InputImageType OutputImageType;
52 
54  itkNewMacro(Self);
55 
57  itkTypeMacro(NormaliseVectorFilter, ImageToImageFilter);
58 
60  itkStaticConstMacro(Dimension, unsigned int, NDimensions);
61 
63  itkSetMacro(Normalise, bool);
64  itkGetMacro(Normalise, bool);
65 
67  itkSetMacro(LengthTolerance, double);
68  itkGetMacro(LengthTolerance, double);
69 
70  protected:
73  void PrintSelf(std::ostream& os, Indent indent) const;
74 
75  // The main method to implement in derived classes, note, its threaded.
76  virtual void ThreadedGenerateData( const InputImageRegionType &outputRegionForThread, ThreadIdType threadId);
77 
78  private:
79 
83  NormaliseVectorFilter(const Self&);
84  void operator=(const Self&);
85 
87  bool m_Normalise;
88 
90  double m_LengthTolerance;
91 
92 }; // end class
93 
94 } // end namespace
95 
96 #ifndef ITK_MANUAL_INSTANTIATION
97 #include "itkNormaliseVectorFilter.txx"
98 #endif
99 
100 #endif
This class takes a vector field and normalises each vector to unit length.
Definition: itkNormaliseVectorFilter.h:28
InputImageType OutputImageType
Definition: itkNormaliseVectorFilter.h:51
void Normalise(mitk::Point3D &vector)
Given a vector, will normalise it to unit length.
Definition: niftkPointUtils.cxx:149
Definition: niftkITKAffineResampleImage.cxx:74
ImageToImageFilter< Image< Vector< TScalarType, NDimensions >, NDimensions >, Image< Vector< TScalarType, NDimensions >, NDimensions > > Superclass
Definition: itkNormaliseVectorFilter.h:40
ImageType::IndexType IndexType
Definition: niftkMakeLapUSProbeBasicModel.cxx:32
Image< TScalarType, NDimensions > InputScalarImageType
Definition: itkNormaliseVectorFilter.h:47
SmartPointer< const Self > ConstPointer
Definition: itkNormaliseVectorFilter.h:42
Image< InputPixelType, NDimensions > InputImageType
Definition: itkNormaliseVectorFilter.h:46
InputPixelType OutputPixelType
Definition: itkNormaliseVectorFilter.h:50
SmartPointer< Self > Pointer
Definition: itkNormaliseVectorFilter.h:41
ImageType::RegionType RegionType
Definition: niftkMakeLapUSProbeBasicModel.cxx:30
NormaliseVectorFilter Self
Definition: itkNormaliseVectorFilter.h:37
Vector< TScalarType, NDimensions > InputPixelType
Definition: itkNormaliseVectorFilter.h:45
Simultaneous itk::Image and itk::Array (and hence vnl_vector) class.
InputImageType::RegionType InputImageRegionType
Definition: itkNormaliseVectorFilter.h:49
const unsigned int Dimension
Definition: niftkBreastDCEandADC.cxx:89
InputImageType::IndexType InputImageIndexType
Definition: itkNormaliseVectorFilter.h:48
~NormaliseVectorFilter()
Definition: itkNormaliseVectorFilter.h:72