Skip to content

Resampling data changes its orientation #1374

Closed
@Kseniiakv

Description

@Kseniiakv

Hi!

Have a question regarding the behaviour of resample_to_output and resample_from_to functions.
After resampling of the data, the orientation changes to default RAS, even if it had other orientation previously:

vol = nib.load(path)
print("Orientation before: ", nib.orientations.aff2axcodes(vol.affine))
target_vox_dim = (1, 1, 1)
resampled = nib.processing.resample_to_output(vol, target_vox_dim, order=3, mode='nearest')
print("Orientation after: ", nib.orientations.aff2axcodes(resampled.affine))
Orientation before:  ('L', 'A', 'S')
Orientation after:  ('R', 'A', 'S')

Expected behaviour: orientation of the resampled data shouldn't change

Is this expected behaviour?
Now if I want LAS orientation, I need to reorient data additionally after resampling.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions