-
#include "tensorstore/index_space/dim_expression.h" -
template <typename BoxType>
auto tensorstore::DimExpression<Op...>::TranslateBoxSlice(
const BoxType& box) const; Extracts a box from the selected dimensions, and translates its origin to 0.
This is equivalent to
TranslateSizedInterval(box.origin(), box.shape()).For example:
Dims(0, 2).TranslateBoxSlice(BoxView({1, 4}, {3, 4}))has the following effects:Before
After
Dimension selection
{0, 2}{0, 2}Input domain
[0, 6], [2, 5], [0, 9][0, 2], [2, 5], [0, 3]Labels
{"x", "y", "z"}{"x", "y", "z"}Equivalent input indices
{1, 3, 2}{0, 3, 0}Equivalent input indices
{x + 1, y, z + 4}{x, y, z}where
xis any index in[0, 2],yis any index in[2, 5], andzis any index in[0, 3].