35 #include "sirf/iUtilities/iutilities.h"
36 #include "sirf/common/JacobiCG.h"
42 template<
class dataType>
class Transformation;
56 template<
class dataType>
77 virtual void set_reference_image(
const std::shared_ptr<const ImageData> reference_image_sptr);
80 virtual void set_floating_image(
const std::shared_ptr<const ImageData> floating_image_sptr);
116 virtual std::shared_ptr<ImageData>
forward(
const std::shared_ptr<const ImageData> input_sptr) = 0;
119 virtual void forward(std::shared_ptr<ImageData> output_sptr,
const std::shared_ptr<const ImageData> input_sptr) = 0;
122 virtual std::shared_ptr<ImageData>
adjoint(
const std::shared_ptr<const ImageData> input_sptr) = 0;
125 virtual void adjoint(std::shared_ptr<ImageData> output_sptr,
const std::shared_ptr<const ImageData> input_sptr) = 0;
128 virtual std::shared_ptr<ImageData>
backward(
const std::shared_ptr<const ImageData> input_sptr);
131 virtual void backward(std::shared_ptr<ImageData> output_sptr,
const std::shared_ptr<const ImageData> input_sptr);
133 std::shared_ptr<const ImageData> reference_image_sptr()
const
137 std::shared_ptr<const ImageData> floating_image_sptr()
const
141 std::vector<std::shared_ptr<const Transformation<dataType> > > transformations_sptr()
const
145 virtual float norm(
int num_iter,
int verb)
const = 0;
177 bool _need_to_set_up =
true;
178 bool _need_to_set_up_forward =
true;
179 bool _need_to_set_up_adjoint =
true;
183 template<
class dataType>
189 std::shared_ptr<const ImageData> sptr_im = wsptr.sptr();
190 std::shared_ptr<ImageData> sptr_f = sptr_r_->forward(sptr_im);
191 std::shared_ptr<ImageData> sptr_bf = sptr_r_->backward(sptr_f);
195 std::shared_ptr<Resampler<dataType> > sptr_r_;
Backward projection of the forward projected image.
Definition: Resample.h:184
Definition: Resample.h:58
virtual void set_interpolation_type(const enum InterpolationType type)
Set interpolation type (0=nearest neighbour, 1=linear, 3=cubic, 4=sinc)
Definition: Resample.cpp:64
const InterpolationType get_interpolation_type() const
Get interpolation type.
Definition: Resample.h:104
std::shared_ptr< ImageData > _output_image_sptr
Output image.
Definition: Resample.h:173
void set_interpolation_type_to_linear()
Set interpolation type to linear.
Definition: Resample.h:95
InterpolationType
Interpolation type.
Definition: Resample.h:62
Resampler()
Constructor.
Definition: Resample.h:71
virtual void set_reference_image(const std::shared_ptr< const ImageData > reference_image_sptr)
Set reference image. This is the image that would be the reference if you were doing a forward transf...
Definition: Resample.cpp:36
virtual void check_parameters()
Check parameters.
Definition: Resample.cpp:73
virtual void set_floating_image(const std::shared_ptr< const ImageData > floating_image_sptr)
Set floating image. This is the image that would be the floating if you were doing a forward transfor...
Definition: Resample.cpp:46
virtual std::shared_ptr< ImageData > forward(const std::shared_ptr< const ImageData > input_sptr)=0
Do the forward transformation.
virtual void set_up_forward()=0
Set up forward.
virtual std::shared_ptr< ImageData > backward(const std::shared_ptr< const ImageData > input_sptr)
Backward. Alias for Adjoint.
Definition: Resample.cpp:85
virtual void process()=0
Process. Equivalent of calling forward(floating_image). Use get_output to get resampled image.
std::vector< std::shared_ptr< const Transformation< dataType > > > _transformations
Transformations (could be mixture of affine, displacements, deformations).
Definition: Resample.h:167
void set_interpolation_type_to_cubic_spline()
Set interpolation type to cubic spline.
Definition: Resample.h:98
std::shared_ptr< const ImageData > _reference_image_sptr
Reference image.
Definition: Resample.h:162
virtual void set_up_adjoint()=0
Set up adjoint.
virtual ~Resampler()
Destructor.
Definition: Resample.h:74
const std::shared_ptr< const ImageData > get_output_sptr() const
Get output.
Definition: Resample.h:113
void set_padding_value(const float padding_value)
Set padding value.
Definition: Resample.h:107
virtual void adjoint(std::shared_ptr< ImageData > output_sptr, const std::shared_ptr< const ImageData > input_sptr)=0
Do the adjoint transformation.
virtual void add_transformation(const std::shared_ptr< const Transformation< dataType > > transformation_sptr)
Add transformation.
Definition: Resample.cpp:55
void set_interpolation_type_to_nearest_neighbour()
Set interpolation type to nearest neighbour.
Definition: Resample.h:92
virtual std::shared_ptr< ImageData > adjoint(const std::shared_ptr< const ImageData > input_sptr)=0
Do the adjoint transformation.
void set_interpolation_type_to_sinc()
Set interpolation type to sinc.
Definition: Resample.h:101
float _padding_value
Padding value.
Definition: Resample.h:176
std::shared_ptr< const ImageData > _floating_image_sptr
Floating image.
Definition: Resample.h:164
InterpolationType _interpolation_type
Interpolation type.
Definition: Resample.h:170
virtual void forward(std::shared_ptr< ImageData > output_sptr, const std::shared_ptr< const ImageData > input_sptr)=0
Do the forward transformation.
void clear_transformations()
Clear transformations.
Definition: Resample.h:86
virtual void set_up()=0
Set up.
Definition: JacobiCG.h:166
Abstract data container.
Definition: GeometricalInfo.cpp:141