|
TECA
|
An algorithm that applies a mask based on connected component area. More...
#include <teca_component_area_filter.h>
Public Member Functions | |
| std::shared_ptr< teca_component_area_filter > | shared_from_this () |
| std::shared_ptr< teca_component_area_filter const > | shared_from_this () const |
| teca_component_area_filter (const teca_component_area_filter &src)=delete | |
| teca_component_area_filter (teca_component_area_filter &&src)=delete | |
| teca_component_area_filter & | operator= (const teca_component_area_filter &src)=delete |
| teca_component_area_filter & | operator= (teca_component_area_filter &&src)=delete |
| const char * | get_class_name () const override |
| void | set_component_variable (const std::string &v) |
| const std::string & | get_component_variable () const |
| void | set_number_of_components_key (const std::string &v) |
| const std::string & | get_number_of_components_key () const |
| void | set_component_ids_key (const std::string &v) |
| const std::string & | get_component_ids_key () const |
| void | set_component_area_key (const std::string &v) |
| const std::string & | get_component_area_key () const |
| void | set_mask_value (const long &v) |
| const long & | get_mask_value () const |
| void | set_low_area_threshold (const double &v) |
| const double & | get_low_area_threshold () const |
| void | set_high_area_threshold (const double &v) |
| const double & | get_high_area_threshold () const |
| void | set_variable_post_fix (const std::string &v) |
| const std::string & | get_variable_post_fix () const |
| void | set_contiguous_component_ids (const int &v) |
| const int & | get_contiguous_component_ids () const |
Public Member Functions inherited from teca_algorithm | |
| teca_algorithm (const teca_algorithm &src)=delete | |
| teca_algorithm (teca_algorithm &&src)=delete | |
| teca_algorithm & | operator= (const teca_algorithm &src)=delete |
| teca_algorithm & | operator= (teca_algorithm &&src)=delete |
| void | set_communicator (MPI_Comm comm) |
| MPI_Comm | get_communicator () |
| virtual teca_algorithm_output_port | get_output_port (unsigned int port=0) |
| void | set_input_connection (const teca_algorithm_output_port &port) |
| virtual void | set_input_connection (unsigned int id, const teca_algorithm_output_port &port) |
| virtual void | remove_input_connection (unsigned int id) |
| void | clear_input_connections () |
| const_p_teca_dataset | get_output_data (unsigned int port=0) |
| void | pop_cache (unsigned int port=0, int top=0) |
| void | set_cache_size (unsigned int n) |
| virtual int | update () |
| virtual int | update (unsigned int port) |
| virtual teca_metadata | update_metadata (unsigned int port=0) |
| void | set_executive (p_teca_algorithm_executive exe) |
| p_teca_algorithm_executive | get_executive () |
| virtual void | to_stream (std::ostream &s) const |
| virtual void | from_stream (std::istream &s) |
Static Public Member Functions | |
| static p_teca_component_area_filter | New () |
Additional Inherited Members | |
Protected Member Functions inherited from teca_algorithm | |
| void | set_number_of_input_connections (unsigned int n) |
| void | set_number_of_output_ports (unsigned int n) |
| virtual void | set_modified () |
| void | set_modified (unsigned int port) |
| virtual teca_metadata | get_cache_key (unsigned int port, const teca_metadata &request) const |
| virtual teca_metadata | get_output_metadata (teca_algorithm_output_port ¤t) |
| virtual const_p_teca_dataset | request_data (teca_algorithm_output_port &port, const teca_metadata &request) |
| virtual int | validate_cache (teca_algorithm_output_port ¤t) |
| virtual void | clear_modified (teca_algorithm_output_port current) |
| const_p_teca_dataset | get_output_data (unsigned int port, const teca_metadata &request) |
| int | cache_output_data (unsigned int port, const teca_metadata &request, const_p_teca_dataset &data) |
| void | clear_cache (unsigned int port) |
| unsigned int | get_number_of_input_connections () |
| teca_algorithm_output_port & | get_input_connection (unsigned int i) |
| void | clear_modified (unsigned int port) |
| int | get_modified (unsigned int port) const |
An algorithm that applies a mask based on connected component area.
The filter masks the regions identified by an integer label that are outside the range bracketed by the 'low_area_threshold' and 'high_area_threshold' properties. These default to -inf and +inf, hence by default no regions are masked. The mask value may be set by the 'mask_value' property which defaults to '0'.
The filter expects an integer field containing connected component labels. This field is named by the 'component_variable' property. Additionally a list of label ids and coresponding areas is expected in the dataset metadata. The properties 'component_ids_key' and 'component_area_key' identify the latter metadata. These default to the names used by the 'teca_2d_component_area' algotihm, 'component_ids' and 'component_area'.
Applying the 'teca_connected_component' algorithm followed by the 'teca_2d_component_area' algorithm is the easiest way to get valid inputs for the 'component_area_filter'.
The filtered coomponent ids are put in the output dataset along with the updated lists of valid component ids and component area metadata keys. By default the filtered data replaces the input data in the output. However, the input data can be retained by setting the 'variable_post_fix' property, a string that will be appended to the names of the filtered component array and metadata keys.