Skip to main content

An extensible microscope adaptive optics use.

Project description

AOTools: A microscope add-on for adaptive optics

A composite device for controlling and using deformable mirror adaptive optic elements. This composite device can be constructed from any python-microscope compatible adaptive optics elements and cameras (see python-microscope compatibility list) as well as certain spatial light modulators. The functions presented allow a user to calibrate and characterise a adaptive optics elements using a variety of wavefront sensing techniques, to set control matrices determined by other
calibration methods and perform sensorless adaptive optics correction
with a variety of metrics.

Set-up:

AOTools is set-up like a regular python-microscope device and served with the python-microscope device server (see device server documentation: https://www.python-microscope.org/examples.html). The device layout is as follows:

device(AdaptiveOpticsDevice, [ip_address], [port],
       {mirror_uri:mirror_args,
       wavefront_uri:wavefront_args,
       slm_uri:slm_args})

Where the various _args are lists in the following format:

[microscope_device_name, ip_address, port]

Note that all microscope_device_name variables need to be imported from python-microscope, ip_address variables must be a string and port variables must be an int.

Adding new wavefront sensing techniques:

The currently implemented wavefront sensing techniques are stored in the aoAlg.py file as functions of the AdaptiveOpticsFunctions class with the naming convention "unwrap_" Each of these functions, and any new functions a user may wish to add, should be of the form:

def unwrap_*new_technique*(self, image, (N key word variables), **kwargs):
	#The actual function definition
	return phase_image

There may be no key word variables required. If any are required, they should be placed between the image key word variable and **kwargs. The final **kwarg syntax is included to catch any key word variables required for other wavefont sensing techniques which higher level processes which utilise Microscope-AOtools may pass to the functions, depending on how the wavefont sensing switching is enabled at those levels. The function should output a phase image as a real valued numpy array.

Many wavefront sensing techniques have pre-requisites that, once set, do not need to be calculated again e.g. the inteferometric wavefront sensing technique requires a mask to isolate the phase information in the Fourier transform. Once this mask has been constructed for one image, it can be used for all subsequent wavefront sensing images. These pre-requisites are stored as attributes of the AdaptiveOpticsFunctions class. Methods for constructing these pre-requisites and attributes for storing them should be added to the AdaptiveOpticsFunctions class. The attributes should be set as None in the __init__ function.

Once the new wavefont sensing technique has been added to aoAlg.py it should be added to the unwrap_function dictionary in aoDev.py with an appropriate string key i.e. the interferometry wavefront sensing technique has the string key "interferometry". Checks for the appropriate pre-requisites should be added to the check_unwrap_conditions function in aoDev.py. At this point the new wavefont sensing technique can be used in any of the Set-up methods in the same manner as the existing wavefont sensing techniques.

Adding new image quality metrics:

The currently implemented image quality assessment techniques are stored in the aoMetrics.py file as functions with the naming convention "measure_" and have the same input and output forms. Each of these functions, and any new functions a user may wish to add, should be of the form:

def measure_*new_technique*(image, (N key word variables), **kwargs):
	#The actual function definition
	return metric

There may be no key word variables required. If any are required, they should be placed between the image key word variable and **kwargs. The final **kwarg syntax is included to catch any key word variables required for other image quality assessment techniques which higher level processes which utilise Microscope-AOtools may pass to the functions, depending on how the metric switching is enabled at those levels. The function should output a single value, which can be an integer or a floating point number.

Once the new image quality assessment technique has been added to aoMetrics.py it should be added to the metric_function dictionary in aoAlg.py with an appropriate string key i.e. the contrast image quality metric has the string key "contrast". At this point the new image quality metric can be used in any of the Use Case methods in the same manner as the existing image quality assessment techniques.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

microscope-aotools-1.1.2.tar.gz (22.1 kB view details)

Uploaded Source

File details

Details for the file microscope-aotools-1.1.2.tar.gz.

File metadata

  • Download URL: microscope-aotools-1.1.2.tar.gz
  • Upload date:
  • Size: 22.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.5

File hashes

Hashes for microscope-aotools-1.1.2.tar.gz
Algorithm Hash digest
SHA256 5fdbf81c69340b3bc5d6eb7e519610ee487195d5ec35bf4599d4401031727a4a
MD5 a4cf0e1755276e8ab5da771520babdc2
BLAKE2b-256 9c39c6a027f6ac277555791fdbfe69d612d8bf0b794af8ca487f0be4d5127b7a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page