#include "emdata.h"
#include "ctf.h"
#include "portable_fileio.h"
#include "io/imageio.h"
#include <cstring>
#include <sstream>
#include <iomanip>
#include <sys/stat.h>
#include <iostream>
Go to the source code of this file.
◆ find_region()
vector< Vec3i > find_region |
( |
EMData * |
image, |
|
|
const vector< Vec3i > & |
coords, |
|
|
const float |
value, |
|
|
vector< Vec3i > & |
region |
|
) |
| |
Definition at line 1344 of file emdata_metadata.cpp.
1346 static vector<Vec3i> two_six_connected;
1347 if (two_six_connected.size() == 0) {
1348 for(
int i = -1; i <= 1; ++i) {
1349 for(
int j = -1; j <= 1; ++j) {
1350 for(
int k = -1; k <= 1; ++k) {
1351 if ( j != 0 || i != 0 || k != 0) {
1352 two_six_connected.push_back(
Vec3i(i,j,k));
1360 for(vector<Vec3i>::const_iterator it = two_six_connected.begin(); it != two_six_connected.end(); ++it ) {
1361 for(vector<Vec3i>::const_iterator it2 = coords.begin(); it2 != coords.end(); ++it2 ) {
1362 if (image->get_value_at((*it2)[0],(*it2)[1],(*it2)[2]) != value)
throw;
1363 Vec3i c = (*it)+(*it2);
1365 if ( c[0] < 0 || c[0] >= image->get_xsize())
continue;
1366 if ( c[1] < 0 || c[1] >= image->get_ysize())
continue;
1367 if ( c[2] < 0 || c[2] >= image->get_zsize())
continue;
1369 if( image->get_value_at(c[0],c[1],c[2]) == value ) {
1370 if (find(ret.begin(),ret.end(),c) == ret.end()) {
1371 if (find(region.begin(),region.end(),c) == region.end()) {
1372 region.push_back(c);
◆ greaterthan()
int greaterthan |
( |
const void * |
p1, |
|
|
const void * |
p2 |
|
) |
| |
Definition at line 996 of file emdata_metadata.cpp.
998 float* v1 = (
float*) p1;
999 float* v2 = (
float*) p2;
1001 if ( *v1 < *v2 )
return 0;
Referenced by get_attr().