Package: napari-signal-selector
napari-signal-selectorAn interactive signal selector and annotator for napari, based onnapari-matplotlib.Jump to IntallationUsageThis plugin opens an embedded plotter in napari capable of plotting and interacting (selecting/annotating) with individual object signals (typically temporal features).Input Datanapari-signal-selector works with aLabels layercontaining segmented objects and whosefeaturesattribute contains a table that follows the example structure shown below:labelframefeature...101.0...201.0...300.5...400.5...112.0...211.0...311.0...411.0...123.0...221.0...320.5...421.5...⋮⋮⋮Basically, it needs an object identifier (in this case, thelabelcolumn) that matches the labels in the Labels layer, and other columns containing x- and y-axis numbers to plot. Typically, x-axis is some temporal-related property.Here is how one could add such a layer to a napari viewer via code (checkthis example notebookfor more details):viewer.add_labels(labels_image,features=table)If a layer like this is selected, you can choose what to plot by means of dropdown fields in the bottom of the plotter.Below is a basic example using the "Flashing Polygons" synthetic data:ToolsSelection ToolThe selection tool (arrowhead icon) is a toggle button which enables you to select individual signals. Once activated, the icon gets highlighted and you can click over individual signals to select them. Right-clicking unselects everything.If the region you want to click is too crowded, consider zooming in first and then selecting.And if you know which label you want to select, you can enable'show selected'from the Labels layer options to solely display one label at a time. The Lables layer picker tool may help you get the right label.Annotation ToolOnce one or multiple signals are selected, you can annotate them with the annotation tool (brush with a 'plus' icon). You need to choose a signal class first.Remember to right-click to remove previous selections when annotating different signal classes!Annotations are saved back in the table in a new column called 'Annotations'.Currently multiple annotations is not possible, i.e., more than one class assigned to the same part of the signal.Span-Selection ToolYou can use the span-selection tool (bounded horizontal arrows icon) to sub-select one or multiple parts of signals. Right-click to unselect regions. Hold 'SHIFT' while dragging the mouse to select multiple sub-regions.You can use this in conjunction with the annotation tool to have sub-regions from the same signal with different annotations.Deletion ToolIf you made a mistake, you can remove previous annotations by selecting signal(s) and clicking on the trash icon at the right of the toolbar (or just annotate them with class 0).Also, with the selection tool enbaled, by holding 'SHIFT' and left-clicking, you can select all signals. This may be useful to delete all previous annotations.Exporting AnnotationsThe table with annotations can be displayed in napari using the 'Show table' widget fromnapari-skimage-regionprops plugin, which is available underTools > Measurements > Show Table (nsr).By the way, with'show selected'checked, you can click on a label row in the table and see the corresponding label in the image...andin the plotter!To export the table, click on'Save as csv...'.InstallationYou can installnapari-signal-selectorviapip. Follow these steps from a terminal.We recommend usingmamba-forgewhenever possible. Clickhereto choose the right download option for your OS.If you do not usemamba-forge, replace themambaterm whenever you see it below withconda.Create a conda environment :mamba create -n napari-ss-env napari pyqt python=3.9Activate the environment :mamba activate napari-ss-envInstallnapari-signal-selectorviapip:pip install napari-signal-selectorAlternatively, install latest development version with :pip install git+https://github.com/zoccoler/napari-signal-selector.gitContributingContributions are very welcome. Tests can be run withtox, please ensure
the coverage at least stays the same before you submit a pull request.LicenseDistributed under the terms of theBSD-3license,
"napari-signal-selector" is free and open source softwareIssuesIf you encounter any problems, pleasefile an issuealong with a detailed description.