ITK  5.0.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  ITK_DISALLOW_COPY_AND_ASSIGN(BlockMatchingImageFilter);
78 
79  static constexpr unsigned ImageDimension = TFixedImage::ImageDimension;
80 
85 
87  using FixedImageType = TFixedImage;
88  using FixedImageConstPointer = typename FixedImageType::ConstPointer;
89  using FixedImagePixelType = typename FixedImageType::PixelType;
90 
92  using MovingImageType = TMovingImage;
93  using MovingImageConstPointer = typename MovingImageType::ConstPointer;
94 
96  using FeaturePointsType = TFeatures;
97  using FeaturePointsPointer = typename FeaturePointsType::Pointer;
98  using FeaturePointsConstPointer = typename FeaturePointsType::ConstPointer;
100 
102  using DisplacementsType = TDisplacements;
103  using DisplacementsPointer = typename DisplacementsType::Pointer;
104  using DisplacementsConstPointer = typename DisplacementsType::ConstPointer;
105  using DisplacementsVector = typename DisplacementsType::PixelType;
106 
108  using SimilaritiesType = TSimilarities;
109  using SimilaritiesPointer = typename SimilaritiesType::Pointer;
110  using SimilaritiesConstPointer = typename SimilaritiesType::ConstPointer;
111  using SimilaritiesValue = typename SimilaritiesType::PixelType;
112 
118 
120  itkNewMacro(Self);
121 
124 
126  itkSetMacro(BlockRadius, ImageSizeType);
127  itkGetConstMacro(BlockRadius, ImageSizeType);
129 
131  itkSetMacro(SearchRadius, ImageSizeType);
132  itkGetConstMacro(SearchRadius, ImageSizeType);
134 
136  itkSetInputMacro(FixedImage, FixedImageType);
137  itkGetInputMacro(FixedImage, FixedImageType);
139 
141  itkSetInputMacro(MovingImage, MovingImageType);
142  itkGetInputMacro(MovingImage, MovingImageType);
144 
146  itkSetInputMacro(FeaturePoints, FeaturePointsType);
147  itkGetInputMacro(FeaturePoints, FeaturePointsType);
149 
151  {
152  return dynamic_cast< DisplacementsType * >( this->ProcessObject::GetOutput( 0 ) );
153  }
154 
156  {
157  return dynamic_cast< SimilaritiesType * >( this->ProcessObject::GetOutput( 1 ) );
158  }
159 
160 protected:
162  using Superclass::MakeOutput;
164 
169  void GenerateOutputInformation() override;
170 
172  void EnlargeOutputRequestedRegion(DataObject * output) override;
173 
175  virtual void BeforeThreadedGenerateData();
176 
177  virtual void ThreadedGenerateData( ThreadIdType threadId );
178 
180  virtual void AfterThreadedGenerateData();
181 
183  void GenerateData() override;
184 
186  ~BlockMatchingImageFilter() override = default;
187 
188  void PrintSelf( std::ostream & os, Indent indent ) const override;
189 
193  static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION ThreaderCallback(void *arg);
194 
197  struct ThreadStruct {
199  };
200 
201 private:
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
Light weight base class for most itk classes.
DataObjectPointerArray::size_type DataObjectPointerArraySizeType
typename DisplacementsType::ConstPointer DisplacementsConstPointer
Represent a n-dimensional index in a n-dimensional image.
Definition: itkIndex.h:66
typename SimilaritiesType::Pointer SimilaritiesPointer
typename FeaturePointsType::Pointer FeaturePointsPointer
unsigned long SizeValueType
Definition: itkIntTypes.h:83
typename FeaturePointsType::ConstPointer FeaturePointsConstPointer
An image region represents a structured region of data.
typename SimilaritiesType::ConstPointer SimilaritiesConstPointer
itk::ITK_THREAD_RETURN_TYPE ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION
MeshToMeshFilter is the base class for all process objects that output mesh data, and require mesh da...
typename FeaturePointsType::PointType FeaturePointsPhysicalCoordinates
typename DisplacementsType::PixelType DisplacementsVector
typename FixedImageType::ConstPointer FixedImageConstPointer
typename DisplacementsType::Pointer DisplacementsPointer
unsigned int ThreadIdType
Definition: itkIntTypes.h:99
DisplacementsVector * m_DisplacementsVectorsArray
Computes displacements of given points from a fixed image in a floating image.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
typename FixedImageType::PixelType FixedImagePixelType
typename SimilaritiesType::PixelType SimilaritiesValue
Base class for all data objects in ITK.
typename MovingImageType::ConstPointer MovingImageConstPointer
DataObject * GetOutput(const DataObjectIdentifierType &key)