https://public.kitware.com/Wiki/api.php?action=feedcontributions&user=Blowekamp&feedformat=atomKitwarePublic - User contributions [en]2024-03-28T17:32:47ZUser contributionsMediaWiki 1.38.6https://public.kitware.com/Wiki/index.php?title=SimpleITK/GettingStarted/A_visual_guide_to_SimpleITK_with_CSharp&diff=63993SimpleITK/GettingStarted/A visual guide to SimpleITK with CSharp2019-12-13T18:18:44Z<p>Blowekamp: </p>
<hr />
<div>{{SimpleITKMigrationHeader}}<br />
<br />
[[Image: Simpleitk_logo.png|center]]<br />
<br />
In this guide we will show how to setup a C# project in Microsoft Visual Studio 2012 which uses the available built binaries for SimpleITK. The same steps and options are needed for the other versions of Visual Studio.<br />
<br />
=Download=<br />
<br />
{|<br />
|<br />
| [[Image:SimpleITK_vs_csharp_visual_fig1.PNG|left|200px|thumb|Download an unzip the CSharp distribution.]]<br />
Binary downloads are readily available for C# for Microsoft Visual Studio. They are available on [https://sourceforge.net/projects/simpleitk/files/SimpleITK/ SourceForge].<br />
<br />
* Download the correct binary for you architecture you are going to target.<br />
<br />
C# for SimpleITK has two components: Native and Managed. The native code contains the SimpleITK C++ library and is compiled for the particular architecture. There is the "win32" for the Intel x86 32-bit architecture, and the "win64" for the Intel x64 architecture. The correct architecture needs to be chosen.<br />
<br />
* Unzip the downloaded zip file into your "Documents" folder.<br />
<br />
Inside you will find two "dll" files: "SimpleITKCSharpManaged.dll" and "SimpleITKCSharpNative.dll", as well as some documentation files.<br />
|}<br />
<br />
=Adding C# SimpleITK to a Project=<br />
<br />
{|<br />
|<br />
|[[Image:SimpleITK_vs_csharp_visual_fig2.PNG|left|200px|thumb|Create a C# Console Application.]]<br />
We will start off with a new C# console solution. <br />
<br />
* This is created by selecting "File->New->Project", then selecting under Templates "Visual C#" and then choosing the "Console Application".<br />
<br />
|}<br />
<br />
<br />
==Select Architecture==<br />
<br />
{|<br />
|[[Image:SimpleITK_vs_csharp_visual_fig3a.PNG|left|200px|thumb|The default configuration and platform in the toolbar.]]<br />
|<br />
The SimpleITK binary only supports a single architecture platform. Your project should be configured to match that same platform.<br />
<br />
By default, in the Toolbar "Debug" is selected for the Solution Configuration and "Any CPU" is selected for the Solution Platform, this needs to be changed.<br />
|-<br />
|[[Image:SimpleITK_vs_csharp_visual_fig3b.PNG|left|200px|thumb|The Configuration Manager.]]<br />
|<br />
<br />
* Bring up the "Configuration Manager" dialog from the menu "BUILD->Configuration Manger...".<br />
<br />
* The architecture of the SimpleITK binary needs to be added, and the "Any CPU" architecture needs to be removed. This needs to be done for both the "Active solution platforms" and the "Platform".<br />
<br />
|}<br />
<br />
<br />
==Add Managed Library==<br />
<br />
{|<br />
|[[File:SimpleITK_vs_csharp_visual_fig4.PNG|left|200px|thumb|Adding managed library as reference.]]<br />
|<br />
* From the menu bar select "PROJECT->Add Reference..." to bring up the Reference Manager. Click "Browse..." and navigate the file system to unzip "SimpleITKCSharpManaged.dll" from the binary download, then click OK to add.<br />
|}<br />
<br />
==Add Native Library==<br />
<br />
{|<br />
|[[File:SimpleITK_vs_csharp_visual_fig5a.PNG|left|200px|thumb|Adding Native Library]]<br />
|<br />
* From the menu bar select "PROJECT->Add Existing Item...". Select "Executable Files" for the extension type. Then navigate the file system to the unzipped "SimpleITKCSharpNative.dll" file from the binary download. *IMPORTANT* in the "Add" button's pull down menu select "Add As Link". <br />
|-<br />
|[[File:SimpleITK_vs_csharp_visual_fig5b.PNG|left|200px|thumb|Configuring properties of native library.]]<br />
|<br />
* In the Solution Explorer right click on the "SimpleITKCSharpNative.dll", and select "Properties".<br />
* Then for "Build Action", choose "Content", and "Copy to OutputDirectory" choose "Copy always".<br />
|}<br />
<br />
=Building an Example=<br />
<br />
{|<br />
|<br />
|[[File:SimpleITK_vs_csharp_visual_fig6.PNG|left|200px|thumb|A successful build of the example.]]<br />
* Now that we have configured the project, let up copy a basic SimpleITK example to compile and run. The [https://github.com/SimpleITK/SimpleITK/blob/master/Examples/SimpleGaussian.cs SimpleGaussian in C#] is a simple one to test our configuration. This can just be copied and pasted into the code editor.<br />
<br />
* Then from the file menu "BUILD->Build Solution" can be selected.<br />
<br />
If all the steps were followed correctly you should now have an executable which can be run from the command line or from within Visual Studio with the appropriate arguments provided.<br />
|}</div>Blowekamphttps://public.kitware.com/Wiki/index.php?title=SimpleITK/GettingStarted/A_visual_guide_to_SimpleITK_in_Java&diff=63992SimpleITK/GettingStarted/A visual guide to SimpleITK in Java2019-12-13T18:18:24Z<p>Blowekamp: </p>
<hr />
<div>{{SimpleITKMigrationHeader}}<br />
<br />
[[Image: Simpleitk_logo.png|center]]<br />
<br />
== Java ==<br />
<br />
<br />
Java and SimpleITK are a natural fit. Like the bindings of other languages wrapped by SimpleITK, SimpleITK's Java bindings have a language-specific component (traditional Jar file), and a native component (native shared library). This combination requires a little more setup, but is largely transparent to the developer.<br />
<br />
=== Eclipse setup ===<br />
<br />
Download [http://www.eclipse.org Eclipse] and install it on the platform of your choice. Eclipse is a commonly used integrated development environment (IDE) for Java, and makes development, debugging and deployment particularly streamlined.<br />
<br />
The first step in developing for SimpleITK's Java bindings is to create a new project in Eclipse. Simply choose ''File --> New --> Project...'', choosing ''Java Project'' in the Eclipse project wizard dialog, and name the project as you like. In this example, our project is called ''SimpleITK Demo''.<br />
Create a new class by choosing ''File --> New --> Class'', or simply copy the code below and paste into the project item in the ''Package Explorer'' view and Eclipse will automatically create the class and hierarchy for you.<br />
<br />
=== GaussianExample ===<br />
<br />
Here is our first class <code>Code/GaussianExample.java</code><br />
<br />
<pre><br />
package org.itk.simple.example;<br />
<br />
import org.itk.simple.Image;<br />
import org.itk.simple.SimpleITK;<br />
<br />
public class GaussianExample {<br />
<br />
/**<br />
* @param args<br />
*/<br />
public static void main(String[] args) {<br />
<br />
if (args.length < 2) {<br />
System.err.println("Usage: 'Gaussian <input> <output>'");<br />
System.exit(1);<br />
}<br />
System.out.println("Starting to blur " + args[0]);<br />
// Grab a file<br />
Image image = SimpleITK.readImage(args[0]);<br />
Image output = SimpleITK.discreteGaussian(image);<br />
SimpleITK.writeImage(output, args[1]);<br />
System.out.println("Finished blurring, writing to " + args[1]);<br />
<br />
}<br />
<br />
}<br />
</pre><br />
<br />
If Eclipse is working as expected, you should see errors on lines 19-21. These errors occurs because we have not told Eclipse where to find SimpleITK's jar file.<br />
<br />
=== Adding SimpleITK to the Build Path ===<br />
<br />
Right click on the project in the ''Package Explorer'' view and choose ''Build Path --> Configure Build Path...''.<br />
<center>[[File:ChangeBuildPath.dropshadow.png|Change Build Path]]</center><br />
<center>Change Build Path</center><br />
<br />
=== Configure the Build Path for our Eclipse project ===<br />
<br />
In the ''Properties'' dialog, click on ''Add External JARs...'' and navigate to the SimpleITK jar file. When selected, click the down arrow to expose the options for the jar.<br />
<br />
<center>[[File:BuildPathSettings.dropshadow.png|SimpleITK jar configuration]]</center><br />
<center>SimpleITK jar configuration</center><br />
<br />
<br />
<br />
The three options of interest are: ''Source attachment'', ''Javdoc location'' and ''Native library location''. The ''Source attachment'' specifies where the source code for the SimpleITK jar file resides. In our case, it is distributed as ''simpleitk-source.x.x.x.jar'' where ''x.x.x'' is the version number of SimpleITK. The source attachment is useful for debugging the SimpleITK library, if necessary, because it allows the debugger to step through classes provided in the SimpleITK jar file. This setting is optional.<br />
<br />
The ''Javadoc location'' is also optional, but extremely helpful in developing with Java. Having Javadoc available provides Eclipse with in-line documentation for each function, if provided. We highly recommend supplying the Javadoc location to Eclipse.<br />
<br />
The last option, ''Native library location'' is required. Because SimpleITK is a C++ library, all functionality is provided through the ''JNI (Java Native Interface)'' specification. When the SimpleITK classes are loaded, a static block loads the native library to provide all the functionality to Java. This option tells Eclipse where to search for the library; without it a ''UnsatisfiedLinkError'' is thrown:<br />
<pre><br />
Exception in thread "main" java.lang.UnsatisfiedLinkError: no SimpleITKJava in java.library.path<br />
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1758)<br />
at java.lang.Runtime.loadLibrary0(Runtime.java:823)<br />
at java.lang.System.loadLibrary(System.java:1045)<br />
at org.itk.simple.SimpleITKJNI.<clinit>(SimpleITKJNI.java:62)<br />
at org.itk.simple.SimpleITK.readImage(SimpleITK.java:33)<br />
at org.itk.simple.example.GaussianExample.main(GaussianExample.java:19)<br />
</pre><br />
<br />
Set the ''Native library location'' to the directory containing the platform specific JNI library, i.e. ''libSimpleITKJava.jnilib'' on Mac OSX, ''libSimpleITKJava.so'' on Linux and ''SimpleITKJava.dll'' on Windows. After providing the library location, our example code runs correctly. When running this example from the command line, the native library location needs to be specified to the JVM, e.g. <code>-Djava.library.path=/path/to/SimpleITKRuntime</code>.<br />
<br />
=== SimpleITK Java Conventions ===<br />
<br />
The SimpleITK Java bindings closely follow the C++ conventions, i.e. each class contains the public member functions. However, the functional interface is handled differently in Java. In particular, every static Java function must belong to a class, unlike C++. In SimpleITK, the functional interface is contained in a class called ''org.itk.simple.SimpleITK''. This class contains the functional interfaces as static member functions, i.e. ''org.itk.simple.SimpleITK.readImage'' as shown [[#GaussianExample|in the example]]. The naming conventions for all SimpleITK classes follows the C++ conventions, but member functions and the function interface follow the Java conventions of using ''CamelCase'' with the first letter lowercase. In Java, the C++ function ''::itk::simple::ReadImage'' becomes ''org.itk.simple.SimpleITK.readImage''.</div>Blowekamphttps://public.kitware.com/Wiki/index.php?title=SimpleITK/GettingStarted/Visual_guide_to_building_on_Linux&diff=63991SimpleITK/GettingStarted/Visual guide to building on Linux2019-12-13T18:17:55Z<p>Blowekamp: </p>
<hr />
<div>{{SimpleITKMigrationHeader}}<br />
<br />
[[Image: Simpleitk_logo.png|center]]<br />
This guide gives detailed instructions for building SimpleITK on Linux. It is written for beginners getting started with SimpleITK. There are examples of how to develop and execute simple programs in C Sharp and Lua.<br />
<br />
== Why Linux? ==<br />
* Linux is freely available<br />
* It has all the required tools<br />
* Did I mention it's free?<br />
<br />
== Step 1: Get Linux ==<br />
The first step is to install a Linux distribution. Some popular ones are:<br />
* [http://www.ubuntu.com/download Ubuntu]<br />
* [http://www.linuxmint.com/download.php Linux Mint]<br />
* [http://www.debian.org/ Debian]<br />
<br />
And here is a [http://www.makeuseof.com/tag/debian-ubuntu-linux-mint-distribution/ comparison of those distributions].<br />
<br />
There are many online tutorials explaining how to install your chosen Linux distribution:<br />
*Ubuntu<br />
** [https://help.ubuntu.com/community/Installation Ubuntu Installation guide]<br />
** [http://www.youtube.com/watch?v=GhnLk3gviWY Learn How to Install Ubuntu Linux in 5 Minutes (youtube)]<br />
** [https://seogadget.co.uk/the-ubuntu-installation-guide The Ubuntu Installation Guide (with pictures)]<br />
*Mint<br />
** [http://www.linuxmint.com/documentation/user-guide/english_15.0.pdf Linux Mint User Guide (English)]<br />
** [http://www.howtogeek.com/howto/20079/install-linux-mint-on-your-windows-computer-or-netbook/ Install Linux Mint on your Windows computer (howtogeek)]<br />
** [http://www.youtube.com/watch?v=7IK35nZuTlk How to Install Linux Mint (youtube)]<br />
*Debian<br />
** [https://www.youtube.com/watch?v=TIuOFqQ-XTk Debian 7 Installation (youtube)]<br />
** [http://www.wikihow.com/Install-Debian Install Debian]<br />
<br />
If you are a Windows user, you may consider running Linux on a virtual machine. Some popular virtual machine environments are:<br />
* [https://www.virtualbox.org/ VirtualBox]<br />
* [http://www.vmware.com/ VMWare]<br />
<br />
If you are a Mac OS X user, you can also run Linux in a virtual machine. Two virtual machine environments for OS X are:<br />
* [http://www.parallels.com/products/desktop/ Parallels]<br />
* [http://www.vmware.com/products/fusion/ VMWare Fusion]<br />
<br />
Again, there are heaps of tutorials:<br />
* [http://www.psychocats.net/ubuntu/virtualbox Installing Ubuntu inside Windows using VirtualBox]<br />
* [http://www.wikihow.com/Install-Ubuntu-on-VirtualBox How to Install Ubuntu on VirtualBox]<br />
* [http://www.zealfortechnology.com/2014/03/install-linux-mint-16-on-virtualbox.html Install Mint 16 on VirtualBox]<br />
* [http://www.youtube.com/watch?v=D-NYWSoiaTg How to Install Linux Mint in Virtualbox (youtube)]<br />
<br />
This guide uses Debian 7, but the steps are very similar for other Linux distributions.<br />
<br />
== Step 2: Install build tools ==<br />
{| valign="top"<br />
|- valign="top" <br />
| The next step is to install the required build tools.<br />
<br />
Open a terminal window (Application Menu > Terminal Emulator) and run the following command:<br />
sudo apt-get install cmake cmake-curses-gui gcc g++ git<br />
<br />
Confirm that you want to install the packages (press "y"), then wait for the installation to complete.<br />
<br />
Alternatively, you could manually select each software package from the [http://www.nongnu.org/synaptic/ Synaptic Package Manager] (Application Menu > Settings > Synaptic Package Manager).<br />
<br />
By default building SimpleITK produces the SimpleITK [http://en.wikipedia.org/wiki/C%2B%2B C++] libraries and the SimpleITK [http://en.wikipedia.org/wiki/Lua_(programming_language) Lua] interpreter. It also supports bindings for other languages. To build this support, additional packages need to be installed. The following table shows the supported language bindings and the corresponding command to install the additional packages required for each language.<br />
<br />
{| border=1<br />
|-<br />
! Programming Language<br />
! Command to install the build tools<br />
|-<br />
| [http://en.wikipedia.org/wiki/C_Sharp_(programming_language) C#]<br />
| sudo apt-get install monodevelop<br />
|-<br />
| [http://en.wikipedia.org/wiki/Java_(programming_language) Java]<br />
| sudo apt-get install eclipse<br />
|-<br />
| [http://en.wikipedia.org/wiki/R_programming_language R]<br />
| sudo apt-get install r-base r-base-dev<br />
|-<br />
| [http://en.wikipedia.org/wiki/Ruby_(programming_language) Ruby]<br />
| sudo apt-get install ruby<br />
|-<br />
| [http://en.wikipedia.org/wiki/Python_(programming_language) Python]<br />
| sudo apt-get install python python-dev<br />
|-<br />
| [http://en.wikipedia.org/wiki/Tcl Tcl]<br />
| sudo apt-get install tcl tcl-dev tk tk-dev<br />
|-<br />
| All languages<br />
| sudo apt-get install monodevelop eclipse r-base r-base-dev ruby python python-dev tcl tcl-dev tk tk-dev<br />
|}<br />
<br />
|[[File:SimpleITK_visual_guide_step02_01.png|200px|thumb|Install the build tools by opening the terminal]]<br />
[[File:SimpleITK_visual_guide_step02_02.png|200px|thumb|In the terminal, use apt-get to install the build tools]]<br />
[[File:SimpleITK_visual_guide_step02_03.png|200px|thumb|Build tools could also be installed using the software manager]]<br />
|}<br />
<br />
== Step 3: Get SimpleITK source code ==<br />
{|<br />
|<br />
The next step is to get the SimpleITK source code using git.<br />
<br />
Decide where you want to put the source code. I'm putting mine in my home directory:<br />
cd ~<br />
<br />
Now download the SimpleITK source code, by entering the following command in the Terminal:<br />
git clone --recursive http://itk.org/SimpleITK.git<br />
<br />
Now change to the SimpleITK directory:<br />
cd SimpleITK<br />
<br />
| [[File:SimpleITK_visual_guide_step03_02.png|200px|thumb|Get the SimpleITK source code using <code>git</code>]]<br />
|}<br />
<br />
== Step 4: Build SimpleITK ==<br />
The next step is to start building.<br />
<br />
The recommended way to build is via the so-called "super build". The build directory should not be inside the source tree. I put the build directory in the same directory as the source tree.<br />
cd ~<br />
mkdir SimpleITK-build<br />
cd SimpleITK-build<br />
cmake ../SimpleITK/SuperBuild<br />
<br />
The SuperBuild generates make files which takes care of downloading and building ITK, SWIG, and Lua, as well as SimpleITK.<br />
<br />
To start the (long) build process, type:<br />
make<br />
<br />
On my test system, a 4 core virtual machine with 16 GB of RAM, the build took just over an hour.<br />
<br />
After the build is finished, you need to add SimpleITK to your <code>LD_LIBRARY_PATH</code>:<br />
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/SimpleITK-build/lib<br />
<br />
You can now (optionally) check whether the build was successful:<br />
cd ~/SimpleITK-build<br />
ctest<br />
<br />
All (or at least most) of the tests should pass.<br />
<br />
== Step 5: Use SimpleITK ==<br />
<br />
SimpleITK is available to a variety of languages. In this section we give simple example programs demonstrating the SimpleITK API in C Sharp and Lua.<br />
<br />
=== A simple C# program ===<br />
{|<br />
|- valign="top"<br />
| This sub-section will describe how to create a simple C# application using SimpleITK from MonoDevelop.<br />
To start launch the C# development environment, MonoDevelop (Application Menu > Development > MonoDevelop).<br />
| [[File:SimpleITK_visual_guide_step05_CSharp_01.png|200px|thumb|Open MonoDevelop]]<br />
|-<br />
| Then create our new Solution (Select File > New > Solution).<br />
|-<br />
|Select a C# console project (C# > Console Project). Enter a suitable name e.g. "sitk" and uncheck "Create directory for directory". Select "Forward" and then "OK".<br />
| [[File:SimpleITK_visual_guide_step05_CSharp_02.png|200px|thumb|Create Console Project]]<br />
|-<br />
| In the Solution explorer, right-click "Selection" and select "Edit References...".<br />
| [[File:SimpleITK_visual_guide_step05_CSharp_03.png|200px|thumb|Edit References]]<br />
|-<br />
| Select the ".Net Assembly" tab, navigate to "~/SimpleITK-build/SimpleITK-build/Wrapping/CSharpBinaries", select "SimpleITKCSharpManaged.dll", click "Add", and then close the window by selecting "OK". This will copy "SimpleITKCSharpManaged.dll" to your build directory e.g. "bin/Debug" or "bin/Release". <br />
| [[File:SimpleITK_visual_guide_step05_CSharp_04.png|200px|thumb|Add SimpleITKCSharpManaged.dll]]<br />
|-<br />
| You must also '''manually copy''' "libSimpleITKCSharpNative.so" to your build directories:<br />
mkdir ~/sitk/bin/Debug<br />
mkdir ~/sitk/bin/Release<br />
cp ~/SimpleITK-build/SimpleITK-build/Wrapping/CSharpBinaries/libSimpleITKCSharpNative.so ~/sitk/bin/Debug<br />
cp ~/SimpleITK-build/SimpleITK-build/Wrapping/CSharpBinaries/libSimpleITKCSharpNative.so ~/sitk/bin/Release<br />
<br />
SimpleITK has now been added as a project reference.<br />
|-<br />
| The following short program creates an image of a Gaussian blob, generates a derivative image from the Gaussian, scales and windows the derivative's intensities, converts the result to 8-bit unsigned ints, and writes out a PNG file:<br />
<br />
using System;<br />
using sitk = itk.simple.SimpleITK;<br />
<br />
namespace itk.simple<br />
{<br />
class MainClass<br />
{<br />
public static void Main (string[] args)<br />
{<br />
var size = new VectorUInt32 (new uint[] { 128, 128 });<br />
var sigma = new VectorDouble (new Double[] { 32.0, 32.0 });<br />
var center = new VectorDouble (new Double[] { 64.0, 64.0 });<br />
<br />
var gauss = sitk.GaussianSource (PixelIDValueEnum.sitkFloat32, size, sigma, center);<br />
<br />
var deriv = sitk.Cast (128.0 + 24.0 * sitk.Derivative (gauss), PixelIDValueEnum.sitkUInt8);<br />
<br />
sitk.WriteImage (deriv, "gauss-deriv-test.png");<br />
}<br />
}<br />
}<br />
| [[File:SimpleITK_visual_guide_step05_CSharp_05.png|200px|thumb|A simple C# program]]<br />
|-<br />
| Note that in the example, the derivative image's intensities are scaled mathematically to illustrate SimpleITK's overloading of the mathematically operators. The image intensities could also be scaled using SimpleITK's RescaleIntesity function.<br />
<br />
To build the project press "F8" or select Build > Build All from the menu.<br />
<br />
To debug the project, add a breakpoint at a desired location and press "F5".<br />
<br />
The Gaussian Derivative image to the right shows the results of the C# example program.<br />
| [[File:SimpleITK_visual_guide_step05_CSharp_06.png|200px|thumb|Gaussian Derivative image]]<br />
|}<br />
<br />
=== Using Lua ===<br />
[http://www.lua.org/about.html Lua] is a fast, portable, lightweight scripting language that is included with the SimpleITK source code. Because the entire source code for Lua is less than 600kb, it takes very little space relative to large projects such as SimpleITK. That makes Lua very popular as an embedded scripting language.<br />
<br />
In this SimpleITK/Lua example we show how to use a text editor to produce a SimpleITK example in Lua and execute the program.<br />
<br />
[[File:SimpleITK_visual_guide_step05_Lua01.png|200px|thumb|Open Mousepad]]<br />
<br />
By default, Debian with the Xfce user interface, comes with '''Mousepad''' (Application Menu > Accessories > Mousepad), a simple text editor. Other possible editors include '''gedit''' with Gnome or '''kedit''' with KDE.<br />
<br />
<br />
[[File:SimpleITK_visual_guide_step05_Lua_02.png|200px|thumb|Simple Lua Program]]<br />
The following is a simple Lua example similar to the C# example in the previous section. This program creates an image of a Gaussian blob, computes a derivative image of the Gaussian, rescales the floating point image to 0-255, casts it to a unsigned char image, and writes the result to a PNG file.<br />
<br />
local sitk = {}<br />
sitk = SimpleITK<br />
<br />
size = sitk.VectorUInt32();<br />
size:push_back(128);<br />
size:push_back(128);<br />
<br />
sigma = sitk.VectorDouble();<br />
sigma:push_back(32.0);<br />
sigma:push_back(32.0);<br />
<br />
center = sitk.VectorDouble();<br />
center:push_back(64.0);<br />
center:push_back(64.0);<br />
<br />
gauss = sitk.GaussianSource (sitk.sitkFloat32, size, sigma, center);<br />
<br />
deriv = sitk.Derivative(gauss);<br />
<br />
result = sitk.RescaleIntensity(deriv, 0, 255.0)<br />
<br />
result = sitk.Cast(result, sitk.sitkUInt8)<br />
<br />
sitk.WriteImage(result, "sitk-lua-test.png");<br />
<br />
The script is slightly different than the C# example in that the RescaleIntensity filter is used. In C# mathematical operators are overloaded for SimpleITK images. This is not the case for Lua, so mathematical operations on SimpleITK images are a bit more complicated. Therefore I chose to use a built in filter.<br />
<br />
To try out the program, copy the code and paste it into Mousepad. Then Save it as "DerivativeExample.lua" and enter the following command in a Terminal window.<br />
<br />
~/SimpleITK-build/SimpleITK-build/bin/SimpleITKLua DerivativeExample.lua<br />
<br />
[[File:SimpleITK_visual_guide_step05_lua_03.png|200px|thumb|Lua Derivative image]]<br />
The Lua Derivative image on the right shows the output of the our SimpleITK Lua example. The result is similar to, although not the same as the C Sharp produced image. They are different because the image intensities are not scaled in the same manner.</div>Blowekamphttps://public.kitware.com/Wiki/index.php?title=SimpleITK&diff=63990SimpleITK2019-12-13T18:17:11Z<p>Blowekamp: </p>
<hr />
<div>{{SimpleITKMigrationHeader}}<br />
<br />
[[Image: SimpleITK-SquareTransparentLogo.png|center]]<br />
<br />
=Overview=<br />
<br />
Welcome to the National Library of Medicine Insight Segmentation and Registration Toolkit (ITK). [http://www.itk.org/ ITK] is an open-source, cross-platform system that provides developers with an extensive suite of software tools for image analysis. Among them, SimpleITK is a simplified layer built on top of ITK, intended to facilitate its use in rapid prototyping, education, interpreted languages. SimpleITK has the following main characteristics:<br />
<br />
* C++ library with wrappers for Python, Java, CSharp, R, Tcl and Ruby<br />
* Object-oriented<br />
* Provides a simplified, easy-to-use, procedural interface without templates<br />
* Is distributed under an open source Apache 2.0 License<br />
* Binary distributions for Python, Java and CSharp<br />
<br />
SimpleITK captures many of features available in ITK, and is under ongoing development. Earlier in the development process a set of [[SimpleITK/Goals|Specific Goals]] were outlined.<br />
<br />
= How to Cite =<br />
<br />
If you find SimpleITK useful in your research, please cite the relevant publications: <br />
<br />
* Lowekamp BC, Chen DT, Ibáñez L and Blezek D (2013) [http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3874546/pdf/fninf-07-00045.pdf The Design of SimpleITK]. Front. Neuroinform. 7:45. doi: 10.3389/fninf.2013.00045<br />
<br />
* Z. Yaniv, B. C. Lowekamp, H. J. Johnson, R. Beare, "SimpleITK Image-Analysis Notebooks: a Collaborative Environment for Education and Reproducible Research", J Digit Imaging., https://doi.org/10.1007/s10278-017-0037-8, 2017. (you can freely read the manuscript [http://em.rdcu.be/wf/click?upn=KP7O1RED-2BlD0F9LDqGVeSIWDx8-2B-2B8r81HkSA5fUW53U-3D_kZYp45lAKoeuSXKlMMKnLRu-2FO1jcvtAwo2UFz30PH9bPLAejS1IjjDkfGx8EIWfnvmrgAH2RF3xvrb1fezqultdVNEEAM7Fc2RGY-2BOVhjR-2BAN-2B7Wi6qUoM6BYtn1ZWsTzFdNZQxBXXJ2Nf0BaU5NhQLQVs2hoM2TXsKZ7pnKQXZVJEAOyLbQSvZkJOvdc7Gk36rdNDa3pn5vH17-2FvszYj4mKlZlgROxTE-2Be2yQ-2FOLAYsoDHZNvVuG4vJr4xNpQnmAI16Nz8h3GJi-2F9GKnpBsAg-3D-3D. here]) <br />
<br />
<br />
<br />
= Getting Started =<br />
<br />
* [[SimpleITK/GettingStarted|Getting Started For Users]]<br />
** [[SimpleITK/GettingStarted#Binaries|downloading the binaries]]<br />
** [[SimpleITK/GettingStarted#Build_It_Yourself|build the code yourself]]<br />
** [[SimpleITK/GettingStarted#Recommended_Software|additional software]] which is useful with SimpleITK<br />
* [[SimpleITK/GettingStarted/Visual_guide_to_building_on_Linux|A Visual Guide to Building SimpleITK on Linux]]<br />
* [[SimpleITK/GettingStarted/A_visual_guide_to_SimpleITK_in_Java|A Visual Guide to SimpleITK with Java and Eclipse]]<br />
* [[SimpleITK/GettingStarted/A_visual_guide_to_SimpleITK_with_CSharp|A Visual Guide to SimpleITK with CSharp on Microsoft Visual Studio]]<br />
<br />
== Download ==<br />
<br />
SimpleITK currently provides binary distribution for Python, CSharp and Java language bindings. <br />
You can download the [https://sourceforge.net/projects/simpleitk/files/SimpleITK/1.0.0/ 1.0.0 release from SourceForge].<br />
<br />
= Documentation =<br />
<br />
* [[SimpleITK/FAQ|Frequently Asked Questions (FAQ)]]<br />
<br />
== API ==<br />
<br />
* Nightly generated [https://www.itk.org/SimpleITKDoxygen/html/ Doxygen].<br />
* Release 1.0 [https://www.itk.org/SimpleITKDoxygen100/html/index.html Doxygen].<br />
* Release 0.10 [https://www.itk.org/SimpleITKDoxygen010/html/index.html Doxygen].<br />
* Release 0.9 [https://www.itk.org/SimpleITKDoxygen09/html/index.html Doxygen].<br />
* Release 0.8 [https://www.itk.org/SimpleITKDoxygen08/html/index.html Doxygen].<br />
* Release 0.7 [https://www.itk.org/SimpleITKDoxygen07/html/index.html Doxygen].<br />
* Release 0.6.1 [https://www.itk.org/SimpleITKDoxygen06/html/ Doxygen].<br />
<br />
== Short Examples ==<br />
<br />
Concise [https://itk.org/SimpleITKDoxygen/html/examples.html examples] illustrating the usage of various SimpleITK features. Examples are written in a variety of languages including Python, R, C++, Java...<br />
<br />
== SimpleITK Notebooks ==<br />
<br />
The SimpleITK Notebooks are examples and tutorials on how to use SimpleITK utilizing Jupyter Notebooks. This approach allows the user to create, edit and re-run scripts and view the results all within a web interface. The authoritative description of what Jupyter Notebooks are can be found on the [http://jupyter.org/ Jupyter website]. While SimpleITK supports a number of programming languages, the majority of notebooks are written in Python and some in R.<br />
<br />
The main notebook repository is available on [https://github.com/InsightSoftwareConsortium/SimpleITK-Notebooks github].<br />
<br />
Additional repositories containing tutorial specific notebooks are listed in the [http://www.itk.org/Wiki/SimpleITK#SimpleITK_Tutorials Tutorials section] below.<br />
<br />
== SimpleITK Tutorials ==<br />
<br />
=== Upcoming ===<br />
<br />
* SPIE Medical Imaging 2018, Houston TX, USA: [https://spie.org/MI/course/simpleitk-jupyter-notebooks-biomedical-image-analysis-in-python SimpleITK Jupyter Notebooks: Biomedical Image Analysis in Python].<br />
<br />
<br />
=== Past ===<br />
* The International Symposium on Biomedical Imaging (ISBI) 2016, Prague, Czech republic: [http://biomedicalimaging.org/2016/?page_id=572 SimpleITK: An Interactive, Python-Based Introduction to SimpleITK with the Insight Segmentation and Registration Toolkit (ITK)]<br />
* SPIE Medical Imaging 2016, San Diego, USA: ITK in Biomedical Research and Commercial Applications<br />
: Tutorial material: [https://github.com/InsightSoftwareConsortium/SimpleITKTutorialSPIE2016 git repository] [https://hdl.handle.net/10380/3542 additional presentations] .<br />
* Medical Image Computing and Computer Assisted Intervention (MICCAI) 2015, Munich, Germany: a Python based tutorial on the use of the [[SimpleITK/Tutorials/MICCAI2015 | ITKv4 registration framework via SimpleITK]].<br />
: Tutorial material: [https://github.com/InsightSoftwareConsortium/SimpleITKTutorialMICCAI2015.git git repository].<br />
* ImageJ User & Developer Conference 2015, Madison, WI, USA: [http://imagej.net/Conference_2015_Program#Matt_McCormick_-_SimpleITK an introductory tutorial] in Python. <br />
: Tutorial material: [https://github.com/InsightSoftwareConsortium/SimpleITKWorkshopImageJ2015 git repository]. <br />
* Medical Image Computing and Computer Assisted Intervention (MICCAI) 2011, Toronto, Canada: a general [[ITK_Release_4/Outreach/Conferences/MICCAI 2011/SimpleITK|tutorial on SimpleITK]]. <br />
: Tutorial material: [https://github.com/SimpleITK/SimpleITK-MICCAI-2011-Tutorial/blob/master/Presentation/SimpleITK-MICCAI-2011.pdf?raw=true PDF of presentation], [http://midas.kitware.com/collection/view/175 virtual machine], and [https://github.com/SimpleITK/SimpleITK-MICCAI-2011-Tutorial git repository].<br />
<br />
== Community Blogs ==<br />
<br />
These are blog entries written by people who are not necessarily directly involved with SimpleITK. If you want us to link to your SimpleITK blog entry just let us know on the mailing list (community@itk.org). <br />
<br />
* General introduction of SimpleITK on the [http://news.iscas.co/simpleitk-a-simplified-multi-language-interface-to-the-insight-segmentation-and-registration-toolkit/ International Society for Computer Aided Surgery blog], 1 March 2017.<br />
* [http://zarquon42b.github.io/2015/05/22/SimpleITKandR/ SimpleITK and R], 22 May 2015.<br />
* [http://kevin-keraudren.blogspot.com/2014/12/medical-image-analysis-ipython-tutorials.html Medical Image Analysis Course], 20 December 2014.<br />
* [https://pyscience.wordpress.com/tag/simpleitk Image Segmentation with Python and SimpleITK], October/November 2014.<br />
<br />
=Support=<br />
<br />
SimpleITK is supported through the ITK community and the active developers. In addition to the resources listed above in the documentation section, the [https://discourse.itk.org discourse forum] can be used to ask questions and obtain additional help from the ITK community. The legacy [http://www.itk.org/ITK/help/mailing.html ITK mailing lists] is no longer prefered.<br />
<br />
== Issue Tracking And Feature Requests ==<br />
<br />
We are currently using the [https://github.com/SimpleITK/SimpleITK/issues github issue tracker]. Before switching to github issue tracking we used an instance of the<br />
[https://itk.icts.uiowa.edu/jira/browse/SIMPLEITK Legacy Jira Issue Tracker ] hosted by the University of Iowa.<br />
<br />
== Releases ==<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=refs/tags/v1.0.1 v1.0.1] [https://github.com/SimpleITK/SimpleITK/releases/tag/v1.0.1 Release Notes] <br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=refs/tags/v1.0.0 v1.0.0] [https://github.com/SimpleITK/SimpleITK/releases/tag/v1.0.0 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/1.0.0 Downloads] [https://www.itk.org/SimpleITKDoxygen100/html/index.html Doxygen]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=4a3376df08f27162b4d2a90e4a0452a839ab3124 v0.10.0] [https://github.com/SimpleITK/SimpleITK/releases/tag/v0.10.0 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.10.0 Downloads] [https://www.itk.org/SimpleITKDoxygen010/html/index.html Doxygen]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=ec033f0be4f67b2e21483ed9bc3698f07dba9d06 v0.9.1] [https://github.com/SimpleITK/SimpleITK/releases/tag/v0.9.1 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.9.1 Downloads] <br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=7f06e9fc7f3cda9c47e8b7d6d37885b1f425ea3b v0.9.0] [https://github.com/SimpleITK/SimpleITK/releases/tag/v0.9.0 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.9.0 Downloads] [https://www.itk.org/SimpleITKDoxygen09/html/index.html Doxygen]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=d0a90983877b46631e69a398bd8341889912c8c2 v0.8.1] [https://github.com/SimpleITK/SimpleITK/releases/tag/v0.8.1 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.8.1/ Downloads] [https://www.itk.org/SimpleITKDoxygen08/html/index.html Doxygen]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=11bff587f8a930bbca02813595aa3d08388af979 v0.8.0] [https://github.com/SimpleITK/SimpleITK/releases/tag/v0.8.0 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.8.0/ Downloads] <br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=commit;h=a2b29110771a1eb0b09d18ff8e98a784dc6e6451 v0.7.1] [https://github.com/SimpleITK/SimpleITK/releases/tag/v0.7.1 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.7.1/ Downloads]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=6fecf5ae5859295082b9016c97bf4bd68a961a62 v0.7.0] [https://github.com/SimpleITK/SimpleITK/releases/tag/v0.7.0 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.7.0/ Downloads] [https://www.itk.org/SimpleITKDoxygen07/html/index.html Doxygen]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=fc17df598cac97d344c875fed117f03ae7d1aacd v0.6.1] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.6.1/ Downloads] [http://www.itk.org/SimpleITKDoxygen06/html/index.html Doxygen]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=c055ef4e4cd2802c56e169084d9dd1bc655b4e93 v0.6.0] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.6.0/ Downloads] <br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=41fbb6d69f88fa1c8ab3b9d710b7ae57bb975721 v0.5.1] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.5.1/ Downloads]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=35ccfd2b99b4b5675d4d0894bb870574396408b6 v0.5.0] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.5.0/ Downloads]<br />
<br />
= Development =<br />
<br />
SimpleITK has moved to a [https://github.com/SimpleITK/SimpleITK Github] based work flow for issues tracking and contribution.<br />
<br />
<br />
SimpleITK utilizes an additional "next" branch to merge and test changes before merging into the master branch. This makes our "master" branch more stable and reliable. This follows the CMake development process:<br />
<br />
* [http://www.cmake.org/Wiki/CMake/Git/Develop CMake Development Process ]<br />
<br />
<br />
== Source Code Repository ==<br />
<br />
SimpleITK uses git as the revision control system. The official repository is hosted along side ITK as http://itk.org/SimpleITK.git [http://public.kitware.com/gitweb?p=SimpleITK.git]. It is also mirrored on [https://github.com/SimpleITK/SimpleITK Github ].<br />
<br />
Development is currently following the branchy workflow with the Kitware stage repository. This workflow is described here:<br />
*http://public.kitware.com/Wiki/Git/Workflow/Stage<br />
*http://public.kitware.com/Wiki/Git/Workflow/Topic<br />
<br />
Contributions from github will be pushed to the stage repo and merged into the next branch by a SimpleITK developer.<br />
<br />
== [[SimpleITK/Design_And_Proposals | Design And Proposals]] ==</div>Blowekamphttps://public.kitware.com/Wiki/index.php?title=ITK/Release_5/DICOM/Color&diff=63976ITK/Release 5/DICOM/Color2019-10-11T14:37:20Z<p>Blowekamp: /* ITK 5.0 */</p>
<hr />
<div>= Multiple Components in DICOM =<br />
<br />
== ITK 5.0 ==<br />
<br />
DICOM standard allow storing of image with more than one components. As of today, only 1 or 3 components are considered valid DICOM SOP Class instances (for all IODs).<br />
<br />
By design the itk::GDCMImageIO was designed and implemented so that an input YBR_FULL image would be loaded as such (no implicit conversion to RGB was done). The main reason for that is that ITK is a processing toolkit, so quantitative analysis is supposed to be done on the best possible pixel representation. Since conversion from integer YBR_FULL to integer RGB colorspace is a lossy operation (truncation in floating point representation), the conversion has never been implemented.<br />
<br />
As side note MONOCHROME1 color space is not converted to MONOCHROME2 (itk::GDCMImageIO / ITK 5.0)<br />
<br />
ITK currently does not have any standard way of noting the color space of an Image. Originally, there was a direct mapping between the `ImageIOBase::PixelType` and the intended pixel type used for the template parameter in the `Image` class. Modern usage of ITK frequently uses the generalized `VectorImage` to hold multi-component images so there may even be less knowledge of the content in the Image buffer. Additionally, we need to consider the default behavior of `ConverPixeltBuffer` (https://itk.org/Doxygen/html/classitk_1_1ConvertPixelBuffer.html), which may be applied when an image is loaded by the `ImageFileReader`. For example if the ImageIO loads a 3 component pixel buffer and the ImageFileReader is templated over a scalar image default a RGB to Gray scale conversion occurs based on the CIE luminance for the 3-components.<br />
<br />
== Issue ==<br />
<br />
This behavior was considered ok, as long as the image was not directly loaded in viz application such as Slicer, where unexpectedly the image would appears with a weird color scheme. (original bug report from Mihail Isakov)<br />
<br />
BCL: After hearing the descriptions of the issue, I considered loading YBR directly as a bug because GDCMImageIO was reporting the pixel type as `IOPixelType::RGB` and the buffer was in YBR color space. If the image is loaded in YBR color space is should have a different `IOPixelType` may be `VECTOR` or `FIXEDARRAY` for lack of a more descriptive `IOPixelType`.<br />
<br />
== Notation ==<br />
<br />
# JPEG refers to the subset of ITU-T T.81, ISO/IEC IS 10918-1 (lossy 8bits)<br />
# JPEG 2000 refers to ITU-T T.800, ISO/IEC IS 15444-1<br />
<br />
== ITK 5.x ==<br />
<br />
The behavior for YBR_FULL vs RGB color model has been discussed and it seems consensus would be to convert to RGB always. Since DICOM, JPEG and TIFF can be somewhat relates for this matter, we should strive to keep the behavior consistent.<br />
<br />
Current behavior of ITK 5.0:<br />
<br />
{| border="1" style="text-align:center"<br />
|- bgcolor="#abcdef"<br />
! Photometric Interpretation !! JPEG !! TIFF !! GDCM !! DCMTK<br />
|-<br />
! MONOCHROME1 || style="background:silver" | X || style="background:orange" |MONOCHROME2 (aka min-is-black) || style="background:lime" |MONOCHROME1 || style="background:lime" |?MONOCHROME1?<br />
|- <br />
! MONOCHROME2 || style="background:lime" | MONOCHROME2 || style="background:lime" |MONOCHROME2 (aka min-is-black) || style="background:lime" |MONOCHROME2 || style="background:lime" |MONOCHROME2<br />
|-<br />
! PALETTE COLOR || style="background:silver" |X || style="background:orange" | RGB (??) || style="background:orange" | Converted to RGB || style="background:orange" | ?Converted to RGB? (need to check compressed LUT)<br />
|-<br />
! RGB || style="background:orange" |RGB || RGB|| RGB || ?RGB?<br />
|- style="background:silver"<br />
! HSV || || || || <br />
|- style="background:silver"<br />
! ARGB || || || || <br />
|- style="background:silver"<br />
! CMYK || || || || <br />
|-<br />
! YBR_FULL || style="background:silver" |ITU 81 enforce sub-sampling|| ?? || YBR_FULL || ??<br />
|-<br />
! YBR_FULL_422 || style="background:orange" |RGB || style="background:orange" |RGB || YBR_FULL || ??Maybe RGB?<br />
|- style="background:silver"<br />
! YBR_PARTIAL_422 || || || || <br />
|- style="background:silver"<br />
! YBR_PARTIAL_420 || || || || <br />
|-<br />
! YBR_ICT || style="background:silver" |ITU 81 does not support this colorspace || ?? || style="background:orange" |RGB || style="background:red" |no J2K plugin<br />
|-<br />
! YBR_RCT || style="background:silver" |ITU 81 does not support this colorspace || ?? || RGB || style="background:red" |no J2K plugin<br />
|-<br />
|}<br />
<br />
<br />
Desired behavior of ITK 5.0:<br />
<br />
{| border="1" style="text-align:center"<br />
|- bgcolor="#abcdef"<br />
! Photometric Interpretation !! JPEG !! TIFF !! GDCM !! DCMTK<br />
|-<br />
! MONOCHROME1 || style="background:silver" | X || style="background:orange" |MONOCHROME2 (aka min-is-black)|| style="background:orange" |MONOCHROME2 || style="background:orange" |MONOCHROME2<br />
|- <br />
! MONOCHROME2 || style="background:lime" | MONOCHROME2 || style="background:lime" |MONOCHROME2 (aka min-is-black)|| style="background:lime" |MONOCHROME2 || style="background:lime" |MONOCHROME2<br />
|-<br />
! PALETTE COLOR || style="background:silver" | X || style="background:orange" | RGB || style="background:orange" | Converted to RGB || style="background:orange" | RGB<br />
|-<br />
! RGB || style="background:orange" |RGB || RGB|| RGB || ?RGB?<br />
|- style="background:silver"<br />
! HSV || || || || <br />
|- style="background:silver"<br />
! ARGB || || || || <br />
|- style="background:silver"<br />
! CMYK || || || || <br />
|-<br />
! YBR_FULL || style="background:silver" |ITU 81 enforce sub-sampling|| ?? || style="background:orange" |RGB || style="background:orange" |RGB<br />
|-<br />
! YBR_FULL_422 || style="background:orange" |RGB || style="background:orange" |RGB || style="background:orange" |RGB || style="background:orange" |RGB<br />
|- style="background:silver"<br />
! YBR_PARTIAL_422 || || || || <br />
|- style="background:silver"<br />
! YBR_PARTIAL_420 || || || || <br />
|-<br />
! YBR_ICT || || || style="background:orange" |RGB || style="background:red" |no J2K plugin<br />
|-<br />
! YBR_RCT || || || RGB || style="background:red" |no J2K plugin<br />
|-<br />
|}<br />
<br />
When a Photometric Interpretation is specified in red, it means this is not supposed to happen (does not make any sense).<br />
When a Photometric Interpretation is specified in silver background, it means the Photometric Interpretation is retired.<br />
<br />
== Discussion ==<br />
<br />
Participants:<br />
# Mathieu Malaterre<br />
# Mihail Isakov<br />
# Bradley Lowekamp<br />
<br />
For visualization people it is important that:<br />
<br />
# MONOCHROME1 (min-is-white) is converted to MONOCHROME2 (min-is-black) <br />
# YBR_FULL / YBR_FULL_422 are converted to RGB<br />
<br />
The requirements for quantitative analysis may be different, please list reqs here:<br />
<br />
#? Extract Luminance out of YBR ?<br />
# ? Need MONOCHROME1 native support, because <fill reason ??><br />
# ? Is there a need to manipulated native palette data ? I doubt so<br />
## BL: The `ExpandRGBPalette` attribute was just added to `ImageIOBase`. TIFFImageIO support this option. For feature consistency it would be nice for GDCMImageIO to support this feature. https://itk.org/Doxygen/html/classitk_1_1ImageIOBase.html#a04804c60d755ae102e104261536a0f46 https://github.com/InsightSoftwareConsortium/ITK/pull/1219/files<br />
<br />
For ITK consistency it is important that the `ImageIOBase::PixelType` is set correctly so that users of the `ITK::ImageIOBase` API know generally what the image buffer is and how to load and use the image. We likely should improve the documentation in the ImageIOBase class about the expectations for how these are used. Here is a list of type pertinent to this discussion:<br />
# RGB<br />
## BL: should only be used for general RGB buffers. This is not very descriptive of the color space sRGB, AdobeRGB, Linear RGB etc., but using this as a type for general "color" buffers should be avoided IMHO.<br />
# SCALAR<br />
## BL: Images of unapplied palettes, when ExpandRGBPalette is false, are currently labeled as scalars<br />
# VECTOR<br />
## BL: Currently this is frequently used for displacement fields.<br />
# FIXEDARRAY<br />
## BL: Not regularly used to my knowledge, and may be the most generic multi-component `PixelType`, so this may be the base label to used for YBR, CMYK etc.<br />
<br />
== Data ==<br />
<br />
# JPEG 8 bits mono2<br />
# JPEG 8 bits YBR_422<br />
# JPEG 8 bits RGB<br />
# TIFF mono1 min-is-white<br />
# TIFF mono2 min-is-black<br />
# TIFF YBR_422<br />
# TIFF RGB<br />
# DICOM mono1 min-is-white<br />
# DICOM mono2 min-is-black<br />
# DICOM YBR<br />
# [https://sourceforge.net/p/gdcm/gdcmdata/ci/master/tree/US-YBR_FULL_422-EVRLE.dcm| DICOM YBR_422]<br />
# [https://sourceforge.net/p/gdcm/gdcmdata/ci/master/tree/US-GE-4AICL142.dcm| DICOM JPEG/YBR_422]<br />
# DICOM RGB<br />
# DICOM YBR_RCT<br />
# DICOM YBR_ICT<br />
<br />
== References ==<br />
<br />
* http://dicom.nema.org/medical/dicom/current/output/chtml/part03/sect_C.7.6.3.html#sect_C.7.6.3.1.2<br />
* http://gdcm.sourceforge.net/wiki/index.php/Color_Space_Transformations</div>Blowekamphttps://public.kitware.com/Wiki/index.php?title=ITK/Release_5/DICOM/Color&diff=63975ITK/Release 5/DICOM/Color2019-10-11T14:37:04Z<p>Blowekamp: /* ITK 5.0 */</p>
<hr />
<div>= Multiple Components in DICOM =<br />
<br />
== ITK 5.0 ==<br />
<br />
DICOM standard allow storing of image with more than one components. As of today, only 1 or 3 components are considered valid DICOM SOP Class instances (for all IODs).<br />
<br />
By design the itk::GDCMImageIO was designed and implemented so that an input YBR_FULL image would be loaded as such (no implicit conversion to RGB was done). The main reason for that is that ITK is a processing toolkit, so quantitative analysis is supposed to be done on the best possible pixel representation. Since conversion from integer YBR_FULL to integer RGB colorspace is a lossy operation (truncation in floating point representation), the conversion has never been implemented.<br />
<br />
As side note MONOCHROME1 color space is not converted to MONOCHROME2 (itk::GDCMImageIO / ITK 5.0)<br />
<br />
ITK currently does not have any standard way of noting what color space of an Image. Originally, there was a direct mapping between the `ImageIOBase::PixelType` and the intended pixel type used for the template parameter in the `Image` class. Modern usage of ITK frequently uses the generalized `VectorImage` to hold multi-component images so there may even be less knowledge of the content in the Image buffer. Additionally, we need to consider the default behavior of `ConverPixeltBuffer` (https://itk.org/Doxygen/html/classitk_1_1ConvertPixelBuffer.html), which may be applied when an image is loaded by the `ImageFileReader`. For example if the ImageIO loads a 3 component pixel buffer and the ImageFileReader is templated over a scalar image default a RGB to Gray scale conversion occurs based on the CIE luminance for the 3-components.<br />
<br />
== Issue ==<br />
<br />
This behavior was considered ok, as long as the image was not directly loaded in viz application such as Slicer, where unexpectedly the image would appears with a weird color scheme. (original bug report from Mihail Isakov)<br />
<br />
BCL: After hearing the descriptions of the issue, I considered loading YBR directly as a bug because GDCMImageIO was reporting the pixel type as `IOPixelType::RGB` and the buffer was in YBR color space. If the image is loaded in YBR color space is should have a different `IOPixelType` may be `VECTOR` or `FIXEDARRAY` for lack of a more descriptive `IOPixelType`.<br />
<br />
== Notation ==<br />
<br />
# JPEG refers to the subset of ITU-T T.81, ISO/IEC IS 10918-1 (lossy 8bits)<br />
# JPEG 2000 refers to ITU-T T.800, ISO/IEC IS 15444-1<br />
<br />
== ITK 5.x ==<br />
<br />
The behavior for YBR_FULL vs RGB color model has been discussed and it seems consensus would be to convert to RGB always. Since DICOM, JPEG and TIFF can be somewhat relates for this matter, we should strive to keep the behavior consistent.<br />
<br />
Current behavior of ITK 5.0:<br />
<br />
{| border="1" style="text-align:center"<br />
|- bgcolor="#abcdef"<br />
! Photometric Interpretation !! JPEG !! TIFF !! GDCM !! DCMTK<br />
|-<br />
! MONOCHROME1 || style="background:silver" | X || style="background:orange" |MONOCHROME2 (aka min-is-black) || style="background:lime" |MONOCHROME1 || style="background:lime" |?MONOCHROME1?<br />
|- <br />
! MONOCHROME2 || style="background:lime" | MONOCHROME2 || style="background:lime" |MONOCHROME2 (aka min-is-black) || style="background:lime" |MONOCHROME2 || style="background:lime" |MONOCHROME2<br />
|-<br />
! PALETTE COLOR || style="background:silver" |X || style="background:orange" | RGB (??) || style="background:orange" | Converted to RGB || style="background:orange" | ?Converted to RGB? (need to check compressed LUT)<br />
|-<br />
! RGB || style="background:orange" |RGB || RGB|| RGB || ?RGB?<br />
|- style="background:silver"<br />
! HSV || || || || <br />
|- style="background:silver"<br />
! ARGB || || || || <br />
|- style="background:silver"<br />
! CMYK || || || || <br />
|-<br />
! YBR_FULL || style="background:silver" |ITU 81 enforce sub-sampling|| ?? || YBR_FULL || ??<br />
|-<br />
! YBR_FULL_422 || style="background:orange" |RGB || style="background:orange" |RGB || YBR_FULL || ??Maybe RGB?<br />
|- style="background:silver"<br />
! YBR_PARTIAL_422 || || || || <br />
|- style="background:silver"<br />
! YBR_PARTIAL_420 || || || || <br />
|-<br />
! YBR_ICT || style="background:silver" |ITU 81 does not support this colorspace || ?? || style="background:orange" |RGB || style="background:red" |no J2K plugin<br />
|-<br />
! YBR_RCT || style="background:silver" |ITU 81 does not support this colorspace || ?? || RGB || style="background:red" |no J2K plugin<br />
|-<br />
|}<br />
<br />
<br />
Desired behavior of ITK 5.0:<br />
<br />
{| border="1" style="text-align:center"<br />
|- bgcolor="#abcdef"<br />
! Photometric Interpretation !! JPEG !! TIFF !! GDCM !! DCMTK<br />
|-<br />
! MONOCHROME1 || style="background:silver" | X || style="background:orange" |MONOCHROME2 (aka min-is-black)|| style="background:orange" |MONOCHROME2 || style="background:orange" |MONOCHROME2<br />
|- <br />
! MONOCHROME2 || style="background:lime" | MONOCHROME2 || style="background:lime" |MONOCHROME2 (aka min-is-black)|| style="background:lime" |MONOCHROME2 || style="background:lime" |MONOCHROME2<br />
|-<br />
! PALETTE COLOR || style="background:silver" | X || style="background:orange" | RGB || style="background:orange" | Converted to RGB || style="background:orange" | RGB<br />
|-<br />
! RGB || style="background:orange" |RGB || RGB|| RGB || ?RGB?<br />
|- style="background:silver"<br />
! HSV || || || || <br />
|- style="background:silver"<br />
! ARGB || || || || <br />
|- style="background:silver"<br />
! CMYK || || || || <br />
|-<br />
! YBR_FULL || style="background:silver" |ITU 81 enforce sub-sampling|| ?? || style="background:orange" |RGB || style="background:orange" |RGB<br />
|-<br />
! YBR_FULL_422 || style="background:orange" |RGB || style="background:orange" |RGB || style="background:orange" |RGB || style="background:orange" |RGB<br />
|- style="background:silver"<br />
! YBR_PARTIAL_422 || || || || <br />
|- style="background:silver"<br />
! YBR_PARTIAL_420 || || || || <br />
|-<br />
! YBR_ICT || || || style="background:orange" |RGB || style="background:red" |no J2K plugin<br />
|-<br />
! YBR_RCT || || || RGB || style="background:red" |no J2K plugin<br />
|-<br />
|}<br />
<br />
When a Photometric Interpretation is specified in red, it means this is not supposed to happen (does not make any sense).<br />
When a Photometric Interpretation is specified in silver background, it means the Photometric Interpretation is retired.<br />
<br />
== Discussion ==<br />
<br />
Participants:<br />
# Mathieu Malaterre<br />
# Mihail Isakov<br />
# Bradley Lowekamp<br />
<br />
For visualization people it is important that:<br />
<br />
# MONOCHROME1 (min-is-white) is converted to MONOCHROME2 (min-is-black) <br />
# YBR_FULL / YBR_FULL_422 are converted to RGB<br />
<br />
The requirements for quantitative analysis may be different, please list reqs here:<br />
<br />
#? Extract Luminance out of YBR ?<br />
# ? Need MONOCHROME1 native support, because <fill reason ??><br />
# ? Is there a need to manipulated native palette data ? I doubt so<br />
## BL: The `ExpandRGBPalette` attribute was just added to `ImageIOBase`. TIFFImageIO support this option. For feature consistency it would be nice for GDCMImageIO to support this feature. https://itk.org/Doxygen/html/classitk_1_1ImageIOBase.html#a04804c60d755ae102e104261536a0f46 https://github.com/InsightSoftwareConsortium/ITK/pull/1219/files<br />
<br />
For ITK consistency it is important that the `ImageIOBase::PixelType` is set correctly so that users of the `ITK::ImageIOBase` API know generally what the image buffer is and how to load and use the image. We likely should improve the documentation in the ImageIOBase class about the expectations for how these are used. Here is a list of type pertinent to this discussion:<br />
# RGB<br />
## BL: should only be used for general RGB buffers. This is not very descriptive of the color space sRGB, AdobeRGB, Linear RGB etc., but using this as a type for general "color" buffers should be avoided IMHO.<br />
# SCALAR<br />
## BL: Images of unapplied palettes, when ExpandRGBPalette is false, are currently labeled as scalars<br />
# VECTOR<br />
## BL: Currently this is frequently used for displacement fields.<br />
# FIXEDARRAY<br />
## BL: Not regularly used to my knowledge, and may be the most generic multi-component `PixelType`, so this may be the base label to used for YBR, CMYK etc.<br />
<br />
== Data ==<br />
<br />
# JPEG 8 bits mono2<br />
# JPEG 8 bits YBR_422<br />
# JPEG 8 bits RGB<br />
# TIFF mono1 min-is-white<br />
# TIFF mono2 min-is-black<br />
# TIFF YBR_422<br />
# TIFF RGB<br />
# DICOM mono1 min-is-white<br />
# DICOM mono2 min-is-black<br />
# DICOM YBR<br />
# [https://sourceforge.net/p/gdcm/gdcmdata/ci/master/tree/US-YBR_FULL_422-EVRLE.dcm| DICOM YBR_422]<br />
# [https://sourceforge.net/p/gdcm/gdcmdata/ci/master/tree/US-GE-4AICL142.dcm| DICOM JPEG/YBR_422]<br />
# DICOM RGB<br />
# DICOM YBR_RCT<br />
# DICOM YBR_ICT<br />
<br />
== References ==<br />
<br />
* http://dicom.nema.org/medical/dicom/current/output/chtml/part03/sect_C.7.6.3.html#sect_C.7.6.3.1.2<br />
* http://gdcm.sourceforge.net/wiki/index.php/Color_Space_Transformations</div>Blowekamphttps://public.kitware.com/Wiki/index.php?title=ITK/Release_5/DICOM/Color&diff=63974ITK/Release 5/DICOM/Color2019-10-11T14:22:13Z<p>Blowekamp: /* Discussion */</p>
<hr />
<div>= Multiple Components in DICOM =<br />
<br />
== ITK 5.0 ==<br />
<br />
DICOM standard allow storing of image with more than one components. As of today, only 1 or 3 components are considered valid DICOM SOP Class instances (for all IODs).<br />
<br />
By design the itk::GDCMImageIO was designed and implemented so that an input YBR_FULL image would be loaded as such (no implicit conversion to RGB was done). The main reason for that is that ITK is a processing toolkit, so quantitative analysis is supposed to be done on the best possible pixel representation. Since conversion from integer YBR_FULL to integer RGB colorspace is a lossy operation (truncation in floating point representation), the conversion has never been implemented.<br />
<br />
As side note MONOCHROME1 color space is not converted to MONOCHROME2 (itk::GDCMImageIO / ITK 5.0)<br />
<br />
ITK currently does not have any standard way of noting what color space an image is. Originally, there was a direct mapping between the `ImageIOBase::PixelType` and the intended pixel type used for the template parameter in the `Image` class. Modern usage of ITK frequently uses the generalized `VectorImage` to hold multi-component images so there may even be less knowledge of the content in the Image buffer. Additionally, we need to consider the default behavior of `ConverPixeltBuffer` (https://itk.org/Doxygen/html/classitk_1_1ConvertPixelBuffer.html), which may be applied when an image is loaded by the `ImageFileReader`. For example if the ImageIO loads a 3 component pixel buffer and the ImageFileReader is templated over a scalar image default a RGB to Gray scale conversion occurs based on the CIE luminance for the 3-components.<br />
<br />
== Issue ==<br />
<br />
This behavior was considered ok, as long as the image was not directly loaded in viz application such as Slicer, where unexpectedly the image would appears with a weird color scheme. (original bug report from Mihail Isakov)<br />
<br />
BCL: After hearing the descriptions of the issue, I considered loading YBR directly as a bug because GDCMImageIO was reporting the pixel type as `IOPixelType::RGB` and the buffer was in YBR color space. If the image is loaded in YBR color space is should have a different `IOPixelType` may be `VECTOR` or `FIXEDARRAY` for lack of a more descriptive `IOPixelType`.<br />
<br />
== Notation ==<br />
<br />
# JPEG refers to the subset of ITU-T T.81, ISO/IEC IS 10918-1 (lossy 8bits)<br />
# JPEG 2000 refers to ITU-T T.800, ISO/IEC IS 15444-1<br />
<br />
== ITK 5.x ==<br />
<br />
The behavior for YBR_FULL vs RGB color model has been discussed and it seems consensus would be to convert to RGB always. Since DICOM, JPEG and TIFF can be somewhat relates for this matter, we should strive to keep the behavior consistent.<br />
<br />
Current behavior of ITK 5.0:<br />
<br />
{| border="1" style="text-align:center"<br />
|- bgcolor="#abcdef"<br />
! Photometric Interpretation !! JPEG !! TIFF !! GDCM !! DCMTK<br />
|-<br />
! MONOCHROME1 || style="background:silver" | X || style="background:orange" |MONOCHROME2 (aka min-is-black) || style="background:lime" |MONOCHROME1 || style="background:lime" |?MONOCHROME1?<br />
|- <br />
! MONOCHROME2 || style="background:lime" | MONOCHROME2 || style="background:lime" |MONOCHROME2 (aka min-is-black) || style="background:lime" |MONOCHROME2 || style="background:lime" |MONOCHROME2<br />
|-<br />
! PALETTE COLOR || style="background:silver" |X || style="background:orange" | RGB (??) || style="background:orange" | Converted to RGB || style="background:orange" | ?Converted to RGB? (need to check compressed LUT)<br />
|-<br />
! RGB || style="background:orange" |RGB || RGB|| RGB || ?RGB?<br />
|- style="background:silver"<br />
! HSV || || || || <br />
|- style="background:silver"<br />
! ARGB || || || || <br />
|- style="background:silver"<br />
! CMYK || || || || <br />
|-<br />
! YBR_FULL || style="background:silver" |ITU 81 enforce sub-sampling|| ?? || YBR_FULL || ??<br />
|-<br />
! YBR_FULL_422 || style="background:orange" |RGB || style="background:orange" |RGB || YBR_FULL || ??Maybe RGB?<br />
|- style="background:silver"<br />
! YBR_PARTIAL_422 || || || || <br />
|- style="background:silver"<br />
! YBR_PARTIAL_420 || || || || <br />
|-<br />
! YBR_ICT || style="background:silver" |ITU 81 does not support this colorspace || ?? || style="background:orange" |RGB || style="background:red" |no J2K plugin<br />
|-<br />
! YBR_RCT || style="background:silver" |ITU 81 does not support this colorspace || ?? || RGB || style="background:red" |no J2K plugin<br />
|-<br />
|}<br />
<br />
<br />
Desired behavior of ITK 5.0:<br />
<br />
{| border="1" style="text-align:center"<br />
|- bgcolor="#abcdef"<br />
! Photometric Interpretation !! JPEG !! TIFF !! GDCM !! DCMTK<br />
|-<br />
! MONOCHROME1 || style="background:silver" | X || style="background:orange" |MONOCHROME2 (aka min-is-black)|| style="background:orange" |MONOCHROME2 || style="background:orange" |MONOCHROME2<br />
|- <br />
! MONOCHROME2 || style="background:lime" | MONOCHROME2 || style="background:lime" |MONOCHROME2 (aka min-is-black)|| style="background:lime" |MONOCHROME2 || style="background:lime" |MONOCHROME2<br />
|-<br />
! PALETTE COLOR || style="background:silver" | X || style="background:orange" | RGB || style="background:orange" | Converted to RGB || style="background:orange" | RGB<br />
|-<br />
! RGB || style="background:orange" |RGB || RGB|| RGB || ?RGB?<br />
|- style="background:silver"<br />
! HSV || || || || <br />
|- style="background:silver"<br />
! ARGB || || || || <br />
|- style="background:silver"<br />
! CMYK || || || || <br />
|-<br />
! YBR_FULL || style="background:silver" |ITU 81 enforce sub-sampling|| ?? || style="background:orange" |RGB || style="background:orange" |RGB<br />
|-<br />
! YBR_FULL_422 || style="background:orange" |RGB || style="background:orange" |RGB || style="background:orange" |RGB || style="background:orange" |RGB<br />
|- style="background:silver"<br />
! YBR_PARTIAL_422 || || || || <br />
|- style="background:silver"<br />
! YBR_PARTIAL_420 || || || || <br />
|-<br />
! YBR_ICT || || || style="background:orange" |RGB || style="background:red" |no J2K plugin<br />
|-<br />
! YBR_RCT || || || RGB || style="background:red" |no J2K plugin<br />
|-<br />
|}<br />
<br />
When a Photometric Interpretation is specified in red, it means this is not supposed to happen (does not make any sense).<br />
When a Photometric Interpretation is specified in silver background, it means the Photometric Interpretation is retired.<br />
<br />
== Discussion ==<br />
<br />
Participants:<br />
# Mathieu Malaterre<br />
# Mihail Isakov<br />
# Bradley Lowekamp<br />
<br />
For visualization people it is important that:<br />
<br />
# MONOCHROME1 (min-is-white) is converted to MONOCHROME2 (min-is-black) <br />
# YBR_FULL / YBR_FULL_422 are converted to RGB<br />
<br />
The requirements for quantitative analysis may be different, please list reqs here:<br />
<br />
#? Extract Luminance out of YBR ?<br />
# ? Need MONOCHROME1 native support, because <fill reason ??><br />
# ? Is there a need to manipulated native palette data ? I doubt so<br />
## BL: The `ExpandRGBPalette` attribute was just added to `ImageIOBase`. TIFFImageIO support this option. For feature consistency it would be nice for GDCMImageIO to support this feature. https://itk.org/Doxygen/html/classitk_1_1ImageIOBase.html#a04804c60d755ae102e104261536a0f46 https://github.com/InsightSoftwareConsortium/ITK/pull/1219/files<br />
<br />
For ITK consistency it is important that the `ImageIOBase::PixelType` is set correctly so that users of the `ITK::ImageIOBase` API know generally what the image buffer is and how to load and use the image. We likely should improve the documentation in the ImageIOBase class about the expectations for how these are used. Here is a list of type pertinent to this discussion:<br />
# RGB<br />
## BL: should only be used for general RGB buffers. This is not very descriptive of the color space sRGB, AdobeRGB, Linear RGB etc., but using this as a type for general "color" buffers should be avoided IMHO.<br />
# SCALAR<br />
## BL: Images of unapplied palettes, when ExpandRGBPalette is false, are currently labeled as scalars<br />
# VECTOR<br />
## BL: Currently this is frequently used for displacement fields.<br />
# FIXEDARRAY<br />
## BL: Not regularly used to my knowledge, and may be the most generic multi-component `PixelType`, so this may be the base label to used for YBR, CMYK etc.<br />
<br />
== Data ==<br />
<br />
# JPEG 8 bits mono2<br />
# JPEG 8 bits YBR_422<br />
# JPEG 8 bits RGB<br />
# TIFF mono1 min-is-white<br />
# TIFF mono2 min-is-black<br />
# TIFF YBR_422<br />
# TIFF RGB<br />
# DICOM mono1 min-is-white<br />
# DICOM mono2 min-is-black<br />
# DICOM YBR<br />
# [https://sourceforge.net/p/gdcm/gdcmdata/ci/master/tree/US-YBR_FULL_422-EVRLE.dcm| DICOM YBR_422]<br />
# [https://sourceforge.net/p/gdcm/gdcmdata/ci/master/tree/US-GE-4AICL142.dcm| DICOM JPEG/YBR_422]<br />
# DICOM RGB<br />
# DICOM YBR_RCT<br />
# DICOM YBR_ICT<br />
<br />
== References ==<br />
<br />
* http://dicom.nema.org/medical/dicom/current/output/chtml/part03/sect_C.7.6.3.html#sect_C.7.6.3.1.2<br />
* http://gdcm.sourceforge.net/wiki/index.php/Color_Space_Transformations</div>Blowekamphttps://public.kitware.com/Wiki/index.php?title=ITK/Release_5/DICOM/Color&diff=63973ITK/Release 5/DICOM/Color2019-10-11T14:20:09Z<p>Blowekamp: /* ITK 5.0 */</p>
<hr />
<div>= Multiple Components in DICOM =<br />
<br />
== ITK 5.0 ==<br />
<br />
DICOM standard allow storing of image with more than one components. As of today, only 1 or 3 components are considered valid DICOM SOP Class instances (for all IODs).<br />
<br />
By design the itk::GDCMImageIO was designed and implemented so that an input YBR_FULL image would be loaded as such (no implicit conversion to RGB was done). The main reason for that is that ITK is a processing toolkit, so quantitative analysis is supposed to be done on the best possible pixel representation. Since conversion from integer YBR_FULL to integer RGB colorspace is a lossy operation (truncation in floating point representation), the conversion has never been implemented.<br />
<br />
As side note MONOCHROME1 color space is not converted to MONOCHROME2 (itk::GDCMImageIO / ITK 5.0)<br />
<br />
ITK currently does not have any standard way of noting what color space an image is. Originally, there was a direct mapping between the `ImageIOBase::PixelType` and the intended pixel type used for the template parameter in the `Image` class. Modern usage of ITK frequently uses the generalized `VectorImage` to hold multi-component images so there may even be less knowledge of the content in the Image buffer. Additionally, we need to consider the default behavior of `ConverPixeltBuffer` (https://itk.org/Doxygen/html/classitk_1_1ConvertPixelBuffer.html), which may be applied when an image is loaded by the `ImageFileReader`. For example if the ImageIO loads a 3 component pixel buffer and the ImageFileReader is templated over a scalar image default a RGB to Gray scale conversion occurs based on the CIE luminance for the 3-components.<br />
<br />
== Issue ==<br />
<br />
This behavior was considered ok, as long as the image was not directly loaded in viz application such as Slicer, where unexpectedly the image would appears with a weird color scheme. (original bug report from Mihail Isakov)<br />
<br />
BCL: After hearing the descriptions of the issue, I considered loading YBR directly as a bug because GDCMImageIO was reporting the pixel type as `IOPixelType::RGB` and the buffer was in YBR color space. If the image is loaded in YBR color space is should have a different `IOPixelType` may be `VECTOR` or `FIXEDARRAY` for lack of a more descriptive `IOPixelType`.<br />
<br />
== Notation ==<br />
<br />
# JPEG refers to the subset of ITU-T T.81, ISO/IEC IS 10918-1 (lossy 8bits)<br />
# JPEG 2000 refers to ITU-T T.800, ISO/IEC IS 15444-1<br />
<br />
== ITK 5.x ==<br />
<br />
The behavior for YBR_FULL vs RGB color model has been discussed and it seems consensus would be to convert to RGB always. Since DICOM, JPEG and TIFF can be somewhat relates for this matter, we should strive to keep the behavior consistent.<br />
<br />
Current behavior of ITK 5.0:<br />
<br />
{| border="1" style="text-align:center"<br />
|- bgcolor="#abcdef"<br />
! Photometric Interpretation !! JPEG !! TIFF !! GDCM !! DCMTK<br />
|-<br />
! MONOCHROME1 || style="background:silver" | X || style="background:orange" |MONOCHROME2 (aka min-is-black) || style="background:lime" |MONOCHROME1 || style="background:lime" |?MONOCHROME1?<br />
|- <br />
! MONOCHROME2 || style="background:lime" | MONOCHROME2 || style="background:lime" |MONOCHROME2 (aka min-is-black) || style="background:lime" |MONOCHROME2 || style="background:lime" |MONOCHROME2<br />
|-<br />
! PALETTE COLOR || style="background:silver" |X || style="background:orange" | RGB (??) || style="background:orange" | Converted to RGB || style="background:orange" | ?Converted to RGB? (need to check compressed LUT)<br />
|-<br />
! RGB || style="background:orange" |RGB || RGB|| RGB || ?RGB?<br />
|- style="background:silver"<br />
! HSV || || || || <br />
|- style="background:silver"<br />
! ARGB || || || || <br />
|- style="background:silver"<br />
! CMYK || || || || <br />
|-<br />
! YBR_FULL || style="background:silver" |ITU 81 enforce sub-sampling|| ?? || YBR_FULL || ??<br />
|-<br />
! YBR_FULL_422 || style="background:orange" |RGB || style="background:orange" |RGB || YBR_FULL || ??Maybe RGB?<br />
|- style="background:silver"<br />
! YBR_PARTIAL_422 || || || || <br />
|- style="background:silver"<br />
! YBR_PARTIAL_420 || || || || <br />
|-<br />
! YBR_ICT || style="background:silver" |ITU 81 does not support this colorspace || ?? || style="background:orange" |RGB || style="background:red" |no J2K plugin<br />
|-<br />
! YBR_RCT || style="background:silver" |ITU 81 does not support this colorspace || ?? || RGB || style="background:red" |no J2K plugin<br />
|-<br />
|}<br />
<br />
<br />
Desired behavior of ITK 5.0:<br />
<br />
{| border="1" style="text-align:center"<br />
|- bgcolor="#abcdef"<br />
! Photometric Interpretation !! JPEG !! TIFF !! GDCM !! DCMTK<br />
|-<br />
! MONOCHROME1 || style="background:silver" | X || style="background:orange" |MONOCHROME2 (aka min-is-black)|| style="background:orange" |MONOCHROME2 || style="background:orange" |MONOCHROME2<br />
|- <br />
! MONOCHROME2 || style="background:lime" | MONOCHROME2 || style="background:lime" |MONOCHROME2 (aka min-is-black)|| style="background:lime" |MONOCHROME2 || style="background:lime" |MONOCHROME2<br />
|-<br />
! PALETTE COLOR || style="background:silver" | X || style="background:orange" | RGB || style="background:orange" | Converted to RGB || style="background:orange" | RGB<br />
|-<br />
! RGB || style="background:orange" |RGB || RGB|| RGB || ?RGB?<br />
|- style="background:silver"<br />
! HSV || || || || <br />
|- style="background:silver"<br />
! ARGB || || || || <br />
|- style="background:silver"<br />
! CMYK || || || || <br />
|-<br />
! YBR_FULL || style="background:silver" |ITU 81 enforce sub-sampling|| ?? || style="background:orange" |RGB || style="background:orange" |RGB<br />
|-<br />
! YBR_FULL_422 || style="background:orange" |RGB || style="background:orange" |RGB || style="background:orange" |RGB || style="background:orange" |RGB<br />
|- style="background:silver"<br />
! YBR_PARTIAL_422 || || || || <br />
|- style="background:silver"<br />
! YBR_PARTIAL_420 || || || || <br />
|-<br />
! YBR_ICT || || || style="background:orange" |RGB || style="background:red" |no J2K plugin<br />
|-<br />
! YBR_RCT || || || RGB || style="background:red" |no J2K plugin<br />
|-<br />
|}<br />
<br />
When a Photometric Interpretation is specified in red, it means this is not supposed to happen (does not make any sense).<br />
When a Photometric Interpretation is specified in silver background, it means the Photometric Interpretation is retired.<br />
<br />
== Discussion ==<br />
<br />
Participants:<br />
# Mathieu Malaterre<br />
# Mihail Isakov<br />
# Bradley Lowekamp<br />
<br />
For visualization people it is important that:<br />
<br />
# MONOCHROME1 (min-is-white) is converted to MONOCHROME2 (min-is-black) <br />
# YBR_FULL / YBR_FULL_422 are converted to RGB<br />
<br />
The requirements for quantitative analysis may be different, please list reqs here:<br />
<br />
#? Extract Luminance out of YBR ?<br />
# ? Need MONOCHROME1 native support, because <fill reason ??><br />
# ? Is there a need to manipulated native palette data ? I doubt so<br />
## BL: The `ExpandRGBPalette` attribute was just added to `ImageIOBase`, for feature consistency it would be nice to support this feature. https://itk.org/Doxygen/html/classitk_1_1ImageIOBase.html#a04804c60d755ae102e104261536a0f46 https://github.com/InsightSoftwareConsortium/ITK/pull/1219/files<br />
<br />
For ITK consistency it is important that the `ImageIOBase::PixelType` is set correctly so that users of the `ITK::ImageIOBase` API know generally what the image buffer is and how to load and use the image. We likely should improve the documentation in the ImageIOBase class about the expectations for how these are used. Here is a list of type pertinent to this discussion:<br />
# RGB<br />
## BL: should only be used for general RGB buffers. This is not very descriptive of the color space sRGB, AdobeRGB, Linear RGB etc., but using this as a type for general "color" buffers should be avoided IMHO.<br />
# SCALAR<br />
## BL: Images of unapplied palettes, when ExpandRGBPalette is false, are currently labeled as scalars<br />
# VECTOR<br />
## BL: Currently this is frequently used for displacement fields.<br />
# FIXEDARRAY<br />
## BL: Not regularly used to my knowledge, and may be the most generic multi-component `PixelType`, so this may be the base label to used for YBR, CMYK etc.<br />
<br />
== Data ==<br />
<br />
# JPEG 8 bits mono2<br />
# JPEG 8 bits YBR_422<br />
# JPEG 8 bits RGB<br />
# TIFF mono1 min-is-white<br />
# TIFF mono2 min-is-black<br />
# TIFF YBR_422<br />
# TIFF RGB<br />
# DICOM mono1 min-is-white<br />
# DICOM mono2 min-is-black<br />
# DICOM YBR<br />
# [https://sourceforge.net/p/gdcm/gdcmdata/ci/master/tree/US-YBR_FULL_422-EVRLE.dcm| DICOM YBR_422]<br />
# [https://sourceforge.net/p/gdcm/gdcmdata/ci/master/tree/US-GE-4AICL142.dcm| DICOM JPEG/YBR_422]<br />
# DICOM RGB<br />
# DICOM YBR_RCT<br />
# DICOM YBR_ICT<br />
<br />
== References ==<br />
<br />
* http://dicom.nema.org/medical/dicom/current/output/chtml/part03/sect_C.7.6.3.html#sect_C.7.6.3.1.2<br />
* http://gdcm.sourceforge.net/wiki/index.php/Color_Space_Transformations</div>Blowekamphttps://public.kitware.com/Wiki/index.php?title=ITK/Release_5/DICOM/Color&diff=63972ITK/Release 5/DICOM/Color2019-10-11T14:13:10Z<p>Blowekamp: /* ITK 5.x */</p>
<hr />
<div>= Multiple Components in DICOM =<br />
<br />
== ITK 5.0 ==<br />
<br />
DICOM standard allow storing of image with more than one components. As of today, only 1 or 3 components are considered valid DICOM SOP Class instances (for all IODs).<br />
<br />
By design the itk::GDCMImageIO was designed and implemented so that an input YBR_FULL image would be loaded as such (no implicit conversion to RGB was done). The main reason for that is that ITK is a processing toolkit, so quantitative analysis is supposed to be done on the best possible pixel representation. Since conversion from integer YBR_FULL to integer RGB colorspace is a lossy operation (truncation in floating point representation), the conversion has never been implemented.<br />
<br />
As side note MONOCHROME1 color space is not converted to MONOCHROME2 (itk::GDCMImageIO / ITK 5.0)<br />
<br />
ITK currently does not have any standard way of noting what color space an image is. Originally, there was a direct mapping between the `ImageIOBase::PixelType` and the intended pixel type used for the template parameter in the `Image` class. Modern usage of ITK frequently uses the generalized `VectorImage` to hold multi-component images so there may even be less knowledge to the content of the buffer from the loaded ITK pixel type. Additionally, we need to consider the default behavior of `ConverPixeltBuffer` (https://itk.org/Doxygen/html/classitk_1_1ConvertPixelBuffer.html), which may be applied when an image is loaded by the `ImageFileReader`. For example if the ImageIO loaded a 3 component image the the ImageFileReader is templated for a scalar image it will by default do an RGB to Gray scale based on the CIE luminance for the 3-components.<br />
<br />
== Issue ==<br />
<br />
This behavior was considered ok, as long as the image was not directly loaded in viz application such as Slicer, where unexpectedly the image would appears with a weird color scheme. (original bug report from Mihail Isakov)<br />
<br />
BCL: After hearing the descriptions of the issue, I considered loading YBR directly as a bug because GDCMImageIO was reporting the pixel type as `IOPixelType::RGB` and the buffer was in YBR color space. If the image is loaded in YBR color space is should have a different `IOPixelType` may be `VECTOR` or `FIXEDARRAY` for lack of a more descriptive `IOPixelType`.<br />
<br />
== Notation ==<br />
<br />
# JPEG refers to the subset of ITU-T T.81, ISO/IEC IS 10918-1 (lossy 8bits)<br />
# JPEG 2000 refers to ITU-T T.800, ISO/IEC IS 15444-1<br />
<br />
== ITK 5.x ==<br />
<br />
The behavior for YBR_FULL vs RGB color model has been discussed and it seems consensus would be to convert to RGB always. Since DICOM, JPEG and TIFF can be somewhat relates for this matter, we should strive to keep the behavior consistent.<br />
<br />
Current behavior of ITK 5.0:<br />
<br />
{| border="1" style="text-align:center"<br />
|- bgcolor="#abcdef"<br />
! Photometric Interpretation !! JPEG !! TIFF !! GDCM !! DCMTK<br />
|-<br />
! MONOCHROME1 || style="background:silver" | X || style="background:orange" |MONOCHROME2 (aka min-is-black) || style="background:lime" |MONOCHROME1 || style="background:lime" |?MONOCHROME1?<br />
|- <br />
! MONOCHROME2 || style="background:lime" | MONOCHROME2 || style="background:lime" |MONOCHROME2 (aka min-is-black) || style="background:lime" |MONOCHROME2 || style="background:lime" |MONOCHROME2<br />
|-<br />
! PALETTE COLOR || style="background:silver" |X || style="background:orange" | RGB (??) || style="background:orange" | Converted to RGB || style="background:orange" | ?Converted to RGB? (need to check compressed LUT)<br />
|-<br />
! RGB || style="background:orange" |RGB || RGB|| RGB || ?RGB?<br />
|- style="background:silver"<br />
! HSV || || || || <br />
|- style="background:silver"<br />
! ARGB || || || || <br />
|- style="background:silver"<br />
! CMYK || || || || <br />
|-<br />
! YBR_FULL || style="background:silver" |ITU 81 enforce sub-sampling|| ?? || YBR_FULL || ??<br />
|-<br />
! YBR_FULL_422 || style="background:orange" |RGB || style="background:orange" |RGB || YBR_FULL || ??Maybe RGB?<br />
|- style="background:silver"<br />
! YBR_PARTIAL_422 || || || || <br />
|- style="background:silver"<br />
! YBR_PARTIAL_420 || || || || <br />
|-<br />
! YBR_ICT || style="background:silver" |ITU 81 does not support this colorspace || ?? || style="background:orange" |RGB || style="background:red" |no J2K plugin<br />
|-<br />
! YBR_RCT || style="background:silver" |ITU 81 does not support this colorspace || ?? || RGB || style="background:red" |no J2K plugin<br />
|-<br />
|}<br />
<br />
<br />
Desired behavior of ITK 5.0:<br />
<br />
{| border="1" style="text-align:center"<br />
|- bgcolor="#abcdef"<br />
! Photometric Interpretation !! JPEG !! TIFF !! GDCM !! DCMTK<br />
|-<br />
! MONOCHROME1 || style="background:silver" | X || style="background:orange" |MONOCHROME2 (aka min-is-black)|| style="background:orange" |MONOCHROME2 || style="background:orange" |MONOCHROME2<br />
|- <br />
! MONOCHROME2 || style="background:lime" | MONOCHROME2 || style="background:lime" |MONOCHROME2 (aka min-is-black)|| style="background:lime" |MONOCHROME2 || style="background:lime" |MONOCHROME2<br />
|-<br />
! PALETTE COLOR || style="background:silver" | X || style="background:orange" | RGB || style="background:orange" | Converted to RGB || style="background:orange" | RGB<br />
|-<br />
! RGB || style="background:orange" |RGB || RGB|| RGB || ?RGB?<br />
|- style="background:silver"<br />
! HSV || || || || <br />
|- style="background:silver"<br />
! ARGB || || || || <br />
|- style="background:silver"<br />
! CMYK || || || || <br />
|-<br />
! YBR_FULL || style="background:silver" |ITU 81 enforce sub-sampling|| ?? || style="background:orange" |RGB || style="background:orange" |RGB<br />
|-<br />
! YBR_FULL_422 || style="background:orange" |RGB || style="background:orange" |RGB || style="background:orange" |RGB || style="background:orange" |RGB<br />
|- style="background:silver"<br />
! YBR_PARTIAL_422 || || || || <br />
|- style="background:silver"<br />
! YBR_PARTIAL_420 || || || || <br />
|-<br />
! YBR_ICT || || || style="background:orange" |RGB || style="background:red" |no J2K plugin<br />
|-<br />
! YBR_RCT || || || RGB || style="background:red" |no J2K plugin<br />
|-<br />
|}<br />
<br />
When a Photometric Interpretation is specified in red, it means this is not supposed to happen (does not make any sense).<br />
When a Photometric Interpretation is specified in silver background, it means the Photometric Interpretation is retired.<br />
<br />
== Discussion ==<br />
<br />
Participants:<br />
# Mathieu Malaterre<br />
# Mihail Isakov<br />
# Bradley Lowekamp<br />
<br />
For visualization people it is important that:<br />
<br />
# MONOCHROME1 (min-is-white) is converted to MONOCHROME2 (min-is-black) <br />
# YBR_FULL / YBR_FULL_422 are converted to RGB<br />
<br />
The requirements for quantitative analysis may be different, please list reqs here:<br />
<br />
#? Extract Luminance out of YBR ?<br />
# ? Need MONOCHROME1 native support, because <fill reason ??><br />
# ? Is there a need to manipulated native palette data ? I doubt so<br />
## BL: The `ExpandRGBPalette` attribute was just added to `ImageIOBase`, for feature consistency it would be nice to support this feature. https://itk.org/Doxygen/html/classitk_1_1ImageIOBase.html#a04804c60d755ae102e104261536a0f46 https://github.com/InsightSoftwareConsortium/ITK/pull/1219/files<br />
<br />
For ITK consistency it is important that the `ImageIOBase::PixelType` is set correctly so that users of the `ITK::ImageIOBase` API know generally what the image buffer is and how to load and use the image. We likely should improve the documentation in the ImageIOBase class about the expectations for how these are used. Here is a list of type pertinent to this discussion:<br />
# RGB<br />
## BL: should only be used for general RGB buffers. This is not very descriptive of the color space sRGB, AdobeRGB, Linear RGB etc., but using this as a type for general "color" buffers should be avoided IMHO.<br />
# SCALAR<br />
## BL: Images of unapplied palettes, when ExpandRGBPalette is false, are currently labeled as scalars<br />
# VECTOR<br />
## BL: Currently this is frequently used for displacement fields.<br />
# FIXEDARRAY<br />
## BL: Not regularly used to my knowledge, and may be the most generic multi-component `PixelType`, so this may be the base label to used for YBR, CMYK etc.<br />
<br />
== Data ==<br />
<br />
# JPEG 8 bits mono2<br />
# JPEG 8 bits YBR_422<br />
# JPEG 8 bits RGB<br />
# TIFF mono1 min-is-white<br />
# TIFF mono2 min-is-black<br />
# TIFF YBR_422<br />
# TIFF RGB<br />
# DICOM mono1 min-is-white<br />
# DICOM mono2 min-is-black<br />
# DICOM YBR<br />
# [https://sourceforge.net/p/gdcm/gdcmdata/ci/master/tree/US-YBR_FULL_422-EVRLE.dcm| DICOM YBR_422]<br />
# [https://sourceforge.net/p/gdcm/gdcmdata/ci/master/tree/US-GE-4AICL142.dcm| DICOM JPEG/YBR_422]<br />
# DICOM RGB<br />
# DICOM YBR_RCT<br />
# DICOM YBR_ICT<br />
<br />
== References ==<br />
<br />
* http://dicom.nema.org/medical/dicom/current/output/chtml/part03/sect_C.7.6.3.html#sect_C.7.6.3.1.2<br />
* http://gdcm.sourceforge.net/wiki/index.php/Color_Space_Transformations</div>Blowekamphttps://public.kitware.com/Wiki/index.php?title=ITK/Release_5/DICOM/Color&diff=63971ITK/Release 5/DICOM/Color2019-10-11T14:11:57Z<p>Blowekamp: /* ITK 5.0 */</p>
<hr />
<div>= Multiple Components in DICOM =<br />
<br />
== ITK 5.0 ==<br />
<br />
DICOM standard allow storing of image with more than one components. As of today, only 1 or 3 components are considered valid DICOM SOP Class instances (for all IODs).<br />
<br />
By design the itk::GDCMImageIO was designed and implemented so that an input YBR_FULL image would be loaded as such (no implicit conversion to RGB was done). The main reason for that is that ITK is a processing toolkit, so quantitative analysis is supposed to be done on the best possible pixel representation. Since conversion from integer YBR_FULL to integer RGB colorspace is a lossy operation (truncation in floating point representation), the conversion has never been implemented.<br />
<br />
As side note MONOCHROME1 color space is not converted to MONOCHROME2 (itk::GDCMImageIO / ITK 5.0)<br />
<br />
ITK currently does not have any standard way of noting what color space an image is. Originally, there was a direct mapping between the `ImageIOBase::PixelType` and the intended pixel type used for the template parameter in the `Image` class. Modern usage of ITK frequently uses the generalized `VectorImage` to hold multi-component images so there may even be less knowledge to the content of the buffer from the loaded ITK pixel type. Additionally, we need to consider the default behavior of `ConverPixeltBuffer` (https://itk.org/Doxygen/html/classitk_1_1ConvertPixelBuffer.html), which may be applied when an image is loaded by the `ImageFileReader`. For example if the ImageIO loaded a 3 component image the the ImageFileReader is templated for a scalar image it will by default do an RGB to Gray scale based on the CIE luminance for the 3-components.<br />
<br />
== Issue ==<br />
<br />
This behavior was considered ok, as long as the image was not directly loaded in viz application such as Slicer, where unexpectedly the image would appears with a weird color scheme. (original bug report from Mihail Isakov)<br />
<br />
BCL: After hearing the descriptions of the issue, I considered loading YBR directly as a bug because GDCMImageIO was reporting the pixel type as `IOPixelType::RGB` and the buffer was in YBR color space. If the image is loaded in YBR color space is should have a different `IOPixelType` may be `VECTOR` or `FIXEDARRAY` for lack of a more descriptive `IOPixelType`.<br />
<br />
== Notation ==<br />
<br />
# JPEG refers to the subset of ITU-T T.81, ISO/IEC IS 10918-1 (lossy 8bits)<br />
# JPEG 2000 refers to ITU-T T.800, ISO/IEC IS 15444-1<br />
<br />
== ITK 5.x ==<br />
<br />
The behavior for YBR_FULL vs RGB color model has been discussed and it seems consensus would be to convert to RGB always. Since DICOM, JPEG and TIFF can be somewhat relates for this matter, we should strive to keep the behavior consistent.<br />
<br />
Current behavior of ITK 5.0:<br />
<br />
{| border="1" style="text-align:center"<br />
|- bgcolor="#abcdef"<br />
! Photometric Interpretation !! JPEG !! TIFF !! GDCM !! DCMTK<br />
|-<br />
! MONOCHROME1 || style="background:silver" | X || style="background:orange" |MONOCHROME2 (aka min-is-black) || style="background:lime" |MONOCHROME1 || style="background:lime" |?MONOCHROME1?<br />
|- <br />
! MONOCHROME2 || style="background:lime" | MONOCHROME2 || style="background:lime" |MONOCHROME2 (aka min-is-black) || style="background:lime" |MONOCHROME2 || style="background:lime" |MONOCHROME2<br />
|-<br />
! PALETTE COLOR || style="background:silver" |X || style="background:orange" | RGB (??) || style="background:orange" | Converted to RGB || style="background:orange" | ?Converted to RGB? (need to check compressed LUT)<br />
|-<br />
! RGB || style="background:orange" |RGB || RGB|| RGB || ?RGB?<br />
|- style="background:silver"<br />
! HSV || || || || <br />
|- style="background:silver"<br />
! ARGB || || || || <br />
|- style="background:silver"<br />
! CMYK || || || || <br />
|-<br />
! YBR_FULL || style="background:silver" |ITU 81 enforce sub-sampling|| ?? || YBR_FULL || ??<br />
|-<br />
! YBR_FULL_422 || style="background:orange" |RGB || style="background:orange" |RGB || YBR_FULL || ??Maybe RGB?<br />
|- style="background:silver"<br />
! YBR_PARTIAL_422 || || || || <br />
|- style="background:silver"<br />
! YBR_PARTIAL_420 || || || || <br />
|-<br />
! YBR_ICT || style="background:silver" |ITU 81 does not support this colorspace || ?? || style="background:orange" |RGB || style="background:red" |no J2K plugin<br />
|-<br />
! YBR_RCT || style="background:silver" |ITU 81 does not support this colorspace || ?? || RGB || style="background:red" |no J2K plugin<br />
|-<br />
|}<br />
<br />
<br />
Desired behavior of ITK 5.0:<br />
<br />
{| border="1" style="text-align:center"<br />
|- bgcolor="#abcdef"<br />
! Photometric Interpretation !! JPEG !! TIFF !! GDCM !! DCMTK<br />
|-<br />
! MONOCHROME1 || style="background:silver" | X || style="background:orange" |MONOCHROME2 (aka min-is-black)|| style="background:orange" |MONOCHROME2 || style="background:orange" |MONOCHROME2<br />
|- <br />
! MONOCHROME2 || style="background:lime" | MONOCHROME2 || style="background:lime" |MONOCHROME2 (aka min-is-black)|| style="background:lime" |MONOCHROME2 || style="background:lime" |MONOCHROME2<br />
|-<br />
! PALETTE COLOR || style="background:silver" | X || style="background:orange" | RGB || style="background:orange" | Converted to RGB || style="background:orange" | RGB<br />
|-<br />
! RGB || style="background:orange" |RGB || RGB|| RGB || ?RGB?<br />
|- style="background:silver"<br />
! HSV || || || || <br />
|- style="background:silver"<br />
! ARGB || || || || <br />
|- style="background:silver"<br />
! CMYK || || || || <br />
|-<br />
! YBR_FULL || style="background:silver" |ITU 81 enforce sub-sampling|| ?? || style="background:orange" |RGB || style="background:orange" |RGB<br />
|-<br />
! YBR_FULL_422 || style="background:orange" |RGB || style="background:orange" |RGB || style="background:orange" |RGB || style="background:orange" |RGB<br />
|- style="background:silver"<br />
! YBR_PARTIAL_422 || || || || <br />
|- style="background:silver"<br />
! YBR_PARTIAL_420 || || || || <br />
|-<br />
! YBR_ICT || || || style="background:orange" |RGB || style="background:red" |no J2K plugin<br />
|-<br />
! YBR_RCT || || || RGB || style="background:red" |no J2K plugin<br />
|-<br />
|}<br />
<br />
BCL: What do the Color mean? Perhaps we should also include the `ImageIOBase::IOPixelType` in these cells?<br />
<br />
== Discussion ==<br />
<br />
Participants:<br />
# Mathieu Malaterre<br />
# Mihail Isakov<br />
# Bradley Lowekamp<br />
<br />
For visualization people it is important that:<br />
<br />
# MONOCHROME1 (min-is-white) is converted to MONOCHROME2 (min-is-black) <br />
# YBR_FULL / YBR_FULL_422 are converted to RGB<br />
<br />
The requirements for quantitative analysis may be different, please list reqs here:<br />
<br />
#? Extract Luminance out of YBR ?<br />
# ? Need MONOCHROME1 native support, because <fill reason ??><br />
# ? Is there a need to manipulated native palette data ? I doubt so<br />
## BL: The `ExpandRGBPalette` attribute was just added to `ImageIOBase`, for feature consistency it would be nice to support this feature. https://itk.org/Doxygen/html/classitk_1_1ImageIOBase.html#a04804c60d755ae102e104261536a0f46 https://github.com/InsightSoftwareConsortium/ITK/pull/1219/files<br />
<br />
For ITK consistency it is important that the `ImageIOBase::PixelType` is set correctly so that users of the `ITK::ImageIOBase` API know generally what the image buffer is and how to load and use the image. We likely should improve the documentation in the ImageIOBase class about the expectations for how these are used. Here is a list of type pertinent to this discussion:<br />
# RGB<br />
## BL: should only be used for general RGB buffers. This is not very descriptive of the color space sRGB, AdobeRGB, Linear RGB etc., but using this as a type for general "color" buffers should be avoided IMHO.<br />
# SCALAR<br />
## BL: Images of unapplied palettes, when ExpandRGBPalette is false, are currently labeled as scalars<br />
# VECTOR<br />
## BL: Currently this is frequently used for displacement fields.<br />
# FIXEDARRAY<br />
## BL: Not regularly used to my knowledge, and may be the most generic multi-component `PixelType`, so this may be the base label to used for YBR, CMYK etc.<br />
<br />
== Data ==<br />
<br />
# JPEG 8 bits mono2<br />
# JPEG 8 bits YBR_422<br />
# JPEG 8 bits RGB<br />
# TIFF mono1 min-is-white<br />
# TIFF mono2 min-is-black<br />
# TIFF YBR_422<br />
# TIFF RGB<br />
# DICOM mono1 min-is-white<br />
# DICOM mono2 min-is-black<br />
# DICOM YBR<br />
# [https://sourceforge.net/p/gdcm/gdcmdata/ci/master/tree/US-YBR_FULL_422-EVRLE.dcm| DICOM YBR_422]<br />
# [https://sourceforge.net/p/gdcm/gdcmdata/ci/master/tree/US-GE-4AICL142.dcm| DICOM JPEG/YBR_422]<br />
# DICOM RGB<br />
# DICOM YBR_RCT<br />
# DICOM YBR_ICT<br />
<br />
== References ==<br />
<br />
* http://dicom.nema.org/medical/dicom/current/output/chtml/part03/sect_C.7.6.3.html#sect_C.7.6.3.1.2<br />
* http://gdcm.sourceforge.net/wiki/index.php/Color_Space_Transformations</div>Blowekamphttps://public.kitware.com/Wiki/index.php?title=ITK/Release_5/DICOM/Color&diff=63970ITK/Release 5/DICOM/Color2019-10-11T13:59:31Z<p>Blowekamp: /* Issue */</p>
<hr />
<div>= Multiple Components in DICOM =<br />
<br />
== ITK 5.0 ==<br />
<br />
DICOM standard allow storing of image with more than one components. As of today, only 1 or 3 components are considered valid DICOM SOP Class instances (for all IODs).<br />
<br />
By design the itk::GDCMImageIO was designed and implemented so that an input YBR_FULL image would be loaded as such (no implicit conversion to RGB was done). The main reason for that is that ITK is a processing toolkit, so quantitative analysis is supposed to be done on the best possible pixel representation. Since conversion from integer YBR_FULL to integer RGB colorspace is a lossy operation (truncation in floating point representation), the conversion has never been implemented.<br />
<br />
As side note MONOCHROME1 color space is not converted to MONOCHROME2 (itk::GDCMImageIO / ITK 5.0)<br />
<br />
== Issue ==<br />
<br />
This behavior was considered ok, as long as the image was not directly loaded in viz application such as Slicer, where unexpectedly the image would appears with a weird color scheme. (original bug report from Mihail Isakov)<br />
<br />
BCL: After hearing the descriptions of the issue, I considered loading YBR directly as a bug because GDCMImageIO was reporting the pixel type as `IOPixelType::RGB` and the buffer was in YBR color space. If the image is loaded in YBR color space is should have a different `IOPixelType` may be `VECTOR` or `FIXEDARRAY` for lack of a more descriptive `IOPixelType`.<br />
<br />
== Notation ==<br />
<br />
# JPEG refers to the subset of ITU-T T.81, ISO/IEC IS 10918-1 (lossy 8bits)<br />
# JPEG 2000 refers to ITU-T T.800, ISO/IEC IS 15444-1<br />
<br />
== ITK 5.x ==<br />
<br />
The behavior for YBR_FULL vs RGB color model has been discussed and it seems consensus would be to convert to RGB always. Since DICOM, JPEG and TIFF can be somewhat relates for this matter, we should strive to keep the behavior consistent.<br />
<br />
Current behavior of ITK 5.0:<br />
<br />
{| border="1" style="text-align:center"<br />
|- bgcolor="#abcdef"<br />
! Photometric Interpretation !! JPEG !! TIFF !! GDCM !! DCMTK<br />
|-<br />
! MONOCHROME1 || style="background:silver" | X || style="background:orange" |MONOCHROME2 (aka min-is-black) || style="background:lime" |MONOCHROME1 || style="background:lime" |?MONOCHROME1?<br />
|- <br />
! MONOCHROME2 || style="background:lime" | MONOCHROME2 || style="background:lime" |MONOCHROME2 (aka min-is-black) || style="background:lime" |MONOCHROME2 || style="background:lime" |MONOCHROME2<br />
|-<br />
! PALETTE COLOR || style="background:silver" |X || style="background:orange" | RGB (??) || style="background:orange" | Converted to RGB || style="background:orange" | ?Converted to RGB? (need to check compressed LUT)<br />
|-<br />
! RGB || style="background:orange" |RGB || RGB|| RGB || ?RGB?<br />
|- style="background:silver"<br />
! HSV || || || || <br />
|- style="background:silver"<br />
! ARGB || || || || <br />
|- style="background:silver"<br />
! CMYK || || || || <br />
|-<br />
! YBR_FULL || style="background:silver" |ITU 81 enforce sub-sampling|| ?? || YBR_FULL || ??<br />
|-<br />
! YBR_FULL_422 || style="background:orange" |RGB || style="background:orange" |RGB || YBR_FULL || ??Maybe RGB?<br />
|- style="background:silver"<br />
! YBR_PARTIAL_422 || || || || <br />
|- style="background:silver"<br />
! YBR_PARTIAL_420 || || || || <br />
|-<br />
! YBR_ICT || style="background:silver" |ITU 81 does not support this colorspace || ?? || style="background:orange" |RGB || style="background:red" |no J2K plugin<br />
|-<br />
! YBR_RCT || style="background:silver" |ITU 81 does not support this colorspace || ?? || RGB || style="background:red" |no J2K plugin<br />
|-<br />
|}<br />
<br />
<br />
Desired behavior of ITK 5.0:<br />
<br />
{| border="1" style="text-align:center"<br />
|- bgcolor="#abcdef"<br />
! Photometric Interpretation !! JPEG !! TIFF !! GDCM !! DCMTK<br />
|-<br />
! MONOCHROME1 || style="background:silver" | X || style="background:orange" |MONOCHROME2 (aka min-is-black)|| style="background:orange" |MONOCHROME2 || style="background:orange" |MONOCHROME2<br />
|- <br />
! MONOCHROME2 || style="background:lime" | MONOCHROME2 || style="background:lime" |MONOCHROME2 (aka min-is-black)|| style="background:lime" |MONOCHROME2 || style="background:lime" |MONOCHROME2<br />
|-<br />
! PALETTE COLOR || style="background:silver" | X || style="background:orange" | RGB || style="background:orange" | Converted to RGB || style="background:orange" | RGB<br />
|-<br />
! RGB || style="background:orange" |RGB || RGB|| RGB || ?RGB?<br />
|- style="background:silver"<br />
! HSV || || || || <br />
|- style="background:silver"<br />
! ARGB || || || || <br />
|- style="background:silver"<br />
! CMYK || || || || <br />
|-<br />
! YBR_FULL || style="background:silver" |ITU 81 enforce sub-sampling|| ?? || style="background:orange" |RGB || style="background:orange" |RGB<br />
|-<br />
! YBR_FULL_422 || style="background:orange" |RGB || style="background:orange" |RGB || style="background:orange" |RGB || style="background:orange" |RGB<br />
|- style="background:silver"<br />
! YBR_PARTIAL_422 || || || || <br />
|- style="background:silver"<br />
! YBR_PARTIAL_420 || || || || <br />
|-<br />
! YBR_ICT || || || style="background:orange" |RGB || style="background:red" |no J2K plugin<br />
|-<br />
! YBR_RCT || || || RGB || style="background:red" |no J2K plugin<br />
|-<br />
|}<br />
<br />
BCL: What do the Color mean? Perhaps we should also include the `ImageIOBase::IOPixelType` in these cells?<br />
<br />
== Discussion ==<br />
<br />
Participants:<br />
# Mathieu Malaterre<br />
# Mihail Isakov<br />
# Bradley Lowekamp<br />
<br />
For visualization people it is important that:<br />
<br />
# MONOCHROME1 (min-is-white) is converted to MONOCHROME2 (min-is-black) <br />
# YBR_FULL / YBR_FULL_422 are converted to RGB<br />
<br />
The requirements for quantitative analysis may be different, please list reqs here:<br />
<br />
#? Extract Luminance out of YBR ?<br />
# ? Need MONOCHROME1 native support, because <fill reason ??><br />
# ? Is there a need to manipulated native palette data ? I doubt so<br />
## BL: The `ExpandRGBPalette` attribute was just added to `ImageIOBase`, for feature consistency it would be nice to support this feature. https://itk.org/Doxygen/html/classitk_1_1ImageIOBase.html#a04804c60d755ae102e104261536a0f46 https://github.com/InsightSoftwareConsortium/ITK/pull/1219/files<br />
<br />
For ITK consistency it is important that the `ImageIOBase::PixelType` is set correctly so that users of the `ITK::ImageIOBase` API know generally what the image buffer is and how to load and use the image. We likely should improve the documentation in the ImageIOBase class about the expectations for how these are used. Here is a list of type pertinent to this discussion:<br />
# RGB<br />
## BL: should only be used for general RGB buffers. This is not very descriptive of the color space sRGB, AdobeRGB, Linear RGB etc., but using this as a type for general "color" buffers should be avoided IMHO.<br />
# SCALAR<br />
## BL: Images of unapplied palettes, when ExpandRGBPalette is false, are currently labeled as scalars<br />
# VECTOR<br />
## BL: Currently this is frequently used for displacement fields.<br />
# FIXEDARRAY<br />
## BL: Not regularly used to my knowledge, and may be the most generic multi-component `PixelType`, so this may be the base label to used for YBR, CMYK etc.<br />
<br />
== Data ==<br />
<br />
# JPEG 8 bits mono2<br />
# JPEG 8 bits YBR_422<br />
# JPEG 8 bits RGB<br />
# TIFF mono1 min-is-white<br />
# TIFF mono2 min-is-black<br />
# TIFF YBR_422<br />
# TIFF RGB<br />
# DICOM mono1 min-is-white<br />
# DICOM mono2 min-is-black<br />
# DICOM YBR<br />
# [https://sourceforge.net/p/gdcm/gdcmdata/ci/master/tree/US-YBR_FULL_422-EVRLE.dcm| DICOM YBR_422]<br />
# [https://sourceforge.net/p/gdcm/gdcmdata/ci/master/tree/US-GE-4AICL142.dcm| DICOM JPEG/YBR_422]<br />
# DICOM RGB<br />
# DICOM YBR_RCT<br />
# DICOM YBR_ICT<br />
<br />
== References ==<br />
<br />
* http://dicom.nema.org/medical/dicom/current/output/chtml/part03/sect_C.7.6.3.html#sect_C.7.6.3.1.2<br />
* http://gdcm.sourceforge.net/wiki/index.php/Color_Space_Transformations</div>Blowekamphttps://public.kitware.com/Wiki/index.php?title=ITK/Release_5/DICOM/Color&diff=63969ITK/Release 5/DICOM/Color2019-10-11T13:58:01Z<p>Blowekamp: /* Discussion */</p>
<hr />
<div>= Multiple Components in DICOM =<br />
<br />
== ITK 5.0 ==<br />
<br />
DICOM standard allow storing of image with more than one components. As of today, only 1 or 3 components are considered valid DICOM SOP Class instances (for all IODs).<br />
<br />
By design the itk::GDCMImageIO was designed and implemented so that an input YBR_FULL image would be loaded as such (no implicit conversion to RGB was done). The main reason for that is that ITK is a processing toolkit, so quantitative analysis is supposed to be done on the best possible pixel representation. Since conversion from integer YBR_FULL to integer RGB colorspace is a lossy operation (truncation in floating point representation), the conversion has never been implemented.<br />
<br />
As side note MONOCHROME1 color space is not converted to MONOCHROME2 (itk::GDCMImageIO / ITK 5.0)<br />
<br />
== Issue ==<br />
<br />
This behavior was considered ok, as long as the image was not directly loaded in viz application such as Slicer, where suddenly the image would appears with a weird color scheme. (original bug report from Mihail Isakov)<br />
<br />
BCL: After hearing the descriptions of the issue, I considered this a bug because GDCMImageIO was reporting the pixel type as `IOPixelType::RGBl` and the buffer was not in RGB color space it was YBR. If the image is loaded in YBR color space is should have a different `IOPixelType` may be `VECTOR` or `FIXEDARRAY` for lack of a more descriptive `IOPixelType`.<br />
<br />
== Notation ==<br />
<br />
# JPEG refers to the subset of ITU-T T.81, ISO/IEC IS 10918-1 (lossy 8bits)<br />
# JPEG 2000 refers to ITU-T T.800, ISO/IEC IS 15444-1<br />
<br />
== ITK 5.x ==<br />
<br />
The behavior for YBR_FULL vs RGB color model has been discussed and it seems consensus would be to convert to RGB always. Since DICOM, JPEG and TIFF can be somewhat relates for this matter, we should strive to keep the behavior consistent.<br />
<br />
Current behavior of ITK 5.0:<br />
<br />
{| border="1" style="text-align:center"<br />
|- bgcolor="#abcdef"<br />
! Photometric Interpretation !! JPEG !! TIFF !! GDCM !! DCMTK<br />
|-<br />
! MONOCHROME1 || style="background:silver" | X || style="background:orange" |MONOCHROME2 (aka min-is-black) || style="background:lime" |MONOCHROME1 || style="background:lime" |?MONOCHROME1?<br />
|- <br />
! MONOCHROME2 || style="background:lime" | MONOCHROME2 || style="background:lime" |MONOCHROME2 (aka min-is-black) || style="background:lime" |MONOCHROME2 || style="background:lime" |MONOCHROME2<br />
|-<br />
! PALETTE COLOR || style="background:silver" |X || style="background:orange" | RGB (??) || style="background:orange" | Converted to RGB || style="background:orange" | ?Converted to RGB? (need to check compressed LUT)<br />
|-<br />
! RGB || style="background:orange" |RGB || RGB|| RGB || ?RGB?<br />
|- style="background:silver"<br />
! HSV || || || || <br />
|- style="background:silver"<br />
! ARGB || || || || <br />
|- style="background:silver"<br />
! CMYK || || || || <br />
|-<br />
! YBR_FULL || style="background:silver" |ITU 81 enforce sub-sampling|| ?? || YBR_FULL || ??<br />
|-<br />
! YBR_FULL_422 || style="background:orange" |RGB || style="background:orange" |RGB || YBR_FULL || ??Maybe RGB?<br />
|- style="background:silver"<br />
! YBR_PARTIAL_422 || || || || <br />
|- style="background:silver"<br />
! YBR_PARTIAL_420 || || || || <br />
|-<br />
! YBR_ICT || style="background:silver" |ITU 81 does not support this colorspace || ?? || style="background:orange" |RGB || style="background:red" |no J2K plugin<br />
|-<br />
! YBR_RCT || style="background:silver" |ITU 81 does not support this colorspace || ?? || RGB || style="background:red" |no J2K plugin<br />
|-<br />
|}<br />
<br />
<br />
Desired behavior of ITK 5.0:<br />
<br />
{| border="1" style="text-align:center"<br />
|- bgcolor="#abcdef"<br />
! Photometric Interpretation !! JPEG !! TIFF !! GDCM !! DCMTK<br />
|-<br />
! MONOCHROME1 || style="background:silver" | X || style="background:orange" |MONOCHROME2 (aka min-is-black)|| style="background:orange" |MONOCHROME2 || style="background:orange" |MONOCHROME2<br />
|- <br />
! MONOCHROME2 || style="background:lime" | MONOCHROME2 || style="background:lime" |MONOCHROME2 (aka min-is-black)|| style="background:lime" |MONOCHROME2 || style="background:lime" |MONOCHROME2<br />
|-<br />
! PALETTE COLOR || style="background:silver" | X || style="background:orange" | RGB || style="background:orange" | Converted to RGB || style="background:orange" | RGB<br />
|-<br />
! RGB || style="background:orange" |RGB || RGB|| RGB || ?RGB?<br />
|- style="background:silver"<br />
! HSV || || || || <br />
|- style="background:silver"<br />
! ARGB || || || || <br />
|- style="background:silver"<br />
! CMYK || || || || <br />
|-<br />
! YBR_FULL || style="background:silver" |ITU 81 enforce sub-sampling|| ?? || style="background:orange" |RGB || style="background:orange" |RGB<br />
|-<br />
! YBR_FULL_422 || style="background:orange" |RGB || style="background:orange" |RGB || style="background:orange" |RGB || style="background:orange" |RGB<br />
|- style="background:silver"<br />
! YBR_PARTIAL_422 || || || || <br />
|- style="background:silver"<br />
! YBR_PARTIAL_420 || || || || <br />
|-<br />
! YBR_ICT || || || style="background:orange" |RGB || style="background:red" |no J2K plugin<br />
|-<br />
! YBR_RCT || || || RGB || style="background:red" |no J2K plugin<br />
|-<br />
|}<br />
<br />
BCL: What do the Color mean? Perhaps we should also include the `ImageIOBase::IOPixelType` in these cells?<br />
<br />
== Discussion ==<br />
<br />
Participants:<br />
# Mathieu Malaterre<br />
# Mihail Isakov<br />
# Bradley Lowekamp<br />
<br />
For visualization people it is important that:<br />
<br />
# MONOCHROME1 (min-is-white) is converted to MONOCHROME2 (min-is-black) <br />
# YBR_FULL / YBR_FULL_422 are converted to RGB<br />
<br />
The requirements for quantitative analysis may be different, please list reqs here:<br />
<br />
#? Extract Luminance out of YBR ?<br />
# ? Need MONOCHROME1 native support, because <fill reason ??><br />
# ? Is there a need to manipulated native palette data ? I doubt so<br />
## BL: The `ExpandRGBPalette` attribute was just added to `ImageIOBase`, for feature consistency it would be nice to support this feature. https://itk.org/Doxygen/html/classitk_1_1ImageIOBase.html#a04804c60d755ae102e104261536a0f46 https://github.com/InsightSoftwareConsortium/ITK/pull/1219/files<br />
<br />
For ITK consistency it is important that the `ImageIOBase::PixelType` is set correctly so that users of the `ITK::ImageIOBase` API know generally what the image buffer is and how to load and use the image. We likely should improve the documentation in the ImageIOBase class about the expectations for how these are used. Here is a list of type pertinent to this discussion:<br />
# RGB<br />
## BL: should only be used for general RGB buffers. This is not very descriptive of the color space sRGB, AdobeRGB, Linear RGB etc., but using this as a type for general "color" buffers should be avoided IMHO.<br />
# SCALAR<br />
## BL: Images of unapplied palettes, when ExpandRGBPalette is false, are currently labeled as scalars<br />
# VECTOR<br />
## BL: Currently this is frequently used for displacement fields.<br />
# FIXEDARRAY<br />
## BL: Not regularly used to my knowledge, and may be the most generic multi-component `PixelType`, so this may be the base label to used for YBR, CMYK etc.<br />
<br />
== Data ==<br />
<br />
# JPEG 8 bits mono2<br />
# JPEG 8 bits YBR_422<br />
# JPEG 8 bits RGB<br />
# TIFF mono1 min-is-white<br />
# TIFF mono2 min-is-black<br />
# TIFF YBR_422<br />
# TIFF RGB<br />
# DICOM mono1 min-is-white<br />
# DICOM mono2 min-is-black<br />
# DICOM YBR<br />
# [https://sourceforge.net/p/gdcm/gdcmdata/ci/master/tree/US-YBR_FULL_422-EVRLE.dcm| DICOM YBR_422]<br />
# [https://sourceforge.net/p/gdcm/gdcmdata/ci/master/tree/US-GE-4AICL142.dcm| DICOM JPEG/YBR_422]<br />
# DICOM RGB<br />
# DICOM YBR_RCT<br />
# DICOM YBR_ICT<br />
<br />
== References ==<br />
<br />
* http://dicom.nema.org/medical/dicom/current/output/chtml/part03/sect_C.7.6.3.html#sect_C.7.6.3.1.2<br />
* http://gdcm.sourceforge.net/wiki/index.php/Color_Space_Transformations</div>Blowekamphttps://public.kitware.com/Wiki/index.php?title=ITK/Release_5/DICOM/Color&diff=63968ITK/Release 5/DICOM/Color2019-10-11T13:44:18Z<p>Blowekamp: /* ITK 5.x */</p>
<hr />
<div>= Multiple Components in DICOM =<br />
<br />
== ITK 5.0 ==<br />
<br />
DICOM standard allow storing of image with more than one components. As of today, only 1 or 3 components are considered valid DICOM SOP Class instances (for all IODs).<br />
<br />
By design the itk::GDCMImageIO was designed and implemented so that an input YBR_FULL image would be loaded as such (no implicit conversion to RGB was done). The main reason for that is that ITK is a processing toolkit, so quantitative analysis is supposed to be done on the best possible pixel representation. Since conversion from integer YBR_FULL to integer RGB colorspace is a lossy operation (truncation in floating point representation), the conversion has never been implemented.<br />
<br />
As side note MONOCHROME1 color space is not converted to MONOCHROME2 (itk::GDCMImageIO / ITK 5.0)<br />
<br />
== Issue ==<br />
<br />
This behavior was considered ok, as long as the image was not directly loaded in viz application such as Slicer, where suddenly the image would appears with a weird color scheme. (original bug report from Mihail Isakov)<br />
<br />
BCL: After hearing the descriptions of the issue, I considered this a bug because GDCMImageIO was reporting the pixel type as `IOPixelType::RGBl` and the buffer was not in RGB color space it was YBR. If the image is loaded in YBR color space is should have a different `IOPixelType` may be `VECTOR` or `FIXEDARRAY` for lack of a more descriptive `IOPixelType`.<br />
<br />
== Notation ==<br />
<br />
# JPEG refers to the subset of ITU-T T.81, ISO/IEC IS 10918-1 (lossy 8bits)<br />
# JPEG 2000 refers to ITU-T T.800, ISO/IEC IS 15444-1<br />
<br />
== ITK 5.x ==<br />
<br />
The behavior for YBR_FULL vs RGB color model has been discussed and it seems consensus would be to convert to RGB always. Since DICOM, JPEG and TIFF can be somewhat relates for this matter, we should strive to keep the behavior consistent.<br />
<br />
Current behavior of ITK 5.0:<br />
<br />
{| border="1" style="text-align:center"<br />
|- bgcolor="#abcdef"<br />
! Photometric Interpretation !! JPEG !! TIFF !! GDCM !! DCMTK<br />
|-<br />
! MONOCHROME1 || style="background:silver" | X || style="background:orange" |MONOCHROME2 (aka min-is-black) || style="background:lime" |MONOCHROME1 || style="background:lime" |?MONOCHROME1?<br />
|- <br />
! MONOCHROME2 || style="background:lime" | MONOCHROME2 || style="background:lime" |MONOCHROME2 (aka min-is-black) || style="background:lime" |MONOCHROME2 || style="background:lime" |MONOCHROME2<br />
|-<br />
! PALETTE COLOR || style="background:silver" |X || style="background:orange" | RGB (??) || style="background:orange" | Converted to RGB || style="background:orange" | ?Converted to RGB? (need to check compressed LUT)<br />
|-<br />
! RGB || style="background:orange" |RGB || RGB|| RGB || ?RGB?<br />
|- style="background:silver"<br />
! HSV || || || || <br />
|- style="background:silver"<br />
! ARGB || || || || <br />
|- style="background:silver"<br />
! CMYK || || || || <br />
|-<br />
! YBR_FULL || style="background:silver" |ITU 81 enforce sub-sampling|| ?? || YBR_FULL || ??<br />
|-<br />
! YBR_FULL_422 || style="background:orange" |RGB || style="background:orange" |RGB || YBR_FULL || ??Maybe RGB?<br />
|- style="background:silver"<br />
! YBR_PARTIAL_422 || || || || <br />
|- style="background:silver"<br />
! YBR_PARTIAL_420 || || || || <br />
|-<br />
! YBR_ICT || style="background:silver" |ITU 81 does not support this colorspace || ?? || style="background:orange" |RGB || style="background:red" |no J2K plugin<br />
|-<br />
! YBR_RCT || style="background:silver" |ITU 81 does not support this colorspace || ?? || RGB || style="background:red" |no J2K plugin<br />
|-<br />
|}<br />
<br />
<br />
Desired behavior of ITK 5.0:<br />
<br />
{| border="1" style="text-align:center"<br />
|- bgcolor="#abcdef"<br />
! Photometric Interpretation !! JPEG !! TIFF !! GDCM !! DCMTK<br />
|-<br />
! MONOCHROME1 || style="background:silver" | X || style="background:orange" |MONOCHROME2 (aka min-is-black)|| style="background:orange" |MONOCHROME2 || style="background:orange" |MONOCHROME2<br />
|- <br />
! MONOCHROME2 || style="background:lime" | MONOCHROME2 || style="background:lime" |MONOCHROME2 (aka min-is-black)|| style="background:lime" |MONOCHROME2 || style="background:lime" |MONOCHROME2<br />
|-<br />
! PALETTE COLOR || style="background:silver" | X || style="background:orange" | RGB || style="background:orange" | Converted to RGB || style="background:orange" | RGB<br />
|-<br />
! RGB || style="background:orange" |RGB || RGB|| RGB || ?RGB?<br />
|- style="background:silver"<br />
! HSV || || || || <br />
|- style="background:silver"<br />
! ARGB || || || || <br />
|- style="background:silver"<br />
! CMYK || || || || <br />
|-<br />
! YBR_FULL || style="background:silver" |ITU 81 enforce sub-sampling|| ?? || style="background:orange" |RGB || style="background:orange" |RGB<br />
|-<br />
! YBR_FULL_422 || style="background:orange" |RGB || style="background:orange" |RGB || style="background:orange" |RGB || style="background:orange" |RGB<br />
|- style="background:silver"<br />
! YBR_PARTIAL_422 || || || || <br />
|- style="background:silver"<br />
! YBR_PARTIAL_420 || || || || <br />
|-<br />
! YBR_ICT || || || style="background:orange" |RGB || style="background:red" |no J2K plugin<br />
|-<br />
! YBR_RCT || || || RGB || style="background:red" |no J2K plugin<br />
|-<br />
|}<br />
<br />
BCL: What do the Color mean? Perhaps we should also include the `ImageIOBase::IOPixelType` in these cells?<br />
<br />
== Discussion ==<br />
<br />
Participants:<br />
# Mathieu Malaterre<br />
# Mihail Isakov<br />
<br />
For visualization people it is important that:<br />
<br />
# MONOCHROME1 (min-is-white) is converted to MONOCHROME2 (min-is-black) <br />
# YBR_FULL / YBR_FULL_422 are converted to RGB<br />
<br />
The requirements for quantitative analysis may be different, please list reqs here:<br />
<br />
#? Extract Luminance out of YBR ?<br />
# ? Need MONOCHROME1 native support, because <fill reason ??><br />
# ? Is there a need to manipulated native palette data ? I doubt so<br />
<br />
== Data ==<br />
<br />
# JPEG 8 bits mono2<br />
# JPEG 8 bits YBR_422<br />
# JPEG 8 bits RGB<br />
# TIFF mono1 min-is-white<br />
# TIFF mono2 min-is-black<br />
# TIFF YBR_422<br />
# TIFF RGB<br />
# DICOM mono1 min-is-white<br />
# DICOM mono2 min-is-black<br />
# DICOM YBR<br />
# [https://sourceforge.net/p/gdcm/gdcmdata/ci/master/tree/US-YBR_FULL_422-EVRLE.dcm| DICOM YBR_422]<br />
# [https://sourceforge.net/p/gdcm/gdcmdata/ci/master/tree/US-GE-4AICL142.dcm| DICOM JPEG/YBR_422]<br />
# DICOM RGB<br />
# DICOM YBR_RCT<br />
# DICOM YBR_ICT<br />
<br />
== References ==<br />
<br />
* http://dicom.nema.org/medical/dicom/current/output/chtml/part03/sect_C.7.6.3.html#sect_C.7.6.3.1.2<br />
* http://gdcm.sourceforge.net/wiki/index.php/Color_Space_Transformations</div>Blowekamphttps://public.kitware.com/Wiki/index.php?title=ITK/Release_5/DICOM/Color&diff=63967ITK/Release 5/DICOM/Color2019-10-11T13:43:25Z<p>Blowekamp: /* ITK 5.x */</p>
<hr />
<div>= Multiple Components in DICOM =<br />
<br />
== ITK 5.0 ==<br />
<br />
DICOM standard allow storing of image with more than one components. As of today, only 1 or 3 components are considered valid DICOM SOP Class instances (for all IODs).<br />
<br />
By design the itk::GDCMImageIO was designed and implemented so that an input YBR_FULL image would be loaded as such (no implicit conversion to RGB was done). The main reason for that is that ITK is a processing toolkit, so quantitative analysis is supposed to be done on the best possible pixel representation. Since conversion from integer YBR_FULL to integer RGB colorspace is a lossy operation (truncation in floating point representation), the conversion has never been implemented.<br />
<br />
As side note MONOCHROME1 color space is not converted to MONOCHROME2 (itk::GDCMImageIO / ITK 5.0)<br />
<br />
== Issue ==<br />
<br />
This behavior was considered ok, as long as the image was not directly loaded in viz application such as Slicer, where suddenly the image would appears with a weird color scheme. (original bug report from Mihail Isakov)<br />
<br />
BCL: After hearing the descriptions of the issue, I considered this a bug because GDCMImageIO was reporting the pixel type as `IOPixelType::RGBl` and the buffer was not in RGB color space it was YBR. If the image is loaded in YBR color space is should have a different `IOPixelType` may be `VECTOR` or `FIXEDARRAY` for lack of a more descriptive `IOPixelType`.<br />
<br />
== Notation ==<br />
<br />
# JPEG refers to the subset of ITU-T T.81, ISO/IEC IS 10918-1 (lossy 8bits)<br />
# JPEG 2000 refers to ITU-T T.800, ISO/IEC IS 15444-1<br />
<br />
== ITK 5.x ==<br />
<br />
The behavior for YBR_FULL vs RGB color model has been discussed and it seems consensus would be to convert to RGB always. Since DICOM, JPEG and TIFF can be somewhat relates for this matter, we should strive to keep the behavior consistent.<br />
<br />
Current behavior of ITK 5.0:<br />
<br />
{| border="1" style="text-align:center"<br />
|- bgcolor="#abcdef"<br />
! Photometric Interpretation !! JPEG !! TIFF !! GDCM !! DCMTK<br />
|-<br />
! MONOCHROME1 || style="background:silver" | X || style="background:orange" |MONOCHROME2 (aka min-is-black) || style="background:lime" |MONOCHROME1 || style="background:lime" |?MONOCHROME1?<br />
|- <br />
! MONOCHROME2 || style="background:lime" | MONOCHROME2 || style="background:lime" |MONOCHROME2 (aka min-is-black) || style="background:lime" |MONOCHROME2 || style="background:lime" |MONOCHROME2<br />
|-<br />
! PALETTE COLOR || style="background:silver" |X || style="background:orange" | RGB (??) || style="background:orange" | Converted to RGB || style="background:orange" | ?Converted to RGB? (need to check compressed LUT)<br />
|-<br />
! RGB || style="background:orange" |RGB || RGB|| RGB || ?RGB?<br />
|- style="background:silver"<br />
! HSV || || || || <br />
|- style="background:silver"<br />
! ARGB || || || || <br />
|- style="background:silver"<br />
! CMYK || || || || <br />
|-<br />
! YBR_FULL || style="background:silver" |ITU 81 enforce sub-sampling|| ?? || YBR_FULL || ??<br />
|-<br />
! YBR_FULL_422 || style="background:orange" |RGB || style="background:orange" |RGB || YBR_FULL || ??Maybe RGB?<br />
|- style="background:silver"<br />
! YBR_PARTIAL_422 || || || || <br />
|- style="background:silver"<br />
! YBR_PARTIAL_420 || || || || <br />
|-<br />
! YBR_ICT || style="background:silver" |ITU 81 does not support this colorspace || ?? || style="background:orange" |RGB || style="background:red" |no J2K plugin<br />
|-<br />
! YBR_RCT || style="background:silver" |ITU 81 does not support this colorspace || ?? || RGB || style="background:red" |no J2K plugin<br />
|-<br />
|}<br />
<br />
<br />
Desired behavior of ITK 5.0:<br />
<br />
{| border="1" style="text-align:center"<br />
|- bgcolor="#abcdef"<br />
! Photometric Interpretation !! JPEG !! TIFF !! GDCM !! DCMTK<br />
|-<br />
! MONOCHROME1 || style="background:silver" | X || style="background:orange" |MONOCHROME2 (aka min-is-black)|| style="background:orange" |MONOCHROME2 || style="background:orange" |MONOCHROME2<br />
|- <br />
! MONOCHROME2 || style="background:lime" | MONOCHROME2 || style="background:lime" |MONOCHROME2 (aka min-is-black)|| style="background:lime" |MONOCHROME2 || style="background:lime" |MONOCHROME2<br />
|-<br />
! PALETTE COLOR || style="background:silver" | X || style="background:orange" | RGB || style="background:orange" | Converted to RGB || style="background:orange" | RGB<br />
|-<br />
! RGB || style="background:orange" |RGB || RGB|| RGB || ?RGB?<br />
|- style="background:silver"<br />
! HSV || || || || <br />
|- style="background:silver"<br />
! ARGB || || || || <br />
|- style="background:silver"<br />
! CMYK || || || || <br />
|-<br />
! YBR_FULL || style="background:silver" |ITU 81 enforce sub-sampling|| ?? || style="background:orange" |RGB || style="background:orange" |RGB<br />
|-<br />
! YBR_FULL_422 || style="background:orange" |RGB || style="background:orange" |RGB || style="background:orange" |RGB || style="background:orange" |RGB<br />
|- style="background:silver"<br />
! YBR_PARTIAL_422 || || || || <br />
|- style="background:silver"<br />
! YBR_PARTIAL_420 || || || || <br />
|-<br />
! YBR_ICT || || || style="background:orange" |RGB || style="background:red" |no J2K plugin<br />
|-<br />
! YBR_RCT || || || RGB || style="background:red" |no J2K plugin<br />
|-<br />
|}<br />
<br />
BCL: What do the Color mean?<br />
<br />
== Discussion ==<br />
<br />
Participants:<br />
# Mathieu Malaterre<br />
# Mihail Isakov<br />
<br />
For visualization people it is important that:<br />
<br />
# MONOCHROME1 (min-is-white) is converted to MONOCHROME2 (min-is-black) <br />
# YBR_FULL / YBR_FULL_422 are converted to RGB<br />
<br />
The requirements for quantitative analysis may be different, please list reqs here:<br />
<br />
#? Extract Luminance out of YBR ?<br />
# ? Need MONOCHROME1 native support, because <fill reason ??><br />
# ? Is there a need to manipulated native palette data ? I doubt so<br />
<br />
== Data ==<br />
<br />
# JPEG 8 bits mono2<br />
# JPEG 8 bits YBR_422<br />
# JPEG 8 bits RGB<br />
# TIFF mono1 min-is-white<br />
# TIFF mono2 min-is-black<br />
# TIFF YBR_422<br />
# TIFF RGB<br />
# DICOM mono1 min-is-white<br />
# DICOM mono2 min-is-black<br />
# DICOM YBR<br />
# [https://sourceforge.net/p/gdcm/gdcmdata/ci/master/tree/US-YBR_FULL_422-EVRLE.dcm| DICOM YBR_422]<br />
# [https://sourceforge.net/p/gdcm/gdcmdata/ci/master/tree/US-GE-4AICL142.dcm| DICOM JPEG/YBR_422]<br />
# DICOM RGB<br />
# DICOM YBR_RCT<br />
# DICOM YBR_ICT<br />
<br />
== References ==<br />
<br />
* http://dicom.nema.org/medical/dicom/current/output/chtml/part03/sect_C.7.6.3.html#sect_C.7.6.3.1.2<br />
* http://gdcm.sourceforge.net/wiki/index.php/Color_Space_Transformations</div>Blowekamphttps://public.kitware.com/Wiki/index.php?title=ITK/Release_5/DICOM/Color&diff=63966ITK/Release 5/DICOM/Color2019-10-11T13:39:54Z<p>Blowekamp: /* Issue */</p>
<hr />
<div>= Multiple Components in DICOM =<br />
<br />
== ITK 5.0 ==<br />
<br />
DICOM standard allow storing of image with more than one components. As of today, only 1 or 3 components are considered valid DICOM SOP Class instances (for all IODs).<br />
<br />
By design the itk::GDCMImageIO was designed and implemented so that an input YBR_FULL image would be loaded as such (no implicit conversion to RGB was done). The main reason for that is that ITK is a processing toolkit, so quantitative analysis is supposed to be done on the best possible pixel representation. Since conversion from integer YBR_FULL to integer RGB colorspace is a lossy operation (truncation in floating point representation), the conversion has never been implemented.<br />
<br />
As side note MONOCHROME1 color space is not converted to MONOCHROME2 (itk::GDCMImageIO / ITK 5.0)<br />
<br />
== Issue ==<br />
<br />
This behavior was considered ok, as long as the image was not directly loaded in viz application such as Slicer, where suddenly the image would appears with a weird color scheme. (original bug report from Mihail Isakov)<br />
<br />
BCL: After hearing the descriptions of the issue, I considered this a bug because GDCMImageIO was reporting the pixel type as `IOPixelType::RGBl` and the buffer was not in RGB color space it was YBR. If the image is loaded in YBR color space is should have a different `IOPixelType` may be `VECTOR` or `FIXEDARRAY` for lack of a more descriptive `IOPixelType`.<br />
<br />
== Notation ==<br />
<br />
# JPEG refers to the subset of ITU-T T.81, ISO/IEC IS 10918-1 (lossy 8bits)<br />
# JPEG 2000 refers to ITU-T T.800, ISO/IEC IS 15444-1<br />
<br />
== ITK 5.x ==<br />
<br />
The behavior for YBR_FULL vs RGB color model has been discussed and it seems consensus would be to convert to RGB always. Since DICOM, JPEG and TIFF can be somewhat relates for this matter, we should strive to keep the behavior consistent.<br />
<br />
Current behavior of ITK 5.0:<br />
<br />
{| border="1" style="text-align:center"<br />
|- bgcolor="#abcdef"<br />
! Photometric Interpretation !! JPEG !! TIFF !! GDCM !! DCMTK<br />
|-<br />
! MONOCHROME1 || style="background:silver" | X || style="background:orange" |MONOCHROME2 (aka min-is-black) || style="background:lime" |MONOCHROME1 || style="background:lime" |?MONOCHROME1?<br />
|- <br />
! MONOCHROME2 || style="background:lime" | MONOCHROME2 || style="background:lime" |MONOCHROME2 (aka min-is-black) || style="background:lime" |MONOCHROME2 || style="background:lime" |MONOCHROME2<br />
|-<br />
! PALETTE COLOR || style="background:silver" |X || style="background:orange" | RGB (??) || style="background:orange" | Converted to RGB || style="background:orange" | ?Converted to RGB? (need to check compressed LUT)<br />
|-<br />
! RGB || style="background:orange" |RGB || RGB|| RGB || ?RGB?<br />
|- style="background:silver"<br />
! HSV || || || || <br />
|- style="background:silver"<br />
! ARGB || || || || <br />
|- style="background:silver"<br />
! CMYK || || || || <br />
|-<br />
! YBR_FULL || style="background:silver" |ITU 81 enforce sub-sampling|| ?? || YBR_FULL || ??<br />
|-<br />
! YBR_FULL_422 || style="background:orange" |RGB || style="background:orange" |RGB || YBR_FULL || ??Maybe RGB?<br />
|- style="background:silver"<br />
! YBR_PARTIAL_422 || || || || <br />
|- style="background:silver"<br />
! YBR_PARTIAL_420 || || || || <br />
|-<br />
! YBR_ICT || style="background:silver" |ITU 81 does not support this colorspace || ?? || style="background:orange" |RGB || style="background:red" |no J2K plugin<br />
|-<br />
! YBR_RCT || style="background:silver" |ITU 81 does not support this colorspace || ?? || RGB || style="background:red" |no J2K plugin<br />
|-<br />
|}<br />
<br />
<br />
Desired behavior of ITK 5.0:<br />
<br />
{| border="1" style="text-align:center"<br />
|- bgcolor="#abcdef"<br />
! Photometric Interpretation !! JPEG !! TIFF !! GDCM !! DCMTK<br />
|-<br />
! MONOCHROME1 || style="background:silver" | X || style="background:orange" |MONOCHROME2 (aka min-is-black)|| style="background:orange" |MONOCHROME2 || style="background:orange" |MONOCHROME2<br />
|- <br />
! MONOCHROME2 || style="background:lime" | MONOCHROME2 || style="background:lime" |MONOCHROME2 (aka min-is-black)|| style="background:lime" |MONOCHROME2 || style="background:lime" |MONOCHROME2<br />
|-<br />
! PALETTE COLOR || style="background:silver" | X || style="background:orange" | RGB || style="background:orange" | Converted to RGB || style="background:orange" | RGB<br />
|-<br />
! RGB || style="background:orange" |RGB || RGB|| RGB || ?RGB?<br />
|- style="background:silver"<br />
! HSV || || || || <br />
|- style="background:silver"<br />
! ARGB || || || || <br />
|- style="background:silver"<br />
! CMYK || || || || <br />
|-<br />
! YBR_FULL || style="background:silver" |ITU 81 enforce sub-sampling|| ?? || style="background:orange" |RGB || style="background:orange" |RGB<br />
|-<br />
! YBR_FULL_422 || style="background:orange" |RGB || style="background:orange" |RGB || style="background:orange" |RGB || style="background:orange" |RGB<br />
|- style="background:silver"<br />
! YBR_PARTIAL_422 || || || || <br />
|- style="background:silver"<br />
! YBR_PARTIAL_420 || || || || <br />
|-<br />
! YBR_ICT || || || style="background:orange" |RGB || style="background:red" |no J2K plugin<br />
|-<br />
! YBR_RCT || || || RGB || style="background:red" |no J2K plugin<br />
|-<br />
|}<br />
<br />
== Discussion ==<br />
<br />
Participants:<br />
# Mathieu Malaterre<br />
# Mihail Isakov<br />
<br />
For visualization people it is important that:<br />
<br />
# MONOCHROME1 (min-is-white) is converted to MONOCHROME2 (min-is-black) <br />
# YBR_FULL / YBR_FULL_422 are converted to RGB<br />
<br />
The requirements for quantitative analysis may be different, please list reqs here:<br />
<br />
#? Extract Luminance out of YBR ?<br />
# ? Need MONOCHROME1 native support, because <fill reason ??><br />
# ? Is there a need to manipulated native palette data ? I doubt so<br />
<br />
== Data ==<br />
<br />
# JPEG 8 bits mono2<br />
# JPEG 8 bits YBR_422<br />
# JPEG 8 bits RGB<br />
# TIFF mono1 min-is-white<br />
# TIFF mono2 min-is-black<br />
# TIFF YBR_422<br />
# TIFF RGB<br />
# DICOM mono1 min-is-white<br />
# DICOM mono2 min-is-black<br />
# DICOM YBR<br />
# [https://sourceforge.net/p/gdcm/gdcmdata/ci/master/tree/US-YBR_FULL_422-EVRLE.dcm| DICOM YBR_422]<br />
# [https://sourceforge.net/p/gdcm/gdcmdata/ci/master/tree/US-GE-4AICL142.dcm| DICOM JPEG/YBR_422]<br />
# DICOM RGB<br />
# DICOM YBR_RCT<br />
# DICOM YBR_ICT<br />
<br />
== References ==<br />
<br />
* http://dicom.nema.org/medical/dicom/current/output/chtml/part03/sect_C.7.6.3.html#sect_C.7.6.3.1.2<br />
* http://gdcm.sourceforge.net/wiki/index.php/Color_Space_Transformations</div>Blowekamphttps://public.kitware.com/Wiki/index.php?title=ITK_Release_5/Wish_List&diff=62143ITK Release 5/Wish List2017-12-05T14:36:20Z<p>Blowekamp: /* C++11 throughout */</p>
<hr />
<div>The wish list is provided by members of the ITK development community.<br />
These requests will not necessarily be included in ITKv5.<br />
<br />
== Outstanding wishes ==<br />
A detailed wish list was put together by the community when preparing for ITK v4. Many of the wishes expressed there could not be fulfilled at the time but are still valid:<br />
* https://itk.org/Wiki/ITK_Release_4/Wish_List<br />
<br />
== Image IO ==<br />
* Replacing current integer pixel IO types defined in itk::ImageIOBase by fixed width integer types<br />
** unsigned short -> uint16_t<br />
** short -> int16_t<br />
** unsigned int -> uint32_t<br />
** int -> int32_t<br />
** unsigned long -> uint64_t<br />
** long -> int64_t<br />
** Portability issue of "char", "signed char" and "unsigned char" need to be discussed and addressed before using uint8_t and int8_t<br />
*** ''char'' and ''unsigned char'' would keep being defined as ''char'' and ''unsigned char'' as these types is wildly use image formats.<br />
* Currently, the size of each type may vary from one platform to another.<br />
* This is especially true for 'long' that is 32 bits on Windows/Visual Studio C++ 2013 (64 bits) but 64 bits on 64 bits Unix systems. <br />
* Files saved on one platform should be read the same on a different platform.<br />
* This would avoid having to compare `sizeof(mytype)` to know what type to use on a specific platform.<br />
* This issue was raised in [http://review.source.kitware.com/#/c/21513/ this patch suggestion]<br />
<br />
== Requiring CMake >= 3.0 ==<br />
* Currently supports CMake >=2.8.9 mostly to support Ubuntu 14.04 LTS (5 year support)<br />
<br />
== C++11 throughout ==<br />
As ITK uses templates heavily, it would greatly benefit from usage of few C++11 goodies, especially '''auto''' and '''decltype'''.<br />
<br />
To take a step further, requiring the latest c++ standard (C++14? C++17?) available when starting a v5 endeavour could also be discussed.<br />
<br />
Note: Some c++ >= 11 features may not be supported by CastXML (and by pygccxml): https://github.com/CastXML/CastXML/issues/72<br />
Before implementing fancy stuff it should be double-checked if it does not break the Wrappings.<br />
<br />
To justify the change I’d like to see some good use of it in ITK. Some things that first come to mind:<br />
<br />
* Support move semantics for the core ITK objects<br />
* Support initializer lists in constructors of array like objects<br />
* Have implementations that make use of C++11 threads<br />
* Have a FunctorFilter which supports lambda expressions<br />
* Rvalue support<br />
* A updated style guideline which requires less typedefs ( auto keyword )<br />
<br />
== VNL->Eigen ==<br />
Replace VNL by [http://eigen.tuxfamily.org/ Eigen], which is much more modern.<br />
<br />
== Wrapping ==<br />
* Take into account default template arguments in Python wrappings. See http://review.source.kitware.com/#/c/21606/ for discussion.<br />
<br />
== Filter Refactoring ==<br />
* The current Functor based filters create code bloat because each class instance requires two instantiated classes. An alternative Functor approach should be used where the same class can be used any functor. One approach is to use a "SefFunctor" method which generates the GenerateData method.<br />
<br />
== Uncategorized minor wishes ==<br />
* Suport for remote module testing against multiple versions of ITK.<br />
* Rolling compiler support. Each new release will support compilers released in the last 3-5 years. This will allow us to gradually adopt newer language versions, as C++ standards committee aims to revise the language every 3 years.</div>Blowekamphttps://public.kitware.com/Wiki/index.php?title=SimpleITK&diff=62074SimpleITK2017-10-11T15:31:46Z<p>Blowekamp: /* Support */</p>
<hr />
<div>[[Image: SimpleITK-SquareTransparentLogo.png|center]]<br />
<br />
=Overview=<br />
<br />
Welcome to the National Library of Medicine Insight Segmentation and Registration Toolkit (ITK). [http://www.itk.org/ ITK] is an open-source, cross-platform system that provides developers with an extensive suite of software tools for image analysis. Among them, SimpleITK is a simplified layer built on top of ITK, intended to facilitate its use in rapid prototyping, education, interpreted languages. SimpleITK has the following main characteristics:<br />
<br />
* C++ library with wrappers for Python, Java, CSharp, R, Tcl and Ruby<br />
* Object-oriented<br />
* Provides a simplified, easy-to-use, procedural interface without templates<br />
* Is distributed under an open source Apache 2.0 License<br />
* Binary distributions for Python, Java and CSharp<br />
<br />
SimpleITK captures many of features available in ITK, and is under ongoing development. Earlier in the development process a set of [[SimpleITK/Goals|Specific Goals]] were outlined.<br />
<br />
= Getting Started =<br />
<br />
* [[SimpleITK/GettingStarted|Getting Started For Users]]<br />
** [[SimpleITK/GettingStarted#Binaries|downloading the binaries]]<br />
** [[SimpleITK/GettingStarted#Build_It_Yourself|build the code yourself]]<br />
** [[SimpleITK/GettingStarted#Recommended_Software|additional software]] which is useful with SimpleITK<br />
* [[SimpleITK/GettingStarted/Visual_guide_to_building_on_Linux|A Visual Guide to Building SimpleITK on Linux]]<br />
* [[SimpleITK/GettingStarted/A_visual_guide_to_SimpleITK_in_Java|A Visual Guide to SimpleITK with Java and Eclipse]]<br />
* [[SimpleITK/GettingStarted/A_visual_guide_to_SimpleITK_with_CSharp|A Visual Guide to SimpleITK with CSharp on Microsoft Visual Studio]]<br />
<br />
== Download ==<br />
<br />
SimpleITK currently provides binary distribution for Python, CSharp and Java language bindings. <br />
You can download the [https://sourceforge.net/projects/simpleitk/files/SimpleITK/1.0.0/ 1.0.0 release from SourceForge].<br />
<br />
= Documentation =<br />
<br />
* [[SimpleITK/FAQ|Frequently Asked Questions (FAQ)]]<br />
<br />
== API ==<br />
<br />
* Nightly generated [https://www.itk.org/SimpleITKDoxygen/html/ Doxygen].<br />
* Release 1.0 [https://www.itk.org/SimpleITKDoxygen100/html/index.html Doxygen].<br />
* Release 0.10 [https://www.itk.org/SimpleITKDoxygen010/html/index.html Doxygen].<br />
* Release 0.9 [https://www.itk.org/SimpleITKDoxygen09/html/index.html Doxygen].<br />
* Release 0.8 [https://www.itk.org/SimpleITKDoxygen08/html/index.html Doxygen].<br />
* Release 0.7 [https://www.itk.org/SimpleITKDoxygen07/html/index.html Doxygen].<br />
* Release 0.6.1 [https://www.itk.org/SimpleITKDoxygen06/html/ Doxygen].<br />
<br />
== Short Examples ==<br />
<br />
Concise [https://itk.org/SimpleITKDoxygen/html/examples.html examples] illustrating the usage of various SimpleITK features. Examples are written in a variety of languages including Python, R, C++, Java...<br />
<br />
== SimpleITK Notebooks ==<br />
<br />
The SimpleITK Notebooks are examples and tutorials on how to use SimpleITK utilizing Jupyter Notebooks. This approach allows the user to create, edit and re-run scripts and view the results all within a web interface. The authoritative description of what Jupyter Notebooks are can be found on the [http://jupyter.org/ Jupyter website]. While SimpleITK supports a number of programming languages, the majority of notebooks are written in Python and some in R.<br />
<br />
The main notebook repository is available on [https://github.com/InsightSoftwareConsortium/SimpleITK-Notebooks github].<br />
<br />
Additional repositories containing tutorial specific notebooks are listed in the [http://www.itk.org/Wiki/SimpleITK#SimpleITK_Tutorials Tutorials section] below.<br />
<br />
== Publications ==<br />
<br />
More information about SimpleITK can be found in the following publication:<br />
<br />
* Lowekamp BC, Chen DT, Ibáñez L and Blezek D (2013) [http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3874546/pdf/fninf-07-00045.pdf The Design of SimpleITK]. Front. Neuroinform. 7:45. doi: 10.3389/fninf.2013.00045<br />
<br />
Please cite SimpleITK and ITK when publishing work where it made a significant contribution.<br />
<br />
== SimpleITK Tutorials ==<br />
<br />
=== Upcoming ===<br />
<br />
* none<br />
<br />
=== Past ===<br />
* The International Symposium on Biomedical Imaging (ISBI) 2016, Prague, Czech republic: [http://biomedicalimaging.org/2016/?page_id=572 SimpleITK: An Interactive, Python-Based Introduction to SimpleITK with the Insight Segmentation and Registration Toolkit (ITK)]<br />
* SPIE Medical Imaging 2016, San Diego, USA: ITK in Biomedical Research and Commercial Applications<br />
: Tutorial material: [https://github.com/InsightSoftwareConsortium/SimpleITKTutorialSPIE2016 git repository] [https://hdl.handle.net/10380/3542 additional presentations] .<br />
* Medical Image Computing and Computer Assisted Intervention (MICCAI) 2015, Munich, Germany: a Python based tutorial on the use of the [[SimpleITK/Tutorials/MICCAI2015 | ITKv4 registration framework via SimpleITK]].<br />
: Tutorial material: [https://github.com/InsightSoftwareConsortium/SimpleITKTutorialMICCAI2015.git git repository].<br />
* ImageJ User & Developer Conference 2015, Madison, WI, USA: [http://imagej.net/Conference_2015_Program#Matt_McCormick_-_SimpleITK an introductory tutorial] in Python. <br />
: Tutorial material: [https://github.com/InsightSoftwareConsortium/SimpleITKWorkshopImageJ2015 git repository]. <br />
* Medical Image Computing and Computer Assisted Intervention (MICCAI) 2011, Toronto, Canada: a general [[ITK_Release_4/Outreach/Conferences/MICCAI 2011/SimpleITK|tutorial on SimpleITK]]. <br />
: Tutorial material: [https://github.com/SimpleITK/SimpleITK-MICCAI-2011-Tutorial/blob/master/Presentation/SimpleITK-MICCAI-2011.pdf?raw=true PDF of presentation], [http://midas.kitware.com/collection/view/175 virtual machine], and [https://github.com/SimpleITK/SimpleITK-MICCAI-2011-Tutorial git repository].<br />
<br />
== Community Blogs ==<br />
<br />
These are blog entries written by people who are not necessarily directly involved with SimpleITK. If you want us to link to your SimpleITK blog entry just let us know on the mailing list (community@itk.org). <br />
<br />
* General introduction of SimpleITK on the [http://news.iscas.co/simpleitk-a-simplified-multi-language-interface-to-the-insight-segmentation-and-registration-toolkit/ International Society for Computer Aided Surgery blog], 1 March 2017.<br />
* [http://zarquon42b.github.io/2015/05/22/SimpleITKandR/ SimpleITK and R], 22 May 2015.<br />
* [http://kevin-keraudren.blogspot.com/2014/12/medical-image-analysis-ipython-tutorials.html Medical Image Analysis Course], 20 December 2014.<br />
* [https://pyscience.wordpress.com/tag/simpleitk Image Segmentation with Python and SimpleITK], October/November 2014.<br />
<br />
=Support=<br />
<br />
SimpleITK is supported through the ITK community and the active developers. In addition to the resources listed above in the documentation section, the [https://discourse.itk.org discourse forum] can be used to ask questions and obtain additional help from the ITK community. The legacy [http://www.itk.org/ITK/help/mailing.html ITK mailing lists] is no longer prefered.<br />
<br />
== Issue Tracking And Feature Requests ==<br />
<br />
We are currently using the [https://github.com/SimpleITK/SimpleITK/issues github issue tracker]. Before switching to github issue tracking we used an instance of the<br />
[https://itk.icts.uiowa.edu/jira/browse/SIMPLEITK Legacy Jira Issue Tracker ] hosted by the University of Iowa.<br />
<br />
== Releases ==<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=refs/tags/v1.0.1 v1.0.1] [https://github.com/SimpleITK/SimpleITK/releases/tag/v1.0.1 Release Notes] <br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=refs/tags/v1.0.0 v1.0.0] [https://github.com/SimpleITK/SimpleITK/releases/tag/v1.0.0 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/1.0.0 Downloads] [https://www.itk.org/SimpleITKDoxygen100/html/index.html Doxygen]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=4a3376df08f27162b4d2a90e4a0452a839ab3124 v0.10.0] [https://github.com/SimpleITK/SimpleITK/releases/tag/v0.10.0 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.10.0 Downloads] [https://www.itk.org/SimpleITKDoxygen010/html/index.html Doxygen]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=ec033f0be4f67b2e21483ed9bc3698f07dba9d06 v0.9.1] [https://github.com/SimpleITK/SimpleITK/releases/tag/v0.9.1 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.9.1 Downloads] <br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=7f06e9fc7f3cda9c47e8b7d6d37885b1f425ea3b v0.9.0] [https://github.com/SimpleITK/SimpleITK/releases/tag/v0.9.0 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.9.0 Downloads] [https://www.itk.org/SimpleITKDoxygen09/html/index.html Doxygen]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=d0a90983877b46631e69a398bd8341889912c8c2 v0.8.1] [https://github.com/SimpleITK/SimpleITK/releases/tag/v0.8.1 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.8.1/ Downloads] [https://www.itk.org/SimpleITKDoxygen08/html/index.html Doxygen]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=11bff587f8a930bbca02813595aa3d08388af979 v0.8.0] [https://github.com/SimpleITK/SimpleITK/releases/tag/v0.8.0 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.8.0/ Downloads] <br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=commit;h=a2b29110771a1eb0b09d18ff8e98a784dc6e6451 v0.7.1] [https://github.com/SimpleITK/SimpleITK/releases/tag/v0.7.1 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.7.1/ Downloads]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=6fecf5ae5859295082b9016c97bf4bd68a961a62 v0.7.0] [https://github.com/SimpleITK/SimpleITK/releases/tag/v0.7.0 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.7.0/ Downloads] [https://www.itk.org/SimpleITKDoxygen07/html/index.html Doxygen]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=fc17df598cac97d344c875fed117f03ae7d1aacd v0.6.1] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.6.1/ Downloads] [http://www.itk.org/SimpleITKDoxygen06/html/index.html Doxygen]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=c055ef4e4cd2802c56e169084d9dd1bc655b4e93 v0.6.0] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.6.0/ Downloads] <br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=41fbb6d69f88fa1c8ab3b9d710b7ae57bb975721 v0.5.1] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.5.1/ Downloads]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=35ccfd2b99b4b5675d4d0894bb870574396408b6 v0.5.0] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.5.0/ Downloads]<br />
<br />
= Development =<br />
<br />
SimpleITK has moved to a [https://github.com/SimpleITK/SimpleITK Github] based work flow for issues tracking and contribution.<br />
<br />
<br />
SimpleITK utilizes an additional "next" branch to merge and test changes before merging into the master branch. This makes our "master" branch more stable and reliable. This follows the CMake development process:<br />
<br />
* [http://www.cmake.org/Wiki/CMake/Git/Develop CMake Development Process ]<br />
<br />
<br />
== Source Code Repository ==<br />
<br />
SimpleITK uses git as the revision control system. The official repository is hosted along side ITK as http://itk.org/SimpleITK.git [http://public.kitware.com/gitweb?p=SimpleITK.git]. It is also mirrored on [https://github.com/SimpleITK/SimpleITK Github ].<br />
<br />
Development is currently following the branchy workflow with the Kitware stage repository. This workflow is described here:<br />
*http://public.kitware.com/Wiki/Git/Workflow/Stage<br />
*http://public.kitware.com/Wiki/Git/Workflow/Topic<br />
<br />
Contributions from github will be pushed to the stage repo and merged into the next branch by a SimpleITK developer.<br />
<br />
== [[SimpleITK/Design_And_Proposals | Design And Proposals]] ==</div>Blowekamphttps://public.kitware.com/Wiki/index.php?title=SimpleITK&diff=62073SimpleITK2017-10-11T15:30:17Z<p>Blowekamp: /* Support */</p>
<hr />
<div>[[Image: SimpleITK-SquareTransparentLogo.png|center]]<br />
<br />
=Overview=<br />
<br />
Welcome to the National Library of Medicine Insight Segmentation and Registration Toolkit (ITK). [http://www.itk.org/ ITK] is an open-source, cross-platform system that provides developers with an extensive suite of software tools for image analysis. Among them, SimpleITK is a simplified layer built on top of ITK, intended to facilitate its use in rapid prototyping, education, interpreted languages. SimpleITK has the following main characteristics:<br />
<br />
* C++ library with wrappers for Python, Java, CSharp, R, Tcl and Ruby<br />
* Object-oriented<br />
* Provides a simplified, easy-to-use, procedural interface without templates<br />
* Is distributed under an open source Apache 2.0 License<br />
* Binary distributions for Python, Java and CSharp<br />
<br />
SimpleITK captures many of features available in ITK, and is under ongoing development. Earlier in the development process a set of [[SimpleITK/Goals|Specific Goals]] were outlined.<br />
<br />
= Getting Started =<br />
<br />
* [[SimpleITK/GettingStarted|Getting Started For Users]]<br />
** [[SimpleITK/GettingStarted#Binaries|downloading the binaries]]<br />
** [[SimpleITK/GettingStarted#Build_It_Yourself|build the code yourself]]<br />
** [[SimpleITK/GettingStarted#Recommended_Software|additional software]] which is useful with SimpleITK<br />
* [[SimpleITK/GettingStarted/Visual_guide_to_building_on_Linux|A Visual Guide to Building SimpleITK on Linux]]<br />
* [[SimpleITK/GettingStarted/A_visual_guide_to_SimpleITK_in_Java|A Visual Guide to SimpleITK with Java and Eclipse]]<br />
* [[SimpleITK/GettingStarted/A_visual_guide_to_SimpleITK_with_CSharp|A Visual Guide to SimpleITK with CSharp on Microsoft Visual Studio]]<br />
<br />
== Download ==<br />
<br />
SimpleITK currently provides binary distribution for Python, CSharp and Java language bindings. <br />
You can download the [https://sourceforge.net/projects/simpleitk/files/SimpleITK/1.0.0/ 1.0.0 release from SourceForge].<br />
<br />
= Documentation =<br />
<br />
* [[SimpleITK/FAQ|Frequently Asked Questions (FAQ)]]<br />
<br />
== API ==<br />
<br />
* Nightly generated [https://www.itk.org/SimpleITKDoxygen/html/ Doxygen].<br />
* Release 1.0 [https://www.itk.org/SimpleITKDoxygen100/html/index.html Doxygen].<br />
* Release 0.10 [https://www.itk.org/SimpleITKDoxygen010/html/index.html Doxygen].<br />
* Release 0.9 [https://www.itk.org/SimpleITKDoxygen09/html/index.html Doxygen].<br />
* Release 0.8 [https://www.itk.org/SimpleITKDoxygen08/html/index.html Doxygen].<br />
* Release 0.7 [https://www.itk.org/SimpleITKDoxygen07/html/index.html Doxygen].<br />
* Release 0.6.1 [https://www.itk.org/SimpleITKDoxygen06/html/ Doxygen].<br />
<br />
== Short Examples ==<br />
<br />
Concise [https://itk.org/SimpleITKDoxygen/html/examples.html examples] illustrating the usage of various SimpleITK features. Examples are written in a variety of languages including Python, R, C++, Java...<br />
<br />
== SimpleITK Notebooks ==<br />
<br />
The SimpleITK Notebooks are examples and tutorials on how to use SimpleITK utilizing Jupyter Notebooks. This approach allows the user to create, edit and re-run scripts and view the results all within a web interface. The authoritative description of what Jupyter Notebooks are can be found on the [http://jupyter.org/ Jupyter website]. While SimpleITK supports a number of programming languages, the majority of notebooks are written in Python and some in R.<br />
<br />
The main notebook repository is available on [https://github.com/InsightSoftwareConsortium/SimpleITK-Notebooks github].<br />
<br />
Additional repositories containing tutorial specific notebooks are listed in the [http://www.itk.org/Wiki/SimpleITK#SimpleITK_Tutorials Tutorials section] below.<br />
<br />
== Publications ==<br />
<br />
More information about SimpleITK can be found in the following publication:<br />
<br />
* Lowekamp BC, Chen DT, Ibáñez L and Blezek D (2013) [http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3874546/pdf/fninf-07-00045.pdf The Design of SimpleITK]. Front. Neuroinform. 7:45. doi: 10.3389/fninf.2013.00045<br />
<br />
Please cite SimpleITK and ITK when publishing work where it made a significant contribution.<br />
<br />
== SimpleITK Tutorials ==<br />
<br />
=== Upcoming ===<br />
<br />
* none<br />
<br />
=== Past ===<br />
* The International Symposium on Biomedical Imaging (ISBI) 2016, Prague, Czech republic: [http://biomedicalimaging.org/2016/?page_id=572 SimpleITK: An Interactive, Python-Based Introduction to SimpleITK with the Insight Segmentation and Registration Toolkit (ITK)]<br />
* SPIE Medical Imaging 2016, San Diego, USA: ITK in Biomedical Research and Commercial Applications<br />
: Tutorial material: [https://github.com/InsightSoftwareConsortium/SimpleITKTutorialSPIE2016 git repository] [https://hdl.handle.net/10380/3542 additional presentations] .<br />
* Medical Image Computing and Computer Assisted Intervention (MICCAI) 2015, Munich, Germany: a Python based tutorial on the use of the [[SimpleITK/Tutorials/MICCAI2015 | ITKv4 registration framework via SimpleITK]].<br />
: Tutorial material: [https://github.com/InsightSoftwareConsortium/SimpleITKTutorialMICCAI2015.git git repository].<br />
* ImageJ User & Developer Conference 2015, Madison, WI, USA: [http://imagej.net/Conference_2015_Program#Matt_McCormick_-_SimpleITK an introductory tutorial] in Python. <br />
: Tutorial material: [https://github.com/InsightSoftwareConsortium/SimpleITKWorkshopImageJ2015 git repository]. <br />
* Medical Image Computing and Computer Assisted Intervention (MICCAI) 2011, Toronto, Canada: a general [[ITK_Release_4/Outreach/Conferences/MICCAI 2011/SimpleITK|tutorial on SimpleITK]]. <br />
: Tutorial material: [https://github.com/SimpleITK/SimpleITK-MICCAI-2011-Tutorial/blob/master/Presentation/SimpleITK-MICCAI-2011.pdf?raw=true PDF of presentation], [http://midas.kitware.com/collection/view/175 virtual machine], and [https://github.com/SimpleITK/SimpleITK-MICCAI-2011-Tutorial git repository].<br />
<br />
== Community Blogs ==<br />
<br />
These are blog entries written by people who are not necessarily directly involved with SimpleITK. If you want us to link to your SimpleITK blog entry just let us know on the mailing list (community@itk.org). <br />
<br />
* General introduction of SimpleITK on the [http://news.iscas.co/simpleitk-a-simplified-multi-language-interface-to-the-insight-segmentation-and-registration-toolkit/ International Society for Computer Aided Surgery blog], 1 March 2017.<br />
* [http://zarquon42b.github.io/2015/05/22/SimpleITKandR/ SimpleITK and R], 22 May 2015.<br />
* [http://kevin-keraudren.blogspot.com/2014/12/medical-image-analysis-ipython-tutorials.html Medical Image Analysis Course], 20 December 2014.<br />
* [https://pyscience.wordpress.com/tag/simpleitk Image Segmentation with Python and SimpleITK], October/November 2014.<br />
<br />
=Support=<br />
<br />
SimpleITK is supported through the ITK community and the active developers. In addition to the resources listed above in the documentation section, the [discourse forum](https://discourse.itk.org) can be used to ask questions and obtain additional help from the ITK community. The legacy [http://www.itk.org/ITK/help/mailing.html ITK mailing lists] is no longer prefered.<br />
<br />
== Issue Tracking And Feature Requests ==<br />
<br />
We are currently using the [https://github.com/SimpleITK/SimpleITK/issues github issue tracker]. Before switching to github issue tracking we used an instance of the<br />
[https://itk.icts.uiowa.edu/jira/browse/SIMPLEITK Legacy Jira Issue Tracker ] hosted by the University of Iowa.<br />
<br />
== Releases ==<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=refs/tags/v1.0.1 v1.0.1] [https://github.com/SimpleITK/SimpleITK/releases/tag/v1.0.1 Release Notes] <br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=refs/tags/v1.0.0 v1.0.0] [https://github.com/SimpleITK/SimpleITK/releases/tag/v1.0.0 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/1.0.0 Downloads] [https://www.itk.org/SimpleITKDoxygen100/html/index.html Doxygen]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=4a3376df08f27162b4d2a90e4a0452a839ab3124 v0.10.0] [https://github.com/SimpleITK/SimpleITK/releases/tag/v0.10.0 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.10.0 Downloads] [https://www.itk.org/SimpleITKDoxygen010/html/index.html Doxygen]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=ec033f0be4f67b2e21483ed9bc3698f07dba9d06 v0.9.1] [https://github.com/SimpleITK/SimpleITK/releases/tag/v0.9.1 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.9.1 Downloads] <br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=7f06e9fc7f3cda9c47e8b7d6d37885b1f425ea3b v0.9.0] [https://github.com/SimpleITK/SimpleITK/releases/tag/v0.9.0 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.9.0 Downloads] [https://www.itk.org/SimpleITKDoxygen09/html/index.html Doxygen]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=d0a90983877b46631e69a398bd8341889912c8c2 v0.8.1] [https://github.com/SimpleITK/SimpleITK/releases/tag/v0.8.1 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.8.1/ Downloads] [https://www.itk.org/SimpleITKDoxygen08/html/index.html Doxygen]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=11bff587f8a930bbca02813595aa3d08388af979 v0.8.0] [https://github.com/SimpleITK/SimpleITK/releases/tag/v0.8.0 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.8.0/ Downloads] <br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=commit;h=a2b29110771a1eb0b09d18ff8e98a784dc6e6451 v0.7.1] [https://github.com/SimpleITK/SimpleITK/releases/tag/v0.7.1 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.7.1/ Downloads]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=6fecf5ae5859295082b9016c97bf4bd68a961a62 v0.7.0] [https://github.com/SimpleITK/SimpleITK/releases/tag/v0.7.0 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.7.0/ Downloads] [https://www.itk.org/SimpleITKDoxygen07/html/index.html Doxygen]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=fc17df598cac97d344c875fed117f03ae7d1aacd v0.6.1] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.6.1/ Downloads] [http://www.itk.org/SimpleITKDoxygen06/html/index.html Doxygen]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=c055ef4e4cd2802c56e169084d9dd1bc655b4e93 v0.6.0] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.6.0/ Downloads] <br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=41fbb6d69f88fa1c8ab3b9d710b7ae57bb975721 v0.5.1] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.5.1/ Downloads]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=35ccfd2b99b4b5675d4d0894bb870574396408b6 v0.5.0] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.5.0/ Downloads]<br />
<br />
= Development =<br />
<br />
SimpleITK has moved to a [https://github.com/SimpleITK/SimpleITK Github] based work flow for issues tracking and contribution.<br />
<br />
<br />
SimpleITK utilizes an additional "next" branch to merge and test changes before merging into the master branch. This makes our "master" branch more stable and reliable. This follows the CMake development process:<br />
<br />
* [http://www.cmake.org/Wiki/CMake/Git/Develop CMake Development Process ]<br />
<br />
<br />
== Source Code Repository ==<br />
<br />
SimpleITK uses git as the revision control system. The official repository is hosted along side ITK as http://itk.org/SimpleITK.git [http://public.kitware.com/gitweb?p=SimpleITK.git]. It is also mirrored on [https://github.com/SimpleITK/SimpleITK Github ].<br />
<br />
Development is currently following the branchy workflow with the Kitware stage repository. This workflow is described here:<br />
*http://public.kitware.com/Wiki/Git/Workflow/Stage<br />
*http://public.kitware.com/Wiki/Git/Workflow/Topic<br />
<br />
Contributions from github will be pushed to the stage repo and merged into the next branch by a SimpleITK developer.<br />
<br />
== [[SimpleITK/Design_And_Proposals | Design And Proposals]] ==</div>Blowekamphttps://public.kitware.com/Wiki/index.php?title=Template:SimpleITKMigrationHeader&diff=61928Template:SimpleITKMigrationHeader2017-08-14T12:52:06Z<p>Blowekamp: </p>
<hr />
<div>{| class="wikitable" style="text-align:center;width: 100%; background-color:#ffff99;" cellpadding="10"<br />
| '''NOTICE'''<br />
|-<br />
|This page is being migrated to Read The Docs!<br />
<br />
For the up to date version please see [https://simpleitk.readthedocs.io/en/master/{{#if:{{{1|}}}|Documentation/docs/source/{{{1|}}}.html|index.html}} this page]!<br />
<br />
|}</div>Blowekamphttps://public.kitware.com/Wiki/index.php?title=Template:SimpleITKMigrationHeader&diff=61927Template:SimpleITKMigrationHeader2017-08-14T12:50:04Z<p>Blowekamp: </p>
<hr />
<div>{| class="wikitable" style="text-align:center;width: 100%; background-color:#ffff99;" cellpadding="10"<br />
| '''NOTICE'''<br />
|-<br />
|This page is being migrated to Read The Docs!<br />
<br />
For the up to date version please see [https://simpleitk.readthedocs.io/en/master/{{#if:{{{1|}}}|Documentation/docs/source/{{{1}}}.html|index.html}} this page]!<br />
<br />
|}</div>Blowekamphttps://public.kitware.com/Wiki/index.php?title=Template:SimpleITKMigrationHeader&diff=61926Template:SimpleITKMigrationHeader2017-08-14T12:48:45Z<p>Blowekamp: </p>
<hr />
<div>{| class="wikitable" style="text-align:center;width: 100%; background-color:#ffff99;" cellpadding="10"<br />
| '''NOTICE'''<br />
|-<br />
|This page is being migrated to Read The Docs!<br />
<br />
For the up to date version please see [https://simpleitk.readthedocs.io/en/master/{{#if:{{{1|}}}|Documentation/docs/source/{{1}}.html|index.html}} this page]!<br />
<br />
|}</div>Blowekamphttps://public.kitware.com/Wiki/index.php?title=Template:SimpleITKMigrationHeader&diff=61925Template:SimpleITKMigrationHeader2017-08-14T12:46:49Z<p>Blowekamp: </p>
<hr />
<div>{| class="wikitable" style="text-align:center;width: 100%; background-color:#ffff99;" cellpadding="10"<br />
| '''NOTICE'''<br />
|-<br />
|This page is being migrated to Read The Docs!<br />
<br />
For the up to date version please see [https://simpleitk.readthedocs.io/en/master/{{#if:{{{1|}}}|Documentation/docs/source/{1}.html|index.html}} this page]!<br />
<br />
|}</div>Blowekamphttps://public.kitware.com/Wiki/index.php?title=SimpleITK&diff=61914SimpleITK2017-08-03T17:11:27Z<p>Blowekamp: /* Releases */</p>
<hr />
<div>[[Image: SimpleITK-SquareTransparentLogo.png|center]]<br />
<br />
=Overview=<br />
<br />
Welcome to the National Library of Medicine Insight Segmentation and Registration Toolkit (ITK). [http://www.itk.org/ ITK] is an open-source, cross-platform system that provides developers with an extensive suite of software tools for image analysis. Among them, SimpleITK is a simplified layer built on top of ITK, intended to facilitate its use in rapid prototyping, education, interpreted languages. SimpleITK has the following main characteristics:<br />
<br />
* C++ library with wrappers for Python, Java, CSharp, R, Tcl and Ruby<br />
* Object-oriented<br />
* Provides a simplified, easy-to-use, procedural interface without templates<br />
* Is distributed under an open source Apache 2.0 License<br />
* Binary distributions for Python, Java and CSharp<br />
<br />
SimpleITK captures many of features available in ITK, and is under ongoing development. Earlier in the development process a set of [[SimpleITK/Goals|Specific Goals]] were outlined.<br />
<br />
= Getting Started =<br />
<br />
* [[SimpleITK/GettingStarted|Getting Started For Users]]<br />
** [[SimpleITK/GettingStarted#Binaries|downloading the binaries]]<br />
** [[SimpleITK/GettingStarted#Build_It_Yourself|build the code yourself]]<br />
** [[SimpleITK/GettingStarted#Recommended_Software|additional software]] which is useful with SimpleITK<br />
* [[SimpleITK/GettingStarted/Visual_guide_to_building_on_Linux|A Visual Guide to Building SimpleITK on Linux]]<br />
* [[SimpleITK/GettingStarted/A_visual_guide_to_SimpleITK_in_Java|A Visual Guide to SimpleITK with Java and Eclipse]]<br />
* [[SimpleITK/GettingStarted/A_visual_guide_to_SimpleITK_with_CSharp|A Visual Guide to SimpleITK with CSharp on Microsoft Visual Studio]]<br />
<br />
== Download ==<br />
<br />
SimpleITK currently provides binary distribution for Python, CSharp and Java language bindings. <br />
You can download the [https://sourceforge.net/projects/simpleitk/files/SimpleITK/1.0.0/ 1.0.0 release from SourceForge].<br />
<br />
= Documentation =<br />
<br />
* [[SimpleITK/FAQ|Frequently Asked Questions (FAQ)]]<br />
<br />
== API ==<br />
<br />
* Nightly generated [https://www.itk.org/SimpleITKDoxygen/html/ Doxygen].<br />
* Release 1.0 [https://www.itk.org/SimpleITKDoxygen100/html/index.html Doxygen].<br />
* Release 0.10 [https://www.itk.org/SimpleITKDoxygen010/html/index.html Doxygen].<br />
* Release 0.9 [https://www.itk.org/SimpleITKDoxygen09/html/index.html Doxygen].<br />
* Release 0.8 [https://www.itk.org/SimpleITKDoxygen08/html/index.html Doxygen].<br />
* Release 0.7 [https://www.itk.org/SimpleITKDoxygen07/html/index.html Doxygen].<br />
* Release 0.6.1 [https://www.itk.org/SimpleITKDoxygen06/html/ Doxygen].<br />
<br />
== Short Examples ==<br />
<br />
Concise [https://itk.org/SimpleITKDoxygen/html/examples.html examples] illustrating the usage of various SimpleITK features. Examples are written in a variety of languages including Python, R, C++, Java...<br />
<br />
== SimpleITK Notebooks ==<br />
<br />
The SimpleITK Notebooks are examples and tutorials on how to use SimpleITK utilizing Jupyter Notebooks. This approach allows the user to create, edit and re-run scripts and view the results all within a web interface. The authoritative description of what Jupyter Notebooks are can be found on the [http://jupyter.org/ Jupyter website]. While SimpleITK supports a number of programming languages, the majority of notebooks are written in Python and some in R.<br />
<br />
The main notebook repository is available on [https://github.com/InsightSoftwareConsortium/SimpleITK-Notebooks github].<br />
<br />
Additional repositories containing tutorial specific notebooks are listed in the [http://www.itk.org/Wiki/SimpleITK#SimpleITK_Tutorials Tutorials section] below.<br />
<br />
== Publications ==<br />
<br />
More information about SimpleITK can be found in the following publication:<br />
<br />
* Lowekamp BC, Chen DT, Ibáñez L and Blezek D (2013) [http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3874546/pdf/fninf-07-00045.pdf The Design of SimpleITK]. Front. Neuroinform. 7:45. doi: 10.3389/fninf.2013.00045<br />
<br />
Please cite SimpleITK and ITK when publishing work where it made a significant contribution.<br />
<br />
== SimpleITK Tutorials ==<br />
<br />
=== Upcoming ===<br />
<br />
* none<br />
<br />
=== Past ===<br />
* The International Symposium on Biomedical Imaging (ISBI) 2016, Prague, Czech republic: [http://biomedicalimaging.org/2016/?page_id=572 SimpleITK: An Interactive, Python-Based Introduction to SimpleITK with the Insight Segmentation and Registration Toolkit (ITK)]<br />
* SPIE Medical Imaging 2016, San Diego, USA: ITK in Biomedical Research and Commercial Applications<br />
: Tutorial material: [https://github.com/InsightSoftwareConsortium/SimpleITKTutorialSPIE2016 git repository] [https://hdl.handle.net/10380/3542 additional presentations] .<br />
* Medical Image Computing and Computer Assisted Intervention (MICCAI) 2015, Munich, Germany: a Python based tutorial on the use of the [[SimpleITK/Tutorials/MICCAI2015 | ITKv4 registration framework via SimpleITK]].<br />
: Tutorial material: [https://github.com/InsightSoftwareConsortium/SimpleITKTutorialMICCAI2015.git git repository].<br />
* ImageJ User & Developer Conference 2015, Madison, WI, USA: [http://imagej.net/Conference_2015_Program#Matt_McCormick_-_SimpleITK an introductory tutorial] in Python. <br />
: Tutorial material: [https://github.com/InsightSoftwareConsortium/SimpleITKWorkshopImageJ2015 git repository]. <br />
* Medical Image Computing and Computer Assisted Intervention (MICCAI) 2011, Toronto, Canada: a general [[ITK_Release_4/Outreach/Conferences/MICCAI 2011/SimpleITK|tutorial on SimpleITK]]. <br />
: Tutorial material: [https://github.com/SimpleITK/SimpleITK-MICCAI-2011-Tutorial/blob/master/Presentation/SimpleITK-MICCAI-2011.pdf?raw=true PDF of presentation], [http://midas.kitware.com/collection/view/175 virtual machine], and [https://github.com/SimpleITK/SimpleITK-MICCAI-2011-Tutorial git repository].<br />
<br />
== Community Blogs ==<br />
<br />
These are blog entries written by people who are not necessarily directly involved with SimpleITK. If you want us to link to your SimpleITK blog entry just let us know on the mailing list (community@itk.org). <br />
<br />
* General introduction of SimpleITK on the [http://news.iscas.co/simpleitk-a-simplified-multi-language-interface-to-the-insight-segmentation-and-registration-toolkit/ International Society for Computer Aided Surgery blog], 1 March 2017.<br />
* [http://zarquon42b.github.io/2015/05/22/SimpleITKandR/ SimpleITK and R], 22 May 2015.<br />
* [http://kevin-keraudren.blogspot.com/2014/12/medical-image-analysis-ipython-tutorials.html Medical Image Analysis Course], 20 December 2014.<br />
* [https://pyscience.wordpress.com/tag/simpleitk Image Segmentation with Python and SimpleITK], October/November 2014.<br />
<br />
=Support=<br />
<br />
SimpleITK is supported through the ITK community and the active developers. In addition to the resources listed above in the documentation section, the [http://www.itk.org/ITK/help/mailing.html ITK mailing lists] can be used to asked questions and obtain additional help.<br />
<br />
== Issue Tracking And Feature Requests ==<br />
<br />
We are currently using the [https://github.com/SimpleITK/SimpleITK/issues github issue tracker]. Before switching to github issue tracking we used an instance of the<br />
[https://itk.icts.uiowa.edu/jira/browse/SIMPLEITK Legacy Jira Issue Tracker ] hosted by the University of Iowa.<br />
<br />
== Releases ==<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=refs/tags/v1.0.1 v1.0.1] [https://github.com/SimpleITK/SimpleITK/releases/tag/v1.0.1 Release Notes] <br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=refs/tags/v1.0.0 v1.0.0] [https://github.com/SimpleITK/SimpleITK/releases/tag/v1.0.0 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/1.0.0 Downloads] [https://www.itk.org/SimpleITKDoxygen100/html/index.html Doxygen]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=4a3376df08f27162b4d2a90e4a0452a839ab3124 v0.10.0] [https://github.com/SimpleITK/SimpleITK/releases/tag/v0.10.0 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.10.0 Downloads] [https://www.itk.org/SimpleITKDoxygen010/html/index.html Doxygen]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=ec033f0be4f67b2e21483ed9bc3698f07dba9d06 v0.9.1] [https://github.com/SimpleITK/SimpleITK/releases/tag/v0.9.1 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.9.1 Downloads] <br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=7f06e9fc7f3cda9c47e8b7d6d37885b1f425ea3b v0.9.0] [https://github.com/SimpleITK/SimpleITK/releases/tag/v0.9.0 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.9.0 Downloads] [https://www.itk.org/SimpleITKDoxygen09/html/index.html Doxygen]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=d0a90983877b46631e69a398bd8341889912c8c2 v0.8.1] [https://github.com/SimpleITK/SimpleITK/releases/tag/v0.8.1 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.8.1/ Downloads] [https://www.itk.org/SimpleITKDoxygen08/html/index.html Doxygen]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=11bff587f8a930bbca02813595aa3d08388af979 v0.8.0] [https://github.com/SimpleITK/SimpleITK/releases/tag/v0.8.0 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.8.0/ Downloads] <br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=commit;h=a2b29110771a1eb0b09d18ff8e98a784dc6e6451 v0.7.1] [https://github.com/SimpleITK/SimpleITK/releases/tag/v0.7.1 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.7.1/ Downloads]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=6fecf5ae5859295082b9016c97bf4bd68a961a62 v0.7.0] [https://github.com/SimpleITK/SimpleITK/releases/tag/v0.7.0 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.7.0/ Downloads] [https://www.itk.org/SimpleITKDoxygen07/html/index.html Doxygen]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=fc17df598cac97d344c875fed117f03ae7d1aacd v0.6.1] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.6.1/ Downloads] [http://www.itk.org/SimpleITKDoxygen06/html/index.html Doxygen]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=c055ef4e4cd2802c56e169084d9dd1bc655b4e93 v0.6.0] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.6.0/ Downloads] <br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=41fbb6d69f88fa1c8ab3b9d710b7ae57bb975721 v0.5.1] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.5.1/ Downloads]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=35ccfd2b99b4b5675d4d0894bb870574396408b6 v0.5.0] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.5.0/ Downloads]<br />
<br />
= Development =<br />
<br />
SimpleITK has moved to a [https://github.com/SimpleITK/SimpleITK Github] based work flow for issues tracking and contribution.<br />
<br />
<br />
SimpleITK utilizes an additional "next" branch to merge and test changes before merging into the master branch. This makes our "master" branch more stable and reliable. This follows the CMake development process:<br />
<br />
* [http://www.cmake.org/Wiki/CMake/Git/Develop CMake Development Process ]<br />
<br />
<br />
== Source Code Repository ==<br />
<br />
SimpleITK uses git as the revision control system. The official repository is hosted along side ITK as http://itk.org/SimpleITK.git [http://public.kitware.com/gitweb?p=SimpleITK.git]. It is also mirrored on [https://github.com/SimpleITK/SimpleITK Github ].<br />
<br />
Development is currently following the branchy workflow with the Kitware stage repository. This workflow is described here:<br />
*http://public.kitware.com/Wiki/Git/Workflow/Stage<br />
*http://public.kitware.com/Wiki/Git/Workflow/Topic<br />
<br />
Contributions from github will be pushed to the stage repo and merged into the next branch by a SimpleITK developer.<br />
<br />
== [[SimpleITK/Design_And_Proposals | Design And Proposals]] ==</div>Blowekamphttps://public.kitware.com/Wiki/index.php?title=ITK/PerformanceOptimization&diff=61905ITK/PerformanceOptimization2017-06-30T14:01:53Z<p>Blowekamp: </p>
<hr />
<div>Recent performance improvements efforts:<br />
<br />
* [http://review.source.kitware.com/#/c/22387/ itk::ThreadPool refactoring]<br />
* [http://review.source.kitware.com/#/c/22377/ Change itkMultiThreader to use OpenMP]<br />
* [http://www.insight-journal.org/browse/publication/974 ITK TBB Insight Journal article]<br />
<br />
<br />
== ITK Performance Optimization Meeting Notes ==<br />
<br />
=== 2017-04-07 ===<br />
<br />
Links:<br />
* [http://www.insight-journal.org/browse/publication/974 TBB Insight Journal article]<br />
* [https://github.com/InsightSoftwareConsortium/ITKModuleTemplate ITK Module Template]<br />
* [https://itk.org/ITKSoftwareGuide/html/Book1/ITKSoftwareGuide-Book1ch9.html#x48-1440009 ITK Module Documentation]<br />
* [https://github.com/hjmjohnson/tbb CMake'ified TBB]<br />
* [https://blog.kitware.com/simple-parallel-computing-with-vtksmptools-2/ VTK SMPTools]<br />
* [https://itk.org/Doxygen/html/classitk_1_1ImageScanlineIterator.html itkScanlineIterator]<br />
* [https://itk.org/Doxygen/html/classitk_1_1ForwardFFTImageFilter.html ITK FFT classes]<br />
<br />
Possible next steps:<br />
* TBB Insight Journal update<br />
* TBB Insight Journal -> Remote Module<br />
* Improved compiler optimization flags<br />
* MKL backend for FFT<br />
* CMake-ified TBB upstreaming / available as an ITK module<br />
* Improved awareness of ImageScanlineIterator<br />
<br />
<br />
== Performance Analysis ==<br />
<br />
=== Per Thread Cost of Job Dispatch ===<br />
<br />
An important metric in analyzing the scalability of multi-threading algorithms is the knowing the cost to spawn or use additional thread for a task. Knowing the cost allows an estimate of the expected improvement additional thread can potentially achieve for a perfectly scale able algorithm. It can also provide an estimate of the threading over for example if you are running X filters per second with N threads, then you can compute the time spent with threading over head. The can help determine if the expected improvement from improving the threading model vs improving the algorithms.<br />
<br />
The overhead for spawning threads is computed by measuring the time it takes the `AddImageFilter` to run with 1 thread on 1 pixel, and the time it takes to run with N threads on N pixels. Each thread does the one pixel trivial operation. The difference in execution time is considered the overhead for spawning the threads. Dividing by the number of additional threads gives us the overhead cost of “spawning” or dispatching. To estimate the cost the following SimpleITK code was initially used:<br />
<br />
def compute_thread_cost(n):<br />
sitk.ProcessObject_SetGlobalDefaultNumberOfThreads(1)<br />
img = sitk.Image(1,1, sitk.sitkFloat32)<br />
t1 = min(timeit.repeat( lambda img=img: sitk.Add(img,img), number=1,repeat=25))<br />
sitk.ProcessObject_SetGlobalDefaultNumberOfThreads(n)<br />
img = sitk.Image(1,n, sitk.sitkFloat32)<br />
t2 = min(timeit.repeat( lambda img=img: sitk.Add(img,img), number=1,repeat=25))<br />
print( "1 Thread: {0}\n{1} Threads: {2}".format(t1,n,t2))<br />
cost=(t2-t1)/(n-1.0)<br />
print("Cost per thread: {0}".format(cost))<br />
<br />
SimpleITK was recompiled with the Default ITK, the [http://review.source.kitware.com/#/c/22387/5 rewritten-thread-pool], and [http://review.source.kitware.com/#/c/22377/1 TheReturnOfOpenMP].<br />
<br />
The following results were with the following system:<br />
Architecture: x86_64<br />
CPU op-mode(s): 32-bit, 64-bit<br />
Byte Order: Little Endian<br />
CPU(s): 88<br />
On-line CPU(s) list: 0-87<br />
Thread(s) per core: 2<br />
Core(s) per socket: 22<br />
Socket(s): 2<br />
NUMA node(s): 2<br />
Vendor ID: GenuineIntel<br />
CPU family: 6<br />
Model: 79<br />
Model name: Intel(R) Xeon(R) CPU E5-2699 v4 @ 2.20GHz<br />
Stepping: 1<br />
CPU MHz: 2800.617<br />
BogoMIPS: 4410.78<br />
Virtualization: VT-x<br />
L1d cache: 32K<br />
L1i cache: 32K<br />
L2 cache: 256K<br />
L3 cache: 56320K<br />
NUMA node0 CPU(s): 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86<br />
NUMA node1 CPU(s): 1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65,67,69,71,73,75,77,79,81,83,85,87<br />
<br />
Here are the results.<br />
<br />
Default ITK:<br />
>compute_thread_cost(88)<br />
1 Thread: 7.9870223999e-05<br />
88 Threads: 0.00240182876587<br />
Cost per thread: 2.66891786422e-05 (seconds)<br />
<br />
rewriting-thread-pool:<br />
>compute_thread_cost(88)<br />
1 Thread: 7.60555267334e-05<br />
88 Threads: 0.000521183013916<br />
Cost per thread: 5.11640789865e-06 (seconds)<br />
<br />
TheReturnOfOpenMP:<br />
>compute_thread_cost(88)<br />
1 Thread: 7.79628753662e-05<br />
88 Threads: 0.000182867050171<br />
Cost per thread: 1.2057951127e-06 (seconds)<br />
<br />
<br />
To summarize these results: the rewriting-thread-pool topic has a 5.2X speed up for spawning thread, and the TheReturnOfOpenMP topic as a 22X speedup. <br />
<br />
Re-running the test code has a bit (~20% with occasional outlier) of variability. The results are quite similar with spawning a smaller number of threads. So this type of testing can be done on a smaller system too.<br />
<br />
So if you are using 100 filters per second with 100 threads each, the thread overhead will take 1% to 26% of the time. That is a lot of filters and threads to encounter this potential bottle neck, however we need to know the current usage and expectation for the number of filters and threads to run per second.</div>Blowekamphttps://public.kitware.com/Wiki/index.php?title=SimpleITK/GettingStarted&diff=61874SimpleITK/GettingStarted2017-06-19T18:57:10Z<p>Blowekamp: </p>
<hr />
<div>{{SimpleITKMigrationHeader}}<br />
<br />
[[Image: SimpleITK-SquareTransparentLogo.png|center]]<br />
<br />
SimpleITK provides a simplified interface to ITK in a variety of languages. You can either download binaries, if they are available for your platform and prefered language, or you can build SimpleITK yourself.<br />
<br />
Additionally, there are several recommended third-party software packages.<br />
<br />
After you have installed SimpleITK, please look to the [[ITK_Release_4/Outreach/Conferences/MICCAI 2011/SimpleITK|Tutorial]] or the [http://www.itk.org/SimpleITKDoxygen/html/ Doxygen] pages for more information.<br />
<br />
=Downloading the binaries=<br />
<br />
One of the great advantages of SimpleITK is that (typically) you do not have to build it — you can simply download the binaries and get started right away!<br />
<br />
Currently, '''Python''' binaries are available on Microsoft Windows, GNU Linux and Apple OS X. '''C# and Java''' binaries are available for Windows. We are also working towards supporting '''R''' packaging.<br />
<br />
==Python binary files==<br />
<br />
There are currently two Python binary package choices: Python Wheels, and Anaconda packages for the Anaconda Python distribution.<br />
<br />
==== Use a Virtual Environment ====<br />
<br />
Before you install SimpleITK we <b>highly recommend</b> that you create a virtual environment into which you install the package. Note that different Python versions and distributions have different programs for creating and managing virtual environments. <br />
<br />
The use of a virtual environment allows you to elegantly deal with package compatability issues, to quote [http://docs.python-guide.org/en/latest/ The Hitchhiker’s Guide to Python!]:<br />
<blockquote>A Virtual Environment is a tool to keep the dependencies required by different projects in separate places, by creating virtual Python environments for them. It solves the “Project X depends on version 1.x but, Project Y needs 4.x” dilemma, and keeps your global site-packages directory clean and manageable.</blockquote><br />
<br />
Programs for creating virtual environments include [https://packaging.python.org/en/latest/installing/#creating-virtual-environments virtualenv and pyvenv] for generic Python distributions, [http://conda.pydata.org/docs/using/envs.html conda] for the anaconda distribution, and [http://docs.enthought.com/canopy/configure/canopy-cli.html canopy_cli] for the canopy distribution.<br />
<br />
=== Wheels for Generic Python Distribution ===<br />
<br />
If you are working with the [https://www.python.org/ generic Python distribution] you can install a Wheel with the lasted version of pip (>=9.0).<br />
<br />
First thing you should do is create a virtual environment (virtualenv or pyvenv tools) and activate it.<br />
<br />
<u>Note</u>: you can always manually download the wheels for your operating system and Python version directly from [http://sourceforge.net/projects/simpleitk/files/SimpleITK/ sourceforge].<br />
<br />
<br />
From the command line use the [https://pip.pypa.io/en/latest/index.html pip program] to install:<br />
<br />
$ pip install SimpleITK<br />
<br />
The pip package manager should automatically find the correct package for Microsoft Windows, Apple OS X and GNU Linux if your version and architecture are supported. If no binary package is found, then a source distribution will be downloaded and attempted to be compiled and you should look into [[#Build_It_Yourself]].<br />
<br />
:: If your pip version in the virtual environment is stale (<9.0) you need to update it (pip install -U pip).<br />
<br />
=== Anaconda Distribution ===<br />
<br />
First thing you should do is create a virtual environment ([https://conda.pydata.org/docs/using/envs.html conda] tool) and activate it.<br />
<br />
Currently there are compiled binaries on [https://conda.anaconda.org/simpleitk Anaconda Cloud], easily installed with:<br />
<br />
$ conda install -c <nowiki>https://conda.anaconda.org/simpleitk</nowiki> SimpleITK<br />
<br />
Beta and release candidate packages are also available on Anaconda cloud under the dev label:<br />
<br />
$conda install -c <nowiki>https://conda.anaconda.org/simpleitk/label/dev</nowiki> SimpleITK<br />
<br />
=== Enthought Canopy Distribution ===<br />
<br />
First thing you should do is create a virtual environment (canopy_cli tool) and activate it.<br />
<br />
Currently there are no binaries supported with this distribution. You will need to compile SimpleITK yourself. (Using pip installation may work.)<br />
<br />
==C# binary files==<br />
<br />
'''Binaries for select C# platform''' can be found on [https://sourceforge.net/projects/simpleitk/files/SimpleITK/1.0.0/CSharp/ SimpleITK's SourceForge page]. Installing the library should only involve importing the unzipped files into you C# environment. The files have the following naming convention:<br />
SimpleITK-version-CSharp-buildplatform-targetplatform.zip<br />
eg.<br />
SimpleITK-1.0.0-CSharp-win32-x86.zip<br />
SimpleITK-1.0.0-CSharp-win64-x64.zip<br />
<br />
Details about how to set up a C# Visual Studio project with SimpleITK can be found in the [[SimpleITK/GettingStarted/A_visual_guide_to_SimpleITK_with_CSharp|Visual Guide to SimpleITK with CSharp]].<br />
<br />
More information about getting started with a sample C# program can be found in [[SimpleITK/GettingStarted/Visual_guide_to_building_on_Linux#A_simple_C.23_program| A visual guide to building SimpleITK on Linux]]<br />
<br />
==Java binary files==<br />
<br />
'''Binaries for select Java platforms''' can be found on [https://sourceforge.net/projects/simpleitk/files/SimpleITK/1.0.0/Java/ SimpleITK's SourceForge page]. Installation instructions are available at [[SimpleITK/GettingStarted/A visual guide to SimpleITK in Java|a visual guide to SimpleITK in Java]].<br />
<br />
==Nightly binaries==<br />
<br />
The '''latest binaries''' for the current development version of SimpleITK are also generally available. Binary packages are built as part of the nightly regression testing system. The download links are available from the [https://open.cdash.org/index.php?project=SimpleITK '''CDash'''] '''dashboard''' in the "Nightly Packages" section. <br />
<br />
Each row on the dashboard is a SimpleITK build on a particular system, and if the build was successful there will be a '''package icon''': https://open.cdash.org/img/package.png which links to the packages build by the system. A user may directly download the built package from such a link.<br />
<br />
=Build It Yourself=<br />
<br />
In many cases a user does not need to build SimpleITK because of the pre-built binaries available (see [[SimpleITK/GettingStarted#Binaries|above]]). However there are several reasons a user might prefer to '''build SimpleITK from source''':<br />
* The binary files for your programming language of choice are not (yet) distributed<br />
* You want the live on the bleeding edge by using the latest-and-greatest version of SimpleITK<br />
* You want to wrap your own filters using the SimpleITK infrastructure<br />
* You want to contribute to the development of SimpleITK<br />
* To use the SimpleITK's C++ interface and/or use ITK directly<br />
<br />
=== Prerequisites ===<br />
To build SimpleITK you need:<br />
* A recent version of [http://www.cmake.org/ CMake] >= 3.3 with SSL support for https.<br />
* A supported [[SimpleITK/FAQ#Is_my_compiler_supported.3F|compiler]]<br />
* To use the latest developmental version, source code can be downloaded with [http://git-scm.com/ git] >= 1.65<br />
** Git is required if building SimpleITK using "SuperBuild" (see below) to automatically download the matching version of ITK, SWIG, etc...<br />
** Windows users may prefer [http://msysgit.github.com/ msysGit]<br />
* It is recommended to have numpy installed when testing Python bindings<br />
<br />
=== Recipes / Formulas / Short Cuts ===<br />
<br />
For some environments we have short cuts, scripts, for automated building of SimpleITK (see their repository for more details):<br />
<br />
* For '''Python''': The [https://github.com/scikit-build/scikit-build scikit-build] based distutils based [https://github.com/scikit-build/scikit-build setup.py frontend] can be used to build, install, and package SimpleITK for Python.<br />
<br />
* For the '''Anaconda Python''' distribution: The recipe and instructions for the SimpleITK build are in [https://github.com/SimpleITK/SimpleITKCondaRecipe this GitHub repository]. <br />
<br />
* For the '''R language''': A devtools installer and instructions are available from [https://github.com/SimpleITK/SimpleITKRInstaller this GitHub repository]. <br />
<br />
* '''On the Mac''', with the [http://brew.sh/ Homebrew package manager], a SimpleITK formula is available: https://github.com/Homebrew/homebrew-science/blob/master/simpleitk.rb for multiple language wrappings.<br />
<br />
* For the '''Lua language''' with the Luarocks module deployment system, a SimpleITK rockspec is available form [https://github.com/SimpleITK/SimpleITKLuaRock this GitHub repository].<br />
<br />
=== Source code ===<br />
<br />
If one of the above language specific front-ends are not used then SimpleITK must be build directly.<br />
<br />
There are two options to obtain the SimpleITK source code:<br />
# Download a released version from the SimpleITK [https://sourceforge.net/projects/simpleitk/ SourceForge] page<br />
# Download the latest development version using git<br />
git clone http://itk.org/SimpleITK.git<br />
<br />
=== Building using SuperBuild ===<br />
After downloading SimpleITK's source code we '''STRONGLY''' recommend to run cmake on the SuperBuild subdirectory of SimpleITK. Execute the following commands in the parent of the SimpleITK source directory to configure the SuperBuild:<br />
mkdir SimpleITK-build<br />
cd SimpleITK-build<br />
cmake ../SimpleITK/SuperBuild<br />
<br />
The SuperBuild will automatically download and build the matching version of ITK and SWIG needed to compile SimpleITK. Additionally, it will set recommended compilation flags to minimize the size of the library and enable support for large libraries. This is the recommended way to build SimpleITK and is easiest.<br />
<br />
If you get an error message saying that ITK_DIR is not set then, you did not correctly point cmake to the SuperBuild sub-directory. Please erase your binary directory, and point cmake to the SimpleITK/SuperBuild sub-directory.<br />
<br />
The cmake configuration process should automatically find supported languages and enable SimpleITK wrapping for them. To manually enable a language toggle the appropriate WRAP_LANGUAGE cmake variable to ON. Verify and/or correct the advanced cmake variables to the language specific executable, libraries and include directories. For example if you have multiple Python installations ensure that all related Python variable refer to the same versions.<br />
<br />
Then use your make utility or your cmake chosen build utility to build SimpleITK.<br />
<br />
SimpleITK takes a while to build. Some tips and tricks to speed up development time are listed [http://www.itk.org/SimpleITKDoxygen/html/Developer.html#TandT here].<br />
<br />
=== Building Manually ===<br />
This is '''not''' the recommended way of building SimpleITK, but it can be useful if you want to use a system version of ITK, etc. , or if you do not want to (or can not) use git.<br />
<br />
# Setup the prerequisites as described above (i.e. CMake and supported compiler)<br />
# Install the matching version of [http://www.swig.org/ SWIG] >= 3.0.11<br />
#* e.g. Windows users may install [http://prdownloads.sourceforge.net/swig/swigwin-3.0.11.zip swigwin-3.0.11]<br />
# Download the SimpleITK source code from the [https://sourceforge.net/projects/simpleitk/files/SimpleITK/ SourceForge] page<br />
# Download the matching version of ITK, found by examining the `SuperBuild/External_ITK.cmake` file.<br />
# Configure ITK using CMake<br />
#* e.g. BUILD_EXAMPLES=OFF, BUILD_TESTING=OFF, BUILD_SHARED_LIBS=OFF, '''ITK_USE_REVIEW=ON'''<br />
# Build ITK<br />
#* Be sure to note the build settings e.g. Release x64<br />
# Configure SimpleITK using CMake<br />
#* Set ITK_DIR to the location of the ITK build location from the previous steps<br />
# Build SimpleITK<br />
#* Be sure to configure the build settings exactly the same as ITK e.g. Release x64 and CXX_FLAGS<br />
<br />
=== Advanced Build Options ===<br />
<br />
SimpleITK is aware of the enabled and disabled ITK Modules. It is possible to customize SimpleITK by disabling unneeded ITK modules or to extend SimpleITK by writing custom json file dependent an ITK Remote Modules being enabled.<br />
<br />
Additionally, each of the Examples directory, and each of the Wrapping subdirectories can be configured as independent CMake project dependent on an installed SimpleITK.<br />
<br />
===[[SimpleITK/GettingStarted/Visual_guide_to_building_on_Linux|A visual guide to building SimpleITK on Linux]]===<br />
<br />
==Testing==<br />
<br />
After compilation the prudent thing to due is to test SimpleITK to ensure your build is stable and suitable for installation and use. The following commands execute the SimpleITK tests.<br />
<br />
cd SimpleITK-build/SimpleITK-build<br />
ctest<br />
<br />
On Windows you will need to specify configuration. Typically that would be the Release configuration, as such:<br />
cd SimpleITK-build/SimpleITK-build<br />
ctest -C Release<br />
<br />
==Python installation==<br />
<br />
To install a built python package into the system Python, as root run:<br />
cd SimpleITK-build/Wrapping/Python<br />
python Packaging/setup.py install<br />
<br />
Alternatively, a Python virtual environment can be created and the distribution installed there.<br />
<br />
A Python Wheel file (.whl) can be created in the "Wrapping/Python/dist" directory, by building the "dist" target. If you have used the Superbuild with the "make" generator then issue the following command:<br />
make -C SimpleITK-build dist<br />
<br />
==R installation==<br />
<br />
To install a built R package:<br />
<br />
cd SimpleITK-build/Wrapping/R/Packaging<br />
R CMD INSTALL SimpleITK<br />
<br />
This will install the R package "SimpleITK" in /usr/local as root or your local R installation directory.<br />
<br />
<br />
If you are working in a multi-user environment, and are considerate of your fellow users you can install the package in a local directory:<br />
<br />
<ol> <li> Create a local directory where you will install your R packages</li></ol><br />
mkdir my_R_libs<br />
<ol start="2"> <li> Add an environment variable to your .bashrc</li></ol> <br />
export R_LIBS="/path_to/my_R_libs"<br />
<ol start="3"> <li> source your .bashrc and check the R library path, in an R shell >.libPaths()</li></ol><br />
<ol start="4"> <li>install </li></ol><br />
<br />
cd SimpleITK-build/Wrapping/R/Packaging<br />
R CMD INSTALL -l /path_to/my_R_libs SimpleITK<br />
<br />
=Recommended Software=<br />
<br />
== Fiji (Fiji is Just ImageJ) ==<br />
<br />
SimpleITK has a built in function, [https://itk.org/SimpleITKDoxygen/html/namespaceitk_1_1simple.html#ac8416e6e7f02dedfe8373b83dbea411d '''"itk::simple::Show()"'''], which can be used for viewing images in an interactive session. Currently, this function by default Show invokes [https://fiji.sc '''Fiji'''] then [http://rsbweb.nih.gov/ij/ '''ImageJ'''] to display images. ImageJ was chosen because it can handle all the image types that SimpleITK supports, even 3D vector images with n components. <br />
<br />
The Show function first searches the "PATH" environment variable, then additional standard locations are examined, if problems are encountered the correct path can be added to this environment variable and the '''"debugOn'''" option to '''"Show'''" flag set.<br />
<br />
====ImageJ====<br />
<br />
If ImageJ is used then we recommend downloading a recent version of [http://rsbweb.nih.gov/ij/download.html ImageJ] from the official home page. Recent versions come with support for the [http://nifti.nimh.nih.gov/nifti-1/ Nifti] ( *.nii ) file format, which SimpleITK uses to export to ImageJ. <br />
<br />
'''Note:''' '''Linux installation''' requires an additional step. The '''"Show'''" function searches for an executable named ImageJ or imagej, however the default tarball does not come with this file. Instead it comes with a file names [http://imagej.nih.gov/ij/download/linux/unix-script.txt script]. This file contains the installation instructions. In short the file should be renamed to "imagej" and the site specific variables for the installation location, and java must be set. Also consider the "newwindow" variable... Do you really want a new instance of ImageJ launched each time you use Show? Lastly, as the installation instructions indicate, the imagej wrapper should be in your path.<br />
<br />
==iPython and Jupyter==<br />
<br />
If you are using python, [http://ipython.org/ '''ipython'''] with [http://jupyter.org Jupyter] is terrific environment to perform interactive computing for image processing. With the addition of numpy and scipy, you'll have a powerful interactive environment.<br />
<br />
We have instructional [http://insightsoftwareconsortium.github.io/SimpleITK-Notebooks/ SimpleITK Jupyter Notebooks] which can help you get started.</div>Blowekamphttps://public.kitware.com/Wiki/index.php?title=Template:SimpleITKMigrationHeader&diff=61873Template:SimpleITKMigrationHeader2017-06-19T18:56:36Z<p>Blowekamp: </p>
<hr />
<div>{| class="wikitable" style="text-align:center;width: 100%; background-color:#ffff99;" cellpadding="10"<br />
| '''NOTICE'''<br />
|-<br />
|This page is being migrated to Read The Docs!<br />
<br />
For the up to date version please see [https://simpleitk.readthedocs.io/en/master/{{#if:{{{1|}}}|Documentation/docs/source/index.html|index.html}} this page]!<br />
<br />
|}</div>Blowekamphttps://public.kitware.com/Wiki/index.php?title=Template:SimpleITKMigrationHeader&diff=61872Template:SimpleITKMigrationHeader2017-06-15T17:17:05Z<p>Blowekamp: </p>
<hr />
<div>{| class="wikitable" style="text-align:center;width: 100%; background-color:#ffff99;" cellpadding="10"<br />
| '''NOTICE'''<br />
|-<br />
|This page is being migrated to Read The Docs!<br />
<br />
For the up to date version please see [https://simpleitk.readthedocs.io/en/master/Documentation/docs/source/{{{1}}}.html this page]!<br />
<br />
|}</div>Blowekamphttps://public.kitware.com/Wiki/index.php?title=SimpleITK/FAQ&diff=61871SimpleITK/FAQ2017-06-15T16:57:57Z<p>Blowekamp: </p>
<hr />
<div>{{SimpleITKMigrationHeader|faq}}<br />
[[Image: Simpleitk_logo.png|center]]<br />
<br />
This page hosts frequently asked questions about SimpleITK, and their answers.<br />
<br />
= Installation =<br />
<br />
==Why do I get an error about a missing Dynamic Library when running SimpleITK with Python on windows?==<br />
<br />
This error has been resolved with SimpleITK version 0.5.1 and should no longer occur. Upgrading to the latest SimpleITK is encouraged.<br />
<br />
This error occurs after you have downloaded the Windows SimpleITK binaries when you are running python and try to import SimpleITK. There is an error about a missing DLL on Windows when you don't have Visual Studio 10 and no other application has installed certain libraries before. You will need to download the Visual Studio 10 redistribution libraries. The libraries are available for download [http://www.microsoft.com/download/en/details.aspx?id=5555 here].<br />
<br />
== I am using the binary distribution of SimpleITK for Anaconda, why do I get an error about libpng? ==<br />
<br />
ImportError: dlopen(./_SimpleITK.so, 2): Library not loaded: @rpath/libpng15.15.dylib<br />
Referenced from: .../lib/python2.7/site-packages/SimpleITK/_SimpleITK.so<br />
Reason: image not found<br />
<br />
This can be resolved by installing the version of libpng that SimpleITK 0.9 was built against:<br />
<br />
conda create -n sitkpy anaconda libpng=1.5<br />
<u>unix/mac</u>: source activate sitkpy <br> <u>win</u>: activate sitkpy <br />
conda install -c <nowiki>https://conda.binstar.org/simpleitk/channel/main</nowiki> SimpleITK<br />
conda install libpng=1.5 <br />
<br />
This set of commands:<br />
* creates the virtual environment with our choice of libpng version, all other anaconda packages will be compatible with this version.<br />
* activate the virtual environment.<br />
* installs SimpleITK into the virtual environment (unfortunately this will automatically upgrade you to libpng 1.6).<br />
* downgrades to libpng 1.5 so that library versions are compatible.<br />
<br />
We are currently investigating why the anaconda build system is not expressing version dependency for shared libraries. We how this will not be an issue with the next binary package.<br />
<br />
= How to Use =<br />
<br />
== What filters are currently available in SimpleITK? ==<br />
<br />
As of March 2014 we have approximately '''260 ITK image filters''' wrapped for SimpleITK. The [http://www.itk.org/SimpleITKDoxygen/html/Filter_Coverage.html '''filter coverage table'''] shows the current set of ITK filters in SimpleITK. Additionally the [http://www.itk.org/SimpleITKDoxygen/html/classes.html Doxygen] can be looked at to determine if a filter is available.<br />
<br />
== What image file formats can SimpleITK read? ==<br />
<br />
<br />
<br />
== How do I read a RAW image into SimpleITK? ==<br />
<br />
In general raw image files are missing information. They do not contain the nessesary header information to describe the basic size and type for the data, so this format is intrinsically deficient. The [http://www.itk.org/Doxygen/html/classitk_1_1RawImageIO.html RawImageIO] class is not available in SimpleITK so there is no direct way to programmatically hard code this header information. The suggested way is to create a Meta image header file (*.mhd) which references the raw data file and describes the size and type of the data. The documentation on how to write a Meta image header can be found [http://www.itk.org/Wiki/MetaIO/Documentation#Reading_a_Brick-of-Bytes_.28an_N-Dimensional_volume_in_a_single_file.29 here].<br />
<br />
The following is a sample Meta image header file, perhaps of name sample.mhd:<br />
<br />
ObjectType = Image<br />
NDims = 3<br />
DimSize = 256 256 64<br />
ElementType = MET_USHORT<br />
ElementDataFile = image.raw (this tag must be last in a MetaImageHeader)<br />
<br />
== Can I use another image file viewer beside ImageJ? ==<br />
<br />
By default when the [http://www.itk.org/SimpleITKDoxygen/html/namespaceitk_1_1simple.html#a7bacfc4685cff93e46d7401865f9579e Show function] is called, SimpleITK writes out a temporary image in Nifti format then launches [http://rsbweb.nih.gov/ij/index.html ImageJ]. The user can override the file format of the temporary file and/or the application used to handle that file.<br />
<br />
The temporary file format can be specified via the '''SITK_SHOW_EXTENSION''' environment variable. For example, if the user wanted to export a PNG file, on Linux it might look like this:<br />
<br />
SITK_SHOW_EXTENSION=".png"<br />
export SITK_SHOW_EXTENSION<br />
<br />
Use of an extension unsupported by ITK results in an error message. For the supported image formats, here is the [http://www.itk.org/Doxygen/html/group__IOFilters.html ITK Image IO Filters].<br />
<br />
The default display application for all image types is ImageJ. To override ImageJ with some other application, use the '''SITK_SHOW_COMMAND''' environment variable. For instance, on Unix systems, using GNOME's image viewer eog would be:<br />
<br />
SITK_SHOW_EXTENSION=".png"<br />
export SITK_SHOW_EXTENSION<br />
SITK_SHOW_COMMAND="eog"<br />
export SITK_SHOW_COMMAND<br />
<br />
To override the default display applications for only color or 3d images, there are the '''SITK_SHOW_COLOR_COMMAND''' and '''SITK_SHOW_3D_COMMAND''' environment variables.<br />
<br />
More details on the Show function, including use of the "%a" and "%f" tokens, is at the [http://www.itk.org/SimpleITKDoxygen/html/namespaceitk_1_1simple.html#a7bacfc4685cff93e46d7401865f9579e Show function Doxygen page].<br />
<br />
== How can I use 3D Slicer to view my images? ==<br />
[http://slicer.org 3D Slicer] is a very powerful and popular application for visualization and medical image computing. The SITK_SHOW_COMMAND environment variable may be used to display images in Slicer instead of SimpleITK's default viewer, ImageJ. The following are examples of what settings for SITK_SHOW_COMMAND might look like for Mac OS X, Linux and Windows to use Slicer.<br />
<br />
<br />
Mac OS X<br />
export SITK_SHOW_COMMAND=/Applications/Slicer.app/Contents/MacOS/Slicer<br />
<br />
Linux<br />
export SITK_SHOW_COMMAND=Slicer<br />
<br />
Windows<br />
set SITK_SHOW_COMMAND=:"c:\Program Files\Slicer 4.2.2-1\Slicer"<br />
<br />
The value of SITK_SHOW_COMMAND should be modified to point to wherever Slicer is installed. If you only want to use Slicer for volumetric 3D images, use the SITK_SHOW_3D_COMMAND environment variable instead of SITK_SHOW_COMMAND.<br />
<br />
== How can I use a newer Java with ImageJ on Mac OS X? ==<br />
By default on Mac OS X, the ImageJ application expects Java 6, which is old and unsupported. The latest supported version of Java (currently version 8u25) can be downloaded from [http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html Oracle's Java Development kit page]. The following bash commands will set up the SITK_SHOW_COMMAND and SITK_SHOW_COLOR_COMMAND to invoke ImageJ's jar file using the Java compiler.<br />
<br />
ij="/Applications/ImageJ/"<br />
ijcmd="java -Dplugins.dir=$ij/plugins -jar $ij/ImageJ.app/Contents/Resources/Java/ij.jar"<br />
<br />
export SITK_SHOW_COMMAND="$ijcmd -eval 'open( \"%f\" );'"<br />
export SITK_SHOW_COLOR_COMMAND="$ijcmd -eval 'open( \"%f\" ); run(\"Make Composite\", \"display=Composite\");'"<br />
<br />
The first lines set a variable pointing to the standard location for the ImageJ directory. If ImageJ is installed somewhere else, the line should be modified. The second line provides the command to launch ImageJ using the Java compiler. It includes flags that point to ImageJ's plugiin directory and ImageJ's ij.jar file.<br />
<br />
The SITK_SHOW_COMMAND tells SimpleITK.Show() to launch Java with ij.jar and then execute the open macro with an image file. The SITK_SHOW_COLOR_COMMAND does these same things and then executes the ImageJ "Make Composite" command to treat a multichannel image as a composite color image.<br />
<br />
= Wrapping =<br />
<br />
== Python ==<br />
<br />
== Tcl ==<br />
<br />
== Java ==<br />
<br />
== C# ==<br />
<br />
== R ==<br />
<br />
<br />
= Compilation =<br />
<br />
==Is my compiler supported?==<br />
SimpleITK uses advanced C++ meta-programming to instantiate ITK's Images and Filters. Addtionally, we use some headers which are included in the C99 and C++ TR1 extension. Therefore SimpleITK places additional requirements on the compiler beyond what is required for ITK. In principle we require C++x03 with C99's "stdint.h" and TR1's "functional". If your compiler has those features it is likely able to be supported.<br />
<br />
The additional requirement for a supported compiler is that it is on the nightly dashboard. With this regard, the list of supported compilers is on the SimpleITK [http://open.cdash.org/index.php?project=SimpleITK SimpleITK dashboard]. We welcome user contributions to the nightly dashboard to expand the list of supported compilers.<br />
<br />
===Committed to Support===<br />
<br />
* GCC 4.2-4.7<br />
* Visual Studio 2008 with Service Pack 1 (VS9)<br />
* Visual Studio 2012 (VS10) ( including Express )<br />
* Visual Studio 2012 (VS11)<br />
<br />
=== Noted Problems ===<br />
* Compiling on a MS Windows 32-bit OS with static libraries is not supported due to lack of memory.<br />
* With SimpleITK release 0.4.0, Visual Studio 2008 was not compiling. This problem has since been remedied in the development branch on April 18th, 2012.<br />
* With SimpleITK release 0.7.0, Visual Studio 2008 is not able to compile all wrapped languages at the same time, it's recommenced to choose one at a time.<br />
<br />
==Why am I getting a compilation error on OSX Mavericks?==<br />
<br />
With SimpleITK <=0.7 the following error occurred during compilation on Apple OSX 10.9 Mavericks with '''clang 5.0''':<br />
<br />
'''SimpleITK/Code/Common/include/sitkMemberFunctionFactoryBase.h:106:16: <span style="color:red">error</span>: no member named 'tr1' in namespace 'std''''<br />
typedef std::tr1::function< MemberFunctionResultType ( ) > FunctionObjectType;<br />
<nowiki>~~~~~^</nowiki><br />
<br />
With Xcode 5.0, Apple's distributed version of clang (5.0) changed which implementation of the C++ Standard Library it uses by default. Previous versions of clang (4.2 and earlier) used [http://gcc.gnu.org/libstdc++/ GNU's libstdc++] , while clang 5.0 now uses [http://libcxx.llvm.org LLVM's libc++]. SimpleITK 0.7 and earlier require certain features from [http://en.wikipedia.org/wiki/C%2B%2B_Technical_Report_1 C++ tr1] which are not implemented in LLVM's libc++ but are available in GNU's libstdc++.<br />
<br />
To build SimpleITK <=0.7 with clang 5.0, you can configure the compiler to use GNU's stdlibc++. This change must be done at the initial configuration:<br />
<br />
cmake "-DCMAKE_CXX_FLAGS:STRING=-stdlib=libstdc++" ../SimpleITK/SuperBuild<br />
<br />
NOTE: If you already have a build directory which has been partially configured the contents must be deleted. The above line needs to be done for an initial configuration in an empty build directory.<br />
NOTE: This work around does not work when with the CMake "Xcode" generator. It is recommended to just use the default "Unix Makefiles" generator, to build SimpleITK, and get using SimpleITK, not building it.<br />
<br />
The following is a '''compatibility table for clang 5.0'''. It shows that the default of libc++ does not work with SimpleITK, while the other options do. The choice of which standard library to use and which C++ language standard to use are independent.<br />
<br />
{| class="wikitable"<br />
|-<br />
!Clang 5.0 compatibility<br />
! -stdlib=libc++ <br />
! -stdlib=libstdc++<br />
|-<br />
! (c++03)<br />
| style="background:red" | FAIL<br />
| style="background:green" | OK<br />
|-<br />
! -std=c++11<br />
| style="background:LightGreen" | OK (>=0.8)<br />
| style="background:green" | OK<br />
|}<br />
<br />
For SimpleITK >=0.8, support for the tr1 features migrated to C++11 has been improved with better feature detection, and the necessary flags are now automatically added. LLVM's libc++ will now work if compiling with the C++11 standard by adding the flag "-std=c++11" in the initial configuration.<br />
<br />
To further complicate dependencies and interactions, some downloadable languages such as Java, or R, may be compiled against GNU's libstdc++. This may cause a conflict in the types used in the interface resulting in compilation errors while wrapping the language.<br />
<br />
==Why does the Superbuild fail compiling PCRE on Mac OS X?==<br />
If the Xcode command line tools are not properly set up on OS X, PCRE could fail to build in the Superbuild process with messages such as:<br />
<br />
checking whether we are cross compiling... configure: error: in `/your/build/path/SimpleITK/PCRE-prefix/src/PCRE-build': <br />
configure: error: cannot run C compiled programs.<br />
If you meant to cross compile, use `--host'.<br />
See `config.log' for more details<br />
[10/13] Performing build step for 'PCRE'<br />
<br />
To install the command line developer tools enter the following:<br />
'''xcode-select --install<br />
<br />
To reset the default command line tools path:<br />
'''xcode-select --reset<br />
<br />
==Do I need to download an option package for TR1 support?==<br />
Visual Studio 2008 requires an additional download for TR1 support. This support is best provided with the Service Pack 1. There is a separate TR1 feature pack which can be downloaded, but it is no longer recommended since Service Pack 1 includes TR1 and numerous bug and performance improvements.<br />
<br />
==Do I need to download an optional package for C99?==<br />
<br />
SimpleITK will proved a "stdint.h" header if missing on the system.<br />
<br />
==How do I build with Visual Studio 2008?==<br />
Visual Studio 2008 is the oldest supported Microsoft development environment that SimpleITK supports. To build SimpleITK, certain features of C++TR1 are required. These features are best provided by the [http://www.microsoft.com/download/en/details.aspx?id=23691 "Microsoft Visual Studio 2008 Service Pack 1"] (or try this link [http://www.microsoft.com/en-us/download/confirmation.aspx?id=10986]). Alternatively just the [http://www.microsoft.com/downloads/en/details.aspx?FamilyId=D466226B-8DAB-445F-A7B4-448B326C48E7&displaylang=en Visual C++ 2008 Feature Pack Release] can be installed. Please note that all our dashboard machines now use SP1.<br />
<br />
<br />
Older versions of SimpleITK (<0.7.0) requires a also required a separately downloaded stdint.h for this compiler. This is not automatically provided if needed. If it's still needed the file can be downloaded [http://msinttypes.googlecode.com/svn/trunk/stdint.h here]. For 64-bit Microsoft Windows it should be dragged with the GUI into the appropriate include path for the architecture.<br />
<br />
== What Configurations on Windows are Supported For Building? ==<br />
<br />
There are quite a large number of configuration options available for the Windows platform. The following table is a guide line of what is regularly tested and confirmed to work or fail.<br />
<br />
<br />
{| class="wikitable"<br />
|-<br />
!<br />
! Architecture<br />
! Library Type<br />
! colspan="2" |Visual Studio 2008 SP1 (VS9 )<br />
! colspan="2" | Visual Studio 2010 ( VS10 )<br />
! colspan="2" | Visual Studio 2012 ( VS11 )<br />
! colspan="2" | Visual Studio 2013 ( VS13 )<br />
|-<br />
!<br />
!<br />
!<br />
! Release<br />
! Debug<br />
! Release<br />
! Debug<br />
! Release<br />
! Debug <br />
! Release<br />
! Debug<br />
|-<br />
! rowspan="2" style="background:Orange" | 32-bit Window OS<br />
! rowspan="2" style="background:Orange" | Only Intel 32-bit<br />
! style="background:Orange" | Static<br />
| style="background:red" | FAIL<br />
| style="background:red" | FAIL<br />
| style="background:red" | FAIL<br />
| style="background:red" | FAIL<br />
| style="background:Orange" | <br />
| style="background:Orange" | <br />
| style="background:Orange" | <br />
| style="background:Orange" | <br />
|-<br />
! style="background:Orange" | Shared<br />
| style="background:red" | FAIL<br />
| style="background:red" | FAIL<br />
| style="background:green" | Nightly<br />
| style="background:green" | Nightly<br />
| style="background:Orange" | <br />
| style="background:Orange" | <br />
| style="background:Orange" | <br />
| style="background:Orange" | <br />
|-<br />
! rowspan="4" |64-bit Window OS<br />
! rowspan="2" | Intel 32-bit<br />
! Static<br />
| style="background:green" | Nightly<br />
| style="background:Orange" | <br />
| style="background:green" | Nightly<br />
| style="background:Orange" | <br />
| style="background:green" | Nightly<br />
| style="background:Orange" |<br />
| style="background:green" | Nightly<br />
| style="background:Orange" |<br />
|-<br />
! Shared<br />
| style="background:LightGreen" |<br />
| style="background:LightGreen" |<br />
| style="background:LightGreen" |<br />
| style="background:LightGreen" |<br />
| style="background:LightGreen" |<br />
| style="background:LightGreen" |<br />
| style="background:LightGreen" |<br />
| style="background:LightGreen" |<br />
|-<br />
! rowspan="2" | Intel 64-bit<br />
! Static<br />
| style="background:green" | Nightly<br />
| style="background:LightGreen" | <br />
| style="background:green" | Nightly<br />
| style="background:green" | Nightly<br />
| style="background:LightGreen" |<br />
|<br />
| style="background:LightGreen" |<br />
|<br />
|-<br />
! Shared<br />
| style="background:LightGreen" |<br />
| style="background:LightGreen" |<br />
| style="background:LightGreen" |<br />
| style="background:LightGreen" |<br />
| style="background:green" | Nightly<br />
| <br />
| style="background:green" | Nightly<br />
|<br />
|}<br />
<br />
{| class="wikitable"<br />
|<br />
! Legend<br />
|-<br />
| style="background:Green" | Nightly<br />
| This combination of options is nightly tested, and known to work.<br />
|-<br />
|style="background:LightGreen" |<br />
| This combinations has been manually tested, and is expected to work.<br />
|-<br />
| <br />
| It is not known if this combinations of options will work.<br />
|-<br />
| style="background:Orange" |<br />
| This combination likely has problems, and is not recommended.<br />
|-<br />
| style="background:Red" | FAIL<br />
| These options are known not to work.<br />
|}<br />
<br />
This table has been updated for the release branch, master, as of February 15th 2013.<br />
<br />
== Why are all of the configurations not supported on Windows? ==<br />
<br />
One of the following errors frequently occur when the set of configuration options fail:<br />
<br />
LINK : fatal error LNK1102: out of memory<br />
<br />
LINK : fatal error LNK1248: image size (80000010) exceeds maximum allowable size (80000000)<br />
<br />
<br />
These errors occur because of limitations in the compiler's linker or the operating system. For 64-bit architectures the linker is still only 32-bits on some Visual Studios. In certain configurations the linker can run out of memory. Also the Windows operating systems have a hard limit of 2GB for the size of libraries. For Debug mode configurations this limit can be encounted.<br />
<br />
In general building in Debug mode should not be necessary, unless you are trying to debug SimpleITK or ITK. This configuration produces libraries that are very large because the compiler must maintain symbols for all instantiated ITK classes and member functions for each template parameters that a class is instantiating.<br />
<br />
<br />
== Where is the Test Data? ==<br />
<br />
The testing data is not stored in the SimpleITK repository or as part of the source code. It is mirrored on several data repositories on the web.<br />
<br />
If you have obtained the source code from the git repository, it should be downloaded as part of the build process via the CMake ExternalData module.<br />
<br />
If you have downloaded a tar-ball of the source code there should be an accompanying "SimpleITKData" tar-ball available, which contains the external data. It should populate the .ExternalData subdirectory of the SimpleITK source code directory when extracted.<br />
<br />
== Why is CMake unable to download ExternalData? ==<br />
<br />
When compiling SimpleITK you may get and error like the following:<br />
<br />
Object MD5=2e115fe26e435e33b0d5c022e4490567 not found at:<br />
https://placid.nlm.nih.gov/api/rest?method=midas.bitstream.download&checksum=2e115fe26e435e33b0d5c022e4490567&algorithm=MD5 ("Unsupported protocol")<br />
https://simpleitk.github.io/SimpleITKExternalData/MD5/2e115fe26e435e33b0d5c022e4490567 ("Unsupported protocol") <br />
https://midas3.kitware.com/midas/api/rest?method=midas.bitstream.download&checksum=2e115fe26e435e33b0d5c022e4490567&algorithm=MD5 ("Unsupported protocol")<br />
https://insightsoftwareconsortium.github.io/ITKTestingData/MD5/2e115fe26e435e33b0d5c022e4490567 ("Unsupported protocol")<br />
https://itk.org/files/ExternalData/MD5/2e115fe26e435e33b0d5c022e4490567 ("Unsupported protocol")<br />
<br />
This indicates that CMake was not compiles with SSL support. The "Unsupported protocol" message indicate that CMake can not communicate via "https".<br />
<br />
The solution is to use a compiled version of CMake which supports SSL. If you compile CMake yourself, simply reconfigure CMake with the "CMAKE_USE_OPENSSL option enabled.</div>Blowekamphttps://public.kitware.com/Wiki/index.php?title=SimpleITK/GettingStarted&diff=61870SimpleITK/GettingStarted2017-06-15T16:57:12Z<p>Blowekamp: </p>
<hr />
<div>{{SimpleITKMigrationHeader|getting_started}}<br />
<br />
[[Image: SimpleITK-SquareTransparentLogo.png|center]]<br />
<br />
SimpleITK provides a simplified interface to ITK in a variety of languages. You can either download binaries, if they are available for your platform and prefered language, or you can build SimpleITK yourself.<br />
<br />
Additionally, there are several recommended third-party software packages.<br />
<br />
After you have installed SimpleITK, please look to the [[ITK_Release_4/Outreach/Conferences/MICCAI 2011/SimpleITK|Tutorial]] or the [http://www.itk.org/SimpleITKDoxygen/html/ Doxygen] pages for more information.<br />
<br />
=Downloading the binaries=<br />
<br />
One of the great advantages of SimpleITK is that (typically) you do not have to build it — you can simply download the binaries and get started right away!<br />
<br />
Currently, '''Python''' binaries are available on Microsoft Windows, GNU Linux and Apple OS X. '''C# and Java''' binaries are available for Windows. We are also working towards supporting '''R''' packaging.<br />
<br />
==Python binary files==<br />
<br />
There are currently two Python binary package choices: Python Wheels, and Anaconda packages for the Anaconda Python distribution.<br />
<br />
==== Use a Virtual Environment ====<br />
<br />
Before you install SimpleITK we <b>highly recommend</b> that you create a virtual environment into which you install the package. Note that different Python versions and distributions have different programs for creating and managing virtual environments. <br />
<br />
The use of a virtual environment allows you to elegantly deal with package compatability issues, to quote [http://docs.python-guide.org/en/latest/ The Hitchhiker’s Guide to Python!]:<br />
<blockquote>A Virtual Environment is a tool to keep the dependencies required by different projects in separate places, by creating virtual Python environments for them. It solves the “Project X depends on version 1.x but, Project Y needs 4.x” dilemma, and keeps your global site-packages directory clean and manageable.</blockquote><br />
<br />
Programs for creating virtual environments include [https://packaging.python.org/en/latest/installing/#creating-virtual-environments virtualenv and pyvenv] for generic Python distributions, [http://conda.pydata.org/docs/using/envs.html conda] for the anaconda distribution, and [http://docs.enthought.com/canopy/configure/canopy-cli.html canopy_cli] for the canopy distribution.<br />
<br />
=== Wheels for Generic Python Distribution ===<br />
<br />
If you are working with the [https://www.python.org/ generic Python distribution] you can install a Wheel with the lasted version of pip (>=9.0).<br />
<br />
First thing you should do is create a virtual environment (virtualenv or pyvenv tools) and activate it.<br />
<br />
<u>Note</u>: you can always manually download the wheels for your operating system and Python version directly from [http://sourceforge.net/projects/simpleitk/files/SimpleITK/ sourceforge].<br />
<br />
<br />
From the command line use the [https://pip.pypa.io/en/latest/index.html pip program] to install:<br />
<br />
$ pip install SimpleITK<br />
<br />
The pip package manager should automatically find the correct package for Microsoft Windows, Apple OS X and GNU Linux if your version and architecture are supported. If no binary package is found, then a source distribution will be downloaded and attempted to be compiled and you should look into [[#Build_It_Yourself]].<br />
<br />
:: If your pip version in the virtual environment is stale (<9.0) you need to update it (pip install -U pip).<br />
<br />
=== Anaconda Distribution ===<br />
<br />
First thing you should do is create a virtual environment ([https://conda.pydata.org/docs/using/envs.html conda] tool) and activate it.<br />
<br />
Currently there are compiled binaries on [https://conda.anaconda.org/simpleitk Anaconda Cloud], easily installed with:<br />
<br />
$ conda install -c <nowiki>https://conda.anaconda.org/simpleitk</nowiki> SimpleITK<br />
<br />
Beta and release candidate packages are also available on Anaconda cloud under the dev label:<br />
<br />
$conda install -c <nowiki>https://conda.anaconda.org/simpleitk/label/dev</nowiki> SimpleITK<br />
<br />
=== Enthought Canopy Distribution ===<br />
<br />
First thing you should do is create a virtual environment (canopy_cli tool) and activate it.<br />
<br />
Currently there are no binaries supported with this distribution. You will need to compile SimpleITK yourself. (Using pip installation may work.)<br />
<br />
==C# binary files==<br />
<br />
'''Binaries for select C# platform''' can be found on [https://sourceforge.net/projects/simpleitk/files/SimpleITK/1.0.0/CSharp/ SimpleITK's SourceForge page]. Installing the library should only involve importing the unzipped files into you C# environment. The files have the following naming convention:<br />
SimpleITK-version-CSharp-buildplatform-targetplatform.zip<br />
eg.<br />
SimpleITK-1.0.0-CSharp-win32-x86.zip<br />
SimpleITK-1.0.0-CSharp-win64-x64.zip<br />
<br />
Details about how to set up a C# Visual Studio project with SimpleITK can be found in the [[SimpleITK/GettingStarted/A_visual_guide_to_SimpleITK_with_CSharp|Visual Guide to SimpleITK with CSharp]].<br />
<br />
More information about getting started with a sample C# program can be found in [[SimpleITK/GettingStarted/Visual_guide_to_building_on_Linux#A_simple_C.23_program| A visual guide to building SimpleITK on Linux]]<br />
<br />
==Java binary files==<br />
<br />
'''Binaries for select Java platforms''' can be found on [https://sourceforge.net/projects/simpleitk/files/SimpleITK/1.0.0/Java/ SimpleITK's SourceForge page]. Installation instructions are available at [[SimpleITK/GettingStarted/A visual guide to SimpleITK in Java|a visual guide to SimpleITK in Java]].<br />
<br />
==Nightly binaries==<br />
<br />
The '''latest binaries''' for the current development version of SimpleITK are also generally available. Binary packages are built as part of the nightly regression testing system. The download links are available from the [https://open.cdash.org/index.php?project=SimpleITK '''CDash'''] '''dashboard''' in the "Nightly Packages" section. <br />
<br />
Each row on the dashboard is a SimpleITK build on a particular system, and if the build was successful there will be a '''package icon''': https://open.cdash.org/img/package.png which links to the packages build by the system. A user may directly download the built package from such a link.<br />
<br />
=Build It Yourself=<br />
<br />
In many cases a user does not need to build SimpleITK because of the pre-built binaries available (see [[SimpleITK/GettingStarted#Binaries|above]]). However there are several reasons a user might prefer to '''build SimpleITK from source''':<br />
* The binary files for your programming language of choice are not (yet) distributed<br />
* You want the live on the bleeding edge by using the latest-and-greatest version of SimpleITK<br />
* You want to wrap your own filters using the SimpleITK infrastructure<br />
* You want to contribute to the development of SimpleITK<br />
* To use the SimpleITK's C++ interface and/or use ITK directly<br />
<br />
=== Prerequisites ===<br />
To build SimpleITK you need:<br />
* A recent version of [http://www.cmake.org/ CMake] >= 3.3 with SSL support for https.<br />
* A supported [[SimpleITK/FAQ#Is_my_compiler_supported.3F|compiler]]<br />
* To use the latest developmental version, source code can be downloaded with [http://git-scm.com/ git] >= 1.65<br />
** Git is required if building SimpleITK using "SuperBuild" (see below) to automatically download the matching version of ITK, SWIG, etc...<br />
** Windows users may prefer [http://msysgit.github.com/ msysGit]<br />
* It is recommended to have numpy installed when testing Python bindings<br />
<br />
=== Recipes / Formulas / Short Cuts ===<br />
<br />
For some environments we have short cuts, scripts, for automated building of SimpleITK (see their repository for more details):<br />
<br />
* For '''Python''': The [https://github.com/scikit-build/scikit-build scikit-build] based distutils based [https://github.com/scikit-build/scikit-build setup.py frontend] can be used to build, install, and package SimpleITK for Python.<br />
<br />
* For the '''Anaconda Python''' distribution: The recipe and instructions for the SimpleITK build are in [https://github.com/SimpleITK/SimpleITKCondaRecipe this GitHub repository]. <br />
<br />
* For the '''R language''': A devtools installer and instructions are available from [https://github.com/SimpleITK/SimpleITKRInstaller this GitHub repository]. <br />
<br />
* '''On the Mac''', with the [http://brew.sh/ Homebrew package manager], a SimpleITK formula is available: https://github.com/Homebrew/homebrew-science/blob/master/simpleitk.rb for multiple language wrappings.<br />
<br />
* For the '''Lua language''' with the Luarocks module deployment system, a SimpleITK rockspec is available form [https://github.com/SimpleITK/SimpleITKLuaRock this GitHub repository].<br />
<br />
=== Source code ===<br />
<br />
If one of the above language specific front-ends are not used then SimpleITK must be build directly.<br />
<br />
There are two options to obtain the SimpleITK source code:<br />
# Download a released version from the SimpleITK [https://sourceforge.net/projects/simpleitk/ SourceForge] page<br />
# Download the latest development version using git<br />
git clone http://itk.org/SimpleITK.git<br />
<br />
=== Building using SuperBuild ===<br />
After downloading SimpleITK's source code we '''STRONGLY''' recommend to run cmake on the SuperBuild subdirectory of SimpleITK. Execute the following commands in the parent of the SimpleITK source directory to configure the SuperBuild:<br />
mkdir SimpleITK-build<br />
cd SimpleITK-build<br />
cmake ../SimpleITK/SuperBuild<br />
<br />
The SuperBuild will automatically download and build the matching version of ITK and SWIG needed to compile SimpleITK. Additionally, it will set recommended compilation flags to minimize the size of the library and enable support for large libraries. This is the recommended way to build SimpleITK and is easiest.<br />
<br />
If you get an error message saying that ITK_DIR is not set then, you did not correctly point cmake to the SuperBuild sub-directory. Please erase your binary directory, and point cmake to the SimpleITK/SuperBuild sub-directory.<br />
<br />
The cmake configuration process should automatically find supported languages and enable SimpleITK wrapping for them. To manually enable a language toggle the appropriate WRAP_LANGUAGE cmake variable to ON. Verify and/or correct the advanced cmake variables to the language specific executable, libraries and include directories. For example if you have multiple Python installations ensure that all related Python variable refer to the same versions.<br />
<br />
Then use your make utility or your cmake chosen build utility to build SimpleITK.<br />
<br />
SimpleITK takes a while to build. Some tips and tricks to speed up development time are listed [http://www.itk.org/SimpleITKDoxygen/html/Developer.html#TandT here].<br />
<br />
=== Building Manually ===<br />
This is '''not''' the recommended way of building SimpleITK, but it can be useful if you want to use a system version of ITK, etc. , or if you do not want to (or can not) use git.<br />
<br />
# Setup the prerequisites as described above (i.e. CMake and supported compiler)<br />
# Install the matching version of [http://www.swig.org/ SWIG] >= 3.0.11<br />
#* e.g. Windows users may install [http://prdownloads.sourceforge.net/swig/swigwin-3.0.11.zip swigwin-3.0.11]<br />
# Download the SimpleITK source code from the [https://sourceforge.net/projects/simpleitk/files/SimpleITK/ SourceForge] page<br />
# Download the matching version of ITK, found by examining the `SuperBuild/External_ITK.cmake` file.<br />
# Configure ITK using CMake<br />
#* e.g. BUILD_EXAMPLES=OFF, BUILD_TESTING=OFF, BUILD_SHARED_LIBS=OFF, '''ITK_USE_REVIEW=ON'''<br />
# Build ITK<br />
#* Be sure to note the build settings e.g. Release x64<br />
# Configure SimpleITK using CMake<br />
#* Set ITK_DIR to the location of the ITK build location from the previous steps<br />
# Build SimpleITK<br />
#* Be sure to configure the build settings exactly the same as ITK e.g. Release x64 and CXX_FLAGS<br />
<br />
=== Advanced Build Options ===<br />
<br />
SimpleITK is aware of the enabled and disabled ITK Modules. It is possible to customize SimpleITK by disabling unneeded ITK modules or to extend SimpleITK by writing custom json file dependent an ITK Remote Modules being enabled.<br />
<br />
Additionally, each of the Examples directory, and each of the Wrapping subdirectories can be configured as independent CMake project dependent on an installed SimpleITK.<br />
<br />
===[[SimpleITK/GettingStarted/Visual_guide_to_building_on_Linux|A visual guide to building SimpleITK on Linux]]===<br />
<br />
==Testing==<br />
<br />
After compilation the prudent thing to due is to test SimpleITK to ensure your build is stable and suitable for installation and use. The following commands execute the SimpleITK tests.<br />
<br />
cd SimpleITK-build/SimpleITK-build<br />
ctest<br />
<br />
On Windows you will need to specify configuration. Typically that would be the Release configuration, as such:<br />
cd SimpleITK-build/SimpleITK-build<br />
ctest -C Release<br />
<br />
==Python installation==<br />
<br />
To install a built python package into the system Python, as root run:<br />
cd SimpleITK-build/Wrapping/Python<br />
python Packaging/setup.py install<br />
<br />
Alternatively, a Python virtual environment can be created and the distribution installed there.<br />
<br />
A Python Wheel file (.whl) can be created in the "Wrapping/Python/dist" directory, by building the "dist" target. If you have used the Superbuild with the "make" generator then issue the following command:<br />
make -C SimpleITK-build dist<br />
<br />
==R installation==<br />
<br />
To install a built R package:<br />
<br />
cd SimpleITK-build/Wrapping/R/Packaging<br />
R CMD INSTALL SimpleITK<br />
<br />
This will install the R package "SimpleITK" in /usr/local as root or your local R installation directory.<br />
<br />
<br />
If you are working in a multi-user environment, and are considerate of your fellow users you can install the package in a local directory:<br />
<br />
<ol> <li> Create a local directory where you will install your R packages</li></ol><br />
mkdir my_R_libs<br />
<ol start="2"> <li> Add an environment variable to your .bashrc</li></ol> <br />
export R_LIBS="/path_to/my_R_libs"<br />
<ol start="3"> <li> source your .bashrc and check the R library path, in an R shell >.libPaths()</li></ol><br />
<ol start="4"> <li>install </li></ol><br />
<br />
cd SimpleITK-build/Wrapping/R/Packaging<br />
R CMD INSTALL -l /path_to/my_R_libs SimpleITK<br />
<br />
=Recommended Software=<br />
<br />
== Fiji (Fiji is Just ImageJ) ==<br />
<br />
SimpleITK has a built in function, [https://itk.org/SimpleITKDoxygen/html/namespaceitk_1_1simple.html#ac8416e6e7f02dedfe8373b83dbea411d '''"itk::simple::Show()"'''], which can be used for viewing images in an interactive session. Currently, this function by default Show invokes [https://fiji.sc '''Fiji'''] then [http://rsbweb.nih.gov/ij/ '''ImageJ'''] to display images. ImageJ was chosen because it can handle all the image types that SimpleITK supports, even 3D vector images with n components. <br />
<br />
The Show function first searches the "PATH" environment variable, then additional standard locations are examined, if problems are encountered the correct path can be added to this environment variable and the '''"debugOn'''" option to '''"Show'''" flag set.<br />
<br />
====ImageJ====<br />
<br />
If ImageJ is used then we recommend downloading a recent version of [http://rsbweb.nih.gov/ij/download.html ImageJ] from the official home page. Recent versions come with support for the [http://nifti.nimh.nih.gov/nifti-1/ Nifti] ( *.nii ) file format, which SimpleITK uses to export to ImageJ. <br />
<br />
'''Note:''' '''Linux installation''' requires an additional step. The '''"Show'''" function searches for an executable named ImageJ or imagej, however the default tarball does not come with this file. Instead it comes with a file names [http://imagej.nih.gov/ij/download/linux/unix-script.txt script]. This file contains the installation instructions. In short the file should be renamed to "imagej" and the site specific variables for the installation location, and java must be set. Also consider the "newwindow" variable... Do you really want a new instance of ImageJ launched each time you use Show? Lastly, as the installation instructions indicate, the imagej wrapper should be in your path.<br />
<br />
==iPython and Jupyter==<br />
<br />
If you are using python, [http://ipython.org/ '''ipython'''] with [http://jupyter.org Jupyter] is terrific environment to perform interactive computing for image processing. With the addition of numpy and scipy, you'll have a powerful interactive environment.<br />
<br />
We have instructional [http://insightsoftwareconsortium.github.io/SimpleITK-Notebooks/ SimpleITK Jupyter Notebooks] which can help you get started.</div>Blowekamphttps://public.kitware.com/Wiki/index.php?title=Template:SimpleITKMigrationHeader&diff=61869Template:SimpleITKMigrationHeader2017-06-15T16:55:46Z<p>Blowekamp: </p>
<hr />
<div>This page is being migrated to Read The Docs!<br />
<br />
For the up to date version please see [https://simpleitk.readthedocs.io/en/master/Documentation/docs/source/{{{1}}}.html this page]!</div>Blowekamphttps://public.kitware.com/Wiki/index.php?title=Template:SimpleITKMigrationHeader&diff=61868Template:SimpleITKMigrationHeader2017-06-15T16:54:51Z<p>Blowekamp: </p>
<hr />
<div>This page is being migrated to Read The Docs!<br />
<br />
For the up to date version please see [ http://simpleitk.readthedocs.io/en/master/Documentation/docs/source/{{{1}}}.html this page ]!</div>Blowekamphttps://public.kitware.com/Wiki/index.php?title=Template:SimpleITKMigrationHeader&diff=61867Template:SimpleITKMigrationHeader2017-06-15T16:54:28Z<p>Blowekamp: </p>
<hr />
<div>This page is being migrated to Read The Docs!<br />
<br />
For the up to date version please see [ http://simpleitk.readthedocs.io/en/master/Documentation/docs/source/{{{1}}}.html this page]!</div>Blowekamphttps://public.kitware.com/Wiki/index.php?title=Template:SimpleITKMigrationHeader&diff=61866Template:SimpleITKMigrationHeader2017-06-15T16:53:30Z<p>Blowekamp: </p>
<hr />
<div>This page is being migrated to Read The Docs!<br />
<br />
For the up to date version please see [ http://simpleitk.readthedocs.io/en/master/Documentation/docs/source/{{{1}}}.html this page}!</div>Blowekamphttps://public.kitware.com/Wiki/index.php?title=SimpleITK/FAQ&diff=61865SimpleITK/FAQ2017-06-15T16:08:27Z<p>Blowekamp: </p>
<hr />
<div>{{SimpleITKMigrationHeader}}<br />
[[Image: Simpleitk_logo.png|center]]<br />
<br />
This page hosts frequently asked questions about SimpleITK, and their answers.<br />
<br />
= Installation =<br />
<br />
==Why do I get an error about a missing Dynamic Library when running SimpleITK with Python on windows?==<br />
<br />
This error has been resolved with SimpleITK version 0.5.1 and should no longer occur. Upgrading to the latest SimpleITK is encouraged.<br />
<br />
This error occurs after you have downloaded the Windows SimpleITK binaries when you are running python and try to import SimpleITK. There is an error about a missing DLL on Windows when you don't have Visual Studio 10 and no other application has installed certain libraries before. You will need to download the Visual Studio 10 redistribution libraries. The libraries are available for download [http://www.microsoft.com/download/en/details.aspx?id=5555 here].<br />
<br />
== I am using the binary distribution of SimpleITK for Anaconda, why do I get an error about libpng? ==<br />
<br />
ImportError: dlopen(./_SimpleITK.so, 2): Library not loaded: @rpath/libpng15.15.dylib<br />
Referenced from: .../lib/python2.7/site-packages/SimpleITK/_SimpleITK.so<br />
Reason: image not found<br />
<br />
This can be resolved by installing the version of libpng that SimpleITK 0.9 was built against:<br />
<br />
conda create -n sitkpy anaconda libpng=1.5<br />
<u>unix/mac</u>: source activate sitkpy <br> <u>win</u>: activate sitkpy <br />
conda install -c <nowiki>https://conda.binstar.org/simpleitk/channel/main</nowiki> SimpleITK<br />
conda install libpng=1.5 <br />
<br />
This set of commands:<br />
* creates the virtual environment with our choice of libpng version, all other anaconda packages will be compatible with this version.<br />
* activate the virtual environment.<br />
* installs SimpleITK into the virtual environment (unfortunately this will automatically upgrade you to libpng 1.6).<br />
* downgrades to libpng 1.5 so that library versions are compatible.<br />
<br />
We are currently investigating why the anaconda build system is not expressing version dependency for shared libraries. We how this will not be an issue with the next binary package.<br />
<br />
= How to Use =<br />
<br />
== What filters are currently available in SimpleITK? ==<br />
<br />
As of March 2014 we have approximately '''260 ITK image filters''' wrapped for SimpleITK. The [http://www.itk.org/SimpleITKDoxygen/html/Filter_Coverage.html '''filter coverage table'''] shows the current set of ITK filters in SimpleITK. Additionally the [http://www.itk.org/SimpleITKDoxygen/html/classes.html Doxygen] can be looked at to determine if a filter is available.<br />
<br />
== What image file formats can SimpleITK read? ==<br />
<br />
<br />
<br />
== How do I read a RAW image into SimpleITK? ==<br />
<br />
In general raw image files are missing information. They do not contain the nessesary header information to describe the basic size and type for the data, so this format is intrinsically deficient. The [http://www.itk.org/Doxygen/html/classitk_1_1RawImageIO.html RawImageIO] class is not available in SimpleITK so there is no direct way to programmatically hard code this header information. The suggested way is to create a Meta image header file (*.mhd) which references the raw data file and describes the size and type of the data. The documentation on how to write a Meta image header can be found [http://www.itk.org/Wiki/MetaIO/Documentation#Reading_a_Brick-of-Bytes_.28an_N-Dimensional_volume_in_a_single_file.29 here].<br />
<br />
The following is a sample Meta image header file, perhaps of name sample.mhd:<br />
<br />
ObjectType = Image<br />
NDims = 3<br />
DimSize = 256 256 64<br />
ElementType = MET_USHORT<br />
ElementDataFile = image.raw (this tag must be last in a MetaImageHeader)<br />
<br />
== Can I use another image file viewer beside ImageJ? ==<br />
<br />
By default when the [http://www.itk.org/SimpleITKDoxygen/html/namespaceitk_1_1simple.html#a7bacfc4685cff93e46d7401865f9579e Show function] is called, SimpleITK writes out a temporary image in Nifti format then launches [http://rsbweb.nih.gov/ij/index.html ImageJ]. The user can override the file format of the temporary file and/or the application used to handle that file.<br />
<br />
The temporary file format can be specified via the '''SITK_SHOW_EXTENSION''' environment variable. For example, if the user wanted to export a PNG file, on Linux it might look like this:<br />
<br />
SITK_SHOW_EXTENSION=".png"<br />
export SITK_SHOW_EXTENSION<br />
<br />
Use of an extension unsupported by ITK results in an error message. For the supported image formats, here is the [http://www.itk.org/Doxygen/html/group__IOFilters.html ITK Image IO Filters].<br />
<br />
The default display application for all image types is ImageJ. To override ImageJ with some other application, use the '''SITK_SHOW_COMMAND''' environment variable. For instance, on Unix systems, using GNOME's image viewer eog would be:<br />
<br />
SITK_SHOW_EXTENSION=".png"<br />
export SITK_SHOW_EXTENSION<br />
SITK_SHOW_COMMAND="eog"<br />
export SITK_SHOW_COMMAND<br />
<br />
To override the default display applications for only color or 3d images, there are the '''SITK_SHOW_COLOR_COMMAND''' and '''SITK_SHOW_3D_COMMAND''' environment variables.<br />
<br />
More details on the Show function, including use of the "%a" and "%f" tokens, is at the [http://www.itk.org/SimpleITKDoxygen/html/namespaceitk_1_1simple.html#a7bacfc4685cff93e46d7401865f9579e Show function Doxygen page].<br />
<br />
== How can I use 3D Slicer to view my images? ==<br />
[http://slicer.org 3D Slicer] is a very powerful and popular application for visualization and medical image computing. The SITK_SHOW_COMMAND environment variable may be used to display images in Slicer instead of SimpleITK's default viewer, ImageJ. The following are examples of what settings for SITK_SHOW_COMMAND might look like for Mac OS X, Linux and Windows to use Slicer.<br />
<br />
<br />
Mac OS X<br />
export SITK_SHOW_COMMAND=/Applications/Slicer.app/Contents/MacOS/Slicer<br />
<br />
Linux<br />
export SITK_SHOW_COMMAND=Slicer<br />
<br />
Windows<br />
set SITK_SHOW_COMMAND=:"c:\Program Files\Slicer 4.2.2-1\Slicer"<br />
<br />
The value of SITK_SHOW_COMMAND should be modified to point to wherever Slicer is installed. If you only want to use Slicer for volumetric 3D images, use the SITK_SHOW_3D_COMMAND environment variable instead of SITK_SHOW_COMMAND.<br />
<br />
== How can I use a newer Java with ImageJ on Mac OS X? ==<br />
By default on Mac OS X, the ImageJ application expects Java 6, which is old and unsupported. The latest supported version of Java (currently version 8u25) can be downloaded from [http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html Oracle's Java Development kit page]. The following bash commands will set up the SITK_SHOW_COMMAND and SITK_SHOW_COLOR_COMMAND to invoke ImageJ's jar file using the Java compiler.<br />
<br />
ij="/Applications/ImageJ/"<br />
ijcmd="java -Dplugins.dir=$ij/plugins -jar $ij/ImageJ.app/Contents/Resources/Java/ij.jar"<br />
<br />
export SITK_SHOW_COMMAND="$ijcmd -eval 'open( \"%f\" );'"<br />
export SITK_SHOW_COLOR_COMMAND="$ijcmd -eval 'open( \"%f\" ); run(\"Make Composite\", \"display=Composite\");'"<br />
<br />
The first lines set a variable pointing to the standard location for the ImageJ directory. If ImageJ is installed somewhere else, the line should be modified. The second line provides the command to launch ImageJ using the Java compiler. It includes flags that point to ImageJ's plugiin directory and ImageJ's ij.jar file.<br />
<br />
The SITK_SHOW_COMMAND tells SimpleITK.Show() to launch Java with ij.jar and then execute the open macro with an image file. The SITK_SHOW_COLOR_COMMAND does these same things and then executes the ImageJ "Make Composite" command to treat a multichannel image as a composite color image.<br />
<br />
= Wrapping =<br />
<br />
== Python ==<br />
<br />
== Tcl ==<br />
<br />
== Java ==<br />
<br />
== C# ==<br />
<br />
== R ==<br />
<br />
<br />
= Compilation =<br />
<br />
==Is my compiler supported?==<br />
SimpleITK uses advanced C++ meta-programming to instantiate ITK's Images and Filters. Addtionally, we use some headers which are included in the C99 and C++ TR1 extension. Therefore SimpleITK places additional requirements on the compiler beyond what is required for ITK. In principle we require C++x03 with C99's "stdint.h" and TR1's "functional". If your compiler has those features it is likely able to be supported.<br />
<br />
The additional requirement for a supported compiler is that it is on the nightly dashboard. With this regard, the list of supported compilers is on the SimpleITK [http://open.cdash.org/index.php?project=SimpleITK SimpleITK dashboard]. We welcome user contributions to the nightly dashboard to expand the list of supported compilers.<br />
<br />
===Committed to Support===<br />
<br />
* GCC 4.2-4.7<br />
* Visual Studio 2008 with Service Pack 1 (VS9)<br />
* Visual Studio 2012 (VS10) ( including Express )<br />
* Visual Studio 2012 (VS11)<br />
<br />
=== Noted Problems ===<br />
* Compiling on a MS Windows 32-bit OS with static libraries is not supported due to lack of memory.<br />
* With SimpleITK release 0.4.0, Visual Studio 2008 was not compiling. This problem has since been remedied in the development branch on April 18th, 2012.<br />
* With SimpleITK release 0.7.0, Visual Studio 2008 is not able to compile all wrapped languages at the same time, it's recommenced to choose one at a time.<br />
<br />
==Why am I getting a compilation error on OSX Mavericks?==<br />
<br />
With SimpleITK <=0.7 the following error occurred during compilation on Apple OSX 10.9 Mavericks with '''clang 5.0''':<br />
<br />
'''SimpleITK/Code/Common/include/sitkMemberFunctionFactoryBase.h:106:16: <span style="color:red">error</span>: no member named 'tr1' in namespace 'std''''<br />
typedef std::tr1::function< MemberFunctionResultType ( ) > FunctionObjectType;<br />
<nowiki>~~~~~^</nowiki><br />
<br />
With Xcode 5.0, Apple's distributed version of clang (5.0) changed which implementation of the C++ Standard Library it uses by default. Previous versions of clang (4.2 and earlier) used [http://gcc.gnu.org/libstdc++/ GNU's libstdc++] , while clang 5.0 now uses [http://libcxx.llvm.org LLVM's libc++]. SimpleITK 0.7 and earlier require certain features from [http://en.wikipedia.org/wiki/C%2B%2B_Technical_Report_1 C++ tr1] which are not implemented in LLVM's libc++ but are available in GNU's libstdc++.<br />
<br />
To build SimpleITK <=0.7 with clang 5.0, you can configure the compiler to use GNU's stdlibc++. This change must be done at the initial configuration:<br />
<br />
cmake "-DCMAKE_CXX_FLAGS:STRING=-stdlib=libstdc++" ../SimpleITK/SuperBuild<br />
<br />
NOTE: If you already have a build directory which has been partially configured the contents must be deleted. The above line needs to be done for an initial configuration in an empty build directory.<br />
NOTE: This work around does not work when with the CMake "Xcode" generator. It is recommended to just use the default "Unix Makefiles" generator, to build SimpleITK, and get using SimpleITK, not building it.<br />
<br />
The following is a '''compatibility table for clang 5.0'''. It shows that the default of libc++ does not work with SimpleITK, while the other options do. The choice of which standard library to use and which C++ language standard to use are independent.<br />
<br />
{| class="wikitable"<br />
|-<br />
!Clang 5.0 compatibility<br />
! -stdlib=libc++ <br />
! -stdlib=libstdc++<br />
|-<br />
! (c++03)<br />
| style="background:red" | FAIL<br />
| style="background:green" | OK<br />
|-<br />
! -std=c++11<br />
| style="background:LightGreen" | OK (>=0.8)<br />
| style="background:green" | OK<br />
|}<br />
<br />
For SimpleITK >=0.8, support for the tr1 features migrated to C++11 has been improved with better feature detection, and the necessary flags are now automatically added. LLVM's libc++ will now work if compiling with the C++11 standard by adding the flag "-std=c++11" in the initial configuration.<br />
<br />
To further complicate dependencies and interactions, some downloadable languages such as Java, or R, may be compiled against GNU's libstdc++. This may cause a conflict in the types used in the interface resulting in compilation errors while wrapping the language.<br />
<br />
==Why does the Superbuild fail compiling PCRE on Mac OS X?==<br />
If the Xcode command line tools are not properly set up on OS X, PCRE could fail to build in the Superbuild process with messages such as:<br />
<br />
checking whether we are cross compiling... configure: error: in `/your/build/path/SimpleITK/PCRE-prefix/src/PCRE-build': <br />
configure: error: cannot run C compiled programs.<br />
If you meant to cross compile, use `--host'.<br />
See `config.log' for more details<br />
[10/13] Performing build step for 'PCRE'<br />
<br />
To install the command line developer tools enter the following:<br />
'''xcode-select --install<br />
<br />
To reset the default command line tools path:<br />
'''xcode-select --reset<br />
<br />
==Do I need to download an option package for TR1 support?==<br />
Visual Studio 2008 requires an additional download for TR1 support. This support is best provided with the Service Pack 1. There is a separate TR1 feature pack which can be downloaded, but it is no longer recommended since Service Pack 1 includes TR1 and numerous bug and performance improvements.<br />
<br />
==Do I need to download an optional package for C99?==<br />
<br />
SimpleITK will proved a "stdint.h" header if missing on the system.<br />
<br />
==How do I build with Visual Studio 2008?==<br />
Visual Studio 2008 is the oldest supported Microsoft development environment that SimpleITK supports. To build SimpleITK, certain features of C++TR1 are required. These features are best provided by the [http://www.microsoft.com/download/en/details.aspx?id=23691 "Microsoft Visual Studio 2008 Service Pack 1"] (or try this link [http://www.microsoft.com/en-us/download/confirmation.aspx?id=10986]). Alternatively just the [http://www.microsoft.com/downloads/en/details.aspx?FamilyId=D466226B-8DAB-445F-A7B4-448B326C48E7&displaylang=en Visual C++ 2008 Feature Pack Release] can be installed. Please note that all our dashboard machines now use SP1.<br />
<br />
<br />
Older versions of SimpleITK (<0.7.0) requires a also required a separately downloaded stdint.h for this compiler. This is not automatically provided if needed. If it's still needed the file can be downloaded [http://msinttypes.googlecode.com/svn/trunk/stdint.h here]. For 64-bit Microsoft Windows it should be dragged with the GUI into the appropriate include path for the architecture.<br />
<br />
== What Configurations on Windows are Supported For Building? ==<br />
<br />
There are quite a large number of configuration options available for the Windows platform. The following table is a guide line of what is regularly tested and confirmed to work or fail.<br />
<br />
<br />
{| class="wikitable"<br />
|-<br />
!<br />
! Architecture<br />
! Library Type<br />
! colspan="2" |Visual Studio 2008 SP1 (VS9 )<br />
! colspan="2" | Visual Studio 2010 ( VS10 )<br />
! colspan="2" | Visual Studio 2012 ( VS11 )<br />
! colspan="2" | Visual Studio 2013 ( VS13 )<br />
|-<br />
!<br />
!<br />
!<br />
! Release<br />
! Debug<br />
! Release<br />
! Debug<br />
! Release<br />
! Debug <br />
! Release<br />
! Debug<br />
|-<br />
! rowspan="2" style="background:Orange" | 32-bit Window OS<br />
! rowspan="2" style="background:Orange" | Only Intel 32-bit<br />
! style="background:Orange" | Static<br />
| style="background:red" | FAIL<br />
| style="background:red" | FAIL<br />
| style="background:red" | FAIL<br />
| style="background:red" | FAIL<br />
| style="background:Orange" | <br />
| style="background:Orange" | <br />
| style="background:Orange" | <br />
| style="background:Orange" | <br />
|-<br />
! style="background:Orange" | Shared<br />
| style="background:red" | FAIL<br />
| style="background:red" | FAIL<br />
| style="background:green" | Nightly<br />
| style="background:green" | Nightly<br />
| style="background:Orange" | <br />
| style="background:Orange" | <br />
| style="background:Orange" | <br />
| style="background:Orange" | <br />
|-<br />
! rowspan="4" |64-bit Window OS<br />
! rowspan="2" | Intel 32-bit<br />
! Static<br />
| style="background:green" | Nightly<br />
| style="background:Orange" | <br />
| style="background:green" | Nightly<br />
| style="background:Orange" | <br />
| style="background:green" | Nightly<br />
| style="background:Orange" |<br />
| style="background:green" | Nightly<br />
| style="background:Orange" |<br />
|-<br />
! Shared<br />
| style="background:LightGreen" |<br />
| style="background:LightGreen" |<br />
| style="background:LightGreen" |<br />
| style="background:LightGreen" |<br />
| style="background:LightGreen" |<br />
| style="background:LightGreen" |<br />
| style="background:LightGreen" |<br />
| style="background:LightGreen" |<br />
|-<br />
! rowspan="2" | Intel 64-bit<br />
! Static<br />
| style="background:green" | Nightly<br />
| style="background:LightGreen" | <br />
| style="background:green" | Nightly<br />
| style="background:green" | Nightly<br />
| style="background:LightGreen" |<br />
|<br />
| style="background:LightGreen" |<br />
|<br />
|-<br />
! Shared<br />
| style="background:LightGreen" |<br />
| style="background:LightGreen" |<br />
| style="background:LightGreen" |<br />
| style="background:LightGreen" |<br />
| style="background:green" | Nightly<br />
| <br />
| style="background:green" | Nightly<br />
|<br />
|}<br />
<br />
{| class="wikitable"<br />
|<br />
! Legend<br />
|-<br />
| style="background:Green" | Nightly<br />
| This combination of options is nightly tested, and known to work.<br />
|-<br />
|style="background:LightGreen" |<br />
| This combinations has been manually tested, and is expected to work.<br />
|-<br />
| <br />
| It is not known if this combinations of options will work.<br />
|-<br />
| style="background:Orange" |<br />
| This combination likely has problems, and is not recommended.<br />
|-<br />
| style="background:Red" | FAIL<br />
| These options are known not to work.<br />
|}<br />
<br />
This table has been updated for the release branch, master, as of February 15th 2013.<br />
<br />
== Why are all of the configurations not supported on Windows? ==<br />
<br />
One of the following errors frequently occur when the set of configuration options fail:<br />
<br />
LINK : fatal error LNK1102: out of memory<br />
<br />
LINK : fatal error LNK1248: image size (80000010) exceeds maximum allowable size (80000000)<br />
<br />
<br />
These errors occur because of limitations in the compiler's linker or the operating system. For 64-bit architectures the linker is still only 32-bits on some Visual Studios. In certain configurations the linker can run out of memory. Also the Windows operating systems have a hard limit of 2GB for the size of libraries. For Debug mode configurations this limit can be encounted.<br />
<br />
In general building in Debug mode should not be necessary, unless you are trying to debug SimpleITK or ITK. This configuration produces libraries that are very large because the compiler must maintain symbols for all instantiated ITK classes and member functions for each template parameters that a class is instantiating.<br />
<br />
<br />
== Where is the Test Data? ==<br />
<br />
The testing data is not stored in the SimpleITK repository or as part of the source code. It is mirrored on several data repositories on the web.<br />
<br />
If you have obtained the source code from the git repository, it should be downloaded as part of the build process via the CMake ExternalData module.<br />
<br />
If you have downloaded a tar-ball of the source code there should be an accompanying "SimpleITKData" tar-ball available, which contains the external data. It should populate the .ExternalData subdirectory of the SimpleITK source code directory when extracted.<br />
<br />
== Why is CMake unable to download ExternalData? ==<br />
<br />
When compiling SimpleITK you may get and error like the following:<br />
<br />
Object MD5=2e115fe26e435e33b0d5c022e4490567 not found at:<br />
https://placid.nlm.nih.gov/api/rest?method=midas.bitstream.download&checksum=2e115fe26e435e33b0d5c022e4490567&algorithm=MD5 ("Unsupported protocol")<br />
https://simpleitk.github.io/SimpleITKExternalData/MD5/2e115fe26e435e33b0d5c022e4490567 ("Unsupported protocol") <br />
https://midas3.kitware.com/midas/api/rest?method=midas.bitstream.download&checksum=2e115fe26e435e33b0d5c022e4490567&algorithm=MD5 ("Unsupported protocol")<br />
https://insightsoftwareconsortium.github.io/ITKTestingData/MD5/2e115fe26e435e33b0d5c022e4490567 ("Unsupported protocol")<br />
https://itk.org/files/ExternalData/MD5/2e115fe26e435e33b0d5c022e4490567 ("Unsupported protocol")<br />
<br />
This indicates that CMake was not compiles with SSL support. The "Unsupported protocol" message indicate that CMake can not communicate via "https".<br />
<br />
The solution is to use a compiled version of CMake which supports SSL. If you compile CMake yourself, simply reconfigure CMake with the "CMAKE_USE_OPENSSL option enabled.</div>Blowekamphttps://public.kitware.com/Wiki/index.php?title=SimpleITK/GettingStarted&diff=61864SimpleITK/GettingStarted2017-06-15T16:07:42Z<p>Blowekamp: </p>
<hr />
<div>{{SimpleITKMigrationHeader}}<br />
<br />
[[Image: SimpleITK-SquareTransparentLogo.png|center]]<br />
<br />
SimpleITK provides a simplified interface to ITK in a variety of languages. You can either download binaries, if they are available for your platform and prefered language, or you can build SimpleITK yourself.<br />
<br />
Additionally, there are several recommended third-party software packages.<br />
<br />
After you have installed SimpleITK, please look to the [[ITK_Release_4/Outreach/Conferences/MICCAI 2011/SimpleITK|Tutorial]] or the [http://www.itk.org/SimpleITKDoxygen/html/ Doxygen] pages for more information.<br />
<br />
=Downloading the binaries=<br />
<br />
One of the great advantages of SimpleITK is that (typically) you do not have to build it — you can simply download the binaries and get started right away!<br />
<br />
Currently, '''Python''' binaries are available on Microsoft Windows, GNU Linux and Apple OS X. '''C# and Java''' binaries are available for Windows. We are also working towards supporting '''R''' packaging.<br />
<br />
==Python binary files==<br />
<br />
There are currently two Python binary package choices: Python Wheels, and Anaconda packages for the Anaconda Python distribution.<br />
<br />
==== Use a Virtual Environment ====<br />
<br />
Before you install SimpleITK we <b>highly recommend</b> that you create a virtual environment into which you install the package. Note that different Python versions and distributions have different programs for creating and managing virtual environments. <br />
<br />
The use of a virtual environment allows you to elegantly deal with package compatability issues, to quote [http://docs.python-guide.org/en/latest/ The Hitchhiker’s Guide to Python!]:<br />
<blockquote>A Virtual Environment is a tool to keep the dependencies required by different projects in separate places, by creating virtual Python environments for them. It solves the “Project X depends on version 1.x but, Project Y needs 4.x” dilemma, and keeps your global site-packages directory clean and manageable.</blockquote><br />
<br />
Programs for creating virtual environments include [https://packaging.python.org/en/latest/installing/#creating-virtual-environments virtualenv and pyvenv] for generic Python distributions, [http://conda.pydata.org/docs/using/envs.html conda] for the anaconda distribution, and [http://docs.enthought.com/canopy/configure/canopy-cli.html canopy_cli] for the canopy distribution.<br />
<br />
=== Wheels for Generic Python Distribution ===<br />
<br />
If you are working with the [https://www.python.org/ generic Python distribution] you can install a Wheel with the lasted version of pip (>=9.0).<br />
<br />
First thing you should do is create a virtual environment (virtualenv or pyvenv tools) and activate it.<br />
<br />
<u>Note</u>: you can always manually download the wheels for your operating system and Python version directly from [http://sourceforge.net/projects/simpleitk/files/SimpleITK/ sourceforge].<br />
<br />
<br />
From the command line use the [https://pip.pypa.io/en/latest/index.html pip program] to install:<br />
<br />
$ pip install SimpleITK<br />
<br />
The pip package manager should automatically find the correct package for Microsoft Windows, Apple OS X and GNU Linux if your version and architecture are supported. If no binary package is found, then a source distribution will be downloaded and attempted to be compiled and you should look into [[#Build_It_Yourself]].<br />
<br />
:: If your pip version in the virtual environment is stale (<9.0) you need to update it (pip install -U pip).<br />
<br />
=== Anaconda Distribution ===<br />
<br />
First thing you should do is create a virtual environment ([https://conda.pydata.org/docs/using/envs.html conda] tool) and activate it.<br />
<br />
Currently there are compiled binaries on [https://conda.anaconda.org/simpleitk Anaconda Cloud], easily installed with:<br />
<br />
$ conda install -c <nowiki>https://conda.anaconda.org/simpleitk</nowiki> SimpleITK<br />
<br />
Beta and release candidate packages are also available on Anaconda cloud under the dev label:<br />
<br />
$conda install -c <nowiki>https://conda.anaconda.org/simpleitk/label/dev</nowiki> SimpleITK<br />
<br />
=== Enthought Canopy Distribution ===<br />
<br />
First thing you should do is create a virtual environment (canopy_cli tool) and activate it.<br />
<br />
Currently there are no binaries supported with this distribution. You will need to compile SimpleITK yourself. (Using pip installation may work.)<br />
<br />
==C# binary files==<br />
<br />
'''Binaries for select C# platform''' can be found on [https://sourceforge.net/projects/simpleitk/files/SimpleITK/1.0.0/CSharp/ SimpleITK's SourceForge page]. Installing the library should only involve importing the unzipped files into you C# environment. The files have the following naming convention:<br />
SimpleITK-version-CSharp-buildplatform-targetplatform.zip<br />
eg.<br />
SimpleITK-1.0.0-CSharp-win32-x86.zip<br />
SimpleITK-1.0.0-CSharp-win64-x64.zip<br />
<br />
Details about how to set up a C# Visual Studio project with SimpleITK can be found in the [[SimpleITK/GettingStarted/A_visual_guide_to_SimpleITK_with_CSharp|Visual Guide to SimpleITK with CSharp]].<br />
<br />
More information about getting started with a sample C# program can be found in [[SimpleITK/GettingStarted/Visual_guide_to_building_on_Linux#A_simple_C.23_program| A visual guide to building SimpleITK on Linux]]<br />
<br />
==Java binary files==<br />
<br />
'''Binaries for select Java platforms''' can be found on [https://sourceforge.net/projects/simpleitk/files/SimpleITK/1.0.0/Java/ SimpleITK's SourceForge page]. Installation instructions are available at [[SimpleITK/GettingStarted/A visual guide to SimpleITK in Java|a visual guide to SimpleITK in Java]].<br />
<br />
==Nightly binaries==<br />
<br />
The '''latest binaries''' for the current development version of SimpleITK are also generally available. Binary packages are built as part of the nightly regression testing system. The download links are available from the [https://open.cdash.org/index.php?project=SimpleITK '''CDash'''] '''dashboard''' in the "Nightly Packages" section. <br />
<br />
Each row on the dashboard is a SimpleITK build on a particular system, and if the build was successful there will be a '''package icon''': https://open.cdash.org/img/package.png which links to the packages build by the system. A user may directly download the built package from such a link.<br />
<br />
=Build It Yourself=<br />
<br />
In many cases a user does not need to build SimpleITK because of the pre-built binaries available (see [[SimpleITK/GettingStarted#Binaries|above]]). However there are several reasons a user might prefer to '''build SimpleITK from source''':<br />
* The binary files for your programming language of choice are not (yet) distributed<br />
* You want the live on the bleeding edge by using the latest-and-greatest version of SimpleITK<br />
* You want to wrap your own filters using the SimpleITK infrastructure<br />
* You want to contribute to the development of SimpleITK<br />
* To use the SimpleITK's C++ interface and/or use ITK directly<br />
<br />
=== Prerequisites ===<br />
To build SimpleITK you need:<br />
* A recent version of [http://www.cmake.org/ CMake] >= 3.3 with SSL support for https.<br />
* A supported [[SimpleITK/FAQ#Is_my_compiler_supported.3F|compiler]]<br />
* To use the latest developmental version, source code can be downloaded with [http://git-scm.com/ git] >= 1.65<br />
** Git is required if building SimpleITK using "SuperBuild" (see below) to automatically download the matching version of ITK, SWIG, etc...<br />
** Windows users may prefer [http://msysgit.github.com/ msysGit]<br />
* It is recommended to have numpy installed when testing Python bindings<br />
<br />
=== Recipes / Formulas / Short Cuts ===<br />
<br />
For some environments we have short cuts, scripts, for automated building of SimpleITK (see their repository for more details):<br />
<br />
* For '''Python''': The [https://github.com/scikit-build/scikit-build scikit-build] based distutils based [https://github.com/scikit-build/scikit-build setup.py frontend] can be used to build, install, and package SimpleITK for Python.<br />
<br />
* For the '''Anaconda Python''' distribution: The recipe and instructions for the SimpleITK build are in [https://github.com/SimpleITK/SimpleITKCondaRecipe this GitHub repository]. <br />
<br />
* For the '''R language''': A devtools installer and instructions are available from [https://github.com/SimpleITK/SimpleITKRInstaller this GitHub repository]. <br />
<br />
* '''On the Mac''', with the [http://brew.sh/ Homebrew package manager], a SimpleITK formula is available: https://github.com/Homebrew/homebrew-science/blob/master/simpleitk.rb for multiple language wrappings.<br />
<br />
* For the '''Lua language''' with the Luarocks module deployment system, a SimpleITK rockspec is available form [https://github.com/SimpleITK/SimpleITKLuaRock this GitHub repository].<br />
<br />
=== Source code ===<br />
<br />
If one of the above language specific front-ends are not used then SimpleITK must be build directly.<br />
<br />
There are two options to obtain the SimpleITK source code:<br />
# Download a released version from the SimpleITK [https://sourceforge.net/projects/simpleitk/ SourceForge] page<br />
# Download the latest development version using git<br />
git clone http://itk.org/SimpleITK.git<br />
<br />
=== Building using SuperBuild ===<br />
After downloading SimpleITK's source code we '''STRONGLY''' recommend to run cmake on the SuperBuild subdirectory of SimpleITK. Execute the following commands in the parent of the SimpleITK source directory to configure the SuperBuild:<br />
mkdir SimpleITK-build<br />
cd SimpleITK-build<br />
cmake ../SimpleITK/SuperBuild<br />
<br />
The SuperBuild will automatically download and build the matching version of ITK and SWIG needed to compile SimpleITK. Additionally, it will set recommended compilation flags to minimize the size of the library and enable support for large libraries. This is the recommended way to build SimpleITK and is easiest.<br />
<br />
If you get an error message saying that ITK_DIR is not set then, you did not correctly point cmake to the SuperBuild sub-directory. Please erase your binary directory, and point cmake to the SimpleITK/SuperBuild sub-directory.<br />
<br />
The cmake configuration process should automatically find supported languages and enable SimpleITK wrapping for them. To manually enable a language toggle the appropriate WRAP_LANGUAGE cmake variable to ON. Verify and/or correct the advanced cmake variables to the language specific executable, libraries and include directories. For example if you have multiple Python installations ensure that all related Python variable refer to the same versions.<br />
<br />
Then use your make utility or your cmake chosen build utility to build SimpleITK.<br />
<br />
SimpleITK takes a while to build. Some tips and tricks to speed up development time are listed [http://www.itk.org/SimpleITKDoxygen/html/Developer.html#TandT here].<br />
<br />
=== Building Manually ===<br />
This is '''not''' the recommended way of building SimpleITK, but it can be useful if you want to use a system version of ITK, etc. , or if you do not want to (or can not) use git.<br />
<br />
# Setup the prerequisites as described above (i.e. CMake and supported compiler)<br />
# Install the matching version of [http://www.swig.org/ SWIG] >= 3.0.11<br />
#* e.g. Windows users may install [http://prdownloads.sourceforge.net/swig/swigwin-3.0.11.zip swigwin-3.0.11]<br />
# Download the SimpleITK source code from the [https://sourceforge.net/projects/simpleitk/files/SimpleITK/ SourceForge] page<br />
# Download the matching version of ITK, found by examining the `SuperBuild/External_ITK.cmake` file.<br />
# Configure ITK using CMake<br />
#* e.g. BUILD_EXAMPLES=OFF, BUILD_TESTING=OFF, BUILD_SHARED_LIBS=OFF, '''ITK_USE_REVIEW=ON'''<br />
# Build ITK<br />
#* Be sure to note the build settings e.g. Release x64<br />
# Configure SimpleITK using CMake<br />
#* Set ITK_DIR to the location of the ITK build location from the previous steps<br />
# Build SimpleITK<br />
#* Be sure to configure the build settings exactly the same as ITK e.g. Release x64 and CXX_FLAGS<br />
<br />
=== Advanced Build Options ===<br />
<br />
SimpleITK is aware of the enabled and disabled ITK Modules. It is possible to customize SimpleITK by disabling unneeded ITK modules or to extend SimpleITK by writing custom json file dependent an ITK Remote Modules being enabled.<br />
<br />
Additionally, each of the Examples directory, and each of the Wrapping subdirectories can be configured as independent CMake project dependent on an installed SimpleITK.<br />
<br />
===[[SimpleITK/GettingStarted/Visual_guide_to_building_on_Linux|A visual guide to building SimpleITK on Linux]]===<br />
<br />
==Testing==<br />
<br />
After compilation the prudent thing to due is to test SimpleITK to ensure your build is stable and suitable for installation and use. The following commands execute the SimpleITK tests.<br />
<br />
cd SimpleITK-build/SimpleITK-build<br />
ctest<br />
<br />
On Windows you will need to specify configuration. Typically that would be the Release configuration, as such:<br />
cd SimpleITK-build/SimpleITK-build<br />
ctest -C Release<br />
<br />
==Python installation==<br />
<br />
To install a built python package into the system Python, as root run:<br />
cd SimpleITK-build/Wrapping/Python<br />
python Packaging/setup.py install<br />
<br />
Alternatively, a Python virtual environment can be created and the distribution installed there.<br />
<br />
A Python Wheel file (.whl) can be created in the "Wrapping/Python/dist" directory, by building the "dist" target. If you have used the Superbuild with the "make" generator then issue the following command:<br />
make -C SimpleITK-build dist<br />
<br />
==R installation==<br />
<br />
To install a built R package:<br />
<br />
cd SimpleITK-build/Wrapping/R/Packaging<br />
R CMD INSTALL SimpleITK<br />
<br />
This will install the R package "SimpleITK" in /usr/local as root or your local R installation directory.<br />
<br />
<br />
If you are working in a multi-user environment, and are considerate of your fellow users you can install the package in a local directory:<br />
<br />
<ol> <li> Create a local directory where you will install your R packages</li></ol><br />
mkdir my_R_libs<br />
<ol start="2"> <li> Add an environment variable to your .bashrc</li></ol> <br />
export R_LIBS="/path_to/my_R_libs"<br />
<ol start="3"> <li> source your .bashrc and check the R library path, in an R shell >.libPaths()</li></ol><br />
<ol start="4"> <li>install </li></ol><br />
<br />
cd SimpleITK-build/Wrapping/R/Packaging<br />
R CMD INSTALL -l /path_to/my_R_libs SimpleITK<br />
<br />
=Recommended Software=<br />
<br />
== Fiji (Fiji is Just ImageJ) ==<br />
<br />
SimpleITK has a built in function, [https://itk.org/SimpleITKDoxygen/html/namespaceitk_1_1simple.html#ac8416e6e7f02dedfe8373b83dbea411d '''"itk::simple::Show()"'''], which can be used for viewing images in an interactive session. Currently, this function by default Show invokes [https://fiji.sc '''Fiji'''] then [http://rsbweb.nih.gov/ij/ '''ImageJ'''] to display images. ImageJ was chosen because it can handle all the image types that SimpleITK supports, even 3D vector images with n components. <br />
<br />
The Show function first searches the "PATH" environment variable, then additional standard locations are examined, if problems are encountered the correct path can be added to this environment variable and the '''"debugOn'''" option to '''"Show'''" flag set.<br />
<br />
====ImageJ====<br />
<br />
If ImageJ is used then we recommend downloading a recent version of [http://rsbweb.nih.gov/ij/download.html ImageJ] from the official home page. Recent versions come with support for the [http://nifti.nimh.nih.gov/nifti-1/ Nifti] ( *.nii ) file format, which SimpleITK uses to export to ImageJ. <br />
<br />
'''Note:''' '''Linux installation''' requires an additional step. The '''"Show'''" function searches for an executable named ImageJ or imagej, however the default tarball does not come with this file. Instead it comes with a file names [http://imagej.nih.gov/ij/download/linux/unix-script.txt script]. This file contains the installation instructions. In short the file should be renamed to "imagej" and the site specific variables for the installation location, and java must be set. Also consider the "newwindow" variable... Do you really want a new instance of ImageJ launched each time you use Show? Lastly, as the installation instructions indicate, the imagej wrapper should be in your path.<br />
<br />
==iPython and Jupyter==<br />
<br />
If you are using python, [http://ipython.org/ '''ipython'''] with [http://jupyter.org Jupyter] is terrific environment to perform interactive computing for image processing. With the addition of numpy and scipy, you'll have a powerful interactive environment.<br />
<br />
We have instructional [http://insightsoftwareconsortium.github.io/SimpleITK-Notebooks/ SimpleITK Jupyter Notebooks] which can help you get started.</div>Blowekamphttps://public.kitware.com/Wiki/index.php?title=SimpleITK&diff=61863SimpleITK2017-06-15T16:07:03Z<p>Blowekamp: </p>
<hr />
<div>[[Image: SimpleITK-SquareTransparentLogo.png|center]]<br />
<br />
=Overview=<br />
<br />
Welcome to the National Library of Medicine Insight Segmentation and Registration Toolkit (ITK). [http://www.itk.org/ ITK] is an open-source, cross-platform system that provides developers with an extensive suite of software tools for image analysis. Among them, SimpleITK is a simplified layer built on top of ITK, intended to facilitate its use in rapid prototyping, education, interpreted languages. SimpleITK has the following main characteristics:<br />
<br />
* C++ library with wrappers for Python, Java, CSharp, R, Tcl and Ruby<br />
* Object-oriented<br />
* Provides a simplified, easy-to-use, procedural interface without templates<br />
* Is distributed under an open source Apache 2.0 License<br />
* Binary distributions for Python, Java and CSharp<br />
<br />
SimpleITK captures many of features available in ITK, and is under ongoing development. Earlier in the development process a set of [[SimpleITK/Goals|Specific Goals]] were outlined.<br />
<br />
= Getting Started =<br />
<br />
* [[SimpleITK/GettingStarted|Getting Started For Users]]<br />
** [[SimpleITK/GettingStarted#Binaries|downloading the binaries]]<br />
** [[SimpleITK/GettingStarted#Build_It_Yourself|build the code yourself]]<br />
** [[SimpleITK/GettingStarted#Recommended_Software|additional software]] which is useful with SimpleITK<br />
* [[SimpleITK/GettingStarted/Visual_guide_to_building_on_Linux|A Visual Guide to Building SimpleITK on Linux]]<br />
* [[SimpleITK/GettingStarted/A_visual_guide_to_SimpleITK_in_Java|A Visual Guide to SimpleITK with Java and Eclipse]]<br />
* [[SimpleITK/GettingStarted/A_visual_guide_to_SimpleITK_with_CSharp|A Visual Guide to SimpleITK with CSharp on Microsoft Visual Studio]]<br />
<br />
== Download ==<br />
<br />
SimpleITK currently provides binary distribution for Python, CSharp and Java language bindings. <br />
You can download the [https://sourceforge.net/projects/simpleitk/files/SimpleITK/1.0.0/ 1.0.0 release from SourceForge].<br />
<br />
= Documentation =<br />
<br />
* [[SimpleITK/FAQ|Frequently Asked Questions (FAQ)]]<br />
<br />
== API ==<br />
<br />
* Nightly generated [https://www.itk.org/SimpleITKDoxygen/html/ Doxygen].<br />
* Release 1.0 [https://www.itk.org/SimpleITKDoxygen100/html/index.html Doxygen].<br />
* Release 0.10 [https://www.itk.org/SimpleITKDoxygen010/html/index.html Doxygen].<br />
* Release 0.9 [https://www.itk.org/SimpleITKDoxygen09/html/index.html Doxygen].<br />
* Release 0.8 [https://www.itk.org/SimpleITKDoxygen08/html/index.html Doxygen].<br />
* Release 0.7 [https://www.itk.org/SimpleITKDoxygen07/html/index.html Doxygen].<br />
* Release 0.6.1 [https://www.itk.org/SimpleITKDoxygen06/html/ Doxygen].<br />
<br />
== Short Examples ==<br />
<br />
Concise [https://itk.org/SimpleITKDoxygen/html/examples.html examples] illustrating the usage of various SimpleITK features. Examples are written in a variety of languages including Python, R, C++, Java...<br />
<br />
== SimpleITK Notebooks ==<br />
<br />
The SimpleITK Notebooks are examples and tutorials on how to use SimpleITK utilizing Jupyter Notebooks. This approach allows the user to create, edit and re-run scripts and view the results all within a web interface. The authoritative description of what Jupyter Notebooks are can be found on the [http://jupyter.org/ Jupyter website]. While SimpleITK supports a number of programming languages, the majority of notebooks are written in Python and some in R.<br />
<br />
The main notebook repository is available on [https://github.com/InsightSoftwareConsortium/SimpleITK-Notebooks github].<br />
<br />
Additional repositories containing tutorial specific notebooks are listed in the [http://www.itk.org/Wiki/SimpleITK#SimpleITK_Tutorials Tutorials section] below.<br />
<br />
== Publications ==<br />
<br />
More information about SimpleITK can be found in the following publication:<br />
<br />
* Lowekamp BC, Chen DT, Ibáñez L and Blezek D (2013) [http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3874546/pdf/fninf-07-00045.pdf The Design of SimpleITK]. Front. Neuroinform. 7:45. doi: 10.3389/fninf.2013.00045<br />
<br />
Please cite SimpleITK and ITK when publishing work where it made a significant contribution.<br />
<br />
== SimpleITK Tutorials ==<br />
<br />
=== Upcoming ===<br />
<br />
* none<br />
<br />
=== Past ===<br />
* The International Symposium on Biomedical Imaging (ISBI) 2016, Prague, Czech republic: [http://biomedicalimaging.org/2016/?page_id=572 SimpleITK: An Interactive, Python-Based Introduction to SimpleITK with the Insight Segmentation and Registration Toolkit (ITK)]<br />
* SPIE Medical Imaging 2016, San Diego, USA: ITK in Biomedical Research and Commercial Applications<br />
: Tutorial material: [https://github.com/InsightSoftwareConsortium/SimpleITKTutorialSPIE2016 git repository] [https://hdl.handle.net/10380/3542 additional presentations] .<br />
* Medical Image Computing and Computer Assisted Intervention (MICCAI) 2015, Munich, Germany: a Python based tutorial on the use of the [[SimpleITK/Tutorials/MICCAI2015 | ITKv4 registration framework via SimpleITK]].<br />
: Tutorial material: [https://github.com/InsightSoftwareConsortium/SimpleITKTutorialMICCAI2015.git git repository].<br />
* ImageJ User & Developer Conference 2015, Madison, WI, USA: [http://imagej.net/Conference_2015_Program#Matt_McCormick_-_SimpleITK an introductory tutorial] in Python. <br />
: Tutorial material: [https://github.com/InsightSoftwareConsortium/SimpleITKWorkshopImageJ2015 git repository]. <br />
* Medical Image Computing and Computer Assisted Intervention (MICCAI) 2011, Toronto, Canada: a general [[ITK_Release_4/Outreach/Conferences/MICCAI 2011/SimpleITK|tutorial on SimpleITK]]. <br />
: Tutorial material: [https://github.com/SimpleITK/SimpleITK-MICCAI-2011-Tutorial/blob/master/Presentation/SimpleITK-MICCAI-2011.pdf?raw=true PDF of presentation], [http://midas.kitware.com/collection/view/175 virtual machine], and [https://github.com/SimpleITK/SimpleITK-MICCAI-2011-Tutorial git repository].<br />
<br />
== Community Blogs ==<br />
<br />
These are blog entries written by people who are not necessarily directly involved with SimpleITK. If you want us to link to your SimpleITK blog entry just let us know on the mailing list (community@itk.org). <br />
<br />
* General introduction of SimpleITK on the [http://news.iscas.co/simpleitk-a-simplified-multi-language-interface-to-the-insight-segmentation-and-registration-toolkit/ International Society for Computer Aided Surgery blog], 1 March 2017.<br />
* [http://zarquon42b.github.io/2015/05/22/SimpleITKandR/ SimpleITK and R], 22 May 2015.<br />
* [http://kevin-keraudren.blogspot.com/2014/12/medical-image-analysis-ipython-tutorials.html Medical Image Analysis Course], 20 December 2014.<br />
* [https://pyscience.wordpress.com/tag/simpleitk Image Segmentation with Python and SimpleITK], October/November 2014.<br />
<br />
=Support=<br />
<br />
SimpleITK is supported through the ITK community and the active developers. In addition to the resources listed above in the documentation section, the [http://www.itk.org/ITK/help/mailing.html ITK mailing lists] can be used to asked questions and obtain additional help.<br />
<br />
== Issue Tracking And Feature Requests ==<br />
<br />
We are currently using the [https://github.com/SimpleITK/SimpleITK/issues github issue tracker]. Before switching to github issue tracking we used an instance of the<br />
[https://itk.icts.uiowa.edu/jira/browse/SIMPLEITK Legacy Jira Issue Tracker ] hosted by the University of Iowa.<br />
<br />
== Releases ==<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=refs/tags/v1.0.0 v1.0.0] [https://github.com/SimpleITK/SimpleITK/releases/tag/v1.0.0 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/1.0.0 Downloads] [https://www.itk.org/SimpleITKDoxygen100/html/index.html Doxygen]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=4a3376df08f27162b4d2a90e4a0452a839ab3124 v0.10.0] [https://github.com/SimpleITK/SimpleITK/releases/tag/v0.10.0 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.10.0 Downloads] [https://www.itk.org/SimpleITKDoxygen010/html/index.html Doxygen]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=ec033f0be4f67b2e21483ed9bc3698f07dba9d06 v0.9.1] [https://github.com/SimpleITK/SimpleITK/releases/tag/v0.9.1 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.9.1 Downloads] <br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=7f06e9fc7f3cda9c47e8b7d6d37885b1f425ea3b v0.9.0] [https://github.com/SimpleITK/SimpleITK/releases/tag/v0.9.0 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.9.0 Downloads] [https://www.itk.org/SimpleITKDoxygen09/html/index.html Doxygen]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=d0a90983877b46631e69a398bd8341889912c8c2 v0.8.1] [https://github.com/SimpleITK/SimpleITK/releases/tag/v0.8.1 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.8.1/ Downloads] [https://www.itk.org/SimpleITKDoxygen08/html/index.html Doxygen]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=11bff587f8a930bbca02813595aa3d08388af979 v0.8.0] [https://github.com/SimpleITK/SimpleITK/releases/tag/v0.8.0 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.8.0/ Downloads] <br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=commit;h=a2b29110771a1eb0b09d18ff8e98a784dc6e6451 v0.7.1] [https://github.com/SimpleITK/SimpleITK/releases/tag/v0.7.1 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.7.1/ Downloads]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=6fecf5ae5859295082b9016c97bf4bd68a961a62 v0.7.0] [https://github.com/SimpleITK/SimpleITK/releases/tag/v0.7.0 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.7.0/ Downloads] [https://www.itk.org/SimpleITKDoxygen07/html/index.html Doxygen]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=fc17df598cac97d344c875fed117f03ae7d1aacd v0.6.1] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.6.1/ Downloads] [http://www.itk.org/SimpleITKDoxygen06/html/index.html Doxygen]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=c055ef4e4cd2802c56e169084d9dd1bc655b4e93 v0.6.0] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.6.0/ Downloads] <br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=41fbb6d69f88fa1c8ab3b9d710b7ae57bb975721 v0.5.1] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.5.1/ Downloads]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=35ccfd2b99b4b5675d4d0894bb870574396408b6 v0.5.0] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.5.0/ Downloads]<br />
<br />
= Development =<br />
<br />
SimpleITK has moved to a [https://github.com/SimpleITK/SimpleITK Github] based work flow for issues tracking and contribution.<br />
<br />
<br />
SimpleITK utilizes an additional "next" branch to merge and test changes before merging into the master branch. This makes our "master" branch more stable and reliable. This follows the CMake development process:<br />
<br />
* [http://www.cmake.org/Wiki/CMake/Git/Develop CMake Development Process ]<br />
<br />
<br />
== Source Code Repository ==<br />
<br />
SimpleITK uses git as the revision control system. The official repository is hosted along side ITK as http://itk.org/SimpleITK.git [http://public.kitware.com/gitweb?p=SimpleITK.git]. It is also mirrored on [https://github.com/SimpleITK/SimpleITK Github ].<br />
<br />
Development is currently following the branchy workflow with the Kitware stage repository. This workflow is described here:<br />
*http://public.kitware.com/Wiki/Git/Workflow/Stage<br />
*http://public.kitware.com/Wiki/Git/Workflow/Topic<br />
<br />
Contributions from github will be pushed to the stage repo and merged into the next branch by a SimpleITK developer.<br />
<br />
== [[SimpleITK/Design_And_Proposals | Design And Proposals]] ==</div>Blowekamphttps://public.kitware.com/Wiki/index.php?title=Template:SimpleITKMigrationHeader&diff=61862Template:SimpleITKMigrationHeader2017-06-15T16:04:09Z<p>Blowekamp: Created page with "This page is being migrated to Read The Docs!"</p>
<hr />
<div>This page is being migrated to Read The Docs!</div>Blowekamphttps://public.kitware.com/Wiki/index.php?title=SimpleITK&diff=61861SimpleITK2017-06-15T16:01:58Z<p>Blowekamp: </p>
<hr />
<div>{{MigrationHeader}}<br />
<br />
[[Image: SimpleITK-SquareTransparentLogo.png|center]]<br />
<br />
=Overview=<br />
<br />
Welcome to the National Library of Medicine Insight Segmentation and Registration Toolkit (ITK). [http://www.itk.org/ ITK] is an open-source, cross-platform system that provides developers with an extensive suite of software tools for image analysis. Among them, SimpleITK is a simplified layer built on top of ITK, intended to facilitate its use in rapid prototyping, education, interpreted languages. SimpleITK has the following main characteristics:<br />
<br />
* C++ library with wrappers for Python, Java, CSharp, R, Tcl and Ruby<br />
* Object-oriented<br />
* Provides a simplified, easy-to-use, procedural interface without templates<br />
* Is distributed under an open source Apache 2.0 License<br />
* Binary distributions for Python, Java and CSharp<br />
<br />
SimpleITK captures many of features available in ITK, and is under ongoing development. Earlier in the development process a set of [[SimpleITK/Goals|Specific Goals]] were outlined.<br />
<br />
= Getting Started =<br />
<br />
* [[SimpleITK/GettingStarted|Getting Started For Users]]<br />
** [[SimpleITK/GettingStarted#Binaries|downloading the binaries]]<br />
** [[SimpleITK/GettingStarted#Build_It_Yourself|build the code yourself]]<br />
** [[SimpleITK/GettingStarted#Recommended_Software|additional software]] which is useful with SimpleITK<br />
* [[SimpleITK/GettingStarted/Visual_guide_to_building_on_Linux|A Visual Guide to Building SimpleITK on Linux]]<br />
* [[SimpleITK/GettingStarted/A_visual_guide_to_SimpleITK_in_Java|A Visual Guide to SimpleITK with Java and Eclipse]]<br />
* [[SimpleITK/GettingStarted/A_visual_guide_to_SimpleITK_with_CSharp|A Visual Guide to SimpleITK with CSharp on Microsoft Visual Studio]]<br />
<br />
== Download ==<br />
<br />
SimpleITK currently provides binary distribution for Python, CSharp and Java language bindings. <br />
You can download the [https://sourceforge.net/projects/simpleitk/files/SimpleITK/1.0.0/ 1.0.0 release from SourceForge].<br />
<br />
= Documentation =<br />
<br />
* [[SimpleITK/FAQ|Frequently Asked Questions (FAQ)]]<br />
<br />
== API ==<br />
<br />
* Nightly generated [https://www.itk.org/SimpleITKDoxygen/html/ Doxygen].<br />
* Release 1.0 [https://www.itk.org/SimpleITKDoxygen100/html/index.html Doxygen].<br />
* Release 0.10 [https://www.itk.org/SimpleITKDoxygen010/html/index.html Doxygen].<br />
* Release 0.9 [https://www.itk.org/SimpleITKDoxygen09/html/index.html Doxygen].<br />
* Release 0.8 [https://www.itk.org/SimpleITKDoxygen08/html/index.html Doxygen].<br />
* Release 0.7 [https://www.itk.org/SimpleITKDoxygen07/html/index.html Doxygen].<br />
* Release 0.6.1 [https://www.itk.org/SimpleITKDoxygen06/html/ Doxygen].<br />
<br />
== Short Examples ==<br />
<br />
Concise [https://itk.org/SimpleITKDoxygen/html/examples.html examples] illustrating the usage of various SimpleITK features. Examples are written in a variety of languages including Python, R, C++, Java...<br />
<br />
== SimpleITK Notebooks ==<br />
<br />
The SimpleITK Notebooks are examples and tutorials on how to use SimpleITK utilizing Jupyter Notebooks. This approach allows the user to create, edit and re-run scripts and view the results all within a web interface. The authoritative description of what Jupyter Notebooks are can be found on the [http://jupyter.org/ Jupyter website]. While SimpleITK supports a number of programming languages, the majority of notebooks are written in Python and some in R.<br />
<br />
The main notebook repository is available on [https://github.com/InsightSoftwareConsortium/SimpleITK-Notebooks github].<br />
<br />
Additional repositories containing tutorial specific notebooks are listed in the [http://www.itk.org/Wiki/SimpleITK#SimpleITK_Tutorials Tutorials section] below.<br />
<br />
== Publications ==<br />
<br />
More information about SimpleITK can be found in the following publication:<br />
<br />
* Lowekamp BC, Chen DT, Ibáñez L and Blezek D (2013) [http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3874546/pdf/fninf-07-00045.pdf The Design of SimpleITK]. Front. Neuroinform. 7:45. doi: 10.3389/fninf.2013.00045<br />
<br />
Please cite SimpleITK and ITK when publishing work where it made a significant contribution.<br />
<br />
== SimpleITK Tutorials ==<br />
<br />
=== Upcoming ===<br />
<br />
* none<br />
<br />
=== Past ===<br />
* The International Symposium on Biomedical Imaging (ISBI) 2016, Prague, Czech republic: [http://biomedicalimaging.org/2016/?page_id=572 SimpleITK: An Interactive, Python-Based Introduction to SimpleITK with the Insight Segmentation and Registration Toolkit (ITK)]<br />
* SPIE Medical Imaging 2016, San Diego, USA: ITK in Biomedical Research and Commercial Applications<br />
: Tutorial material: [https://github.com/InsightSoftwareConsortium/SimpleITKTutorialSPIE2016 git repository] [https://hdl.handle.net/10380/3542 additional presentations] .<br />
* Medical Image Computing and Computer Assisted Intervention (MICCAI) 2015, Munich, Germany: a Python based tutorial on the use of the [[SimpleITK/Tutorials/MICCAI2015 | ITKv4 registration framework via SimpleITK]].<br />
: Tutorial material: [https://github.com/InsightSoftwareConsortium/SimpleITKTutorialMICCAI2015.git git repository].<br />
* ImageJ User & Developer Conference 2015, Madison, WI, USA: [http://imagej.net/Conference_2015_Program#Matt_McCormick_-_SimpleITK an introductory tutorial] in Python. <br />
: Tutorial material: [https://github.com/InsightSoftwareConsortium/SimpleITKWorkshopImageJ2015 git repository]. <br />
* Medical Image Computing and Computer Assisted Intervention (MICCAI) 2011, Toronto, Canada: a general [[ITK_Release_4/Outreach/Conferences/MICCAI 2011/SimpleITK|tutorial on SimpleITK]]. <br />
: Tutorial material: [https://github.com/SimpleITK/SimpleITK-MICCAI-2011-Tutorial/blob/master/Presentation/SimpleITK-MICCAI-2011.pdf?raw=true PDF of presentation], [http://midas.kitware.com/collection/view/175 virtual machine], and [https://github.com/SimpleITK/SimpleITK-MICCAI-2011-Tutorial git repository].<br />
<br />
== Community Blogs ==<br />
<br />
These are blog entries written by people who are not necessarily directly involved with SimpleITK. If you want us to link to your SimpleITK blog entry just let us know on the mailing list (community@itk.org). <br />
<br />
* General introduction of SimpleITK on the [http://news.iscas.co/simpleitk-a-simplified-multi-language-interface-to-the-insight-segmentation-and-registration-toolkit/ International Society for Computer Aided Surgery blog], 1 March 2017.<br />
* [http://zarquon42b.github.io/2015/05/22/SimpleITKandR/ SimpleITK and R], 22 May 2015.<br />
* [http://kevin-keraudren.blogspot.com/2014/12/medical-image-analysis-ipython-tutorials.html Medical Image Analysis Course], 20 December 2014.<br />
* [https://pyscience.wordpress.com/tag/simpleitk Image Segmentation with Python and SimpleITK], October/November 2014.<br />
<br />
=Support=<br />
<br />
SimpleITK is supported through the ITK community and the active developers. In addition to the resources listed above in the documentation section, the [http://www.itk.org/ITK/help/mailing.html ITK mailing lists] can be used to asked questions and obtain additional help.<br />
<br />
== Issue Tracking And Feature Requests ==<br />
<br />
We are currently using the [https://github.com/SimpleITK/SimpleITK/issues github issue tracker]. Before switching to github issue tracking we used an instance of the<br />
[https://itk.icts.uiowa.edu/jira/browse/SIMPLEITK Legacy Jira Issue Tracker ] hosted by the University of Iowa.<br />
<br />
== Releases ==<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=refs/tags/v1.0.0 v1.0.0] [https://github.com/SimpleITK/SimpleITK/releases/tag/v1.0.0 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/1.0.0 Downloads] [https://www.itk.org/SimpleITKDoxygen100/html/index.html Doxygen]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=4a3376df08f27162b4d2a90e4a0452a839ab3124 v0.10.0] [https://github.com/SimpleITK/SimpleITK/releases/tag/v0.10.0 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.10.0 Downloads] [https://www.itk.org/SimpleITKDoxygen010/html/index.html Doxygen]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=ec033f0be4f67b2e21483ed9bc3698f07dba9d06 v0.9.1] [https://github.com/SimpleITK/SimpleITK/releases/tag/v0.9.1 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.9.1 Downloads] <br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=7f06e9fc7f3cda9c47e8b7d6d37885b1f425ea3b v0.9.0] [https://github.com/SimpleITK/SimpleITK/releases/tag/v0.9.0 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.9.0 Downloads] [https://www.itk.org/SimpleITKDoxygen09/html/index.html Doxygen]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=d0a90983877b46631e69a398bd8341889912c8c2 v0.8.1] [https://github.com/SimpleITK/SimpleITK/releases/tag/v0.8.1 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.8.1/ Downloads] [https://www.itk.org/SimpleITKDoxygen08/html/index.html Doxygen]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=11bff587f8a930bbca02813595aa3d08388af979 v0.8.0] [https://github.com/SimpleITK/SimpleITK/releases/tag/v0.8.0 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.8.0/ Downloads] <br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=commit;h=a2b29110771a1eb0b09d18ff8e98a784dc6e6451 v0.7.1] [https://github.com/SimpleITK/SimpleITK/releases/tag/v0.7.1 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.7.1/ Downloads]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=6fecf5ae5859295082b9016c97bf4bd68a961a62 v0.7.0] [https://github.com/SimpleITK/SimpleITK/releases/tag/v0.7.0 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.7.0/ Downloads] [https://www.itk.org/SimpleITKDoxygen07/html/index.html Doxygen]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=fc17df598cac97d344c875fed117f03ae7d1aacd v0.6.1] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.6.1/ Downloads] [http://www.itk.org/SimpleITKDoxygen06/html/index.html Doxygen]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=c055ef4e4cd2802c56e169084d9dd1bc655b4e93 v0.6.0] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.6.0/ Downloads] <br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=41fbb6d69f88fa1c8ab3b9d710b7ae57bb975721 v0.5.1] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.5.1/ Downloads]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=35ccfd2b99b4b5675d4d0894bb870574396408b6 v0.5.0] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.5.0/ Downloads]<br />
<br />
= Development =<br />
<br />
SimpleITK has moved to a [https://github.com/SimpleITK/SimpleITK Github] based work flow for issues tracking and contribution.<br />
<br />
<br />
SimpleITK utilizes an additional "next" branch to merge and test changes before merging into the master branch. This makes our "master" branch more stable and reliable. This follows the CMake development process:<br />
<br />
* [http://www.cmake.org/Wiki/CMake/Git/Develop CMake Development Process ]<br />
<br />
<br />
== Source Code Repository ==<br />
<br />
SimpleITK uses git as the revision control system. The official repository is hosted along side ITK as http://itk.org/SimpleITK.git [http://public.kitware.com/gitweb?p=SimpleITK.git]. It is also mirrored on [https://github.com/SimpleITK/SimpleITK Github ].<br />
<br />
Development is currently following the branchy workflow with the Kitware stage repository. This workflow is described here:<br />
*http://public.kitware.com/Wiki/Git/Workflow/Stage<br />
*http://public.kitware.com/Wiki/Git/Workflow/Topic<br />
<br />
Contributions from github will be pushed to the stage repo and merged into the next branch by a SimpleITK developer.<br />
<br />
== [[SimpleITK/Design_And_Proposals | Design And Proposals]] ==</div>Blowekamphttps://public.kitware.com/Wiki/index.php?title=SimpleITK/Template:MigrationHeader&diff=61860SimpleITK/Template:MigrationHeader2017-06-15T16:01:22Z<p>Blowekamp: Created page with "This page is being migrated to Read The Docs!"</p>
<hr />
<div>This page is being migrated to Read The Docs!</div>Blowekamphttps://public.kitware.com/Wiki/index.php?title=SimpleITK/FAQ&diff=61827SimpleITK/FAQ2017-05-30T18:17:56Z<p>Blowekamp: /* Why does the Superbuild fail compiling PCRE on Mac OS X? */</p>
<hr />
<div>[[Image: Simpleitk_logo.png|center]]<br />
<br />
This page hosts frequently asked questions about SimpleITK, and their answers.<br />
<br />
= Installation =<br />
<br />
==Why do I get an error about a missing Dynamic Library when running SimpleITK with Python on windows?==<br />
<br />
This error has been resolved with SimpleITK version 0.5.1 and should no longer occur. Upgrading to the latest SimpleITK is encouraged.<br />
<br />
This error occurs after you have downloaded the Windows SimpleITK binaries when you are running python and try to import SimpleITK. There is an error about a missing DLL on Windows when you don't have Visual Studio 10 and no other application has installed certain libraries before. You will need to download the Visual Studio 10 redistribution libraries. The libraries are available for download [http://www.microsoft.com/download/en/details.aspx?id=5555 here].<br />
<br />
== I am using the binary distribution of SimpleITK for Anaconda, why do I get an error about libpng? ==<br />
<br />
ImportError: dlopen(./_SimpleITK.so, 2): Library not loaded: @rpath/libpng15.15.dylib<br />
Referenced from: .../lib/python2.7/site-packages/SimpleITK/_SimpleITK.so<br />
Reason: image not found<br />
<br />
This can be resolved by installing the version of libpng that SimpleITK 0.9 was built against:<br />
<br />
conda create -n sitkpy anaconda libpng=1.5<br />
<u>unix/mac</u>: source activate sitkpy <br> <u>win</u>: activate sitkpy <br />
conda install -c <nowiki>https://conda.binstar.org/simpleitk/channel/main</nowiki> SimpleITK<br />
conda install libpng=1.5 <br />
<br />
This set of commands:<br />
* creates the virtual environment with our choice of libpng version, all other anaconda packages will be compatible with this version.<br />
* activate the virtual environment.<br />
* installs SimpleITK into the virtual environment (unfortunately this will automatically upgrade you to libpng 1.6).<br />
* downgrades to libpng 1.5 so that library versions are compatible.<br />
<br />
We are currently investigating why the anaconda build system is not expressing version dependency for shared libraries. We how this will not be an issue with the next binary package.<br />
<br />
= How to Use =<br />
<br />
== What filters are currently available in SimpleITK? ==<br />
<br />
As of March 2014 we have approximately '''260 ITK image filters''' wrapped for SimpleITK. The [http://www.itk.org/SimpleITKDoxygen/html/Filter_Coverage.html '''filter coverage table'''] shows the current set of ITK filters in SimpleITK. Additionally the [http://www.itk.org/SimpleITKDoxygen/html/classes.html Doxygen] can be looked at to determine if a filter is available.<br />
<br />
== What image file formats can SimpleITK read? ==<br />
<br />
<br />
<br />
== How do I read a RAW image into SimpleITK? ==<br />
<br />
In general raw image files are missing information. They do not contain the nessesary header information to describe the basic size and type for the data, so this format is intrinsically deficient. The [http://www.itk.org/Doxygen/html/classitk_1_1RawImageIO.html RawImageIO] class is not available in SimpleITK so there is no direct way to programmatically hard code this header information. The suggested way is to create a Meta image header file (*.mhd) which references the raw data file and describes the size and type of the data. The documentation on how to write a Meta image header can be found [http://www.itk.org/Wiki/MetaIO/Documentation#Reading_a_Brick-of-Bytes_.28an_N-Dimensional_volume_in_a_single_file.29 here].<br />
<br />
The following is a sample Meta image header file, perhaps of name sample.mhd:<br />
<br />
ObjectType = Image<br />
NDims = 3<br />
DimSize = 256 256 64<br />
ElementType = MET_USHORT<br />
ElementDataFile = image.raw (this tag must be last in a MetaImageHeader)<br />
<br />
== Can I use another image file viewer beside ImageJ? ==<br />
<br />
By default when the [http://www.itk.org/SimpleITKDoxygen/html/namespaceitk_1_1simple.html#a7bacfc4685cff93e46d7401865f9579e Show function] is called, SimpleITK writes out a temporary image in Nifti format then launches [http://rsbweb.nih.gov/ij/index.html ImageJ]. The user can override the file format of the temporary file and/or the application used to handle that file.<br />
<br />
The temporary file format can be specified via the '''SITK_SHOW_EXTENSION''' environment variable. For example, if the user wanted to export a PNG file, on Linux it might look like this:<br />
<br />
SITK_SHOW_EXTENSION=".png"<br />
export SITK_SHOW_EXTENSION<br />
<br />
Use of an extension unsupported by ITK results in an error message. For the supported image formats, here is the [http://www.itk.org/Doxygen/html/group__IOFilters.html ITK Image IO Filters].<br />
<br />
The default display application for all image types is ImageJ. To override ImageJ with some other application, use the '''SITK_SHOW_COMMAND''' environment variable. For instance, on Unix systems, using GNOME's image viewer eog would be:<br />
<br />
SITK_SHOW_EXTENSION=".png"<br />
export SITK_SHOW_EXTENSION<br />
SITK_SHOW_COMMAND="eog"<br />
export SITK_SHOW_COMMAND<br />
<br />
To override the default display applications for only color or 3d images, there are the '''SITK_SHOW_COLOR_COMMAND''' and '''SITK_SHOW_3D_COMMAND''' environment variables.<br />
<br />
More details on the Show function, including use of the "%a" and "%f" tokens, is at the [http://www.itk.org/SimpleITKDoxygen/html/namespaceitk_1_1simple.html#a7bacfc4685cff93e46d7401865f9579e Show function Doxygen page].<br />
<br />
== How can I use 3D Slicer to view my images? ==<br />
[http://slicer.org 3D Slicer] is a very powerful and popular application for visualization and medical image computing. The SITK_SHOW_COMMAND environment variable may be used to display images in Slicer instead of SimpleITK's default viewer, ImageJ. The following are examples of what settings for SITK_SHOW_COMMAND might look like for Mac OS X, Linux and Windows to use Slicer.<br />
<br />
<br />
Mac OS X<br />
export SITK_SHOW_COMMAND=/Applications/Slicer.app/Contents/MacOS/Slicer<br />
<br />
Linux<br />
export SITK_SHOW_COMMAND=Slicer<br />
<br />
Windows<br />
set SITK_SHOW_COMMAND=:"c:\Program Files\Slicer 4.2.2-1\Slicer"<br />
<br />
The value of SITK_SHOW_COMMAND should be modified to point to wherever Slicer is installed. If you only want to use Slicer for volumetric 3D images, use the SITK_SHOW_3D_COMMAND environment variable instead of SITK_SHOW_COMMAND.<br />
<br />
== How can I use a newer Java with ImageJ on Mac OS X? ==<br />
By default on Mac OS X, the ImageJ application expects Java 6, which is old and unsupported. The latest supported version of Java (currently version 8u25) can be downloaded from [http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html Oracle's Java Development kit page]. The following bash commands will set up the SITK_SHOW_COMMAND and SITK_SHOW_COLOR_COMMAND to invoke ImageJ's jar file using the Java compiler.<br />
<br />
ij="/Applications/ImageJ/"<br />
ijcmd="java -Dplugins.dir=$ij/plugins -jar $ij/ImageJ.app/Contents/Resources/Java/ij.jar"<br />
<br />
export SITK_SHOW_COMMAND="$ijcmd -eval 'open( \"%f\" );'"<br />
export SITK_SHOW_COLOR_COMMAND="$ijcmd -eval 'open( \"%f\" ); run(\"Make Composite\", \"display=Composite\");'"<br />
<br />
The first lines set a variable pointing to the standard location for the ImageJ directory. If ImageJ is installed somewhere else, the line should be modified. The second line provides the command to launch ImageJ using the Java compiler. It includes flags that point to ImageJ's plugiin directory and ImageJ's ij.jar file.<br />
<br />
The SITK_SHOW_COMMAND tells SimpleITK.Show() to launch Java with ij.jar and then execute the open macro with an image file. The SITK_SHOW_COLOR_COMMAND does these same things and then executes the ImageJ "Make Composite" command to treat a multichannel image as a composite color image.<br />
<br />
= Wrapping =<br />
<br />
== Python ==<br />
<br />
== Tcl ==<br />
<br />
== Java ==<br />
<br />
== C# ==<br />
<br />
== R ==<br />
<br />
<br />
= Compilation =<br />
<br />
==Is my compiler supported?==<br />
SimpleITK uses advanced C++ meta-programming to instantiate ITK's Images and Filters. Addtionally, we use some headers which are included in the C99 and C++ TR1 extension. Therefore SimpleITK places additional requirements on the compiler beyond what is required for ITK. In principle we require C++x03 with C99's "stdint.h" and TR1's "functional". If your compiler has those features it is likely able to be supported.<br />
<br />
The additional requirement for a supported compiler is that it is on the nightly dashboard. With this regard, the list of supported compilers is on the SimpleITK [http://open.cdash.org/index.php?project=SimpleITK SimpleITK dashboard]. We welcome user contributions to the nightly dashboard to expand the list of supported compilers.<br />
<br />
===Committed to Support===<br />
<br />
* GCC 4.2-4.7<br />
* Visual Studio 2008 with Service Pack 1 (VS9)<br />
* Visual Studio 2012 (VS10) ( including Express )<br />
* Visual Studio 2012 (VS11)<br />
<br />
=== Noted Problems ===<br />
* Compiling on a MS Windows 32-bit OS with static libraries is not supported due to lack of memory.<br />
* With SimpleITK release 0.4.0, Visual Studio 2008 was not compiling. This problem has since been remedied in the development branch on April 18th, 2012.<br />
* With SimpleITK release 0.7.0, Visual Studio 2008 is not able to compile all wrapped languages at the same time, it's recommenced to choose one at a time.<br />
<br />
==Why am I getting a compilation error on OSX Mavericks?==<br />
<br />
With SimpleITK <=0.7 the following error occurred during compilation on Apple OSX 10.9 Mavericks with '''clang 5.0''':<br />
<br />
'''SimpleITK/Code/Common/include/sitkMemberFunctionFactoryBase.h:106:16: <span style="color:red">error</span>: no member named 'tr1' in namespace 'std''''<br />
typedef std::tr1::function< MemberFunctionResultType ( ) > FunctionObjectType;<br />
<nowiki>~~~~~^</nowiki><br />
<br />
With Xcode 5.0, Apple's distributed version of clang (5.0) changed which implementation of the C++ Standard Library it uses by default. Previous versions of clang (4.2 and earlier) used [http://gcc.gnu.org/libstdc++/ GNU's libstdc++] , while clang 5.0 now uses [http://libcxx.llvm.org LLVM's libc++]. SimpleITK 0.7 and earlier require certain features from [http://en.wikipedia.org/wiki/C%2B%2B_Technical_Report_1 C++ tr1] which are not implemented in LLVM's libc++ but are available in GNU's libstdc++.<br />
<br />
To build SimpleITK <=0.7 with clang 5.0, you can configure the compiler to use GNU's stdlibc++. This change must be done at the initial configuration:<br />
<br />
cmake "-DCMAKE_CXX_FLAGS:STRING=-stdlib=libstdc++" ../SimpleITK/SuperBuild<br />
<br />
NOTE: If you already have a build directory which has been partially configured the contents must be deleted. The above line needs to be done for an initial configuration in an empty build directory.<br />
NOTE: This work around does not work when with the CMake "Xcode" generator. It is recommended to just use the default "Unix Makefiles" generator, to build SimpleITK, and get using SimpleITK, not building it.<br />
<br />
The following is a '''compatibility table for clang 5.0'''. It shows that the default of libc++ does not work with SimpleITK, while the other options do. The choice of which standard library to use and which C++ language standard to use are independent.<br />
<br />
{| class="wikitable"<br />
|-<br />
!Clang 5.0 compatibility<br />
! -stdlib=libc++ <br />
! -stdlib=libstdc++<br />
|-<br />
! (c++03)<br />
| style="background:red" | FAIL<br />
| style="background:green" | OK<br />
|-<br />
! -std=c++11<br />
| style="background:LightGreen" | OK (>=0.8)<br />
| style="background:green" | OK<br />
|}<br />
<br />
For SimpleITK >=0.8, support for the tr1 features migrated to C++11 has been improved with better feature detection, and the necessary flags are now automatically added. LLVM's libc++ will now work if compiling with the C++11 standard by adding the flag "-std=c++11" in the initial configuration.<br />
<br />
To further complicate dependencies and interactions, some downloadable languages such as Java, or R, may be compiled against GNU's libstdc++. This may cause a conflict in the types used in the interface resulting in compilation errors while wrapping the language.<br />
<br />
==Why does the Superbuild fail compiling PCRE on Mac OS X?==<br />
If the Xcode command line tools are not properly set up on OS X, PCRE could fail to build in the Superbuild process with messages such as:<br />
<br />
checking whether we are cross compiling... configure: error: in `/your/build/path/SimpleITK/PCRE-prefix/src/PCRE-build': <br />
configure: error: cannot run C compiled programs.<br />
If you meant to cross compile, use `--host'.<br />
See `config.log' for more details<br />
[10/13] Performing build step for 'PCRE'<br />
<br />
To install the command line developer tools enter the following:<br />
'''xcode-select --install<br />
<br />
To reset the default command line tools path:<br />
'''xcode-select --reset<br />
<br />
==Do I need to download an option package for TR1 support?==<br />
Visual Studio 2008 requires an additional download for TR1 support. This support is best provided with the Service Pack 1. There is a separate TR1 feature pack which can be downloaded, but it is no longer recommended since Service Pack 1 includes TR1 and numerous bug and performance improvements.<br />
<br />
==Do I need to download an optional package for C99?==<br />
<br />
SimpleITK will proved a "stdint.h" header if missing on the system.<br />
<br />
==How do I build with Visual Studio 2008?==<br />
Visual Studio 2008 is the oldest supported Microsoft development environment that SimpleITK supports. To build SimpleITK, certain features of C++TR1 are required. These features are best provided by the [http://www.microsoft.com/download/en/details.aspx?id=23691 "Microsoft Visual Studio 2008 Service Pack 1"] (or try this link [http://www.microsoft.com/en-us/download/confirmation.aspx?id=10986]). Alternatively just the [http://www.microsoft.com/downloads/en/details.aspx?FamilyId=D466226B-8DAB-445F-A7B4-448B326C48E7&displaylang=en Visual C++ 2008 Feature Pack Release] can be installed. Please note that all our dashboard machines now use SP1.<br />
<br />
<br />
Older versions of SimpleITK (<0.7.0) requires a also required a separately downloaded stdint.h for this compiler. This is not automatically provided if needed. If it's still needed the file can be downloaded [http://msinttypes.googlecode.com/svn/trunk/stdint.h here]. For 64-bit Microsoft Windows it should be dragged with the GUI into the appropriate include path for the architecture.<br />
<br />
== What Configurations on Windows are Supported For Building? ==<br />
<br />
There are quite a large number of configuration options available for the Windows platform. The following table is a guide line of what is regularly tested and confirmed to work or fail.<br />
<br />
<br />
{| class="wikitable"<br />
|-<br />
!<br />
! Architecture<br />
! Library Type<br />
! colspan="2" |Visual Studio 2008 SP1 (VS9 )<br />
! colspan="2" | Visual Studio 2010 ( VS10 )<br />
! colspan="2" | Visual Studio 2012 ( VS11 )<br />
! colspan="2" | Visual Studio 2013 ( VS13 )<br />
|-<br />
!<br />
!<br />
!<br />
! Release<br />
! Debug<br />
! Release<br />
! Debug<br />
! Release<br />
! Debug <br />
! Release<br />
! Debug<br />
|-<br />
! rowspan="2" style="background:Orange" | 32-bit Window OS<br />
! rowspan="2" style="background:Orange" | Only Intel 32-bit<br />
! style="background:Orange" | Static<br />
| style="background:red" | FAIL<br />
| style="background:red" | FAIL<br />
| style="background:red" | FAIL<br />
| style="background:red" | FAIL<br />
| style="background:Orange" | <br />
| style="background:Orange" | <br />
| style="background:Orange" | <br />
| style="background:Orange" | <br />
|-<br />
! style="background:Orange" | Shared<br />
| style="background:red" | FAIL<br />
| style="background:red" | FAIL<br />
| style="background:green" | Nightly<br />
| style="background:green" | Nightly<br />
| style="background:Orange" | <br />
| style="background:Orange" | <br />
| style="background:Orange" | <br />
| style="background:Orange" | <br />
|-<br />
! rowspan="4" |64-bit Window OS<br />
! rowspan="2" | Intel 32-bit<br />
! Static<br />
| style="background:green" | Nightly<br />
| style="background:Orange" | <br />
| style="background:green" | Nightly<br />
| style="background:Orange" | <br />
| style="background:green" | Nightly<br />
| style="background:Orange" |<br />
| style="background:green" | Nightly<br />
| style="background:Orange" |<br />
|-<br />
! Shared<br />
| style="background:LightGreen" |<br />
| style="background:LightGreen" |<br />
| style="background:LightGreen" |<br />
| style="background:LightGreen" |<br />
| style="background:LightGreen" |<br />
| style="background:LightGreen" |<br />
| style="background:LightGreen" |<br />
| style="background:LightGreen" |<br />
|-<br />
! rowspan="2" | Intel 64-bit<br />
! Static<br />
| style="background:green" | Nightly<br />
| style="background:LightGreen" | <br />
| style="background:green" | Nightly<br />
| style="background:green" | Nightly<br />
| style="background:LightGreen" |<br />
|<br />
| style="background:LightGreen" |<br />
|<br />
|-<br />
! Shared<br />
| style="background:LightGreen" |<br />
| style="background:LightGreen" |<br />
| style="background:LightGreen" |<br />
| style="background:LightGreen" |<br />
| style="background:green" | Nightly<br />
| <br />
| style="background:green" | Nightly<br />
|<br />
|}<br />
<br />
{| class="wikitable"<br />
|<br />
! Legend<br />
|-<br />
| style="background:Green" | Nightly<br />
| This combination of options is nightly tested, and known to work.<br />
|-<br />
|style="background:LightGreen" |<br />
| This combinations has been manually tested, and is expected to work.<br />
|-<br />
| <br />
| It is not known if this combinations of options will work.<br />
|-<br />
| style="background:Orange" |<br />
| This combination likely has problems, and is not recommended.<br />
|-<br />
| style="background:Red" | FAIL<br />
| These options are known not to work.<br />
|}<br />
<br />
This table has been updated for the release branch, master, as of February 15th 2013.<br />
<br />
== Why are all of the configurations not supported on Windows? ==<br />
<br />
One of the following errors frequently occur when the set of configuration options fail:<br />
<br />
LINK : fatal error LNK1102: out of memory<br />
<br />
LINK : fatal error LNK1248: image size (80000010) exceeds maximum allowable size (80000000)<br />
<br />
<br />
These errors occur because of limitations in the compiler's linker or the operating system. For 64-bit architectures the linker is still only 32-bits on some Visual Studios. In certain configurations the linker can run out of memory. Also the Windows operating systems have a hard limit of 2GB for the size of libraries. For Debug mode configurations this limit can be encounted.<br />
<br />
In general building in Debug mode should not be necessary, unless you are trying to debug SimpleITK or ITK. This configuration produces libraries that are very large because the compiler must maintain symbols for all instantiated ITK classes and member functions for each template parameters that a class is instantiating.<br />
<br />
<br />
== Where is the Test Data? ==<br />
<br />
The testing data is not stored in the SimpleITK repository or as part of the source code. It is mirrored on several data repositories on the web.<br />
<br />
If you have obtained the source code from the git repository, it should be downloaded as part of the build process via the CMake ExternalData module.<br />
<br />
If you have downloaded a tar-ball of the source code there should be an accompanying "SimpleITKData" tar-ball available, which contains the external data. It should populate the .ExternalData subdirectory of the SimpleITK source code directory when extracted.<br />
<br />
== Why is CMake unable to download ExternalData? ==<br />
<br />
When compiling SimpleITK you may get and error like the following:<br />
<br />
Object MD5=2e115fe26e435e33b0d5c022e4490567 not found at:<br />
https://placid.nlm.nih.gov/api/rest?method=midas.bitstream.download&checksum=2e115fe26e435e33b0d5c022e4490567&algorithm=MD5 ("Unsupported protocol")<br />
https://simpleitk.github.io/SimpleITKExternalData/MD5/2e115fe26e435e33b0d5c022e4490567 ("Unsupported protocol") <br />
https://midas3.kitware.com/midas/api/rest?method=midas.bitstream.download&checksum=2e115fe26e435e33b0d5c022e4490567&algorithm=MD5 ("Unsupported protocol")<br />
https://insightsoftwareconsortium.github.io/ITKTestingData/MD5/2e115fe26e435e33b0d5c022e4490567 ("Unsupported protocol")<br />
https://itk.org/files/ExternalData/MD5/2e115fe26e435e33b0d5c022e4490567 ("Unsupported protocol")<br />
<br />
This indicates that CMake was not compiles with SSL support. The "Unsupported protocol" message indicate that CMake can not communicate via "https".<br />
<br />
The solution is to use a compiled version of CMake which supports SSL. If you compile CMake yourself, simply reconfigure CMake with the "CMAKE_USE_OPENSSL option enabled.</div>Blowekamphttps://public.kitware.com/Wiki/index.php?title=SimpleITK/GettingStarted&diff=61811SimpleITK/GettingStarted2017-05-12T16:03:32Z<p>Blowekamp: /* Python installation */</p>
<hr />
<div>[[Image: SimpleITK-SquareTransparentLogo.png|center]]<br />
<br />
SimpleITK provides a simplified interface to ITK in a variety of languages. You can either download binaries, if they are available for your platform and prefered language, or you can build SimpleITK yourself.<br />
<br />
Additionally, there are several recommended third-party software packages.<br />
<br />
After you have installed SimpleITK, please look to the [[ITK_Release_4/Outreach/Conferences/MICCAI 2011/SimpleITK|Tutorial]] or the [http://www.itk.org/SimpleITKDoxygen/html/ Doxygen] pages for more information.<br />
<br />
=Downloading the binaries=<br />
<br />
One of the great advantages of SimpleITK is that (typically) you do not have to build it — you can simply download the binaries and get started right away!<br />
<br />
Currently, '''Python''' binaries are available on Microsoft Windows, GNU Linux and Apple OS X. '''C# and Java''' binaries are available for Windows. We are also working towards supporting '''R''' packaging.<br />
<br />
==Python binary files==<br />
<br />
There are currently two Python binary package choices: Python Wheels, and Anaconda packages for the Anaconda Python distribution.<br />
<br />
==== Use a Virtual Environment ====<br />
<br />
Before you install SimpleITK we <b>highly recommend</b> that you create a virtual environment into which you install the package. Note that different Python versions and distributions have different programs for creating and managing virtual environments. <br />
<br />
The use of a virtual environment allows you to elegantly deal with package compatability issues, to quote [http://docs.python-guide.org/en/latest/ The Hitchhiker’s Guide to Python!]:<br />
<blockquote>A Virtual Environment is a tool to keep the dependencies required by different projects in separate places, by creating virtual Python environments for them. It solves the “Project X depends on version 1.x but, Project Y needs 4.x” dilemma, and keeps your global site-packages directory clean and manageable.</blockquote><br />
<br />
Programs for creating virtual environments include [https://packaging.python.org/en/latest/installing/#creating-virtual-environments virtualenv and pyvenv] for generic Python distributions, [http://conda.pydata.org/docs/using/envs.html conda] for the anaconda distribution, and [http://docs.enthought.com/canopy/configure/canopy-cli.html canopy_cli] for the canopy distribution.<br />
<br />
=== Wheels for Generic Python Distribution ===<br />
<br />
If you are working with the [https://www.python.org/ generic Python distribution] you can install a Wheel with the lasted version of pip (>=9.0).<br />
<br />
First thing you should do is create a virtual environment (virtualenv or pyvenv tools) and activate it.<br />
<br />
<u>Note</u>: you can always manually download the wheels for your operating system and Python version directly from [http://sourceforge.net/projects/simpleitk/files/SimpleITK/ sourceforge].<br />
<br />
<br />
From the command line use the [https://pip.pypa.io/en/latest/index.html pip program] to install:<br />
<br />
$ pip install SimpleITK<br />
<br />
The pip package manager should automatically find the correct package for Microsoft Windows, Apple OS X and GNU Linux if your version and architecture are supported. If no binary package is found, then a source distribution will be downloaded and attempted to be compiled and you should look into [[#Build_It_Yourself]].<br />
<br />
:: If your pip version in the virtual environment is stale (<9.0) you need to update it (pip install -U pip).<br />
<br />
=== Anaconda Distribution ===<br />
<br />
First thing you should do is create a virtual environment ([https://conda.pydata.org/docs/using/envs.html conda] tool) and activate it.<br />
<br />
Currently there are compiled binaries on [https://conda.anaconda.org/simpleitk Anaconda Cloud], easily installed with:<br />
<br />
$ conda install -c <nowiki>https://conda.anaconda.org/simpleitk</nowiki> SimpleITK<br />
<br />
Beta and release candidate packages are also available on Anaconda cloud under the dev label:<br />
<br />
$conda install -c <nowiki>https://conda.anaconda.org/simpleitk/label/dev</nowiki> SimpleITK<br />
<br />
=== Enthought Canopy Distribution ===<br />
<br />
First thing you should do is create a virtual environment (canopy_cli tool) and activate it.<br />
<br />
Currently there are no binaries supported with this distribution. You will need to compile SimpleITK yourself. (Using pip installation may work.)<br />
<br />
==C# binary files==<br />
<br />
'''Binaries for select C# platform''' can be found on [https://sourceforge.net/projects/simpleitk/files/SimpleITK/1.0.0/CSharp/ SimpleITK's SourceForge page]. Installing the library should only involve importing the unzipped files into you C# environment. The files have the following naming convention:<br />
SimpleITK-version-CSharp-buildplatform-targetplatform.zip<br />
eg.<br />
SimpleITK-1.0.0-CSharp-win32-x86.zip<br />
SimpleITK-1.0.0-CSharp-win64-x64.zip<br />
<br />
Details about how to set up a C# Visual Studio project with SimpleITK can be found in the [[SimpleITK/GettingStarted/A_visual_guide_to_SimpleITK_with_CSharp|Visual Guide to SimpleITK with CSharp]].<br />
<br />
More information about getting started with a sample C# program can be found in [[SimpleITK/GettingStarted/Visual_guide_to_building_on_Linux#A_simple_C.23_program| A visual guide to building SimpleITK on Linux]]<br />
<br />
==Java binary files==<br />
<br />
'''Binaries for select Java platforms''' can be found on [https://sourceforge.net/projects/simpleitk/files/SimpleITK/1.0.0/Java/ SimpleITK's SourceForge page]. Installation instructions are available at [[SimpleITK/GettingStarted/A visual guide to SimpleITK in Java|a visual guide to SimpleITK in Java]].<br />
<br />
==Nightly binaries==<br />
<br />
The '''latest binaries''' for the current development version of SimpleITK are also generally available. Binary packages are built as part of the nightly regression testing system. The download links are available from the [https://open.cdash.org/index.php?project=SimpleITK '''CDash'''] '''dashboard''' in the "Nightly Packages" section. <br />
<br />
Each row on the dashboard is a SimpleITK build on a particular system, and if the build was successful there will be a '''package icon''': https://open.cdash.org/img/package.png which links to the packages build by the system. A user may directly download the built package from such a link.<br />
<br />
=Build It Yourself=<br />
<br />
In many cases a user does not need to build SimpleITK because of the pre-built binaries available (see [[SimpleITK/GettingStarted#Binaries|above]]). However there are several reasons a user might prefer to '''build SimpleITK from source''':<br />
* The binary files for your programming language of choice are not (yet) distributed<br />
* You want the live on the bleeding edge by using the latest-and-greatest version of SimpleITK<br />
* You want to wrap your own filters using the SimpleITK infrastructure<br />
* You want to contribute to the development of SimpleITK<br />
* To use the SimpleITK's C++ interface and/or use ITK directly<br />
<br />
=== Prerequisites ===<br />
To build SimpleITK you need:<br />
* A recent version of [http://www.cmake.org/ CMake] >= 3.3 with SSL support for https.<br />
* A supported [[SimpleITK/FAQ#Is_my_compiler_supported.3F|compiler]]<br />
* To use the latest developmental version, source code can be downloaded with [http://git-scm.com/ git] >= 1.65<br />
** Git is required if building SimpleITK using "SuperBuild" (see below) to automatically download the matching version of ITK, SWIG, etc...<br />
** Windows users may prefer [http://msysgit.github.com/ msysGit]<br />
* It is recommended to have numpy installed when testing Python bindings<br />
<br />
=== Recipes / Formulas / Short Cuts ===<br />
<br />
For some environments we have short cuts, scripts, for automated building of SimpleITK (see their repository for more details):<br />
<br />
* For '''Python''': The [https://github.com/scikit-build/scikit-build scikit-build] based distutils based [https://github.com/scikit-build/scikit-build setup.py frontend] can be used to build, install, and package SimpleITK for Python.<br />
<br />
* For the '''Anaconda Python''' distribution: The recipe and instructions for the SimpleITK build are in [https://github.com/SimpleITK/SimpleITKCondaRecipe this GitHub repository]. <br />
<br />
* For the '''R language''': A devtools installer and instructions are available from [https://github.com/SimpleITK/SimpleITKRInstaller this GitHub repository]. <br />
<br />
* '''On the Mac''', with the [http://brew.sh/ Homebrew package manager], a SimpleITK formula is available: https://github.com/Homebrew/homebrew-science/blob/master/simpleitk.rb for multiple language wrappings.<br />
<br />
* For the '''Lua language''' with the Luarocks module deployment system, a SimpleITK rockspec is available form [https://github.com/SimpleITK/SimpleITKLuaRock this GitHub repository].<br />
<br />
=== Source code ===<br />
<br />
If one of the above language specific front-ends are not used then SimpleITK must be build directly.<br />
<br />
There are two options to obtain the SimpleITK source code:<br />
# Download a released version from the SimpleITK [https://sourceforge.net/projects/simpleitk/ SourceForge] page<br />
# Download the latest development version using git<br />
git clone http://itk.org/SimpleITK.git<br />
<br />
=== Building using SuperBuild ===<br />
After downloading SimpleITK's source code we '''STRONGLY''' recommend to run cmake on the SuperBuild subdirectory of SimpleITK. Execute the following commands in the parent of the SimpleITK source directory to configure the SuperBuild:<br />
mkdir SimpleITK-build<br />
cd SimpleITK-build<br />
cmake ../SimpleITK/SuperBuild<br />
<br />
The SuperBuild will automatically download and build the matching version of ITK and SWIG needed to compile SimpleITK. Additionally, it will set recommended compilation flags to minimize the size of the library and enable support for large libraries. This is the recommended way to build SimpleITK and is easiest.<br />
<br />
If you get an error message saying that ITK_DIR is not set then, you did not correctly point cmake to the SuperBuild sub-directory. Please erase your binary directory, and point cmake to the SimpleITK/SuperBuild sub-directory.<br />
<br />
The cmake configuration process should automatically find supported languages and enable SimpleITK wrapping for them. To manually enable a language toggle the appropriate WRAP_LANGUAGE cmake variable to ON. Verify and/or correct the advanced cmake variables to the language specific executable, libraries and include directories. For example if you have multiple Python installations ensure that all related Python variable refer to the same versions.<br />
<br />
Then use your make utility or your cmake chosen build utility to build SimpleITK.<br />
<br />
SimpleITK takes a while to build. Some tips and tricks to speed up development time are listed [http://www.itk.org/SimpleITKDoxygen/html/Developer.html#TandT here].<br />
<br />
=== Building Manually ===<br />
This is '''not''' the recommended way of building SimpleITK, but it can be useful if you want to use a system version of ITK, etc. , or if you do not want to (or can not) use git.<br />
<br />
# Setup the prerequisites as described above (i.e. CMake and supported compiler)<br />
# Install the matching version of [http://www.swig.org/ SWIG] >= 3.0.11<br />
#* e.g. Windows users may install [http://prdownloads.sourceforge.net/swig/swigwin-3.0.11.zip swigwin-3.0.11]<br />
# Download the SimpleITK source code from the [https://sourceforge.net/projects/simpleitk/files/SimpleITK/ SourceForge] page<br />
# Download the matching version of ITK, found by examining the `SuperBuild/External_ITK.cmake` file.<br />
# Configure ITK using CMake<br />
#* e.g. BUILD_EXAMPLES=OFF, BUILD_TESTING=OFF, BUILD_SHARED_LIBS=OFF, '''ITK_USE_REVIEW=ON'''<br />
# Build ITK<br />
#* Be sure to note the build settings e.g. Release x64<br />
# Configure SimpleITK using CMake<br />
#* Set ITK_DIR to the location of the ITK build location from the previous steps<br />
# Build SimpleITK<br />
#* Be sure to configure the build settings exactly the same as ITK e.g. Release x64 and CXX_FLAGS<br />
<br />
=== Advanced Build Options ===<br />
<br />
SimpleITK is aware of the enabled and disabled ITK Modules. It is possible to customize SimpleITK by disabling unneeded ITK modules or to extend SimpleITK by writing custom json file dependent an ITK Remote Modules being enabled.<br />
<br />
Additionally, each of the Examples directory, and each of the Wrapping subdirectories can be configured as independent CMake project dependent on an installed SimpleITK.<br />
<br />
===[[SimpleITK/GettingStarted/Visual_guide_to_building_on_Linux|A visual guide to building SimpleITK on Linux]]===<br />
<br />
==Testing==<br />
<br />
After compilation the prudent thing to due is to test SimpleITK to ensure your build is stable and suitable for installation and use. The following commands execute the SimpleITK tests.<br />
<br />
cd SimpleITK-build/SimpleITK-build<br />
ctest<br />
<br />
On Windows you will need to specify configuration. Typically that would be the Release configuration, as such:<br />
cd SimpleITK-build/SimpleITK-build<br />
ctest -C Release<br />
<br />
==Python installation==<br />
<br />
To install a built python package into the system Python, as root run:<br />
cd SimpleITK-build/Wrapping/Python<br />
python Packaging/setup.py install<br />
<br />
Alternatively, a Python virtual environment can be created and the distribution installed there.<br />
<br />
A Python Wheel file (.whl) can be created in the "Wrapping/Python/dist" directory, by building the "dist" target. If you have used the Superbuild with the "make" generator then issue the following command:<br />
make -C SimpleITK-build dist<br />
<br />
==R installation==<br />
<br />
To install a built R package:<br />
<br />
cd SimpleITK-build/Wrapping/R/Packaging<br />
R CMD INSTALL SimpleITK<br />
<br />
This will install the R package "SimpleITK" in /usr/local as root or your local R installation directory.<br />
<br />
<br />
If you are working in a multi-user environment, and are considerate of your fellow users you can install the package in a local directory:<br />
<br />
<ol> <li> Create a local directory where you will install your R packages</li></ol><br />
mkdir my_R_libs<br />
<ol start="2"> <li> Add an environment variable to your .bashrc</li></ol> <br />
export R_LIBS="/path_to/my_R_libs"<br />
<ol start="3"> <li> source your .bashrc and check the R library path, in an R shell >.libPaths()</li></ol><br />
<ol start="4"> <li>install </li></ol><br />
<br />
cd SimpleITK-build/Wrapping/R/Packaging<br />
R CMD INSTALL -l /path_to/my_R_libs SimpleITK<br />
<br />
=Recommended Software=<br />
<br />
== Fiji (Fiji is Just ImageJ) ==<br />
<br />
SimpleITK has a built in function, [https://itk.org/SimpleITKDoxygen/html/namespaceitk_1_1simple.html#ac8416e6e7f02dedfe8373b83dbea411d '''"itk::simple::Show()"'''], which can be used for viewing images in an interactive session. Currently, this function by default Show invokes [https://fiji.sc '''Fiji'''] then [http://rsbweb.nih.gov/ij/ '''ImageJ'''] to display images. ImageJ was chosen because it can handle all the image types that SimpleITK supports, even 3D vector images with n components. <br />
<br />
The Show function first searches the "PATH" environment variable, then additional standard locations are examined, if problems are encountered the correct path can be added to this environment variable and the '''"debugOn'''" option to '''"Show'''" flag set.<br />
<br />
====ImageJ====<br />
<br />
If ImageJ is used then we recommend downloading a recent version of [http://rsbweb.nih.gov/ij/download.html ImageJ] from the official home page. Recent versions come with support for the [http://nifti.nimh.nih.gov/nifti-1/ Nifti] ( *.nii ) file format, which SimpleITK uses to export to ImageJ. <br />
<br />
'''Note:''' '''Linux installation''' requires an additional step. The '''"Show'''" function searches for an executable named ImageJ or imagej, however the default tarball does not come with this file. Instead it comes with a file names [http://imagej.nih.gov/ij/download/linux/unix-script.txt script]. This file contains the installation instructions. In short the file should be renamed to "imagej" and the site specific variables for the installation location, and java must be set. Also consider the "newwindow" variable... Do you really want a new instance of ImageJ launched each time you use Show? Lastly, as the installation instructions indicate, the imagej wrapper should be in your path.<br />
<br />
==iPython and Jupyter==<br />
<br />
If you are using python, [http://ipython.org/ '''ipython'''] with [http://jupyter.org Jupyter] is terrific environment to perform interactive computing for image processing. With the addition of numpy and scipy, you'll have a powerful interactive environment.<br />
<br />
We have instructional [http://insightsoftwareconsortium.github.io/SimpleITK-Notebooks/ SimpleITK Jupyter Notebooks] which can help you get started.</div>Blowekamphttps://public.kitware.com/Wiki/index.php?title=SimpleITK&diff=61651SimpleITK2017-04-13T15:09:31Z<p>Blowekamp: /* Download */</p>
<hr />
<div>[[Image: SimpleITK-SquareTransparentLogo.png|center]]<br />
<br />
=Overview=<br />
<br />
Welcome to the National Library of Medicine Insight Segmentation and Registration Toolkit (ITK). [http://www.itk.org/ ITK] is an open-source, cross-platform system that provides developers with an extensive suite of software tools for image analysis. Among them, SimpleITK is a simplified layer built on top of ITK, intended to facilitate its use in rapid prototyping, education, interpreted languages. SimpleITK has the following main characteristics:<br />
<br />
* C++ library with wrappers for Python, Java, CSharp, R, Tcl and Ruby<br />
* Object-oriented<br />
* Provides a simplified, easy-to-use, procedural interface without templates<br />
* Is distributed under an open source Apache 2.0 License<br />
* Binary distributions for Python, Java and CSharp<br />
<br />
SimpleITK captures many of features available in ITK, and is under ongoing development. Earlier in the development process a set of [[SimpleITK/Goals|Specific Goals]] were outlined.<br />
<br />
= Getting Started =<br />
<br />
* [[SimpleITK/GettingStarted|Getting Started For Users]]<br />
** [[SimpleITK/GettingStarted#Binaries|downloading the binaries]]<br />
** [[SimpleITK/GettingStarted#Build_It_Yourself|build the code yourself]]<br />
** [[SimpleITK/GettingStarted#Recommended_Software|additional software]] which is useful with SimpleITK<br />
* [[SimpleITK/GettingStarted/Visual_guide_to_building_on_Linux|A Visual Guide to Building SimpleITK on Linux]]<br />
* [[SimpleITK/GettingStarted/A_visual_guide_to_SimpleITK_in_Java|A Visual Guide to SimpleITK with Java and Eclipse]]<br />
* [[SimpleITK/GettingStarted/A_visual_guide_to_SimpleITK_with_CSharp|A Visual Guide to SimpleITK with CSharp on Microsoft Visual Studio]]<br />
<br />
== Download ==<br />
<br />
SimpleITK currently provides binary distribution for Python, CSharp and Java language bindings. <br />
You can download the [https://sourceforge.net/projects/simpleitk/files/SimpleITK/1.0.0/ 1.0.0 release from SourceForge].<br />
<br />
= Documentation =<br />
<br />
* [[SimpleITK/FAQ|Frequently Asked Questions (FAQ)]]<br />
<br />
== API ==<br />
<br />
* Nightly generated [https://www.itk.org/SimpleITKDoxygen/html/ Doxygen].<br />
* Release 1.0 [https://www.itk.org/SimpleITKDoxygen100/html/index.html Doxygen].<br />
* Release 0.10 [https://www.itk.org/SimpleITKDoxygen010/html/index.html Doxygen].<br />
* Release 0.9 [https://www.itk.org/SimpleITKDoxygen09/html/index.html Doxygen].<br />
* Release 0.8 [https://www.itk.org/SimpleITKDoxygen08/html/index.html Doxygen].<br />
* Release 0.7 [https://www.itk.org/SimpleITKDoxygen07/html/index.html Doxygen].<br />
* Release 0.6.1 [https://www.itk.org/SimpleITKDoxygen06/html/ Doxygen].<br />
<br />
== Short Examples ==<br />
<br />
Concise [https://itk.org/SimpleITKDoxygen/html/examples.html examples] illustrating the usage of various SimpleITK features. Examples are written in a variety of languages including Python, R, C++, Java...<br />
<br />
== SimpleITK Notebooks ==<br />
<br />
The SimpleITK Notebooks are examples and tutorials on how to use SimpleITK utilizing Jupyter Notebooks. This approach allows the user to create, edit and re-run scripts and view the results all within a web interface. The authoritative description of what Jupyter Notebooks are can be found on the [http://jupyter.org/ Jupyter website]. While SimpleITK supports a number of programming languages, the majority of notebooks are written in Python and some in R.<br />
<br />
The main notebook repository is available on [https://github.com/InsightSoftwareConsortium/SimpleITK-Notebooks github].<br />
<br />
Additional repositories containing tutorial specific notebooks are listed in the [http://www.itk.org/Wiki/SimpleITK#SimpleITK_Tutorials Tutorials section] below.<br />
<br />
== Publications ==<br />
<br />
More information about SimpleITK can be found in the following publication:<br />
<br />
* Lowekamp BC, Chen DT, Ibáñez L and Blezek D (2013) [http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3874546/pdf/fninf-07-00045.pdf The Design of SimpleITK]. Front. Neuroinform. 7:45. doi: 10.3389/fninf.2013.00045<br />
<br />
Please cite SimpleITK and ITK when publishing work where it made a significant contribution.<br />
<br />
== SimpleITK Tutorials ==<br />
<br />
=== Upcoming ===<br />
<br />
* none<br />
<br />
=== Past ===<br />
* The International Symposium on Biomedical Imaging (ISBI) 2016, Prague, Czech republic: [http://biomedicalimaging.org/2016/?page_id=572 SimpleITK: An Interactive, Python-Based Introduction to SimpleITK with the Insight Segmentation and Registration Toolkit (ITK)]<br />
* SPIE Medical Imaging 2016, San Diego, USA: ITK in Biomedical Research and Commercial Applications<br />
: Tutorial material: [https://github.com/InsightSoftwareConsortium/SimpleITKTutorialSPIE2016 git repository] [https://hdl.handle.net/10380/3542 additional presentations] .<br />
* Medical Image Computing and Computer Assisted Intervention (MICCAI) 2015, Munich, Germany: a Python based tutorial on the use of the [[SimpleITK/Tutorials/MICCAI2015 | ITKv4 registration framework via SimpleITK]].<br />
: Tutorial material: [https://github.com/InsightSoftwareConsortium/SimpleITKTutorialMICCAI2015.git git repository].<br />
* ImageJ User & Developer Conference 2015, Madison, WI, USA: [http://imagej.net/Conference_2015_Program#Matt_McCormick_-_SimpleITK an introductory tutorial] in Python. <br />
: Tutorial material: [https://github.com/InsightSoftwareConsortium/SimpleITKWorkshopImageJ2015 git repository]. <br />
* Medical Image Computing and Computer Assisted Intervention (MICCAI) 2011, Toronto, Canada: a general [[ITK_Release_4/Outreach/Conferences/MICCAI 2011/SimpleITK|tutorial on SimpleITK]]. <br />
: Tutorial material: [https://github.com/SimpleITK/SimpleITK-MICCAI-2011-Tutorial/blob/master/Presentation/SimpleITK-MICCAI-2011.pdf?raw=true PDF of presentation], [http://midas.kitware.com/collection/view/175 virtual machine], and [https://github.com/SimpleITK/SimpleITK-MICCAI-2011-Tutorial git repository].<br />
<br />
== Community Blogs ==<br />
<br />
These are blog entries written by people who are not necessarily directly involved with SimpleITK. If you want us to link to your SimpleITK blog entry just let us know on the mailing list (community@itk.org). <br />
<br />
* General introduction of SimpleITK on the [http://news.iscas.co/simpleitk-a-simplified-multi-language-interface-to-the-insight-segmentation-and-registration-toolkit/ International Society for Computer Aided Surgery blog], 1 March 2017.<br />
* [http://zarquon42b.github.io/2015/05/22/SimpleITKandR/ SimpleITK and R], 22 May 2015.<br />
* [http://kevin-keraudren.blogspot.com/2014/12/medical-image-analysis-ipython-tutorials.html Medical Image Analysis Course], 20 December 2014.<br />
* [https://pyscience.wordpress.com/tag/simpleitk Image Segmentation with Python and SimpleITK], October/November 2014.<br />
<br />
=Support=<br />
<br />
SimpleITK is supported through the ITK community and the active developers. In addition to the resources listed above in the documentation section, the [http://www.itk.org/ITK/help/mailing.html ITK mailing lists] can be used to asked questions and obtain additional help.<br />
<br />
== Issue Tracking And Feature Requests ==<br />
<br />
We are currently using the [https://github.com/SimpleITK/SimpleITK/issues github issue tracker]. Before switching to github issue tracking we used an instance of the<br />
[https://itk.icts.uiowa.edu/jira/browse/SIMPLEITK Legacy Jira Issue Tracker ] hosted by the University of Iowa.<br />
<br />
== Releases ==<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=refs/tags/v1.0.0 v1.0.0] [https://github.com/SimpleITK/SimpleITK/releases/tag/v1.0.0 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/1.0.0 Downloads] [https://www.itk.org/SimpleITKDoxygen100/html/index.html Doxygen]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=4a3376df08f27162b4d2a90e4a0452a839ab3124 v0.10.0] [https://github.com/SimpleITK/SimpleITK/releases/tag/v0.10.0 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.10.0 Downloads] [https://www.itk.org/SimpleITKDoxygen010/html/index.html Doxygen]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=ec033f0be4f67b2e21483ed9bc3698f07dba9d06 v0.9.1] [https://github.com/SimpleITK/SimpleITK/releases/tag/v0.9.1 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.9.1 Downloads] <br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=7f06e9fc7f3cda9c47e8b7d6d37885b1f425ea3b v0.9.0] [https://github.com/SimpleITK/SimpleITK/releases/tag/v0.9.0 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.9.0 Downloads] [https://www.itk.org/SimpleITKDoxygen09/html/index.html Doxygen]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=d0a90983877b46631e69a398bd8341889912c8c2 v0.8.1] [https://github.com/SimpleITK/SimpleITK/releases/tag/v0.8.1 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.8.1/ Downloads] [https://www.itk.org/SimpleITKDoxygen08/html/index.html Doxygen]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=11bff587f8a930bbca02813595aa3d08388af979 v0.8.0] [https://github.com/SimpleITK/SimpleITK/releases/tag/v0.8.0 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.8.0/ Downloads] <br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=commit;h=a2b29110771a1eb0b09d18ff8e98a784dc6e6451 v0.7.1] [https://github.com/SimpleITK/SimpleITK/releases/tag/v0.7.1 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.7.1/ Downloads]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=6fecf5ae5859295082b9016c97bf4bd68a961a62 v0.7.0] [https://github.com/SimpleITK/SimpleITK/releases/tag/v0.7.0 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.7.0/ Downloads] [https://www.itk.org/SimpleITKDoxygen07/html/index.html Doxygen]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=fc17df598cac97d344c875fed117f03ae7d1aacd v0.6.1] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.6.1/ Downloads] [http://www.itk.org/SimpleITKDoxygen06/html/index.html Doxygen]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=c055ef4e4cd2802c56e169084d9dd1bc655b4e93 v0.6.0] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.6.0/ Downloads] <br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=41fbb6d69f88fa1c8ab3b9d710b7ae57bb975721 v0.5.1] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.5.1/ Downloads]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=35ccfd2b99b4b5675d4d0894bb870574396408b6 v0.5.0] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.5.0/ Downloads]<br />
<br />
= Development =<br />
<br />
SimpleITK has moved to a [https://github.com/SimpleITK/SimpleITK Github] based work flow for issues tracking and contribution.<br />
<br />
<br />
SimpleITK utilizes an additional "next" branch to merge and test changes before merging into the master branch. This makes our "master" branch more stable and reliable. This follows the CMake development process:<br />
<br />
* [http://www.cmake.org/Wiki/CMake/Git/Develop CMake Development Process ]<br />
<br />
<br />
== Source Code Repository ==<br />
<br />
SimpleITK uses git as the revision control system. The official repository is hosted along side ITK as http://itk.org/SimpleITK.git [http://public.kitware.com/gitweb?p=SimpleITK.git]. It is also mirrored on [https://github.com/SimpleITK/SimpleITK Github ].<br />
<br />
Development is currently following the branchy workflow with the Kitware stage repository. This workflow is described here:<br />
*http://public.kitware.com/Wiki/Git/Workflow/Stage<br />
*http://public.kitware.com/Wiki/Git/Workflow/Topic<br />
<br />
Contributions from github will be pushed to the stage repo and merged into the next branch by a SimpleITK developer.<br />
<br />
== [[SimpleITK/Design_And_Proposals | Design And Proposals]] ==</div>Blowekamphttps://public.kitware.com/Wiki/index.php?title=SimpleITK&diff=61635SimpleITK2017-04-11T16:00:28Z<p>Blowekamp: /* Issue Tracking And Feature Requests */</p>
<hr />
<div>[[Image: SimpleITK-SquareTransparentLogo.png|center]]<br />
<br />
=Overview=<br />
<br />
Welcome to the National Library of Medicine Insight Segmentation and Registration Toolkit (ITK). [http://www.itk.org/ ITK] is an open-source, cross-platform system that provides developers with an extensive suite of software tools for image analysis. Among them, SimpleITK is a simplified layer built on top of ITK, intended to facilitate its use in rapid prototyping, education, interpreted languages. SimpleITK has the following main characteristics:<br />
<br />
* C++ library with wrappers for Python, Java, CSharp, R, Tcl and Ruby<br />
* Object-oriented<br />
* Provides a simplified, easy-to-use, procedural interface without templates<br />
* Is distributed under an open source Apache 2.0 License<br />
* Binary distributions for Python, Java and CSharp<br />
<br />
SimpleITK captures many of features available in ITK, and is under ongoing development. Earlier in the development process a set of [[SimpleITK/Goals|Specific Goals]] were outlined.<br />
<br />
= Getting Started =<br />
<br />
* [[SimpleITK/GettingStarted|Getting Started For Users]]<br />
** [[SimpleITK/GettingStarted#Binaries|downloading the binaries]]<br />
** [[SimpleITK/GettingStarted#Build_It_Yourself|build the code yourself]]<br />
** [[SimpleITK/GettingStarted#Recommended_Software|additional software]] which is useful with SimpleITK<br />
* [[SimpleITK/GettingStarted/Visual_guide_to_building_on_Linux|A Visual Guide to Building SimpleITK on Linux]]<br />
* [[SimpleITK/GettingStarted/A_visual_guide_to_SimpleITK_in_Java|A Visual Guide to SimpleITK with Java and Eclipse]]<br />
* [[SimpleITK/GettingStarted/A_visual_guide_to_SimpleITK_with_CSharp|A Visual Guide to SimpleITK with CSharp on Microsoft Visual Studio]]<br />
<br />
== Download ==<br />
<br />
SimpleITK currently provides binary distribution for Python, CSharp and Java language bindings. <br />
You can download the [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.10.0/ 0.10.0 release from SourceForge].<br />
<br />
= Documentation =<br />
<br />
* [[SimpleITK/FAQ|Frequently Asked Questions (FAQ)]]<br />
<br />
== API ==<br />
<br />
* Nightly generated [https://www.itk.org/SimpleITKDoxygen/html/ Doxygen].<br />
* Release 1.0 [https://www.itk.org/SimpleITKDoxygen100/html/index.html Doxygen].<br />
* Release 0.10 [https://www.itk.org/SimpleITKDoxygen010/html/index.html Doxygen].<br />
* Release 0.9 [https://www.itk.org/SimpleITKDoxygen09/html/index.html Doxygen].<br />
* Release 0.8 [https://www.itk.org/SimpleITKDoxygen08/html/index.html Doxygen].<br />
* Release 0.7 [https://www.itk.org/SimpleITKDoxygen07/html/index.html Doxygen].<br />
* Release 0.6.1 [https://www.itk.org/SimpleITKDoxygen06/html/ Doxygen].<br />
<br />
== Short Examples ==<br />
<br />
Concise [https://itk.org/SimpleITKDoxygen/html/examples.html examples] illustrating the usage of various SimpleITK features. Examples are written in a variety of languages including Python, R, C++, Java...<br />
<br />
== SimpleITK Notebooks ==<br />
<br />
The SimpleITK Notebooks are examples and tutorials on how to use SimpleITK utilizing Jupyter Notebooks. This approach allows the user to create, edit and re-run scripts and view the results all within a web interface. The authoritative description of what Jupyter Notebooks are can be found on the [http://jupyter.org/ Jupyter website]. While SimpleITK supports a number of programming languages, the majority of notebooks are written in Python and some in R.<br />
<br />
The main notebook repository is available on [https://github.com/InsightSoftwareConsortium/SimpleITK-Notebooks github].<br />
<br />
Additional repositories containing tutorial specific notebooks are listed in the [http://www.itk.org/Wiki/SimpleITK#SimpleITK_Tutorials Tutorials section] below.<br />
<br />
== Publications ==<br />
<br />
More information about SimpleITK can be found in the following publication:<br />
<br />
* Lowekamp BC, Chen DT, Ibáñez L and Blezek D (2013) [http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3874546/pdf/fninf-07-00045.pdf The Design of SimpleITK]. Front. Neuroinform. 7:45. doi: 10.3389/fninf.2013.00045<br />
<br />
Please cite SimpleITK and ITK when publishing work where it made a significant contribution.<br />
<br />
== SimpleITK Tutorials ==<br />
<br />
=== Upcoming ===<br />
<br />
* none<br />
<br />
=== Past ===<br />
* The International Symposium on Biomedical Imaging (ISBI) 2016, Prague, Czech republic: [http://biomedicalimaging.org/2016/?page_id=572 SimpleITK: An Interactive, Python-Based Introduction to SimpleITK with the Insight Segmentation and Registration Toolkit (ITK)]<br />
* SPIE Medical Imaging 2016, San Diego, USA: ITK in Biomedical Research and Commercial Applications<br />
: Tutorial material: [https://github.com/InsightSoftwareConsortium/SimpleITKTutorialSPIE2016 git repository] [https://hdl.handle.net/10380/3542 additional presentations] .<br />
* Medical Image Computing and Computer Assisted Intervention (MICCAI) 2015, Munich, Germany: a Python based tutorial on the use of the [[SimpleITK/Tutorials/MICCAI2015 | ITKv4 registration framework via SimpleITK]].<br />
: Tutorial material: [https://github.com/InsightSoftwareConsortium/SimpleITKTutorialMICCAI2015.git git repository].<br />
* ImageJ User & Developer Conference 2015, Madison, WI, USA: [http://imagej.net/Conference_2015_Program#Matt_McCormick_-_SimpleITK an introductory tutorial] in Python. <br />
: Tutorial material: [https://github.com/InsightSoftwareConsortium/SimpleITKWorkshopImageJ2015 git repository]. <br />
* Medical Image Computing and Computer Assisted Intervention (MICCAI) 2011, Toronto, Canada: a general [[ITK_Release_4/Outreach/Conferences/MICCAI 2011/SimpleITK|tutorial on SimpleITK]]. <br />
: Tutorial material: [https://github.com/SimpleITK/SimpleITK-MICCAI-2011-Tutorial/blob/master/Presentation/SimpleITK-MICCAI-2011.pdf?raw=true PDF of presentation], [http://midas.kitware.com/collection/view/175 virtual machine], and [https://github.com/SimpleITK/SimpleITK-MICCAI-2011-Tutorial git repository].<br />
<br />
== Community Blogs ==<br />
<br />
These are blog entries written by people who are not necessarily directly involved with SimpleITK. If you want us to link to your SimpleITK blog entry just let us know on the mailing list (community@itk.org). <br />
<br />
* General introduction of SimpleITK on the [http://news.iscas.co/simpleitk-a-simplified-multi-language-interface-to-the-insight-segmentation-and-registration-toolkit/ International Society for Computer Aided Surgery blog], 1 March 2017.<br />
* [http://zarquon42b.github.io/2015/05/22/SimpleITKandR/ SimpleITK and R], 22 May 2015.<br />
* [http://kevin-keraudren.blogspot.com/2014/12/medical-image-analysis-ipython-tutorials.html Medical Image Analysis Course], 20 December 2014.<br />
* [https://pyscience.wordpress.com/tag/simpleitk Image Segmentation with Python and SimpleITK], October/November 2014.<br />
<br />
=Support=<br />
<br />
SimpleITK is supported through the ITK community and the active developers. In addition to the resources listed above in the documentation section, the [http://www.itk.org/ITK/help/mailing.html ITK mailing lists] can be used to asked questions and obtain additional help.<br />
<br />
== Issue Tracking And Feature Requests ==<br />
<br />
We are currently using the [https://github.com/SimpleITK/SimpleITK/issues github issue tracker]. Before switching to github issue tracking we used an instance of the<br />
[https://itk.icts.uiowa.edu/jira/browse/SIMPLEITK Legacy Jira Issue Tracker ] hosted by the University of Iowa.<br />
<br />
== Releases ==<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=refs/tags/v1.0.0 v1.0.0] [https://github.com/SimpleITK/SimpleITK/releases/tag/v1.0.0 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/1.0.0 Downloads] [https://www.itk.org/SimpleITKDoxygen100/html/index.html Doxygen]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=4a3376df08f27162b4d2a90e4a0452a839ab3124 v0.10.0] [https://github.com/SimpleITK/SimpleITK/releases/tag/v0.10.0 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.10.0 Downloads] [https://www.itk.org/SimpleITKDoxygen010/html/index.html Doxygen]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=ec033f0be4f67b2e21483ed9bc3698f07dba9d06 v0.9.1] [https://github.com/SimpleITK/SimpleITK/releases/tag/v0.9.1 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.9.1 Downloads] <br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=7f06e9fc7f3cda9c47e8b7d6d37885b1f425ea3b v0.9.0] [https://github.com/SimpleITK/SimpleITK/releases/tag/v0.9.0 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.9.0 Downloads] [https://www.itk.org/SimpleITKDoxygen09/html/index.html Doxygen]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=d0a90983877b46631e69a398bd8341889912c8c2 v0.8.1] [https://github.com/SimpleITK/SimpleITK/releases/tag/v0.8.1 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.8.1/ Downloads] [https://www.itk.org/SimpleITKDoxygen08/html/index.html Doxygen]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=11bff587f8a930bbca02813595aa3d08388af979 v0.8.0] [https://github.com/SimpleITK/SimpleITK/releases/tag/v0.8.0 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.8.0/ Downloads] <br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=commit;h=a2b29110771a1eb0b09d18ff8e98a784dc6e6451 v0.7.1] [https://github.com/SimpleITK/SimpleITK/releases/tag/v0.7.1 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.7.1/ Downloads]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=6fecf5ae5859295082b9016c97bf4bd68a961a62 v0.7.0] [https://github.com/SimpleITK/SimpleITK/releases/tag/v0.7.0 Release Notes] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.7.0/ Downloads] [https://www.itk.org/SimpleITKDoxygen07/html/index.html Doxygen]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=fc17df598cac97d344c875fed117f03ae7d1aacd v0.6.1] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.6.1/ Downloads] [http://www.itk.org/SimpleITKDoxygen06/html/index.html Doxygen]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=c055ef4e4cd2802c56e169084d9dd1bc655b4e93 v0.6.0] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.6.0/ Downloads] <br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=41fbb6d69f88fa1c8ab3b9d710b7ae57bb975721 v0.5.1] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.5.1/ Downloads]<br />
* [https://itk.org/gitweb?p=SimpleITK.git;a=tag;h=35ccfd2b99b4b5675d4d0894bb870574396408b6 v0.5.0] [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.5.0/ Downloads]<br />
<br />
= Development =<br />
<br />
SimpleITK has moved to a [https://github.com/SimpleITK/SimpleITK Github] based work flow for issues tracking and contribution.<br />
<br />
<br />
SimpleITK utilizes an additional "next" branch to merge and test changes before merging into the master branch. This makes our "master" branch more stable and reliable. This follows the CMake development process:<br />
<br />
* [http://www.cmake.org/Wiki/CMake/Git/Develop CMake Development Process ]<br />
<br />
<br />
== Source Code Repository ==<br />
<br />
SimpleITK uses git as the revision control system. The official repository is hosted along side ITK as http://itk.org/SimpleITK.git [http://public.kitware.com/gitweb?p=SimpleITK.git]. It is also mirrored on [https://github.com/SimpleITK/SimpleITK Github ].<br />
<br />
Development is currently following the branchy workflow with the Kitware stage repository. This workflow is described here:<br />
*http://public.kitware.com/Wiki/Git/Workflow/Stage<br />
*http://public.kitware.com/Wiki/Git/Workflow/Topic<br />
<br />
Contributions from github will be pushed to the stage repo and merged into the next branch by a SimpleITK developer.<br />
<br />
== [[SimpleITK/Design_And_Proposals | Design And Proposals]] ==</div>Blowekamphttps://public.kitware.com/Wiki/index.php?title=SimpleITK/GettingStarted&diff=61634SimpleITK/GettingStarted2017-04-11T15:58:50Z<p>Blowekamp: /* Testing */</p>
<hr />
<div>[[Image: SimpleITK-SquareTransparentLogo.png|center]]<br />
<br />
SimpleITK provides a simplified interface to ITK in a variety of languages. You can either download binaries, if they are available for your platform and prefered language, or you can build SimpleITK yourself.<br />
<br />
Additionally, there are several recommended third-party software packages.<br />
<br />
After you have installed SimpleITK, please look to the [[ITK_Release_4/Outreach/Conferences/MICCAI 2011/SimpleITK|Tutorial]] or the [http://www.itk.org/SimpleITKDoxygen/html/ Doxygen] pages for more information.<br />
<br />
=Downloading the binaries=<br />
<br />
One of the great advantages of SimpleITK is that (typically) you do not have to build it — you can simply download the binaries and get started right away!<br />
<br />
Currently, '''Python''' binaries are available on Microsoft Windows, GNU Linux and Apple OS X. '''C# and Java''' binaries are available for Windows. We are also working towards supporting '''R''' packaging.<br />
<br />
==Python binary files==<br />
<br />
There are currently two Python binary package choices: Python Wheels, and Anaconda packages for the Anaconda Python distribution.<br />
<br />
==== Use a Virtual Environment ====<br />
<br />
Before you install SimpleITK we <b>highly recommend</b> that you create a virtual environment into which you install the package. Note that different Python versions and distributions have different programs for creating and managing virtual environments. <br />
<br />
The use of a virtual environment allows you to elegantly deal with package compatability issues, to quote [http://docs.python-guide.org/en/latest/ The Hitchhiker’s Guide to Python!]:<br />
<blockquote>A Virtual Environment is a tool to keep the dependencies required by different projects in separate places, by creating virtual Python environments for them. It solves the “Project X depends on version 1.x but, Project Y needs 4.x” dilemma, and keeps your global site-packages directory clean and manageable.</blockquote><br />
<br />
Programs for creating virtual environments include [https://packaging.python.org/en/latest/installing/#creating-virtual-environments virtualenv and pyvenv] for generic Python distributions, [http://conda.pydata.org/docs/using/envs.html conda] for the anaconda distribution, and [http://docs.enthought.com/canopy/configure/canopy-cli.html canopy_cli] for the canopy distribution.<br />
<br />
=== Wheels for Generic Python Distribution ===<br />
<br />
If you are working with the [https://www.python.org/ generic Python distribution] you can install a Wheel with the lasted version of pip (>=9.0).<br />
<br />
First thing you should do is create a virtual environment (virtualenv or pyvenv tools) and activate it.<br />
<br />
<u>Note</u>: you can always manually download the wheels for your operating system and Python version directly from [http://sourceforge.net/projects/simpleitk/files/SimpleITK/ sourceforge].<br />
<br />
<br />
From the command line use the [https://pip.pypa.io/en/latest/index.html pip program] to install:<br />
<br />
$ pip install SimpleITK<br />
<br />
The pip package manager should automatically find the correct package for Microsoft Windows, Apple OS X and GNU Linux if your version and architecture are supported. If no binary package is found, then a source distribution will be downloaded and attempted to be compiled and you should look into [[#Build_It_Yourself]].<br />
<br />
:: If your pip version in the virtual environment is stale (<9.0) you need to update it (pip install -U pip).<br />
<br />
=== Anaconda Distribution ===<br />
<br />
First thing you should do is create a virtual environment ([https://conda.pydata.org/docs/using/envs.html conda] tool) and activate it.<br />
<br />
Currently there are compiled binaries on [https://conda.anaconda.org/simpleitk Anaconda Cloud], easily installed with:<br />
<br />
$ conda install -c <nowiki>https://conda.anaconda.org/simpleitk</nowiki> SimpleITK<br />
<br />
Beta and release candidate packages are also available on Anaconda cloud under the dev label:<br />
<br />
$conda install -c <nowiki>https://conda.anaconda.org/simpleitk/label/dev</nowiki> SimpleITK<br />
<br />
=== Enthought Canopy Distribution ===<br />
<br />
First thing you should do is create a virtual environment (canopy_cli tool) and activate it.<br />
<br />
Currently there are no binaries supported with this distribution. You will need to compile SimpleITK yourself. (Using pip installation may work.)<br />
<br />
==C# binary files==<br />
<br />
'''Binaries for select C# platform''' can be found on [https://sourceforge.net/projects/simpleitk/files/SimpleITK/1.0.0/CSharp/ SimpleITK's SourceForge page]. Installing the library should only involve importing the unzipped files into you C# environment. The files have the following naming convention:<br />
SimpleITK-version-CSharp-buildplatform-targetplatform.zip<br />
eg.<br />
SimpleITK-1.0.0-CSharp-win32-x86.zip<br />
SimpleITK-1.0.0-CSharp-win64-x64.zip<br />
<br />
Details about how to set up a C# Visual Studio project with SimpleITK can be found in the [[SimpleITK/GettingStarted/A_visual_guide_to_SimpleITK_with_CSharp|Visual Guide to SimpleITK with CSharp]].<br />
<br />
More information about getting started with a sample C# program can be found in [[SimpleITK/GettingStarted/Visual_guide_to_building_on_Linux#A_simple_C.23_program| A visual guide to building SimpleITK on Linux]]<br />
<br />
==Java binary files==<br />
<br />
'''Binaries for select Java platforms''' can be found on [https://sourceforge.net/projects/simpleitk/files/SimpleITK/1.0.0/Java/ SimpleITK's SourceForge page]. Installation instructions are available at [[SimpleITK/GettingStarted/A visual guide to SimpleITK in Java|a visual guide to SimpleITK in Java]].<br />
<br />
==Nightly binaries==<br />
<br />
The '''latest binaries''' for the current development version of SimpleITK are also generally available. Binary packages are built as part of the nightly regression testing system. The download links are available from the [https://open.cdash.org/index.php?project=SimpleITK '''CDash'''] '''dashboard''' in the "Nightly Packages" section. <br />
<br />
Each row on the dashboard is a SimpleITK build on a particular system, and if the build was successful there will be a '''package icon''': https://open.cdash.org/img/package.png which links to the packages build by the system. A user may directly download the built package from such a link.<br />
<br />
=Build It Yourself=<br />
<br />
In many cases a user does not need to build SimpleITK because of the pre-built binaries available (see [[SimpleITK/GettingStarted#Binaries|above]]). However there are several reasons a user might prefer to '''build SimpleITK from source''':<br />
* The binary files for your programming language of choice are not (yet) distributed<br />
* You want the live on the bleeding edge by using the latest-and-greatest version of SimpleITK<br />
* You want to wrap your own filters using the SimpleITK infrastructure<br />
* You want to contribute to the development of SimpleITK<br />
* To use the SimpleITK's C++ interface and/or use ITK directly<br />
<br />
=== Prerequisites ===<br />
To build SimpleITK you need:<br />
* A recent version of [http://www.cmake.org/ CMake] >= 3.3 with SSL support for https.<br />
* A supported [[SimpleITK/FAQ#Is_my_compiler_supported.3F|compiler]]<br />
* To use the latest developmental version, source code can be downloaded with [http://git-scm.com/ git] >= 1.65<br />
** Git is required if building SimpleITK using "SuperBuild" (see below) to automatically download the matching version of ITK, SWIG, etc...<br />
** Windows users may prefer [http://msysgit.github.com/ msysGit]<br />
* It is recommended to have numpy installed when testing Python bindings<br />
<br />
=== Recipes / Formulas / Short Cuts ===<br />
<br />
For some environments we have short cuts, scripts, for automated building of SimpleITK (see their repository for more details):<br />
<br />
* For '''Python''': The [https://github.com/scikit-build/scikit-build scikit-build] based distutils based [https://github.com/scikit-build/scikit-build setup.py frontend] can be used to build, install, and package SimpleITK for Python.<br />
<br />
* For the '''Anaconda Python''' distribution: The recipe and instructions for the SimpleITK build are in [https://github.com/SimpleITK/SimpleITKCondaRecipe this GitHub repository]. <br />
<br />
* For the '''R language''': A devtools installer and instructions are available from [https://github.com/SimpleITK/SimpleITKRInstaller this GitHub repository]. <br />
<br />
* '''On the Mac''', with the [http://brew.sh/ Homebrew package manager], a SimpleITK formula is available: https://github.com/Homebrew/homebrew-science/blob/master/simpleitk.rb for multiple language wrappings.<br />
<br />
* For the '''Lua language''' with the Luarocks module deployment system, a SimpleITK rockspec is available form [https://github.com/SimpleITK/SimpleITKLuaRock this GitHub repository].<br />
<br />
=== Source code ===<br />
<br />
If one of the above language specific front-ends are not used then SimpleITK must be build directly.<br />
<br />
There are two options to obtain the SimpleITK source code:<br />
# Download a released version from the SimpleITK [https://sourceforge.net/projects/simpleitk/ SourceForge] page<br />
# Download the latest development version using git<br />
git clone http://itk.org/SimpleITK.git<br />
<br />
=== Building using SuperBuild ===<br />
After downloading SimpleITK's source code we '''STRONGLY''' recommend to run cmake on the SuperBuild subdirectory of SimpleITK. Execute the following commands in the parent of the SimpleITK source directory to configure the SuperBuild:<br />
mkdir SimpleITK-build<br />
cd SimpleITK-build<br />
cmake ../SimpleITK/SuperBuild<br />
<br />
The SuperBuild will automatically download and build the matching version of ITK and SWIG needed to compile SimpleITK. Additionally, it will set recommended compilation flags to minimize the size of the library and enable support for large libraries. This is the recommended way to build SimpleITK and is easiest.<br />
<br />
If you get an error message saying that ITK_DIR is not set then, you did not correctly point cmake to the SuperBuild sub-directory. Please erase your binary directory, and point cmake to the SimpleITK/SuperBuild sub-directory.<br />
<br />
The cmake configuration process should automatically find supported languages and enable SimpleITK wrapping for them. To manually enable a language toggle the appropriate WRAP_LANGUAGE cmake variable to ON. Verify and/or correct the advanced cmake variables to the language specific executable, libraries and include directories. For example if you have multiple Python installations ensure that all related Python variable refer to the same versions.<br />
<br />
Then use your make utility or your cmake chosen build utility to build SimpleITK.<br />
<br />
SimpleITK takes a while to build. Some tips and tricks to speed up development time are listed [http://www.itk.org/SimpleITKDoxygen/html/Developer.html#TandT here].<br />
<br />
=== Building Manually ===<br />
This is '''not''' the recommended way of building SimpleITK, but it can be useful if you want to use a system version of ITK, etc. , or if you do not want to (or can not) use git.<br />
<br />
# Setup the prerequisites as described above (i.e. CMake and supported compiler)<br />
# Install the matching version of [http://www.swig.org/ SWIG] >= 3.0.11<br />
#* e.g. Windows users may install [http://prdownloads.sourceforge.net/swig/swigwin-3.0.11.zip swigwin-3.0.11]<br />
# Download the SimpleITK source code from the [https://sourceforge.net/projects/simpleitk/files/SimpleITK/ SourceForge] page<br />
# Download the matching version of ITK, found by examining the `SuperBuild/External_ITK.cmake` file.<br />
# Configure ITK using CMake<br />
#* e.g. BUILD_EXAMPLES=OFF, BUILD_TESTING=OFF, BUILD_SHARED_LIBS=OFF, '''ITK_USE_REVIEW=ON'''<br />
# Build ITK<br />
#* Be sure to note the build settings e.g. Release x64<br />
# Configure SimpleITK using CMake<br />
#* Set ITK_DIR to the location of the ITK build location from the previous steps<br />
# Build SimpleITK<br />
#* Be sure to configure the build settings exactly the same as ITK e.g. Release x64 and CXX_FLAGS<br />
<br />
=== Advanced Build Options ===<br />
<br />
SimpleITK is aware of the enabled and disabled ITK Modules. It is possible to customize SimpleITK by disabling unneeded ITK modules or to extend SimpleITK by writing custom json file dependent an ITK Remote Modules being enabled.<br />
<br />
Additionally, each of the Examples directory, and each of the Wrapping subdirectories can be configured as independent CMake project dependent on an installed SimpleITK.<br />
<br />
===[[SimpleITK/GettingStarted/Visual_guide_to_building_on_Linux|A visual guide to building SimpleITK on Linux]]===<br />
<br />
==Testing==<br />
<br />
After compilation the prudent thing to due is to test SimpleITK to ensure your build is stable and suitable for installation and use. The following commands execute the SimpleITK tests.<br />
<br />
cd SimpleITK-build/SimpleITK-build<br />
ctest<br />
<br />
On Windows you will need to specify configuration. Typically that would be the Release configuration, as such:<br />
cd SimpleITK-build/SimpleITK-build<br />
ctest -C Release<br />
<br />
==Python installation==<br />
<br />
To install a built python package into the system Python, as root run:<br />
cd SimpleITK-build/Wrapping/Python<br />
python Packaging/setup.py install<br />
<br />
Alternatively, a Python virtual environment can be created and the distribution installed there.<br />
<br />
If you build the "dist" target a Python Wheel file (.whl) will be created in the "Wrapping/Python/dist" directory.<br />
<br />
==R installation==<br />
<br />
To install a built R package:<br />
<br />
cd SimpleITK-build/Wrapping/R/Packaging<br />
R CMD INSTALL SimpleITK<br />
<br />
This will install the R package "SimpleITK" in /usr/local as root or your local R installation directory.<br />
<br />
<br />
If you are working in a multi-user environment, and are considerate of your fellow users you can install the package in a local directory:<br />
<br />
<ol> <li> Create a local directory where you will install your R packages</li></ol><br />
mkdir my_R_libs<br />
<ol start="2"> <li> Add an environment variable to your .bashrc</li></ol> <br />
export R_LIBS="/path_to/my_R_libs"<br />
<ol start="3"> <li> source your .bashrc and check the R library path, in an R shell >.libPaths()</li></ol><br />
<ol start="4"> <li>install </li></ol><br />
<br />
cd SimpleITK-build/Wrapping/R/Packaging<br />
R CMD INSTALL -l /path_to/my_R_libs SimpleITK<br />
<br />
=Recommended Software=<br />
<br />
== Fiji (Fiji is Just ImageJ) ==<br />
<br />
SimpleITK has a built in function, [https://itk.org/SimpleITKDoxygen/html/namespaceitk_1_1simple.html#ac8416e6e7f02dedfe8373b83dbea411d '''"itk::simple::Show()"'''], which can be used for viewing images in an interactive session. Currently, this function by default Show invokes [https://fiji.sc '''Fiji'''] then [http://rsbweb.nih.gov/ij/ '''ImageJ'''] to display images. ImageJ was chosen because it can handle all the image types that SimpleITK supports, even 3D vector images with n components. <br />
<br />
The Show function first searches the "PATH" environment variable, then additional standard locations are examined, if problems are encountered the correct path can be added to this environment variable and the '''"debugOn'''" option to '''"Show'''" flag set.<br />
<br />
====ImageJ====<br />
<br />
If ImageJ is used then we recommend downloading a recent version of [http://rsbweb.nih.gov/ij/download.html ImageJ] from the official home page. Recent versions come with support for the [http://nifti.nimh.nih.gov/nifti-1/ Nifti] ( *.nii ) file format, which SimpleITK uses to export to ImageJ. <br />
<br />
'''Note:''' '''Linux installation''' requires an additional step. The '''"Show'''" function searches for an executable named ImageJ or imagej, however the default tarball does not come with this file. Instead it comes with a file names [http://imagej.nih.gov/ij/download/linux/unix-script.txt script]. This file contains the installation instructions. In short the file should be renamed to "imagej" and the site specific variables for the installation location, and java must be set. Also consider the "newwindow" variable... Do you really want a new instance of ImageJ launched each time you use Show? Lastly, as the installation instructions indicate, the imagej wrapper should be in your path.<br />
<br />
==iPython and Jupyter==<br />
<br />
If you are using python, [http://ipython.org/ '''ipython'''] with [http://jupyter.org Jupyter] is terrific environment to perform interactive computing for image processing. With the addition of numpy and scipy, you'll have a powerful interactive environment.<br />
<br />
We have instructional [http://insightsoftwareconsortium.github.io/SimpleITK-Notebooks/ SimpleITK Jupyter Notebooks] which can help you get started.</div>Blowekamphttps://public.kitware.com/Wiki/index.php?title=SimpleITK/GettingStarted&diff=61633SimpleITK/GettingStarted2017-04-11T15:56:52Z<p>Blowekamp: /* Building manually */</p>
<hr />
<div>[[Image: SimpleITK-SquareTransparentLogo.png|center]]<br />
<br />
SimpleITK provides a simplified interface to ITK in a variety of languages. You can either download binaries, if they are available for your platform and prefered language, or you can build SimpleITK yourself.<br />
<br />
Additionally, there are several recommended third-party software packages.<br />
<br />
After you have installed SimpleITK, please look to the [[ITK_Release_4/Outreach/Conferences/MICCAI 2011/SimpleITK|Tutorial]] or the [http://www.itk.org/SimpleITKDoxygen/html/ Doxygen] pages for more information.<br />
<br />
=Downloading the binaries=<br />
<br />
One of the great advantages of SimpleITK is that (typically) you do not have to build it — you can simply download the binaries and get started right away!<br />
<br />
Currently, '''Python''' binaries are available on Microsoft Windows, GNU Linux and Apple OS X. '''C# and Java''' binaries are available for Windows. We are also working towards supporting '''R''' packaging.<br />
<br />
==Python binary files==<br />
<br />
There are currently two Python binary package choices: Python Wheels, and Anaconda packages for the Anaconda Python distribution.<br />
<br />
==== Use a Virtual Environment ====<br />
<br />
Before you install SimpleITK we <b>highly recommend</b> that you create a virtual environment into which you install the package. Note that different Python versions and distributions have different programs for creating and managing virtual environments. <br />
<br />
The use of a virtual environment allows you to elegantly deal with package compatability issues, to quote [http://docs.python-guide.org/en/latest/ The Hitchhiker’s Guide to Python!]:<br />
<blockquote>A Virtual Environment is a tool to keep the dependencies required by different projects in separate places, by creating virtual Python environments for them. It solves the “Project X depends on version 1.x but, Project Y needs 4.x” dilemma, and keeps your global site-packages directory clean and manageable.</blockquote><br />
<br />
Programs for creating virtual environments include [https://packaging.python.org/en/latest/installing/#creating-virtual-environments virtualenv and pyvenv] for generic Python distributions, [http://conda.pydata.org/docs/using/envs.html conda] for the anaconda distribution, and [http://docs.enthought.com/canopy/configure/canopy-cli.html canopy_cli] for the canopy distribution.<br />
<br />
=== Wheels for Generic Python Distribution ===<br />
<br />
If you are working with the [https://www.python.org/ generic Python distribution] you can install a Wheel with the lasted version of pip (>=9.0).<br />
<br />
First thing you should do is create a virtual environment (virtualenv or pyvenv tools) and activate it.<br />
<br />
<u>Note</u>: you can always manually download the wheels for your operating system and Python version directly from [http://sourceforge.net/projects/simpleitk/files/SimpleITK/ sourceforge].<br />
<br />
<br />
From the command line use the [https://pip.pypa.io/en/latest/index.html pip program] to install:<br />
<br />
$ pip install SimpleITK<br />
<br />
The pip package manager should automatically find the correct package for Microsoft Windows, Apple OS X and GNU Linux if your version and architecture are supported. If no binary package is found, then a source distribution will be downloaded and attempted to be compiled and you should look into [[#Build_It_Yourself]].<br />
<br />
:: If your pip version in the virtual environment is stale (<9.0) you need to update it (pip install -U pip).<br />
<br />
=== Anaconda Distribution ===<br />
<br />
First thing you should do is create a virtual environment ([https://conda.pydata.org/docs/using/envs.html conda] tool) and activate it.<br />
<br />
Currently there are compiled binaries on [https://conda.anaconda.org/simpleitk Anaconda Cloud], easily installed with:<br />
<br />
$ conda install -c <nowiki>https://conda.anaconda.org/simpleitk</nowiki> SimpleITK<br />
<br />
Beta and release candidate packages are also available on Anaconda cloud under the dev label:<br />
<br />
$conda install -c <nowiki>https://conda.anaconda.org/simpleitk/label/dev</nowiki> SimpleITK<br />
<br />
=== Enthought Canopy Distribution ===<br />
<br />
First thing you should do is create a virtual environment (canopy_cli tool) and activate it.<br />
<br />
Currently there are no binaries supported with this distribution. You will need to compile SimpleITK yourself. (Using pip installation may work.)<br />
<br />
==C# binary files==<br />
<br />
'''Binaries for select C# platform''' can be found on [https://sourceforge.net/projects/simpleitk/files/SimpleITK/1.0.0/CSharp/ SimpleITK's SourceForge page]. Installing the library should only involve importing the unzipped files into you C# environment. The files have the following naming convention:<br />
SimpleITK-version-CSharp-buildplatform-targetplatform.zip<br />
eg.<br />
SimpleITK-1.0.0-CSharp-win32-x86.zip<br />
SimpleITK-1.0.0-CSharp-win64-x64.zip<br />
<br />
Details about how to set up a C# Visual Studio project with SimpleITK can be found in the [[SimpleITK/GettingStarted/A_visual_guide_to_SimpleITK_with_CSharp|Visual Guide to SimpleITK with CSharp]].<br />
<br />
More information about getting started with a sample C# program can be found in [[SimpleITK/GettingStarted/Visual_guide_to_building_on_Linux#A_simple_C.23_program| A visual guide to building SimpleITK on Linux]]<br />
<br />
==Java binary files==<br />
<br />
'''Binaries for select Java platforms''' can be found on [https://sourceforge.net/projects/simpleitk/files/SimpleITK/1.0.0/Java/ SimpleITK's SourceForge page]. Installation instructions are available at [[SimpleITK/GettingStarted/A visual guide to SimpleITK in Java|a visual guide to SimpleITK in Java]].<br />
<br />
==Nightly binaries==<br />
<br />
The '''latest binaries''' for the current development version of SimpleITK are also generally available. Binary packages are built as part of the nightly regression testing system. The download links are available from the [https://open.cdash.org/index.php?project=SimpleITK '''CDash'''] '''dashboard''' in the "Nightly Packages" section. <br />
<br />
Each row on the dashboard is a SimpleITK build on a particular system, and if the build was successful there will be a '''package icon''': https://open.cdash.org/img/package.png which links to the packages build by the system. A user may directly download the built package from such a link.<br />
<br />
=Build It Yourself=<br />
<br />
In many cases a user does not need to build SimpleITK because of the pre-built binaries available (see [[SimpleITK/GettingStarted#Binaries|above]]). However there are several reasons a user might prefer to '''build SimpleITK from source''':<br />
* The binary files for your programming language of choice are not (yet) distributed<br />
* You want the live on the bleeding edge by using the latest-and-greatest version of SimpleITK<br />
* You want to wrap your own filters using the SimpleITK infrastructure<br />
* You want to contribute to the development of SimpleITK<br />
* To use the SimpleITK's C++ interface and/or use ITK directly<br />
<br />
=== Prerequisites ===<br />
To build SimpleITK you need:<br />
* A recent version of [http://www.cmake.org/ CMake] >= 3.3 with SSL support for https.<br />
* A supported [[SimpleITK/FAQ#Is_my_compiler_supported.3F|compiler]]<br />
* To use the latest developmental version, source code can be downloaded with [http://git-scm.com/ git] >= 1.65<br />
** Git is required if building SimpleITK using "SuperBuild" (see below) to automatically download the matching version of ITK, SWIG, etc...<br />
** Windows users may prefer [http://msysgit.github.com/ msysGit]<br />
* It is recommended to have numpy installed when testing Python bindings<br />
<br />
=== Recipes / Formulas / Short Cuts ===<br />
<br />
For some environments we have short cuts, scripts, for automated building of SimpleITK (see their repository for more details):<br />
<br />
* For '''Python''': The [https://github.com/scikit-build/scikit-build scikit-build] based distutils based [https://github.com/scikit-build/scikit-build setup.py frontend] can be used to build, install, and package SimpleITK for Python.<br />
<br />
* For the '''Anaconda Python''' distribution: The recipe and instructions for the SimpleITK build are in [https://github.com/SimpleITK/SimpleITKCondaRecipe this GitHub repository]. <br />
<br />
* For the '''R language''': A devtools installer and instructions are available from [https://github.com/SimpleITK/SimpleITKRInstaller this GitHub repository]. <br />
<br />
* '''On the Mac''', with the [http://brew.sh/ Homebrew package manager], a SimpleITK formula is available: https://github.com/Homebrew/homebrew-science/blob/master/simpleitk.rb for multiple language wrappings.<br />
<br />
* For the '''Lua language''' with the Luarocks module deployment system, a SimpleITK rockspec is available form [https://github.com/SimpleITK/SimpleITKLuaRock this GitHub repository].<br />
<br />
=== Source code ===<br />
<br />
If one of the above language specific front-ends are not used then SimpleITK must be build directly.<br />
<br />
There are two options to obtain the SimpleITK source code:<br />
# Download a released version from the SimpleITK [https://sourceforge.net/projects/simpleitk/ SourceForge] page<br />
# Download the latest development version using git<br />
git clone http://itk.org/SimpleITK.git<br />
<br />
=== Building using SuperBuild ===<br />
After downloading SimpleITK's source code we '''STRONGLY''' recommend to run cmake on the SuperBuild subdirectory of SimpleITK. Execute the following commands in the parent of the SimpleITK source directory to configure the SuperBuild:<br />
mkdir SimpleITK-build<br />
cd SimpleITK-build<br />
cmake ../SimpleITK/SuperBuild<br />
<br />
The SuperBuild will automatically download and build the matching version of ITK and SWIG needed to compile SimpleITK. Additionally, it will set recommended compilation flags to minimize the size of the library and enable support for large libraries. This is the recommended way to build SimpleITK and is easiest.<br />
<br />
If you get an error message saying that ITK_DIR is not set then, you did not correctly point cmake to the SuperBuild sub-directory. Please erase your binary directory, and point cmake to the SimpleITK/SuperBuild sub-directory.<br />
<br />
The cmake configuration process should automatically find supported languages and enable SimpleITK wrapping for them. To manually enable a language toggle the appropriate WRAP_LANGUAGE cmake variable to ON. Verify and/or correct the advanced cmake variables to the language specific executable, libraries and include directories. For example if you have multiple Python installations ensure that all related Python variable refer to the same versions.<br />
<br />
Then use your make utility or your cmake chosen build utility to build SimpleITK.<br />
<br />
SimpleITK takes a while to build. Some tips and tricks to speed up development time are listed [http://www.itk.org/SimpleITKDoxygen/html/Developer.html#TandT here].<br />
<br />
=== Building Manually ===<br />
This is '''not''' the recommended way of building SimpleITK, but it can be useful if you want to use a system version of ITK, etc. , or if you do not want to (or can not) use git.<br />
<br />
# Setup the prerequisites as described above (i.e. CMake and supported compiler)<br />
# Install the matching version of [http://www.swig.org/ SWIG] >= 3.0.11<br />
#* e.g. Windows users may install [http://prdownloads.sourceforge.net/swig/swigwin-3.0.11.zip swigwin-3.0.11]<br />
# Download the SimpleITK source code from the [https://sourceforge.net/projects/simpleitk/files/SimpleITK/ SourceForge] page<br />
# Download the matching version of ITK, found by examining the `SuperBuild/External_ITK.cmake` file.<br />
# Configure ITK using CMake<br />
#* e.g. BUILD_EXAMPLES=OFF, BUILD_TESTING=OFF, BUILD_SHARED_LIBS=OFF, '''ITK_USE_REVIEW=ON'''<br />
# Build ITK<br />
#* Be sure to note the build settings e.g. Release x64<br />
# Configure SimpleITK using CMake<br />
#* Set ITK_DIR to the location of the ITK build location from the previous steps<br />
# Build SimpleITK<br />
#* Be sure to configure the build settings exactly the same as ITK e.g. Release x64 and CXX_FLAGS<br />
<br />
=== Advanced Build Options ===<br />
<br />
SimpleITK is aware of the enabled and disabled ITK Modules. It is possible to customize SimpleITK by disabling unneeded ITK modules or to extend SimpleITK by writing custom json file dependent an ITK Remote Modules being enabled.<br />
<br />
Additionally, each of the Examples directory, and each of the Wrapping subdirectories can be configured as independent CMake project dependent on an installed SimpleITK.<br />
<br />
===[[SimpleITK/GettingStarted/Visual_guide_to_building_on_Linux|A visual guide to building SimpleITK on Linux]]===<br />
<br />
==Testing==<br />
<br />
After compilation the prudent thing to due is to test SimpleITK to ensure your build is stable and suitable for use and installation. The following commands execute the SimpleITK tests.<br />
<br />
cd SimpleITK-build/SimpleITK-build<br />
ctest<br />
<br />
On Windows you will need to specify configuration. Typically that would be the Release configuration, as such:<br />
cd SimpleITK-build/SimpleITK-build<br />
ctest -C Release<br />
<br />
If all tests fail, verify that you have the testing data in your source tree (the reason for the "--recursive" flag in the git command) AND that you have added the correct path to your *_LIBRARY_PATH.<br />
<br />
==Python installation==<br />
<br />
To install a built python package into the system Python, as root run:<br />
cd SimpleITK-build/Wrapping/Python<br />
python Packaging/setup.py install<br />
<br />
Alternatively, a Python virtual environment can be created and the distribution installed there.<br />
<br />
If you build the "dist" target a Python Wheel file (.whl) will be created in the "Wrapping/Python/dist" directory.<br />
<br />
==R installation==<br />
<br />
To install a built R package:<br />
<br />
cd SimpleITK-build/Wrapping/R/Packaging<br />
R CMD INSTALL SimpleITK<br />
<br />
This will install the R package "SimpleITK" in /usr/local as root or your local R installation directory.<br />
<br />
<br />
If you are working in a multi-user environment, and are considerate of your fellow users you can install the package in a local directory:<br />
<br />
<ol> <li> Create a local directory where you will install your R packages</li></ol><br />
mkdir my_R_libs<br />
<ol start="2"> <li> Add an environment variable to your .bashrc</li></ol> <br />
export R_LIBS="/path_to/my_R_libs"<br />
<ol start="3"> <li> source your .bashrc and check the R library path, in an R shell >.libPaths()</li></ol><br />
<ol start="4"> <li>install </li></ol><br />
<br />
cd SimpleITK-build/Wrapping/R/Packaging<br />
R CMD INSTALL -l /path_to/my_R_libs SimpleITK<br />
<br />
=Recommended Software=<br />
<br />
== Fiji (Fiji is Just ImageJ) ==<br />
<br />
SimpleITK has a built in function, [https://itk.org/SimpleITKDoxygen/html/namespaceitk_1_1simple.html#ac8416e6e7f02dedfe8373b83dbea411d '''"itk::simple::Show()"'''], which can be used for viewing images in an interactive session. Currently, this function by default Show invokes [https://fiji.sc '''Fiji'''] then [http://rsbweb.nih.gov/ij/ '''ImageJ'''] to display images. ImageJ was chosen because it can handle all the image types that SimpleITK supports, even 3D vector images with n components. <br />
<br />
The Show function first searches the "PATH" environment variable, then additional standard locations are examined, if problems are encountered the correct path can be added to this environment variable and the '''"debugOn'''" option to '''"Show'''" flag set.<br />
<br />
====ImageJ====<br />
<br />
If ImageJ is used then we recommend downloading a recent version of [http://rsbweb.nih.gov/ij/download.html ImageJ] from the official home page. Recent versions come with support for the [http://nifti.nimh.nih.gov/nifti-1/ Nifti] ( *.nii ) file format, which SimpleITK uses to export to ImageJ. <br />
<br />
'''Note:''' '''Linux installation''' requires an additional step. The '''"Show'''" function searches for an executable named ImageJ or imagej, however the default tarball does not come with this file. Instead it comes with a file names [http://imagej.nih.gov/ij/download/linux/unix-script.txt script]. This file contains the installation instructions. In short the file should be renamed to "imagej" and the site specific variables for the installation location, and java must be set. Also consider the "newwindow" variable... Do you really want a new instance of ImageJ launched each time you use Show? Lastly, as the installation instructions indicate, the imagej wrapper should be in your path.<br />
<br />
==iPython and Jupyter==<br />
<br />
If you are using python, [http://ipython.org/ '''ipython'''] with [http://jupyter.org Jupyter] is terrific environment to perform interactive computing for image processing. With the addition of numpy and scipy, you'll have a powerful interactive environment.<br />
<br />
We have instructional [http://insightsoftwareconsortium.github.io/SimpleITK-Notebooks/ SimpleITK Jupyter Notebooks] which can help you get started.</div>Blowekamphttps://public.kitware.com/Wiki/index.php?title=SimpleITK/GettingStarted&diff=61632SimpleITK/GettingStarted2017-04-11T15:46:04Z<p>Blowekamp: /* Source code */</p>
<hr />
<div>[[Image: SimpleITK-SquareTransparentLogo.png|center]]<br />
<br />
SimpleITK provides a simplified interface to ITK in a variety of languages. You can either download binaries, if they are available for your platform and prefered language, or you can build SimpleITK yourself.<br />
<br />
Additionally, there are several recommended third-party software packages.<br />
<br />
After you have installed SimpleITK, please look to the [[ITK_Release_4/Outreach/Conferences/MICCAI 2011/SimpleITK|Tutorial]] or the [http://www.itk.org/SimpleITKDoxygen/html/ Doxygen] pages for more information.<br />
<br />
=Downloading the binaries=<br />
<br />
One of the great advantages of SimpleITK is that (typically) you do not have to build it — you can simply download the binaries and get started right away!<br />
<br />
Currently, '''Python''' binaries are available on Microsoft Windows, GNU Linux and Apple OS X. '''C# and Java''' binaries are available for Windows. We are also working towards supporting '''R''' packaging.<br />
<br />
==Python binary files==<br />
<br />
There are currently two Python binary package choices: Python Wheels, and Anaconda packages for the Anaconda Python distribution.<br />
<br />
==== Use a Virtual Environment ====<br />
<br />
Before you install SimpleITK we <b>highly recommend</b> that you create a virtual environment into which you install the package. Note that different Python versions and distributions have different programs for creating and managing virtual environments. <br />
<br />
The use of a virtual environment allows you to elegantly deal with package compatability issues, to quote [http://docs.python-guide.org/en/latest/ The Hitchhiker’s Guide to Python!]:<br />
<blockquote>A Virtual Environment is a tool to keep the dependencies required by different projects in separate places, by creating virtual Python environments for them. It solves the “Project X depends on version 1.x but, Project Y needs 4.x” dilemma, and keeps your global site-packages directory clean and manageable.</blockquote><br />
<br />
Programs for creating virtual environments include [https://packaging.python.org/en/latest/installing/#creating-virtual-environments virtualenv and pyvenv] for generic Python distributions, [http://conda.pydata.org/docs/using/envs.html conda] for the anaconda distribution, and [http://docs.enthought.com/canopy/configure/canopy-cli.html canopy_cli] for the canopy distribution.<br />
<br />
=== Wheels for Generic Python Distribution ===<br />
<br />
If you are working with the [https://www.python.org/ generic Python distribution] you can install a Wheel with the lasted version of pip (>=9.0).<br />
<br />
First thing you should do is create a virtual environment (virtualenv or pyvenv tools) and activate it.<br />
<br />
<u>Note</u>: you can always manually download the wheels for your operating system and Python version directly from [http://sourceforge.net/projects/simpleitk/files/SimpleITK/ sourceforge].<br />
<br />
<br />
From the command line use the [https://pip.pypa.io/en/latest/index.html pip program] to install:<br />
<br />
$ pip install SimpleITK<br />
<br />
The pip package manager should automatically find the correct package for Microsoft Windows, Apple OS X and GNU Linux if your version and architecture are supported. If no binary package is found, then a source distribution will be downloaded and attempted to be compiled and you should look into [[#Build_It_Yourself]].<br />
<br />
:: If your pip version in the virtual environment is stale (<9.0) you need to update it (pip install -U pip).<br />
<br />
=== Anaconda Distribution ===<br />
<br />
First thing you should do is create a virtual environment ([https://conda.pydata.org/docs/using/envs.html conda] tool) and activate it.<br />
<br />
Currently there are compiled binaries on [https://conda.anaconda.org/simpleitk Anaconda Cloud], easily installed with:<br />
<br />
$ conda install -c <nowiki>https://conda.anaconda.org/simpleitk</nowiki> SimpleITK<br />
<br />
Beta and release candidate packages are also available on Anaconda cloud under the dev label:<br />
<br />
$conda install -c <nowiki>https://conda.anaconda.org/simpleitk/label/dev</nowiki> SimpleITK<br />
<br />
=== Enthought Canopy Distribution ===<br />
<br />
First thing you should do is create a virtual environment (canopy_cli tool) and activate it.<br />
<br />
Currently there are no binaries supported with this distribution. You will need to compile SimpleITK yourself. (Using pip installation may work.)<br />
<br />
==C# binary files==<br />
<br />
'''Binaries for select C# platform''' can be found on [https://sourceforge.net/projects/simpleitk/files/SimpleITK/1.0.0/CSharp/ SimpleITK's SourceForge page]. Installing the library should only involve importing the unzipped files into you C# environment. The files have the following naming convention:<br />
SimpleITK-version-CSharp-buildplatform-targetplatform.zip<br />
eg.<br />
SimpleITK-1.0.0-CSharp-win32-x86.zip<br />
SimpleITK-1.0.0-CSharp-win64-x64.zip<br />
<br />
Details about how to set up a C# Visual Studio project with SimpleITK can be found in the [[SimpleITK/GettingStarted/A_visual_guide_to_SimpleITK_with_CSharp|Visual Guide to SimpleITK with CSharp]].<br />
<br />
More information about getting started with a sample C# program can be found in [[SimpleITK/GettingStarted/Visual_guide_to_building_on_Linux#A_simple_C.23_program| A visual guide to building SimpleITK on Linux]]<br />
<br />
==Java binary files==<br />
<br />
'''Binaries for select Java platforms''' can be found on [https://sourceforge.net/projects/simpleitk/files/SimpleITK/1.0.0/Java/ SimpleITK's SourceForge page]. Installation instructions are available at [[SimpleITK/GettingStarted/A visual guide to SimpleITK in Java|a visual guide to SimpleITK in Java]].<br />
<br />
==Nightly binaries==<br />
<br />
The '''latest binaries''' for the current development version of SimpleITK are also generally available. Binary packages are built as part of the nightly regression testing system. The download links are available from the [https://open.cdash.org/index.php?project=SimpleITK '''CDash'''] '''dashboard''' in the "Nightly Packages" section. <br />
<br />
Each row on the dashboard is a SimpleITK build on a particular system, and if the build was successful there will be a '''package icon''': https://open.cdash.org/img/package.png which links to the packages build by the system. A user may directly download the built package from such a link.<br />
<br />
=Build It Yourself=<br />
<br />
In many cases a user does not need to build SimpleITK because of the pre-built binaries available (see [[SimpleITK/GettingStarted#Binaries|above]]). However there are several reasons a user might prefer to '''build SimpleITK from source''':<br />
* The binary files for your programming language of choice are not (yet) distributed<br />
* You want the live on the bleeding edge by using the latest-and-greatest version of SimpleITK<br />
* You want to wrap your own filters using the SimpleITK infrastructure<br />
* You want to contribute to the development of SimpleITK<br />
* To use the SimpleITK's C++ interface and/or use ITK directly<br />
<br />
=== Prerequisites ===<br />
To build SimpleITK you need:<br />
* A recent version of [http://www.cmake.org/ CMake] >= 3.3 with SSL support for https.<br />
* A supported [[SimpleITK/FAQ#Is_my_compiler_supported.3F|compiler]]<br />
* To use the latest developmental version, source code can be downloaded with [http://git-scm.com/ git] >= 1.65<br />
** Git is required if building SimpleITK using "SuperBuild" (see below) to automatically download the matching version of ITK, SWIG, etc...<br />
** Windows users may prefer [http://msysgit.github.com/ msysGit]<br />
* It is recommended to have numpy installed when testing Python bindings<br />
<br />
=== Recipes / Formulas / Short Cuts ===<br />
<br />
For some environments we have short cuts, scripts, for automated building of SimpleITK (see their repository for more details):<br />
<br />
* For '''Python''': The [https://github.com/scikit-build/scikit-build scikit-build] based distutils based [https://github.com/scikit-build/scikit-build setup.py frontend] can be used to build, install, and package SimpleITK for Python.<br />
<br />
* For the '''Anaconda Python''' distribution: The recipe and instructions for the SimpleITK build are in [https://github.com/SimpleITK/SimpleITKCondaRecipe this GitHub repository]. <br />
<br />
* For the '''R language''': A devtools installer and instructions are available from [https://github.com/SimpleITK/SimpleITKRInstaller this GitHub repository]. <br />
<br />
* '''On the Mac''', with the [http://brew.sh/ Homebrew package manager], a SimpleITK formula is available: https://github.com/Homebrew/homebrew-science/blob/master/simpleitk.rb for multiple language wrappings.<br />
<br />
* For the '''Lua language''' with the Luarocks module deployment system, a SimpleITK rockspec is available form [https://github.com/SimpleITK/SimpleITKLuaRock this GitHub repository].<br />
<br />
=== Source code ===<br />
<br />
If one of the above language specific front-ends are not used then SimpleITK must be build directly.<br />
<br />
There are two options to obtain the SimpleITK source code:<br />
# Download a released version from the SimpleITK [https://sourceforge.net/projects/simpleitk/ SourceForge] page<br />
# Download the latest development version using git<br />
git clone http://itk.org/SimpleITK.git<br />
<br />
=== Building using SuperBuild ===<br />
After downloading SimpleITK's source code we '''STRONGLY''' recommend to run cmake on the SuperBuild subdirectory of SimpleITK. Execute the following commands in the parent of the SimpleITK source directory to configure the SuperBuild:<br />
mkdir SimpleITK-build<br />
cd SimpleITK-build<br />
cmake ../SimpleITK/SuperBuild<br />
<br />
The SuperBuild will automatically download and build the matching version of ITK and SWIG needed to compile SimpleITK. Additionally, it will set recommended compilation flags to minimize the size of the library and enable support for large libraries. This is the recommended way to build SimpleITK and is easiest.<br />
<br />
If you get an error message saying that ITK_DIR is not set then, you did not correctly point cmake to the SuperBuild sub-directory. Please erase your binary directory, and point cmake to the SimpleITK/SuperBuild sub-directory.<br />
<br />
The cmake configuration process should automatically find supported languages and enable SimpleITK wrapping for them. To manually enable a language toggle the appropriate WRAP_LANGUAGE cmake variable to ON. Verify and/or correct the advanced cmake variables to the language specific executable, libraries and include directories. For example if you have multiple Python installations ensure that all related Python variable refer to the same versions.<br />
<br />
Then use your make utility or your cmake chosen build utility to build SimpleITK.<br />
<br />
SimpleITK takes a while to build. Some tips and tricks to speed up development time are listed [http://www.itk.org/SimpleITKDoxygen/html/Developer.html#TandT here].<br />
<br />
=== Building manually ===<br />
This is '''not''' the recommended way of building SimpleITK, but it can be useful if you want to use a system version of ITK and/or SWIG, or if you do not want to (or can not) use git (due to firewall, etc).<br />
<br />
# Setup the prerequisites as described above (i.e. CMake and supported compiler)<br />
# Install the matching version of [http://www.swig.org/ SWIG] >= 3.0.5<br />
#* e.g. Windows users may install [http://prdownloads.sourceforge.net/swig/swigwin-3.0.5.zip swigwin-3.0.5]<br />
# Download the SimpleITK source code from the [https://sourceforge.net/projects/simpleitk/files/SimpleITK/ SourceForge] page<br />
# Download the matching version of ITK<br />
#* e.g. SimpleITK 0.10.0 uses [ http://sourceforge.net/projects/itk/files/itk/4.10/InsightToolkit-4.10.0.tar.gz/download ITK 4.10.0 (tag v4.10.0)]<br />
# Configure ITK using CMake<br />
#* BUILD_EXAMPLES=OFF, BUILD_TESTING=OFF, BUILD_SHARED_LIBS=OFF, '''ITK_USE_REVIEW=ON'''<br />
# Build ITK<br />
#* Be sure to note the build settings e.g. Release x64<br />
# Configure SimpleITK using CMake<br />
#* Set ITK_DIR to the location of the ITK build location from the previous steps<br />
# Build SimpleITK<br />
#* Be sure to configure the build settings exactly the same as ITK e.g. Release x64 and CXX_FLAGS<br />
<br />
===[[SimpleITK/GettingStarted/Visual_guide_to_building_on_Linux|A visual guide to building SimpleITK on Linux]]===<br />
<br />
==Testing==<br />
<br />
After compilation the prudent thing to due is to test SimpleITK to ensure your build is stable and suitable for use and installation. The following commands execute the SimpleITK tests.<br />
<br />
cd SimpleITK-build/SimpleITK-build<br />
ctest<br />
<br />
On Windows you will need to specify configuration. Typically that would be the Release configuration, as such:<br />
cd SimpleITK-build/SimpleITK-build<br />
ctest -C Release<br />
<br />
If all tests fail, verify that you have the testing data in your source tree (the reason for the "--recursive" flag in the git command) AND that you have added the correct path to your *_LIBRARY_PATH.<br />
<br />
==Python installation==<br />
<br />
To install a built python package into the system Python, as root run:<br />
cd SimpleITK-build/Wrapping/Python<br />
python Packaging/setup.py install<br />
<br />
Alternatively, a Python virtual environment can be created and the distribution installed there.<br />
<br />
If you build the "dist" target a Python Wheel file (.whl) will be created in the "Wrapping/Python/dist" directory.<br />
<br />
==R installation==<br />
<br />
To install a built R package:<br />
<br />
cd SimpleITK-build/Wrapping/R/Packaging<br />
R CMD INSTALL SimpleITK<br />
<br />
This will install the R package "SimpleITK" in /usr/local as root or your local R installation directory.<br />
<br />
<br />
If you are working in a multi-user environment, and are considerate of your fellow users you can install the package in a local directory:<br />
<br />
<ol> <li> Create a local directory where you will install your R packages</li></ol><br />
mkdir my_R_libs<br />
<ol start="2"> <li> Add an environment variable to your .bashrc</li></ol> <br />
export R_LIBS="/path_to/my_R_libs"<br />
<ol start="3"> <li> source your .bashrc and check the R library path, in an R shell >.libPaths()</li></ol><br />
<ol start="4"> <li>install </li></ol><br />
<br />
cd SimpleITK-build/Wrapping/R/Packaging<br />
R CMD INSTALL -l /path_to/my_R_libs SimpleITK<br />
<br />
=Recommended Software=<br />
<br />
== Fiji (Fiji is Just ImageJ) ==<br />
<br />
SimpleITK has a built in function, [https://itk.org/SimpleITKDoxygen/html/namespaceitk_1_1simple.html#ac8416e6e7f02dedfe8373b83dbea411d '''"itk::simple::Show()"'''], which can be used for viewing images in an interactive session. Currently, this function by default Show invokes [https://fiji.sc '''Fiji'''] then [http://rsbweb.nih.gov/ij/ '''ImageJ'''] to display images. ImageJ was chosen because it can handle all the image types that SimpleITK supports, even 3D vector images with n components. <br />
<br />
The Show function first searches the "PATH" environment variable, then additional standard locations are examined, if problems are encountered the correct path can be added to this environment variable and the '''"debugOn'''" option to '''"Show'''" flag set.<br />
<br />
====ImageJ====<br />
<br />
If ImageJ is used then we recommend downloading a recent version of [http://rsbweb.nih.gov/ij/download.html ImageJ] from the official home page. Recent versions come with support for the [http://nifti.nimh.nih.gov/nifti-1/ Nifti] ( *.nii ) file format, which SimpleITK uses to export to ImageJ. <br />
<br />
'''Note:''' '''Linux installation''' requires an additional step. The '''"Show'''" function searches for an executable named ImageJ or imagej, however the default tarball does not come with this file. Instead it comes with a file names [http://imagej.nih.gov/ij/download/linux/unix-script.txt script]. This file contains the installation instructions. In short the file should be renamed to "imagej" and the site specific variables for the installation location, and java must be set. Also consider the "newwindow" variable... Do you really want a new instance of ImageJ launched each time you use Show? Lastly, as the installation instructions indicate, the imagej wrapper should be in your path.<br />
<br />
==iPython and Jupyter==<br />
<br />
If you are using python, [http://ipython.org/ '''ipython'''] with [http://jupyter.org Jupyter] is terrific environment to perform interactive computing for image processing. With the addition of numpy and scipy, you'll have a powerful interactive environment.<br />
<br />
We have instructional [http://insightsoftwareconsortium.github.io/SimpleITK-Notebooks/ SimpleITK Jupyter Notebooks] which can help you get started.</div>Blowekamphttps://public.kitware.com/Wiki/index.php?title=SimpleITK/GettingStarted&diff=61631SimpleITK/GettingStarted2017-04-11T15:44:16Z<p>Blowekamp: /* Recipes / Formulas / Short Cuts */</p>
<hr />
<div>[[Image: SimpleITK-SquareTransparentLogo.png|center]]<br />
<br />
SimpleITK provides a simplified interface to ITK in a variety of languages. You can either download binaries, if they are available for your platform and prefered language, or you can build SimpleITK yourself.<br />
<br />
Additionally, there are several recommended third-party software packages.<br />
<br />
After you have installed SimpleITK, please look to the [[ITK_Release_4/Outreach/Conferences/MICCAI 2011/SimpleITK|Tutorial]] or the [http://www.itk.org/SimpleITKDoxygen/html/ Doxygen] pages for more information.<br />
<br />
=Downloading the binaries=<br />
<br />
One of the great advantages of SimpleITK is that (typically) you do not have to build it — you can simply download the binaries and get started right away!<br />
<br />
Currently, '''Python''' binaries are available on Microsoft Windows, GNU Linux and Apple OS X. '''C# and Java''' binaries are available for Windows. We are also working towards supporting '''R''' packaging.<br />
<br />
==Python binary files==<br />
<br />
There are currently two Python binary package choices: Python Wheels, and Anaconda packages for the Anaconda Python distribution.<br />
<br />
==== Use a Virtual Environment ====<br />
<br />
Before you install SimpleITK we <b>highly recommend</b> that you create a virtual environment into which you install the package. Note that different Python versions and distributions have different programs for creating and managing virtual environments. <br />
<br />
The use of a virtual environment allows you to elegantly deal with package compatability issues, to quote [http://docs.python-guide.org/en/latest/ The Hitchhiker’s Guide to Python!]:<br />
<blockquote>A Virtual Environment is a tool to keep the dependencies required by different projects in separate places, by creating virtual Python environments for them. It solves the “Project X depends on version 1.x but, Project Y needs 4.x” dilemma, and keeps your global site-packages directory clean and manageable.</blockquote><br />
<br />
Programs for creating virtual environments include [https://packaging.python.org/en/latest/installing/#creating-virtual-environments virtualenv and pyvenv] for generic Python distributions, [http://conda.pydata.org/docs/using/envs.html conda] for the anaconda distribution, and [http://docs.enthought.com/canopy/configure/canopy-cli.html canopy_cli] for the canopy distribution.<br />
<br />
=== Wheels for Generic Python Distribution ===<br />
<br />
If you are working with the [https://www.python.org/ generic Python distribution] you can install a Wheel with the lasted version of pip (>=9.0).<br />
<br />
First thing you should do is create a virtual environment (virtualenv or pyvenv tools) and activate it.<br />
<br />
<u>Note</u>: you can always manually download the wheels for your operating system and Python version directly from [http://sourceforge.net/projects/simpleitk/files/SimpleITK/ sourceforge].<br />
<br />
<br />
From the command line use the [https://pip.pypa.io/en/latest/index.html pip program] to install:<br />
<br />
$ pip install SimpleITK<br />
<br />
The pip package manager should automatically find the correct package for Microsoft Windows, Apple OS X and GNU Linux if your version and architecture are supported. If no binary package is found, then a source distribution will be downloaded and attempted to be compiled and you should look into [[#Build_It_Yourself]].<br />
<br />
:: If your pip version in the virtual environment is stale (<9.0) you need to update it (pip install -U pip).<br />
<br />
=== Anaconda Distribution ===<br />
<br />
First thing you should do is create a virtual environment ([https://conda.pydata.org/docs/using/envs.html conda] tool) and activate it.<br />
<br />
Currently there are compiled binaries on [https://conda.anaconda.org/simpleitk Anaconda Cloud], easily installed with:<br />
<br />
$ conda install -c <nowiki>https://conda.anaconda.org/simpleitk</nowiki> SimpleITK<br />
<br />
Beta and release candidate packages are also available on Anaconda cloud under the dev label:<br />
<br />
$conda install -c <nowiki>https://conda.anaconda.org/simpleitk/label/dev</nowiki> SimpleITK<br />
<br />
=== Enthought Canopy Distribution ===<br />
<br />
First thing you should do is create a virtual environment (canopy_cli tool) and activate it.<br />
<br />
Currently there are no binaries supported with this distribution. You will need to compile SimpleITK yourself. (Using pip installation may work.)<br />
<br />
==C# binary files==<br />
<br />
'''Binaries for select C# platform''' can be found on [https://sourceforge.net/projects/simpleitk/files/SimpleITK/1.0.0/CSharp/ SimpleITK's SourceForge page]. Installing the library should only involve importing the unzipped files into you C# environment. The files have the following naming convention:<br />
SimpleITK-version-CSharp-buildplatform-targetplatform.zip<br />
eg.<br />
SimpleITK-1.0.0-CSharp-win32-x86.zip<br />
SimpleITK-1.0.0-CSharp-win64-x64.zip<br />
<br />
Details about how to set up a C# Visual Studio project with SimpleITK can be found in the [[SimpleITK/GettingStarted/A_visual_guide_to_SimpleITK_with_CSharp|Visual Guide to SimpleITK with CSharp]].<br />
<br />
More information about getting started with a sample C# program can be found in [[SimpleITK/GettingStarted/Visual_guide_to_building_on_Linux#A_simple_C.23_program| A visual guide to building SimpleITK on Linux]]<br />
<br />
==Java binary files==<br />
<br />
'''Binaries for select Java platforms''' can be found on [https://sourceforge.net/projects/simpleitk/files/SimpleITK/1.0.0/Java/ SimpleITK's SourceForge page]. Installation instructions are available at [[SimpleITK/GettingStarted/A visual guide to SimpleITK in Java|a visual guide to SimpleITK in Java]].<br />
<br />
==Nightly binaries==<br />
<br />
The '''latest binaries''' for the current development version of SimpleITK are also generally available. Binary packages are built as part of the nightly regression testing system. The download links are available from the [https://open.cdash.org/index.php?project=SimpleITK '''CDash'''] '''dashboard''' in the "Nightly Packages" section. <br />
<br />
Each row on the dashboard is a SimpleITK build on a particular system, and if the build was successful there will be a '''package icon''': https://open.cdash.org/img/package.png which links to the packages build by the system. A user may directly download the built package from such a link.<br />
<br />
=Build It Yourself=<br />
<br />
In many cases a user does not need to build SimpleITK because of the pre-built binaries available (see [[SimpleITK/GettingStarted#Binaries|above]]). However there are several reasons a user might prefer to '''build SimpleITK from source''':<br />
* The binary files for your programming language of choice are not (yet) distributed<br />
* You want the live on the bleeding edge by using the latest-and-greatest version of SimpleITK<br />
* You want to wrap your own filters using the SimpleITK infrastructure<br />
* You want to contribute to the development of SimpleITK<br />
* To use the SimpleITK's C++ interface and/or use ITK directly<br />
<br />
=== Prerequisites ===<br />
To build SimpleITK you need:<br />
* A recent version of [http://www.cmake.org/ CMake] >= 3.3 with SSL support for https.<br />
* A supported [[SimpleITK/FAQ#Is_my_compiler_supported.3F|compiler]]<br />
* To use the latest developmental version, source code can be downloaded with [http://git-scm.com/ git] >= 1.65<br />
** Git is required if building SimpleITK using "SuperBuild" (see below) to automatically download the matching version of ITK, SWIG, etc...<br />
** Windows users may prefer [http://msysgit.github.com/ msysGit]<br />
* It is recommended to have numpy installed when testing Python bindings<br />
<br />
=== Recipes / Formulas / Short Cuts ===<br />
<br />
For some environments we have short cuts, scripts, for automated building of SimpleITK (see their repository for more details):<br />
<br />
* For '''Python''': The [https://github.com/scikit-build/scikit-build scikit-build] based distutils based [https://github.com/scikit-build/scikit-build setup.py frontend] can be used to build, install, and package SimpleITK for Python.<br />
<br />
* For the '''Anaconda Python''' distribution: The recipe and instructions for the SimpleITK build are in [https://github.com/SimpleITK/SimpleITKCondaRecipe this GitHub repository]. <br />
<br />
* For the '''R language''': A devtools installer and instructions are available from [https://github.com/SimpleITK/SimpleITKRInstaller this GitHub repository]. <br />
<br />
* '''On the Mac''', with the [http://brew.sh/ Homebrew package manager], a SimpleITK formula is available: https://github.com/Homebrew/homebrew-science/blob/master/simpleitk.rb for multiple language wrappings.<br />
<br />
* For the '''Lua language''' with the Luarocks module deployment system, a SimpleITK rockspec is available form [https://github.com/SimpleITK/SimpleITKLuaRock this GitHub repository].<br />
<br />
=== Source code ===<br />
There are two options to obtain the SimpleITK source code:<br />
# Download a released version from the SimpleITK [https://sourceforge.net/projects/simpleitk/ SourceForge] page<br />
# Download the latest development version using git<br />
git clone http://itk.org/SimpleITK.git<br />
<br />
=== Building using SuperBuild ===<br />
After downloading SimpleITK's source code we '''STRONGLY''' recommend to run cmake on the SuperBuild subdirectory of SimpleITK. Execute the following commands in the parent of the SimpleITK source directory to configure the SuperBuild:<br />
mkdir SimpleITK-build<br />
cd SimpleITK-build<br />
cmake ../SimpleITK/SuperBuild<br />
<br />
The SuperBuild will automatically download and build the matching version of ITK and SWIG needed to compile SimpleITK. Additionally, it will set recommended compilation flags to minimize the size of the library and enable support for large libraries. This is the recommended way to build SimpleITK and is easiest.<br />
<br />
If you get an error message saying that ITK_DIR is not set then, you did not correctly point cmake to the SuperBuild sub-directory. Please erase your binary directory, and point cmake to the SimpleITK/SuperBuild sub-directory.<br />
<br />
The cmake configuration process should automatically find supported languages and enable SimpleITK wrapping for them. To manually enable a language toggle the appropriate WRAP_LANGUAGE cmake variable to ON. Verify and/or correct the advanced cmake variables to the language specific executable, libraries and include directories. For example if you have multiple Python installations ensure that all related Python variable refer to the same versions.<br />
<br />
Then use your make utility or your cmake chosen build utility to build SimpleITK.<br />
<br />
SimpleITK takes a while to build. Some tips and tricks to speed up development time are listed [http://www.itk.org/SimpleITKDoxygen/html/Developer.html#TandT here].<br />
<br />
=== Building manually ===<br />
This is '''not''' the recommended way of building SimpleITK, but it can be useful if you want to use a system version of ITK and/or SWIG, or if you do not want to (or can not) use git (due to firewall, etc).<br />
<br />
# Setup the prerequisites as described above (i.e. CMake and supported compiler)<br />
# Install the matching version of [http://www.swig.org/ SWIG] >= 3.0.5<br />
#* e.g. Windows users may install [http://prdownloads.sourceforge.net/swig/swigwin-3.0.5.zip swigwin-3.0.5]<br />
# Download the SimpleITK source code from the [https://sourceforge.net/projects/simpleitk/files/SimpleITK/ SourceForge] page<br />
# Download the matching version of ITK<br />
#* e.g. SimpleITK 0.10.0 uses [ http://sourceforge.net/projects/itk/files/itk/4.10/InsightToolkit-4.10.0.tar.gz/download ITK 4.10.0 (tag v4.10.0)]<br />
# Configure ITK using CMake<br />
#* BUILD_EXAMPLES=OFF, BUILD_TESTING=OFF, BUILD_SHARED_LIBS=OFF, '''ITK_USE_REVIEW=ON'''<br />
# Build ITK<br />
#* Be sure to note the build settings e.g. Release x64<br />
# Configure SimpleITK using CMake<br />
#* Set ITK_DIR to the location of the ITK build location from the previous steps<br />
# Build SimpleITK<br />
#* Be sure to configure the build settings exactly the same as ITK e.g. Release x64 and CXX_FLAGS<br />
<br />
===[[SimpleITK/GettingStarted/Visual_guide_to_building_on_Linux|A visual guide to building SimpleITK on Linux]]===<br />
<br />
==Testing==<br />
<br />
After compilation the prudent thing to due is to test SimpleITK to ensure your build is stable and suitable for use and installation. The following commands execute the SimpleITK tests.<br />
<br />
cd SimpleITK-build/SimpleITK-build<br />
ctest<br />
<br />
On Windows you will need to specify configuration. Typically that would be the Release configuration, as such:<br />
cd SimpleITK-build/SimpleITK-build<br />
ctest -C Release<br />
<br />
If all tests fail, verify that you have the testing data in your source tree (the reason for the "--recursive" flag in the git command) AND that you have added the correct path to your *_LIBRARY_PATH.<br />
<br />
==Python installation==<br />
<br />
To install a built python package into the system Python, as root run:<br />
cd SimpleITK-build/Wrapping/Python<br />
python Packaging/setup.py install<br />
<br />
Alternatively, a Python virtual environment can be created and the distribution installed there.<br />
<br />
If you build the "dist" target a Python Wheel file (.whl) will be created in the "Wrapping/Python/dist" directory.<br />
<br />
==R installation==<br />
<br />
To install a built R package:<br />
<br />
cd SimpleITK-build/Wrapping/R/Packaging<br />
R CMD INSTALL SimpleITK<br />
<br />
This will install the R package "SimpleITK" in /usr/local as root or your local R installation directory.<br />
<br />
<br />
If you are working in a multi-user environment, and are considerate of your fellow users you can install the package in a local directory:<br />
<br />
<ol> <li> Create a local directory where you will install your R packages</li></ol><br />
mkdir my_R_libs<br />
<ol start="2"> <li> Add an environment variable to your .bashrc</li></ol> <br />
export R_LIBS="/path_to/my_R_libs"<br />
<ol start="3"> <li> source your .bashrc and check the R library path, in an R shell >.libPaths()</li></ol><br />
<ol start="4"> <li>install </li></ol><br />
<br />
cd SimpleITK-build/Wrapping/R/Packaging<br />
R CMD INSTALL -l /path_to/my_R_libs SimpleITK<br />
<br />
=Recommended Software=<br />
<br />
== Fiji (Fiji is Just ImageJ) ==<br />
<br />
SimpleITK has a built in function, [https://itk.org/SimpleITKDoxygen/html/namespaceitk_1_1simple.html#ac8416e6e7f02dedfe8373b83dbea411d '''"itk::simple::Show()"'''], which can be used for viewing images in an interactive session. Currently, this function by default Show invokes [https://fiji.sc '''Fiji'''] then [http://rsbweb.nih.gov/ij/ '''ImageJ'''] to display images. ImageJ was chosen because it can handle all the image types that SimpleITK supports, even 3D vector images with n components. <br />
<br />
The Show function first searches the "PATH" environment variable, then additional standard locations are examined, if problems are encountered the correct path can be added to this environment variable and the '''"debugOn'''" option to '''"Show'''" flag set.<br />
<br />
====ImageJ====<br />
<br />
If ImageJ is used then we recommend downloading a recent version of [http://rsbweb.nih.gov/ij/download.html ImageJ] from the official home page. Recent versions come with support for the [http://nifti.nimh.nih.gov/nifti-1/ Nifti] ( *.nii ) file format, which SimpleITK uses to export to ImageJ. <br />
<br />
'''Note:''' '''Linux installation''' requires an additional step. The '''"Show'''" function searches for an executable named ImageJ or imagej, however the default tarball does not come with this file. Instead it comes with a file names [http://imagej.nih.gov/ij/download/linux/unix-script.txt script]. This file contains the installation instructions. In short the file should be renamed to "imagej" and the site specific variables for the installation location, and java must be set. Also consider the "newwindow" variable... Do you really want a new instance of ImageJ launched each time you use Show? Lastly, as the installation instructions indicate, the imagej wrapper should be in your path.<br />
<br />
==iPython and Jupyter==<br />
<br />
If you are using python, [http://ipython.org/ '''ipython'''] with [http://jupyter.org Jupyter] is terrific environment to perform interactive computing for image processing. With the addition of numpy and scipy, you'll have a powerful interactive environment.<br />
<br />
We have instructional [http://insightsoftwareconsortium.github.io/SimpleITK-Notebooks/ SimpleITK Jupyter Notebooks] which can help you get started.</div>Blowekamphttps://public.kitware.com/Wiki/index.php?title=SimpleITK/GettingStarted&diff=61630SimpleITK/GettingStarted2017-04-11T15:42:28Z<p>Blowekamp: /* Prerequisites */</p>
<hr />
<div>[[Image: SimpleITK-SquareTransparentLogo.png|center]]<br />
<br />
SimpleITK provides a simplified interface to ITK in a variety of languages. You can either download binaries, if they are available for your platform and prefered language, or you can build SimpleITK yourself.<br />
<br />
Additionally, there are several recommended third-party software packages.<br />
<br />
After you have installed SimpleITK, please look to the [[ITK_Release_4/Outreach/Conferences/MICCAI 2011/SimpleITK|Tutorial]] or the [http://www.itk.org/SimpleITKDoxygen/html/ Doxygen] pages for more information.<br />
<br />
=Downloading the binaries=<br />
<br />
One of the great advantages of SimpleITK is that (typically) you do not have to build it — you can simply download the binaries and get started right away!<br />
<br />
Currently, '''Python''' binaries are available on Microsoft Windows, GNU Linux and Apple OS X. '''C# and Java''' binaries are available for Windows. We are also working towards supporting '''R''' packaging.<br />
<br />
==Python binary files==<br />
<br />
There are currently two Python binary package choices: Python Wheels, and Anaconda packages for the Anaconda Python distribution.<br />
<br />
==== Use a Virtual Environment ====<br />
<br />
Before you install SimpleITK we <b>highly recommend</b> that you create a virtual environment into which you install the package. Note that different Python versions and distributions have different programs for creating and managing virtual environments. <br />
<br />
The use of a virtual environment allows you to elegantly deal with package compatability issues, to quote [http://docs.python-guide.org/en/latest/ The Hitchhiker’s Guide to Python!]:<br />
<blockquote>A Virtual Environment is a tool to keep the dependencies required by different projects in separate places, by creating virtual Python environments for them. It solves the “Project X depends on version 1.x but, Project Y needs 4.x” dilemma, and keeps your global site-packages directory clean and manageable.</blockquote><br />
<br />
Programs for creating virtual environments include [https://packaging.python.org/en/latest/installing/#creating-virtual-environments virtualenv and pyvenv] for generic Python distributions, [http://conda.pydata.org/docs/using/envs.html conda] for the anaconda distribution, and [http://docs.enthought.com/canopy/configure/canopy-cli.html canopy_cli] for the canopy distribution.<br />
<br />
=== Wheels for Generic Python Distribution ===<br />
<br />
If you are working with the [https://www.python.org/ generic Python distribution] you can install a Wheel with the lasted version of pip (>=9.0).<br />
<br />
First thing you should do is create a virtual environment (virtualenv or pyvenv tools) and activate it.<br />
<br />
<u>Note</u>: you can always manually download the wheels for your operating system and Python version directly from [http://sourceforge.net/projects/simpleitk/files/SimpleITK/ sourceforge].<br />
<br />
<br />
From the command line use the [https://pip.pypa.io/en/latest/index.html pip program] to install:<br />
<br />
$ pip install SimpleITK<br />
<br />
The pip package manager should automatically find the correct package for Microsoft Windows, Apple OS X and GNU Linux if your version and architecture are supported. If no binary package is found, then a source distribution will be downloaded and attempted to be compiled and you should look into [[#Build_It_Yourself]].<br />
<br />
:: If your pip version in the virtual environment is stale (<9.0) you need to update it (pip install -U pip).<br />
<br />
=== Anaconda Distribution ===<br />
<br />
First thing you should do is create a virtual environment ([https://conda.pydata.org/docs/using/envs.html conda] tool) and activate it.<br />
<br />
Currently there are compiled binaries on [https://conda.anaconda.org/simpleitk Anaconda Cloud], easily installed with:<br />
<br />
$ conda install -c <nowiki>https://conda.anaconda.org/simpleitk</nowiki> SimpleITK<br />
<br />
Beta and release candidate packages are also available on Anaconda cloud under the dev label:<br />
<br />
$conda install -c <nowiki>https://conda.anaconda.org/simpleitk/label/dev</nowiki> SimpleITK<br />
<br />
=== Enthought Canopy Distribution ===<br />
<br />
First thing you should do is create a virtual environment (canopy_cli tool) and activate it.<br />
<br />
Currently there are no binaries supported with this distribution. You will need to compile SimpleITK yourself. (Using pip installation may work.)<br />
<br />
==C# binary files==<br />
<br />
'''Binaries for select C# platform''' can be found on [https://sourceforge.net/projects/simpleitk/files/SimpleITK/1.0.0/CSharp/ SimpleITK's SourceForge page]. Installing the library should only involve importing the unzipped files into you C# environment. The files have the following naming convention:<br />
SimpleITK-version-CSharp-buildplatform-targetplatform.zip<br />
eg.<br />
SimpleITK-1.0.0-CSharp-win32-x86.zip<br />
SimpleITK-1.0.0-CSharp-win64-x64.zip<br />
<br />
Details about how to set up a C# Visual Studio project with SimpleITK can be found in the [[SimpleITK/GettingStarted/A_visual_guide_to_SimpleITK_with_CSharp|Visual Guide to SimpleITK with CSharp]].<br />
<br />
More information about getting started with a sample C# program can be found in [[SimpleITK/GettingStarted/Visual_guide_to_building_on_Linux#A_simple_C.23_program| A visual guide to building SimpleITK on Linux]]<br />
<br />
==Java binary files==<br />
<br />
'''Binaries for select Java platforms''' can be found on [https://sourceforge.net/projects/simpleitk/files/SimpleITK/1.0.0/Java/ SimpleITK's SourceForge page]. Installation instructions are available at [[SimpleITK/GettingStarted/A visual guide to SimpleITK in Java|a visual guide to SimpleITK in Java]].<br />
<br />
==Nightly binaries==<br />
<br />
The '''latest binaries''' for the current development version of SimpleITK are also generally available. Binary packages are built as part of the nightly regression testing system. The download links are available from the [https://open.cdash.org/index.php?project=SimpleITK '''CDash'''] '''dashboard''' in the "Nightly Packages" section. <br />
<br />
Each row on the dashboard is a SimpleITK build on a particular system, and if the build was successful there will be a '''package icon''': https://open.cdash.org/img/package.png which links to the packages build by the system. A user may directly download the built package from such a link.<br />
<br />
=Build It Yourself=<br />
<br />
In many cases a user does not need to build SimpleITK because of the pre-built binaries available (see [[SimpleITK/GettingStarted#Binaries|above]]). However there are several reasons a user might prefer to '''build SimpleITK from source''':<br />
* The binary files for your programming language of choice are not (yet) distributed<br />
* You want the live on the bleeding edge by using the latest-and-greatest version of SimpleITK<br />
* You want to wrap your own filters using the SimpleITK infrastructure<br />
* You want to contribute to the development of SimpleITK<br />
* To use the SimpleITK's C++ interface and/or use ITK directly<br />
<br />
=== Prerequisites ===<br />
To build SimpleITK you need:<br />
* A recent version of [http://www.cmake.org/ CMake] >= 3.3 with SSL support for https.<br />
* A supported [[SimpleITK/FAQ#Is_my_compiler_supported.3F|compiler]]<br />
* To use the latest developmental version, source code can be downloaded with [http://git-scm.com/ git] >= 1.65<br />
** Git is required if building SimpleITK using "SuperBuild" (see below) to automatically download the matching version of ITK, SWIG, etc...<br />
** Windows users may prefer [http://msysgit.github.com/ msysGit]<br />
* It is recommended to have numpy installed when testing Python bindings<br />
<br />
=== Recipes / Formulas / Short Cuts ===<br />
<br />
For some environments we have short cuts, scripts, for automated building of SimpleITK:<br />
<br />
* For '''Python''': The [https://github.com/scikit-build/scikit-build scikit-build] based distutils based [https://github.com/scikit-build/scikit-build setup.py frontend] can be used to create wheels and install SimpleITK:<br />
<br />
# get the fronted<br />
git clone https://github.com/SimpleITK/SimpleITKPythonPackage.git<br />
cd SimpleITKPythonPackage<br />
<br />
# make virutal environment and install requirements<br />
mkvirtualenv build-sitk<br />
pip install -r requirements-dev.txt<br />
<br />
python setup.py bdist_wheel<br />
<br />
* For the '''Anaconda Python''' distribution: The recipe and instructions for the SimpleITK build are in [https://github.com/SimpleITK/SimpleITKCondaRecipe this GitHub repository]. <br />
<br />
* For the '''R language''': A devtools installer and instructions are available from [https://github.com/SimpleITK/SimpleITKRInstaller this GitHub repository]. <br />
<br />
* '''On the Mac''', with the [http://brew.sh/ Homebrew package manager], a SimpleITK formula is available: https://github.com/Homebrew/homebrew-science/blob/master/simpleitk.rb for multiple language wrappings.<br />
<br />
* For the '''Lua language''' with the Luarocks module deployment system, a SimpleITK rockspec is available form [https://github.com/SimpleITK/SimpleITKLuaRock this GitHub repository]. <br />
<br />
=== Source code ===<br />
There are two options to obtain the SimpleITK source code:<br />
# Download a released version from the SimpleITK [https://sourceforge.net/projects/simpleitk/ SourceForge] page<br />
# Download the latest development version using git<br />
git clone http://itk.org/SimpleITK.git<br />
<br />
=== Building using SuperBuild ===<br />
After downloading SimpleITK's source code we '''STRONGLY''' recommend to run cmake on the SuperBuild subdirectory of SimpleITK. Execute the following commands in the parent of the SimpleITK source directory to configure the SuperBuild:<br />
mkdir SimpleITK-build<br />
cd SimpleITK-build<br />
cmake ../SimpleITK/SuperBuild<br />
<br />
The SuperBuild will automatically download and build the matching version of ITK and SWIG needed to compile SimpleITK. Additionally, it will set recommended compilation flags to minimize the size of the library and enable support for large libraries. This is the recommended way to build SimpleITK and is easiest.<br />
<br />
If you get an error message saying that ITK_DIR is not set then, you did not correctly point cmake to the SuperBuild sub-directory. Please erase your binary directory, and point cmake to the SimpleITK/SuperBuild sub-directory.<br />
<br />
The cmake configuration process should automatically find supported languages and enable SimpleITK wrapping for them. To manually enable a language toggle the appropriate WRAP_LANGUAGE cmake variable to ON. Verify and/or correct the advanced cmake variables to the language specific executable, libraries and include directories. For example if you have multiple Python installations ensure that all related Python variable refer to the same versions.<br />
<br />
Then use your make utility or your cmake chosen build utility to build SimpleITK.<br />
<br />
SimpleITK takes a while to build. Some tips and tricks to speed up development time are listed [http://www.itk.org/SimpleITKDoxygen/html/Developer.html#TandT here].<br />
<br />
=== Building manually ===<br />
This is '''not''' the recommended way of building SimpleITK, but it can be useful if you want to use a system version of ITK and/or SWIG, or if you do not want to (or can not) use git (due to firewall, etc).<br />
<br />
# Setup the prerequisites as described above (i.e. CMake and supported compiler)<br />
# Install the matching version of [http://www.swig.org/ SWIG] >= 3.0.5<br />
#* e.g. Windows users may install [http://prdownloads.sourceforge.net/swig/swigwin-3.0.5.zip swigwin-3.0.5]<br />
# Download the SimpleITK source code from the [https://sourceforge.net/projects/simpleitk/files/SimpleITK/ SourceForge] page<br />
# Download the matching version of ITK<br />
#* e.g. SimpleITK 0.10.0 uses [ http://sourceforge.net/projects/itk/files/itk/4.10/InsightToolkit-4.10.0.tar.gz/download ITK 4.10.0 (tag v4.10.0)]<br />
# Configure ITK using CMake<br />
#* BUILD_EXAMPLES=OFF, BUILD_TESTING=OFF, BUILD_SHARED_LIBS=OFF, '''ITK_USE_REVIEW=ON'''<br />
# Build ITK<br />
#* Be sure to note the build settings e.g. Release x64<br />
# Configure SimpleITK using CMake<br />
#* Set ITK_DIR to the location of the ITK build location from the previous steps<br />
# Build SimpleITK<br />
#* Be sure to configure the build settings exactly the same as ITK e.g. Release x64 and CXX_FLAGS<br />
<br />
===[[SimpleITK/GettingStarted/Visual_guide_to_building_on_Linux|A visual guide to building SimpleITK on Linux]]===<br />
<br />
==Testing==<br />
<br />
After compilation the prudent thing to due is to test SimpleITK to ensure your build is stable and suitable for use and installation. The following commands execute the SimpleITK tests.<br />
<br />
cd SimpleITK-build/SimpleITK-build<br />
ctest<br />
<br />
On Windows you will need to specify configuration. Typically that would be the Release configuration, as such:<br />
cd SimpleITK-build/SimpleITK-build<br />
ctest -C Release<br />
<br />
If all tests fail, verify that you have the testing data in your source tree (the reason for the "--recursive" flag in the git command) AND that you have added the correct path to your *_LIBRARY_PATH.<br />
<br />
==Python installation==<br />
<br />
To install a built python package into the system Python, as root run:<br />
cd SimpleITK-build/Wrapping/Python<br />
python Packaging/setup.py install<br />
<br />
Alternatively, a Python virtual environment can be created and the distribution installed there.<br />
<br />
If you build the "dist" target a Python Wheel file (.whl) will be created in the "Wrapping/Python/dist" directory.<br />
<br />
==R installation==<br />
<br />
To install a built R package:<br />
<br />
cd SimpleITK-build/Wrapping/R/Packaging<br />
R CMD INSTALL SimpleITK<br />
<br />
This will install the R package "SimpleITK" in /usr/local as root or your local R installation directory.<br />
<br />
<br />
If you are working in a multi-user environment, and are considerate of your fellow users you can install the package in a local directory:<br />
<br />
<ol> <li> Create a local directory where you will install your R packages</li></ol><br />
mkdir my_R_libs<br />
<ol start="2"> <li> Add an environment variable to your .bashrc</li></ol> <br />
export R_LIBS="/path_to/my_R_libs"<br />
<ol start="3"> <li> source your .bashrc and check the R library path, in an R shell >.libPaths()</li></ol><br />
<ol start="4"> <li>install </li></ol><br />
<br />
cd SimpleITK-build/Wrapping/R/Packaging<br />
R CMD INSTALL -l /path_to/my_R_libs SimpleITK<br />
<br />
=Recommended Software=<br />
<br />
== Fiji (Fiji is Just ImageJ) ==<br />
<br />
SimpleITK has a built in function, [https://itk.org/SimpleITKDoxygen/html/namespaceitk_1_1simple.html#ac8416e6e7f02dedfe8373b83dbea411d '''"itk::simple::Show()"'''], which can be used for viewing images in an interactive session. Currently, this function by default Show invokes [https://fiji.sc '''Fiji'''] then [http://rsbweb.nih.gov/ij/ '''ImageJ'''] to display images. ImageJ was chosen because it can handle all the image types that SimpleITK supports, even 3D vector images with n components. <br />
<br />
The Show function first searches the "PATH" environment variable, then additional standard locations are examined, if problems are encountered the correct path can be added to this environment variable and the '''"debugOn'''" option to '''"Show'''" flag set.<br />
<br />
====ImageJ====<br />
<br />
If ImageJ is used then we recommend downloading a recent version of [http://rsbweb.nih.gov/ij/download.html ImageJ] from the official home page. Recent versions come with support for the [http://nifti.nimh.nih.gov/nifti-1/ Nifti] ( *.nii ) file format, which SimpleITK uses to export to ImageJ. <br />
<br />
'''Note:''' '''Linux installation''' requires an additional step. The '''"Show'''" function searches for an executable named ImageJ or imagej, however the default tarball does not come with this file. Instead it comes with a file names [http://imagej.nih.gov/ij/download/linux/unix-script.txt script]. This file contains the installation instructions. In short the file should be renamed to "imagej" and the site specific variables for the installation location, and java must be set. Also consider the "newwindow" variable... Do you really want a new instance of ImageJ launched each time you use Show? Lastly, as the installation instructions indicate, the imagej wrapper should be in your path.<br />
<br />
==iPython and Jupyter==<br />
<br />
If you are using python, [http://ipython.org/ '''ipython'''] with [http://jupyter.org Jupyter] is terrific environment to perform interactive computing for image processing. With the addition of numpy and scipy, you'll have a powerful interactive environment.<br />
<br />
We have instructional [http://insightsoftwareconsortium.github.io/SimpleITK-Notebooks/ SimpleITK Jupyter Notebooks] which can help you get started.</div>Blowekamphttps://public.kitware.com/Wiki/index.php?title=SimpleITK/GettingStarted&diff=61629SimpleITK/GettingStarted2017-04-11T15:41:04Z<p>Blowekamp: /* Java binary files */</p>
<hr />
<div>[[Image: SimpleITK-SquareTransparentLogo.png|center]]<br />
<br />
SimpleITK provides a simplified interface to ITK in a variety of languages. You can either download binaries, if they are available for your platform and prefered language, or you can build SimpleITK yourself.<br />
<br />
Additionally, there are several recommended third-party software packages.<br />
<br />
After you have installed SimpleITK, please look to the [[ITK_Release_4/Outreach/Conferences/MICCAI 2011/SimpleITK|Tutorial]] or the [http://www.itk.org/SimpleITKDoxygen/html/ Doxygen] pages for more information.<br />
<br />
=Downloading the binaries=<br />
<br />
One of the great advantages of SimpleITK is that (typically) you do not have to build it — you can simply download the binaries and get started right away!<br />
<br />
Currently, '''Python''' binaries are available on Microsoft Windows, GNU Linux and Apple OS X. '''C# and Java''' binaries are available for Windows. We are also working towards supporting '''R''' packaging.<br />
<br />
==Python binary files==<br />
<br />
There are currently two Python binary package choices: Python Wheels, and Anaconda packages for the Anaconda Python distribution.<br />
<br />
==== Use a Virtual Environment ====<br />
<br />
Before you install SimpleITK we <b>highly recommend</b> that you create a virtual environment into which you install the package. Note that different Python versions and distributions have different programs for creating and managing virtual environments. <br />
<br />
The use of a virtual environment allows you to elegantly deal with package compatability issues, to quote [http://docs.python-guide.org/en/latest/ The Hitchhiker’s Guide to Python!]:<br />
<blockquote>A Virtual Environment is a tool to keep the dependencies required by different projects in separate places, by creating virtual Python environments for them. It solves the “Project X depends on version 1.x but, Project Y needs 4.x” dilemma, and keeps your global site-packages directory clean and manageable.</blockquote><br />
<br />
Programs for creating virtual environments include [https://packaging.python.org/en/latest/installing/#creating-virtual-environments virtualenv and pyvenv] for generic Python distributions, [http://conda.pydata.org/docs/using/envs.html conda] for the anaconda distribution, and [http://docs.enthought.com/canopy/configure/canopy-cli.html canopy_cli] for the canopy distribution.<br />
<br />
=== Wheels for Generic Python Distribution ===<br />
<br />
If you are working with the [https://www.python.org/ generic Python distribution] you can install a Wheel with the lasted version of pip (>=9.0).<br />
<br />
First thing you should do is create a virtual environment (virtualenv or pyvenv tools) and activate it.<br />
<br />
<u>Note</u>: you can always manually download the wheels for your operating system and Python version directly from [http://sourceforge.net/projects/simpleitk/files/SimpleITK/ sourceforge].<br />
<br />
<br />
From the command line use the [https://pip.pypa.io/en/latest/index.html pip program] to install:<br />
<br />
$ pip install SimpleITK<br />
<br />
The pip package manager should automatically find the correct package for Microsoft Windows, Apple OS X and GNU Linux if your version and architecture are supported. If no binary package is found, then a source distribution will be downloaded and attempted to be compiled and you should look into [[#Build_It_Yourself]].<br />
<br />
:: If your pip version in the virtual environment is stale (<9.0) you need to update it (pip install -U pip).<br />
<br />
=== Anaconda Distribution ===<br />
<br />
First thing you should do is create a virtual environment ([https://conda.pydata.org/docs/using/envs.html conda] tool) and activate it.<br />
<br />
Currently there are compiled binaries on [https://conda.anaconda.org/simpleitk Anaconda Cloud], easily installed with:<br />
<br />
$ conda install -c <nowiki>https://conda.anaconda.org/simpleitk</nowiki> SimpleITK<br />
<br />
Beta and release candidate packages are also available on Anaconda cloud under the dev label:<br />
<br />
$conda install -c <nowiki>https://conda.anaconda.org/simpleitk/label/dev</nowiki> SimpleITK<br />
<br />
=== Enthought Canopy Distribution ===<br />
<br />
First thing you should do is create a virtual environment (canopy_cli tool) and activate it.<br />
<br />
Currently there are no binaries supported with this distribution. You will need to compile SimpleITK yourself. (Using pip installation may work.)<br />
<br />
==C# binary files==<br />
<br />
'''Binaries for select C# platform''' can be found on [https://sourceforge.net/projects/simpleitk/files/SimpleITK/1.0.0/CSharp/ SimpleITK's SourceForge page]. Installing the library should only involve importing the unzipped files into you C# environment. The files have the following naming convention:<br />
SimpleITK-version-CSharp-buildplatform-targetplatform.zip<br />
eg.<br />
SimpleITK-1.0.0-CSharp-win32-x86.zip<br />
SimpleITK-1.0.0-CSharp-win64-x64.zip<br />
<br />
Details about how to set up a C# Visual Studio project with SimpleITK can be found in the [[SimpleITK/GettingStarted/A_visual_guide_to_SimpleITK_with_CSharp|Visual Guide to SimpleITK with CSharp]].<br />
<br />
More information about getting started with a sample C# program can be found in [[SimpleITK/GettingStarted/Visual_guide_to_building_on_Linux#A_simple_C.23_program| A visual guide to building SimpleITK on Linux]]<br />
<br />
==Java binary files==<br />
<br />
'''Binaries for select Java platforms''' can be found on [https://sourceforge.net/projects/simpleitk/files/SimpleITK/1.0.0/Java/ SimpleITK's SourceForge page]. Installation instructions are available at [[SimpleITK/GettingStarted/A visual guide to SimpleITK in Java|a visual guide to SimpleITK in Java]].<br />
<br />
==Nightly binaries==<br />
<br />
The '''latest binaries''' for the current development version of SimpleITK are also generally available. Binary packages are built as part of the nightly regression testing system. The download links are available from the [https://open.cdash.org/index.php?project=SimpleITK '''CDash'''] '''dashboard''' in the "Nightly Packages" section. <br />
<br />
Each row on the dashboard is a SimpleITK build on a particular system, and if the build was successful there will be a '''package icon''': https://open.cdash.org/img/package.png which links to the packages build by the system. A user may directly download the built package from such a link.<br />
<br />
=Build It Yourself=<br />
<br />
In many cases a user does not need to build SimpleITK because of the pre-built binaries available (see [[SimpleITK/GettingStarted#Binaries|above]]). However there are several reasons a user might prefer to '''build SimpleITK from source''':<br />
* The binary files for your programming language of choice are not (yet) distributed<br />
* You want the live on the bleeding edge by using the latest-and-greatest version of SimpleITK<br />
* You want to wrap your own filters using the SimpleITK infrastructure<br />
* You want to contribute to the development of SimpleITK<br />
* To use the SimpleITK's C++ interface and/or use ITK directly<br />
<br />
=== Prerequisites ===<br />
To build SimpleITK you need:<br />
* A recent version of [http://www.cmake.org/ CMake] >= 3.3 with SSL support for https.<br />
* A supported [[SimpleITK/FAQ#Is_my_compiler_supported.3F|compiler]]<br />
* To use the latest developmental version, source code can be downloaded with [http://git-scm.com/ git] >= 1.65<br />
** Git is required if building SimpleITK using "SuperBuild" (see below) to automatically download the matching version of ITK and SWIG<br />
** Windows users may prefer [http://msysgit.github.com/ msysGit]<br />
* It is recommended to have numpy installed when testing Python bindings<br />
<br />
=== Recipes / Formulas / Short Cuts ===<br />
<br />
For some environments we have short cuts, scripts, for automated building of SimpleITK:<br />
<br />
* For '''Python''': The [https://github.com/scikit-build/scikit-build scikit-build] based distutils based [https://github.com/scikit-build/scikit-build setup.py frontend] can be used to create wheels and install SimpleITK:<br />
<br />
# get the fronted<br />
git clone https://github.com/SimpleITK/SimpleITKPythonPackage.git<br />
cd SimpleITKPythonPackage<br />
<br />
# make virutal environment and install requirements<br />
mkvirtualenv build-sitk<br />
pip install -r requirements-dev.txt<br />
<br />
python setup.py bdist_wheel<br />
<br />
* For the '''Anaconda Python''' distribution: The recipe and instructions for the SimpleITK build are in [https://github.com/SimpleITK/SimpleITKCondaRecipe this GitHub repository]. <br />
<br />
* For the '''R language''': A devtools installer and instructions are available from [https://github.com/SimpleITK/SimpleITKRInstaller this GitHub repository]. <br />
<br />
* '''On the Mac''', with the [http://brew.sh/ Homebrew package manager], a SimpleITK formula is available: https://github.com/Homebrew/homebrew-science/blob/master/simpleitk.rb for multiple language wrappings.<br />
<br />
* For the '''Lua language''' with the Luarocks module deployment system, a SimpleITK rockspec is available form [https://github.com/SimpleITK/SimpleITKLuaRock this GitHub repository]. <br />
<br />
=== Source code ===<br />
There are two options to obtain the SimpleITK source code:<br />
# Download a released version from the SimpleITK [https://sourceforge.net/projects/simpleitk/ SourceForge] page<br />
# Download the latest development version using git<br />
git clone http://itk.org/SimpleITK.git<br />
<br />
=== Building using SuperBuild ===<br />
After downloading SimpleITK's source code we '''STRONGLY''' recommend to run cmake on the SuperBuild subdirectory of SimpleITK. Execute the following commands in the parent of the SimpleITK source directory to configure the SuperBuild:<br />
mkdir SimpleITK-build<br />
cd SimpleITK-build<br />
cmake ../SimpleITK/SuperBuild<br />
<br />
The SuperBuild will automatically download and build the matching version of ITK and SWIG needed to compile SimpleITK. Additionally, it will set recommended compilation flags to minimize the size of the library and enable support for large libraries. This is the recommended way to build SimpleITK and is easiest.<br />
<br />
If you get an error message saying that ITK_DIR is not set then, you did not correctly point cmake to the SuperBuild sub-directory. Please erase your binary directory, and point cmake to the SimpleITK/SuperBuild sub-directory.<br />
<br />
The cmake configuration process should automatically find supported languages and enable SimpleITK wrapping for them. To manually enable a language toggle the appropriate WRAP_LANGUAGE cmake variable to ON. Verify and/or correct the advanced cmake variables to the language specific executable, libraries and include directories. For example if you have multiple Python installations ensure that all related Python variable refer to the same versions.<br />
<br />
Then use your make utility or your cmake chosen build utility to build SimpleITK.<br />
<br />
SimpleITK takes a while to build. Some tips and tricks to speed up development time are listed [http://www.itk.org/SimpleITKDoxygen/html/Developer.html#TandT here].<br />
<br />
=== Building manually ===<br />
This is '''not''' the recommended way of building SimpleITK, but it can be useful if you want to use a system version of ITK and/or SWIG, or if you do not want to (or can not) use git (due to firewall, etc).<br />
<br />
# Setup the prerequisites as described above (i.e. CMake and supported compiler)<br />
# Install the matching version of [http://www.swig.org/ SWIG] >= 3.0.5<br />
#* e.g. Windows users may install [http://prdownloads.sourceforge.net/swig/swigwin-3.0.5.zip swigwin-3.0.5]<br />
# Download the SimpleITK source code from the [https://sourceforge.net/projects/simpleitk/files/SimpleITK/ SourceForge] page<br />
# Download the matching version of ITK<br />
#* e.g. SimpleITK 0.10.0 uses [ http://sourceforge.net/projects/itk/files/itk/4.10/InsightToolkit-4.10.0.tar.gz/download ITK 4.10.0 (tag v4.10.0)]<br />
# Configure ITK using CMake<br />
#* BUILD_EXAMPLES=OFF, BUILD_TESTING=OFF, BUILD_SHARED_LIBS=OFF, '''ITK_USE_REVIEW=ON'''<br />
# Build ITK<br />
#* Be sure to note the build settings e.g. Release x64<br />
# Configure SimpleITK using CMake<br />
#* Set ITK_DIR to the location of the ITK build location from the previous steps<br />
# Build SimpleITK<br />
#* Be sure to configure the build settings exactly the same as ITK e.g. Release x64 and CXX_FLAGS<br />
<br />
===[[SimpleITK/GettingStarted/Visual_guide_to_building_on_Linux|A visual guide to building SimpleITK on Linux]]===<br />
<br />
==Testing==<br />
<br />
After compilation the prudent thing to due is to test SimpleITK to ensure your build is stable and suitable for use and installation. The following commands execute the SimpleITK tests.<br />
<br />
cd SimpleITK-build/SimpleITK-build<br />
ctest<br />
<br />
On Windows you will need to specify configuration. Typically that would be the Release configuration, as such:<br />
cd SimpleITK-build/SimpleITK-build<br />
ctest -C Release<br />
<br />
If all tests fail, verify that you have the testing data in your source tree (the reason for the "--recursive" flag in the git command) AND that you have added the correct path to your *_LIBRARY_PATH.<br />
<br />
==Python installation==<br />
<br />
To install a built python package into the system Python, as root run:<br />
cd SimpleITK-build/Wrapping/Python<br />
python Packaging/setup.py install<br />
<br />
Alternatively, a Python virtual environment can be created and the distribution installed there.<br />
<br />
If you build the "dist" target a Python Wheel file (.whl) will be created in the "Wrapping/Python/dist" directory.<br />
<br />
==R installation==<br />
<br />
To install a built R package:<br />
<br />
cd SimpleITK-build/Wrapping/R/Packaging<br />
R CMD INSTALL SimpleITK<br />
<br />
This will install the R package "SimpleITK" in /usr/local as root or your local R installation directory.<br />
<br />
<br />
If you are working in a multi-user environment, and are considerate of your fellow users you can install the package in a local directory:<br />
<br />
<ol> <li> Create a local directory where you will install your R packages</li></ol><br />
mkdir my_R_libs<br />
<ol start="2"> <li> Add an environment variable to your .bashrc</li></ol> <br />
export R_LIBS="/path_to/my_R_libs"<br />
<ol start="3"> <li> source your .bashrc and check the R library path, in an R shell >.libPaths()</li></ol><br />
<ol start="4"> <li>install </li></ol><br />
<br />
cd SimpleITK-build/Wrapping/R/Packaging<br />
R CMD INSTALL -l /path_to/my_R_libs SimpleITK<br />
<br />
=Recommended Software=<br />
<br />
== Fiji (Fiji is Just ImageJ) ==<br />
<br />
SimpleITK has a built in function, [https://itk.org/SimpleITKDoxygen/html/namespaceitk_1_1simple.html#ac8416e6e7f02dedfe8373b83dbea411d '''"itk::simple::Show()"'''], which can be used for viewing images in an interactive session. Currently, this function by default Show invokes [https://fiji.sc '''Fiji'''] then [http://rsbweb.nih.gov/ij/ '''ImageJ'''] to display images. ImageJ was chosen because it can handle all the image types that SimpleITK supports, even 3D vector images with n components. <br />
<br />
The Show function first searches the "PATH" environment variable, then additional standard locations are examined, if problems are encountered the correct path can be added to this environment variable and the '''"debugOn'''" option to '''"Show'''" flag set.<br />
<br />
====ImageJ====<br />
<br />
If ImageJ is used then we recommend downloading a recent version of [http://rsbweb.nih.gov/ij/download.html ImageJ] from the official home page. Recent versions come with support for the [http://nifti.nimh.nih.gov/nifti-1/ Nifti] ( *.nii ) file format, which SimpleITK uses to export to ImageJ. <br />
<br />
'''Note:''' '''Linux installation''' requires an additional step. The '''"Show'''" function searches for an executable named ImageJ or imagej, however the default tarball does not come with this file. Instead it comes with a file names [http://imagej.nih.gov/ij/download/linux/unix-script.txt script]. This file contains the installation instructions. In short the file should be renamed to "imagej" and the site specific variables for the installation location, and java must be set. Also consider the "newwindow" variable... Do you really want a new instance of ImageJ launched each time you use Show? Lastly, as the installation instructions indicate, the imagej wrapper should be in your path.<br />
<br />
==iPython and Jupyter==<br />
<br />
If you are using python, [http://ipython.org/ '''ipython'''] with [http://jupyter.org Jupyter] is terrific environment to perform interactive computing for image processing. With the addition of numpy and scipy, you'll have a powerful interactive environment.<br />
<br />
We have instructional [http://insightsoftwareconsortium.github.io/SimpleITK-Notebooks/ SimpleITK Jupyter Notebooks] which can help you get started.</div>Blowekamphttps://public.kitware.com/Wiki/index.php?title=SimpleITK/GettingStarted&diff=61628SimpleITK/GettingStarted2017-04-11T15:40:27Z<p>Blowekamp: /* Wheel for Generic Python Distribution */</p>
<hr />
<div>[[Image: SimpleITK-SquareTransparentLogo.png|center]]<br />
<br />
SimpleITK provides a simplified interface to ITK in a variety of languages. You can either download binaries, if they are available for your platform and prefered language, or you can build SimpleITK yourself.<br />
<br />
Additionally, there are several recommended third-party software packages.<br />
<br />
After you have installed SimpleITK, please look to the [[ITK_Release_4/Outreach/Conferences/MICCAI 2011/SimpleITK|Tutorial]] or the [http://www.itk.org/SimpleITKDoxygen/html/ Doxygen] pages for more information.<br />
<br />
=Downloading the binaries=<br />
<br />
One of the great advantages of SimpleITK is that (typically) you do not have to build it — you can simply download the binaries and get started right away!<br />
<br />
Currently, '''Python''' binaries are available on Microsoft Windows, GNU Linux and Apple OS X. '''C# and Java''' binaries are available for Windows. We are also working towards supporting '''R''' packaging.<br />
<br />
==Python binary files==<br />
<br />
There are currently two Python binary package choices: Python Wheels, and Anaconda packages for the Anaconda Python distribution.<br />
<br />
==== Use a Virtual Environment ====<br />
<br />
Before you install SimpleITK we <b>highly recommend</b> that you create a virtual environment into which you install the package. Note that different Python versions and distributions have different programs for creating and managing virtual environments. <br />
<br />
The use of a virtual environment allows you to elegantly deal with package compatability issues, to quote [http://docs.python-guide.org/en/latest/ The Hitchhiker’s Guide to Python!]:<br />
<blockquote>A Virtual Environment is a tool to keep the dependencies required by different projects in separate places, by creating virtual Python environments for them. It solves the “Project X depends on version 1.x but, Project Y needs 4.x” dilemma, and keeps your global site-packages directory clean and manageable.</blockquote><br />
<br />
Programs for creating virtual environments include [https://packaging.python.org/en/latest/installing/#creating-virtual-environments virtualenv and pyvenv] for generic Python distributions, [http://conda.pydata.org/docs/using/envs.html conda] for the anaconda distribution, and [http://docs.enthought.com/canopy/configure/canopy-cli.html canopy_cli] for the canopy distribution.<br />
<br />
=== Wheels for Generic Python Distribution ===<br />
<br />
If you are working with the [https://www.python.org/ generic Python distribution] you can install a Wheel with the lasted version of pip (>=9.0).<br />
<br />
First thing you should do is create a virtual environment (virtualenv or pyvenv tools) and activate it.<br />
<br />
<u>Note</u>: you can always manually download the wheels for your operating system and Python version directly from [http://sourceforge.net/projects/simpleitk/files/SimpleITK/ sourceforge].<br />
<br />
<br />
From the command line use the [https://pip.pypa.io/en/latest/index.html pip program] to install:<br />
<br />
$ pip install SimpleITK<br />
<br />
The pip package manager should automatically find the correct package for Microsoft Windows, Apple OS X and GNU Linux if your version and architecture are supported. If no binary package is found, then a source distribution will be downloaded and attempted to be compiled and you should look into [[#Build_It_Yourself]].<br />
<br />
:: If your pip version in the virtual environment is stale (<9.0) you need to update it (pip install -U pip).<br />
<br />
=== Anaconda Distribution ===<br />
<br />
First thing you should do is create a virtual environment ([https://conda.pydata.org/docs/using/envs.html conda] tool) and activate it.<br />
<br />
Currently there are compiled binaries on [https://conda.anaconda.org/simpleitk Anaconda Cloud], easily installed with:<br />
<br />
$ conda install -c <nowiki>https://conda.anaconda.org/simpleitk</nowiki> SimpleITK<br />
<br />
Beta and release candidate packages are also available on Anaconda cloud under the dev label:<br />
<br />
$conda install -c <nowiki>https://conda.anaconda.org/simpleitk/label/dev</nowiki> SimpleITK<br />
<br />
=== Enthought Canopy Distribution ===<br />
<br />
First thing you should do is create a virtual environment (canopy_cli tool) and activate it.<br />
<br />
Currently there are no binaries supported with this distribution. You will need to compile SimpleITK yourself. (Using pip installation may work.)<br />
<br />
==C# binary files==<br />
<br />
'''Binaries for select C# platform''' can be found on [https://sourceforge.net/projects/simpleitk/files/SimpleITK/1.0.0/CSharp/ SimpleITK's SourceForge page]. Installing the library should only involve importing the unzipped files into you C# environment. The files have the following naming convention:<br />
SimpleITK-version-CSharp-buildplatform-targetplatform.zip<br />
eg.<br />
SimpleITK-1.0.0-CSharp-win32-x86.zip<br />
SimpleITK-1.0.0-CSharp-win64-x64.zip<br />
<br />
Details about how to set up a C# Visual Studio project with SimpleITK can be found in the [[SimpleITK/GettingStarted/A_visual_guide_to_SimpleITK_with_CSharp|Visual Guide to SimpleITK with CSharp]].<br />
<br />
More information about getting started with a sample C# program can be found in [[SimpleITK/GettingStarted/Visual_guide_to_building_on_Linux#A_simple_C.23_program| A visual guide to building SimpleITK on Linux]]<br />
<br />
==Java binary files==<br />
<br />
'''Binaries for select Java platforms''' can be found on [https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.10.0/Java/ SimpleITK's SourceForge page]. Installation instructions are available at [[SimpleITK/GettingStarted/A visual guide to SimpleITK in Java|a visual guide to SimpleITK in Java]].<br />
<br />
==Nightly binaries==<br />
<br />
The '''latest binaries''' for the current development version of SimpleITK are also generally available. Binary packages are built as part of the nightly regression testing system. The download links are available from the [https://open.cdash.org/index.php?project=SimpleITK '''CDash'''] '''dashboard''' in the "Nightly Packages" section. <br />
<br />
Each row on the dashboard is a SimpleITK build on a particular system, and if the build was successful there will be a '''package icon''': https://open.cdash.org/img/package.png which links to the packages build by the system. A user may directly download the built package from such a link.<br />
<br />
=Build It Yourself=<br />
<br />
In many cases a user does not need to build SimpleITK because of the pre-built binaries available (see [[SimpleITK/GettingStarted#Binaries|above]]). However there are several reasons a user might prefer to '''build SimpleITK from source''':<br />
* The binary files for your programming language of choice are not (yet) distributed<br />
* You want the live on the bleeding edge by using the latest-and-greatest version of SimpleITK<br />
* You want to wrap your own filters using the SimpleITK infrastructure<br />
* You want to contribute to the development of SimpleITK<br />
* To use the SimpleITK's C++ interface and/or use ITK directly<br />
<br />
=== Prerequisites ===<br />
To build SimpleITK you need:<br />
* A recent version of [http://www.cmake.org/ CMake] >= 3.3 with SSL support for https.<br />
* A supported [[SimpleITK/FAQ#Is_my_compiler_supported.3F|compiler]]<br />
* To use the latest developmental version, source code can be downloaded with [http://git-scm.com/ git] >= 1.65<br />
** Git is required if building SimpleITK using "SuperBuild" (see below) to automatically download the matching version of ITK and SWIG<br />
** Windows users may prefer [http://msysgit.github.com/ msysGit]<br />
* It is recommended to have numpy installed when testing Python bindings<br />
<br />
=== Recipes / Formulas / Short Cuts ===<br />
<br />
For some environments we have short cuts, scripts, for automated building of SimpleITK:<br />
<br />
* For '''Python''': The [https://github.com/scikit-build/scikit-build scikit-build] based distutils based [https://github.com/scikit-build/scikit-build setup.py frontend] can be used to create wheels and install SimpleITK:<br />
<br />
# get the fronted<br />
git clone https://github.com/SimpleITK/SimpleITKPythonPackage.git<br />
cd SimpleITKPythonPackage<br />
<br />
# make virutal environment and install requirements<br />
mkvirtualenv build-sitk<br />
pip install -r requirements-dev.txt<br />
<br />
python setup.py bdist_wheel<br />
<br />
* For the '''Anaconda Python''' distribution: The recipe and instructions for the SimpleITK build are in [https://github.com/SimpleITK/SimpleITKCondaRecipe this GitHub repository]. <br />
<br />
* For the '''R language''': A devtools installer and instructions are available from [https://github.com/SimpleITK/SimpleITKRInstaller this GitHub repository]. <br />
<br />
* '''On the Mac''', with the [http://brew.sh/ Homebrew package manager], a SimpleITK formula is available: https://github.com/Homebrew/homebrew-science/blob/master/simpleitk.rb for multiple language wrappings.<br />
<br />
* For the '''Lua language''' with the Luarocks module deployment system, a SimpleITK rockspec is available form [https://github.com/SimpleITK/SimpleITKLuaRock this GitHub repository]. <br />
<br />
=== Source code ===<br />
There are two options to obtain the SimpleITK source code:<br />
# Download a released version from the SimpleITK [https://sourceforge.net/projects/simpleitk/ SourceForge] page<br />
# Download the latest development version using git<br />
git clone http://itk.org/SimpleITK.git<br />
<br />
=== Building using SuperBuild ===<br />
After downloading SimpleITK's source code we '''STRONGLY''' recommend to run cmake on the SuperBuild subdirectory of SimpleITK. Execute the following commands in the parent of the SimpleITK source directory to configure the SuperBuild:<br />
mkdir SimpleITK-build<br />
cd SimpleITK-build<br />
cmake ../SimpleITK/SuperBuild<br />
<br />
The SuperBuild will automatically download and build the matching version of ITK and SWIG needed to compile SimpleITK. Additionally, it will set recommended compilation flags to minimize the size of the library and enable support for large libraries. This is the recommended way to build SimpleITK and is easiest.<br />
<br />
If you get an error message saying that ITK_DIR is not set then, you did not correctly point cmake to the SuperBuild sub-directory. Please erase your binary directory, and point cmake to the SimpleITK/SuperBuild sub-directory.<br />
<br />
The cmake configuration process should automatically find supported languages and enable SimpleITK wrapping for them. To manually enable a language toggle the appropriate WRAP_LANGUAGE cmake variable to ON. Verify and/or correct the advanced cmake variables to the language specific executable, libraries and include directories. For example if you have multiple Python installations ensure that all related Python variable refer to the same versions.<br />
<br />
Then use your make utility or your cmake chosen build utility to build SimpleITK.<br />
<br />
SimpleITK takes a while to build. Some tips and tricks to speed up development time are listed [http://www.itk.org/SimpleITKDoxygen/html/Developer.html#TandT here].<br />
<br />
=== Building manually ===<br />
This is '''not''' the recommended way of building SimpleITK, but it can be useful if you want to use a system version of ITK and/or SWIG, or if you do not want to (or can not) use git (due to firewall, etc).<br />
<br />
# Setup the prerequisites as described above (i.e. CMake and supported compiler)<br />
# Install the matching version of [http://www.swig.org/ SWIG] >= 3.0.5<br />
#* e.g. Windows users may install [http://prdownloads.sourceforge.net/swig/swigwin-3.0.5.zip swigwin-3.0.5]<br />
# Download the SimpleITK source code from the [https://sourceforge.net/projects/simpleitk/files/SimpleITK/ SourceForge] page<br />
# Download the matching version of ITK<br />
#* e.g. SimpleITK 0.10.0 uses [ http://sourceforge.net/projects/itk/files/itk/4.10/InsightToolkit-4.10.0.tar.gz/download ITK 4.10.0 (tag v4.10.0)]<br />
# Configure ITK using CMake<br />
#* BUILD_EXAMPLES=OFF, BUILD_TESTING=OFF, BUILD_SHARED_LIBS=OFF, '''ITK_USE_REVIEW=ON'''<br />
# Build ITK<br />
#* Be sure to note the build settings e.g. Release x64<br />
# Configure SimpleITK using CMake<br />
#* Set ITK_DIR to the location of the ITK build location from the previous steps<br />
# Build SimpleITK<br />
#* Be sure to configure the build settings exactly the same as ITK e.g. Release x64 and CXX_FLAGS<br />
<br />
===[[SimpleITK/GettingStarted/Visual_guide_to_building_on_Linux|A visual guide to building SimpleITK on Linux]]===<br />
<br />
==Testing==<br />
<br />
After compilation the prudent thing to due is to test SimpleITK to ensure your build is stable and suitable for use and installation. The following commands execute the SimpleITK tests.<br />
<br />
cd SimpleITK-build/SimpleITK-build<br />
ctest<br />
<br />
On Windows you will need to specify configuration. Typically that would be the Release configuration, as such:<br />
cd SimpleITK-build/SimpleITK-build<br />
ctest -C Release<br />
<br />
If all tests fail, verify that you have the testing data in your source tree (the reason for the "--recursive" flag in the git command) AND that you have added the correct path to your *_LIBRARY_PATH.<br />
<br />
==Python installation==<br />
<br />
To install a built python package into the system Python, as root run:<br />
cd SimpleITK-build/Wrapping/Python<br />
python Packaging/setup.py install<br />
<br />
Alternatively, a Python virtual environment can be created and the distribution installed there.<br />
<br />
If you build the "dist" target a Python Wheel file (.whl) will be created in the "Wrapping/Python/dist" directory.<br />
<br />
==R installation==<br />
<br />
To install a built R package:<br />
<br />
cd SimpleITK-build/Wrapping/R/Packaging<br />
R CMD INSTALL SimpleITK<br />
<br />
This will install the R package "SimpleITK" in /usr/local as root or your local R installation directory.<br />
<br />
<br />
If you are working in a multi-user environment, and are considerate of your fellow users you can install the package in a local directory:<br />
<br />
<ol> <li> Create a local directory where you will install your R packages</li></ol><br />
mkdir my_R_libs<br />
<ol start="2"> <li> Add an environment variable to your .bashrc</li></ol> <br />
export R_LIBS="/path_to/my_R_libs"<br />
<ol start="3"> <li> source your .bashrc and check the R library path, in an R shell >.libPaths()</li></ol><br />
<ol start="4"> <li>install </li></ol><br />
<br />
cd SimpleITK-build/Wrapping/R/Packaging<br />
R CMD INSTALL -l /path_to/my_R_libs SimpleITK<br />
<br />
=Recommended Software=<br />
<br />
== Fiji (Fiji is Just ImageJ) ==<br />
<br />
SimpleITK has a built in function, [https://itk.org/SimpleITKDoxygen/html/namespaceitk_1_1simple.html#ac8416e6e7f02dedfe8373b83dbea411d '''"itk::simple::Show()"'''], which can be used for viewing images in an interactive session. Currently, this function by default Show invokes [https://fiji.sc '''Fiji'''] then [http://rsbweb.nih.gov/ij/ '''ImageJ'''] to display images. ImageJ was chosen because it can handle all the image types that SimpleITK supports, even 3D vector images with n components. <br />
<br />
The Show function first searches the "PATH" environment variable, then additional standard locations are examined, if problems are encountered the correct path can be added to this environment variable and the '''"debugOn'''" option to '''"Show'''" flag set.<br />
<br />
====ImageJ====<br />
<br />
If ImageJ is used then we recommend downloading a recent version of [http://rsbweb.nih.gov/ij/download.html ImageJ] from the official home page. Recent versions come with support for the [http://nifti.nimh.nih.gov/nifti-1/ Nifti] ( *.nii ) file format, which SimpleITK uses to export to ImageJ. <br />
<br />
'''Note:''' '''Linux installation''' requires an additional step. The '''"Show'''" function searches for an executable named ImageJ or imagej, however the default tarball does not come with this file. Instead it comes with a file names [http://imagej.nih.gov/ij/download/linux/unix-script.txt script]. This file contains the installation instructions. In short the file should be renamed to "imagej" and the site specific variables for the installation location, and java must be set. Also consider the "newwindow" variable... Do you really want a new instance of ImageJ launched each time you use Show? Lastly, as the installation instructions indicate, the imagej wrapper should be in your path.<br />
<br />
==iPython and Jupyter==<br />
<br />
If you are using python, [http://ipython.org/ '''ipython'''] with [http://jupyter.org Jupyter] is terrific environment to perform interactive computing for image processing. With the addition of numpy and scipy, you'll have a powerful interactive environment.<br />
<br />
We have instructional [http://insightsoftwareconsortium.github.io/SimpleITK-Notebooks/ SimpleITK Jupyter Notebooks] which can help you get started.</div>Blowekamp