#include <users_modules/cell_engineering/src/DispMap.hpp>
Definition at line 29 of file DispMap.hpp.
◆ DataFromFiles()
CellEngineering::DataFromFiles::DataFromFiles |
( |
string & |
file | ) |
|
|
inline |
◆ fromOptions()
MoFEMErrorCode CellEngineering::DataFromFiles::fromOptions |
( |
| ) |
|
|
inline |
Definition at line 68 of file DispMap.hpp.
70 CHKERR PetscOptionsBegin(PETSC_COMM_WORLD,
"",
"Get parameters",
"none");
73 CHKERR PetscOptionsScalar(
"-cube_size",
"get cube size for the averaging",
78 "-scale",
"scale the distance between voxels (eg. from mm to m)",
"",
81 ierr = PetscOptionsEnd();
◆ getDataForGivenCoordinate()
double CellEngineering::DataFromFiles::getDataForGivenCoordinate |
( |
const double |
x, |
|
|
const double |
y, |
|
|
vector< vector< double >> & |
main_vector, |
|
|
const double |
sCale, |
|
|
const double |
cUbe_size |
|
) |
| |
|
inline |
returns vertors of data for given index of the point
- Parameters
-
vec_idx | reference vector of indices |
vec_data | reference vector of data (colors) |
- Returns
- error code
Definition at line 94 of file DispMap.hpp.
104 vector<double> vec_data;
105 vector<double> vec_dist;
110 int ix = ceil(x /
sCale);
111 int iy = ceil(y /
sCale);
113 vec_ix.resize(2 * nx);
114 vec_iy.resize(2 * ny);
117 for (
int i = 0;
i < 2 * nx;
i++) {
118 int idx = ix - nx +
i;
119 if (idx >= size_x / 2 || idx < -size_x / 2)
125 for (
int i = 0;
i < 2 * ny;
i++) {
126 int idx = iy - ny +
i;
127 if (idx >= size_y / 2 || idx < -size_y / 2)
134 vec_data.resize(vec_iy.size() * vec_ix.size());
135 vec_dist.resize(vec_iy.size() * vec_ix.size());
137 for (vector<int>::iterator it_iy = vec_iy.begin(); it_iy != vec_iy.end();
139 for (vector<int>::iterator it_ix = vec_ix.begin(); it_ix != vec_ix.end();
142 main_vector[*it_iy + size_y / 2][*it_ix + size_x / 2];
143 vec_dist[ii] = ((*it_iy *
sCale - y) * (*it_iy *
sCale - y) +
151 vector<double> kernel;
152 kernel.resize(vec_data.size());
156 const double m = (1 / sqrt(M_PI * 2 * sigma * sigma));
157 for (
int ii = 0; ii < vec_dist.size(); ii++) {
158 kernel[
i] =
m * exp(-(vec_dist[ii]) /
159 (2 * sigma * sigma));
163 for (vector<double>::iterator vec_itr = vec_data.begin();
164 vec_itr != vec_data.end(); vec_itr++) {
166 data += (*vec_itr) * kernel[ii++];
◆ loadFileData()
MoFEMErrorCode CellEngineering::DataFromFiles::loadFileData |
( |
| ) |
|
|
inline |
Definition at line 40 of file DispMap.hpp.
42 ifstream in(
fIle.c_str());
45 "file with data points not found");
49 typedef boost::tokenizer<boost::escaped_list_separator<char>> Tokenizer;
54 while (getline(in, line)) {
57 for (Tokenizer::iterator it(tok.begin()), end(tok.end()); it != end;
59 vec.push_back(atof(it->c_str()));
◆ cUbe_size
double CellEngineering::DataFromFiles::cUbe_size |
◆ fIle
string& CellEngineering::DataFromFiles::fIle |
◆ lAmbda
double CellEngineering::DataFromFiles::lAmbda |
◆ main_vector
vector<vector<double> > CellEngineering::DataFromFiles::main_vector |
◆ sCale
double CellEngineering::DataFromFiles::sCale |
The documentation for this struct was generated from the following file: