X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=registration%2FclitkShapedBLUTSpatioTemporalDeformableTransformInitializer.h;fp=registration%2FclitkShapedBLUTSpatioTemporalDeformableTransformInitializer.h;h=8c5d2868fdcfab37f16a5d06d5f99818a91a1a34;hb=657652a78c2e2717a6f77e027049173442ca29f0;hp=0000000000000000000000000000000000000000;hpb=8abe9edbdc63a33f8fbb1f321073b762e08be9aa;p=clitk.git diff --git a/registration/clitkShapedBLUTSpatioTemporalDeformableTransformInitializer.h b/registration/clitkShapedBLUTSpatioTemporalDeformableTransformInitializer.h new file mode 100755 index 0000000..8c5d286 --- /dev/null +++ b/registration/clitkShapedBLUTSpatioTemporalDeformableTransformInitializer.h @@ -0,0 +1,183 @@ +/*========================================================================= + Program: vv http://www.creatis.insa-lyon.fr/rio/vv + + Authors belong to: + - University of LYON http://www.universite-lyon.fr/ + - Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr + - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the copyright notices for more information. + + It is distributed under dual licence + + - BSD See included LICENSE.txt file + - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html +======================================================================-====*/ +#ifndef __clitkShapedBLUTSpatioTemporalDeformableTransformInitializer_h +#define __clitkShapedBLUTSpatioTemporalDeformableTransformInitializer_h +#include "clitkResampleBSplineDeformableTransformImageFilter.h" + +#include "itkObject.h" +#include "itkObjectFactory.h" +#include "itkImageFileReader.h" +#include + +namespace clitk +{ + + +template < class TTransform, class TImage > +class ITK_EXPORT ShapedBLUTSpatioTemporalDeformableTransformInitializer : public itk::Object +{ +public: + /** Standard class typedefs. */ + typedef ShapedBLUTSpatioTemporalDeformableTransformInitializer Self; + typedef itk::Object Superclass; + typedef itk::SmartPointer Pointer; + typedef itk::SmartPointer ConstPointer; + + /** New macro for creation of through a Smart Pointer. */ + itkNewMacro( Self ); + + /** Run-time type information (and related methods). */ + itkTypeMacro( ShapedBLUTSpatioTemporalDeformableTransformInitializer, Object ); + + // Typedefs + typedef TTransform TransformType; + typedef typename TransformType::Pointer TransformPointer; + typedef typename TransformType::RegionType RegionType; + typedef typename TransformType::OriginType OriginType; + typedef typename TransformType::DirectionType DirectionType; + typedef typename RegionType::SizeType SizeType; + typedef typename TransformType::SpacingType SpacingType; + itkStaticConstMacro(InputDimension, unsigned int, TransformType::InputDimension); + typedef TImage ImageType; + typedef typename ImageType::ConstPointer ImagePointer; + typedef typename TransformType::CoefficientImageType CoefficientImageType; + typedef typename TransformType::ParametersType ParametersType; + + // Set and Get + itkBooleanMacro(Verbose); + itkSetMacro( Verbose, bool); + itkGetConstReferenceMacro( Verbose, bool); + itkSetObjectMacro( Transform, TransformType ); + itkGetConstObjectMacro( Transform, TransformType ); + itkSetObjectMacro( Image, ImageType ); + itkGetConstObjectMacro( Image, ImageType ); + + void SetSplineOrder(const unsigned int & splineOrder) + { + SizeType s; + s.Fill(splineOrder); + this->SetSplineOrders(s); + } + void SetSplineOrders(const SizeType & splineOrders) + { + m_SplineOrders=splineOrders; + } + void SetNumberOfControlPointsInsideTheImage( SizeType & n ) + { + m_NumberOfControlPointsInsideTheImage=n; + m_NumberOfControlPointsIsGiven=true; + this->Modified(); + } + void SetNumberOfControlPointsInsideTheImage( int * n) + { + SizeType s; + for (unsigned int i=0;iSetNumberOfControlPointsInsideTheImage( s ); + } + void SetNumberOfControlPointsInsideTheImage( unsigned int & n ) + { + SizeType s; + s.Fill( n );; + this->SetNumberOfControlPointsInsideTheImage( s ); + } + void SetControlPointSpacing( SpacingType n ) + { + m_ControlPointSpacing= n; + m_ControlPointSpacingIsGiven=true; + this->Modified(); + } + void SetControlPointSpacing( double*& n ) + { + SpacingType s( n ); + this->SetControlPointSpacing(s); + } + void SetControlPointSpacing( double n ) + { + SpacingType s; + s.Fill( n ); + this->SetControlPointSpacing(s); + } + void SetSamplingFactors( SizeType n ) + { + m_SamplingFactors=n; + m_SamplingFactorIsGiven=true; + this->Modified(); + } + void SetSamplingFactors( int *& n) + { + SizeType s; + for (unsigned int i=0;i SetSamplingFactors( s ); + } + void SetSamplingFactors( unsigned int n ) + { + SizeType s; + s.Fill( n ); + this-> SetSamplingFactors( s ); + } + virtual void InitializeTransform(); + void SetInitialParameters(const typename CoefficientImageType::Pointer coefficientImage, ParametersType& params); + void SetInitialParameters(const std::string & s, ParametersType& params); +// void SetInitialPaddedParameters(const typename CoefficientImageType::Pointer coefficientImage, ParametersType& params); +// void SetInitialPaddedParameters(const std::string & s, ParametersType& params); + + // For easy acces, declared public + std::vector m_NumberOfControlPointsInsideTheImageArray; + std::vector m_SamplingFactorsArray; + std::vector m_ControlPointSpacingArray; + + SpacingType m_ControlPointSpacing; + SizeType m_SamplingFactors; + SizeType m_SplineOrders; + SpacingType m_ChosenSpacing; + SizeType m_NumberOfControlPointsInsideTheImage; + bool m_NumberOfControlPointsIsGiven; + bool m_ControlPointSpacingIsGiven; + bool m_SamplingFactorIsGiven; + bool m_TransformRegionIsGiven; + unsigned int m_TrajectoryShape; + + typename TransformType::ParametersType* m_Parameters; + +protected: + ShapedBLUTSpatioTemporalDeformableTransformInitializer(); + ~ShapedBLUTSpatioTemporalDeformableTransformInitializer(){}; + +private: + ShapedBLUTSpatioTemporalDeformableTransformInitializer(const Self&); //purposely not implemented + void operator=(const Self&); //purposely not implemented + + bool m_Verbose; + TransformPointer m_Transform; + ImagePointer m_Image; + bool m_BC1; + bool m_BC2; + +}; //class ShapedBLUTSpatioTemporalDeformableTransformInitializer + + +} // namespace clitk + + +#ifndef ITK_MANUAL_INSTANTIATION +#include "clitkShapedBLUTSpatioTemporalDeformableTransformInitializer.txx" +#endif + +#endif /* __clitkShapedBLUTSpatioTemporalDeformableTransformInitializer_h */