File: modalities.h

package info (click to toggle)
simrisc 16.06.00-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,568 kB
  • sloc: cpp: 6,889; fortran: 669; makefile: 112; ansic: 112; sh: 107
file content (75 lines) | stat: -rw-r--r-- 2,295 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#ifndef INCLUDED_MODALITIES_
#define INCLUDED_MODALITIES_

// See README

#include <iosfwd>
#include <vector>

#include "../typedefs/typedefs.h"
#include "../enums/enums.h"

class ModBase;
class Tumor;

namespace FBB
{
    class CSVTable;
}

class Modalities
{
    Tumor const &d_tumor;               // used by Mammo and CT

    std::vector<ModBase *> d_modBaseVect;   // defined modalities
    StringVect d_modalityIDs;               // and their IDs
    StringSet d_active;                     // the active modalities
    std::vector<ModBase *> d_activeVect;    // ptrs to active modalities
    
    public:
        Modalities(Tumor const &tumor);
        ~Modalities();

                            // visit all modalities and initialize
                            // their data, see loop/initialize
            // see also Loop::d_nModalityFP: modality specific, to become
            //      a size_t variables in each used modality
        void resetCounters(size_t nRounds);

                                // returns UNDEFINED if 'modality' is unknown
        uint16_t find(std::string const &modality) const;

            // return a vector of ModBase ptrs matching the names specified
            //  in 'active'
        std::vector<ModBase *> use(Uint16Vect const &active) const;
        StringVect const &modalityIDs() const;

        void vary(std::ostream &out);

        void legend(std::ostream &out) const;

        void writeParameters(std::ostream &out) const;

                                                        // determine the Mod. 
        size_t roundFmt(FBB::CSVTable &tab) const;      // #fields & width   

        void roundHeaders(FBB::CSVTable &tab) const;    // write the Mod names
                                                        // write the Mod data
        void writeRounds(FBB::CSVTable &tmp, size_t round) const;

        void active();                          // sets d_activeVect
        void activate(std::string const &modality);       

        std::vector<ModBase *> const &activeMods() const;           // .f

    private:
        void addMod(ModBase *modBase);
};

// double specificity(age) const: age may not be negative
// currently not used
// double const *hasDose(StringVect const &ids) const;

#include "modalities.f"

#endif