Skip to content

Commit

Permalink
Update Nilearn API _check_same_fov (#873)
Browse files Browse the repository at this point in the history
* Revert "Revert "use public check_same_fov""

This reverts commit c053fd7.

* Update nimare/meta/ibma.py

Co-authored-by: James Kent <[email protected]>

* skip 0.10.3

* fix style issue

* fix codecov

---------

Co-authored-by: James Kent <[email protected]>
  • Loading branch information
adelavega and jdkent authored Apr 10, 2024
1 parent bf7df33 commit 07f8451
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,8 @@ jobs:
- name: Download artifacts
uses: actions/download-artifact@v2
- name: Upload to CodeCov
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
11 changes: 9 additions & 2 deletions nimare/meta/ibma.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,14 @@
import pandas as pd
import pymare
from joblib import Memory
from nilearn._utils.niimg_conversions import _check_same_fov

try:
# nilearn>0.10.3
from nilearn._utils.niimg_conversions import check_same_fov
except ImportError:
# nilearn < 0.10.3
from nilearn._utils.niimg_conversions import _check_same_fov as check_same_fov

from nilearn.image import concat_imgs, resample_to_img
from nilearn.input_data import NiftiMasker
from nilearn.mass_univariate import permuted_ols
Expand Down Expand Up @@ -105,7 +112,7 @@ def _preprocess_input(self, dataset):
imgs = [
(
nib.load(img)
if _check_same_fov(nib.load(img), reference_masker=mask_img)
if check_same_fov(nib.load(img), reference_masker=mask_img)
else resample_to_img(nib.load(img), mask_img, **self._resample_kwargs)
)
for img in self.inputs_[name]
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ install_requires =
joblib>=1.3.0 # parallelization
matplotlib>=3.5.2 # this is for nilearn, which doesn't include it in its reqs
nibabel>=3.2.0 # I/O of niftis
nilearn>=0.10.1,<0.10.3 # until https://github.com/nilearn/nilearn/pull/4256 is resolved
nilearn>=0.10.1,!=0.10.3 # https://github.com/nilearn/nilearn/pull/4256 0.10.3 is broken
numba>=0.57.0 # used by sparse
numpy>=1.22 # numba needs NumPy 1.22 or greater
pandas>=2.0.0
Expand Down

0 comments on commit 07f8451

Please sign in to comment.