erlab.interactive.imagetool.dialogs

Dialogs for data manipulation found in the menu bar.

Classes

AggregateDialog(slicer_area)

AssignAttrsDialog(slicer_area)

AssignCoordsDialog(slicer_area)

CoarsenDialog(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.

DivideByCoordDialog(slicer_area)

EdgeCorrectionDialog(slicer_area)

GaussianFilterDialog(slicer_area)

InterpolationDialog(slicer_area)

LeadingEdgeDialog(slicer_area)

NormalizeDialog(slicer_area)

ROIMaskDialog(roi)

ROIPathDialog(roi)

RenameDimsCoordsDialog(slicer_area)

RotationDialog(slicer_area)

SelectionDialog(slicer_area)

SwapDimsDialog(slicer_area)

SymmetrizeDialog(slicer_area)

SymmetrizeNfoldDialog(slicer_area)

ThinDialog(slicer_area)

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

Bases: DataTransformDialog

title: str | None = 'Aggregate Over Dimensions'

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.

setup_widgets()[source]
source_transform_operation()[source]
accept()[source]
class erlab.interactive.imagetool.dialogs.AssignAttrsDialog(slicer_area)[source]

Bases: DataTransformDialog

title: str | None = 'Attribute Editor'

The title of the dialog window.

setup_widgets()[source]
accept()[source]
source_transform_operation()[source]
class erlab.interactive.imagetool.dialogs.AssignCoordsDialog(slicer_area)[source]

Bases: DataTransformDialog

title: str | None = 'Coordinate Editor'

The title of the dialog window.

setup_widgets()[source]
property current_coord_name: str

Get the name of the currently selected coordinate.

accept()[source]
source_transform_operation()[source]
class erlab.interactive.imagetool.dialogs.CoarsenDialog(slicer_area)[source]

Bases: DataTransformDialog

title: str | None = 'Coarsen'

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.

apply_on_nonuniform_data: bool = True

Whether to apply the transform on data with non-uniform dimensions.

Set to True for transforms that can handle coordinates that are not evenly spaced.

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

Bases: _BaseCropDialog

title: str | None = 'Crop Between Cursors'

The title of the dialog window.

accept()[source]
setup_widgets()[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]
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 filter_operation to generate operation-backed copy code and provenance for the displayed filtered data. Accepted filters must be operation-backed.

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

restore_filter_operation(operation)[source]

Restore widgets from an active filter operation when supported.

reject()[source]
accept()[source]
filter_operation()[source]
filter_operations()[source]
make_code()[source]
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 source_transform_operation or source_operations to generate operation-backed copy code, or override make_code only for non-operation code.

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

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

  • Override attribute keep_colors and keep_color_limits to control which color-related settings are migrated when opening in a new window.

keep_colors: bool = True

Whether to keep the color settings when opening in a new window.

If True, the same colormap and normalization is used in the new window.

keep_color_limits: bool = True

Whether to also keep manual color limits when opening in a new window.

apply_on_nonuniform_data: bool = False

Whether to apply the transform on data with non-uniform dimensions.

Set to True for transforms that can handle coordinates that are not evenly spaced.

property launch_mode: Literal['replace', 'detach', 'nest']
source_operations()[source]
source_transform_operation()[source]
source_spec(new_name=None)[source]
process_data(data)[source]
make_code()[source]
accept()[source]
class erlab.interactive.imagetool.dialogs.DivideByCoordDialog(slicer_area)[source]

Bases: DataTransformDialog

title: str | None = 'Divide by Coordinate'

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.

apply_on_nonuniform_data: bool = True

Whether to apply the transform on data with non-uniform dimensions.

Set to True for transforms that can handle coordinates that are not evenly spaced.

setup_widgets()[source]
accept()[source]
source_transform_operation()[source]
class erlab.interactive.imagetool.dialogs.EdgeCorrectionDialog(slicer_area)[source]

Bases: DataTransformDialog

title: str | None = 'Edge Correction'

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]
source_transform_operation()[source]
class erlab.interactive.imagetool.dialogs.GaussianFilterDialog(slicer_area)[source]

Bases: DataFilterDialog

title: str | None = 'Gaussian Filter'

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.

setup_widgets()[source]
process_data(data)[source]
filter_operation()[source]
restore_filter_operation(operation)[source]
class erlab.interactive.imagetool.dialogs.InterpolationDialog(slicer_area)[source]

Bases: DataTransformDialog

title: str | None = 'Interpolate'

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.

apply_on_nonuniform_data: bool = True

Whether to apply the transform on data with non-uniform dimensions.

Set to True for transforms that can handle coordinates that are not evenly spaced.

setup_widgets()[source]
source_transform_operation()[source]
accept()[source]
class erlab.interactive.imagetool.dialogs.LeadingEdgeDialog(slicer_area)[source]

Bases: DataTransformDialog

title: str | None = 'Leading Edge'

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.

apply_on_nonuniform_data: bool = True

Whether to apply the transform on data with non-uniform dimensions.

Set to True for transforms that can handle coordinates that are not evenly spaced.

setup_widgets()[source]
source_transform_operation()[source]
accept()[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 = 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.

denominator_rtol: float = 1e-12
setup_widgets()[source]
process_data(data)[source]
filter_operation()[source]
restore_filter_operation(operation)[source]
class erlab.interactive.imagetool.dialogs.ROIMaskDialog(roi)[source]

Bases: DataTransformDialog

title: str | None = 'Mask with ROI'

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.

apply_on_nonuniform_data: bool = True

Whether to apply the transform on data with non-uniform dimensions.

Set to True for transforms that can handle coordinates that are not evenly spaced.

setup_widgets()[source]
source_transform_operation()[source]
class erlab.interactive.imagetool.dialogs.ROIPathDialog(roi)[source]

Bases: DataTransformDialog

title: str | None = 'Slice Along ROI Path'

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.

apply_on_nonuniform_data: bool = True

Whether to apply the transform on data with non-uniform dimensions.

Set to True for transforms that can handle coordinates that are not evenly spaced.

setup_widgets()[source]
source_transform_operation()[source]
class erlab.interactive.imagetool.dialogs.RenameDimsCoordsDialog(slicer_area)[source]

Bases: DataTransformDialog

title: str | None = 'Rename Coordinates and Dimensions'

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.

apply_on_nonuniform_data: bool = True

Whether to apply the transform on data with non-uniform dimensions.

Set to True for transforms that can handle coordinates that are not evenly spaced.

setup_widgets()[source]
accept()[source]
source_transform_operation()[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.

setup_widgets()[source]
source_transform_operation()[source]
class erlab.interactive.imagetool.dialogs.SelectionDialog(slicer_area)[source]

Bases: DataTransformDialog

title: str | None = 'Select Data'

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.

apply_on_nonuniform_data: bool = True

Whether to apply the transform on data with non-uniform dimensions.

Set to True for transforms that can handle coordinates that are not evenly spaced.

setup_widgets()[source]
source_operations()[source]
process_data(data)[source]
update_preview(*args)[source]
accept()[source]
class erlab.interactive.imagetool.dialogs.SwapDimsDialog(slicer_area)[source]

Bases: DataTransformDialog

title: str | None = 'Swap Dimensions'

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.

apply_on_nonuniform_data: bool = True

Whether to apply the transform on data with non-uniform dimensions.

Set to True for transforms that can handle coordinates that are not evenly spaced.

setup_widgets()[source]
accept()[source]
source_transform_operation()[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.

setup_widgets()[source]
source_transform_operation()[source]
class erlab.interactive.imagetool.dialogs.SymmetrizeNfoldDialog(slicer_area)[source]

Bases: DataTransformDialog

title: str | None = 'Rotational 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.

setup_widgets()[source]
source_transform_operation()[source]
class erlab.interactive.imagetool.dialogs.ThinDialog(slicer_area)[source]

Bases: DataTransformDialog

title: str | None = 'Thin Data'

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.

apply_on_nonuniform_data: bool = True

Whether to apply the transform on data with non-uniform dimensions.

Set to True for transforms that can handle coordinates that are not evenly spaced.

setup_widgets()[source]
source_transform_operation()[source]
accept()[source]