(self, volume, layers=None)
Initialize a new Masker.
        Args:
            volume: A volume indicating the global space within which all
                subsequent layers must reside. Any voxel in the mask with a
                non-zero valid is considered valid for analyses. Can be either
                an image filename or a NiBabel image.
            layers: Optional masking layers to add; see docstring for add().
Initialize a new Masker.
        Args:
            volume: A volume indicating the global space within which all
                subsequent layers must reside. Any voxel in the mask with a
                non-zero valid is considered valid for analyses. Can be either
                an image filename or a NiBabel image.
            layers: Optional masking layers to add; see docstring for add().
Initialize a new Masker . Args : volume : A volume indicating the global space within which all subsequent layers must reside . Any voxel in the mask with a non - zero valid is considered valid for analyses . Can be either an image filename or a NiBabel image . layers : Optional masking layers to add ; see docstring for add () .
def __init__(self, volume, layers=None):
        """ Initialize a new Masker.
        Args:
            volume: A volume indicating the global space within which all
                subsequent layers must reside. Any voxel in the mask with a
                non-zero valid is considered valid for analyses. Can be either
                an image filename or a NiBabel image.
            layers: Optional masking layers to add; see docstring for add().
        """
        if isinstance(volume, string_types):
            volume = nb.load(volume)
        self.volume = volume
        data = self.volume.get_data()
        self.dims = data.shape
        self.vox_dims = self.get_header().get_zooms()
        self.full = np.float64(data.ravel())
        self.global_mask = np.where(self.full)

        self.reset()
        if layers is not None:
            self.add(layers)
def __init__ ( self , volume , layers = None ) : if isinstance ( volume , string_types ) : volume = nb . load ( volume ) self . volume = volume data = self . volume . get_data ( ) self . dims = data . shape self . vox_dims = self . get_header ( ) . get_zooms ( ) self . full = np . float64 ( data . ravel ( ) ) self . global_mask = np . where ( self . full ) self . reset ( ) if layers is not None : self . add ( layers )