navigate.model.features.image_writer.ImageWriter
- class navigate.model.features.image_writer.ImageWriter(model, microscope_name=None, data_buffer=None, sub_dir='', image_name=None, saving_flags=None, saving_config={})
Bases:
object
Class for saving acquired data to disk.
- __init__(model, microscope_name=None, data_buffer=None, sub_dir='', image_name=None, saving_flags=None, saving_config={})
Class for saving acquired data to disk.
- Parameters:
model (navigate.model.model.Model) – Navigate Model class for controlling hardware/acquisition.
data_buffer ([SharedNDArray]) – data_buffer will use model’s default data_buffer if it’s not specified
sub_dir (str) – Sub-directory of self.model.configuration[‘experiment’] [‘Saving’][‘save_directory’] indicating where to save data
image_name (str) – Name of the image to be saved. If None, a name will be generated
Methods
__init__
(model[, microscope_name, ...])Class for saving acquired data to disk.
Estimate the size of the data that will be written to disk, and confirm that sufficient disk space is available.
close
()Close the data source we are writing to.
generate_image_name
(current_channel[, ext])Generates a string for the filename, e.g., CH00_000000.tif.
save_image
(frame_ids)Save the data to disk.
Attributes
Name of the microscope.
Data buffer for saving data.
Number of frames in the experiment.
Array of saving flags
Directory for saving data to disk.
Sub-directory for saving data to disk.
Current time point for saving data.
Dictionary of functions to call for each configuration.
Is 32 vs 64-bit file format.
Maximum intensity projection image.
Directory for saving maximum intensity projection images.
File type for saving data.
Data source for saving data to disk.
- calculate_and_check_disk_space()
Estimate the size of the data that will be written to disk, and confirm that sufficient disk space is available. Also evaluates whether big-tiff or tiff is needed. Tiff file formats were designed for 32-bit operating systems, whereas big-tiff was designed for 64-bit operating systems.
Assumes 16-bit image type, without compression.
- close()
Close the data source we are writing to.
- generate_image_name(current_channel, ext='.tif')
Generates a string for the filename, e.g., CH00_000000.tif.
- Parameters:
current_channel (int) – Index into self.model.configuration[‘experiment’] [‘MicroscopeState’][‘channels’] of saved color channel.
ext (str) – File extension, e.g., ‘.tif’
- Returns:
File name, e.g., CH00_000000.tif
- Return type:
str
- save_image(frame_ids)
Save the data to disk.
- Parameters:
frame_ids (int) – Index into self.model.data_buffer.
- big_tiff
Is 32 vs 64-bit file format.
- Type:
bool
- config_table
Dictionary of functions to call for each configuration.
- Type:
dict
- current_time_point
Current time point for saving data.
- Type:
int
- data_buffer
Data buffer for saving data.
- Type:
- data_source
Data source for saving data to disk.
- Type:
navigate.model.data_sources.DataSource
- file_type
File type for saving data.
- Type:
str
- microscope_name
Name of the microscope.
- Type:
str
- mip
Maximum intensity projection image.
- Type:
np.ndarray
- mip_directory
Directory for saving maximum intensity projection images.
- Type:
str
- number_of_frames
Number of frames in the experiment.
- Type:
int
- save_directory
Directory for saving data to disk.
- Type:
str
- saving_flags
Array of saving flags
- Type:
array
- sub_dir
Sub-directory for saving data to disk.
- Type:
str