Skip to content

Commit

Permalink
Merge pull request #161 from poldracklab/fix/137
Browse files Browse the repository at this point in the history
FIX: Wrong datatype used for offset when reading ITK's h5 fields.
  • Loading branch information
oesteban authored Mar 15, 2022
2 parents ee4902a + 2c5603f commit 59fd890
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nitransforms/io/itk.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ def from_h5obj(cls, fileobj, check=True):
if xfm["TransformType"][0].startswith(b"DisplacementFieldTransform"):
_fixed = np.asanyarray(xfm[f"{typo_fallback}FixedParameters"])
shape = _fixed[:3].astype("uint16").tolist()
offset = _fixed[3:6].astype("uint16")
offset = _fixed[3:6].astype("float")
zooms = _fixed[6:9].astype("float")
directions = _fixed[9:].astype("float").reshape((3, 3))
affine = from_matvec(directions * zooms, offset)
Expand Down

0 comments on commit 59fd890

Please sign in to comment.