 |
Bsoft
2.1.0
Bernard's software package
|
Go to the documentation of this file.
21 "Usage: b3v [options] input.img output.img",
22 "-----------------------------------------",
23 "Generates 3 orthogonal views of a map.",
26 "-orthogonal 24,67,45 Extract orthogonal slices around this voxel.",
27 " The voxel can be specified as center or origin.",
28 "-montage 2 Montage the slices into a number of columns.",
31 "-verbose 7 Verbosity of output.",
32 "-datatype u Force writing of a new data type.",
33 "-select 5 Image number.",
34 "-size 100,80,120 Size of orthogonal slices to extract.",
35 "-pad 5 Padding to add around slices or images (default 0).",
36 "-fill 127 Fill value for padding (default average).",
41 int main(
int argc,
char **argv)
57 for ( curropt = option; curropt; curropt = curropt->
next ) {
58 if ( curropt->
tag ==
"datatype" )
60 if ( curropt->
tag ==
"montage" )
62 cerr <<
"-montage: A number of columns must be specified!" << endl;
63 if ( curropt->
tag ==
"orthogonal" ) {
64 if ( curropt->
value[0] ==
'c' ) orth_type = 1;
65 else if ( curropt->
value[0] ==
'o' ) orth_type = 2;
67 if ( curropt->
values(voxel[0], voxel[1], voxel[2]) < 3 )
68 cerr <<
"-orthogonal: A voxel must be specified!" << endl;
72 if ( curropt->
tag ==
"select" )
74 cerr <<
"-select: Image numbers start from 0!" << endl;
75 if ( curropt->
tag ==
"size" )
76 size = curropt->
size();
77 if ( curropt->
tag ==
"pad" )
79 cerr <<
"-pad: A number of pixels must be specified!" << endl;
80 if ( curropt->
tag ==
"fill" )
81 fill = curropt->
fill(fill_type);
88 if ( p == NULL )
bexit(-1);
90 if ( optind >= argc ) {
110 if ( orth_type < 3 ) {
112 if ( orth_type == 1 )
114 else if ( orth_type == 2 )
125 p->
resize(newsize, translate, fill_type, fill);
128 if ( montage_cols ) {
129 p3 = p->
montage(0, montage_cols, 4 - montage_cols, 0, 1);
A class for a command line input option.
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.
double background(long nn)
Header file for option handlers.
int calculate_background(long nn, int flag)
Calculates the background for one sub-image.
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)
int write_img(const char *filename, Bimage *p, int compression)
General driver function to write multiple image formats.
General image parameter class.
double average(long cc, double xf, double yf, double zf, long nn, double iscale)
Averages in 3D when scaling is less than 1.
Utilities for timing functions.
int main(int argc, char **argv)
Bimage * montage(int first, int cols, int rows, int skip=0, int flipy=0)
Rearranges an image into a montage of 2D slices for display.
double timer_start()
Starts timer and prints the time.
Header file for general utilities.
double fill(int &fill_type)
double timer_report(double lasttime)
Reports the time elapsed since a given time.
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 option_kill(Boption *option)
Deallocates a linked list of option structures.
DataType
Base data type specifier.
Bimage * orthogonal_slices(long nn, Vector3< long > voxel, Vector3< long > ext_size)
Extracts orthogonal views around a voxel.
int resize(Vector3< long > nusize, Vector3< long > translate, int fill_type=0, double fill=0)
Resizes without interpolation or rescaling.