Skip to content
Snippets Groups Projects
Commit b41c630c authored by Paul McCarthy's avatar Paul McCarthy :mountain_bicyclist:
Browse files

RF: Adjust roi module to use new import

parent 3aef4975
No related branches found
No related tags found
No related merge requests found
...@@ -13,4 +13,5 @@ The following modules are available: ...@@ -13,4 +13,5 @@ The following modules are available:
:nosignature :nosignature
.image.resample .image.resample
.image.roi
""" """
...@@ -11,8 +11,8 @@ a region-of-interest from, or expand the field-of-view of, an :class:`.Image`. ...@@ -11,8 +11,8 @@ a region-of-interest from, or expand the field-of-view of, an :class:`.Image`.
import numpy as np import numpy as np
import fsl.data.image as fslimage import fsl.data.image as fslimage
import fsl.utils.transform as transform import fsl.transform.affine as affine
def _normaliseBounds(shape, bounds): def _normaliseBounds(shape, bounds):
...@@ -97,8 +97,8 @@ def roi(image, bounds): ...@@ -97,8 +97,8 @@ def roi(image, bounds):
# each spatial dimension # each spatial dimension
oldaff = image.voxToWorldMat oldaff = image.voxToWorldMat
offset = [lo for lo, hi in bounds[:3]] offset = [lo for lo, hi in bounds[:3]]
offset = transform.scaleOffsetXform([1, 1, 1], offset) offset = affine.scaleOffsetXform([1, 1, 1], offset)
newaff = transform.concat(oldaff, offset) newaff = affine.concat(oldaff, offset)
return fslimage.Image(newdata, return fslimage.Image(newdata,
xform=newaff, xform=newaff,
......
...@@ -16,6 +16,6 @@ from fsl.transform.flirt import (flirtMatrixToSform, # noqa ...@@ -16,6 +16,6 @@ from fsl.transform.flirt import (flirtMatrixToSform, # noqa
deprecated.warn('fsl.utils.transform', deprecated.warn('fsl.utils.transform',
vin='2.2.0', vin='2.4.0',
rin='3.0.0', rin='3.0.0',
msg='Use the fsl.transform module instead') msg='Use the fsl.transform module instead')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment