Developers

Readers

napari_deepfinder._reader.napari_get_reader(path)

A basic implementation of a Reader contribution.

Parameters

pathstr or list of str

Path to file, or list of paths.

Returns

function or None

If the path is a recognized format, return a function that accepts the same path or list of paths, and returns a list of layer data tuples.

napari_deepfinder._reader.reader_function(path)

Take a path or list of paths and return a list of LayerData tuples.

Readers are expected to return data as a list of tuples, where each tuple is (data, [add_kwargs, [layer_type]]), “add_kwargs” and “layer_type” are both optional.

Parameters

pathstr or list of str

Path to file, or list of paths.

Returns

layer_datalist of tuples

A list of LayerData tuples where each tuple in the list contains (data, metadata, layer_type), where data is a numpy array, metadata is a dict of keyword arguments for the corresponding viewer.add_* method in napari, and layer_type is a lower-case string naming the type of layer. Both “meta”, and “layer_type” are optional. napari will default to layer_type==”image” if not provided

Writers

napari_deepfinder._writer.write_annotations_xml(path: str, data: list)

Writer for annotations in for of a xml object list

napari_deepfinder._writer.write_labelmap(path: str, data: array, meta: dict)

Writer for labelmaps (segmentation maps)

napari_deepfinder._writer.write_tomogram(path: str, data: array, meta: dict)

Writer for tomograms

Widgets

Reorder layers

napari_deepfinder._widget.reorder_widget()

Wrapper for a container of widgets representing a callable object.

Parameters

functionCallable

A callable to turn into a GUI

call_buttonbool | str | None, optional

If True, create an additional button that calls the original function when clicked. If a str, set the button text. by default False when auto_call is True, and True otherwise. The button can be accessed from the .call_button property.

layoutstr, optional

The type of layout to use. Must be horizontal or vertical by default “horizontal”.

scrollablebool, optional

Whether to enable scroll bars or not. If enabled, scroll bars will only appear along the layout direction, not in both directions.

labelsbool, optional

Whether labels are shown in the widget. by default True

tooltipsbool, optional

Whether tooltips are shown when hovering over widgets. by default True

appApplication | str | None, optional

A backend to use, by default None (use the default backend.)

visiblebool, optional

Whether to immediately show the widget. If False, widget is explicitly hidden. If None, widget is not shown, but will be shown if a parent container is shown, by default None.

auto_callbool, optional

If True, changing any parameter in either the GUI or the widget attributes will call the original function with the current settings. by default False

result_widgetbool, optional

Whether to display a LineEdit widget the output of the function when called, by default False

param_optionsdict, optional

A dict of name: widget_options dict for each parameter in the function. Will be passed to magic_signature by default None

namestr, optional

A name to assign to the Container widget, by default function.__name__

persistbool, optional

If True, when parameter values change in the widget, they will be stored to disk (in ~/.config/magicgui/cache) and restored when the widget is loaded again with persist = True. By default, False.

raise_on_unknownbool

If True, raise an error if a parameter annotation is not recognized.

Raises

TypeError

If unexpected keyword arguments are provided

Denoising

napari_deepfinder._widget.denoise_widget()

Wrapper for a container of widgets representing a callable object.

Parameters

functionCallable

A callable to turn into a GUI

call_buttonbool | str | None, optional

If True, create an additional button that calls the original function when clicked. If a str, set the button text. by default False when auto_call is True, and True otherwise. The button can be accessed from the .call_button property.

layoutstr, optional

The type of layout to use. Must be horizontal or vertical by default “horizontal”.

scrollablebool, optional

Whether to enable scroll bars or not. If enabled, scroll bars will only appear along the layout direction, not in both directions.

labelsbool, optional

Whether labels are shown in the widget. by default True

tooltipsbool, optional

Whether tooltips are shown when hovering over widgets. by default True

appApplication | str | None, optional

A backend to use, by default None (use the default backend.)

visiblebool, optional

Whether to immediately show the widget. If False, widget is explicitly hidden. If None, widget is not shown, but will be shown if a parent container is shown, by default None.

auto_callbool, optional

If True, changing any parameter in either the GUI or the widget attributes will call the original function with the current settings. by default False

result_widgetbool, optional

Whether to display a LineEdit widget the output of the function when called, by default False

param_optionsdict, optional

A dict of name: widget_options dict for each parameter in the function. Will be passed to magic_signature by default None

namestr, optional

A name to assign to the Container widget, by default function.__name__

persistbool, optional

If True, when parameter values change in the widget, they will be stored to disk (in ~/.config/magicgui/cache) and restored when the widget is loaded again with persist = True. By default, False.

raise_on_unknownbool

If True, raise an error if a parameter annotation is not recognized.

Raises

TypeError

If unexpected keyword arguments are provided

Annotation

class napari_deepfinder._widget.AddPointsWidget(napari_viewer: Viewer)

Widget to add points to layer. This is especially designed for tomogram annotation in Orthoslice view.

Segmentation

class napari_deepfinder._segmentation_widget.SegmentationWidget(napari_viewer: Viewer)
browse_output()

Callback called when the browse output button is clicked

browse_weights()

Callback called when the browse weights button is clicked

Clustering

class napari_deepfinder._cluster_widget.ClusterWidget(napari_viewer: Viewer)
browse_output()

Callback called when the browse output button is clicked