Skip to content
This repository has been archived by the owner on Nov 26, 2023. It is now read-only.

Commit

Permalink
Merge branch 'master' of https://github.com/kushalkolar/MESmerize
Browse files Browse the repository at this point in the history
  • Loading branch information
kushalkolar committed Jul 14, 2020
2 parents cdfe439 + 2827cba commit 7919345
Show file tree
Hide file tree
Showing 43 changed files with 145 additions and 271 deletions.
2 changes: 1 addition & 1 deletion docs/source/api_reference/Analysis_data_types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Transmission
**Inherits from BaseTransmission**

.. autoclass:: mesmerize.Transmission
:members: __init__, empty_df, from_pickle, to_pickle, from_hicke, to_hickle, from_hdf5, to_hdf5, get_proj_path, set_proj_path, to_dict, from_proj, _load_files, merge
:members: __init__, empty_df, from_pickle, to_pickle, from_hdf5, to_hdf5, get_proj_path, set_proj_path, to_dict, from_proj, _load_files, merge
:member-order: bysource

BaseTransmission
Expand Down
2 changes: 1 addition & 1 deletion docs/source/api_reference/analysis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ CC_Data
.. warning:: All arguments MUST be numpy.ndarray type for CC_Data for the save to be saveable as an hdf5 file. Set ``numpy.unicode`` as the **dtype** for the ``curve_uuids`` and ``labels`` arrays. If the **dtype** is ``'O'`` (object) the **to_hdf5()** method will fail.

.. autoclass:: mesmerize.analysis.cross_correlation.CC_Data
:members: __init__, ccs, lag_matrix, epsilson_matrix, curve_uuids, labels, get_threshold_matrix, from_dict, to_hdf5, from_hdf5
:members: __init__, ccs, lag_matrix, epsilon_matrix, curve_uuids, labels, get_threshold_matrix, from_dict, to_hdf5, from_hdf5
:member-order: bysource


Expand Down
2 changes: 1 addition & 1 deletion docs/source/api_reference/plotting/widgets/heatmap.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Heatmap with an embedded :ref:`Datapoint Tracer <API_DatapointTracer>` that can

.. autoclass:: mesmerize.plotting.HeatmapTracerWidget
:show-inheritance:
:members: plot_variant, set_update_live, set_current_datapoint, set_input, get_plot_opts, set_plot_opts, update_plot, get_cluster_kwrags, set_data, transmission, set_input, save_plot_dialog, save_plot, open_plot_dialog, open_plot, live_datapoint_tracer
:members: set_update_live, set_current_datapoint, set_input, get_plot_opts, set_plot_opts, update_plot, get_cluster_kwargs, set_data, transmission, set_input, save_plot_dialog, save_plot, open_plot_dialog, open_plot, live_datapoint_tracer
:member-order: bysource

.. autoattribute:: drop_opts
Expand Down
4 changes: 2 additions & 2 deletions docs/source/api_reference/plotting/widgets/scatter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ Scatter plot with docked Control Widget, :ref:`Datapoint Tracer <API_DatapointTr

.. autoclass:: mesmerize.plotting.ScatterPlotWidget
:show-inheritance:
:members: plot_variant, set_update_live, set_current_datapoint, set_input, get_plot_opts, set_plot_opts, update_plot, transmission, set_input, save_plot_dialog, save_plot, open_plot_dialog, open_plot, live_datapoint_tracer
:members: set_update_live, set_current_datapoint, set_input, get_plot_opts, set_plot_opts, update_plot, transmission, save_plot_dialog, save_plot, open_plot_dialog, open_plot, live_datapoint_tracer
:member-order: bysource

.. _API_Variant_PgScatterPlot:

Variant
Expand Down
7 changes: 0 additions & 7 deletions docs/source/api_reference/viewer_modules/batch_manager.rst

This file was deleted.

8 changes: 4 additions & 4 deletions docs/source/api_reference/viewer_modules/roi_manager.rst
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ BaseROI

.. autoclass:: mesmerize.viewer.modules.roi_manager_modules.roi_types.BaseROI
:show-inheritance:
:members: __init__, curve_data, get_roi_graphics_object, set_roi_graphics_object, reset_color, set_original_color, get_color, set_color, set_text, set_tag, get_tag, get_all_tags, add_to_viewer, remove_from_viewer, to_state, from_state
:members: __init__, get_roi_graphics_object, set_roi_graphics_object, reset_color, set_original_color, get_color, set_color, set_text, set_tag, get_tag, get_all_tags, add_to_viewer, remove_from_viewer, to_state, from_state
:member-order: bysource

ManualROI
Expand All @@ -126,22 +126,22 @@ ScatterROI

.. autoclass:: mesmerize.viewer.modules.roi_manager_modules.roi_types.ScatterROI
:show-inheritance:
:members: __init__, curve_data, get_roi_graphics_object, set_roi_graphics_object, reset_color, set_original_color, get_color, set_color, set_text, set_tag, get_tag, get_all_tags, add_to_viewer, remove_from_viewer, to_state, from_state, set_curve_data
:members: __init__, get_roi_graphics_object, set_roi_graphics_object, reset_color, set_original_color, get_color, set_color, set_text, set_tag, get_tag, get_all_tags, add_to_viewer, remove_from_viewer, to_state, from_state, set_curve_data
:member-order: bysource

VolCNMF
-------

.. autoclass:: mesmerize.viewer.modules.roi_manager_modules.roi_types.VolCNMF
:show-inheritance:
:members: __init__, curve_data, get_roi_graphics_object, set_roi_graphics_object, reset_color, set_original_color, get_color, set_color, set_text, set_tag, get_tag, get_all_tags, add_to_viewer, remove_from_viewer, to_state, from_state, set_curve_data, check_visible, zlevel, set_zlevel, zcenter
:members: __init__, get_roi_graphics_object, set_roi_graphics_object, reset_color, set_original_color, get_color, set_color, set_text, set_tag, get_tag, get_all_tags, add_to_viewer, remove_from_viewer, to_state, from_state, set_curve_data, check_visible, set_zlevel
:member-order: bysource

CNMFROI
-------

.. autoclass:: mesmerize.viewer.modules.roi_manager_modules.roi_types.CNMFROI
:show-inheritance:
:members: __init__, curve_data, get_roi_graphics_object, set_roi_graphics_object, reset_color, set_original_color, get_color, set_color, set_text, set_tag, get_tag, get_all_tags, add_to_viewer, remove_from_viewer, to_state, from_state, set_curve_data
:members: __init__, get_roi_graphics_object, set_roi_graphics_object, reset_color, set_original_color, get_color, set_color, set_text, set_tag, get_tag, get_all_tags, add_to_viewer, remove_from_viewer, to_state, from_state, set_curve_data
:member-order: bysource

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. _module_StimulusMapping:
.. _API_StimulusMapping:

Stimulus Mapping
****************
Expand Down
1 change: 0 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
'sphinx.ext.viewcode',
'sphinx.ext.githubpages',
'sphinx.ext.napoleon',
'sphinxcontrib.images',
]
napoleon_use_param = True
set_type_checking_flag = True
Expand Down
4 changes: 2 additions & 2 deletions docs/source/developer_guide/plots.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ The easiest way to create a plot module is by subclassing the :ref:`BasePlotWidg
General Design
==============

This shows how you can design a plot using the :ref:`SpaceMapPlot <API_SpaceMapPlot>` as a simple example. It will generally consist of a class for the main plot area, plot control, and the plot window which contains the controls and plot area.
This shows how you can design a plot using the :ref:`SpaceMapPlot <API_SpaceMap>` as a simple example. It will generally consist of a class for the main plot area, plot control, and the plot window which contains the controls and plot area.

Plot Area
=========

A class which holds the actual plot, could be a matplotlib widget or pyqtgraph plot widget for example. In the :ref:`SpaceMapPlot <API_SpaceMapPlot>` this is simply a subclass of the pyqtgraph matplotlib widget with a few more attributes and a helper method. The `error_label` attribute is simply a QLabel used for displaying a plot error summary and is handled by the `exceptions_label` decorator from :ref:`qdialogs <common-qdialogs>`.
A class which holds the actual plot, could be a matplotlib widget or pyqtgraph plot widget for example. In the :ref:`SpaceMapPlot <API_SpaceMap>` this is simply a subclass of the pyqtgraph matplotlib widget with a few more attributes and a helper method. The `error_label` attribute is simply a QLabel used for displaying a plot error summary and is handled by the `exceptions_label` decorator from :ref:`qdialogs <common-qdialogs>`.

Plot Controls
=============
Expand Down
5 changes: 0 additions & 5 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ Welcome to Mesmerize's documentation!
.. |gitter_badge| image:: https://badges.gitter.im/mesmerize_discussion/community.svg
:target: https://gitter.im/mesmerize_discussion/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge

Docs for older versions
-----------------------
`v0.1 <v0.1/index.html>`_

.. toctree::
:maxdepth: 1
Expand All @@ -39,7 +35,6 @@ Docs for older versions
:caption: Viewer

./user_guides/viewer/overview
./user_guides/convert_meta_data
./user_guides/viewer/add_to_project

.. toctree::
Expand Down
2 changes: 1 addition & 1 deletion docs/source/user_guides/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ROIs
- Yes, just add it to your :ref:`Project Configuration <project-configuration>`

#. Can some samples in my project have ROIs that originate from CNMF(E) and others that are manually drawn?
- Yes, but be aware that you must separate the CNMF(E) and manual data in downstream analysis if you use flowchart nodes that only work with CNMF(E) data, such as :ref:`NormRaw <node_NormRawMinMax>` and :ref:`DetrendDFoF <node_DetrendDFoF>.`
- Yes, but be aware that you may need to separate the CNMF(E) and manual data in downstream analysis if using flowchart nodes that work with data from specific sources.

CNMFE
=====
Expand Down
14 changes: 3 additions & 11 deletions docs/source/user_guides/flowchart/nodes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ Plot

:class:`Source <mesmerize.pyqtgraphCore.flowchart.library.Display.Plot>`

For information on the plot widget see :ref:`<plot_SimplePlot>`
For information on the plot widget see :ref:`Simple Plot <plot_SimplePlot>`

A simple plot.

Expand Down Expand Up @@ -398,15 +398,6 @@ ScatterPlot

For information on the plot widget see :ref:`Scatter Plot <plot_ScatterPlot>`

.. _node_TimeSeries:

TimeSeries
^^^^^^^^^^

Plot the means along with confidence intervals or standard eviation of numerical arrays representing time series data.

For more information see :ref:`plot_TimeSeries`


--------------------

Expand Down Expand Up @@ -1084,7 +1075,8 @@ KMeans
:class:`Source <mesmerize.pyqtgraphCore.flowchart.library.Clustering.KMeans>`

Basically `sklearn.cluster.KMeans <https://scikit-learn.org/stable/modules/generated/sklearn.cluster.KMeans.html>`_.



----------------------


Expand Down
2 changes: 1 addition & 1 deletion docs/source/user_guides/flowchart/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Almost every node uses a Transmission object for input and output. A Transmissio

**Transmission DataFrame**

The Transmission DataFrame is created from your :ref:`ProjectDataFrame` (or sub-DataFrame) by the :ref:`node_Load_Proj_DF` node. This initial DataFrame will contain the same columns as your Project DataFrame, and a new column named **_RAW_CURVE**. Each element (row) in the **_RAW_CURVE** column is a 1-D numerical array representing a single raw curve extracted from an ROI.
The Transmission DataFrame is created from your :ref:`Project DataFrame <ProjectBrowser>` (or sub-DataFrame) by the :ref:`Load_Proj_DF node <nodeLoadProjDF>`. This initial DataFrame will contain the same columns as your Project DataFrame, and a new column named **_RAW_CURVE**. Each element (row) in the **_RAW_CURVE** column is a 1-D numerical array representing a single raw curve extracted from an ROI.

A new column named **_BLOCK_** is also added which contains the `UUID <https://en.wikipedia.org/wiki/Universally_unique_identifier>`_ for logging the analysis history of this newly created block of DataFrame rows, known as a *data block*. This allows you to merge Transmissions (see :ref:`Merge node <node_Merge>`) and maintain their independent analysis logs prior to the merge.

Expand Down
22 changes: 6 additions & 16 deletions docs/source/user_guides/general/misc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ Dir Purpose
============= ===================================================================================
dataframes Contains an file storing the project dataframe, root.dfr, and backups.

A new backup is created every time a :ref:`Sample <ProjectSample>` is added to the project.
A new backup is created every time a a new *Sample* is :ref:`added to the project <add-to-project>`.

Restore a backup by renaming it to "root.dfr".

images Contains the image sequences and work environment data for all samples in the project

curves Contains the curves for every sample in the project

batches Used for storing batches used by the :ref:`Batch Manager <BatchManager>` if you wish.
batches Used for storing batches used by the :ref:`Batch Manager <module_BatchManager>` if you wish.

flowcharts Used for storing *.fc* flowchart files that save the layout of nodes in a flowchart.

Expand All @@ -54,14 +54,6 @@ plots Used for storing *.ptrn* interactive plot files.

.. warning:: Do not manually modify the data under the **images** or **curves** directories

.. _ProjectSample:

Project Sample
==============





.. _ConsoleOverview:

Expand Down Expand Up @@ -129,19 +121,17 @@ This window is accessible through the :ref:`Welcome Window <WelcomeWindow>` menu

.. image:: ./system_config_window.png

**Maximum number of threads to use:** The maximum number of threads that Mesmerize is allowed to use, this includes proccesses started by the :ref:`Batch Manager <BatchManager>`, various analysis proccesses in the flowchart, and the viewer as well.
**Maximum number of threads to use:** The maximum number of threads that Mesmerize is allowed to use, this includes proccesses started by the :ref:`Batch Manager <module_BatchManager>`, various analysis proccesses in the flowchart, and the viewer as well.

**Python call:** Many parts of Mesmerize, such as the :ref:`Batch Manager <BatchManager>` use external processes to run a python script. This setting sets which python call should be used. The default setting of "python3" should work for both :ref:`snap <snap_install>` and :ref:`pip <pip_install>` installations unless you have written a custom expansion that uses python2.
**Python call:** Many parts of Mesmerize, such as the :ref:`Batch Manager <module_BatchManager>` use external processes to run a python script. This setting sets which python call should be used. ``python3`` should work for Linux & Mac OSX. We've found that this needs to be set to ``python`` to work within Anaconda environments on Windows.

**Use CUDA:** Use CUDA accerlation if you have a GPU with CUDA cores. Only works with the :ref:`pip installation <pip_install>`, and you must have pycuda and scikit-cuda (as well as the `nvidia CUDA toolkit <https://developer.nvidia.com/cuda-toolkit>`_) installed. In Mesmerize CUDA is currently used only by :ref:`Caiman Motion Correction <module_caiman_motion_correction>`. We plan to expand CUDA support to computationally intensive tasks that are performed by flowchart nodes.
**Use CUDA:** Use CUDA accerlation if you have a GPU with CUDA cores. You must have pycuda and scikit-cuda (as well as the `nvidia CUDA toolkit <https://developer.nvidia.com/cuda-toolkit>`_) installed. CUDA accerlation isn't used much currently.

**Work dir:** Many parts of Mesmerize use a working directory for temporary files. If you have a fast filesystem you can use that for this purpose.

**Pre-run commands (large text entry):** Mesmerize runs some computationally intensive tasks in subprocesses. These commands are run prior to the python script that performs the task.

- If you are using Mesmerize in a virtual environment (such as a :ref:`pip installed <pip_install>` Mesmerize) you will need activate the environment so you must include the line ``source /path_to_venv/bin/activate`` to the pre-run commands

- Simiarly if you are using Mesmerize in an Anaconda environment you will need include commands to activate the environment.
- If you are using Mesmerize in a virtual environment or conda environment you will need activate the environment so you must include the line ``source /path_to_venv/bin/activate`` or ``conda activate <env_name>`` to the pre-run commands.

- If you are using an Intel CPU you should get optimal performance by installing `Math Kernel Library (MKL) <https://software.intel.com/en-us/get-started-with-mkl-for-linux>`_ and including ``export MKL_NUM_THREADS=1`` to the pre-run commands.

Expand Down
84 changes: 18 additions & 66 deletions docs/source/user_guides/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,75 +3,20 @@
Installation
************

Mesmerize can be installed on Linux, Mac OSX and Windows. For Linux we provide a snap package which comes with everything and doesn't require management of virtual environments or anaconda. On Windows, Mesmerize can be installed in an anaconda environment. For Mac OSX and Linux you may use either virtual environments or conda environments, but we have had much better experience with virtual environments.

.. _snap_install:
Mesmerize can be installed on Linux, Mac OSX and Windows. On Windows, Mesmerize can be installed in an anaconda environment. For Mac OSX and Linux you may use either virtual environments or conda environments, but we have had much better experience with virtual environments.

Linux
=====

The easiest way to get Mesmerize is through the Snap Store. You can also install from the GitHub repo.

Snap
----

.. image:: https://snapcraft.io/static/images/badges/en/snap-store-black.svg
:target: https://snapcraft.io/mesmerize

Command line snap installation::

sudo snap install mesmerize

After installation simply run ``mesmerize`` in the terminal and the application will launch in ~10-30 seconds. Make sure your PYTHONPATH environment variable is empty otherwise it might conflict with the snap::

export PYTHONPATH=
You can also open an ipython console in the snap environment::

mesmerize.ipython
Requirements
^^^^^^^^^^^^

Make sure you have ``snapd`` installed, which is required for running snap apps.
Ubuntu 16.04 and later usually come pre-installed with snapd.

You should be able to install ``snapd`` through apt for most Debian based distros::

sudo apt update
sudo apt install snapd

Installing ``snapd`` on Fedora::

sudo dnf install snapd

To install ``snapd`` on other distros please see: https://docs.snapcraft.io/installing-snapd

If you have trouble installing Mesmerize via snap you might need to install `core18 <https://snapcraft.io/core18>`_ first::

sudo snap install core18

Limitations
^^^^^^^^^^^

The snap installation has several limitations, most importantly you will not be able to access arbitrary filesystems. If you need this you will have to install directly from the repo (see From GitHub). If you are able to mount your external filesystem in /media (or wherever your distro places removeable media) then you should be able to access these filesystems if you do the following::

sudo snap connect mesmerize:removable-media

Alternatively you can install the snap in devmode (gives that snap broad access to the system)::

sudo snap install mesmerize --devmode
.. warning:: Analysis graphs do not work in the snap version at the moment.

.. _pypi_install:
The snap is currently discontinued in favor of a pypi package.

pip (PyPI)
==========
----------

**You will need python==3.6, there is a bug with Qt & python3.7**

#. Install python 3.6::

# Debian & Ubuntu based
sudo apt-get install python3.6
# Fedora/CentOS
Expand All @@ -89,6 +34,7 @@ pip (PyPI)
For other distributions install the equivalent meta package to get build tools.

If you're on Fedora/CentOS you'll also need ``redhat-rpm-config``, install using::

sudo dnf install redhat-rpm-config
#. Create a new virtual environment::
Expand All @@ -103,9 +49,9 @@ If you're on Fedora/CentOS you'll also need ``redhat-rpm-config``, install using
pip install --upgrade pip setuptools

#. Install tslearn::
#. Install tslearn & bottleneck (optional)::

pip install tslearn~=0.2.2
pip install tslearn~=0.2.2 bottleneck==1.2.1

#. Install mesmerize::

Expand All @@ -124,9 +70,7 @@ You will always need to activate the environment for Mesmerize before launching
source activate caiman
pip install .

More information on caiman installation::

https://caiman.readthedocs.io/en/master/Installation.html#installation-on-macos-and-linux
More information on caiman installation: https://caiman.readthedocs.io/en/master/Installation.html#installation-on-macos-and-linux


Mac OSX
Expand Down Expand Up @@ -164,9 +108,13 @@ This might take a while.

conda install Cython pandas~=0.25.3

#. Install tslearn::
#. Install tslearn (optional)::

conda install -c conda-forge tslearn==0.2.1
#. Install bottleneck (optional)::

pip install bottleneck==1.2.1

#. To launch Mesmerize call it from the terminal::

Expand Down Expand Up @@ -222,10 +170,14 @@ You will need a relatively recent version of Anaconda in order to run conda comm

conda install Cython pandas~=0.25.3
#. Install tslearn::
#. Install tslearn (optional)::

conda install -c conda-forge tslearn==0.2.1
#. Install bottleneck (optional)::

pip install bottleneck==1.2.1
#. Install graphviz::

conda install graphviz
Expand Down

0 comments on commit 7919345

Please sign in to comment.