1 #ifndef teca_binary_segmentation_h
2 #define teca_binary_segmentation_h
5 #include "teca_algorithm.h"
6 #include "teca_metadata.h"
37 TECA_ALGORITHM_PROPERTY(std::
string, segmentation_variable)
45 TECA_ALGORITHM_PROPERTY(
teca_metadata, segmentation_variable_attributes)
53 TECA_ALGORITHM_PROPERTY(std::
string, threshold_variable)
60 TECA_ALGORITHM_PROPERTY(
double, low_threshold_value)
67 TECA_ALGORITHM_PROPERTY(
double, high_threshold_value)
77 enum {BY_VALUE=0, BY_PERCENTILE=1};
79 TECA_ALGORITHM_PROPERTY(
int, threshold_mode)
82 void set_threshold_by_percentile() { set_threshold_mode(BY_PERCENTILE); }
91 int get_segmentation_variable(std::string &segmentation_var);
92 int get_threshold_variable(std::string &threshold_var);
96 const std::vector<teca_metadata> &input_md)
override;
98 std::vector<teca_metadata> get_upstream_request(
99 unsigned int port,
const std::vector<teca_metadata> &input_md,
102 const_p_teca_dataset execute(
unsigned int port,
103 const std::vector<const_p_teca_dataset> &input_data,
107 std::string segmentation_variable;
109 std::string threshold_variable;
110 double low_threshold_value;
111 double high_threshold_value;