You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
Yes, this is expected. Resampling requires choosing a number of parameters, and the functions are intended to be fairly simple. If you want full control over the field of view, specify a shape and an affine, and use nibabel.affines.rescale_affine to preserve the rotations and shears.
vol=nib.load(path)
target_zooms= (1, 1, 1)
target_shape=vol.shape# Or you can set anything you liketarget_aff=nib.affines.rescale_affine(vol.affine, vol.shape, target_zooms, target_shape)
resampled=nib.procesing.resample_from_to(vol, (target_shape, target_aff))
Note (see #1366) that if you go from an even number of voxels to odd (or vice versa) in any dimension, you might get an affine slightly different from what you want. The resampling will be valid, however.
Hi!
Have a question regarding the behaviour of
resample_to_output
andresample_from_to
functions.After resampling of the data, the orientation changes to default RAS, even if it had other orientation previously:
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.
The text was updated successfully, but these errors were encountered: