neuralib.imaging.widefield.fft
- class neuralib.imaging.widefield.fft.SequenceFFT[source]
- __init__(seq, component=1)[source]
- Parameters:
seq (ndarray) – Image Sequence. Array[float, [F, H, W]]
component (int) – Which Fourier component (frequency) to use, defaults to 1 (primary oscillatory component)
- property component: int
- property n_frames: int
- property height: int
- property width: int
- get_freq_map()[source]
Takes in trial-averaged sequence and calculates the Fourier Transform, basically transforming each pixel’s intensity over time (across frames)
- Returns:
Array[float, [H, W]]
- Return type:
ndarray
- get_intensity()[source]
Computes the magnitude of the frequency component. i.e., Strength of the responsiveness (frame-wise averaged)
- Return type:
ndarray
- get_phase()[source]
Computes the phase of the selected frequency component. For example, the spatial locations of the visual field.
- Returns:
Array[float, [H, W]]
- Return type:
ndarray
- as_colormap(*, saturation_factor=0.3, value_perc=98, saturation_perc=90, to_rgb=True)[source]
Generates an HSV colormap representation of the Fourier transform results.
Hue (H) represents the phase of the oscillation.
Saturation (S) represents the intensity raised to a power (saturation_factor).
Value (V) represents the normalized intensity of the frequency component.
The generated colormap provides a visualization of frequency components across spatial locations.
- Parameters:
saturation_factor (float) – Exponent applied to the intensity for controlling saturation scaling
value_perc (float) – Percentile threshold to normalize intensity values
saturation_perc (float) – Percentile threshold to normalize saturation values
to_rgb (bool) – If True, converts the HSV colormap to RGB using OpenCV
- Returns:
- Return type:
ndarray