 |
Bsoft
2.1.0
Bernard's software package
|
Go to the documentation of this file.
23 "Usage: bcat [options] input.images",
24 "----------------------------------",
25 "Catenates a list of images into a multi-image file.",
26 "Any number of input images may be given and may include the wild card \"*\".",
27 "(However, VMS does not support Unix style usage of wild cards).",
28 "All images must have the same data type.",
31 "-rescale -0.1,5.2 Rescale input images to average and standard deviation.",
34 "-verbose 3 Verbosity of output.",
35 "-datatype u Force writing of a new data type.",
36 "-sampling 1.5,1.5,1.5 Sampling (A/pixel; a single value can be given).",
37 "-origin 0.8,-10,15.7 Set the origin (default from input image).",
38 "-reverse Reverse the order of catenation.",
39 "-slices Pack 2D images as z-slices (default pack as separate images).",
40 "-size 10,50,8 New image size (pixels).",
41 "-fill 125.5 Fill value for padding (default average).",
42 "-raw d=f#x=120,120,1 Formatting to reinterpret image files.",
45 "-output output.img Output image (default temp.miff).",
50 int main(
int argc,
char **argv)
62 double nuavg(0), nustd(0);
69 for ( curropt = option; curropt; curropt = curropt->
next ) {
70 if ( curropt->
tag ==
"datatype" )
72 if ( curropt->
tag ==
"sampling" )
73 sam = curropt->
scale();
74 if ( curropt->
tag ==
"origin" ) {
75 if ( curropt->
value[0] ==
'c' ) {
78 origin = curropt->
origin();
82 if ( curropt->
tag ==
"reverse" )
84 if ( curropt->
tag ==
"slices" )
86 if ( curropt->
tag ==
"size" )
87 nusize = curropt->
size();
88 if ( curropt->
tag ==
"rescale" ) {
89 if ( curropt->
values(nuavg, nustd) < 2 )
90 cerr <<
"-rescale: Both averge and standard deviation must be specified!" << endl;
91 if ( nustd < 0 ) nustd = 0;
93 if ( curropt->
tag ==
"fill" )
94 fill = curropt->
fill(fill_type);
95 if ( curropt->
tag ==
"raw" ) {
96 rawstring = curropt->
value;
97 if ( rawstring.
length() < 1 )
98 cerr <<
"-raw: A valid format reinterpretation string must be specified!" << endl;
100 if ( curropt->
tag ==
"output" ) {
101 catfile = curropt->
value;
102 if ( catfile.
length() < 1 )
103 cerr <<
"-output: An output file must be specified!" << endl;
109 cerr <<
"Error: No input files given!" << endl;
117 while ( optind < argc )
string_add(&file_list, argv[optind++]);
119 cerr <<
"Error: No image files specified!" << endl;
126 nusize, setZslices, fill_type, fill, nuavg, nustd);
134 else pcat->
origin(origin);
long reverse_list(char **list)
Reverse the order of items in a linked list.
A class for a command line input option.
Vector3< double > scale()
int main(int argc, char **argv)
int string_kill(Bstring *list)
Kills a string linked list.
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.
int calculate_background(long nn, int flag)
Calculates the background for one sub-image.
Vector3< double > origin()
long values(T1 &v1, T2 &v2)
int write_img(const char *filename, Bimage *p, int compression)
General driver function to write multiple image formats.
General image parameter class.
Utilities for timing functions.
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 origin(double ox, double oy, double oz)
Header file for 2D and 3D image I/O.
Header file for generalized linked list functions.
int option_kill(Boption *option)
Deallocates a linked list of option structures.
Header file for combining two images in various ways.
void sampling(long nn, Vector3< double > u)
DataType
Base data type specifier.
Bstring * string_add(Bstring **list, const char *string)
Adds a string to a linked list.
Bimage * img_catenate(Bstring *file_list, Bstring &rawstring, DataType newdatatype, Vector3< long > nusize, int setZslices=0, int fill_type=0, double fill=0, double newavg=0, double newstd=0)
Catenates a list of images into a multi-image structure.