45 #define DEFAULT_TIME_SCALE 0.001 58 int main(
int argc,
char *argv[])
70 EST_String(
"[input file] -o [output file] [options]\n")+
71 "Summary: change/copy track files\n" 72 "use \"-\" to make input and output files stdin/out\n" 76 "-info Print information about file and header. \n" 77 " This option gives useful information such as file \n" 78 " length, file type, channel names. No output is produced\n\n" 79 "-track_names <string> \n" 80 " File containing new names for output channels\n\n" 81 "-diff Differentiate contour. This performs simple \n" 82 " numerical differentiation on the contour by \n" 83 " subtracting the amplitude of the current frame \n" 84 " from the amplitude of the next. Although quick, \n" 85 " this technique is crude and not recommende as the \n" 86 " estimation of the derivate is done on only one point\n\n" 87 "-delta <int> Make delta coefficients (better form of differentiate).\n" 88 " The argument to this option is the regression length of \n" 89 " of the delta calculation and can be between 2 and 4 \n\n" 90 "-sm <float> Length of smoothing window in seconds. Various types of \n" 91 " smoothing are available for tracks. This options specifies \n" 92 " length of the smooting window which effects the degree of \n" 93 " smoothing, i.e. a longer value means more smoothing \n\n" 94 "-smtype <string> Smooth type, median or mean\n" 95 "-style <string> Convert track to other form. Currently only one form \n" 96 " \"label\" is supported. This uses a specified cut off to \n" 97 " make a label file, with two labels, one for above the \n" 98 " cut off (-pos) and one for below (-neg)\n\n" 99 "-t <float> threshold for track to label conversion \n" 100 "-neg <string> Name of negative label in track to label conversion \n" 101 "-pos <string> Name of positive label in track to label conversion \n" 102 "-pc <string> Combine given tracks in parallel. If option \n" 103 " is longest, pad shorter tracks to longest, else if \n" 104 " first pad/cut to match first input track \n" +
130 cerr << argv[0] <<
": no input files specified\n";
136 for (p = trlist.
head(); p; p = p->
next())
144 else if (al.
val(
"-otype", 0) ==
"snns")
156 for (p = trlist.
head(); p; p = p->
next())
169 cerr <<
"Using -diff and -delta together makes no sense !\n";
204 if (al.
present(
"-track_names"))
209 cerr <<
"Failed to load new track names file." << endl;
251 if (al.
val(
"-style",0) ==
"label")
300 if (al.
val(
"-style", 0) ==
"label")
304 if (al.
present(
"-time_channel"))
void change_label(EST_Relation &seg, const EST_String &oname, const EST_String &nname)
void delta(EST_Track &tr, EST_Track &d, int regression_length=3)
The file was read in successfully.
int override_val(const EST_String rkey, const EST_String rval)
add to end of list or overwrite. If rval is empty, do nothing
int ival(const EST_String &rkey, int m=1) const
int StrListtoIList(EST_StrList &s, EST_IList &il)
Convert a list of strings to a list of integers.
int num_channels() const
return number of channels in track
int override_fval(const EST_String rkey, const float rval)
add to end of list or overwrite. If rval is empty, do nothing
EST_write_status save_snns_pat(const EST_String filename, EST_TrackList &inpat, EST_TrackList &outpat)
float fval(const EST_String &rkey, int m=1) const
void override_lib_ops(EST_Option &a_list, EST_Option &al)
T & nth(int n)
return the Nth value
void resize(ssize_t num_frames, int num_channels, bool preserve=1)
void track_smooth(EST_Track &c, float x, EST_String stype="")
const EST_String & sval(const EST_String &rkey, int m=1) const
EST_String options_track_filetypes_long(void)
void extract(EST_Track &tr, EST_Option &al)
void StringtoStrList(EST_String s, EST_StrList &l, EST_String sep)
Convert a EST_String to a EST_StrList by separating tokens in s delimited by the separator sep...
The file was written successfully.
void track_info(EST_Track &track)
EST_write_status save(const EST_String name, const EST_String EST_filetype="")
EST_String options_track_input(void)
int main(int argc, char *argv[])
const V & val(const K &rkey, bool m=0) const
return value according to key (const)
void append(const T &item)
add item onto end of list
#define DEFAULT_TIME_SCALE
EST_String options_track_output(void)
void track_to_label(const EST_Track &tr, EST_Relation &lab, float thresh=0.0)
EST_read_status read_TrackList(EST_TrackList &tlist, EST_StrList &files, EST_Option &al)
int present(const K &rkey) const
Returns true if key is present.
void extract_channel(EST_Track &orig, EST_Track &nt, EST_IList &ch_list)
EST_write_status save(const EST_String &filename, bool evaluate_ff=false) const
void ParallelTracks(EST_Track &a, EST_TrackList &list, const EST_String &style)
EST_Track differentiate(EST_Track &c, float samp_int=0.0)
EST_read_status load_StrList(EST_String filename, EST_StrList &l)
Load tokens from a file and return them in a EST_StrList.
int parse_command_line(int argc, char *argv[], const EST_String &usage, EST_StrList &files, EST_Option &al, int make_stdio=1)