acia.segm.output#
Functionality for creating outputs (export) the segmentation information
- class acia.segm.output.DatasetExporter[source]#
Bases:
objectBase class for dataset exporters
- add(item)[source]#
- Parameters:
item (ImageRoISource | list[ImageRoISource])
- class acia.segm.output.MMSegmentationDataset[source]#
Bases:
DatasetExporterMMSegmentation dataset exporter
- acia.segm.output.renderVideo(imageSource, roiSource=None, filename='output.mp4', framerate=3, codec='vp09', scaleBar=None, draw_frame_number=False, cropper=<function no_crop>, filter_contours=<function <lambda>>, cell_color=(255, 255, 0))[source]#
Render a video of the time-lapse.
- Parameters:
imageSource (ImageSequenceSource) – Your time-lapse source object.
roiSource ([type]) – Your source of RoIs for the image (e.g. cells). If None, no RoIs are visualized. Defaults to None.
filename (str, optional) – The output path of the video. Defaults to ‘output.mp4’.
framerate (int, optional) – The framerate of the video. E.g. 3 means three time-lapse images per second. Defaults to 3.
codec (str, optional) – The video format codec. Defaults to “vp09”.
scaleBar (ScaleBar, optional) – The scale bar object. Defaults to None.
draw_frame_number (bool, optional) – Whether to draw the frame number. Defaults to False.
cropper ([type], optional) – The frame cropper object. Defaults to no_crop.
- acia.segm.output.fast_mask_rendering(masks, im, colors, alpha=0.5)[source]#
Plot masks on image.
- Parameters:
masks (tensor) – Predicted masks on cuda, shape: [n, h, w]
colors (List[List[Int]]) – Colors for predicted masks, [[r, g, b] * n]
im_gpu (tensor) – Image is in cuda, shape: [3, h, w], range: [0, 1]
alpha (float) – Mask transparency: 0.0 fully transparent, 1.0 opaque
retina_masks (bool) – Whether to use high resolution masks or not. Defaults to False.
- acia.segm.output.fast_mask_rendering_torch(masks, im, colors, alpha=0.5)[source]#
Plot masks on image.
- Parameters:
masks (tensor) – Predicted masks on cuda, shape: [n, h, w]
colors (List[List[Int]]) – Colors for predicted masks, [[r, g, b] * n]
im_gpu (tensor) – Image is in cuda, shape: [3, h, w], range: [0, 1]
alpha (float) – Mask transparency: 0.0 fully transparent, 1.0 opaque
retina_masks (bool) – Whether to use high resolution masks or not. Defaults to False.