The 3D Slicer is a modern biomedical image processing and analysis software based on ITK and VTK libraries. It is an open source, and can be extended with plugins. Developing new modules, though, demands building the Slicer from the source code.
To say the truth, building Slicer in Windows (especially 64 bit Windows) is a pain. The official installation Wiki page is useful, but gives too many variants and options and jumping from one place to another with different prerequisites, prerequisites of prerequisites, etc., and finally forgets to tell you about essential Visual Studio switches. The result is: after a half day of building, you get between 1 to 5 unsuccessful builds…Who knows why…
After endless trials of installing different versions of different prerequisite softwares, here is my first successful installation list (VERY IMPORTANT to use the suggested software versions, and not newer versions):
- Install the newest version of Git.
- Install the newest version of SilkSVN.
- Install QT 4.7.4 (32 bit binary).
- Install VS 2008 Express with SP1.
- Install the newest version of CMake.
- Open the Windows file explorer and create the directory: C:\Slicer4
- Go to C:\ root directory, and press right mouse button. Choose Git Bash. When black terminal window opens, write and run:
svn co http://svn.slicer.org/Slicer4/trunk Slicer4
- At this stage, the directory C:\Slicer4 should have all the source code of slicer.
- Go to Slicer4 directory, and create there Slicer4-Superbuild directory.
- Run CMake-GUI.
- Select…Where is the source code: C:\Slicer4
- Select…Where to build the binaries: C:\Slicer4\Slicer4-Superbuild
- Press Configure and select the generator Visual Studio 9 2008 (NOT Win64). If all the previous softwares were installed and configured properly, this step should run without any error messages, and give you a few selected red-background lines in the upper part of the GUI. If errors occur, this is probably because the system’s PATH is not updated properly (all binaries of all aforementioned programs should be included in the PATH variable.
- Press Configure once or twice until all the red disappears.
- Press Generate, and close CMake after the successful solution generation.
- Go to C:\Slicer4\Slicer4-Superbuild directory and open Slicer.sln with VS2008.
- When the project opens, select “Release” option instead of “Debug” on the upper toolbar (important!). Note that the built solution should be Win32 even when compiled on x64 machine and Win64.
- Build the solution. Hopefully, after a few hours of compiling, this should create a workable version of Slicer.
- Once I’ve receive error for NUMPY build, and it was resolved by manually creating an empty NUMPY directory in the Slicer4-Superbuild directory, and recompiling.