ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkBlockMatchingImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef itkBlockMatchingImageFilter_h
19 #define itkBlockMatchingImageFilter_h
20 
21 #include "itkMeshToMeshFilter.h"
22 #include "itkImage.h"
23 #include "itkPointSet.h"
24 #include "itkVector.h"
26 
27 
28 namespace itk
29 {
67 template<
68  typename TFixedImage,
69  typename TMovingImage = TFixedImage,
70  typename TFeatures = PointSet< Matrix< SpacePrecisionType, TFixedImage::ImageDimension, TFixedImage::ImageDimension>, TFixedImage::ImageDimension >,
71  class TDisplacements = PointSet< Vector< typename TFeatures::PointType::ValueType, TFeatures::PointDimension >, TFeatures::PointDimension >,
72  class TSimilarities = PointSet< SpacePrecisionType, TDisplacements::PointDimension > >
73 class ITK_TEMPLATE_EXPORT BlockMatchingImageFilter:
74 public MeshToMeshFilter< TFeatures, TDisplacements>
75 {
76 public:
77  itkStaticConstMacro(ImageDimension, unsigned, TFixedImage::ImageDimension);
78 
83 
85  typedef TFixedImage FixedImageType;
86  typedef typename FixedImageType::ConstPointer FixedImageConstPointer;
87  typedef typename FixedImageType::PixelType FixedImagePixelType;
88 
90  typedef TMovingImage MovingImageType;
91  typedef typename MovingImageType::ConstPointer MovingImageConstPointer;
92 
94  typedef TFeatures FeaturePointsType;
95  typedef typename FeaturePointsType::Pointer FeaturePointsPointer;
96  typedef typename FeaturePointsType::ConstPointer FeaturePointsConstPointer;
98 
100  typedef TDisplacements DisplacementsType;
101  typedef typename DisplacementsType::Pointer DisplacementsPointer;
102  typedef typename DisplacementsType::ConstPointer DisplacementsConstPointer;
103  typedef typename DisplacementsType::PixelType DisplacementsVector;
104 
106  typedef TSimilarities SimilaritiesType;
107  typedef typename SimilaritiesType::Pointer SimilaritiesPointer;
108  typedef typename SimilaritiesType::ConstPointer SimilaritiesConstPointer;
109  typedef typename SimilaritiesType::PixelType SimilaritiesValue;
110 
116 
118  itkNewMacro(Self);
119 
122 
124  itkSetMacro(BlockRadius, ImageSizeType);
125  itkGetConstMacro(BlockRadius, ImageSizeType);
127 
129  itkSetMacro(SearchRadius, ImageSizeType);
130  itkGetConstMacro(SearchRadius, ImageSizeType);
132 
134  itkSetInputMacro(FixedImage, FixedImageType);
135  itkGetInputMacro(FixedImage, FixedImageType);
137 
139  itkSetInputMacro(MovingImage, MovingImageType);
140  itkGetInputMacro(MovingImage, MovingImageType);
142 
144  itkSetInputMacro(FeaturePoints, FeaturePointsType);
145  itkGetInputMacro(FeaturePoints, FeaturePointsType);
147 
149  {
150  return dynamic_cast< DisplacementsType * >( this->ProcessObject::GetOutput( 0 ) );
151  }
152 
154  {
155  return dynamic_cast< SimilaritiesType * >( this->ProcessObject::GetOutput( 1 ) );
156  }
157 
158 protected:
160  using Superclass::MakeOutput;
161  virtual DataObject::Pointer MakeOutput( ProcessObject::DataObjectPointerArraySizeType idx ) ITK_OVERRIDE;
162 
167  virtual void GenerateOutputInformation() ITK_OVERRIDE;
168 
170  virtual void EnlargeOutputRequestedRegion(DataObject * output) ITK_OVERRIDE;
171 
173  virtual void BeforeThreadedGenerateData();
174 
175  virtual void ThreadedGenerateData( ThreadIdType threadId );
176 
178  virtual void AfterThreadedGenerateData();
179 
181  virtual void GenerateData() ITK_OVERRIDE;
182 
184  ~BlockMatchingImageFilter() ITK_OVERRIDE;
185 
186  void PrintSelf( std::ostream & os, Indent indent ) const ITK_OVERRIDE;
187 
191  static ITK_THREAD_RETURN_TYPE ThreaderCallback(void *arg);
192 
195  struct ThreadStruct {
197  };
198 
199 private:
200  ITK_DISALLOW_COPY_AND_ASSIGN(BlockMatchingImageFilter);
201 
202  // algorithm parameters
205 
206  // temporary dynamic arrays for storing threads outputs
210 
211 };
212 } // end namespace itk
213 
214 #ifndef ITK_MANUAL_INSTANTIATION
215 #include "itkBlockMatchingImageFilter.hxx"
216 #endif
217 
218 #endif
SmartPointer< const Self > ConstPointer
DisplacementsType::ConstPointer DisplacementsConstPointer
Light weight base class for most itk classes.
ImageRegion< ImageDimension > ImageRegionType
MeshToMeshFilter< FeaturePointsType, DisplacementsType > Superclass
FixedImageType::PixelType FixedImagePixelType
An image region represents a structured region of data.
MeshToMeshFilter is the base class for all process objects that output mesh data, and require mesh da...
SimilaritiesType::PixelType SimilaritiesValue
SimilaritiesType::Pointer SimilaritiesPointer
unsigned long SizeValueType
Definition: itkIntTypes.h:143
#define ITK_THREAD_RETURN_TYPE
DataObjectPointerArray::size_type DataObjectPointerArraySizeType
FeaturePointsType::Pointer FeaturePointsPointer
FeaturePointsType::ConstPointer FeaturePointsConstPointer
DisplacementsType::PixelType DisplacementsVector
MovingImageType::ConstPointer MovingImageConstPointer
unsigned int ThreadIdType
Definition: itkIntTypes.h:159
SimilaritiesType::ConstPointer SimilaritiesConstPointer
DisplacementsVector * m_DisplacementsVectorsArray
DisplacementsType::Pointer DisplacementsPointer
Computes displacements of given points from a fixed image in a floating image.
FixedImageType::ConstPointer FixedImageConstPointer
FeaturePointsType::PointType FeaturePointsPhysicalCoordinates
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Represent a n-dimensional index in a n-dimensional image.
Definition: itkIndex.h:72
Base class for all data objects in ITK.
DataObject * GetOutput(const DataObjectIdentifierType &key)