STIR 6.4.0
Reconstruction.h
Go to the documentation of this file.
1//
2//
3/*
4 Copyright (C) 2000 PARAPET partners
5 Copyright (C) 2000- 2007, Hammersmith Imanet Ltd
6 Copyright (C) 2018, University College London
7 This file is part of STIR.
8
9 SPDX-License-Identifier: Apache-2.0 AND License-ref-PARAPET-license
10
11 See STIR/LICENSE.txt for details
12*/
13#ifndef __stir_recon_buildblock_Reconstruction_H__
14#define __stir_recon_buildblock_Reconstruction_H__
27
28#include "stir/TimedObject.h"
29#include "stir/ParsingObject.h"
30#include "stir/shared_ptr.h"
31#include "stir/DataProcessor.h"
34#include <string>
35
36#include "stir/ExamData.h"
37
38START_NAMESPACE_STIR
39
40class Succeeded;
41
67
68template <typename TargetT>
69class Reconstruction : public RegisteredObject<Reconstruction<TargetT>>, public TimedObject
70{
71public:
74
76 ~Reconstruction() override{};
77
79 virtual std::string method_info() const = 0;
80
82
85 virtual Succeeded reconstruct() = 0;
86
88
100 virtual Succeeded reconstruct(shared_ptr<TargetT> const& target_image_sptr) = 0;
101
103
111 virtual Succeeded set_up(shared_ptr<TargetT> const& target_data_sptr);
112
119
121 void set_output_filename_prefix(const std::string&);
122
125
127 void set_post_processor_sptr(const shared_ptr<DataProcessor<TargetT>>&);
128
130 virtual void set_input_data(const shared_ptr<ExamData>&) = 0;
132
133 virtual const ExamData& get_input_data() const = 0;
135
143 void set_disable_output(bool _val);
144
150 shared_ptr<TargetT> get_target_image();
151
152 // parameters
153protected:
156
158 shared_ptr<OutputFileFormat<TargetT>> output_file_format_ptr;
159
161 shared_ptr<DataProcessor<TargetT>> post_filter_sptr;
162
163protected:
165
169 virtual void check(TargetT const& target_data) const;
170 bool _already_set_up;
171
185 void initialise(const std::string& parameter_filename);
186
187 void set_defaults() override;
188 void initialise_keymap() override;
190
202 bool post_processing() override;
203
207 shared_ptr<TargetT> target_data_sptr;
208
216
219};
220
221END_NAMESPACE_STIR
222
223#endif
Declaration of class stir::DataProcessor.
declaration of stir::ExamData
Declaration of class stir::OutputFileFormat.
Declaration of class stir::ParsingObject.
Declaration of class stiir::RegisteredObject.
declares the stir::TimedObject class
Base class that defines an interface for classes that do data processing.
Definition DataProcessor.h:47
base class for data objects such as ProjData etc
Definition ExamData.h:34
Base class for classes that create output files.
Definition OutputFileFormat.h:56
bool _disable_output
_disable_output
Definition Reconstruction.h:215
Reconstruction()
default constructor (calls set_defaults())
Definition Reconstruction.cxx:41
void set_output_file_format_ptr(const shared_ptr< OutputFileFormat< TargetT > > &)
defines the format of the output files
Definition Reconstruction.cxx:139
virtual const ExamData & get_input_data() const =0
get input data
shared_ptr< TargetT > target_data_sptr
target_data_sptr
Definition Reconstruction.h:207
void set_disable_output(bool _val)
set_disable_output
Definition Reconstruction.cxx:184
virtual void check(TargetT const &target_data) const
do consistency checks
Definition Reconstruction.cxx:174
virtual Succeeded reconstruct()=0
executes the reconstruction
virtual void set_input_data(const shared_ptr< ExamData > &)=0
set input data
virtual Succeeded set_up(shared_ptr< TargetT > const &target_data_sptr)
operations prior to the reconstruction
Definition Reconstruction.cxx:154
std::string output_filename_prefix
file name for output reconstructed images
Definition Reconstruction.h:155
~Reconstruction() override
virtual destructor
Definition Reconstruction.h:76
void initialise_keymap() override
Initialise all keywords.
Definition Reconstruction.cxx:63
int _verbosity
Verbosity level.
Definition Reconstruction.h:218
void set_post_processor_sptr(const shared_ptr< DataProcessor< TargetT > > &)
post-filter
Definition Reconstruction.cxx:146
shared_ptr< OutputFileFormat< TargetT > > output_file_format_ptr
defines the format of the output files
Definition Reconstruction.h:158
bool post_processing() override
used to check acceptable parameters after parsing
Definition Reconstruction.cxx:97
void set_defaults() override
Set defaults before parsing.
Definition Reconstruction.cxx:50
virtual std::string method_info() const =0
gives method information
virtual Succeeded reconstruct(shared_ptr< TargetT > const &target_image_sptr)=0
executes the reconstruction storing result in target_image_sptr
void initialise(const std::string &parameter_filename)
This function initialises all parameters, either via parsing, or by calling ask_parameters() (when pa...
Definition Reconstruction.cxx:76
void set_output_filename_prefix(const std::string &)
file name for output reconstructed images
Definition Reconstruction.cxx:132
shared_ptr< TargetT > get_target_image()
get_reconstructed_image
Definition Reconstruction.cxx:191
shared_ptr< DataProcessor< TargetT > > post_filter_sptr
post-filter
Definition Reconstruction.h:161
a class containing an enumeration type that can be used by functions to signal successful operation o...
Definition Succeeded.h:44
base class for all objects which need timers. At the moment, there's only a CPU timer.
Definition TimedObject.h:36
Import of std::shared_ptr, std::dynamic_pointer_cast and std::static_pointer_cast into the stir names...