OrsProcessIslands_9ea2ae92d95911e89b0d448a5b5d70c0

Removes small or big objects from a ROI

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 2023.

date:

Oct 26 2018 15:59

dragonflyVersion:

4.0.0.542 (D)

UUID:

9ea2ae92d95911e89b0d448a5b5d70c0

Class Code

class OrsPythonPlugins.OrsProcessIslands_9ea2ae92d95911e89b0d448a5b5d70c0.OrsProcessIslands_9ea2ae92d95911e89b0d448a5b5d70c0.OrsProcessIslands_9ea2ae92d95911e89b0d448a5b5d70c0(*args, **kwargs)
classmethod contextualMenu(listSelectedObjectsRepr)

Contextual menu.

This code will be executed when a contextual menu has to be displayed.

The menu item instances used in this method should be taken from menu item definitions declared in this plugin and filled with proper values (section, action, enabled, …). If multiple menu items have to be used by this method, they should be defined using the same pattern.

Parameters:

listSelectedObjectsRepr – list of selected objects (this argument is given as string representation)

Returns:

output – None, a single menu item instance, or a list of menu item instances

classmethod contextualMenu_menuItemDefinition()

Declaration of a plugin menu item.

This method has to be decorated by “menuItem(menuItemDefinition=True)”.

Returns:

output – Menu item instance

classmethod getMainFormClass()

Gets the class of the main form

Returns:

output

interfacemethod isolateNBiggest(aROI: ROI, numberOfObject: int, as26Connected: bool, aProgress: Progress = None, perSlice: bool = False) None

Keeps only the N biggest objects of a ROI.

Parameters:
  • aROI (ORSModel.ors.ROI) – the ROI to modify

  • numberOfObject (int) – number of objects to keep

  • as26Connected (bool) – if True, the connectivity will be made using 26 neighbors; if False, the connectivity will be made using 6 neighbors.

  • aProgress (ORSModel.ors.Progress) – progress object

  • perSlice (bool) – do a 2D connected component

interfacemethod processIslands(aROI: ROI, voxelCountThreshold: int, keepLargeObjects: bool, as26Connected: bool, aProgress: Progress = None, perSlice: bool = False) None

Removes small or big objects of a ROI based on their voxel count.

Parameters:
  • aROI (ORSModel.ors.ROI) – the ROI to modify

  • voxelCountThreshold (int) – voxel count threshold

  • keepLargeObjects (bool) – if True, only the objects having a voxel count greater than or equal to the count threshold will be kept; if False, only the objects having a voxel count smaller than or equal to the count threshold will be kept.

  • as26Connected (bool) – if True, the connectivity will be made using 26 neighbors; if False, the connectivity will be made using 6 neighbors.

  • aProgress (ORSModel.ors.Progress) – progress object

  • perSlice (bool) – do a 2D connected component

interfacemethod removeNBiggest(aROI: ROI, numberOfObject: int, as26Connected: bool, aProgress: Progress = None, perSlice: bool = False) None

Removes the N biggest objects of a ROI.

Parameters:
  • aROI (ORSModel.ors.ROI) – the ROI to modify

  • numberOfObject (int) – number of objects to remove

  • as26Connected (bool) – if True, the connectivity will be made using 26 neighbors; if False, the connectivity will be made using 6 neighbors.

  • aProgress (ORSModel.ors.Progress) – progress object

  • perSlice (bool) – do a 2D connected component