go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
elxBSplineTransformWithDiffusion.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright UMC Utrecht and contributors
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 __elxBSplineTransformWithDiffusion_H__
19 #define __elxBSplineTransformWithDiffusion_H__
20 
21 /* For easy changing the BSplineOrder: */
22 #define __VSplineOrder 3
23 
24 #include "elxIncludes.h" // include first to avoid MSVS warning
27 //#include "itkBSplineCombinationTransform.h"
28 #include "itkBSplineResampleImageFilterBase.h"
29 #include "itkBSplineUpsampleImageFilter.h"
30 
31 #include "itkImageRegionConstIterator.h"
32 
36 #include "itkImageFileReader.h"
37 #include "itkImageFileWriter.h"
38 #include "itkResampleImageFilter.h"
39 #include "itkCastImageFilter.h"
40 #include "itkMaximumImageFilter.h"
41 #include "itkImageRegionIterator.h"
42 #include "itkBSplineInterpolateImageFunction.h"
43 
44 namespace elastix
45 {
46 
158 template< class TElastix >
160  public
162  itk::AdvancedCombinationTransform<
163  //BSplineCombinationTransform<
164  typename elx::TransformBase< TElastix >::CoordRepType,
165  elx::TransformBase< TElastix >::FixedImageDimension > >,
166  //elx::TransformBase<TElastix>::FixedImageDimension, __VSplineOrder > >,
167  public
168  TransformBase< TElastix >
169 {
170 public:
171 
176  //BSplineCombinationTransform<
179  //elx::TransformBase<TElastix>::FixedImageDimension, __VSplineOrder > >
182 
187  typename elx::TransformBase< TElastix >::CoordRepType,
190 
191  typedef itk::SmartPointer< Self > Pointer;
192  typedef itk::SmartPointer< const Self > ConstPointer;
193 
195  itkNewMacro( Self );
196 
199 
204  elxClassNameMacro( "BSplineTransformWithDiffusion" );
205 
207  itkStaticConstMacro( SpaceDimension, unsigned int, Superclass2::FixedImageDimension );
208 
210  itkStaticConstMacro( SplineOrder, unsigned int, __VSplineOrder );
211 
224 
238 
251 
255  typedef typename VectorImageType::Pointer VectorImagePointer;
256 
258  typedef typename ElastixType::FixedImageType FixedImageELXType;
259  typedef typename ElastixType::MovingImageType MovingImageELXType;
260 
262  typedef itk::Image< short,
263  itkGetStaticConstMacro( SpaceDimension ) > DummyImageType;
264  typedef itk::ImageRegionConstIterator<
268 
270  typedef itk::ImageFileReader< VectorImageType > VectorReaderType;
271  typedef typename VectorImageType::PixelType VectorType;
272  typedef itk::ImageRegionIterator<
273  VectorImageType > VectorImageIteratorType;
274  typedef FixedImageELXType GrayValueImageType;
275  typedef typename GrayValueImageType::Pointer GrayValueImagePointer;
276  typedef typename GrayValueImageType::PixelType GrayValuePixelType;
277  typedef itk::ImageRegionIterator<
278  GrayValueImageType > GrayValueImageIteratorType;
279  typedef itk::MaximumImageFilter<
281  GrayValueImageType > MaximumImageFilterType;
283  VectorImageType, GrayValueImageType > DiffusionFilterType;
285  typedef typename VectorImageType::SizeType RadiusType;
286  typedef itk::ResampleImageFilter<
288  CoordRepType > ResamplerType1;
289  typedef typename ResamplerType1::Pointer ResamplerPointer1;
290  typedef itk::ResampleImageFilter<
292  CoordRepType > ResamplerType2;
293  typedef typename ResamplerType2::Pointer ResamplerPointer2;
294  typedef itk::BSplineInterpolateImageFunction<
295  GrayValueImageType > InterpolatorType;
296  typedef typename InterpolatorType::Pointer InterpolatorPointer;
297  typedef itk::ImageFileReader< GrayValueImageType > GrayValueImageReaderType;
298  typedef typename GrayValueImageReaderType::Pointer GrayValueImageReaderPointer;
299  typedef itk::ImageFileWriter< GrayValueImageType > GrayValueImageWriterType;
300  typedef itk::ImageFileWriter< VectorImageType > DeformationFieldWriterType;
301 
307  virtual void BeforeRegistration( void );
308 
312  virtual void BeforeEachResolution( void );
313 
317  virtual void AfterEachIteration( void );
318 
322  virtual void AfterRegistration( void );
323 
325  virtual void SetInitialGrid( bool upsampleGridOption );
326 
328  virtual void IncreaseScale( void );
329 
331  virtual void ReadFromFile( void );
332 
334  virtual void WriteToFile( const ParametersType & param ) const;
335 
337  void DiffuseDeformationField( void );
338 
349  virtual OutputPointType TransformPoint( const InputPointType & point ) const;
350 
362 protected:
363 
368 
370  SpacingType m_GridSpacingFactor;
371 
372 private:
373 
375  BSplineTransformWithDiffusion( const Self & ); // purposely not implemented
377  void operator=( const Self & ); // purposely not implemented
378 
380  DiffusionFilterPointer m_Diffusion;
381  VectorImagePointer m_DeformationField;
382  VectorImagePointer m_DiffusedField;
383  GrayValueImagePointer m_GrayValueImage1;
384  GrayValueImagePointer m_GrayValueImage2;
385  GrayValueImagePointer m_MovingSegmentationImage;
386  GrayValueImagePointer m_FixedSegmentationImage;
387  GrayValueImageReaderPointer m_MovingSegmentationReader;
388  GrayValueImageReaderPointer m_FixedSegmentationReader;
391  ResamplerPointer1 m_Resampler1;
392  ResamplerPointer2 m_Resampler2;
393  InterpolatorPointer m_Interpolator;
396  SpacingType m_DeformationSpacing;
397 
402  GrayValuePixelType m_ThresholdHU;
405 
407  ParametersType m_BSplineParameters;
408 
412  BSplineTransformPointer m_BSplineTransform;
413 
414 };
415 
416 } // end namespace elastix
417 
418 #ifndef ITK_MANUAL_INSTANTIATION
419 #include "elxBSplineTransformWithDiffusion.hxx"
420 #endif
421 
422 #endif // end #ifndef __elxBSplineTransformWithDiffusion_H__
This class combines two transforms: an 'initial transform' with a 'current transform'.
itk::ImageRegionIterator< GrayValueImageType > GrayValueImageIteratorType
itk::DeformationFieldRegulizer< itk::AdvancedCombinationTransform< typename elx::TransformBase< TElastix >::CoordRepType, elx::TransformBase< TElastix >::FixedImageDimension > > Superclass1
itk::Image< short, itkGetStaticConstMacro(SpaceDimension) > DummyImageType
Superclass::RegistrationPointer RegistrationPointer
Superclass1::IntermediaryDFTransformType IntermediaryDFTransformType
Deformable transform using a B-spline representation.
An itk transform based on a DeformationVectorField.
Superclass::OutputVectorType OutputVectorType
itk::ImageFileWriter< VectorImageType > DeformationFieldWriterType
itk::BSplineInterpolateImageFunction< GrayValueImageType > InterpolatorType
Superclass::OutputPointType OutputPointType
virtual OutputPointType TransformPoint(const InputPointType &point) const
itk::ImageRegionConstIterator< DummyImageType > DummyIteratorType
itk::AdvancedBSplineDeformableTransform< typename elx::TransformBase< TElastix >::CoordRepType, elx::TransformBase< TElastix >::FixedImageDimension, __VSplineOrder > BSplineTransformType
itk::MaximumImageFilter< GrayValueImageType, GrayValueImageType, GrayValueImageType > MaximumImageFilterType
itk::ImageRegionIterator< VectorImageType > VectorImageIteratorType
GrayValueImageReaderType::Pointer GrayValueImageReaderPointer
Returns the weights over the support region used for B-spline interpolation/reconstruction.
itk::ResampleImageFilter< GrayValueImageType, GrayValueImageType, CoordRepType > ResamplerType2
Superclass::InputVnlVectorType InputVnlVectorType
BSplineTransformType::ContinuousIndexType ContinuousIndexType
ElastixType::FixedImageType FixedImageType
itk::VectorMeanDiffusionImageFilter< VectorImageType, GrayValueImageType > DiffusionFilterType
virtual void WriteToFile(void) const
Superclass::ParametersType ParametersType
Superclass::ElastixType ElastixType
Transform maps points, vectors and covariant vectors from an input space to an output space...
#define __VSplineOrder
itk::ImageFileReader< VectorImageType > VectorReaderType
WeightsFunctionType::ContinuousIndexType ContinuousIndexType
BSplineTransformType::WeightsFunctionType WeightsFunctionType
itkStaticConstMacro(SpaceDimension, unsigned int, Superclass2::FixedImageDimension)
Superclass::OutputCovariantVectorType OutputCovariantVectorType
virtual void SetInitialGrid(bool upsampleGridOption)
Superclass2::CombinationTransformType CombinationTransformType
ElastixType::MovingImageType MovingImageType
Superclass1::InputCovariantVectorType InputCovariantVectorType
Superclass::ElastixPointer ElastixPointer
Superclass::OutputVnlVectorType OutputVnlVectorType
Applies an averaging filter to an image.
ElastixType::CoordRepType CoordRepType
Superclass::RegistrationType RegistrationType
elxClassNameMacro("BSplineTransformWithDiffusion")
Superclass1::OutputCovariantVectorType OutputCovariantVectorType
This class is the elastix base class for all Transforms.
Superclass::ConfigurationType ConfigurationType
Superclass::ConfigurationPointer ConfigurationPointer
Superclass::InputPointType InputPointType
Superclass2::ConfigurationPointer ConfigurationPointer
Superclass::InputCovariantVectorType InputCovariantVectorType
Superclass::InputVectorType InputVectorType
itk::ImageFileReader< GrayValueImageType > GrayValueImageReaderType
This class combines a B-spline transform with the diffusion/filtering of the deformation field...
itk::ResampleImageFilter< MovingImageELXType, GrayValueImageType, CoordRepType > ResamplerType1
itk::ImageFileWriter< GrayValueImageType > GrayValueImageWriterType
BSplineTransformType::ParameterIndexArrayType ParameterIndexArrayType
IntermediaryDFTransformType::CoefficientVectorImageType VectorImageType
This class combines any itk transform with the DeformationFieldTransform.


Generated on 04-09-2015 for elastix by doxygen 1.8.9.1 elastix logo