 |
Bsoft
2.1.0
Bernard's software package
|
Go to the documentation of this file.
21 "Usage: blocfilt [options] input.img output.img",
22 "----------------------------------------------",
25 "-box 20 Kernel size for filtering according to local resolution (voxels).",
28 "-verbose 7 Verbosity of output.",
29 "-sampling 1.5,1.5,1.5 Sampling (A/pixel; a single value can be given).",
30 "-origin 0.8,-10,15.7 Set the origin (default from input image).",
31 "-symmetry D5 Point group symmetry.",
32 "-edge 10 Pixels at the edge of the whole map to exclude from analysis (default: half the size of the resolution box).",
35 "-Resolution locres.tif Resolution map to use for local filtering.",
36 "-Mask mask.tif,2 Mask file to use for limiting the analysis to a defined region",
37 " and level value to use (optional, default: all but zero).",
42 int main(
int argc,
char **argv)
60 for ( curropt = option; curropt; curropt = curropt->
next ) {
61 if ( curropt->
tag ==
"box" )
63 cerr <<
"-box: A resolution box size must be specified!" << endl;
64 if ( curropt->
tag ==
"edge" )
65 vedge = curropt->
size();
66 if ( curropt->
tag ==
"sampling" )
67 sam = curropt->
scale();
68 if ( curropt->
tag ==
"origin" ) {
69 if ( curropt->
value[0] ==
'c' ) {
72 origin = curropt->
origin();
76 if ( curropt->
tag ==
"symmetry" )
78 if ( curropt->
tag ==
"Mask" ) {
81 mask_level = (maskfile.
post(
',')).integer();
82 maskfile = maskfile.
pre(
',');
85 if ( curropt->
tag ==
"Resolution" )
94 if ( p1 == NULL )
bexit(-1);
97 if ( sam[0] > 0 && sam[1] > 0 && sam[2] > 0 ) {
106 if ( ! locresfile.
length()) {
107 cerr <<
"ERROR: Local resolution file needed! (option -Resolution)" << endl;
112 cerr <<
"ERROR: Box size value needed! (option -box)" << endl;
125 if ( symmetry_string.
length() ) {
127 if ( sym->
point > 101 ) {
130 maskfile = maskfile.
pre_rev(
'.') +
"_levelmask." + maskfile.
post_rev(
'.');
148 p = p1->
local_filter(pmask, mask_level, resmap, boxsize, vedge);
150 cerr <<
"Error: No local-filtered map produced!" << endl;
160 if ( optind < argc ) {
165 if (pmask)
delete pmask;
166 if (resmap)
delete resmap;
A class for a command line input option.
Vector3< double > scale()
long mask_dilate(long times=1)
Dilates a binary mask.
int bexit(int value)
Exit function for cleanup and debugging.
Vector3< double > default_origin()
Boption * get_option_list(const char *use[], int argc, char *argv[], int &optind)
Parses command line arguments based on a template.
Header file for option handlers.
Vector3< double > origin()
Bimage * local_filter(Bimage *pmask, int mask_level, Bimage *resmap, int size, Vector3< long > vedge)
Applies a local resolution filter to a map.
Bimage * read_img(char *filename, int readdata, int img_select)
General driver function to read multiple image formats.
void multiply(long j, Complex< double > cv)
int write_img(const char *filename, Bimage *p, int compression)
General driver function to write multiple image formats.
int replicate_asymmetric_unit(Bsymmetry *sym)
Calculates a full map from one asymmetric unit.
General image parameter class.
Utilities for timing functions.
Bimage * levelmask_asymmetric_units(Bsymmetry *sym, int index)
Calculates a multi-level mask to indicate asymmetric units.
Bstring symmetry_string()
double timer_start()
Starts timer and prints the time.
Header file for general utilities.
Bsymmetry * init_point_group_symmetry(Bstring symmetry_string)
Sets up a symmetry structure from a string identifier.
double timer_report(double lasttime)
Reports the time elapsed since a given time.
void origin(double ox, double oy, double oz)
void change_type(char letter)
Get the data type indicated by a single letter code.
Header file for 2D and 3D image I/O.
int kill_symmetry(Bsymmetry *sym)
Deallocates a symmetry structure.
int option_kill(Boption *option)
Deallocates a linked list of option structures.
void sampling(long nn, Vector3< double > u)
int main(int argc, char **argv)
DataType
Base data type specifier.
bool contains(const Bstring &s)