A Python Library estimating somatic signals in 2-photon data
Project description
Latest Release |
|
License |
|
Documentation |
|
Build Status |
|
Interactive Demo |
|
Support |
|
Citation |
FISSA (Fast Image Signal Separation Analysis) is a Python package for decontaminating somatic signals from two-photon calcium imaging data. It can read images in tiff format and ROIs from zip files exported by ImageJ; or operate on numpy arrays, generated by importing files stored in other or as the output of other packages.
For details of the algorithm, please see our companion paper published in Scientific Reports. For the code used to generate the simulated data in the companion paper, see the SimCalc repository.
FISSA is compatible with both Python 2.7 and Python >=3.5, however Python 3 is strongly encouraged as Python 2 has reached its end of life. FISSA is continually tested on Ubuntu, Windows, and Mac OSX during its development cycle.
Documentation, including the full API, is available online at readthedocs.
If you encounter a specific problem please open a new issue. For general discussion and help with installation or setup, please see the Gitter chat.
Usage
A concise example of how to use FISSA is as follows.
import fissa
experiment = fissa.Experiment('path/to/tiffs', 'path/to/rois.zip', 'experiment_name')
experiment.separate()
# The separated time series data is now available as experiment.result
experiment.result[roi_index, tiff_index][0, :]
We also have several example notebooks for a basic worflow and more complicated workflows where FISSA needs to interact with the outputs of other two-photon calcium imaging toolboxes which can be used to automatically detect cells.
You can try out each of the example notebooks interactively in your browser on Binder (note that it may take 10 minutes for Binder to boot up).
Workflow |
Jupyter Notebook |
Script |
|||
---|---|---|---|---|---|
Basic (ImageJ) |
|||||
With suite2p |
|||||
With SIMA |
|||||
With CNMF (MATLAB) |
These notebooks can also be run on your own machine. To do so, you will need to:
If you want to run the Suite2p notebook, you’ll have to install everything into a conda environment, as per their installation instructions.
Install fissa with its plotting dependencies pip install fissa[plotting].
If you want to run the sima notebook, you will also have to install sima with pip install sima. Note that sima only supports python<=3.6.
Download a copy of the repository, unzip it and browse to the examples directory.
Start up a jupyter notebook server to run our notebooks jupyter notebook.
If you’re new to Jupyter notebooks, here is an approachable tutorial.
Installation
Quick Guide
FISSA is available on PyPI and the latest version can be installed into your current environment using pip.
pip install fissa
If you need more details or you’re stuck with something in the dependency chain, more detailed instructions for both Windows and Ubuntu users are below.
Installation on Windows
We detail two different ways to install Python on your Windows. One is to download the official Python installer, and the other is to use Anaconda.
Official Python distribution
Go to the Python website and download the latest version of Python for Windows.
Run the executable file downloaded, which has a name formatted like python-3.y.z.exe.
In the installation window, tick the checkbox “Add Python 3.y to PATH”.
Click “Install Now”, and go though the installation process to install Python.
Open the Command Prompt application. We can run Python from the general purpose command prompt because we added its binaries to the global PATH variable in Step 4.
At the Command Prompt command prompt, install fissa and its dependencies by running the command:
pip install fissa
You can check to see if fissa is installed with:
python -c "import fissa; print(fissa.__version__)"
You should see your FISSA version number printed in the terminal.
You can now use FISSA from the Python command prompt. To open a python command prompt, either execute the command python within the Command Prompt, or open Python executable which was installed in Step 5. At the python command prompt, you can run FISSA as described in Usage above.
Anaconda distribution
Download and install the latest version of either Anaconda or Miniconda. Miniconda is a lightweight version of Anaconda, the same thing but without any packages pre-installed.
Open the Anaconda Prompt, which was installed by either Anaconda or Miniconda in Step 1.
In the Anaconda Prompt, run the following command to install some of FISSA’s dependencies with conda.
conda install -c conda-forge numpy scipy shapely tifffile
Run the following command to install FISSA, along with the rest of its dependencies.
pip install fissa
You can check to see if fissa is installed with:
python -c "import fissa; print(fissa.__version__)"
You should see your FISSA version number printed in the terminal.
You can now use FISSA from the Python command prompt. To open a python command prompt, either execute the command python within the Anaconda Prompt. At the python command prompt, you can run FISSA as described in Usage above.
Optionally, if you want use suite2p, it and its dependencies can be installed as follows.
conda install -c conda-forge mkl mkl_fft numba pyqt pip install suite2p rastermap
Installation on Linux
Before installing FISSA, you will need to make sure you have all of its dependencies (and the dependencies of its dependencies) installed.
Here we will outline how to do all of these steps, assuming you already have both Python and pip installed. It is highly likely that your Linux distribution ships with these. You can upgrade to a newer version of Python by downloading Python from the official website.
Alternatively, you can use an Anaconda environment (not detailed here).
Dependencies of dependencies
scipy requires a Fortran compiler and BLAS/LAPACK/ATLAS
shapely requires GEOS.
Pillow>=3.0.0 effectively requires a JPEG library.
These packages can be installed on Debian/Ubuntu with the following shell commands.
sudo apt-get update sudo apt-get install gfortran libopenblas-dev liblapack-dev libatlas-dev libatlas-base-dev sudo apt-get install libgeos-dev sudo apt-get install libjpeg-dev
Install the latest release version of FISSA from PyPI using pip:
pip install fissa
You can check to see if FISSA is installed by running the command:
python -c "import fissa; print(fissa.__version__)"
You will see your FISSA version number printed in the terminal.
You can now use FISSA from the Python command prompt, as described in Usage above.
Citing FISSA
If you use FISSA for your research, we would be grateful if you could cite our paper on FISSA in any resulting publications:
S. W. Keemink, S. C. Lowe, J. M. P. Pakan, E. Dylda, M. C. W. van Rossum, and N. L. Rochefort. FISSA: A neuropil decontamination toolbox for calcium imaging signals, Scientific Reports, 8(1):3493, 2018. doi: 10.1038/s41598-018-21640-2.
For your convenience, we provide a copy of this citation in bibtex and RIS format.
License
Unless otherwise stated in individual files, all code is Copyright (c) 2015–2020, Sander Keemink, Scott Lowe, and Nathalie Rochefort. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for fissa-0.7.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a68ebeb225c455a8e17227a3ed3ad31641992a9f56f0ed288506a6e83c951ff |
|
MD5 | def453738f5a47c8ced37336f0245ea9 |
|
BLAKE2b-256 | 8a1647b707cc7487133fff4543cf76ca1acaea9853a845f1686e6740ca94def2 |