1#ifndef __DO_CALC_FEAT_PROCESSOR_H__
2#define __DO_CALC_FEAT_PROCESSOR_H__
5#include <MedProcessTools/MedProcessTools/MedFeatures.h>
20 vector<string> source_feature_names;
45 int init(map<string, string>& mapper);
47 int _apply(
MedFeatures& features, unordered_set<int>& ids);
50 void sum(vector<float*> p_sources,
float *p_out,
int n_samples);
51 void chads2(vector<float*> p_sources,
float *p_out,
int n_samples,
int vasc_flag,
int max_flag);
52 void has_bled(vector<float*> p_sources,
float *p_out,
int n_samples,
int max_flag);
53 void fragile(vector<float*> p_sources,
float *p_out,
int n_samples);
54 void framingham_chd(vector<float*> p_sources,
float *p_out,
int n_samples);
55 void do_boolean_condition(vector<float*> p_sources,
float *p_out,
int n_samples);
56 void do_boolean_condition_ignore_missing(vector<float*> p_sources,
float *p_out,
int n_samples);
57 void do_not(vector<float*> p_sources,
float *p_out,
int n_samples);
60 void _log(vector<float*> p_sources,
float *p_out,
int n_samples);
61 void do_threshold(vector<float*> p_sources,
float *p_out,
int n_samples);
74 ADD_SERIALIZATION_FUNCS(processor_type, serial_id,
raw_target_feature_name,
feature_name,
calc_type,
missing_value,
raw_source_feature_names, source_feature_names,
weights,
parameters,
tags)
77 virtual void resolve_feature_names(
MedFeatures &features);
78 void prepare_feature(
MedFeatures& features,
int samples_size)
const;
80 void max(vector<float*> p_sources,
float *p_out,
int n_samples)
const;
81 void min(vector<float*> p_sources,
float *p_out,
int n_samples)
const;
A virtual class of processes on MedFeatures; E.g.
#define ADD_SERIALIZATION_FUNCS(...)
Definition SerializableObject.h:122
#define MEDSERIALIZE_SUPPORT(Type)
Definition SerializableObject.h:108
User defined calculations on other features.
Definition DoCalcFeatProcessor.h:11
vector< string > tags
Tags - for defining labels or groups. may be used later for filtering for example.
Definition DoCalcFeatProcessor.h:35
void update_req_features_vec(unordered_set< string > &out_req_features, unordered_set< string > &in_req_features)
update sets of required as input according to set required as output to processor
Definition DoCalcFeatProcessor.cpp:195
vector< float > weights
for sum
Definition DoCalcFeatProcessor.h:32
vector< string > raw_source_feature_names
source_feature_names as specified by the user, will be resolved to decorated names
Definition DoCalcFeatProcessor.h:18
string raw_target_feature_name
target_feature_name as specified by the user, will be decorated for uniqueness and extra information
Definition DoCalcFeatProcessor.h:15
string calc_type
user function selector (e.g. sum, ratio)
Definition DoCalcFeatProcessor.h:26
float missing_value
when a source_feature == missing_value, the calculation would also be missing_value
Definition DoCalcFeatProcessor.h:29
bool are_features_affected(unordered_set< string > &out_req_features)
check if a set of features is affected by the current processor
Definition DoCalcFeatProcessor.cpp:180
int init(map< string, string > &mapper)
The parsed fields from init command.
Definition DoCalcFeatProcessor.cpp:23
vector< string > parameters
general-purpose parameters which can be used by the calc
Definition DoCalcFeatProcessor.h:23
Definition FeatureProcess.h:51
string feature_name
Feature name ( + name as appears in MedFeatures) ;.
Definition FeatureProcess.h:55
A class for holding features data as a virtual matrix
Definition MedFeatures.h:47
static int global_serial_id_cnt
A global counter used to prevent identical names for two features by adding FTR_::_ before generated ...
Definition MedFeatures.h:73