pytrax/__RandomWalk__.py
def _rand_start(self, image, num=1):
        r'''
        Get a number of start points in the pore space of the image

        Parameters
        ----------
        image: ndarray of int
            2D or 3D image with 1 denoting pore space and 0 denoting solid
        num: int
            number of unique starting points to return
        '''
        inds = np.argwhere(image != self.solid_value)
        if self.seed:
            np.random.seed(1)
        try:
            choice = np.random.choice(np.arange(0, len(inds), 1),
                                      num,
                                      replace=False)
        except ValueError:
            choice = np.random.choice(np.arange(0, len(inds), 1),
                                      num,
                                      replace=True)
        return inds[choice]
r'''
        Get a number of start points in the pore space of the image

        Parameters
        ----------
        image: ndarray of int
            2D or 3D image with 1 denoting pore space and 0 denoting solid
        num: int
            number of unique starting points to return
        
r'''
Get a number of start points in the pore space of the image

Parameters

ndarray of int
2D or 3D image with 1 denoting pore space and 0 denoting solid
num: int
number of unique starting points to return
r ' ' ' Get a number of start points in the pore space of the image Parameters ndarray of int 2D or 3D image with 1 denoting pore space and 0 denoting solid num : int number of unique starting points to return
def _rand_start(self, image, num=1):
        inds = np.argwhere(image != self.solid_value)
        if self.seed:
            np.random.seed(1)
        try:
            choice = np.random.choice(np.arange(0, len(inds), 1),
                                      num,
                                      replace=False)
        except ValueError:
            choice = np.random.choice(np.arange(0, len(inds), 1),
                                      num,
                                      replace=True)
        return inds[choice]
def _rand_start ( self , image , num = 1 ) : inds = np . argwhere ( image != self . solid_value ) if self . seed : np . random . seed ( 1 ) try : choice = np . random . choice ( np . arange ( 0 , len ( inds ) , 1 ) , num , replace = False ) except ValueError : choice = np . random . choice ( np . arange ( 0 , len ( inds ) , 1 ) , num , replace = True ) return inds [ choice ]
r'''
Get a number of start points in the pore space of the image
r ' ' ' Get a number of start points in the pore space of the image
r'''
        Get a number of start points in the pore space of the image

        Parameters
        ----------
        image: ndarray of int
            2D or 3D image with 1 denoting pore space and 0 denoting solid
        num: int
            number of unique starting points to return
        '''
self
image
num