I want to transform my list of 3D Niimg-like objects to a 2D array (n_samples x n_features). I know that NiftiMasker
can do this but apparently it will always mask the data (and therefore reduce the dimensionality) even if I don’t provide it with a mask-object:
if not given, a mask is computed in the fit step. Optional parameters (mask_args and mask_strategy) can be set to fine tune the mask extraction)
Is there any way I can avoid this masking process? If no, I would probably have to write my own “Unfolder
” but in this case I would like to stick to the order/logic of the unfolding process used by NiftiMasker
. Moreover and more generally asking what is the reason that NitiMasker
always masks the data? I know that it will fall back to the ‘background’-mask strategy if no mask is provided. Maybe I am just missing something:
mask_strategy: {‘background’, ‘epi’ or ‘template’}, optional
The strategy used to compute the mask: use ‘background’ if your images present a clear homogeneous background, ‘epi’ if they are raw EPI images, or you could use ‘template’ which will extract the gray matter part of your data by resampling the MNI152 brain mask for your data’s field of view. Depending on this value, the mask will be computed from masking.compute_background_mask, masking.compute_epi_mask or masking.compute_gray_matter_mask. Default is ‘background’.