Skip to content

Conversation

effigies
Copy link

This approach treats rescaling the affine matrix as its own problem, addressing nipy#670 in passing. The tests ensure that orientation and centroid are unchanged when updating voxel sizes.

We can then use that to take a reoriented image and resample it.

The reason to reorient first is if a non-cubic field-of-view or inhomogeneous voxel size is requested. Suppose we have an RSA image, and we want RAS with voxel size (1, 1, 1.2) and dimension (256, 128, 256). If we resample first, then we end up with an RSA image with (1, 1, 1.2) voxels in a (256, 128, 256) grid. Reorienting, we now get an RAS image with (1, 1.2, 1) voxels in a (256, 256, 128) grid.

@kaczmarj kaczmarj merged commit 2177a59 into kaczmarj:add/fs-conform Apr 15, 2020
@effigies effigies deleted the add/fs-conform branch April 15, 2020 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants