NeuroAnalyzer tutorials: Download and install

First, download Julia 1.9.0 or later.

There are two main branches of NeuroAnalyzer:

Additionally, as requested by users, there is also lite branch available. This branch is equivalent to the stable branch, but without graphic capabilities (no plots and interactive editors). It has therefore much less dependencies (GLMakie, Plots, Gtk).

Note: this toolbox is under active development and is subject to change.

Multi-threading

Please note that Julia uses the JULIA_NUM_THREADS environmental variable to determine the number of threads available for the program.

For optimal performance this number should be > 1 and, depending upon your CPU number of cores, usually is equal or more than the number of cores.

For Unix-based systems (Linux, FreeBSD, MacOS) this may be set in the ~/.profile file or ~/.zshrc or ~/.bashrc (depending on your shell).

export JULIA_NUM_THREADS=12

The easiest way (which also works in Windows) it to set this variable in the Julia startup.jl file, located in ~/.julia/config directory:

ENV["JULIA_NUM_THREADS"] = 12
ENV["JULIA_NUM_PRECOMPILE_TASKS"] = 12

(!) Setting the JULIA_NUM_PRECOMPILE_TASKS variable speeds up packages precompilation process.

Installation using package manager

You may add NeuroAnalyzer using Julia package manager:

using Pkg
Pkg.update()
# for stable branch:
Pkg.add(url="https://codeberg.org/AdamWysokinski/NeuroAnalyzer.jl#stable")
# for development branch:
Pkg.add(url="https://codeberg.org/AdamWysokinski/NeuroAnalyzer.jl#devel")
# for lite branch:
Pkg.add(url="https://codeberg.org/AdamWysokinski/NeuroAnalyzer.jl#lite")
Pkg.resolve() # if necessary
Pkg.update()

Installation using environment

Another option is to initialize a new Julia environment for the package:

git clone https://codeberg.org/AdamWysokinski/NeuroAnalyzer.jl
cd NeuroAnalyzer.jl
julia --project
# or (in which case you may ignore the line `Pkg.activate(@__DIR__)` below)
julia

Activate the package in the Julia REPL:

using Pkg
Pkg.activate(@__DIR__)
Pkg.instantiate()
Pkg.resolve() # if necessary
Pkg.update()

Downloading zipped release

Alternatively, you may download NeuroAnalyzer latest release:

unzip NeuroAnalyzer-*.zip
cd NeuroAnalyzer-*
julia --project
# or (in which case you may ignore the line `Pkg.activate(@__DIR__)` below)
julia

Activate the package in the Julia REPL:

using Pkg
Pkg.activate(@__DIR__)
Pkg.instantiate()
Pkg.resolve() # if necessary
Pkg.update()

Installation using LOAD_PATH variable

The third option is to extend the Julia LOAD_PATH variable in the ~/.julia/config/startup.jl with the NeuroAnalyzer folder (downloaded as cloned or zipped repository):

push!(LOAD_PATH, "path/to/NeuroAnalyzer/folder")

Running NeuroAnalyzer

Start Julia and in the Julia REPL do the following:

using NeuroAnalyzer

Due to the nature of Julia compiler, initial startup of NeuroAnalyzer takes several seconds. To speedup the process, creating a custom sysimage for reduced latency using PackageCompiler.jl is recommended. See this tutorial how to do it.

Show version and info (for reproducibility):

na_version()
na_info()

Get help:

?NeuroAnalyzer.plot

For interactive GUI, use Pluto and PlutoUI:

using Pkg
Pkg.add("Pluto")
Pkg.add("PlutoUI")
Pkg.add("Gtk")
using Pluto
Pluto.run()

Example Pluto notebook is located here.

For non-interactive GUI, use Jupyter:

using Pkg
Pkg.add("IJulia")
using IJulia
notebook()

Example Jupyter notebook is located here.

Docker image

NeuroAnalyzer stable branch is also available as the Docker image:

docker pull neuroanalyzer/neuroanalyzer:latest
xhost local:docker
docker run -e DISPLAY=:0 -v /tmp/.X11-unix:/tmp/.X11-unix -it neuroanalyzer