Nanoparticle Tracking¶
Nanoparticle tracking is a technique that allows to measure the size of very small objects. The core idea is that by locating objects subject to brownian motion, it is possible to reconstruct their movement, which in turn can be fitted to a model which depends on properties of the medium (i.e. viscosity) and on the diameter of the particles.
Nanoparticle tracking analysis (NTA) is a common name used to the entire cycle of data acquisition, localization, and analysis. Commercial devices such as NanoSight and ZetaView provide a closed-solution to the problem. PyNTA aims at providing a superior approach, allowing researchers to have real-time information on the sample studied and a completely transparent approach regarding algorithms used.
- copyright
Aquiles Carattino <aquiles@uetke.com>
- license
GPLv3, see LICENSE for more details
-
class
pynta.model.experiment.nanoparticle_tracking.np_tracking.
NPTracking
(filename=None)[source]¶ Bases:
pynta.model.experiment.base_experiment.BaseExperiment
Experiment class for performing a nanoCET measurement.
-
BACKGROUND_NO_CORRECTION
= 0¶
-
BACKGROUND_SINGLE_SNAP
= 1¶
-
calculate_waterfall
(image)[source]¶ A waterfall is the product of summing together all the vertical values of an image and displaying them as lines on a 2D image. It is how spectrometers normally work. A waterfall can be produced either by binning the image in the vertical direction directly at the camera, or by doing it in software. The first has the advantage of speeding up the readout process. The latter has the advantage of working with any camera. This method will work either with 1D arrays or with 2D arrays and will generate a stack of lines.
-
initialize_camera
()[source]¶ Initializes the camera to be used to acquire data. The information on the camera should be provided in the configuration file and loaded with
load_configuration()
. It will load the camera assuming it is located in nanoparticle_tracking/model/cameras/[model].Todo
Define how to load models from outside of PyNTA. E.g. from a user-specified folder.
-
property
link_particles_running
¶
-
localize_particles_image
(image=None)[source]¶ Localizes particles based on trackpy. It is a convenience function in order to use the configuration parameters instead of manually passing them to trackpy.
-
save_image
()[source]¶ Saves the last acquired image. The file to which it is going to be saved is defined in the config.
-
save_stream
()[source]¶ Saves the queue to a file continuously. This is an async function, that can be triggered before starting the stream. It relies on the multiprocess library. It uses a queue in order to get the data to be saved. In normal operation, it should be used together with
add_to_stream_queue
.
-
property
save_stream_running
¶
-
set_roi
(X, Y)[source]¶ Sets the region of interest of the camera, provided that the camera supports cropping. All the technicalities should be addressed on the camera model, not in this method.
- Parameters
- Raises
ValueError – if either dimension of the cropping goes out of the camera total amount of pixels
- Returns
The final cropping dimensions, it may be that the camera limits the user desires
-
start_free_run
()[source]¶ Starts continuous acquisition from the camera, but it is not being saved. This method is the workhorse of the program. While this method runs on its own thread, it will broadcast the images to be consumed by other methods. In this way it is possible to continuously save to hard drive, track particles, etc.
-
stop_free_run
()[source]¶ Stops the free run by setting the
_stop_event
. It is basically a convenience method to avoid having users dealing with somewhat lower level threading options.
-
property
temp_locations
¶
-