Xmipp
v3.23.11-Nereus
xmippCore
core
metadata_generator.h
Go to the documentation of this file.
1
/***************************************************************************
2
*
3
* Authors: J.M. de la Rosa Trevin (jmdelarosa@cnb.csic.es)
4
* Jan Horacek (xhorace4@fi.muni.cz)
5
*
6
* Unidad de Bioinformatica of Centro Nacional de Biotecnologia , CSIC
7
*
8
* This program is free software; you can redistribute it and/or modify
9
* it under the terms of the GNU General Public License as published by
10
* the Free Software Foundation; either version 2 of the License, or
11
* (at your option) any later version.
12
*
13
* This program is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
* GNU General Public License for more details.
17
*
18
* You should have received a copy of the GNU General Public License
19
* along with this program; if not, write to the Free Software
20
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
21
* 02111-1307 USA
22
*
23
* All comments concerning this program package may be sent to the
24
* e-mail address 'xmipp@cnb.csic.es'
25
***************************************************************************/
26
27
#ifndef CORE_METADATA_GENERATOR_H
28
#define CORE_METADATA_GENERATOR_H
29
30
#include "
metadata_base.h
"
31
33
class
MDValueGenerator
{
34
public
:
35
MDLabel
label
;
//label to which generate values
36
37
/* Destructor*/
38
virtual
~MDValueGenerator
()
39
{}
40
41
/* Method to be implemented in concrete generators */
42
virtual
void
fillValue
(
MetaData
&md,
size_t
objId) = 0;
43
/* Fill whole metadata */
44
void
fill
(
MetaData
&md);
45
};
//end of class MDValueGenerator
46
48
typedef
enum
{
GTOR_UNIFORM
,
GTOR_GAUSSIAN
,
GTOR_STUDENT
}
RandMode
;
49
51
class
MDRandGenerator
:
public
MDValueGenerator
{
52
protected
:
53
double
op1, op2,
op3
;
54
RandMode
mode
;
55
56
inline
double
getRandValue();
57
public
:
58
MDRandGenerator
(
double
op1,
double
op2,
const
String
&mode,
double
op3=0.);
59
void
fillValue
(
MetaData
&md,
size_t
objId);
60
};
//end of class MDRandGenerator
61
63
class
MDConstGenerator
:
public
MDValueGenerator
{
64
public
:
65
String
value
;
66
67
MDConstGenerator
(
const
String
&value);
68
void
fillValue
(
MetaData
&md,
size_t
objId);
69
};
//end of class MDConstGenerator
70
71
#ifdef NEVERDEFINED
72
73
class
MDExpandGenerator:
public
MDValueGenerator
{
74
public
:
75
MetaData
expMd;
76
FileName
fn;
77
MDRow
row;
78
79
void
fillValue
(
MetaData
&md,
size_t
objId);
80
};
//end of class MDExpandGenerator
81
#endif
82
84
class
MDLinealGenerator
:
public
MDValueGenerator
{
85
public
:
86
double
initValue,
step
;
87
size_t
counter
;
88
89
MDLinealGenerator
(
double
initial,
double
step);
90
void
fillValue
(
MetaData
&md,
size_t
objId);
91
};
//end of class MDExpandGenerator
92
93
96
#endif
RandMode
RandMode
Definition:
metadata_generator.h:48
MDRandGenerator::mode
RandMode mode
Definition:
metadata_generator.h:54
MDRandGenerator::op3
double op3
Definition:
metadata_generator.h:53
MDLinealGenerator
Definition:
metadata_generator.h:84
MDLinealGenerator::counter
size_t counter
Definition:
metadata_generator.h:87
MDLinealGenerator::step
double step
Definition:
metadata_generator.h:86
MetaData
Definition:
metadata_base.h:176
GTOR_UNIFORM
Definition:
metadata_generator.h:48
GTOR_STUDENT
Definition:
metadata_generator.h:48
FileName
Definition:
xmipp_filename.h:65
MDConstGenerator
Definition:
metadata_generator.h:63
MDValueGenerator::label
MDLabel label
Definition:
metadata_generator.h:35
metadata_base.h
MDConstGenerator::value
String value
Definition:
metadata_generator.h:65
MDValueGenerator::fillValue
virtual void fillValue(MetaData &md, size_t objId)=0
MDValueGenerator
Definition:
metadata_generator.h:33
String
std::string String
Definition:
xmipp_strings.h:34
MDRow
Definition:
metadata_row_base.h:53
MDValueGenerator::~MDValueGenerator
virtual ~MDValueGenerator()
Definition:
metadata_generator.h:38
MDLabel
MDLabel
Definition:
metadata_label.h:44
GTOR_GAUSSIAN
Definition:
metadata_generator.h:48
MDRandGenerator
Definition:
metadata_generator.h:51
MDValueGenerator::fill
void fill(MetaData &md)
Definition:
metadata_generator.cpp:96
Generated by
1.8.13