Xmipp
v3.23.11-Nereus
xmipp
libraries
reconstruction
volume_to_pseudoatoms.h
Go to the documentation of this file.
1
/***************************************************************************
2
*
3
* Authors: Carlos Oscar S. Sorzano (coss@cnb.csic.es)
4
*
5
* Unidad de Bioinformatica of Centro Nacional de Biotecnologia , CSIC
6
*
7
* This program is free software; you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation; either version 2 of the License, or
10
* (at your option) any later version.
11
*
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
16
*
17
* You should have received a copy of the GNU General Public License
18
* along with this program; if not, write to the Free Software
19
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
20
* 02111-1307 USA
21
*
22
* All comments concerning this program package may be sent to the
23
* e-mail address 'xmipp@cnb.csic.es'
24
***************************************************************************/
25
/* This file contains functions related to the Radon Transform */
26
27
#ifndef _CONVERT_VOL2PSEUDO_HH
28
#define _CONVERT_VOL2PSEUDO_HH
29
30
#include <
core/xmipp_image.h
>
31
#include <
data/mask.h
>
32
#include <
core/xmipp_threads.h
>
33
#include <
core/xmipp_program.h
>
34
#include <vector>
35
#include <
data/fourier_filter.h
>
36
40
class
PseudoAtom
42
{
43
public
:
45
Matrix1D<double>
location
;
46
48
double
intensity
;
49
51
PseudoAtom
();
52
54
friend
std::ostream&
operator <<
(std::ostream &o,
const
PseudoAtom
&
f
);
55
};
56
58
bool
operator <
(
const
PseudoAtom
&
a
,
const
PseudoAtom
&
b
);
59
60
// Forward declaration
61
class
ProgVolumeToPseudoatoms
;
62
63
// Thread parameters
64
struct
Prog_Convert_Vol2Pseudo_ThreadParams
65
{
66
int
myThreadID
;
67
ProgVolumeToPseudoatoms
*
parent
;
68
int
Nintensity
;
69
int
Nmovement
;
70
};
71
72
class
ProgVolumeToPseudoatoms
:
public
XmippProgram
73
{
74
public
:
76
FileName
fnVol
;
77
79
FileName
fnOut
;
80
81
// Mask
82
Mask
mask_prm
;
83
84
// Use mask
85
bool
useMask
;
86
88
double
sigma
;
89
91
double
targetError
;
92
94
double
stop
;
95
97
int
initialSeeds
;
98
100
double
growSeeds
;
101
103
bool
allowMovement
;
104
106
bool
allowIntensity
;
107
112
double
intensityFraction
;
113
115
std::string
intensityColumn
;
116
118
double
minDistance
;
119
121
double
penalty
;
122
124
int
numThreads
;
125
127
double
sampling
;
128
130
size_t
Nclosest
;
131
133
bool
dontScale
;
134
136
bool
binarize
;
137
139
double
threshold
;
140
public
:
142
void
readParams();
143
145
void
show()
const
;
146
148
void
defineParams();
149
151
void
produceSideInfo();
152
154
void
run();
155
157
void
placeSeeds(
int
Nseeds);
158
160
void
removeSeeds(
int
Nseeds);
161
163
void
removeTooCloseSeeds();
164
166
double
computeAverage(
int
k
,
int
i
,
int
j
,
MultidimArray<double>
&V);
167
169
void
drawGaussian(
double
k
,
double
i
,
double
j
,
MultidimArray<double>
&V,
170
double
intensity
);
171
173
void
drawApproximation();
174
176
void
extractRegion(
int
idxGaussian,
MultidimArray<double>
®ion,
177
bool
extended=
false
)
const
;
178
180
void
insertRegion(
const
MultidimArray<double>
®ion);
181
183
double
evaluateRegion(
const
MultidimArray<double>
®ion)
const
;
184
186
void
optimizeCurrentAtoms();
187
189
static
void
* optimizeCurrentAtomsThread(
void
* threadArgs);
190
192
void
writeResults();
193
public
:
194
// Input volume
195
Image<double>
Vin
;
196
197
// Current approximation volume
198
Image<double>
Vcurrent
;
199
200
// Energy of the difference
201
double
energyDiff
;
202
203
// Maximum percentage diffence
204
double
percentageDiff
;
205
206
// Original energy
207
double
energyOriginal
;
208
209
// List of atoms
210
std::vector< PseudoAtom >
atoms
;
211
212
// Maximum radius
213
double
sigma3
;
214
215
// Percentil 1
216
double
percentil1
;
217
218
// Range
219
double
range
;
220
221
// Small atom intensity
222
double
smallAtom
;
223
224
// Gaussian table
225
MultidimArray<double>
gaussianTable
;
226
227
// Barrier
228
barrier_t
barrier
;
229
230
#define KILLTHREAD -1
231
#define WORKTHREAD 0
232
// Thread operation code
233
int
threadOpCode
;
234
235
// Pointer to thread arguments
236
Prog_Convert_Vol2Pseudo_ThreadParams
*
threadArgs
;
237
238
// Pointer to threads
239
pthread_t *
threadIds
;
240
241
// Filter for the difference volume
242
FourierFilter
Filter
;
243
};
245
#endif
ProgVolumeToPseudoatoms::percentil1
double percentil1
Definition:
volume_to_pseudoatoms.h:216
ProgVolumeToPseudoatoms::sigma3
double sigma3
Definition:
volume_to_pseudoatoms.h:213
ProgVolumeToPseudoatoms::numThreads
int numThreads
Number of threads.
Definition:
volume_to_pseudoatoms.h:124
MultidimArray< double >
PseudoAtom
Pseudoatom class.
Definition:
volume_to_pseudoatoms.h:41
ProgVolumeToPseudoatoms::sampling
double sampling
Sampling rate.
Definition:
volume_to_pseudoatoms.h:127
Mask
Definition:
mask.h:360
ProgVolumeToPseudoatoms::energyDiff
double energyDiff
Definition:
volume_to_pseudoatoms.h:201
ProgVolumeToPseudoatoms::Vcurrent
Image< double > Vcurrent
Definition:
volume_to_pseudoatoms.h:198
mask.h
ProgVolumeToPseudoatoms::threadOpCode
int threadOpCode
Definition:
volume_to_pseudoatoms.h:233
ProgVolumeToPseudoatoms::sigma
double sigma
Sigma.
Definition:
volume_to_pseudoatoms.h:88
ProgVolumeToPseudoatoms::useMask
bool useMask
Definition:
volume_to_pseudoatoms.h:85
ProgVolumeToPseudoatoms::fnOut
FileName fnOut
Output volume.
Definition:
volume_to_pseudoatoms.h:79
ProgVolumeToPseudoatoms::atoms
std::vector< PseudoAtom > atoms
Definition:
volume_to_pseudoatoms.h:210
ProgVolumeToPseudoatoms::gaussianTable
MultidimArray< double > gaussianTable
Definition:
volume_to_pseudoatoms.h:225
FileName
Definition:
xmipp_filename.h:65
ProgVolumeToPseudoatoms::threadIds
pthread_t * threadIds
Definition:
volume_to_pseudoatoms.h:239
xmipp_threads.h
ProgVolumeToPseudoatoms::intensityColumn
std::string intensityColumn
Column for the intensity (if any)
Definition:
volume_to_pseudoatoms.h:115
i
#define i
Definition:
numerical_recipes.cpp:2493
k
ql0001_ & k(htemp+1),(cvec+1),(atemp+1),(bj+1),(bl+1),(bu+1),(x+1),(clamda+1), &iout, infoqp, &zero,(w+1), &lenw,(iw+1), &leniw, &glob_grd.epsmac
ProgVolumeToPseudoatoms::barrier
barrier_t barrier
Definition:
volume_to_pseudoatoms.h:228
PseudoAtom::PseudoAtom
PseudoAtom()
Empty constructor.
Definition:
volume_to_pseudoatoms.cpp:33
ProgVolumeToPseudoatoms::intensityFraction
double intensityFraction
Definition:
volume_to_pseudoatoms.h:112
xmipp_image.h
b
doublereal * b
Definition:
numerical_recipes.cpp:2230
xmipp_program.h
f
double * f
Definition:
numerical_recipes.cpp:4414
fourier_filter.h
PseudoAtom::operator<<
friend std::ostream & operator<<(std::ostream &o, const PseudoAtom &f)
Show pseudo atom.
Definition:
volume_to_pseudoatoms.cpp:44
PseudoAtom::intensity
double intensity
Intensity.
Definition:
volume_to_pseudoatoms.h:48
Prog_Convert_Vol2Pseudo_ThreadParams::parent
ProgVolumeToPseudoatoms * parent
Definition:
volume_to_pseudoatoms.h:67
ProgVolumeToPseudoatoms::allowIntensity
bool allowIntensity
Allow gaussians to vary intensity.
Definition:
volume_to_pseudoatoms.h:106
ProgVolumeToPseudoatoms::binarize
bool binarize
Binarize.
Definition:
volume_to_pseudoatoms.h:136
PseudoAtom::location
Matrix1D< double > location
Location.
Definition:
volume_to_pseudoatoms.h:45
ProgVolumeToPseudoatoms::allowMovement
bool allowMovement
Allow gaussians to move.
Definition:
volume_to_pseudoatoms.h:103
j
#define j
Definition:
numerical_recipes.cpp:2493
ProgVolumeToPseudoatoms::percentageDiff
double percentageDiff
Definition:
volume_to_pseudoatoms.h:204
ProgVolumeToPseudoatoms::smallAtom
double smallAtom
Definition:
volume_to_pseudoatoms.h:222
ProgVolumeToPseudoatoms::stop
double stop
Stop criterion.
Definition:
volume_to_pseudoatoms.h:94
ProgVolumeToPseudoatoms::targetError
double targetError
Maximum error (as a percentage)
Definition:
volume_to_pseudoatoms.h:91
ProgVolumeToPseudoatoms::minDistance
double minDistance
Mindistance.
Definition:
volume_to_pseudoatoms.h:118
mybarrier_t
Definition:
xmipp_threads.h:472
Prog_Convert_Vol2Pseudo_ThreadParams
Definition:
volume_to_pseudoatoms.h:64
ProgVolumeToPseudoatoms::Vin
Image< double > Vin
Definition:
volume_to_pseudoatoms.h:195
Matrix1D< double >
Image< double >
FourierFilter
Definition:
fourier_filter.h:69
ProgVolumeToPseudoatoms::fnVol
FileName fnVol
Volume to convert.
Definition:
volume_to_pseudoatoms.h:76
ProgVolumeToPseudoatoms::threshold
double threshold
Threshold for the binarization.
Definition:
volume_to_pseudoatoms.h:139
ProgVolumeToPseudoatoms::threadArgs
Prog_Convert_Vol2Pseudo_ThreadParams * threadArgs
Definition:
volume_to_pseudoatoms.h:236
Prog_Convert_Vol2Pseudo_ThreadParams::myThreadID
int myThreadID
Definition:
volume_to_pseudoatoms.h:66
operator<
bool operator<(const PseudoAtom &a, const PseudoAtom &b)
Comparison between pseudo atoms.
Definition:
volume_to_pseudoatoms.cpp:39
Prog_Convert_Vol2Pseudo_ThreadParams::Nintensity
int Nintensity
Definition:
volume_to_pseudoatoms.h:68
ProgVolumeToPseudoatoms::initialSeeds
int initialSeeds
Initial seeds.
Definition:
volume_to_pseudoatoms.h:97
Prog_Convert_Vol2Pseudo_ThreadParams::Nmovement
int Nmovement
Definition:
volume_to_pseudoatoms.h:69
ProgVolumeToPseudoatoms::dontScale
bool dontScale
Don't scale the atom weights at the end.
Definition:
volume_to_pseudoatoms.h:133
ProgVolumeToPseudoatoms::range
double range
Definition:
volume_to_pseudoatoms.h:219
ProgVolumeToPseudoatoms::penalty
double penalty
Penalization.
Definition:
volume_to_pseudoatoms.h:121
ProgVolumeToPseudoatoms
Definition:
volume_to_pseudoatoms.h:72
ProgVolumeToPseudoatoms::mask_prm
Mask mask_prm
Definition:
volume_to_pseudoatoms.h:82
ProgVolumeToPseudoatoms::growSeeds
double growSeeds
Grow seeds.
Definition:
volume_to_pseudoatoms.h:100
XmippProgram
Definition:
xmipp_program.h:52
a
doublereal * a
Definition:
numerical_recipes.cpp:2230
ProgVolumeToPseudoatoms::Filter
FourierFilter Filter
Definition:
volume_to_pseudoatoms.h:242
ProgVolumeToPseudoatoms::energyOriginal
double energyOriginal
Definition:
volume_to_pseudoatoms.h:207
ProgVolumeToPseudoatoms::Nclosest
size_t Nclosest
N closest atoms for the distance histogram.
Definition:
volume_to_pseudoatoms.h:130
Generated by
1.8.13