NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
itkHighResLaplacianSolverImageFilter.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 itkHighResLaplacianSolverImageFilter_h
16 #define itkHighResLaplacianSolverImageFilter_h
17 
19 #include <itkNearestNeighborInterpolateImageFunction.h>
21 
22 namespace itk
23 {
38 template <class TInputImage, typename TScalarType=double>
40  public LaplacianSolverImageFilter< TInputImage >
41 {
42 public:
46  typedef SmartPointer<Self> Pointer;
47  typedef SmartPointer<const Self> ConstPointer;
48 
51 
53  itkNewMacro(Self);
54 
57  typedef TScalarType OutputPixelType;
59 
61  typedef TInputImage InputImageType;
62  typedef typename InputImageType::Pointer InputImagePointer;
67  typedef typename InputImageType::PointType InputImageOriginType;
68  typedef typename InputImageType::PointType InputImagePointType;
69  typedef typename InputImageType::SpacingType InputImageSpacingType;
71  typedef typename OutputImageType::Pointer OutputImagePointer;
72  typedef typename OutputImageType::SpacingType OutputImageSpacing;
76  typedef typename OutputImageType::DirectionType OutputImageDirectionType;
77  typedef typename OutputImageType::PointType OutputImageOriginType;
78  typedef ContinuousIndex<TScalarType, InputImageType::ImageDimension> ContinuousIndexType;
79  typedef Point<TScalarType, InputImageType::ImageDimension> PointType;
80  typedef itk::NearestNeighborInterpolateImageFunction< TInputImage, TScalarType> NearestNeighbourInterpolatorType;
82  typedef std::map<unsigned long int, FiniteDifferenceVoxelType*> MapType;
83  typedef std::pair<unsigned long int, FiniteDifferenceVoxelType*> PairType;
84  typedef typename MapType::const_iterator IteratorType;
85 
87  itkSetMacro(VoxelMultiplicationFactor, int);
88  itkGetMacro(VoxelMultiplicationFactor, int);
89 
91  MapType* GetMapOfVoxels() { return &m_MapOfVoxels; }
92 
93 protected:
96 
98  virtual void PrintSelf(std::ostream&, Indent) const;
99 
100  // The main filter method. Note, single threaded.
101  virtual void GenerateData();
102 
103 private:
104  HighResLaplacianSolverImageFilter(const Self&); //purposely not implemented
105  void operator=(const Self&); //purposely not implemented
106 
108  int m_VoxelMultiplicationFactor;
109 
110  bool GetValue(InputImageType* highResImage,
111  InputImageType* lowResImage,
112  NearestNeighbourInterpolatorType* interpolator,
113  InputImageIndexType& index,
114  InputImagePixelType& result);
115 
116  void InsertNeighbour(
117  FiniteDifferenceVoxelType* greyVoxel,
118  InputImagePixelType& neighbourValue,
119  unsigned long int& mapIndexOfVoxel,
120  InputImageIndexType& itkImageIndexOfVoxel,
121  MapType& map,
122  unsigned long int& numberOfDuplicates,
123  unsigned long int& numberOfBoundaryPoints
124  );
125 
126  MapType m_MapOfVoxels;
127 
128  float m_Tolerance;
129 };
130 
131 } // end namespace itk
132 
133 #ifndef ITK_MANUAL_INSTANTIATION
134 #include "itkHighResLaplacianSolverImageFilter.txx"
135 #endif
136 
137 #endif
HighResLaplacianSolverImageFilter Self
Definition: itkHighResLaplacianSolverImageFilter.h:44
itk::NearestNeighborInterpolateImageFunction< TInputImage, TScalarType > NearestNeighbourInterpolatorType
Definition: itkHighResLaplacianSolverImageFilter.h:80
Simple data type to hold a voxel value, and indexes that can be used to refer to other voxels...
Definition: itkFiniteDifferenceVoxel.h:32
ImageType::SizeType SizeType
Definition: niftkMakeLapUSProbeBasicModel.cxx:31
InputImageType::SpacingType InputImageSpacingType
Definition: itkHighResLaplacianSolverImageFilter.h:69
OutputImageType::IndexType OutputImageIndexType
Definition: itkHighResLaplacianSolverImageFilter.h:75
std::map< unsigned long int, FiniteDifferenceVoxelType * > MapType
Definition: itkHighResLaplacianSolverImageFilter.h:82
OutputImageType::RegionType OutputImageRegionType
Definition: itkHighResLaplacianSolverImageFilter.h:73
Definition: niftkITKAffineResampleImage.cxx:74
OutputImageType::Pointer OutputImagePointer
Definition: itkHighResLaplacianSolverImageFilter.h:71
ImageType::IndexType IndexType
Definition: niftkMakeLapUSProbeBasicModel.cxx:32
InputImageType::PointType InputImageOriginType
Definition: itkHighResLaplacianSolverImageFilter.h:67
TScalarType OutputPixelType
Definition: itkHighResLaplacianSolverImageFilter.h:53
OutputImageType::SizeType OutputImageSizeType
Definition: itkHighResLaplacianSolverImageFilter.h:74
InputImageType::RegionType InputImageRegionType
Definition: itkHighResLaplacianSolverImageFilter.h:65
GLuint64EXT * result
Definition: glew.h:12084
Solves Laplace equation over the cortical volume, but can be run at very high resolution, by setting the VoxelMultiplicationFactor to determine an effective voxel size.
Definition: itkHighResLaplacianSolverImageFilter.h:39
MapType * GetMapOfVoxels()
Definition: itkHighResLaplacianSolverImageFilter.h:91
OutputImageType::DirectionType OutputImageDirectionType
Definition: itkHighResLaplacianSolverImageFilter.h:76
InputImageType::Pointer InputImagePointer
Definition: itkHighResLaplacianSolverImageFilter.h:62
std::pair< unsigned long int, FiniteDifferenceVoxelType * > PairType
Definition: itkHighResLaplacianSolverImageFilter.h:83
float PixelType
Definition: niftkBreastDCEandADC.cxx:88
InputImageType::IndexType InputImageIndexType
Definition: itkHighResLaplacianSolverImageFilter.h:63
ImageType::RegionType RegionType
Definition: niftkMakeLapUSProbeBasicModel.cxx:30
OutputImageType::SpacingType OutputImageSpacing
Definition: itkHighResLaplacianSolverImageFilter.h:72
FiniteDifferenceVoxel< InputImageType::ImageDimension, 2, InputImagePixelType, InputImagePixelType > FiniteDifferenceVoxelType
Definition: itkHighResLaplacianSolverImageFilter.h:81
Point< TScalarType, InputImageType::ImageDimension > PointType
Definition: itkHighResLaplacianSolverImageFilter.h:79
GLuint index
Definition: glew.h:1798
OutputImageType::PointType OutputImageOriginType
Definition: itkHighResLaplacianSolverImageFilter.h:77
SmartPointer< Self > Pointer
Definition: itkHighResLaplacianSolverImageFilter.h:46
Simultaneous itk::Image and itk::Array (and hence vnl_vector) class.
InputImageType::SizeType InputImageSizeType
Definition: itkHighResLaplacianSolverImageFilter.h:66
LaplacianSolverImageFilter< TInputImage > Superclass
Definition: itkHighResLaplacianSolverImageFilter.h:45
MapType::const_iterator IteratorType
Definition: itkHighResLaplacianSolverImageFilter.h:84
Image< OutputPixelType, TInputImage::ImageDimension > OutputImageType
Definition: itkHighResLaplacianSolverImageFilter.h:70
ContinuousIndex< TScalarType, InputImageType::ImageDimension > ContinuousIndexType
Definition: itkHighResLaplacianSolverImageFilter.h:78
InputImageType::PointType InputImagePointType
Definition: itkHighResLaplacianSolverImageFilter.h:68
TInputImage::PixelType InputPixelType
Definition: itkHighResLaplacianSolverImageFilter.h:58
SmartPointer< const Self > ConstPointer
Definition: itkHighResLaplacianSolverImageFilter.h:47
TInputImage InputImageType
Definition: itkHighResLaplacianSolverImageFilter.h:61
Solves Laplace equation over the cortical volume.
Definition: itkLaplacianSolverImageFilter.h:49
InputImageType::PixelType InputImagePixelType
Definition: itkHighResLaplacianSolverImageFilter.h:64