ITK  4.9.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 > >
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;
97  typedef typename FeaturePointsType::PointType FeaturePointsPhysicalCoordinates;
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:
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 ) throw ( ExceptionObject );
176 
178  virtual void AfterThreadedGenerateData();
179 
181  virtual void GenerateData() ITK_OVERRIDE;
182 
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  BlockMatchingImageFilter( const BlockMatchingImageFilter & ) ITK_DELETE_FUNCTION;
201  void operator=( const BlockMatchingImageFilter & ) ITK_DELETE_FUNCTION;
202 
203  // algorithm parameters
206 
207  // temporary dynamic arrays for storing threads outputs
211 
212 };
213 } // end namespace itk
214 
215 #ifndef ITK_MANUAL_INSTANTIATION
216 #include "itkBlockMatchingImageFilter.hxx"
217 #endif
218 
219 #endif
virtual void BeforeThreadedGenerateData()
SmartPointer< const Self > ConstPointer
DisplacementsType::ConstPointer DisplacementsConstPointer
Light weight base class for most itk classes.
void PrintSelf(std::ostream &os, Indent indent) const override
ImageRegion< ImageDimension > ImageRegionType
virtual void EnlargeOutputRequestedRegion(DataObject *output) override
static ITK_THREAD_RETURN_TYPE ThreaderCallback(void *arg)
virtual DataObject::Pointer MakeOutput(ProcessObject::DataObjectPointerArraySizeType idx) override
MeshToMeshFilter< FeaturePointsType, DisplacementsType > Superclass
virtual void AfterThreadedGenerateData()
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...
virtual void ThreadedGenerateData(ThreadIdType threadId)
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
Standard exception handling object.
FeaturePointsType::ConstPointer FeaturePointsConstPointer
DisplacementsType::PixelType DisplacementsVector
MovingImageType::ConstPointer MovingImageConstPointer
unsigned int ThreadIdType
Definition: itkIntTypes.h:159
virtual DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx) override
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
virtual void GenerateData() override
virtual void GenerateOutputInformation() override
Represent a n-dimensional index in a n-dimensional image.
Definition: itkIndex.h:71
Base class for all data objects in ITK.
DataObject * GetOutput(const DataObjectIdentifierType &key)