3D particle picking¶
nextPYP
provides a suite of methods for 3D particle picking that includes size-based, geometry-based, template-search, and neural network-based methods. It also features an interactive interface to pick particles manually and import or export coordinates to use with external programs.
Main particle picking block¶
The Particle-Picking block takes Tomograms
as input and implements four particle picking methods.
Import coordinates¶
nextPYP
can import particle coordinates saved as IMOD models (*.spk
) or xyz coordinates saved in plain text format (*.box
):
Click on
Tomograms
(output of the Pre-processing block) and select Particle-PickingSelect “import” as the
Detectiom method
Select the location to import the coordinates from
Set the
Particle radius (A)
(for visualization purposes)Click Save, Run, and Start Run for 1 block
Once the run completes, navigate to the Particle-Picking block and confirm that the coordinates were imported correctly by checking the position of the green markers
Tip
The total number of particles in the dataset will be shown in the project information area at the top of the page
Manual picking¶
nextPYP
also provides a user-friendly UI to quickly pick particles from datasets with many tomograms:
Click on
Tomograms
(output of the Pre-processing block) and select Particle-PickingSelect “manual” as the
Detection method
Set the
Particle radius (A)
(for visualization purposes)Click Save, Run, and Start Run for 1 block
Once the run completes, navigate to the Particle-Picking block, inspect different tomogram slices using the slider and select particles by clicking on them. Go to other tomograms using the navigation bar at the top of the page and add particles as needed
Tip
You can remove particles by right-clicking on them
Coordinates are automatically saved every time you add or delete a particle
Size-based picking¶
This method, described in Jin et al. (2024), can be used to detect particles based on their size. It works both on purified and in-situ samples:
Click on
Tomograms
(output of the Pre-processing block) and select Particle-PickingSelect “size-based” as the
Detection method
Set the
Particle radius (A)
and other parameters as needed (see the classification tutorial for an example)Click Save, Run, and Start Run for 1 block
Once the run completes, navigate to the Particle-Picking block to inspect the results
Tip
You can manually edit the results of this or any other particle picking method by creating a copy of the Particle-Picking block using the “Copy” function, selecting Copy files and data
and Make automatically-picked particles editable
, and clicking Next. Once the copy is done (this may take a while depending on the size of your dataset and the numnber of particles), you can navigate to the new block and manually add or delete particles
Template search¶
This method uses the package pytom-match-pick to detect particles using template search (GPU required):
Click on
Tomograms
(output of the Pre-processing block) and select Particle-PickingSelect “template-search (pytom)” as the
Detection method
Set the
Particle radius (A)
, specify aTemplate
, and set other parameters as neededClick Save, Run, and Start Run for 1 block
Once the run completes, navigate to the Particle-Picking block to inspect the results
Tip
For templates downloaded from the EMDB that have white protein density over dark background, select the Invert
option to match the contrast in the tomograms
Geometry-based picking blocks¶
nextPYP
’s geometry-based picking is used to detect membrane proteins attached to the surface of virions or vesicles, as described in Liu et al. (2023). The method is composed of three stages:
Detection of virion centers¶
The first step is to estimate the position and the approximate radius of each virion or vesicle:
Click on
Tomograms
(output of the Pre-processing block) and select Particle-PickingSelect “virions” as the
Detection method
Set the expected
Virion radius (A)
and other parameters as neededClick Save, Run, and Start Run for 1 block
Once the run completes, navigate to the Particle-Picking block to inspect the results
Tip
Virion centers may be obtained using any method for particle picking available in nextPYP
(manual, size-based, neural network-based, etc). Since the virion radius will not estimated in these cases, the constant Virion radius (A)
value will be assigned to all virions
Virion segmentation¶
The next step is to segment virions in 3D using methods described in Bartesaghi et al. (2005):
Click on
Particles
(output of the Particle-Picking block) and select Segmentation (closed surfaces)Adjust the segmentation parameters as needed (defaults should work fine for EMPIAR-10164, for example)
Click Save, Run, and Start Run for 1 block
Once the run completes, navigate to the Particle-Segmentation (closed surfaces) block and go to the Segmentation tab to inspect the results
nextPYP
calculates segmentations using implicit surface representations that require specifying a threshold value to uniquely define the detected surface. To facilitate the threshold selection process for each virion, the user can choose from 8 different threshold values (represented as columns in a table). If none of the columns look reasonable (or if a virion should be ignored), the last column, labeled as “-”, should be selected. This process must be repeated for all virions in a tilt-series and for all tilt-series in the dataset
Note
The selection of virion thresholds is saved automatically every time a column is clicked
Here is a screenshot of the user interface for virion segmentation:

Particle picking from virions¶
The last step is to pick particles from the surface of virions:
Click on
Segmentation (closed)
(output of the Segmentation (closed surfaces) block) and select Particle-Picking (closed surfaces)Select a particle detection
Method
and corresponding parameters: “uniform” can be used to select uniformly spaced positions on the virion surfaces, while “template search” is used to search for positions on the surface that have high-correlation with an external template (provided as an*.mrc
file with the correct pixel size saved in the header)Click Save, Run, and Start Run for 1 block
Once the run completes, navigate to the Particle-Picking (closed surfaces) block to inspect the results
Neural-network picking blocks¶
nextPYP
uses two blocks to implement neural network-based particle picking, as described in Huang et al. (2024). This method uses consistency regularization to minimize the number of annotations and speedup training:
Model training¶
The first step is to obtain a set of particles using any of the methods implemented in the Pre-processing or MiloPYP (eval) blocks to train the neural network:
Click on
Particles
(output of the Particle-Picking or Particle-Picking (closed surfaces) blocks), orMiLoPYP Particles
(output of the MiLoPYP (eval) block) and select Particle-Picking (train)Adjust the parameters for training as needed. If using MiLoPYP particles, see instructions on how to set parameters here
Click Save, Run, and Start Run for 1 block
Once the run completes, navigate to the Particle-Picking (train) block to inspect the training loss
Notes
40-50 particles from 2-3 tomograms are usually sufficient to successfully train a model
Trained models for each run will be saved in the project folder under
train/YYYYMMDD_HHMMSS/*.pth
Model evaluation¶
Once the model has been trained, evaluation can be run on the entire dataset:
Click on
Particles Model
(output of the Particle-Picking (train) block) and select Particle-Picking (eval)Select the location of the
Trained model (*.pth)
using the file browser, and adjust the evaluation parameters as needed (the file browser’s default location will be thetrain/
folder from the parent block)Click Save, Run, and Start Run for 1 block
Once the run completes, navigate to the Particle-Picking (eval) block to inspect the particle picking results
Tips
To improve accuracy, the model can be re-trainined using more labels
To detect particles distributed along fibers or tubules, select the option
Fiber mode
. This will group together neighboring particles, fit a smooth trajectory to them, and re-sample positions along the fitted curve