lumicks.pylake.kymo.Kymo¶
-
class
Kymo
(name, file, start, stop, json)¶ A Kymograph exported from Bluelake
Parameters: - name : str
Kymograph name
- file : lumicks.pylake.File
Parent file. Contains the channel data.
- start : int
Start point in the relevant info wave.
- stop : int
End point in the relevant info wave.
- json : dict
Dictionary containing kymograph-specific metadata.
-
__init__
(name, file, start, stop, json)¶ Initialize self. See help(type(self)) for accurate signature.
Methods
__init__
(name, file, start, stop, json)Initialize self. downsampled_by
([time_factor, …])Return a copy of this Kymograph which is downsampled by time_factor
in time andposition_factor
in space.from_dataset
(h5py_dset, file)Construct a confocal class from dataset. plot_blue
(**kwargs)Plot an image of the blue photon channel plot_green
(**kwargs)Plot an image of the green photon channel plot_red
(**kwargs)Plot an image of the red photon channel plot_rgb
(**kwargs)Plot a full rbg kymograph image plot_with_force
(force_channel, color_channel)Plot kymo with force channel downsampled over scan lines plot_with_position_histogram
(color_channel)Plot kymo with histogram along position axis plot_with_time_histogram
(color_channel[, …])Plot kymo with histogram along time axis save_tiff
(filename[, dtype, clip])Save the RGB photon counts to a TIFF image Attributes
blue_image
blue_photon_count
blue_power
center_point_um
Returns a dictionary of the x/y/z center coordinates of the scan (w.r.t. fast_axis
green_image
green_photon_count
green_power
has_fluorescence
Deprecated since version 0.8.0.
has_force
Deprecated since version 0.8.0.
infowave
json
Deprecated since version 0.8.0.
line_time_seconds
Line time in seconds pixels_per_line
pixelsize_um
Returns a List
of axes dimensions in um.red_image
red_photon_count
red_power
rgb_image
scan_width_um
Returns a List
of scan widths as configured in the Bluelake UI. The length of the listsize_um
Returns a List
of scan sizes in um along axes.sted_power
timestamps
Timestamps for image pixels, not for samples -
__getitem__
(item)¶ All indexing is in timestamp units (ns)
-
downsampled_by
(time_factor=1, position_factor=1, reduce=<function sum>, reduce_timestamps=<function mean>)¶ Return a copy of this Kymograph which is downsampled by
time_factor
in time andposition_factor
in space.Parameters: - time_factor : int
The number of pixels that will be averaged in time (default: 1).
- position_factor : int
The number of pixels that will be averaged in space (default: 1).
- reduce : callable
The
numpy
function which is going to reduce multiple pixels into one. The default isnp.sum
.- reduce_timestamps : callable
The
numpy
function that is going to reduce timestamps into one. The default isnp.mean
.
-
classmethod
from_dataset
(h5py_dset, file)¶ Construct a confocal class from dataset.
Parameters: - h5py_dset : h5py.Dataset
The original HDF5 dataset containing confocal scan information
- file : lumicks.pylake.File
The parent file. Used to loop up channel data
-
plot_blue
(**kwargs)¶ Plot an image of the blue photon channel
Parameters: - **kwargs
Forwarded to
matplotlib.pyplot.imshow()
.
-
plot_green
(**kwargs)¶ Plot an image of the green photon channel
Parameters: - **kwargs
Forwarded to
matplotlib.pyplot.imshow()
.
-
plot_red
(**kwargs)¶ Plot an image of the red photon channel
Parameters: - **kwargs
Forwarded to
matplotlib.pyplot.imshow()
.
-
plot_rgb
(**kwargs)¶ Plot a full rbg kymograph image
Parameters: - **kwargs
Forwarded to
matplotlib.pyplot.imshow()
.
-
plot_with_force
(force_channel, color_channel, aspect_ratio=0.25, reduce=<function mean>, **kwargs)¶ Plot kymo with force channel downsampled over scan lines
Note that high frequency channel data must be available for this function to work.
Parameters: - force_channel: str
name of force channel to downsample and plot (e.g. ‘1x’)
- color_channel: str
color channel of kymo to plot (‘red’, ‘green’, ‘blue’, ‘rgb’)
- aspect_ratio: float
aspect ratio of the axes (i.e. ratio of y-unit to x-unit)
- reduce : callable
The
numpy
function which is going to reduce multiple samples into one. Forwarded toSlice.downsampled_over()
- **kwargs
Forwarded to
Slice.plot()
.
-
plot_with_position_histogram
(color_channel, pixels_per_bin=1, hist_ratio=0.25, **kwargs)¶ Plot kymo with histogram along position axis
Parameters: - color_channel: str
color channel of kymo to plot (‘red’, ‘green’, ‘blue’, ‘rgb’).
- pixels_per_bin: int
number of pixels along position axis to bin together.
- hist_ratio: float
width of the histogram with respect to the kymo image.
- **kwargs
Forwarded to histogram bar plot.
-
plot_with_time_histogram
(color_channel, pixels_per_bin=1, hist_ratio=0.25, **kwargs)¶ Plot kymo with histogram along time axis
Parameters: - color_channel: str
color channel of kymo to plot (‘red’, ‘green’, ‘blue’, ‘rgb’).
- pixels_per_bin: int
number of pixels along time axis to bin together.
- hist_ratio: float
height of the histogram with respect to the kymo image.
- **kwargs
Forwarded to histogram bar plot.
-
save_tiff
(filename, dtype=<class 'numpy.float32'>, clip=False)¶ Save the RGB photon counts to a TIFF image
Parameters: - filename : str
The name of the TIFF file where the image will be saved.
- dtype : np.dtype
The data type of a single color channel in the resulting image.
- clip : bool
If enabled, the photon count data will be clipped to fit into the desired
dtype
. This option is disabled by default: an error will be raise if the data does not fit.
-
center_point_um
¶ Returns a dictionary of the x/y/z center coordinates of the scan (w.r.t. brightfield field of view)
-
has_fluorescence
¶ Deprecated since version 0.8.0: By definition, confocal images always have fluorescence data.
-
has_force
¶ Deprecated since version 0.8.0: This property is always False and therefore not needed.
-
json
¶ Deprecated since version 0.8.0: Access to raw metadata will be removed in a future release. Use accessor properties instead. (see docs)
-
line_time_seconds
¶ Line time in seconds
-
pixelsize_um
¶ Returns a
List
of axes dimensions in um. The length of the list corresponds to the number of scan axes.
-
scan_width_um
¶ - Returns a
List
of scan widths as configured in the Bluelake UI. The length of the list - corresponds to the number of scan axes. Note that these widths can deviate from the actual scan widths performed in practice
Deprecated since version 0.8.2: The property
scan_width_um
has been deprecated. Usesize_um
to get the actual size of the scan. When performing a scan, Bluelake determines an appropriate scan width based on the desired pixel size and the desired scan width. This means that the size of the performed scan could deviate from the width provided in this property.- Returns a
-
size_um
¶ Returns a
List
of scan sizes in um along axes. The length of the list corresponds to the number of scan axes.
-
timestamps
¶ Timestamps for image pixels, not for samples
The returned array has the same shape as the
*_image
arrays.