code: def unmask_from_to_3d_array(w, mask):
      """Unmask an image into whole brain, \
      with off-mask :term:`voxels<voxel>` set to 0.
  
      Used as a stand-alone function in low-level decoding (SpaceNet) and
      clustering (ReNA) functions.
  
      Parameters
      ----------
      w : :class:`numpy.ndarray`, shape (n_features,)
        The image to be unmasked.
  
      mask : :class:`numpy.ndarray`, shape (nx, ny, nz)
        The mask used in the unmasking operation. It is required that
        ``mask.sum() == n_features``.
  
      Returns
      -------
      out : 3D :class:`numpy.ndarray` (same shape as `mask`)
          The unmasked version of `w`.
      """
      if mask.sum() != len(w):
          raise ValueError("Expecting mask.sum() == len(w).")
      out = np.zeros(mask.shape, dtype=w.dtype)
      out[mask] = w
      return out
  
imports: import numbers
  import warnings
  import numpy
  from joblib import Parallel, delayed
  from scipy.ndimage import binary_dilation, binary_erosion
  from .None import _utils
  from ._utils import fill_doc
  from ._utils.cache_mixin import cache
  from ._utils.ndimage import get_border_data, largest_connected_component
  from ._utils.niimg import safe_get_data
  from .datasets import load_mni152_gm_template, load_mni152_template, load_mni152_wm_template
  from .image import get_data, new_img_like, resampling
label_desc: Use image node_id 16 for calling a global function with example usage: unmask_from_to_3d_array(w, mask) and returns: out