pyfast_adt.main.adaptor.camera.adaptor_xf416r_GPU

Attributes

type_dict

cam

Classes

Cam_xf416r

Software interface for the EMMENU program and camc5.22 to control live readout of the buffer for acquiring series of images

Functions

EMVector2dict(vec)

Convert EMVector object to a Python dictionary.

Module Contents

pyfast_adt.main.adaptor.camera.adaptor_xf416r_GPU.type_dict
pyfast_adt.main.adaptor.camera.adaptor_xf416r_GPU.EMVector2dict(vec)

Convert EMVector object to a Python dictionary.

class pyfast_adt.main.adaptor.camera.adaptor_xf416r_GPU.Cam_xf416r(drc_name: str = 'Diffraction', name: str = 'emmenu', instance_gui=None)

Bases: pyfast_adt.main.adaptor.camera.adaptor_cam.Cam_base

Software interface for the EMMENU program and camc5.22 to control live readout of the buffer for acquiring series of images

Communicates with EMMENU over the COM interface defined by TVIPS, and directly to the camera using the API of TVIPS. EMMENU is used to give a friendly way to set up the camera parameters and see the live view of the camera. TVIPS API is used to acquire the images from the camera buffer, to reach 20 FPS during acquisition.

its required to have a folder tree in EMMENU called Diffraction drc_name : str

Set the default folder to store data in

namestr

Name of the interface

name = 'emmenu'
drc_name = 'Diffraction'
exposure = None
x = None
y = None
processing = None
delay = None
binning = None
buffer_size = None
buffer = None
stop_signal = None
table = None
timings = []
instance_gui = None
connect()

Connect to the camera.

listConfigs() list

List the configs from the Configuration Manager.

getCurrentConfigName() str

Return the name of the currently selected configuration in EMMENU.

getCurrentConfig(as_dict: bool = True) dict

Get selected config object currently associated with the viewport.

getCurrentCameraInfo() dict

Gets the current camera object.

getCameraType() str

Get the name of the camera currently in use.

getEMMenuVersion() str

Get the version number of EMMENU.

lock() None

Lockdown interactions with emmenu, must call self.unlock to unlock.

If EMMenu is locked, no mouse or keyboard input will be accepted by the interface. The script calling this function is responsible for unlocking EMMenu.

unlock() None

Unlock emmenu after it has been locked down with self.lock

listDirectories() dict

List subdirectories of the top directory.

getEMVectorByIndex(img_index: int, drc_index: int = None) dict

Returns the EMVector by index as a python dictionary.

deleteAllImages() None

Clears all images currently stored in EMMENU buffers.

deleteImageByIndex(img_index: int, drc_index: int = None) int

Delete the image from EMMENU by its index.

getImageByIndex(img_index: int, drc_index: int = None) int

Grab data from the image manager by index. Return image pointer (COM).

Not accessible through server.

getImageDataByIndex(img_index: int, drc_index: int = None) numpy.array

Grab data from the image manager by index.

Return numpy 2D array

getCameraDimensions()

Get the maximum dimensions reported by the camera.

getImageDimensions()

Get the dimensions of the image.

getPhysicalPixelsize()

Returns the physical pixel size of the camera nanometers.

getBinning() int

Returns the binning corresponding to the currently selected camera config.

get_binning()

‘ get the binning of the camera

set_binning(binning: int)

‘ set the binning of the camera, common parameters are 1, 2, 4, 8

set_processing(processing: str)

‘ set the processing of the camera, processing = “Unprocessed, Background subtracted, Gain normalized”

get_processing()

‘ get the processing typeof the camera

getCameraName() str

Get the name reported by the camera.

writeTiffFromPointer(image_pointer, filename: str) None

Write tiff file using the EMMENU machinery image_pointer is the memory address returned by getImageIndex()

writeTiff(image_index, filename: str) None

Write tiff file using the EMMENU machinery image_index is the index in the current directory of the image to be written.

writeTiffs(start_index: int, stop_index: int, path: str, clear_buffer: bool = False) None

Write a series of data in tiff format and writes them to the given path using EMMENU machinery.

getImage(**kwargs) numpy.array

Acquire image through EMMENU and return data as np array.

acquire_image(exposure_time: int, binning: int, processing: str)

Acquire image through its adaptor and return it as np.array.

acquire_image_and_show(binning: int, exposure_time: int, image_size: str)
rotate_img(img, times=None, flip_h=None, flip_v=None, flip_diag=None)
acquireImage(**kwargs) int

Acquire image through EMMENU and store in the Image Manager Returns the image index.

set_image_index(index: int) None

Change the currently selected buffer by the image index Note that the interface here is 0-indexed, whereas the image manager is 1-indexed (FIXME)

get_image_index() int

Retrieve the index of the currently selected buffer, 0-indexed.

get_next_empty_image_index() int

Get the next empty buffer in the image manager, 0-indexed.

stop_record() int
start_record() int
stop_liveview() None

‘ stop the live view of the camera

start_liveview(delay: float = 3.0) None

‘ start the live view of the camera

set_exposure(exposure_time: int) None

Set exposure time in ms.

It will be set to the lowest allowed value by EMMenu if the given exposure time is too low.

get_exposure() int

Return exposure time in ms.

set_autoincrement(toggle: bool) None

Tell EMMENU to autoincrement the index number (True/False)

get_timestamps(start_index: int, end_index: int) list

Get timestamps in seconds for given image index range.

releaseConnection() None

Release the connection to the camera.

release_connection()

‘ release the connection with the device

GetCurrentCameraConfiguration() tvips.common.types.CameraConfiguration
_readSingleImage(cameraFormat: tvips.common.types.CameraFormat)
acquire_series_images(exposure_time: int, binning: int, processing: str, buffer_size: int, stop_signal, display=False)
prepare_acquisition_cRED_data(camera, binning, exposure, buffer_size, FPS_devider=1)

“ camera = XF416 or XF416R, binning = one of the available binning for the choosen camera, exposure = choosen exposure, buffer_size = dimension of the stack where saving the output images

acquisition_cRED_data(stage_thread=None, timer=None, event=None, stop_event=None)

Acquire images into the buffer up to the thread is alive, usually the stage thread is passed for cRED experiments

save_cRED_data(savingpath)
get_camera_characteristic()
load_calibration_table()
is_cam_streaming()

True is the camera have a live mode where you can retrieve the images from the memory like the xf416r, otherwise False like the timepix1

is_cam_bottom_mounted()

True if the camera is mounted on the bottom of the microscope, otherwise False

enable_streaming()
image_to_streaming(img)
pyfast_adt.main.adaptor.camera.adaptor_xf416r_GPU.cam