Skip to content

Commit

Permalink
Untrack nilearn, set 10.2 as minimum version
Browse files Browse the repository at this point in the history
  • Loading branch information
emdupre committed Jan 19, 2024
1 parent 0e1ce05 commit 9ac4521
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
12 changes: 7 additions & 5 deletions fmralign/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

import nibabel as nib
import numpy as np
from nilearn._utils.niimg_conversions import check_same_fov
from nilearn._utils.niimg_conversions import _check_same_fov
from nilearn.image import index_img, new_img_like, smooth_img
from nilearn.masking import apply_mask_fmri, intersect_masks
from nilearn.masking import _apply_mask_fmri, intersect_masks
from nilearn.regions.parcellations import Parcellations


Expand Down Expand Up @@ -107,8 +107,8 @@ def _make_parcellation(
"""
# check if clustering is provided
if isinstance(clustering, nib.nifti1.Nifti1Image) or os.path.isfile(clustering):
check_same_fov(masker.mask_img_, clustering)
labels = apply_mask_fmri(clustering, masker.mask_img_).astype(int)
_check_same_fov(masker.mask_img_, clustering)
labels = _apply_mask_fmri(clustering, masker.mask_img_).astype(int)

# otherwise check it's needed, if not return 1 everywhere
elif n_pieces == 1:
Expand Down Expand Up @@ -140,7 +140,9 @@ def _make_parcellation(
)
err.args += (errmsg,)
raise err
labels = apply_mask_fmri(parcellation.labels_img_, masker.mask_img_).astype(int)
labels = _apply_mask_fmri(parcellation.labels_img_, masker.mask_img_).astype(
int
)

if verbose > 0:
unique_labels, counts = np.unique(labels, return_counts=True)
Expand Down
6 changes: 3 additions & 3 deletions fmralign/pairwise_alignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import numpy as np
from joblib import Memory, Parallel, delayed
from nilearn.image import concat_imgs, load_img
from nilearn._utils.masker_validation import check_embedded_masker
from nilearn.maskers._masker_validation import _check_embedded_nifti_masker
from sklearn.base import BaseEstimator, TransformerMixin, clone
from sklearn.model_selection import ShuffleSplit

Expand Down Expand Up @@ -313,7 +313,7 @@ def fit(self, X, Y):
-------
self
"""
self.masker_ = check_embedded_masker(self)
self.masker_ = _check_embedded_nifti_masker(self)
self.masker_.n_jobs = self.n_jobs

if self.masker_.mask_img is None:
Expand All @@ -330,7 +330,7 @@ def fit(self, X, Y):
self.clustering, self.masker_.mask_img
)
self.mask = reduced_mask
self.masker_ = check_embedded_masker(self)
self.masker_ = _check_embedded_nifti_masker(self)
self.masker_.n_jobs = self.n_jobs
self.masker_.fit()
warnings.warn(
Expand Down
4 changes: 2 additions & 2 deletions fmralign/template_alignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import numpy as np
from joblib import Memory, Parallel, delayed
from nilearn.image import concat_imgs, index_img, load_img
from nilearn._utils.masker_validation import check_embedded_masker
from nilearn.maskers._masker_validation import _check_embedded_nifti_masker
from sklearn.base import BaseEstimator, TransformerMixin

from fmralign.pairwise_alignment import PairwiseAlignment
Expand Down Expand Up @@ -388,7 +388,7 @@ def fit(self, imgs):
if isinstance(imgs[0], (list, np.ndarray)):
imgs = [concat_imgs(img) for img in imgs]

self.masker_ = check_embedded_masker(self)
self.masker_ = _check_embedded_nifti_masker(self)
self.masker_.n_jobs = self.n_jobs # self.n_jobs

# if masker_ has been provided a mask_img
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ dependencies = [
"joblib",
"scipy",
"nibabel",
"nilearn@git+https://github.com/nilearn/nilearn#egg=1b11edf5789813d20995e7744bc58f3a2b6bc4ea",
"nilearn>=0.10.2",
"POT"
]
dynamic = ["version"]
Expand Down

0 comments on commit 9ac4521

Please sign in to comment.