pysted.microscopes
This modules implements different configuration of a base.Microscope
.
Currently implemented microscopes are
DyMINMicroscope
DyMINRESCueMicroscope
RESCueMicroscope
Implementing their own microscope requires to reimplement the get_signal_and_bleach
method of a base.Microscope
.
References
Heine, J. et al. Adaptive-illumination STED nanoscopy. PNAS 114, 9797–9802 (2017).
Staudt, T. et al. Far-field optical nanoscopy with reduced number of state transition cycles. Opt. Express, OE 19, 5644–5657 (2011).
Classes
|
Implements a |
|
Implements a DyMINRESCueMicroscope. |
|
Implements a RESCueMicroscope. |
- class pysted.microscopes.DyMINMicroscope(excitation, sted, detector, objective, fluo, load_cache=False, opts=None, verbose=False)
Implements a
DyMINMicroscope
.Refer to [Heine2017] for details about DyMIN microscopy.
The DyMIN acquisition parameters are controlled with the opts variable. Other number of DyMIN steps can be implemented by simply changing the length of each parameters.
opts = { "scale_power" : [0, 0.25, 1.0], # Percentage of STED power "decision_time" : [10e-6, 10e-6, -1], # Time to acquire photons "threshold_count" : [8, 8, 0] # Minimal number of photons for next step }
- get_signal_and_bleach(datamap, pixelsize, pdt, p_ex, p_sted, indices=None, acquired_intensity=None, pixel_list=None, bleach=True, update=True, seed=None, filter_bypass=False, bleach_func=<cyfunction default_update_survival_probabilities>, sample_func=<cyfunction sample_molecules>)
This function acquires the signal and bleaches simultaneously.
It makes a call to compiled C code for speed, so make sure the raster.pyx file is compiled!
- Parameters:
datamap – The datamap on which the acquisition is done, either a Datamap object or TemporalDatamap
pixelsize – The pixelsize of the acquisition. (m)
pdt – The pixel dwelltime. Can be either a single float value or an array of the same size as the ROI being imaged. (s)
p_ex – The excitation beam power. Can be either a single float value or an array of the same size as the ROI being imaged. (W)
p_sted – The depletion beam power. Can be either a single float value or an array of the same size as the ROI being imaged. (W)
indices – A dictionary containing the indices of the subdatamaps used. This is used to apply bleaching to the future subdatamaps. If acquiring on a static Datamap, leave as None.
acquired_intensity – The result of the last incomplete acquisition. This is useful in a time routine where flashes can occur mid acquisition. Leave as None if it is not the case. (array)
pixel_list – The list of pixels to be iterated on. If none, a pixel_list of a raster scan will be generated. (list of tuples (row, col))
bleach – Determines whether bleaching is active or not. (Bool)
update – Determines whether the datamap is updated in place. If set to false, the datamap can still be updated later with the returned bleached datamap. (Bool)
seed – Sets a seed for the random number generator.
filter_bypass – Whether or not to filter the pixel list. This is useful if you know your pixel list is adequate and ordered differently from a raster scan (i.e. a left to right, row by row scan), as filtering the list return it in raster order. If pixel_list is none, this must be True then.
bleach_func – The bleaching function to be applied.
steps – list containing the pixeldwelltimes for the sub steps of an acquisition. Is none by default. Should be used if trying to implement a DyMin type acquisition, where decisions are made after some time on whether or not to continue the acq.
- Returns:
returned_acquired_photons, the acquired photon for the acquisition. bleached_sub_datamaps_dict, a dict containing the results of bleaching on the subdatamaps acquired_intensity, the intensity of the acquisition, used for interrupted acquisitions
- class pysted.microscopes.DyMINRESCueMicroscope(excitation, sted, detector, objective, fluo, load_cache=False, opts=None, verbose=False)
Implements a DyMINRESCueMicroscope.
Refer to [Heine2017] for details about DyMIN microscopy. In this particular case, the last step of the DyMIN acquisition is a RESCue acquisition. This microscope was not implemented in cython.
The DyMINRESCUe acquisition parameters are controlled with the opts variable. Other number of DyMIN steps can be implemented by simply changing the length of each parameters.
opts = { "scale_power" : [0, 0.25, 1.0], # Percentage of STED power "decision_time" : [10e-6, 10e-6, -1], # Time to acquire photons "threshold_count" : [8, 8, 0] # Minimal number of photons for next step }
- get_signal_and_bleach(datamap, pixelsize, pdt, p_ex, p_sted, indices=None, acquired_intensity=None, pixel_list=None, bleach=True, update=True, seed=None, filter_bypass=False, bleach_func=<cyfunction default_update_survival_probabilities>, sample_func=<cyfunction sample_molecules>)
This function acquires the signal and bleaches simultaneously.
- Parameters:
datamap – The datamap on which the acquisition is done, either a Datamap object or TemporalDatamap
pixelsize – The pixelsize of the acquisition. (m)
pdt – The pixel dwelltime. Can be either a single float value or an array of the same size as the ROI being imaged. (s)
p_ex – The excitation beam power. Can be either a single float value or an array of the same size as the ROI being imaged. (W)
p_sted – The depletion beam power. Can be either a single float value or an array of the same size as the ROI being imaged. (W)
indices – A dictionary containing the indices of the subdatamaps used. This is used to apply bleaching to the future subdatamaps. If acquiring on a static Datamap, leave as None.
acquired_intensity – The result of the last incomplete acquisition. This is useful in a time routine where flashes can occur mid acquisition. Leave as None if it is not the case. (array)
pixel_list – The list of pixels to be iterated on. If none, a pixel_list of a raster scan will be generated. (list of tuples (row, col))
bleach – Determines whether bleaching is active or not. (Bool)
update – Determines whether the datamap is updated in place. If set to false, the datamap can still be updated later with the returned bleached datamap. (Bool)
seed – Sets a seed for the random number generator.
filter_bypass – Whether or not to filter the pixel list. This is useful if you know your pixel list is adequate and ordered differently from a raster scan (i.e. a left to right, row by row scan), as filtering the list return it in raster order. If pixel_list is none, this must be True then.
bleach_func – The bleaching function to be applied.
steps – list containing the pixeldwelltimes for the sub steps of an acquisition. Is none by default. Should be used if trying to implement a DyMin type acquisition, where decisions are made after some time on whether or not to continue the acq.
- Returns:
returned_acquired_photons, the acquired photon for the acquisition. bleached_sub_datamaps_dict, a dict containing the results of bleaching on the subdatamaps acquired_intensity, the intensity of the acquisition, used for interrupted acquisitions
- class pysted.microscopes.RESCueMicroscope(excitation, sted, detector, objective, fluo, load_cache=False, opts=None, verbose=False)
Implements a RESCueMicroscope.
Refer to [Staudt2011] for details about RESCue microscopy.
The RESCue acquisition parameters are controlled with the opts variable. Other number of steps can be implemented by simply changing the length of each parameters.
opts = { "lower_treshold" : [2, -1], # Lower threshold on the number of photons "upper_threshold" : [4, -1], # Upper threshold on the maximum number of photons "decision_time" : [10e-6, -1] # Time spent for the decision }
- get_signal_and_bleach(datamap, pixelsize, pdt, p_ex, p_sted, indices=None, acquired_intensity=None, pixel_list=None, bleach=True, update=True, seed=None, filter_bypass=False, bleach_func=<cyfunction default_update_survival_probabilities>, sample_func=<cyfunction sample_molecules>)
This function acquires the signal and bleaches simultaneously.
It makes a call to compiled C code for speed, so make sure the raster.pyx file is compiled!
- Parameters:
datamap – The datamap on which the acquisition is done, either a Datamap object or TemporalDatamap
pixelsize – The pixelsize of the acquisition. (m)
pdt – The pixel dwelltime. Can be either a single float value or an array of the same size as the ROI being imaged. (s)
p_ex – The excitation beam power. Can be either a single float value or an array of the same size as the ROI being imaged. (W)
p_sted – The depletion beam power. Can be either a single float value or an array of the same size as the ROI being imaged. (W)
indices – A dictionary containing the indices of the subdatamaps used. This is used to apply bleaching to the future subdatamaps. If acquiring on a static Datamap, leave as None.
acquired_intensity – The result of the last incomplete acquisition. This is useful in a time routine where flashes can occur mid acquisition. Leave as None if it is not the case. (array)
pixel_list – The list of pixels to be iterated on. If none, a pixel_list of a raster scan will be generated. (list of tuples (row, col))
bleach – Determines whether bleaching is active or not. (Bool)
update – Determines whether the datamap is updated in place. If set to false, the datamap can still be updated later with the returned bleached datamap. (Bool)
seed – Sets a seed for the random number generator.
filter_bypass – Whether or not to filter the pixel list. This is useful if you know your pixel list is adequate and ordered differently from a raster scan (i.e. a left to right, row by row scan), as filtering the list return it in raster order. If pixel_list is none, this must be True then.
bleach_func – The bleaching function to be applied.
steps – list containing the pixeldwelltimes for the sub steps of an acquisition. Is none by default. Should be used if trying to implement a DyMin type acquisition, where decisions are made after some time on whether or not to continue the acq.
- Returns:
returned_acquired_photons, the acquired photon for the acquisition. bleached_sub_datamaps_dict, a dict containing the results of bleaching on the subdatamaps acquired_intensity, the intensity of the acquisition, used for interrupted acquisitions