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);
98 const std::vector<teca_metadata> &input_md)
override;
100 std::vector<teca_metadata> get_upstream_request(
101 unsigned int port,
const std::vector<teca_metadata> &input_md,
104 const_p_teca_dataset execute(
unsigned int port,
105 const std::vector<const_p_teca_dataset> &input_data,
109 std::string segmentation_variable;
111 std::string threshold_variable;
112 double low_threshold_value;
113 double high_threshold_value;
The interface to TECA pipeline architecture.
Definition: teca_algorithm.h:244
virtual teca_metadata get_output_metadata(unsigned int port, const std::vector< teca_metadata > &input_md)
An algorithm that computes a binary segmentation.
Definition: teca_binary_segmentation.h:26
void set_threshold_by_value()
Set the threshold_mode to value.
Definition: teca_binary_segmentation.h:85
p_teca_error_handler error_handler TECA_EXPORT
The global error handler instance.