Skip to content

Commit 6f79b77

Browse files
author
smoia
committed
Removed leading underscores
1 parent 76d4c14 commit 6f79b77

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

nitransforms/io/afni.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -130,22 +130,22 @@ class AFNIDisplacementsField(DisplacementsField):
130130
@classmethod
131131
def from_image(cls, imgobj):
132132
"""Import a displacements field from a NIfTI file."""
133-
_hdr = imgobj.header.copy()
134-
_shape = _hdr.get_data_shape()
133+
hdr = imgobj.header.copy()
134+
shape = hdr.get_data_shape()
135135

136136
if (
137-
len(_shape) != 5 or
138-
_shape[-2] != 1 or
139-
not _shape[-1] in (2, 3)
137+
len(shape) != 5 or
138+
shape[-2] != 1 or
139+
not shape[-1] in (2, 3)
140140
):
141141
raise TransformFileError(
142142
'Displacements field "%s" does not come from AFNI.' %
143143
imgobj.file_map['image'].filename)
144144

145-
_field = np.squeeze(np.asanyarray(imgobj.dataobj))
146-
_field[..., (0, 1)] *= -1.0
145+
field = np.squeeze(np.asanyarray(imgobj.dataobj))
146+
field[..., (0, 1)] *= -1.0
147147

148-
return imgobj.__class__(_field, imgobj.affine, _hdr)
148+
return imgobj.__class__(field, imgobj.affine, hdr)
149149

150150

151151
def _is_oblique(affine, thres=OBLIQUITY_THRESHOLD_DEG):

nitransforms/io/itk.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -261,23 +261,23 @@ class ITKDisplacementsField(DisplacementsField):
261261
@classmethod
262262
def from_image(cls, imgobj):
263263
"""Import a displacements field from a NIfTI file."""
264-
_hdr = imgobj.header.copy()
265-
_shape = _hdr.get_data_shape()
264+
hdr = imgobj.header.copy()
265+
shape = hdr.get_data_shape()
266266

267267
if (
268-
len(_shape) != 5 or
269-
_shape[-2] != 1 or
270-
not _shape[-1] in (2, 3)
268+
len(shape) != 5 or
269+
shape[-2] != 1 or
270+
not shape[-1] in (2, 3)
271271
):
272272
raise TransformFileError(
273273
'Displacements field "%s" does not come from ITK.' %
274274
imgobj.file_map['image'].filename)
275275

276-
if _hdr.get_intent()[0] != 'vector':
276+
if hdr.get_intent()[0] != 'vector':
277277
warnings.warn('Incorrect intent identified.')
278-
_hdr.set_intent('vector')
278+
hdr.set_intent('vector')
279279

280-
_field = np.squeeze(np.asanyarray(imgobj.dataobj))
281-
_field[..., (0, 1)] *= -1.0
280+
field = np.squeeze(np.asanyarray(imgobj.dataobj))
281+
field[..., (0, 1)] *= -1.0
282282

283-
return imgobj.__class__(_field, imgobj.affine, _hdr)
283+
return imgobj.__class__(field, imgobj.affine, hdr)

0 commit comments

Comments
 (0)