diff --git a/fsl/data/atlases.py b/fsl/data/atlases.py index daa62700ec0384b8b90ae566f90ef378f2fca1cb..36b0d48f93380dce213765c10a05c5271feb5017 100644 --- a/fsl/data/atlases.py +++ b/fsl/data/atlases.py @@ -495,7 +495,7 @@ class AtlasDescription(object): # Load the appropriate transformation matrix # and transform all those voxel coordinates # into world coordinates - coords = transform.transform(coords, self.xforms[0].T) + coords = transform.transform(coords, self.xforms[0]) # Update the coordinates # in our label objects @@ -594,7 +594,7 @@ class LabelAtlas(Atlas): location, or ``None`` if the location is out of bounds. """ - voxelLoc = transform.transform([worldLoc], self.worldToVoxMat.T)[0] + voxelLoc = transform.transform([worldLoc], self.worldToVoxMat)[0] voxelLoc = [int(v) for v in voxelLoc.round()] if voxelLoc[0] < 0 or \ @@ -642,7 +642,7 @@ class ProbabilisticAtlas(Atlas): location. Returns an empty list if the given location is out of bounds. """ - voxelLoc = transform.transform([worldLoc], self.worldToVoxMat.T)[0] + voxelLoc = transform.transform([worldLoc], self.worldToVoxMat)[0] voxelLoc = [int(v) for v in voxelLoc.round()] if voxelLoc[0] < 0 or \ diff --git a/fsl/data/featanalysis.py b/fsl/data/featanalysis.py index 1860a5e8d7e6aa2de4ab776da483c8946566274b..5d527863dd48dd19b3184a7c56a59c93139aaabe 100644 --- a/fsl/data/featanalysis.py +++ b/fsl/data/featanalysis.py @@ -355,7 +355,7 @@ def loadClusterResults(featdir, settings, contrast): # later on. coordXform = fslimage.Image( getDataFile(featdir), - loadData=False).worldToVoxMat.T + loadData=False).worldToVoxMat if not op.exists(clusterFile): return None diff --git a/fsl/utils/transform.py b/fsl/utils/transform.py index ed90bf35eba52afdb48e7711e2b336e1670c4b08..df82ddc55079e65075b5d0199d6acb27a2b1fdeb 100644 --- a/fsl/utils/transform.py +++ b/fsl/utils/transform.py @@ -73,9 +73,9 @@ def scaleOffsetXform(scales, offsets): xform[1, 1] = scales[1] xform[2, 2] = scales[2] - xform[3, 0] = offsets[0] - xform[3, 1] = offsets[1] - xform[3, 2] = offsets[2] + xform[0, 3] = offsets[0] + xform[1, 3] = offsets[1] + xform[2, 3] = offsets[2] return xform @@ -337,8 +337,8 @@ def transform(p, xform, axes=None): scalings. """ - p = _fillPoints(p, axes) - t = np.dot(xform[:3, :3].T, p.T).T + xform[3, :3] + p = _fillPoints(p, axes) + t = np.dot(xform[:3, :3], p.T).T + xform[:3, 3] if axes is not None: t = t[:, axes]