libRASCH: eval.c File Reference
eval.c File Reference
Include dependency graph for eval.c:
Go to the source code of this file.
Defines
#define _LIBRASCH_BUILD
Functions
LIBRAAPI int ra_eval_edit_start (any_handle h)
LIBRAAPI int ra_eval_edit_complete (any_handle h)
LIBRAAPI int ra_eval_edit_cancel (any_handle h)
LIBRAAPI int ra_eval_attribute_list (any_handle h, value_handle vh)
LIBRAAPI int ra_eval_attribute_get (any_handle h, const char *id, value_handle vh)
get from 'h' the value of the attribute 'name'
LIBRAAPI int ra_eval_attribute_set (any_handle h, const char *id, value_handle vh)
set the value of the attribute 'name' in 'h'
LIBRAAPI int ra_eval_attribute_unset (any_handle h, const char *id)
removes the attribute 'name' in 'h'
eval_attribute * find_attribute (struct eval_head *h, const char *id)
int delete_attributes (struct eval_head *h)
LIBRAAPI eval_handle ra_eval_add (meas_handle mh, const char *name, const char *desc, int original)
adds an evaluation
int set_env (struct eval *e)
set environment informations in evaluation
LIBRAAPI int ra_eval_delete (eval_handle eh)
delete evaluation
LIBRAAPI int ra_eval_get_all (meas_handle mh, value_handle vh)
returns all evaluation-handles
LIBRAAPI eval_handle ra_eval_get_original (meas_handle mh)
returns the original evaluation-handle
LIBRAAPI eval_handle ra_eval_get_default (meas_handle mh)
returns the default evaluation-handle
LIBRAAPI int ra_eval_set_default (eval_handle eh)
set an evaluation to the default one
LIBRAAPI eval_handle ra_eval_get_handle (class_handle clh)
returns the evaluation handle an event-class belongs to
LIBRAAPI class_handle ra_class_add (eval_handle eh, const char *id, const char *name, const char *desc)
adds an user-defined event-class to an evaluation
LIBRAAPI class_handle ra_class_add_predef (eval_handle eh, const char *id)
adds an pre-defined event-class to an evaluation
LIBRAAPI int ra_class_delete (class_handle clh)
deletes an event-class
LIBRAAPI int ra_class_get (eval_handle eh, const char *id, value_handle vh)
return event-class
LIBRAAPI long ra_class_add_event (class_handle clh, long start, long end)
add an event
int add_prop_mem (struct eval_class *c)
LIBRAAPI int ra_class_del_event (class_handle clh, long event_id)
delete an event
long get_event_idx (struct eval_class *c, long event_id)
int del_prop_values (struct eval_class *c, long idx)
LIBRAAPI int ra_class_get_event_pos (class_handle clh, long event_id, long *start, long *end)
get the start and end position of an event
LIBRAAPI int ra_class_set_event_pos (class_handle clh, long event_id, long start, long end)
set the start and end position of an event
int comp_pos (const void *arg1, const void *arg2)
LIBRAAPI int ra_class_get_events (class_handle clh, long start, long end, int complete, int sort, value_handle vh)
returns the events in a specific region
LIBRAAPI class_handle ra_class_get_handle (prop_handle ph)
returns the event-class handle the event-property belongs to
LIBRAAPI prop_handle ra_prop_add (class_handle clh, const char *id, long value_type, long num_values, const char *name, const char *desc, const char *unit, int use_minmax, double min, double max)
int alloc_prop_mem (struct eval_property *p)
LIBRAAPI prop_handle ra_prop_add_predef (class_handle clh, const char *id)
LIBRAAPI int ra_prop_delete (prop_handle ph)
LIBRAAPI int ra_prop_get_all (class_handle clh, value_handle vh)
LIBRAAPI prop_handle ra_prop_get (class_handle clh, const char *id)
LIBRAAPI int ra_prop_set_value (prop_handle ph, long event_id, long ch, value_handle vh)
LIBRAAPI int ra_prop_get_ch (prop_handle ph, long event_id, value_handle vh)
LIBRAAPI int ra_prop_get_value (prop_handle ph, long event_id, long ch, value_handle vh)
LIBRAAPI int ra_prop_get_events (prop_handle ph, value_handle min, value_handle max, long ch, value_handle vh)
LIBRAAPI sum_handle ra_sum_add (class_handle clh, const char *id, const char *name, const char *desc)
LIBRAAPI int ra_sum_add_ch (sum_handle sh, long ch, long fiducial_offset, long num_dim, const char **dim_unit, const char **dim_name)
LIBRAAPI int ra_sum_delete (sum_handle sh)
LIBRAAPI int ra_sum_get (class_handle clh, const char *id, value_handle vh)
LIBRAAPI long ra_sum_add_part (sum_handle sh, long num_events, const long *events_based_on)
LIBRAAPI int ra_sum_del_part (sum_handle sh, long part_id)
LIBRAAPI int ra_sum_set_part_data (sum_handle sh, long part_id, long channel, long dim, value_handle vh)
LIBRAAPI int ra_sum_get_part_data (sum_handle sh, long part_id, long channel, long dim, value_handle vh)
LIBRAAPI int ra_sum_get_part_events (sum_handle sh, long part_id, value_handle vh)
int get_sum_data_idx (sum_handle sh, long channel, long dim)
Detailed Description
This file provides the part of the API to access evaluations.
Author: Raphael Schneider (rasch@med1.med.tum.de )
Definition in file eval.c .
Define Documentation
Function Documentation
Definition at line 911 of file eval.c .
References eval_property::allocated_events , eval_property::ch_map , EVENT_MEM_ADD , eval_property::next , eval_property::num_elements , eval_property::num_entries , eval_class::num_event , eval_class::prop , RA_VALUE_TYPE_CHAR , RA_VALUE_TYPE_CHAR_ARRAY , RA_VALUE_TYPE_DOUBLE , RA_VALUE_TYPE_DOUBLE_ARRAY , RA_VALUE_TYPE_LONG , RA_VALUE_TYPE_LONG_ARRAY , RA_VALUE_TYPE_SHORT , RA_VALUE_TYPE_SHORT_ARRAY , eval_property::value , and eval_property::value_type .
Referenced by ra_class_add_event() .
Definition at line 1452 of file eval.c .
References eval_property::allocated_events , eval_property::ch_map , eval_property::evclass , eval_property::num_elements , eval_property::num_entries , eval_class::num_event , RA_VALUE_TYPE_CHAR , RA_VALUE_TYPE_CHAR_ARRAY , RA_VALUE_TYPE_DOUBLE , RA_VALUE_TYPE_DOUBLE_ARRAY , RA_VALUE_TYPE_LONG , RA_VALUE_TYPE_LONG_ARRAY , RA_VALUE_TYPE_SHORT , RA_VALUE_TYPE_SHORT_ARRAY , eval_property::value , and eval_property::value_type .
Referenced by ra_prop_add() .
int comp_pos
(
const void *
arg1 ,
const void *
arg2
)
int del_prop_values
(
struct eval_class *
c ,
long
idx
)
Definition at line 1058 of file eval.c .
References eval_property::ch_map , eval_property::next , eval_property::num_elements , eval_property::num_entries , RA_VALUE_TYPE_CHAR , RA_VALUE_TYPE_CHAR_ARRAY , RA_VALUE_TYPE_DOUBLE , RA_VALUE_TYPE_DOUBLE_ARRAY , RA_VALUE_TYPE_LONG , RA_VALUE_TYPE_LONG_ARRAY , RA_VALUE_TYPE_SHORT , RA_VALUE_TYPE_SHORT_ARRAY , eval_property::value , and eval_property::value_type .
Referenced by ra_class_del_event() .
int delete_attributes
(
struct eval_head *
h
)
long get_event_idx
(
struct eval_class *
c ,
long
event_id
)
int get_sum_data_idx
(
sum_handle
sh ,
long
channel ,
long
dim
)
Parameters:
<eh> evaluation handle
<id> ASCII-id of the event-class
<name> a short name for the event-class
<desc> a short description of the event-class
The function adds an event-class to the evaluation 'eh'. The parameter 'id' is used to identifiy the event-class and must contain only ASCII characters. The parameters 'name' and 'desc' are used to describe the event-class. If you want to use a pre-defined event-class, use ra_class_add_predef() .
Definition at line 676 of file eval.c .
References _ra_set_error , eval_class::ascii_id , eval::cl , eval_class::eval , get_class_id() , eval_class::handle_id , eval_class::id , MAX_ID_LEN , eval_class::meas , eval::meas , ra_class_delete() , RA_ERR_INFO_MISSING , RA_ERR_NONE , ra_eval_attribute_set() , RA_HANDLE_EVAL_CLASS , ra_list_add() , ra_value_free() , ra_value_malloc() , and ra_value_set_string() .
Referenced by add_class_orig() , and ra_class_add_predef() .
LIBRAAPI long ra_class_add_event
(
class_handle
clh ,
long
start ,
long
end
)
Parameters:
<clh> event-class handle
<start> start position of the event in sample-units
<end> end position of the event in sample-units
The function adds an event to the event-class 'clh'. The start and end of the event are given by 'start' and 'end' respectively. If the event is a point in time, use for 'end' the same value as 'start'. A unique event-id is returned.
Definition at line 883 of file eval.c .
References _ra_set_error , add_prop_mem() , eval_event::end , eval_class::ev , eval_class::handle_id , eval_event::id , eval_class::last_id , eval_class::num_event , RA_ERR_NONE , RA_ERR_WRONG_HANDLE , RA_HANDLE_EVAL_CLASS , and eval_event::start .
Referenced by add_events_orig() , create_auto_class() , and read_sets_xml() .
LIBRAAPI int ra_class_del_event
(
class_handle
clh ,
long
event_id
)
Parameters:
<clh> event-class handle
<event_id> event-id of the event
The function deletes the event 'event_id' from the event-class 'clh'.
Definition at line 996 of file eval.c .
References _ra_set_error , del_prop_values() , eval_class::ev , get_event_idx() , eval_class::handle_id , eval_class::last_id , eval_class::num_event , RA_ERR_NONE , RA_ERR_OUT_OF_RANGE , RA_ERR_WRONG_HANDLE , RA_ERR_WRONG_INPUT , and RA_HANDLE_EVAL_CLASS .
Parameters:
The function deletes the event-class 'clh'.
Definition at line 767 of file eval.c .
References _ra_set_error , eval::cl , delete_attributes() , eval_class::ev , eval_class::handle_id , eval_class::prop , RA_ERR_NONE , RA_ERR_WRONG_HANDLE , RA_HANDLE_EVAL_CLASS , ra_list_del() , ra_prop_delete() , ra_sum_delete() , and eval_class::summaries .
Referenced by ra_class_add() , and ra_eval_delete() .
Parameters:
<eh> evaluation handle
<id> event-class ASCII-id
<vh> value handle
The function returns all event-classes with the id 'id'. If 'id' is NULL (or is an empty string), all event-classes in the evaluation 'eh' are given.
Definition at line 818 of file eval.c .
References _ra_set_error , eval_class::ascii_id , eval::cl , eval::handle_id , eval_class::next , RA_ERR_INFO_MISSING , RA_ERR_NONE , RA_ERR_WRONG_HANDLE , RA_HANDLE_EVAL , ra_value_reset() , and ra_value_set_voidp_array() .
Referenced by do_post_processing() , and ra_eval_delete() .
LIBRAAPI int ra_class_get_event_pos
(
class_handle
clh ,
long
event_id ,
long *
start ,
long *
end
)
Parameters:
<clh> event-class handle
<event_id> event-id of the event
<start> here the start position will be returned
<end> here the end position will be returned
The function returns in 'start' and 'end' the position of the evvent 'event_id' from the event-class 'clh'. The positions are in sample-units.
Definition at line 1162 of file eval.c .
References _ra_set_error , eval_event::end , eval_class::ev , get_event_idx() , eval_class::handle_id , eval_class::last_id , RA_ERR_NONE , RA_ERR_OUT_OF_RANGE , RA_ERR_WRONG_HANDLE , RA_ERR_WRONG_INPUT , RA_HANDLE_EVAL_CLASS , and eval_event::start .
Parameters:
<clh> event-class handle
<start> start of the region of interest
<end> end of the region of interest
<complete> flag if the events have to be complete in the region of interest
<sort> flag if the found events should be sorted according their start position
<vh> value handle receiving the event-id's asked for
The function returns in 'vh' the events which are inside a specific region. The region of interest (ROI)is given by 'start' and 'end'. If the 'complete' flag is set, the events have to be complete inside the ROI. If it is not set, all events are returned which starts or ends inside the ROI.
Definition at line 1269 of file eval.c .
References _ra_set_error , comp_pos() , eval_event::end , eval_class::ev , eval_class::handle_id , sort_pos::id , eval_event::id , eval_class::num_event , sort_pos::pos , RA_ERR_INFO_MISSING , RA_ERR_NONE , RA_ERR_WRONG_HANDLE , RA_HANDLE_EVAL_CLASS , ra_value_reset() , ra_value_set_long_array() , and eval_event::start .
LIBRAAPI int ra_class_set_event_pos
(
class_handle
clh ,
long
event_id ,
long
start ,
long
end
)
Parameters:
<clh> event-class handle
<event_id> event-id of the event
<start> the start position of the event
<end> the end position of the event
The function sets the start and end position of the event 'event_id' in the event-class 'clh' to the values 'start' and 'end'.
Definition at line 1209 of file eval.c .
References _ra_set_error , eval_event::end , eval_class::ev , get_event_idx() , eval_class::handle_id , eval_class::last_id , RA_ERR_NONE , RA_ERR_OUT_OF_RANGE , RA_ERR_WRONG_HANDLE , RA_ERR_WRONG_INPUT , RA_HANDLE_EVAL_CLASS , and eval_event::start .
Parameters:
<mh> measurement-handle
<name> a short name of the evaluation
<desc> a short description of the evaluation
<original> flag if evaluation is the original evaluation
This function adds an evaluation to a measurement.
Definition at line 246 of file eval.c .
References _ra_set_error , ra_meas::eval , EVAL_MAX_DESC , eval_info::evaluations , ra_meas::handle_id , eval::handle_id , eval::meas , eval::original , RA_ERR_EVAL_WRONG_TYPE , RA_ERR_NONE , RA_ERR_WRONG_HANDLE , ra_eval_attribute_set() , ra_eval_get_original() , ra_eval_set_default() , RA_HANDLE_EVAL , RA_HANDLE_MEAS , ra_list_add() , ra_list_del() , ra_value_free() , ra_value_malloc() , ra_value_set_string() , and set_env() .
Referenced by add_eval_orig() , and ra_eval_save_result() .
Definition at line 61 of file eval.c .
References _ra_set_error , eval_info::attribute , ra_meas::eval , MAX_ATTRIB_LEN , eval_head::meas , eval_attribute::name , eval_attribute::next , RA_ERR_NONE , ra_value_reset() , ra_value_set_string_array() , and eval_attribute::src_handle .
Parameters:
<h> an eval-/event-class-/event-prop-handle
<id> ASCII-id of the attribute
<vh> value-handle with the value
This function sets the value of the attribute 'name'.
Definition at line 139 of file eval.c .
References _ra_set_error , eval_info::attribute , ra_meas::eval , find_attribute() , MAX_ATTRIB_LEN , eval_head::meas , eval_attribute::name , RA_ERR_NONE , ra_list_add() , ra_value_copy() , ra_value_malloc() , eval_attribute::src_handle , and eval_attribute::value .
Referenced by create_auto_class() , ra_class_add() , ra_eval_add() , ra_prop_add() , ra_sum_add() , and read_sets_xml() .
LIBRAAPI int ra_eval_attribute_unset
(
any_handle
h ,
const char *
id
)
Parameters:
The function deletes the evaluation given by 'eh'.
Definition at line 451 of file eval.c .
References _ra_set_error , delete_attributes() , ra_meas::eval , eval_info::evaluations , eval::handle_id , eval_head::meas , ra_class_delete() , ra_class_get() , RA_ERR_NONE , RA_ERR_WRONG_HANDLE , RA_HANDLE_EVAL , ra_list_del() , ra_value_free() , ra_value_get_num_elem() , ra_value_get_voidp_array() , and ra_value_malloc() .
Referenced by free_eval_infos() .
LIBRAAPI int ra_eval_edit_complete
(
any_handle
h
)
LIBRAAPI prop_handle ra_prop_add
(
class_handle
clh ,
const char *
id ,
long
value_type ,
long
num_values ,
const char *
name ,
const char *
desc ,
const char *
unit ,
int
use_minmax ,
double
min ,
double
max
)
Definition at line 1371 of file eval.c .
References _ra_set_error , alloc_prop_mem() , eval_property::ascii_id , eval_property::evclass , get_prop_id() , eval_class::handle_id , eval_property::handle_id , eval_property::id , MAX_ID_LEN , eval_property::meas , eval_class::meas , eval_class::prop , RA_ERR_INFO_MISSING , RA_ERR_NONE , RA_ERR_WRONG_HANDLE , ra_eval_attribute_set() , RA_HANDLE_EVAL_CLASS , RA_HANDLE_EVAL_PROP , ra_list_add() , ra_prop_delete() , ra_value_free() , ra_value_malloc() , ra_value_set_double() , ra_value_set_long() , ra_value_set_string() , and eval_property::value_type .
Referenced by add_prop_orig() , and ra_prop_add_predef() .
Definition at line 1538 of file eval.c .
References _ra_set_error , eval_property::ch_map , delete_attributes() , eval_property::evclass , eval_property::handle_id , eval_property::l , eval_property::num_elements , eval_property::num_entries , eval_class::prop , RA_ERR_ERROR , RA_ERR_NONE , RA_ERR_WRONG_HANDLE , RA_HANDLE_EVAL_PROP , ra_list_del() , RA_VALUE_TYPE_CHAR , RA_VALUE_TYPE_CHAR_ARRAY , RA_VALUE_TYPE_DOUBLE , RA_VALUE_TYPE_DOUBLE_ARRAY , RA_VALUE_TYPE_LONG , RA_VALUE_TYPE_LONG_ARRAY , RA_VALUE_TYPE_SHORT , RA_VALUE_TYPE_SHORT_ARRAY , eval_property::value , and eval_property::value_type .
Referenced by ra_class_delete() , and ra_prop_add() .
Definition at line 1887 of file eval.c .
References _ra_set_error , eval_property::ch_map , eval_property::evclass , get_event_idx() , eval_property::handle_id , eval_property::num_entries , RA_ERR_NONE , RA_ERR_OUT_OF_RANGE , RA_ERR_WRONG_HANDLE , RA_HANDLE_EVAL_PROP , and ra_value_set_short_array() .
Definition at line 1983 of file eval.c .
References _ra_set_error , eval_property::ch_map , eval_class::ev , eval_property::evclass , eval_property::handle_id , eval_event::id , eval_property::l , eval_class::num_event , RA_ERR_NONE , RA_ERR_OUT_OF_RANGE , RA_ERR_UNSUPPORTED , RA_ERR_WRONG_HANDLE , RA_HANDLE_EVAL_PROP , ra_value_get_double() , ra_value_get_long() , ra_value_is_ok() , ra_value_reset() , ra_value_set_long_array() , RA_VALUE_TYPE_DOUBLE , RA_VALUE_TYPE_LONG , eval_property::value , and eval_property::value_type .
Definition at line 1913 of file eval.c .
References _ra_set_error , eval_property::ch_map , eval_property::evclass , get_event_idx() , eval_property::handle_id , eval_property::l , eval_property::num_elements , eval_property::num_entries , RA_ERR_ERROR , RA_ERR_NONE , RA_ERR_OUT_OF_RANGE , RA_ERR_WRONG_HANDLE , RA_HANDLE_EVAL_PROP , ra_value_set_double() , ra_value_set_double_array() , ra_value_set_long() , ra_value_set_long_array() , ra_value_set_short() , ra_value_set_short_array() , ra_value_set_string() , ra_value_set_string_array() , RA_VALUE_TYPE_CHAR , RA_VALUE_TYPE_CHAR_ARRAY , RA_VALUE_TYPE_DOUBLE , RA_VALUE_TYPE_DOUBLE_ARRAY , RA_VALUE_TYPE_LONG , RA_VALUE_TYPE_LONG_ARRAY , RA_VALUE_TYPE_SHORT , RA_VALUE_TYPE_SHORT_ARRAY , eval_property::value , and eval_property::value_type .
Definition at line 1760 of file eval.c .
References _ra_set_error , eval_property::ca , eval_property::ch_map , eval_property::evclass , get_event_idx() , eval_property::handle_id , eval_property::l , eval_property::num_elements , eval_property::num_entries , RA_ERR_ERROR , RA_ERR_EVAL_WRONG_TYPE , RA_ERR_INFO_MISSING , RA_ERR_NO