{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Filters \n", "\n", "in this tutorial:\n", "- [x] invert and normalize signal\n", "- [x] using temporal filter(s)\n", "- [x] using spatial filter(s)\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Before we proceed to use the different filters to process and imporve the signal quality of the traces, let's first try to pree-process this example image by inverting and normalizing the signal." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Invert and normalize" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "![plot viewer](/_static/invert_normalize_1.gif)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Note that there are three different normalization options:\n", "\n", " 1. Local Max: perform pixel wise normalization.\n", "\n", " 2. Slide window: same as local max but max is defined by a defined slide window.\n", "\n", " 1. Global: uses the averaged maximum value for normalization.\n", "\n", "In the previous example, we use the default normalization method (Local max)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let's playback the whole sequence to visualize the AP propagation after normalization of the signal. " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "![plot viewer](/_static/playback_normalized_signal.gif)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Spatial filters\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Spatial filters are applied on the _xy_ dimensions of the 3d stack (_xyt_).\n", "The foldable filter tab will display a number of filter that we can use for this purpose. The filter operations are typically costly for large images, however, if you have a GPU available you can benefit of optimized accelerated version of these filters." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "![plot viewer](/_static/gaussian_filter.gif)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Temporal filters\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The temporal filters are performed only on the time _t_ dimension of the image 3d stack (_xyt_). So you won't be able to spot mayor difference by looking at the pixels in the _xy_ dimension. To note the differences you may plot the time profile of the image before and after performing the temporal filter operation to note the changes. Let's see it in the demonstration bellow:" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "![plot viewer](/_static/butter_filter.gif)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let's compare the profiles of the different resulting images after applying the spatial and temporal filters." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "![plot viewer](/_static/compare_filter_profiles.gif)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [] } ], "metadata": { "language_info": { "name": "python" } }, "nbformat": 4, "nbformat_minor": 2 }