neuro_morpho.model.tiler ======================== .. py:module:: neuro_morpho.model.tiler .. autoapi-nested-parse:: Image tiling and stitching. Classes ------- .. autoapisummary:: neuro_morpho.model.tiler.Tiler Module Contents --------------- .. py:class:: Tiler(tile_size: int = 512, tile_assembly: str = 'nn', x_coords: numpy.ndarray | None = None, y_coords: numpy.ndarray | None = None, nearest_map: numpy.ndarray | None = None) Image tiling and stitching. This class provides methods for tiling an image into smaller patches and stitching them back together. .. py:attribute:: tile_size :value: 512 .. py:attribute:: tile_assembly :value: 'nn' .. py:attribute:: x_coords .. py:attribute:: y_coords .. py:method:: get_tiling_attributes(image_size) Calculate the tiling attributes based on the image size. This method calculates the x and y coordinates of the tiles and the nearest neighbor map if the tile assembly method is 'nn'. :param image_size: The size of the image. :type image_size: tuple[int, int] .. py:method:: extend_image_shape(orig_image: numpy.ndarray) -> tuple[numpy.ndarray, tuple[int, int]] Create image with extended size to fit the tile size. This method calculates models the distribution of noise/background as a gaussian and creates extended with pixels' greylevels distributed in the same manner. :param orig_image: Original image. :type orig_image: np.ndarray .. py:method:: tile_image(image: numpy.ndarray) -> numpy.ndarray Tile an image into smaller patches. :param image: The input image. :type image: np.ndarray :returns: An array of tiles. :rtype: np.ndarray