Skip to content

Alternative interpretation of -strides option #3279

@Lestropie

Description

@Lestropie

Follows from #3271; not going to do it there to expedite completion since it's not necessary to replicate existing behaviour.

There are actually a couple of different ways in which the -strides option may be used. In the parlance of #3271, sometimes it is used to specify something more akin to a permutation (eg. 0,0,0,1 for volume-contiguous; though "0" here is an ignore flag, an actual permutation for this purpose would be 1,1,1,0), sometimes it is used to specify symbolic strides (eg. -1,+2,+3,+4).

I think these two cases could in fact be separated by applying the following categorisation to each value:

  1. Explicit negative value
  2. Explicit positive value (ie. "+" present)
  3. Implicitly positive due to absence of sign symbol

Perhaps 1 and 2 should be treated as a symbolic stride with sign, whereas 3 should be treated only as a magnitude, preserving the sign of the input image if advantageous to do so?

MR::parse_ints<>() already parses the presence / absence of "-" and "+". So this information could be accessed by having MR::parse_ints<>() call some other function that does the heavy-lifting but returns both values and the categories above, but discards the latter. The parsing of specifically -strides could then invoke that function directly in order to preserve the implicit / explicit-ness of the signs.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions