lumicks.pylake.correlated_stack.CorrelatedStack

class CorrelatedStack(image_name, align=True)

CorrelatedStack acquired with Bluelake. Bluelake can export stacks of images to various formats. These can be opened and correlated to timeline data using CorrelatedStack.

Parameters
image_namestr

Filename for the image stack. Typically a TIFF file recorded from a camera in Bluelake.

alignbool

If enabled, multi-channel images will be reconstructed from the image alignment metadata from Bluelake. The default value is True.

Examples

from lumicks import pylake

# Loading a stack.
stack = pylake.CorrelatedStack("example.tiff")

# Making a plot where force is correlated to images in the stack.
file = pylake.File("example.h5")
stack.plot_correlated(file.force1x)

# Determine the force trace averaged over frame 2...9.
file.force1x.downsampled_over(stack[2:10].frame_timestamp_ranges)
__init__(image_name, align=True)

Methods

__getitem__(item)

All indexing is in frames

_get_frame([frame])

crop_and_rotate([frame, channel, show_title])

Open a widget to interactively edit the image stack.

crop_by_pixels(x_min, x_max, y_min, y_max)

Crop the image stack by pixel values.

define_tether(point1, point2)

Returns a copy of the stack rotated such that the tether defined by point_1 and point_2 is horizontal.

export_tiff(file_name[, roi])

Export a video of a particular scan plot

from_data(data[, name, start_idx, stop_idx])

Deprecated since version 0.10.1.

from_dataset(data[, name, start_idx, stop_idx])

Construct CorrelatedStack from image stack object

get_image([channel])

Get image data for the full stack as an np.ndarray.

plot([frame, channel, show_title, axes, ...])

Plot image from image stack

plot_correlated(channel_slice[, frame, ...])

Downsample channel on a frame by frame basis and plot the results.

plot_tether([axes])

Plot a line at the tether position.

Attributes

frame_timestamp_ranges

List of time stamps.

num_frames

Number of frames in the stack.

raw

Raw frame data.

start

Starting time stamp of the stack.

stop

Final time stamp of the stack.

timestamps

Deprecated since version 0.11.1.