jicbioimage/illustrate/__init__.py
def draw_cross(self, position, color=(255, 0, 0), radius=4):
        """Draw a cross on the canvas.

        :param position: (row, col) tuple
        :param color: RGB tuple
        :param radius: radius of the cross (int)
        """
        y, x = position
        for xmod in np.arange(-radius, radius+1, 1):
            xpos = x + xmod
            if xpos < 0:
                continue  # Negative indices will draw on the opposite side.
            if xpos >= self.shape[1]:
                continue  # Out of bounds.
            self[int(y), int(xpos)] = color
        for ymod in np.arange(-radius, radius+1, 1):
            ypos = y + ymod
            if ypos < 0:
                continue  # Negative indices will draw on the opposite side.
            if ypos >= self.shape[0]:
                continue  # Out of bounds.
            self[int(ypos), int(x)] = color
def draw_cross(self, position, color=(255, 0, 0), radius=4):
        y, x = position
        for xmod in np.arange(-radius, radius+1, 1):
            xpos = x + xmod
            if xpos < 0:
                continue  # Negative indices will draw on the opposite side.
            if xpos >= self.shape[1]:
                continue  # Out of bounds.
            self[int(y), int(xpos)] = color
        for ymod in np.arange(-radius, radius+1, 1):
            ypos = y + ymod
            if ypos < 0:
                continue  # Negative indices will draw on the opposite side.
            if ypos >= self.shape[0]:
                continue  # Out of bounds.
            self[int(ypos), int(x)] = color
def draw_cross ( self , position , color = ( 255 , 0 , 0 ) , radius = 4 ) : y , x = position for xmod in np . arange ( - radius , radius + 1 , 1 ) : xpos = x + xmod if xpos < 0 : continue # Negative indices will draw on the opposite side. if xpos >= self . shape [ 1 ] : continue # Out of bounds. self [ int ( y ) , int ( xpos ) ] = color for ymod in np . arange ( - radius , radius + 1 , 1 ) : ypos = y + ymod if ypos < 0 : continue # Negative indices will draw on the opposite side. if ypos >= self . shape [ 0 ] : continue # Out of bounds. self [ int ( ypos ) , int ( x ) ] = color
Draw a cross on the canvas.

        :param position: (row, col) tuple
        :param color: RGB tuple
        :param radius: radius of the cross (int)
Draw a cross on the canvas .