diff --git a/fmralign/_utils.py b/fmralign/_utils.py index f6130da..eafe96b 100644 --- a/fmralign/_utils.py +++ b/fmralign/_utils.py @@ -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 @@ -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: @@ -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) diff --git a/fmralign/pairwise_alignment.py b/fmralign/pairwise_alignment.py index 522648b..9753d87 100644 --- a/fmralign/pairwise_alignment.py +++ b/fmralign/pairwise_alignment.py @@ -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 @@ -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: @@ -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( diff --git a/fmralign/template_alignment.py b/fmralign/template_alignment.py index dac5655..08a6ba9 100644 --- a/fmralign/template_alignment.py +++ b/fmralign/template_alignment.py @@ -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 @@ -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 diff --git a/pyproject.toml b/pyproject.toml index ec15836..8e74c98 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,7 +24,7 @@ dependencies = [ "joblib", "scipy", "nibabel", - "nilearn@git+https://github.com/nilearn/nilearn#egg=1b11edf5789813d20995e7744bc58f3a2b6bc4ea", + "nilearn>=0.10.2", "POT" ] dynamic = ["version"]