NeuroAnalyzer tutorials: Download and install

First, download latest stable Julia version.

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.

(!) Note that the 32-bit x86 architecture does not support threading due to lack of compiler runtime library support, so you may need to set JULIA_NUM_THREADS=0 and JULIA_NUM_PRECOMPILE_TASKS=0 if you’re on a 32-bit system.

(!) If you encounter the following error: dyld: Library not loaded: @rpath/libLLVM.dylib at pre-compilation, start Julia using:

julia --pkgimages=no

Installation using package manager

Since version 0.24.1, NeuroAnalyzer is registered in the Julia general registry. Therefore, the easiest way of installing the package is to press ] to enter the package mode, and then add this package:

(@v1.10) pkg> add NeuroAnalyzer

or

using Pkg
Pkg.add("NeuroAnalyzer.jl")

You may also manually 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