#include "tensorstore/index_space/dimension_identifier.h"
Result<DimensionIndex> tensorstore::NormalizeDimensionIdentifier(
    
DimensionIdentifier identifier,
    
span<const std::string> labels);

Normalizes a dimension identifier to a dimension index in the range [0, rank).

Parameters:
DimensionIdentifier identifier

The dimension identifier to normalize.

span<const std::string> labels

Vector of length rank specifying the dimension labels.

Returns:

The normalized dimension index.

Error absl::StatusCode::kInvalidArgument:

if identifier is not valid.