pytrax/__RandomWalk__.py
def _get_wall_map(self, image):
        r'''
        Function savesc a wall map and movement vectors.
        This is referred to later when random walker moves in a particular
        direction to detect where the walls are.

        Parameters
        ----------
        image: ndarray of int
            2D or 3D image with 1 denoting pore space and 0 denoting solid
        '''
        # Make boolean map where solid is True
        solid = image.copy() == self.solid_value
        solid = solid.astype(bool)
        moves = []
        for axis in range(self.dim):
            ax_list = []
            for direction in [-1, 1]:
                # Store the direction of the step in an array for later use
                step = np.arange(0, self.dim, 1, dtype=int) == axis
                step = step.astype(int) * direction
                ax_list.append(step)
            moves.append(ax_list)
        # Save inverse of the solid wall map for fluid map
        self.wall_map = ~solid
        self.moves = np.asarray(moves)
r'''
        Function savesc a wall map and movement vectors.
        This is referred to later when random walker moves in a particular
        direction to detect where the walls are.

        Parameters
        ----------
        image: ndarray of int
            2D or 3D image with 1 denoting pore space and 0 denoting solid
        
r'''
Function savesc a wall map and movement vectors.
This is referred to later when random walker moves in a particular
direction to detect where the walls are.

Parameters

ndarray of int
2D or 3D image with 1 denoting pore space and 0 denoting solid
r ' ' ' Function savesc a wall map and movement vectors . This is referred to later when random walker moves in a particular direction to detect where the walls are . Parameters ndarray of int 2D or 3D image with 1 denoting pore space and 0 denoting solid
def _get_wall_map(self, image):
        solid = image.copy() == self.solid_value
        solid = solid.astype(bool)
        moves = []
        for axis in range(self.dim):
            ax_list = []
            for direction in [-1, 1]:
                step = np.arange(0, self.dim, 1, dtype=int) == axis
                step = step.astype(int) * direction
                ax_list.append(step)
            moves.append(ax_list)
        self.wall_map = ~solid
        self.moves = np.asarray(moves)
def _get_wall_map ( self , image ) : solid = image . copy ( ) == self . solid_value solid = solid . astype ( bool ) moves = [ ] for axis in range ( self . dim ) : ax_list = [ ] for direction in [ - 1 , 1 ] : step = np . arange ( 0 , self . dim , 1 , dtype = int ) == axis step = step . astype ( int ) * direction ax_list . append ( step ) moves . append ( ax_list ) self . wall_map = ~ solid self . moves = np . asarray ( moves )
r'''
Function savesc a wall map and movement vectors.
r ' ' ' Function savesc a wall map and movement vectors .
r'''
        Function savesc a wall map and movement vectors.
        This is referred to later when random walker moves in a particular
        direction to detect where the walls are.

        Parameters
        ----------
        image: ndarray of int
            2D or 3D image with 1 denoting pore space and 0 denoting solid
        ''' # Make boolean map where solid is True # Store the direction of the step in an array for later use # Save inverse of the solid wall map for fluid map
self
image