////// Restrict to faces and houses ////////////////////////////////////////////////////////////////////////////////////////////
condition_mask = np.logical_or(conditions == "face", conditions == "house")
X = fmri_data[..., condition_mask]
y = y[condition_mask]
session = session[condition_mask]
conditions = conditions[condition_mask]
////// Loading step ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
from nisl import mri_transformer
from nisl.utils import Niimg
// Detrending is disabled as we are not yet able to do it by session
mri_loader = mri_transformer.MRITransformer(mask=mask, detrend=True,
copy=False, sessions=session)
niimg = Niimg(X, affine)
X_masked = mri_loader.fit(niimg).transform(niimg)
X_detrended = mri_loader.inverse_transform(X_masked).get_data()
////// Prepare the masks //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Here we will use several masks :
// * mask is the originalmask