STIR  6.2.0
DataProcessor.h
Go to the documentation of this file.
1 //
2 //
3 /*
4  Copyright (C) 2000- 2009, Hammersmith Imanet Ltd
5  This file is part of STIR.
6 
7  SPDX-License-Identifier: Apache-2.0
8 
9  See STIR/LICENSE.txt for details
10 */
20 #ifndef __stir_DataProcessor_H__
21 #define __stir_DataProcessor_H__
22 
23 #include "stir/RegisteredObject.h"
24 #include "stir/TimedObject.h"
25 #include "stir/Succeeded.h"
26 
27 START_NAMESPACE_STIR
28 
45 template <typename DataT>
46 class DataProcessor : public RegisteredObject<DataProcessor<DataT>>, public TimedObject
47 {
48 public:
49  inline DataProcessor();
50 
52 
62  inline Succeeded set_up(const DataT& data);
63 
65 
72  inline virtual void reset();
73 
75 
78  inline Succeeded apply(DataT& data);
79 
91  inline Succeeded apply(DataT& out_data, const DataT& in_data);
92 
100  inline bool parse(std::istream& f);
101  bool parse(const char* const filename);
103 
104  // Check if filtering images with this dimensions, sampling_distances etc actually makes sense
105  // virtual inline Succeeded consistency_check( const DataT& image ) const;
106 
107 protected:
109  virtual Succeeded virtual_set_up(const DataT&) = 0;
111  //*! \todo should return Succeeded */
112  virtual void virtual_apply(DataT& data, const DataT& in_data) const = 0;
114  //*! \todo should return Succeeded */
115  virtual void virtual_apply(DataT& data) const = 0;
116 
117 private:
118  bool is_set_up_already;
119 };
120 
121 END_NAMESPACE_STIR
122 
123 #include "stir/DataProcessor.inl"
124 
125 #endif
Declaration of class stir::Succeeded.
Base class that defines an interface for classes that do data processing.
Definition: DataProcessor.h:46
base class for all objects which need timers. At the moment, there&#39;s only a CPU timer.
Definition: TimedObject.h:35
Declaration of class stiir::RegisteredObject.
declares the stir::TimedObject class
Helper class to provide registry mechanisms to a Base classSuppose you have a hierarchy of classes wi...
Definition: RegisteredObject.h:95
Inline implementations for class stir::DataProcessor.
a class containing an enumeration type that can be used by functions to signal successful operation o...
Definition: Succeeded.h:43