How to build the software

This page just explains how to build the software needed for OpenSPIM. For an overview of the source code, please have a look at this page.

= Obtaining the source code =

The easy way
First, make sure you have your camera driver installed!

Download & run the OpenSPIM development environment installer. This will set up everything you need and perform the initial build.

Manually
First, make sure you have your camera driver installed!

You need Git
First of all, you need to make sure that you have the version control software Git installed. If in doubt, just install Git for Windows.

Cloning the Micro-Manager and support sources
Wherever you like, e.g. in your home directory, call these commands:


 * 1) git clone git://github.com/openspim/micromanager
 * 2) git clone git://github.com/openspim/3rdpartypublic

Setting JAVA_HOME
Make sure that the environment variable JAVA_HOME is set and points to a valid JDK (you can add environment variables by right-clicking on the "Start" menu button, choosing "Open Windows Explorer", opening the context menu of "My Computer", selecting "Properties" and in the "Advanced mode" click on the "Environment variables" button. You need to restart the Visual Studio after adding the environment variable).

= Building Micro-Manager =

After installing Visual Studio Express 2008, continue as described on the uManager Wiki.

Why Microsoft Visual C++?
There exists a free and Open Source alternative to Microsoft Visual C++: GNU C++.

Unfortunately, it is impossible to build µManager on Windows with the GNU C++ compiler. The reason is that Microsoft Visual C++ uses an Application Binary Interface (ABI) which predates, and is incompatible with, the standard defined by the C++ consortium, but GNU C++ abides by the standard. All of the shared libraries provided by vendors were compiled for Microsoft Visual C++, though, so linking using GNU C++ is impossible.

= µManager scripting/plugins =

One of the coolest things in µManager is the Beanshell Scripting support. You can launch it through the Tools>Script Panel menu item. Those Beanshell scripts can interact with the GUI of µManager through the global gui variable which is actually an instance of org.micromanager.MMStudioMainFrame, and with the MMCore through the global mmc variable which is an instance of mmcorej.CMMCore (the binding to the C++ core).

When prototyping, it is best to start out with Beanshell scripts and once things get polished enough, turn them into µManager plugins. Such plugins are connected to the µManager application through the method setApp which must be implemented when implementing the org.micromanager.api.MMPlugin interface. This method is passed an instance of org.micromanager.api.ScriptInterface which has a method getMMCore. Unfortunately, it has no method to retrieve a reference to the MMStudioMainFrame, but you can use the static method getInstance of said class to retrieve the singleton.

To provide ease of transition between scripting and plugin coding, we do the following in the OpenSPIM plugin: we have two fields, unsurprisingly called mmc and gui, which are initialized in the setApp method.

= Debugging =

See the Frequently Asked Questions.

= Further reading =

A birds-eye view of the OpenSPIM source code