ODIN
filter_mask.h
1 /***************************************************************************
2  filter_mask.h - description
3  -------------------
4  begin : Wed Nov 5 2008
5  copyright : (C) 2000-2021 by Thies Jochimsen
6  email : thies@jochimsen.de
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef FILTER_MASK_H
19 #define FILTER_MASK_H
20 
21 #include <odindata/filter_step.h>
22 
23 class FilterGenMask : public FilterStep {
24 
25  LDRfloat min;
26  LDRfloat max;
27 
28 
29  STD_string label() const {return "genmask";}
30  STD_string description() const {return "Create binary mask including all voxels with value in given range";}
31  bool process(Data<float,4>& data, Protocol& prot) const;
32  FilterStep* allocate() const {return new FilterGenMask();}
33  void init();
34 };
35 
37 
38 class FilteNonZeroMask : public FilterStep {
39 
40  STD_string label() const {return "nonzeromask";}
41  STD_string description() const {return "Create binary mask including all voxels with non-zero value";}
42  bool process(Data<float,4>& data, Protocol& prot) const;
43  FilterStep* allocate() const {return new FilteNonZeroMask();}
44  void init() {}
45 };
46 
48 
49 class FilterAutoMask : public FilterStep {
50 
51  LDRint skip;
52  LDRfileName dump_histogram_fname;
53  LDRfileName dump_histogram_fit_fname;
54 
55  STD_string label() const {return "automask";}
56  STD_string description() const {return "Create binary mask using automatic histogram-based threshold";}
57  bool process(Data<float,4>& data, Protocol& prot) const;
58  FilterStep* allocate() const {return new FilterAutoMask();}
59  void init();
60 };
61 
62 
64 
65 class FilterQuantilMask : public FilterStep {
66 
67  LDRfloat fraction;
68 
69  STD_string label() const {return "quantilmask";}
70  STD_string description() const {return "Create binary mask including all voxels above the given fractional threshold";}
71  bool process(Data<float,4>& data, Protocol& prot) const;
72  FilterStep* allocate() const {return new FilterQuantilMask();}
73  void init();
74 };
75 
76 
78 
79 class FilterSphereMask : public FilterStep {
80 
81  LDRstring pos;
82  LDRfloat radius;
83 
84  STD_string label() const {return "spheremask";}
85  STD_string description() const {return "Create binary spherical mask";}
86  bool process(Data<float,4>& data, Protocol& prot) const;
87  FilterStep* allocate() const {return new FilterSphereMask();}
88  void init();
89 };
90 
91 
93 
94 class FilterUseMask : public FilterStep {
95 
96  LDRfileName fname;
97 
98  STD_string label() const {return "usemask";}
99  STD_string description() const {return "Create 1D dataset including all values within binary mask from file";}
100  bool process(Data<float,4>& data, Protocol& prot) const;
101  FilterStep* allocate() const {return new FilterUseMask();}
102  void init();
103 };
104 
105 #endif
virtual bool process(Data< float, 4 > &data, Protocol &prot) const
Protocol proxy.
Definition: protocol.h:33
virtual FilterStep * allocate() const=0
virtual STD_string description() const=0
virtual void init()=0
virtual STD_string label() const=0