OrsMultiROISplitTool_a7b25d8abd1b11e980d4309c235e8fdb

MultiROI Split Tool Plugin

This plugin provides a tool to split labeled multi ROI labels that are touching using the distance map. It replaces the split merge tool from the object analysis.

author:

Dragonfly Team

contact:

https://dragonfly.comet.tech

email:

support.dragonfly@comet.tech

organization:

Comet Technologies Canada Inc.

address:

460 Ste-Catherine Ouest, suite 600, Montréal, Québec, Canada, H3B 1A7

copyright:

Comet Technologies Canada Inc. All rights reserved 2025.

date:

Mar 21 2025

dragonflyVersion:

2025.1

UUID:

a7b25d8abd1b11e980d4309c235e8fdb

Class Code

class OrsPythonPlugins.OrsMultiROISplitTool_a7b25d8abd1b11e980d4309c235e8fdb.OrsMultiROISplitTool_a7b25d8abd1b11e980d4309c235e8fdb.OrsMultiROISplitTool_a7b25d8abd1b11e980d4309c235e8fdb(*args, **kwargs)

Multi-ROI Split Tool Plugin

This plugin provides a tool to split labeled multi-ROI labels that are touching using a distance map threshold to generate seeds for a watershed. It replaces the split merge tool from the object analysis with a more focused implementation.

addCallbacks()

Add all callbacks after MultiROI is set This ensures we don’t try to register callbacks with None objects

addMultiROILabelDeletedCallback()

Add callback for MultiROI label deletion event

addMultiROISelectedLabelsChangedCallback()

Add callback for MultiROI selected labels changed event

addOnObjectDeleteCallback()

Add callback for object deleted event

applySplit(use6Connectivity=True)

Apply the split operation to selected labels in the MultiROI

Parameters:

use6Connectivity (bool) – Use 6-connectivity for watershed (True) or 26-connectivity (False)

callbackMultiROISelectedLabelsChanged(eventData)

Callback for MultiROI selected labels changed event

closePlugin()

Clean up resources and callbacks

computeDistanceMap(progress=None)

Compute the distance map for the MultiROI : Only compute 1 distance map for all labels - This approach is faster than computing one distance map for each label, but the result is not ideal for touching labels and dense MultiROIs.

Parameters:

progress (ORSModel.ors.Progress) – Progress object

Return:

True if the distance map was computed successfully, False otherwise

Rtype:

bool

classmethod getMainFormClass()

Get the main form class

Returns:

output (MainFormMultiROISplitTool) – Main form class

classmethod startupMultiROISplitTool(multiROI)

Start the plugin with a multiroi

Parameters:

multiROIList – MultiROI GUIDs

:type

undoMultiROI()

Undo the last operation made on the MultiROI.

updateROISeeds()

Update ROI seeds based on the current threshold and selected labels

This method creates or updates the seeds ROI by finding the intersection of each selected label with the thresholded distance map.

Return:

True if seeds were updated successfully, False otherwise

Rtype:

bool

updateSeedsVisibility()

Show the seeds ROI based on a showstate

Return:

True if seeds were successfully shown/hidden, False otherwise

Rtype:

bool