00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef __freBSplineInterpolateController_h
00023 #define __freBSplineInterpolateController_h
00024
00025 #include "freInterpolatorControllerBase.h"
00026
00027 #include "itkBSplineInterpolateImageFunction.h"
00028
00029 namespace FREE
00030 {
00031
00041 freControllerIDMacro(BSplineInterpolateControllerBase, "BSplineInterpolationBase");
00042 template <class TImageType>
00043 class BSplineInterpolateControllerBase : public InterpolatorControllerBase< itk::BSplineInterpolateImageFunction<TImageType,ScalarType,ScalarType> >
00044 {
00045 public:
00046 itkTypeMacro(BSplineInterpolateControllerBase, InterpolatorControllerBase);
00047
00048 typedef itk::BSplineInterpolateImageFunction<TImageType,ScalarType,ScalarType> ComponentType;
00049 typedef InterpolatorControllerBase<ComponentType> Superclass;
00050
00051 virtual ~BSplineInterpolateControllerBase()
00052 {
00053 };
00054
00055 protected:
00058 BSplineInterpolateControllerBase()
00059 {
00060
00061 this->UpdateControllerID(ControllerID::BSplineInterpolateControllerBase);
00062 this->m_Description = "Interpolates point values with bsplines.";
00063 };
00064
00065 virtual void GenerateProfile(CtrlProfile::ControllerProfile& profile,
00066 const SessionComponentCache* pComponentCache,
00067 bool bRegardOldSetup) const
00068 {
00069 Superclass::GenerateProfile(profile,pComponentCache,bRegardOldSetup);
00070
00071 profile.Parameters().AddParameter(cParam_SplinOrder,Parameter::PVTInteger,cParamDsc_SplinOrder,1,"0",-1,true);
00072 };
00073
00078 virtual void ActualizeMainComponent(ComponentType* pMainComponent,
00079 SessionComponentCache* pComponentCache,
00080 SessionInfo* pSessionInfo,
00081 const unsigned int& iActLevel) const
00082 {
00083 int iOrder;
00084 try
00085 {
00086 SessionAccessor::GetParameterValue(pComponentCache,cParam_SplinOrder,iOrder,0,iActLevel,true);
00087 }
00088 catchAllNPassMacro("Error while retrieving parameter values.");
00089 pMainComponent->SetSplineOrder(iOrder);
00090 };
00091
00092 };
00093
00103 freControllerIDMacro(BSpline2DInterpolateController, "BSpline 2D Interpolation");
00104 class BSpline2DInterpolateController : public BSplineInterpolateControllerBase<InternalImage2DType>
00105 {
00106 public:
00107 itkTypeMacro(BSpline2DInterpolateController, BSplineInterpolateControllerBase);
00108
00109 BSpline2DInterpolateController();
00110
00111 virtual ~BSpline2DInterpolateController();
00112 };
00113
00123 freControllerIDMacro(BSpline3DInterpolateController, "BSpline 3D Interpolation");
00124 class BSpline3DInterpolateController : public BSplineInterpolateControllerBase<InternalImage3DType>
00125 {
00126 public:
00127 itkTypeMacro(BSpline3DInterpolateController, BSplineInterpolateControllerBase);
00128
00129 BSpline3DInterpolateController();
00130
00131 virtual ~BSpline3DInterpolateController();
00132 };
00133
00134 }
00135
00136 #endif