To use SMART, wholebrain must first be installed. If your machine is running Windows or Linux, the most updated instructions were written by Matias Andina and can be found at this site.
If you are running on Mac OSX, the most updated instructions to install Wholebrain can be found here
The original wholebrain installation instructions are somewhat outdated. However I highly recommend reading through all the documentation and watching the tutorials for Wholebrain on the original [website] (www.wholebrainsoftware.org) before using this package.
SMART is easily installed from github using the devtools package:
# Load devtools library(devtools) # Install SMART devtools::install_github("sgoldenlab/SMART@main") # Load SMART library(SMART) # Pull up package descriptions and list of functions ?SMART
An alternative to the above instructions using a Wholebrain + SMART Docker image is recommended for those that are having serious installation issues. Docker is a platform for software virtualization and can deliver software in packages called containers. Read more about Docker on their documentation website.
The docker can also be used to trial the functions that are available with these two packages. Because the docker image is a “snapshot” of the version of wholebrain and SMART at the time of the image creation, any updates to these packages will not be included in the image.
Please note that we still favor installing wholebrain and SMART directly to your computer if possiible. The docker requires X-Forwarding to render certain graphical user interfaces onto the host computer. This results in a slower overall interactive experience.
The steps below were tested on a PC running Windows 10 Enterprise, Intel(R) Core(TM) i9-10900 CPU. with 64 GB of installed RAM.
Install Docker for Windows (4.3.2 was tested). Click here. Run the ‘Docker Desktop Installer.exe’ file and accept the defaults, including ’Enable Hyper-V Windows Features” or “Install required Windows components for WSL-2.”
Launch the Docker Desktop application and click yes if there is a pop-up stating the WSL-2 installation is incomplete. Follow the instructions to install the Linux kernel and click “restart” on the Docker Deskstop pop-up to restart the computer and finish the installation.
Open up a terminal as an administrator. Pull the wholebrain-SMART docker image from DockerHub with the command:
Docker pull mjin1812/wholebrain_smart
Install vcxsrv. Click here. This is a Windows X-Server and is used for displaying graphical information communicated from the running docker container. Click on the installer and accept all defaults.
Open the X server (vcxsrv) by clicking on the XLaunch shortcut or searchin for XLaunch in the windows search bar. Hit next and accept the defaults until you reach the “Extra settings” window. MAKE SURE to check the box next to “Disable access control” to allow accepting connections from all clients.
Open a terminal as an administrator and type the following command:
Look for your IPv4 Address for your network adaptor and write it down.
docker run -it --rm -e DISPLAY=<IPv4 address>:0.0 -v /tmp/.X11-unix:/tmp/.X11-unix -e DISABLE_AUTH=true -e ROOT=true -p 8787:8787 mjin1812/wholebrain_smart
For example, if my IPv4 address is 10.20.230.51 the following command will launch my docker container.
docker run -it --rm -e DISPLAY=10.20.230.51:0.0 -v /tmp/.X11-unix:/tmp/.X11-unix -e DISABLE_AUTH=true -e ROOT=true -v C:/Users/jinmich/Documents/my_project:/home/rstudio/my_project -p 8787:8787 mjin1812/wholebrain_smart
In the above command, I also included the -v flag to map data from my folder on my host computer, “C:/Users/jinmich/Documents/my_project” to a folder accessible from my Docker container “/home/rstudio/my_project.” Processing of any data within mapped drive using the docker container should access the data using the docker path.
localhost:8787.If you would like to use a different port, change the argument after the -p flag in the command used to run the docker container. An RStudio interface should appear in the window.
You can type the command below to check that wholebrain is working.
library(wholebrain) filename<-system.file('sample_tiles/rabiesEGFP.tif', package='wholebrain') seg<-segment(filename)
At this point, the docker container is running and users can feel free to follow along with the pipeline tutorial.
Note: when entering paths into the container running RStudio, absolute paths take linux conventions and start with the root path ‘/home’, so make sure to include the first forward slash.
When you are done using the docker container to run Wholebrain or SMART in a given session, navigate to the terminal. CTRL + C will stop running the container. You can check that there are no running containers by typing
docker container ls.
Kill the X server with the terminal command:
taskkill /f /im vcxsrv.exe