Motion correction

The SIMA package can be used to motion correct sequentially acquired images.

Currently, there is only one implemented method, which uses a hidden Markov model (HMM) to correct for motion artifacts both between frames and within frame.

sima.motion.hmm(iterables, savedir, channel_names=None, metadata=None, num_states_retained=50, max_displacement=None, correction_channels=None, artifact_channels=None, trim_criterion=None, invalid_frames=None, verbose=True)

Create a motion-corrected ImagingDataset using a row-wise hidden Markov model (HMM).

Parameters:
  • iterables (list of list of iterable) – Iterables yielding frames from imaging cycles and channels.
  • savedir (str) – The directory used to store the dataset. If the directory name does not end with .sima, then this extension will be appended.
  • channel_names (list of str, optional) – Names for the channels. Defaults to [‘0’, ‘1’, ‘2’, ...].
  • metadata (dict) – Data for the order and timing of the data acquisition. See sima.ImagingDataset for details.
  • num_states_retained (int, optional) – Number of states to retain at each time step of the HMM. Defaults to 50.
  • max_displacement (array of int, optional) – The maximum allowed displacement magnitudes in [y,x]. By default, arbitrarily large displacements are allowed.
Returns:

dataset (sima.ImagingDataset) – The motion-corrected dataset.

Keyword Arguments:
 
  • correction_channels (list of int, optional) – Information from the channels corresponding to these indices will be used for motion correction. By default, all channels will be used.
  • artifact_channels (list of int, optional) – Channels for which artifact light should be checked.
  • trim_criterion (float, optional) – The required fraction of frames during which a location must be within the field of view for it to be included in the motion-corrected imaging frames. By default, only locations that are always within the field of view are retained.
  • verbose (boolean, optional) – Whether to print the progress status. Defaults to True.

References

  • Dombeck et al. 2007. Neuron. 56(1): 43-57.
  • Kaifosh et al. 2013. Nature Neuroscience. 16(9): 1182-4.