Skip to content

himena.consts

MenuId

Preset of menu IDs.

Source code in src\himena\consts.py
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
class MenuId(StrEnum):
    """Preset of menu IDs."""

    FILE = "file"
    FILE_RECENT = "file/recent"
    FILE_NEW = "file/new"
    FILE_SCREENSHOT = "file/screenshot"
    FILE_SESSION = "file/session"
    WINDOW = "window"
    WINDOW_RESIZE = "window/resize"
    WINDOW_ALIGN = "window/align"
    WINDOW_ANCHOR = "window/anchor"
    WINDOW_NTH = "window/nth"
    VIEW = "view"
    VIEW_LAYOUT = "view/layout"

    # "Tools" menu
    TOOLS = "tools"
    TOOLS_DOCK = "tools/dock"
    """Menu ID for the dock widgets."""
    TOOLS_ARRAY = "tools/array"
    """Menu ID for the commands related to "array"-type data."""
    TOOLS_DATAFRAME = "tools/dataframe"
    """Menu ID for the commands related to "dataframe"-type data."""
    TOOLS_EXCEL = "tools/excel"
    """Menu ID for the commands related to "excel"-type data."""
    TOOLS_IMAGE = "tools/image"
    """Menu ID for the commands related to "image"-type data."""
    TOOLS_IMAGE_ROI = "tools/image/roi"
    """Menu ID for the commands related to image ROIs."""
    TOOLS_IMAGE_CHANNELS = "tools/image/channels"
    """Menu ID for the commands related to image channels."""
    TOOLS_IMAGE_CAPTURE = "tools/image/capture"
    """Menu ID for the commands related to capturing current image slice."""
    TOOLS_PLOT = "tools/plot"
    """Menu ID for the commands related to "plot"-type data."""
    TOOLS_TEXT = "tools/text"
    """Menu ID for the commands related to "text"-type data."""
    TOOLS_TABLE = "tools/table"
    """Menu ID for the commands related to "table"-type data."""
    TOOLS_TABLE_COPY = "tools/table/copy"
    """Menu ID for the commands that copy the "table"-type data."""
    TOOLS_FUNCTION = "tools/function"
    """Menu ID for the commands related to "function"-type data."""
    TOOLS_OTHERS = "tools/others"
    """Menu ID for the commands related to other data."""

    # "Go" menu
    GO = "go"

    # Others
    TOOLBAR = "toolbar"
    CORNER = "corner"
    HELP = "help"

    RECENT_ALL = "file/.recent-all"
    STARTUP = "file/.startup"
    MODEL_MENU = "/model_menu"
TOOLS_ARRAY = 'tools/array' class-attribute instance-attribute

Menu ID for the commands related to "array"-type data.

TOOLS_DATAFRAME = 'tools/dataframe' class-attribute instance-attribute

Menu ID for the commands related to "dataframe"-type data.

TOOLS_DOCK = 'tools/dock' class-attribute instance-attribute

Menu ID for the dock widgets.

TOOLS_EXCEL = 'tools/excel' class-attribute instance-attribute

Menu ID for the commands related to "excel"-type data.

TOOLS_FUNCTION = 'tools/function' class-attribute instance-attribute

Menu ID for the commands related to "function"-type data.

TOOLS_IMAGE = 'tools/image' class-attribute instance-attribute

Menu ID for the commands related to "image"-type data.

TOOLS_IMAGE_CAPTURE = 'tools/image/capture' class-attribute instance-attribute

Menu ID for the commands related to capturing current image slice.

TOOLS_IMAGE_CHANNELS = 'tools/image/channels' class-attribute instance-attribute

Menu ID for the commands related to image channels.

TOOLS_IMAGE_ROI = 'tools/image/roi' class-attribute instance-attribute

Menu ID for the commands related to image ROIs.

TOOLS_OTHERS = 'tools/others' class-attribute instance-attribute

Menu ID for the commands related to other data.

TOOLS_PLOT = 'tools/plot' class-attribute instance-attribute

Menu ID for the commands related to "plot"-type data.

TOOLS_TABLE = 'tools/table' class-attribute instance-attribute

Menu ID for the commands related to "table"-type data.

TOOLS_TABLE_COPY = 'tools/table/copy' class-attribute instance-attribute

Menu ID for the commands that copy the "table"-type data.

TOOLS_TEXT = 'tools/text' class-attribute instance-attribute

Menu ID for the commands related to "text"-type data.

StandardType

Conventions for standard model types.

Developers should use these types as much as possible to ensure compatibility with other plugins.

Source code in src\himena\consts.py
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
class StandardType(SimpleNamespace):
    """Conventions for standard model types.

    Developers should use these types as much as possible to ensure compatibility with
    other plugins.
    """

    ### Basic types ###
    TEXT = "text"  # any text
    TABLE = "table"  # 2D data without any special structure
    ARRAY = "array"  # nD grid data such as numpy array
    DICT = "dict"  # dictionary
    DATAFRAME = "dataframe"  # DataFrame object

    ### Subtypes ###
    # dict subtypes
    EXCEL = "dict.table"  # Excel file (~= tabbed tables)
    DATAFRAMES = "dict.dataframe"
    ARRAYS = "dict.array"
    IMAGES = "dict.array.image"

    # text subtypes
    HTML = "text.html"  # HTML text
    SVG = "text.svg"  # SVG text
    MARKDOWN = "text.markdown"  # markdown text
    JSON = "text.json"  # JSON text
    IPYNB = "text.json.ipynb"  # Jupyter notebook

    # image data
    IMAGE = "array.image"
    # uint image data that will be interpreted as labels
    IMAGE_LABELS = "array.image.labels"
    # Complex image data that should be interpreted as a Fourier transform. C0 must
    # be shifted to the image center (using np.fft.fftshift)
    IMAGE_FOURIER = "array.image.fourier"

    # (N, D) numerical array, such as D-dimensional point cloud
    COORDINATES = "array.coordinates"

    # DataFrame that is supposed to be plotted immediately (such as image line scan)
    DATAFRAME_PLOT = "dataframe.plot"

    ### plotting ###
    PLOT = "plot"  # objects that satisfy the plotting standard
    PLOT_STACK = "plot-stack"  # stack of plot objects
    MPL_FIGURE = "matplotlib-figure"  # matplotlib figure object

    ### 3D ###
    MESH = "mesh"  # vertices, faces and values for 3D mesh

    ### Nested models ###
    MODELS = "models"  # list or dict of models
    LAZY = "lazy"  # lazy loading of models

    ### Other types ###
    WORKFLOW = "workflow"  # himena workflow object
    WORKFLOW_PARAMETRIC = "workflow.parametric"  # parametric workflow object
    GROUPBY = "groupby"  # DataFrame GroupBy object
    ROIS = "rois"  # regions of interest
    FUNCTION = "function"  # callable object
    DISTRIBUTION = "distribution"  # probablistic distribution object

    # fallback when no reader is found for the file (which means that the file could be
    # opened as a text file)
    READER_NOT_FOUND = "reader_not_found"

    # fallback when no specific widget can be used for the data
    ANY = "any"

    # type used for result stack
    RESULTS = "results"