v1.4.0
·
10 commits
to release/1.4
since this release
New features
- Added
lk.HiddenMarkovModel
for classifying data traces exhibiting transitions between discrete states. For more information, see the tutorials section on Population Dynamics. - Added option to crop beads out of a kymograph using
Kymo.crop_beads()
. - Added API to determine bead edges in a kymograph using
Kymo.estimate_bead_edges()
. - Added
emission_path()
andplot_path()
methods tolk.GaussianMixtureModel
- Added option to
File
to pass a custom mapping from Photon count detector to RGB colors colors. This is useful to reconstruct images on systems with non-standard imaging modules. - Added option to customize the filter width of the Gaussian filter that is applied prior to spot detection in
lk.track_greedy()
. Increasing this value results in fewer false detections at the cost of resolution. Note that the current default is set to half a pixel to preserve the old behavior. - Added option to determine the viscosity and density of water with NaCl dissolved in it using
lk.viscosity_of_water()
andlk.density_of_water()
. - Added
ImageStack.close()
to force close file handles. Note that this prohibits further access to images from theImageStack
it is called on, but also anyImageStack
derived from it (i.e. throughImageStack.define_tether()
orImageStack.crop_by_pixels()
). - Added option to filter kymograph spot detections where there are no detections in adjacent frames using
adjacency_filter=True
inlk.track_greedy()
. - Add option to
include_dead_time
toImageStack.plot_correlated()
forScan
andImageStack
. This parameter defaults toTrue
.
Bug fixes
- Fixed a bug where the time indicator was off by one frame in
ImageStack.plot_correlated()
andImageStack.export_video()
. - Fixed a bug where the time between frames was incorrectly not excluded when calling
ImageStack.frame_timestamp_ranges()
withinclude_dead_time=False
. Note thatScan
andKymo
are not affected. - Fixed a bug where
ImageStack.plot_correlated()
was not excluding the dead time between frames. - Fixed a bug where color adjustments on a single channel
ImageStack
would not be applied unless a channel was provided as argument. This bug was introduced inv1.3.0
. - Changed the
DateTime
tag on TIFFs exported with Pylake fromScan
andKymo
objects. Before the change, the start and end of the scanning period in nanoseconds was stored. After the change, we store the starting timestamp of the frame, followed by the starting timestamp of the next frame to be consistent with data exported from Bluelake. The scanning time is stored in the fieldExposure time (ms)
on the Description tag. - Fixed tests to be compatible with
pytest>=8.0.0
. - Ensure
in
returnsTrue
for a valid data path (e.g."Force HF/Force 1x" in file
should returnTrue
).
Improvements
ImageStack
now closes any file handles it has open upon garbage collection.
Deprecations
- Deprecated
GaussianMixtureModel.from_channel()
. The class constructor now acceptsSlice
instances directly. - Deprecated
GaussianMixtureModel.label()
. UseGaussianMixtureModel.state_path()
instead. Note, the returned instance is typeSlice
rather thannp.ndarray
. The data can be accessed viamodel.state_path(channel_slice).data
. - Deprecated
GaussianMixtureModel.exit_flag
UseGaussianMixtureModel.fit_info()
instead. Note, the returned instance is aGmmFitInfo
dataclass with attributes matching the keys of thedict
returned fromexit_flag
(along withbic
andaic
; see next point). - Deprecated
GaussianMixtureModel.bic
andGaussianMixtureModel.aic
properties. These values can now be accessed via thebic
andaic
properties ofGaussianMixtureModel.fit_info
.
Breaking changes (alpha functionality)
trace_kwargs
andlabel_kwargs
are now keyword-only arguments forGaussianMixtureModel.plot()
.
Other changes
- Bump
tifffile
dependency to>=2022.7.28
.