Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions nitransforms/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

from pathlib import Path
import numpy as np
import h5py
import warnings
from nibabel.loadsave import load as _nbload
from nibabel import funcs as _nbfuncs
Expand Down Expand Up @@ -333,15 +332,9 @@ def map(self, x, inverse=False):
"""
return x

def to_filename(self, filename, fmt="X5"):
def to_filename(self, filename, fmt="X5", moving=None, x5_inverse=False):
"""Store the transform in BIDS-Transforms HDF5 file format (.x5)."""
with h5py.File(filename, "w") as out_file:
out_file.attrs["Format"] = "X5"
out_file.attrs["Version"] = np.uint16(1)
root = out_file.create_group("/0")
self._to_hdf5(root)

return filename
raise NotImplementedError

def _to_hdf5(self, x5_root):
"""Serialize this object into the x5 file format."""
Expand Down
3 changes: 2 additions & 1 deletion nitransforms/tests/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ def _to_hdf5(klass, x5_root):
_ = xfm.ndim

# Test to_filename
xfm.to_filename("data.x5")
with pytest.raises(NotImplementedError):
xfm.to_filename("data.x5")

# Test identity transform
xfm = nitl.Affine()
Expand Down
Loading