Windows Installation
Installation Steps
Download and install the latest stable Blender (2.7pb).
Download and install Git.
Download and install Anaconda python 3.6.
Create a folder named “mmvt_root”.
Open the git application – Git CMD.
From the command line, go to the mmvt_root folder:
Copy the folder path.
Example: c:\Users\Jhon\Desktop\mmvt_root
In the Git CMD terminal type the letters: cd hit space and paste the folder.
Example: cd c:\Users\Jhon\Desktop\mmvt_root
Clone the MMVT code in the new line opened in the Git CMD.
Type: git clone https://github.com/pelednoam/mmvt.git
.
A folder named “mmvt” will be created under the mmvt_root folder. Rename it to mmvt_code folder.
Open the “Anaconda Prompt” application. Go to the mmvt_code folder by using the cd command.
Example: C:\Users\Jhon\mmvt_root\mmvt_code
Run the mmvt setup.
Type: python -m src.setup
.
Go to the Windows menu and search for ‘cmd’. Right click on the icon and choose ‘run as administrator’ (same as step one in the message that appears when the setup ends).
When the setup ends a message with directions will appear in the terminal. Please follow the instructions to complete the setup.
Here is an example of such a message:
Sorry, automatically installing external python libs in python will be implemented in the future. Meanwhile, you can do the following:
Open a terminal window as administrator: Right click on the “Command Prompt” shortcut from the start menu and choose “Run as administrator”
Change the directory to “C:\Program Files\Blender Foundation\Blender\2.79\python”.
Run “bin\python.exe C:\Users\Jhon\Desktop\mmvt\mmvt_root\mmvt_code\resources\get-pip.py”
Run “Scripts\pip install matplotlib zmq pizco scipy mne joblib tqdm nibabel pdfkit decorator Pillow scikit-learn gitpython”
Setup Script Steps
Installation of all the necessary python libraries.
If the script won’t find the Blender installation, it’ll ask you to locate it.
In default, the script will create all its folders under the mmvt_root folder, unless you set the -d flag to 0. If so, it will ask you where to create the following folders (in brackets the folder’s default name):
mmvt (“mmvt_blend”): The folder where you all the MMVT files are going to be stored. The blender files (*.blend) will be placed in this folder. For each subject, a folder will be created and the output of the preprocessing scripts will be stored in that folder.
meg (“meg”) / eeg (“eeg”) / fMRI (“fMRI”) / electrodes (“electrodes”): Where you are going to store the different data files. For the modalities you aren’t going to use, just press cancel.
After Running the Setup Script
Create a script for running Blender from the terminal. You can find such a script in the mmvt_code/misc/mmvt.bat.
Try to run it. If it works, just create a shortcut to this file. Place the shortcut on your Desktop, and change the icon to the icon located in mmvt_code/misc/bleder.ico.
If the bat file doesn’t work, you’ll need to change the location of blender.exe in the bat file. Don’t change it in place. First, copy it to a different folder which isn’t under mmvt_code folder, and only then creates the shortcut.
You can find more information about how to run Blender from the terminal here.
How to Create the Links Manually
In case you don’t want to use the gui for selecting your folders, before running the setup, run this command:
python -m src.setup -f create_links_csv
That will create the skeleton for the links.csv file in the links folder. Edit it manually, and run the setup.
Installing the Necessary Python Libraries
If you don’t have python (3.6 and above) installed, install python 3.6 from here.
You need to run the mmvt setup with the new python you’ve just installed (or with the python 3.6 and above you’ve already have installed). To find where the python.exe is located, open “Python 3.6 (64/32-bit)” application (or the already installed one), and write this command:
import os, sys; os.path.dirname(sys.executable)
The directory supposes to be something like: “C:\Users\your_user_name\AppData\Local\Programs\Python\Python36”.
Open the command prompt (run -> cmd), cd to the mmvt-code folder and run the mmvt setup:
python-dir\python -m src.setup
where python-dir is the folder where python is installed.
Help
First, you can find help by running the setup with the -h flag:
python -m src.setup -h
Here are the optional flags:
-f : If you wish to run a specific step (or steps), you can use the -f flag with one of more of these options: install_reqs, create_links, copy_resources_files and install_addon. If you set more than one, use commas without space (-f install_reqs,create_links for example).
-d : If you set it to 1 (default), the setup will use the default folders locations (see Links section). If not, you’ll be asked to set the folders locations.
-g : If 1 (default), and -d is 0, you’ll be able to choose the locations of the folders using a GUI. If not, you’ll be using the command prompt.This option won’t work without installing first the external libraries (install_reqs step).
Links
Under the mmvt_root folder, you can find the links folder. The setup will create all its folders under the mmvt_root folder (unless you set the -d flag to 0, and chose a different location) and set the links to those folders. Beside of creating the actual links, a links.csv file will be created, storing the links locations. When trying to find those folders, MMVT first tries to access the links. If a link is broken or doesn’t exist MMVT will try to read it from the csv file. Worse case scenario, you can delete all the links (if exist), and just manually set the links.csv and re-run setup with the -f install_addon flag:
python -m src.setup -f install_addon
Problems with Creating the Link to Blender
One of the links is to Blender folder, where the Blender executable file is placed. In such a case, you can finish the set, set this link manually (or just edit the links.csv file) and re-run the setup just to install the MMVT addon inside Blender:
python -m src.setup -f install_addon
Problems with Installing the External Python Libraries
That can happen usually because of a bad internet connection or a firewall. If you don’t install the external libraries you’ll be able only to open existing MMVT (blend) files. You also can’t use the GUI of the setup to choose the folders locations. Don’t set the -d flag to 0, run the setup, and after that, you can manually change the links or the links.csv.