Skip to content

Commit 2d5c5b4

Browse files
authored
Merge pull request #280 from agramfort/fix_coreg_mgh
MRG : coreg for MGH images + cosmits
2 parents b18bd46 + 35678f2 commit 2d5c5b4

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

pypreprocess/coreg.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ def fit(self, target, source):
358358
self.params_ = np.array(self.params_init)
359359
for samp in self.sep:
360360
print("\r\nRunning Powell gradient-less local optimization "
361-
"(pyramidal level = %smm)...") % samp
361+
"(pyramidal level = %smm)..." % samp)
362362

363363
# create sampled grid for target img
364364
grid = make_sampled_grid(target.shape, samp=_correct_voxel_samp(
@@ -406,15 +406,15 @@ def transform(self, source, output_dir=None, prefix="", ext=".nii.gz",
406406
the coregistered source volume
407407
"""
408408
# save output unto disk
409-
if not output_dir is None:
409+
if output_dir is not None:
410410
if basenames is None:
411411
basenames = get_basenames(source)
412412

413413
# apply coreg
414414
# XXX backend should handle nasty i/o logic!!
415415
coregistered_source = list(apply_realignment(source, self.params_,
416416
inverse=True))
417-
if not output_dir is None:
417+
if output_dir is not None:
418418
concat = isinstance(basenames, _basestring)
419419
coregistered_source = save_vols(coregistered_source,
420420
output_dir=output_dir,

pypreprocess/io_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ def is_niimg(img):
3131
if isinstance(img, (nibabel.Nifti1Image,
3232
nibabel.Nifti1Pair,
3333
nibabel.Spm2AnalyzeImage,
34-
nibabel.Spm99AnalyzeImage
34+
nibabel.Spm99AnalyzeImage,
35+
nibabel.MGHImage,
3536
# add other supported image types below (e.g
3637
# AnalyseImage, etc.)
3738
)):

0 commit comments

Comments
 (0)