imfun.fnmap

imfun.fnmap.MH_onoff(start, stop)

To be used for correlation

imfun.fnmap.actcorrmap(fseq, (start, stop), normL=None, normfn=<function DFoSD at 0x7fcac6ea67d0>, sigfunc=<function tanh_step at 0x7fcac6e569b0>)

Activation correlation-based mapping

imfun.fnmap.avg_eds(fseq, *args, **kwargs)

Average wavelet energy density surface for a frame sequence input: fseq, *args, **kwargs *args, **kwargs are passed to cwt_iter

imfun.fnmap.corrlag(timevec)

Factory: takes time vector. Returns a function, which takes two vectors, returns position and amplitude of the main peak in cross-correlation function

imfun.fnmap.cwt_freqmap(fseq, tranges, frange, nfreqs=32, **kwargs)

Maps dominant frequency in the given frequency band, creates maps for a list of specified time ranges

imfun.fnmap.cwt_iter(fseq, frange, nfreqs=128, wavelet=<Mock name='mock.pycwt.Morlet()' id='140508897046928'>, normL=None, max_pixels=None, cwtfn=<Mock name='mock.pycwt.eds' id='140508897046992'>, verbose=False, **kwargs)

Iterate over cwt of the time series for each pixel

Parameters:
  • fseq – frame sequence instance
  • frange – frequency range as a pair or vector of frequencies
  • nfreqs – number of frequencies/scales for decomposition
  • wavelet – wavelet object [pycwt.Morlet()]
  • normL – length of normalizing part (baseline) of the time series
  • max_pixels – upper limit on number of pixels to iterate over
  • cwt_fn – function to process wavelet coefficients [pycwt.eds]
  • verbose – be verbose
  • **kwargs – are passed to fseq.pix_iter
Returns:
  • generator over (cwt-derived measure, i, j) tuples
(where i,j are frame indices)
imfun.fnmap.cwtmap(fseq, tranges, frange, func=<Mock name='mock.mean' id='140508897394640'>, **kwargs)

Wavelet-based ‘functional’ map of the frame sequence

Parameters:
  • fseq – frame sequence

  • tranges – list of time ranges

  • frange – frequency range or vector of frequencies

  • func – function to apply to the wavelet spectrogram within the window

    of interest. Default, np.mean

  • `**kwarg`s – to be passed to cwt_iter

Returns:
  • a 2D array as a result of application of the func to wavelet spectrograms
imfun.fnmap.fftmap(fseq, frange, func=<Mock name='mock.mean' id='140508897394640'>, normL=None, verbose=True, **kwargs)
Fourier-based functional mapping:
  • frange : a range of frequencies in Hz, e.g. (1.0, 1.5)
  • func : range reducing function. np.mean by default, may be np.sum as well
imfun.fnmap.isseq(obj)

Simple test if an object is a sequence (has “__iter__” attribute)

imfun.fnmap.meanactmap(fseq, (start, stop), normL=None)

Average activation map

imfun.fnmap.simple_corrlag(v1)

Returns a function, which takes a vector, returns position of the main peak in cross-correlation function

imfun.fnmap.tanh_step(start, stop)

To be used for correlation

imfun.fnmap.xcorrmap(fseq, signal, normL=None, normfn=<function DFoSD at 0x7fcac6ea67d0>, corrfn='pearson', keyfn=<function <lambda> at 0x7fcac6e56c08>, normalize_data=False, normalize_signal=False)
Arguments:
  • fseq, a frame sequence instance
  • signal: a template signal (to correlate to)
  • normL : N points to use for normalization
  • normfn: a function to use for normalization [default: DFoSD]
  • corrfn: a correlation function. can be {‘pearson’, ‘spearman’, ‘correlate’} or user-provided function
  • keyfn : a function to extract corr. coefficient from corrfn returned value. default, [x->x]
  • normalize_signal: flag, whether to normalize the template signal [default: False]
Returned value:
2D array, each value contains correlation coefficient of the provided frame sequence to the template signal.