def transform(self, imgs, confounds=None):
"""Compute the mask and the ICA maps across subjects
Parameters
----------
batch_size
imgs: list of Niimg-like objects
See http://nilearn.github.io/building_blocks/manipulating_mr_images.html#niimg.
Data on which PCA must be calculated. If this is a list,
the affine is considered the same for all.
confounds: CSV file path or 2D matrix
This parameter is passed to nilearn.signal.clean. Please see the
related documentation for details
Returns
-------
codes, list of ndarray, shape = n_images * (n_samples, n_components)
Loadings for each of the images, and each of the time steps
"""
if (isinstance(imgs, str) or not hasattr(imgs, '__iter__')):
imgs = [imgs]
if confounds is None:
confounds = itertools.repeat(None)
codes = Parallel(n_jobs=self.n_jobs, verbose=self.verbose)(
delayed(self._cache(_transform_img, func_memory_level=1))(
self.coder_, self.masker_, img, these_confounds)
for img, these_confounds in zip(imgs, confounds))
return codes
评论列表
文章目录