dacapo.blockwise.watershed_function =================================== .. py:module:: dacapo.blockwise.watershed_function Functions --------- .. autoapisummary:: dacapo.blockwise.watershed_function.segment_function Module Contents --------------- .. py:function:: segment_function(input_array, block, offsets, bias) Segment the input array using the multicut watershed algorithm. :param input_array: The input array. :type input_array: np.ndarray :param block: The block to be processed. :type block: daisy.Block :param offsets: The offsets. :type offsets: List[Tuple[int]] :param bias: The bias. :type bias: float :returns: The segmented array. :rtype: np.ndarray .. rubric:: Examples >>> input_array = np.random.rand(128, 128, 128) >>> total_roi = daisy.Roi((0, 0, 0), (128, 128, 128)) >>> read_roi = daisy.Roi((0, 0, 0), (64, 64, 64)) >>> write_roi = daisy.Roi((0, 0, 0), (32, 32, 32)) >>> block_id = 0 >>> task_id = "task_id" >>> block = daisy.Block(total_roi, read_roi, write_roi, block_id, task_id) >>> offsets = [(0, 1, 0), (1, 0, 0), (0, 0, 1)] >>> bias = 0.1 >>> segmentation = segment_function(input_array, block, offsets, bias) .. note:: DGA: had to add in flatten and reshape since remap (in particular indices) didn't seem to work with ndarrays for the input