menpo/image/boolean.py
def from_vector(self, vector, copy=True):
        r"""
        Takes a flattened vector and returns a new :map:`BooleanImage` formed
        by reshaping the vector to the correct dimensions. Note that this is
        rebuilding a boolean image **itself** from boolean values. The mask
        is in no way interpreted in performing the operation, in contrast to
        :map:`MaskedImage`, where only the masked region is used in
        :meth:`from_vector` and :meth`as_vector`. Any image landmarks are
        transferred in the process.

        Parameters
        ----------
        vector : ``(n_pixels,)`` `bool ndarray`
            A flattened vector of all the pixels of a :map:`BooleanImage`.
        copy : `bool`, optional
            If ``False``, no copy of the vector will be taken.

        Returns
        -------
        image : :map:`BooleanImage`
            New BooleanImage of same shape as this image

        Raises
        ------
        Warning
            If ``copy=False`` cannot be honored.
        """
        mask = BooleanImage(vector.reshape(self.shape), copy=copy)
        mask.landmarks = self.landmarks
        return mask
r"""
        Takes a flattened vector and returns a new :map:`BooleanImage` formed
        by reshaping the vector to the correct dimensions. Note that this is
        rebuilding a boolean image **itself** from boolean values. The mask
        is in no way interpreted in performing the operation, in contrast to
        :map:`MaskedImage`, where only the masked region is used in
        :meth:`from_vector` and :meth`as_vector`. Any image landmarks are
        transferred in the process.

        Parameters
        ----------
        vector : ``(n_pixels,)`` `bool ndarray`
            A flattened vector of all the pixels of a :map:`BooleanImage`.
        copy : `bool`, optional
            If ``False``, no copy of the vector will be taken.

        Returns
        -------
        image : :map:`BooleanImage`
            New BooleanImage of same shape as this image

        Raises
        ------
        Warning
            If ``copy=False`` cannot be honored.
        
r"""
Takes a flattened vector and returns a new :map:`BooleanImage` formed
by reshaping the vector to the correct dimensions. Note that this is
rebuilding a boolean image **itself** from boolean values. The mask
is in no way interpreted in performing the operation, in contrast to
r " " " Takes a flattened vector and returns a new : map : ` BooleanImage ` formed by reshaping the vector to the correct dimensions . Note that this is rebuilding a boolean image ** itself ** from boolean values . The mask is in no way interpreted in performing the operation in contrast to
def from_vector(self, vector, copy=True):
        mask = BooleanImage(vector.reshape(self.shape), copy=copy)
        mask.landmarks = self.landmarks
        return mask
def from_vector ( self , vector , copy = True ) : mask = BooleanImage ( vector . reshape ( self . shape ) , copy = copy ) mask . landmarks = self . landmarks return mask
r"""
Takes a flattened vector and returns a new :map:`BooleanImage` formed
by reshaping the vector to the correct dimensions.
r " " " Takes a flattened vector and returns a new : map : ` BooleanImage ` formed by reshaping the vector to the correct dimensions .
r"""
        Takes a flattened vector and returns a new :map:`BooleanImage` formed
        by reshaping the vector to the correct dimensions. Note that this is
        rebuilding a boolean image **itself** from boolean values. The mask
        is in no way interpreted in performing the operation, in contrast to
        :map:`MaskedImage`, where only the masked region is used in
        :meth:`from_vector` and :meth`as_vector`. Any image landmarks are
        transferred in the process.

        Parameters
        ----------
        vector : ``(n_pixels,)`` `bool ndarray`
            A flattened vector of all the pixels of a :map:`BooleanImage`.
        copy : `bool`, optional
            If ``False``, no copy of the vector will be taken.

        Returns
        -------
        image : :map:`BooleanImage`
            New BooleanImage of same shape as this image

        Raises
        ------
        Warning
            If ``copy=False`` cannot be honored.
        """
self
vector
copy
map
`MaskedImage`, where only the masked region is used in
` MaskedImage ` where only the masked region is used in
meth
`from_vector` and :meth`as_vector`. Any image landmarks are
transferred in the process.

Parameters

vector : ``(n_pixels,)`` `bool ndarray`
A flattened vector of all the pixels of a :map:`BooleanImage`.
copy : `bool`, optional
If ``False``, no copy of the vector will be taken.

Returns

image : :map:`BooleanImage`
New BooleanImage of same shape as this image

Raises

Warning
If ``copy=False`` cannot be honored.
` from_vector ` and : meth ` as_vector ` . Any image landmarks are transferred in the process . Parameters vector : ` ` ( n_pixels ) ` ` ` bool ndarray ` A flattened vector of all the pixels of a : map : ` BooleanImage ` . copy : ` bool ` optional If ` ` False ` ` no copy of the vector will be taken . Returns image : : map : ` BooleanImage ` New BooleanImage of same shape as this image Raises Warning If ` ` copy = False ` ` cannot be honored .