
Research
SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.
hesperos
Advanced tools
A plugin to manually or semi-automatically segment medical data and correct previous segmentation data.
A Napari plugin for pre-defined manual segmentation or semi-automatic segmentation with a one-shot learning procedure. The objective was to simplify the interface as much as possible so that the user can concentrate on annotation tasks using a pen on a tablet, or a mouse on a computer.
This napari plugin was generated with Cookiecutter using @napari's cookiecutter-napari-plugin template.
The Hesperos plugin is designed to run on Windows (11 or less) and MacOS with Python 3.8 / 3.9 / 3.10.
Install Anaconda and unselect Add to PATH. Keep in mind the path where you choose to install anaconda.
Add your Anaconda path in these script files:
for exemple:
anaconda_dir=C:\Users\chgodard\anaconda3
for exemple:
source ~/opt/anaconda3/etc/profile.d/conda.sh
chmod u+x PATH/install_hesperos_env.command
chmod u+x PATH/run_hesperos.command
Double click on the install_hesperos_env file to create a virtual environment in Anaconda with python 3.9 and Napari 0.4.14.
/!\ The Hesperos plugin is not yet compatible with Napari versions superior to 0.4.14.
Double click on the run_hesperos file to run Napari from your virtual environment.
In Napari:
Double click on the run_hesperos file to run Napari.
In Napari, use the Hesperos plugin with Plugins/hesperos.
conda create -n hesperos_env python=3.9
conda activate hesperos_env
conda install -c conda-forge napari=0.4.14
conda install -c anaconda pyqt
pip install hesperos
/!\ Hesperos plugin is not yet compatible with napari version superior to 0.4.14.
napari
Go to Plugins/Install Plugins...
Search for "hesperos" (it can take a while to load).
Click on Update if a new version of Hesperos has been found. You can check the latest version of Hesperos in the Napari Hub.
When the installation is done, close Napari. A restart of Napari is required to finish the plugin installation.
The Manual Segmentation and Correction mode of the Hesperos plugin is a simplified and optimized interface to do basic 2D manual segmentation of several structures in a 3D image using a mouse or a stylet with a tablet.
The Hesperos plugin can be used with Digital Imaging and COmmunications in Medicine (DICOM), Neuroimaging Informatics Technology Initiative (NIfTI) or Tagged Image File Format (TIFF) images. To improve performances, use images that are located on your own disk.
When data is loading, two layers are created: the image layer and the annotations layer. Order in the layer list correspond to the overlayed order. By clicking on these layers you will have acces to different layer controls (at the top left corner of the application). All actions can be undone/redone with the Ctrl-Z/Shift-Ctrl-Z keyboard shortcuts. You can also hide a layer by clicking on its eye icon on the layer list.
For the image layer:
opacity: a slider to control the global opacity of the layer.contrast limits: a double slider to manually control the contrast of the image (same as the For the annotations layer:
: erase brush to erase all labels at once (if
preserve labels is not selected) or only erase the selected label (if preserve labels is selected).
: paint brush with the same color than the
label rectangle.
: fill bucket with the same color than the
label rectangle.
: select to zoom in and out with the mouse wheel (same as the zoom slider at the top right corner in Panel 1).
label: a colored rectangle to represent the selected label.
opacity: a slider to control the global opacity of the layer.
brush size limits: a slider to control size of the paint/erase brush.
preserve labels: if selected, all actions are applied only on the selected label (see the label rectangle); if not selected, actions are applied on all labels.
show selected: if selected, only the selected label will be display on the layer; if not selected, all labels are displayed.
Remark: a second option for filling has been added
- Drawn the egde of a closed shape with the paint brush mode.
- Double click to activate the fill bucket.
- Click inside the closed area to fill it.
- Double click on the filled area to deactivate the fill bucket and reactivate the paint brush mode.
Manual annotation and correction on the segmented file is done using the layer controls of the annotations layer. Click on the layer to display them. /!\ You have to choose a structure to start annotating (see 2.).
To modify an existing segmentation, you can directy open the segmented file with the button. The file needs to have the same dimensions as the original image.
/!\ Only .tiff, .tif, .nii and .nii.gz files are supported as segmented files.
Choose a structure to annotate in the drop-down menu
Fetus: to annotate pregnancy image.Shoulder: to annotate bones and muscles for shoulder surgery.Shoulder Bones: to annotate only few bones for shoulder surgery.Feta Challenge: to annotate fetal brain MRI with the same label than the FeTA Challenge (see ADD LIEN WEB).When selecting a structure, a new panel appears with a list of elements to annotate. Each element has its own label and color. Select one element in the list to automatically activate the paint brush mode with the corresponding color (color is updated in the
labelrectangle in the layer controls panel).
All actions can be undone with the button or Ctrl-Z.
If you need to work on a specific slice of your 3D image, but also have to explore the volume to understand some complex structures, you can use the locking option to facilitate the annotation task.
This panel will only be displayed if the Shoulder Bones category is selected. A maxiumum of 10 slices can be selected in a 3D image and the corresponding z-indexes will be integrated in the metadata during the exportation of the segmentation file.
/!\ Metadata integration is available only for exported .tiff and .tif files and with the
Uniquesave option.
: to add the currently displayed z-index in the drop-down menu.
: to remove the currently displayed z-index from the drop-down menu.
: to go to the z-index selected in the drop-down menu. The icon will be checked when the currently displayed z-index matches the selected z-index in the drop-down menu.
: a drop-down menu containing the list of selected z-indexes. Select a z-index from the list to work with it more easily.
button in one of the two following saving mode:
Unique: segmented data is exported as a unique 3D image with corresponding label ids (1-2-3-...). This file can be re-opened in the application.Several: segmented data is exported as several binary 3D images (0 or 255), one for each label id.Automatic segmentation backup: if selected, the segmentation data will be automatically exported as a unique 3D image when the image slice is changed.
/!\ This process can slow down the display if the image is large.
The OneShot Segmentation mode of the Hesperos plugin is a 2D version of the VoxelLearning method implemented in DIVA (see our Github and the latest article Guérinot, C., Marcon, V., Godard, C., et al. (2022). New Approach to Accelerated Image Annotation by Leveraging Virtual Reality and Cloud Computing. Frontiers in Bioinformatics. doi:10.3389/fbinf.2021.777101).
The principle is to accelerate the segmentation without prior information. The procedure consists of:
Same panel as the Manual Segmentation and Correction mode (see panel 1 description).
Annotations and corrections on the segmented file is done using the layer controls of the annotations layer. Click on the layer to display them. Only two labels are available: Structure of interest and Other.
The rapid manual tagging step of the one-shot learning method aims to learn and attribute different features to each label.
To achieve that, the user has to:
Structure of interest, tag few pixels of the structure of interest.Other, tag the greatest diversity of uninteresting structures in the 3D image (avoid tagging too much pixels).see the exemple image with
Structure of interestlabel in red andOtherlabel in cyan.
To modify an existing segmentation, you can directy open the segmented file with the button. The file needs to have the same dimensions as the original image.
/!\ Only .tiff, .tif, .nii and .nii.gz files are supported as segmented files.
All actions can be undone with the button or Ctrl-Z.
From the previously tagged pixels, features are extracted and used to train a basic classifier : the Random Forest Classifier (RFC). When the training of the pixel classifier is done, it is applied to each pixel of the complete volume and outputs a probability to belong to the structure of interest.
To run training and inference, click on the button:
Computing.... You must wait for the message to change to: Ready before doing anything in the application (otherwise the application may freeze or crash).probabilities layer which corresponds to the direct probability (between 0 and 1) of a pixel to belong to the structure of interest. This layer is disabled by default, to enable it click on its eye icon in the layer list.segmented probabilities layer which corresponds to a binary image obtained from the probability image normed and thresholded according to a value manually defined with the Probability threshold slider: Remark: If the output is not perfect, you have two possibilities to improve the result:
- Add some tags with the paint brush to take in consideration unintersting structures or add information in critical areas of your structure of interest (such as in thin sections). Then, run the training and inference process again. /!\ This will overwrite all previous segmentation data.
- Export your segmentation data and re-open it with the Manual Annotation and Correction mode of Hesperos to manually erase or add annotations.
Distributed under the terms of the BSD-3 license, Hesperos is a free and open source software.
FAQs
A plugin to manually or semi-automatically segment medical data and correct previous segmentation data.
We found that hesperos demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.

Company News
Socket is proud to join the OpenJS Foundation as a Silver Member, deepening our commitment to the long-term health and security of the JavaScript ecosystem.

Security News
npm now links to Socket's security analysis on every package page. Here's what you'll find when you click through.