Page MenuHomePhabricator

Rethink GetStatisticsAsOrderedVector()
Closed, ResolvedPublic


We need a public available output for further processing of ImageStatisticsContainer:

Two choices:

  1. Implement Iterator interface to iterate over all statistics
  2. Function to retrieve keys and function to retrieve values for each key:
    • std::vector<std::string> GetKeys() const in a defined order
      • each key is a defined constant (no evil magic string!)
    • boost::variant GetValuesByKeys(std::string) const
    • optionally possibility to put value into std::string
      • but not neccesarily in ImageStatisticsContainer class
      • regard that std::to_string() ignores locale control. use ostringstream instead.

as payload, use std::map<std::string, boost::variant> (multiple types have to be stored as value: double, unsigned int, itk::index...).