Miind
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Workflow

Getting Started

Basically there are two work flows:

In the former case you will not have to deal with C++ directly and even experienced C++ programs may find the XML files easier to handle than to program in C++. It is certainly recommended for a first try, even if you intend to use C++.

We recommend that you do the install in a local directory. MIIND is small. If you have worked through the installation successfully (see intstallation), you will have a top directory for miind in the location where you installed it, and withing this directory an 'app', 'libs and 'python' directory. You will also have created a 'build' directory yourself. Upon successful compilation, the 'build' directory itself will contain an 'apps' directory, which contains a 'BasicDemos' directory that reflects the structure of the source files in the 'apps' directory under the top level.

Now go to the 'python' directory under the top domain. Run 'python miind.py', in the in the 'apps/BasicDemos' directory the file miind.cpp has been newly generated. Go to the 'build' directory under the top domain. Type 'make'. A new executable, 'miind' will appear in the 'build/apps/BasicDemos' directory. You should be able to run this by typing './miind' in that directory.

You may now go back to the top-level 'python' directory and make changes to the XML file and repeat the process. You have then succesfully created your first MIIND simulation.

For a discussion of the structure of the XML file see An XML Example.

Analyzing the results

Running the miind executable will produce a '.root' file. You can analyse the results conveniently in Python, using either the ROOT objects directly, or converting them into numpy obejcts that can be analysed in numpy, scipy and visualized with Matplotlib.

Copy the root file to a directory of your choice. Make sure that the PYTHONPATH variable is set to pick up the ROOT module.

Open a Python shell in your favouring Python environment and type:

import ROOT

If this does not generate errors, you are in business. Now open the file:

f=ROOT.TFile('yourfile.root')

You can inspect the file:

f.ls()

You will get a list of names of TGraph objects. To get them from the file, do, for example:

g=f.Get('rate_1')
g.Draw('AP')

A canvas with the firing rate graph should now pop up.

ROOT is a very powerful analysis environment, with more extensive visualization capabilities than Matplotlib, but nothing prevents you from using SciPy for your analysis. Consider:

x_buff = data.GetX()
y_buff = data.GetY()
N = data.GetN()
x_buff.SetSize(N)
y_buff.SetSize(N)
# Create numpy arrays from buffers, copy to prevent data loss
x_arr = np.array(x_buff,copy=True)
y_arr = np.array(y_buff,copy=True)

Here is a brief introduction to PyROOT.

Create and Run a C++ Program

It is easiest to replace an existing program, for example, miind.cpp which can be found in the apps/BasicDemos directory. Once the required changes have been made, proceed to the 'build' directory, which you had to make during Installation. Type 'make' and the modified C++ program should compile and link. Under the 'build' directory, there will be an 'apps/BasicDemos' directory that will contain the new 'miind' executable.

Analyze it as described in Analyzing the results.