Skip to content

Commit 3b4b3f3

Browse files
committed
enh(transforms): improve generation of x5 structures of reference spaces
1 parent 924bb11 commit 3b4b3f3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Diff for: nibabel/transform/base.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@ def map_voxels(self, coordinates):
7777
return np.tensordot(np.linalg.inv(self._affine),
7878
coordinates, axes=1)[:3, ...]
7979

80+
def _to_hdf5(self, group):
81+
group['Type'] = 'image'
82+
group.create_dataset('affine', data=self.affine)
83+
group.create_dataset('shape', data=self.shape)
84+
group.create_dataset('ndim', data=self.ndim)
85+
8086
def __eq__(self, other):
8187
try:
8288
return np.allclose(self.affine, other.affine) and self.shape == other.shape
@@ -178,7 +184,7 @@ def _to_hdf5(self, x5_root):
178184
'''Serialize this object into the x5 file format'''
179185
raise NotImplementedError
180186

181-
def to_filename(self, filename, format='X5'):
187+
def to_filename(self, filename, fmt='X5'):
182188
'''Store the transform in BIDS-Transforms HDF5 file format (.x5).
183189
'''
184190
with h5py.File(filename, 'w') as out_file:

0 commit comments

Comments
 (0)