Installing Julia

Note: NeuroAnalyzer is under active development and its API is subject to change.

Start by downloading the latest stable release of Julia.

Multi-threading

NeuroAnalyzer uses multi-threading to parallelize computationally intensive tasks, significantly improving processing speed and efficiency.

Julia uses the JULIA_NUM_THREADS environment variable to control the number of threads available to the program. For optimal performance, this should be set to a value greater than 1 - typically equal to or greater than the number of physical CPU cores.

Option 1 - Unix-based systems (Linux, FreeBSD, macOS):

Add the following line to your shell configuration file (~/.profile, ~/.bashrc, or ~/.zshrc, depending on your shell):

export JULIA_NUM_THREADS=12

Option 2 - All platforms (including Windows):

Set the variable in Julia’s startup.jl file, located at ~/.julia/config/startup.jl:

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

Tip: Setting JULIA_NUM_PRECOMPILE_TASKS speeds up the package precompilation process.

macOS only: If you encounter the following error during precompilation: dyld: Library not loaded: @rpath/libLLVM.dylib start Julia using:

julia --pkgimages=no

Installation via the Package Manager

NeuroAnalyzer is registered in the Julia General Registry, making installation straightforward via the built-in package manager:

using Pkg
Pkg.add("NeuroAnalyzer")

Alternatively, you can install directly from the source repository using the package manager:

using Pkg
Pkg.update()
Pkg.add(url = "https://codeberg.org/AdamWysokinski/NeuroAnalyzer.jl.git")
Pkg.resolve() # if necessary
Pkg.update()

Installation via a Dedicated Environment

Another option is to set up an isolated Julia environment for NeuroAnalyzer - useful if you want to keep its dependencies separate from your other Julia projects:

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

To activate the environment in the Julia REPL:

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

Running NeuroAnalyzer

Start Julia and enter the following in the REPL:

using NeuroAnalyzer

Due to the nature of the Julia compiler, NeuroAnalyzer’s initial startup takes several seconds. To reduce this latency, it is recommended to create a custom sysimage using PackageCompiler.jl - see this tutorial for step-by-step instructions.

Show version and info (for reproducibility):

na_version()
"0.26.4"
na_info()
     NeuroAnalyzer: 0.26.4-dev
NeuroAnalyzer path: /home/eb/.julia/packages/NeuroAnalyzer/oshZ5
     Julia version: 1.12.5
      Plugins path: /home/eb/NeuroAnalyzer/plugins
    Resources path: /home/eb/.julia/artifacts/5d28931953470cdaddb1dd3f26ce9745153d072a/neuroanalyzer-resources
 Show progress bar: false
           Verbose: false
      Exclude bads: false
            Colors: false
           Threads: 48 [set using `JULIA_NUM_THREADS` environment variable or Julia --threads command-line option]

For best performance, environment variable `JULIA_NUM_THREADS` (48) should be less than number of CPU threads (48)

Use Julia’s built-in help system to access documentation for any function: ?NeuroAnalyzer.plot

For an interactive GUI experience, NeuroAnalyzer works with 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 a non-interactive notebook environment, NeuroAnalyzer can also be used with Jupyter:

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

Example Jupyter notebook is located here.

Docker Image

NeuroAnalyzer is also available as a pre-built Docker image:

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