OrsDatasetCropper

Creates subsets of datasets by cropping

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:

Aug 04 2015 17:43

dragonflyVersion:

3.0

UUID:

6c71e7e8761111e7be64448a5b5d70c0

Class Code

class OrsPythonPlugins.OrsDatasetCropper.OrsDatasetCropper.OrsDatasetCropper(*args, **kwargs)
cleanup()

Deletes the variables managed by the plugin. It is the place to remove callbacks and other references to Python objects that would prevent them to be garbage collected. This method is called during the process of deletion of the plugin. It calls for the cleanup and deletion of the forms.

interfacemethod crop(structuredGrid: StructuredGrid, xMin: int, yMin: int, zMin: int, tMin: int, xMax: int, yMax: int, zMax: int, tMax: int, createNewStructuredGrid: bool) StructuredGrid

Crop a structured grid by index range.

Parameters:
  • structuredGrid (ORSModel.ors.StructuredGrid) – the structured grid to crop

  • xMin (int) – minimal cropping index in X

  • yMin (int) – minimal cropping index in Y

  • zMin (int) – minimal cropping index in Z

  • tMin (int) – minimal cropping index in T

  • xMax (int) – maximal cropping index in X

  • yMax (int) – maximal cropping index in Y

  • zMax (int) – maximal cropping index in Z

  • tMax (int) – maximal cropping index in T

  • createNewStructuredGrid (bool) – if True, a new dataset will be generated. If False, the input structuredGrid will be modified.

Returns:

newStructuredGrid (ORSModel.ors.StructuredGrid) – cropped dataset.

interfacemethod cropFromBox(structuredGrid: StructuredGrid, createNewStructuredGrid: bool, aBox: Box = None, tMin: int = 0, tMax: int = 0) StructuredGrid

Crop a structured grid using a box.

Parameters:
  • structuredGrid (ORSModel.ors.StructuredGrid) – the structured grid to crop

  • createNewStructuredGrid (bool) – if True, a new dataset will be generated. If False, the input structuredGrid will be modified.

  • aBox (ORSModel.ors.Box) – the box used to set the cropping range. If None, the box of the structured grid to crop is used.

  • tMin (int) – minimal cropping index in T

  • tMax (int) – maximal cropping index in T

Returns:

newStructuredGrid (ORSModel.ors.StructuredGrid) – cropped dataset. If createNewStructuredGrid is False, None is returned.

classmethod getMainFormClass()

Gets the class of the main form

Returns:

output

classmethod getSelectedItems(referenceGrid)

Opens a GUI to let the user select objects that have the same shape as the reference object, and then crop the selected objects

Returns:

output (list of GUIDs) –

handleChanged(oldHandleName, newHandleName)

This method is called when the state of the application is changed.

Parameters:
  • oldState (str) – name of the old (previous) state

  • newState (str) – name of the new (current) state

handleTriggered(eventdata)

This method is called on every user input (mouse move, mouse click, key press, …) when the current state of the application is one of those declared by the plugin. This method can be used to perform specific tasks even if no action is currently in progress.

Parameters:

eventData (OrsEvent.eventdata.InputEventData) – the event data