 |
Bsoft
2.1.0
Bernard's software package
|
Go to the documentation of this file.
21 "Usage: blocres [options] input1.img input2.img output.img",
22 "---------------------------------------------------------",
23 "The local (-box) and shell (-shell) resolution calculations are mutually exclusive.",
26 "-box 20 Kernel size for determining local resolution (pixels/voxels).",
27 "-shell 14 Shell width for determining radial resolution (pixels/voxels).",
30 "-verbose 7 Verbosity of output.",
31 "-sampling 1.5,1.5,1.5 Sampling (A/pixel; a single value can be given).",
32 "-origin 0.8,-10,15.7 Set the origin (default from input image).",
33 "-step 5 Interval between voxel samples or shells for resolution analysis (pixels, default: 1).",
34 "-radii 20,130 Radial limits for local or shell resolution (default 0,<x-dimension>).",
35 "-maxresolution 5 Maximum frequency available in the data (angstrom).",
36 "-cutoff 0.5,0.143 Resolution cutoffs for FSC (default 0.5).",
37 "-fill 200 Value to fill the background (non-masked regions; default 0).",
39 "Parameters for local resolution:",
40 "-pad 2 Resolution box padding factor (0 = none, default: 1 (box) and 0 (shell)).",
41 "-edge 10 Pixels at the edge of the whole map to exclude from analysis (default: half the size of the resolution box).",
42 "-taper edge Apply a windowing aperture to box volumes before resolution analysis.",
43 " none = do not taper",
44 " edge = circular mask with smooth edges",
45 " hann = hanning window (default)",
46 "-nofill Do not fill values in between (if step > 1).",
47 "-symmetry D5 Point group symmetry.",
49 "Parameters for shell resolution:",
50 "-smooth Smooth the shell edge.",
53 "-Mask mask.tif,2 Mask file to use for limiting the analysis to a defined region",
54 " and level value to use (optional, default: all but zero).",
57 "-usedmask used.mrc Output file name for mask after modifications.",
62 int main(
int argc,
char **argv)
77 double cutoff[4] = {0.5,0,0,0};
91 for ( curropt = option; curropt; curropt = curropt->
next ) {
92 if ( curropt->
tag ==
"box" )
94 cerr <<
"-box: A resolution box size must be specified!" << endl;
95 if ( curropt->
tag ==
"shell" )
97 cerr <<
"-shell: A shell width must be specified!" << endl;
98 if ( curropt->
tag ==
"sampling" )
99 sam = curropt->
scale();
100 if ( curropt->
tag ==
"origin" ) {
101 if ( curropt->
value[0] ==
'c' ) {
104 origin = curropt->
origin();
108 if ( curropt->
tag ==
"step" )
110 cerr <<
"-step: A sampling step size must be specified!" << endl;
111 if ( curropt->
tag ==
"pad" )
113 cerr <<
"-pad: A padding factor must be specified!" << endl;
114 if ( curropt->
tag ==
"maxresolution" )
115 if ( ( maxres = curropt->
value.
real() ) < 0.1 )
116 cerr <<
"-maxresolution: A resolution limit must be specified!" << endl;
117 if ( curropt->
tag ==
"taper" ) {
118 if ( curropt->
value[0] ==
'n' ) taper = 0;
119 if ( curropt->
value[0] ==
'h' ) taper = 2;
120 if ( curropt->
value[0] ==
'e' ) taper = 1;
122 if ( curropt->
tag ==
"fill" )
123 if ( ( fill = curropt->
value.
real() ) < 1 )
124 cerr <<
"-fill: A fill value must be specified!" << endl;
125 if ( curropt->
tag ==
"nofill" )
127 if ( curropt->
tag ==
"edge" )
128 vedge = curropt->
size();
129 if ( curropt->
tag ==
"radii" )
130 if ( curropt->
values(minrad, maxrad) < 1 )
131 cerr <<
"-radii: At least a minimum radius must be specified!" << endl;
132 if ( curropt->
tag ==
"smooth" ) smooth = 1;
133 if ( curropt->
tag ==
"cutoff" )
134 if ( curropt->
values(cutoff[0], cutoff[1], cutoff[2], cutoff[3]) < 1 )
135 cerr <<
"-cutoff: At least one FSC threshold must be specified!" << endl;
136 if ( curropt->
tag ==
"symmetry" )
138 if ( curropt->
tag ==
"Mask" ) {
141 mask_level = (maskfile.
post(
',')).integer();
142 maskfile = maskfile.
pre(
',');
145 if ( curropt->
tag ==
"usedmask" )
153 if ( p1 == NULL )
bexit(-1);
156 if ( p2 == NULL )
bexit(-1);
159 cerr <<
"Error: The sizes of the two images do not match!" << endl;
178 if ( boxsize>0 && maskfile.
length() && step>1 && !nofill) {
179 cerr <<
"ERROR: Can not set a step size more than one when using a mask!" << endl;
180 cerr <<
"Please select only one of the two options, otherwise set the nofill option" << endl;
201 if ( symmetry_string.
length() ) {
209 if ( usedmaskfile.
length() )
212 if ( pad < 0 ) pad = 1;
213 p = p1->
fsc_local(p2, pmask, maxres, cutoff, mask_level, boxsize,
214 pad, vedge, step, taper, fill);
216 cerr <<
"Error: No local resolution map produced!" << endl;
226 }
else if ( shell_width > 0 ) {
228 p = p1->
fsc_shell(p2, maxres, cutoff, shell_width, step, minrad, maxrad,
231 cerr <<
"Error: No shell resolution map produced!" << endl;
237 if ( optind < argc ) {
242 if (pmask)
delete pmask;
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.
Vector3< long > size() const
Header file for option handlers.
Vector3< double > origin()
long values(T1 &v1, T2 &v2)
Bimage * read_img(char *filename, int readdata, int img_select)
General driver function to read multiple image formats.
void origin(double x, double y, double z)
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.
long mask_shell(Vector3< double > origin, double rad_min, double rad_max)
int interpolate_gaps(long step)
Interpolate the voxels that are not calculated.
General image parameter class.
Utilities for timing functions.
unsigned char * data_alloc()
Bimage * levelmask_asymmetric_units(Bsymmetry *sym, int index)
Calculates a multi-level mask to indicate asymmetric units.
Bstring symmetry_string()
Bimage * fsc_local(Bimage *p, Bimage *pmask, double resolution, double *cutoff, int mask_level, int size, int pad, Vector3< long > vedge, int step=1, int taper=1, double fill=0)
Determine the local resolution at each masked voxel in a map.
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)
DataType
Base data type specifier.
bool contains(const Bstring &s)
int main(int argc, char **argv)
Bimage * fsc_shell(Bimage *p, double hi_res, double *cutoff, int thickness, int step, int minrad, int maxrad, int pad=1, int smooth=0, double fill=0)
Determine the resolution for each concentric shell in a map.