erlab.interactive.imagetool.dialogs

Dialogs for data manipulation found in the menu bar.

Classes

AverageDialog(slicer_area)

CropDialog(slicer_area)

CropToViewDialog(slicer_area)

DataFilterDialog(slicer_area)

Parent class for implementing data changes that only affects the appearance.

DataTransformDialog(slicer_area)

Parent class for implementing data changes that affect both shape and values.

EdgeCorrectionDialog(slicer_area)

NormalizeDialog(slicer_area)

RotationDialog(slicer_area)

SymmetrizeDialog(slicer_area)

class erlab.interactive.imagetool.dialogs.DataTransformDialog(slicer_area)[source]

Bases: _DataManipulationDialog

Parent class for implementing data changes that affect both shape and values.

These changes are destructive and cannot be undone. The user can choose to open the transformed data in a new window or replace the current data.

  • Override method setup_widgets to add widgets to the dialog.

  • Override method process_data to implement the data transformation.

  • Override method make_code to generate code that can be copied to the clipboard.

  • Override attribute title to set the title of the dialog window.

  • Override attribute enable_copy to show or hide the copy button.

  • Override attributes prefix and suffix to set the prefix and suffix of the new data name.

prefix: str = ''
suffix: str = ''
accept()[source]
class erlab.interactive.imagetool.dialogs.DataFilterDialog(slicer_area)[source]

Bases: _DataManipulationDialog

Parent class for implementing data changes that only affects the appearance.

These changes are not destructive and can be undone from the menu bar. Only one kind of filter can be applied at a time, and applying a new kind of filter will replace the previous one.

  • Override method setup_widgets to add widgets to the dialog.

  • Override method process_data to implement the filter. The output must be a new DataArray with the same shape as the input.

  • Override method make_code to generate code that can be copied to the clipboard.

  • Override attribute title to set the title of the dialog window.

  • Override attribute enable_copy to show or hide the copy button.

  • Override attributes enable_preview to show or hide the preview button.

enable_preview: bool = True

Whether to show a preview button.

reject()[source]
accept()[source]
class erlab.interactive.imagetool.dialogs.RotationDialog(slicer_area)[source]

Bases: DataTransformDialog

enable_copy: bool = True

Whether to show a button to copy the code to the clipboard.

If True, the button will be shown in the dialog box. The make_code method must be overridden to provide the code to be copied.

property suffix: str
setup_widgets()[source]
process_data(data)[source]
make_code()[source]
class erlab.interactive.imagetool.dialogs.AverageDialog(slicer_area)[source]

Bases: DataTransformDialog

title: str | None = 'Average Over Dimensions'

The title of the dialog window.

suffix: str = '_avg'
enable_copy: bool = True

Whether to show a button to copy the code to the clipboard.

If True, the button will be shown in the dialog box. The make_code method must be overridden to provide the code to be copied.

setup_widgets()[source]
process_data(data)[source]
accept()[source]
make_code()[source]
class erlab.interactive.imagetool.dialogs.SymmetrizeDialog(slicer_area)[source]

Bases: DataTransformDialog

title: str | None = 'Symmetrize'

The title of the dialog window.

enable_copy: bool = True

Whether to show a button to copy the code to the clipboard.

If True, the button will be shown in the dialog box. The make_code method must be overridden to provide the code to be copied.

property suffix: str
setup_widgets()[source]
process_data(data)[source]
make_code()[source]
class erlab.interactive.imagetool.dialogs.EdgeCorrectionDialog(slicer_area)[source]

Bases: DataTransformDialog

title: str | None = 'Edge Correction'

The title of the dialog window.

suffix: str = '_corr'
enable_copy: bool = False

Whether to show a button to copy the code to the clipboard.

If True, the button will be shown in the dialog box. The make_code method must be overridden to provide the code to be copied.

setup_widgets()[source]
process_data(data)[source]
exec()[source]
class erlab.interactive.imagetool.dialogs.CropToViewDialog(slicer_area)[source]

Bases: _BaseCropDialog

title: str | None = 'Crop to View'

The title of the dialog window.

whatsthis: str | None = 'Crop the data to the currently visible area.'

The whatsthis text for the dialog window.

setup_widgets()[source]
accept()[source]
exec()[source]
class erlab.interactive.imagetool.dialogs.CropDialog(slicer_area)[source]

Bases: _BaseCropDialog

title: str | None = 'Crop Between Cursors'

The title of the dialog window.

exec()[source]
accept()[source]
setup_widgets()[source]
class erlab.interactive.imagetool.dialogs.NormalizeDialog(slicer_area)[source]

Bases: DataFilterDialog

title: str | None = 'Normalize'

The title of the dialog window.

enable_copy: bool = False

Whether to show a button to copy the code to the clipboard.

If True, the button will be shown in the dialog box. The make_code method must be overridden to provide the code to be copied.

setup_widgets()[source]
process_data(data)[source]