STIR 6.4.0
ParseAndCreateFrom.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2019, University College London
3 This file is part of STIR.
4
5 SPDX-License-Identifier: Apache-2.0
6
7 See STIR/LICENSE.txt for details
8*/
17
18#ifndef __stir_ParseAndCreateFrom_H__
19#define __stir_ParseAndCreateFrom_H__
20
23START_NAMESPACE_STIR
24
25class KeyParser;
26
28
51template <class OutputT, class InputT, class ParserT = KeyParser>
53{
54public:
56 void set_defaults() {}
58 void add_to_keymap(ParserT&) {}
60 void check_values() const {};
61
63
72 OutputT* create(const InputT&) const { return new OutputT(); }
73};
74
76
89template <class elemT, class ExamDataT>
91{
92public:
93 typedef DiscretisedDensity<3, elemT> output_type;
94 inline output_type* create(const ExamDataT&) const;
95};
96
97END_NAMESPACE_STIR
98
100#endif
implementation of the stir::ParseAndCreateFrom class for stir:DiscretisedDensity
Definition of the stir::ParseDiscretisedDensityParameters class.
defines the stir::VoxelsOnCartesianGrid class
This abstract class is the basis for all image representations.
Definition DiscretisedDensity.h:99
template for adding keywords to a parser and creating an object
Definition ParseAndCreateFrom.h:53
OutputT * create(const InputT &) const
create a new object
Definition ParseAndCreateFrom.h:72
void set_defaults()
set default values for any parameters
Definition ParseAndCreateFrom.h:56
void check_values() const
should call error() if something is wrong
Definition ParseAndCreateFrom.h:60
void add_to_keymap(ParserT &)
add any relevant parameters to a parser
Definition ParseAndCreateFrom.h:58
Class for adding parameters relevant to DiscretisedDensity to a parser.
Definition ParseDiscretisedDensityParameters.h:40