pyfast_adt.main.adaptor.camera.generalized_adapcam_to_edit
Attributes
Classes
Software interface for the EMMENU program and camc5.22 to control live readout of the buffer for acquiring series |
Functions
|
Convert EMVector object to a Python dictionary. |
Module Contents
- pyfast_adt.main.adaptor.camera.generalized_adapcam_to_edit.type_dict
- pyfast_adt.main.adaptor.camera.generalized_adapcam_to_edit.EMVector2dict(vec)
Convert EMVector object to a Python dictionary.
- class pyfast_adt.main.adaptor.camera.generalized_adapcam_to_edit.Cam_xf416r(drc_name: str = 'Diffraction', name: str = 'emmenu')
Bases:
pyfast_adt.main.adaptor.camera.adaptor_cam.Cam_baseSoftware 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 name : str Name of the interface
- name = 'emmenu'
- exposure = None
- x = None
- y = None
- processing = None
- delay = None
- binning = None
- buffer_size = None
- stop_signal = None
- _memReader
- image = None
- result_param = []
- _obj
- _recording = False
- _cam
- _vp
- _immgr
- _emf
- _emi
- top_drc_index
- top_drc_name
- drc_name = 'Diffraction'
- drc_index
- streamable = False
- default_exposure = 50
- default_binsize = 4
- dimensions = 1024
- CAMCLIB
- cameraGPU
- cameraLiveGPU
- release_connection()
‘ release the connection with the device
- set_exposure(exposure_time: int)
‘ set the exposure time in ms for the camera
- get_exposure()
‘ get the exposure time in ms for the camera
- start_liveview(delay: float)
‘ start the live view of the camera
- stop_liveview()
‘ stop the live view of the camera
- set_binning(binning: int)
‘ set the binning of the camera, common parameters are 1, 2, 4, 8
- get_binning()
‘ get the binning of the camera
- acquire_image(exposure_time: int, binning: int, processing: str)
Acquire image through its adaptor and return it as np.array.
- set_processing(processing: str)
‘ set the processing of the camera, processing = “Unprocessed, Background subtracted, Gain normalized”
- get_processing()
‘ get the processing typeof the camera
- acquire_series_images(exposure_time: int, binning: int, processing: str, buffer_size: int, stop_signal)
- 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.
- 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.
- 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
- 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.
- GetCurrentCameraConfiguration() tvips.common.types.CameraConfiguration
- _readSingleImage(cameraFormat: tvips.common.types.CameraFormat)
- prepare_acquisition_cRED_data(camera, binning, exposure, buffer_size)
“ 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)
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(path)
- pyfast_adt.main.adaptor.camera.generalized_adapcam_to_edit.cam