 |
Bsoft
2.1.0
Bernard's software package
|
Go to the documentation of this file.
24 "Usage: radon [options] input.img output.img",
25 "-------------------------------------------",
26 "Program to do radon transforms.",
27 "Full transform: 2PI*2PI",
28 "Quarter transform: PI*PI",
30 "Types of forward radon transformation:",
31 "1 From 3D structure to single axis proj.",
32 "2 From single axis proj. to quarter radon transform",
33 "3 From 3D structure to full radon transform",
34 "4 From 3D structure to quarter radon transform",
36 "Types of backward radon transformation:",
37 "1 From single axis proj. to 3D structure",
38 "2 From quarter radon transform to single axis proj.",
39 "3 From full radon transform to 3D structure",
40 "4 From quarter radon transform to 3D structure",
42 "POCS specifications:",
43 "POCS filter works only on cube quarter radon transform,",
44 "that means theta = 2 * side of the cubic 3D structure map.",
45 "Side must be equal to a power of 2.",
46 "If radon transform has holes, POCS filter needs mask file.",
49 "-forward 4 Forward radon transform (default not)",
50 "-pocs 5,5,30,30,0 POCS density modification on radon transform (default not)",
51 " Parameters (in order): outer cycles, inner cycles, ",
52 " 3D limit, projection limit, support for finite extension",
53 "-backward 4 Backward radon transform (default not)",
56 "-verbose 7 Verbosity of output",
57 "-datatype u Force writing of a new data type (default output floating point)",
58 "-theta 64 Number of angles (default 2*ncol)",
59 "-kernel 15,4 Kernel size and power (default 11,2)",
60 "-nopadding Turn off padding (default on)",
63 "-mask mask.map Binary mask for POCS filter",
69 main (
int argc,
char **argv)
94 for (curropt = option; curropt; curropt = curropt->
next)
96 if ( curropt->
tag ==
"datatype" )
98 if ( curropt->
tag ==
"forward" )
101 cerr <<
"-forward: A type of forward transformation must be specified!" << endl;
102 else if (forward > 4)
105 if ( curropt->
tag ==
"pocs" )
106 if (sscanf (curropt->
value.
c_str(),
"%d,%d,%lf,%lf,%d", &n_cyc_out, &n_cyc_in, &rad_3D, &rad_plane, &support) < 2)
107 cerr <<
"-pocs: At least the outer and inner cycles must be specified!" << endl;
108 if ( curropt->
tag ==
"backward" )
111 cerr <<
"-backward: A type of backward transformation must be specified!" << endl;
112 else if (backward > 4)
115 if ( curropt->
tag ==
"theta" )
117 cerr <<
"-theta: The number of angles must be specified!" << endl;
118 if ( curropt->
tag ==
"kernel" )
119 if ( curropt->
values(nkernel, kernel_power) < 1)
120 cerr <<
"-kernel: At least the kernel size must be specified!" << endl;
121 if ( curropt->
tag ==
"nopadding" )
123 if ( curropt->
tag ==
"mask" )
147 n_theta = p->
sizeX() * 2;
150 rad_3D = p->
sizeX() / 2 - 1;
153 rad_plane = p->
sizeX() / 2 - 1;
164 if (n_cyc_out && n_cyc_in) {
165 if ( n_cyc_in > 1 && !pmask ) {
166 cout <<
"Error: To use POCS effectively, a mask file must be given!" << endl;
179 if (p && optind < argc)
A class for a command line input option.
Bimage * img_radon_transform(Bimage *p, int type, int nkernel, int kernel_power, int padd, int ntheta)
Calculates the Radon transform of an image.
Boption * get_option_list(const char *use[], int argc, char *argv[], int &optind)
Parses command line arguments based on a template.
double background(long nn)
Header file for option handlers.
int calculate_background(long nn, int flag)
Calculates the background for one sub-image.
int img_radon_pocs_filter(Bimage *p, int n_cyc_out, int n_cyc_in, double rad_3D, double rad_plane, int support, Bimage *pmask)
Filters a radon transform using the POCS method.
long values(T1 &v1, T2 &v2)
Bimage * read_img(char *filename, int readdata, int img_select)
General driver function to read multiple image formats.
int write_img(const char *filename, Bimage *p, int compression)
General driver function to write multiple image formats.
int img_resize_to_next_power2(Bimage *p, int fill_type, double fill)
Resizes without interpolation or rescaling to the next power of 2.
General image parameter class.
Header file for general utilities.
int main(int argc, char **argv)
void change_type(char letter)
Get the data type indicated by a single letter code.
Header file for 2D and 3D image I/O.
Bimage * img_radon_inverse_transform(Bimage *p, int type, int nkernel, int kernel_power, int padd)
Calculates a 3D image from a Radon transform.
int option_kill(Boption *option)
Deallocates a linked list of option structures.
DataType
Base data type specifier.