1 /*=========================================================================
2 Program: vv http://www.creatis.insa-lyon.fr/rio/vv
5 - University of LYON http://www.universite-lyon.fr/
6 - Léon Bérard cancer center http://www.centreleonberard.fr
7 - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
9 This software is distributed WITHOUT ANY WARRANTY; without even
10 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11 PURPOSE. See the copyright notices for more information.
13 It is distributed under dual licence
15 - BSD See included LICENSE.txt file
16 - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17 ===========================================================================**/
18 #ifndef __clitkForwardWarpImageFilter_h
19 #define __clitkForwardWarpImageFilter_h
20 #include "clitkImageCommon.h"
23 #include "itkImageToImageFilter.h"
25 #include "itkImageRegionIterator.h"
26 #include "itkImageRegionIteratorWithIndex.h"
27 #include "itkNumericTraits.h"
28 #include "itkSimpleFastMutexLock.h"
33 template < class InputImageType, class OutputImageType, class DeformationFieldType >
34 class ForwardWarpImageFilter : public itk::ImageToImageFilter<InputImageType, OutputImageType>
38 typedef ForwardWarpImageFilter Self;
39 typedef itk::ImageToImageFilter<InputImageType,OutputImageType> Superclass;
40 typedef itk::SmartPointer<Self> Pointer;
41 typedef itk::SmartPointer<const Self> ConstPointer;
44 /** Method for creation through the object factory. */
47 /** Determine the image dimension. */
48 itkStaticConstMacro(ImageDimension, unsigned int,
49 InputImageType::ImageDimension );
50 itkStaticConstMacro(InputImageDimension, unsigned int,
51 OutputImageType::ImageDimension );
52 itkStaticConstMacro(DeformationFieldDimension, unsigned int,
53 DeformationFieldType::ImageDimension );
57 typedef double CoordRepType;
58 typedef itk::Image<double, ImageDimension> WeightsImageType;
59 typedef itk::Image<itk::SimpleFastMutexLock, ImageDimension> MutexImageType;
62 typedef itk::Point<CoordRepType,itkGetStaticConstMacro(ImageDimension)> PointType;
64 /** Inherit some types from the superclass. */
65 typedef typename OutputImageType::IndexType IndexType;
66 typedef typename OutputImageType::SizeType SizeType;
67 typedef typename OutputImageType::PixelType PixelType;
68 typedef typename OutputImageType::SpacingType SpacingType;
70 //Set & Get Methods (inline)
71 itkSetMacro( Verbose, bool);
72 itkSetMacro( EdgePaddingValue, PixelType );
73 itkSetMacro( DeformationField, typename DeformationFieldType::Pointer);
74 void SetNumberOfThreads(unsigned int r )
76 m_NumberOfThreadsIsGiven=true;
79 itkSetMacro(ThreadSafe, bool);
82 //ITK concept checking, why not?
83 #ifdef ITK_USE_CONCEPT_CHECKING
84 /** Begin concept checking */
85 itkConceptMacro(SameDimensionCheck1,
86 (itk::Concept::SameDimension<ImageDimension, InputImageDimension>));
87 itkConceptMacro(SameDimensionCheck2,
88 (itk::Concept::SameDimension<ImageDimension, DeformationFieldDimension>));
89 itkConceptMacro(InputHasNumericTraitsCheck,
90 (itk::Concept::HasNumericTraits<typename InputImageType::PixelType>));
91 itkConceptMacro(DeformationFieldHasNumericTraitsCheck,
92 (itk::Concept::HasNumericTraits<typename DeformationFieldType::PixelType::ValueType>));
93 /** End concept checking */
97 ForwardWarpImageFilter();
98 ~ForwardWarpImageFilter() {};
104 bool m_NumberOfThreadsIsGiven;
105 unsigned int m_NumberOfThreads;
106 PixelType m_EdgePaddingValue;
107 typename DeformationFieldType::Pointer m_DeformationField;
116 } // end namespace clitk
117 #ifndef ITK_MANUAL_INSTANTIATION
118 #include "clitkForwardWarpImageFilter.txx"
121 #endif // #define __clitkForwardWarpImageFilter_h