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://oncora1.lyon.fnclcc.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 __clitkPointListTransform_h
19 #define __clitkPointListTransform_h
20 #include "clitkList.h"
21 #include "clitkLists.h"
24 #include "itkTransform.h"
25 #include "itkVectorInterpolateImageFunction.h"
30 template < class TScalarType=double, unsigned int NDimensions=4,unsigned int NOutputDimensions=4 >
31 class ITK_EXPORT PointListTransform : public itk::Transform< TScalarType, NDimensions, NOutputDimensions >
34 /** Standard class typedefs. */
35 typedef PointListTransform Self;
36 typedef itk::Transform< TScalarType, NDimensions, NOutputDimensions > Superclass;
37 typedef itk::SmartPointer<Self> Pointer;
38 typedef itk::SmartPointer<const Self> ConstPointer;
40 /** New macro for creation of through the object factory. */
43 /** Run-time type information (and related methods). */
44 itkTypeMacro( PointListTransform, Transform );
46 /** Dimension of the domain space. */
47 itkStaticConstMacro(SpaceDimension, unsigned int, NDimensions-1);
48 itkStaticConstMacro(ImageDimension, unsigned int, NDimensions);
51 typedef itk::Point<double, SpaceDimension> SpacePointType;
52 typedef itk::Point<double, ImageDimension> SpaceTimePointType;
53 typedef clitk::List<SpacePointType> PointListType;
54 typedef clitk::Lists<SpacePointType> PointListsType;
55 typedef itk::Vector<double, SpaceDimension> PointListImagePixelType;
56 typedef itk::Image<PointListImagePixelType, 1> PointListImageType;
57 typedef itk::VectorInterpolateImageFunction<PointListImageType, double> InterpolatorType;
59 void SetPointList (PointListType p){m_PointList=p;}
60 void SetPointLists (PointListsType p){m_PointLists=p;}
61 void SetInterpolator (typename InterpolatorType::Pointer i){ m_Interpolator=i;}
63 /** Standard coordinate point type for this class. */
64 typedef itk::Point<TScalarType, itkGetStaticConstMacro(ImageDimension)> InputPointType;
65 typedef itk::Point<TScalarType, itkGetStaticConstMacro(ImageDimension)> OutputPointType;
68 PointListType GetCorrespondingPointList(const InputPointType &inputPoint) const;
69 OutputPointType TransformPoint(const InputPointType &point ) const;
73 ~PointListTransform(){;}
76 PointListTransform(const Self&); //purposely not implemented
77 void operator=(const Self&); //purposely not implemented
79 PointListsType m_PointLists;
80 mutable PointListType m_PointList;
81 typename InterpolatorType::Pointer m_Interpolator;
84 }; //class PointListTransform
91 #ifndef ITK_MANUAL_INSTANTIATION
92 #include "clitkPointListTransform.txx"
95 #endif /* __clitkPointListTransform_h */