<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.na-mic.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Mseeland</id>
	<title>NAMIC Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www.na-mic.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Mseeland"/>
	<link rel="alternate" type="text/html" href="https://www.na-mic.org/wiki/Special:Contributions/Mseeland"/>
	<updated>2026-04-19T16:01:54Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.33.0</generator>
	<entry>
		<id>https://www.na-mic.org/w/index.php?title=User:Mseeland&amp;diff=42673</id>
		<title>User:Mseeland</title>
		<link rel="alternate" type="text/html" href="https://www.na-mic.org/w/index.php?title=User:Mseeland&amp;diff=42673"/>
		<updated>2009-09-14T13:46:23Z</updated>

		<summary type="html">&lt;p&gt;Mseeland: /* Teem Python wrapping */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Wiki of Madeleine Seeland =&lt;br /&gt;
&lt;br /&gt;
== General Information ==&lt;br /&gt;
&lt;br /&gt;
===About myself===&lt;br /&gt;
I am a grad student of Management Information Systems at the University of Mannheim, Germany. I'm involved in the Diffusion Tensor Imaging (DTI) project in the Laboratory of Mathematics in Imaging. Currently I'm working on two-tensor tractograohy for Neurosurgery. I will document my research experience as a diploma thesis, which I need for completing my studies in Germany.&lt;br /&gt;
&lt;br /&gt;
===Contact information===&lt;br /&gt;
E-mail: mseeland (at sign) bwh.harvard.edu&lt;br /&gt;
&lt;br /&gt;
===Collaborators &amp;amp; Contacts===&lt;br /&gt;
* Supervisors: C-F Westin, Nobuhiko Hata&lt;br /&gt;
* Gordon  Kindlmann (Teem)&lt;br /&gt;
* Sharon Peled&lt;br /&gt;
* Alireza Radmanesh&lt;br /&gt;
* Isaiah Norton&lt;br /&gt;
* Regarding Python: Steve Pieper, Julien de Siebenthal, Sylvain Bouix, Demian Wassermann, Luca Antiga&lt;br /&gt;
&lt;br /&gt;
==Project: Two-Tensor Tractography integration into Slicer==&lt;br /&gt;
&lt;br /&gt;
===Project Description===&lt;br /&gt;
*  Integration of Two-Tensor Tractography into Slicer using Python and the novel Python wrapping for Teem&lt;br /&gt;
*  Use of existing tractography methods in Teem (http://teem.sourceforge.net/)&lt;br /&gt;
*  My part: Interface between Slicer-&amp;gt;Python-&amp;gt;Teem and Teem-&amp;gt;Python-&amp;gt;Slicer&lt;br /&gt;
** pass data from VTK through Python to Teem&lt;br /&gt;
** make use of Teem tractography function calls&lt;br /&gt;
** pass resulting fiber data from Teem to Python to VTK and display fiber tracts in Slicer&lt;br /&gt;
&lt;br /&gt;
===How to enable Python in Slicer 3.3===&lt;br /&gt;
*  The current version of Slicer, Slicer 3.2, does not support Python. In order to use Python you need to install Slicer 3.3.&lt;br /&gt;
&lt;br /&gt;
*  To build Slicer Version 3.3, just do the following two commands:&lt;br /&gt;
  svn co http://svn.slicer.org/Slicer3/trunk Slicer3&lt;br /&gt;
  ./Slicer3/Scripts/getbuildtest.tcl&lt;br /&gt;
&lt;br /&gt;
*  In Slicer 3.3, Python support is disabled by default. In order to enable Python, just follow the next steps:&lt;br /&gt;
&lt;br /&gt;
# Edit slicer_variables.tcl&lt;br /&gt;
## Change &amp;quot;set ::USE_PYTHON &amp;quot;off&amp;quot;&amp;quot; to &amp;quot;on&amp;quot;&lt;br /&gt;
# '''Optional:''' If you prefer to use your system Python installation, see here: [http://www.slicer.org/slicerWiki/index.php/Slicer3::Python] &lt;br /&gt;
# '''Optional:''' installing SciPy, see here: [http://www.slicer.org/slicerWiki/index.php/Slicer3::Python]. However, there are still problems adding scipy in Slicer, whcih are not fixed yet.&lt;br /&gt;
&lt;br /&gt;
*  Rebuild Slicer3 using &amp;quot;getbuildtest.tcl&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 ./Slicer3/Scripts/getbuildtest.tcl&lt;br /&gt;
&lt;br /&gt;
A new menu command '''Python Interpreter''' should appear on the Window menu in Slicer. This command should bring up the Python Console window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Prerequisites for Two-Tensor Tractography module===&lt;br /&gt;
====Check out Two-Tensor Tractography====&lt;br /&gt;
* Check out Two-Tensor Tractography from http://svn.na-mic.org/NAMICSandBox/trunk/TwoTensorTractography.&lt;br /&gt;
* Copy the Two-Tensor Tractography folder into the directory /Slicer3-build/lib/Slicer3/Modules.&lt;br /&gt;
&lt;br /&gt;
====LEVMAR====&lt;br /&gt;
&lt;br /&gt;
* The 2-tensor tractography depends on Levenberg-Marquardt nonlinear optimization of Sharon Peled's constrained two-tensor model. I used the following implementation for it: http://www.ics.forth.gr/~lourakis/levmar/&lt;br /&gt;
* First, in lm.h you need to uncomment the line that says: #undef HAVE_LAPACK (around line 30)&lt;br /&gt;
* Change CMakeLists.txt in the teem folder. Below the required changes can be found.&lt;br /&gt;
* The levmar code is enabled by compiling Teem with TEEM_LEVMAR defined (turn LEVMAR ON while doing ccmake). The include paths and library link paths also need to be defined for everything to work.&lt;br /&gt;
* Here are the changes in the teem/CMakeLists.txt file that work for me:&lt;br /&gt;
&lt;br /&gt;
Replace the following line&lt;br /&gt;
  # Look for &amp;quot;levmar&amp;quot; library &amp;lt;http://www.ics.forth.gr/~lourakis/levmar/&amp;gt;&lt;br /&gt;
  OPTION(Teem_LEVMAR &amp;quot;Build Teem with levmar library support.&amp;quot; OFF)&lt;br /&gt;
  SET(Teem_LEVMAR_LIB &amp;quot;&amp;quot;)&lt;br /&gt;
  IF(Teem_LEVMAR)&lt;br /&gt;
    FIND_PACKAGE(LEVMAR)&lt;br /&gt;
    IF(LEVMAR_FOUND)&lt;br /&gt;
      ADD_DEFINITIONS(-DTEEM_LEVMAR)&lt;br /&gt;
      SET(Teem_LEVMAR_LIB ${LEVMAR_LIBRARIES})&lt;br /&gt;
      SET(Teem_LEVMAR_IPATH ${LEVMAR_INCLUDE_DIR})&lt;br /&gt;
    ELSE(LEVMAR_FOUND)&lt;br /&gt;
      # We need to set this as a cache variable, so that it will show up as&lt;br /&gt;
      # being turned off in the cache.&lt;br /&gt;
      MESSAGE(SEND_ERROR &amp;quot;Turning off Teem_LEVMAR, because it wasn't found.&amp;quot;)&lt;br /&gt;
      SET(Teem_LEVMAR OFF CACHE BOOL &amp;quot;Build Teem with levmar library support.&amp;quot; FORCE)&lt;br /&gt;
    ENDIF(LEVMAR_FOUND)&lt;br /&gt;
  ENDIF(Teem_LEVMAR)&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
&lt;br /&gt;
  # Look for &amp;quot;levmar&amp;quot; library &amp;lt;http://www.ics.forth.gr/~lourakis/levmar/&amp;gt;&lt;br /&gt;
  OPTION(Teem_LEVMAR &amp;quot;Build Teem with levmar library support.&amp;quot; OFF)&lt;br /&gt;
  IF(Teem_LEVMAR)&lt;br /&gt;
      ADD_DEFINITIONS(-DTEEM_LEVMAR)&lt;br /&gt;
      SET(Teem_LEVMAR_PATH &amp;quot;/media/sda7/Programming/levmar&amp;quot;)&lt;br /&gt;
      SET(Teem_LEVMAR_LIB &amp;quot;${LEVMAR_LEVMAR_PATH}/levmar-build/liblevmar.a&amp;quot; CACHE STRING &amp;quot;library path&amp;quot;)&lt;br /&gt;
      SET(Teem_LEVMAR_IPATH &amp;quot;${LEVMAR_LEVMAR_PATH}/levmar-2.3&amp;quot; CACHE STRING &amp;quot;ipath&amp;quot;)&lt;br /&gt;
  ENDIF(Teem_LEVMAR)&lt;br /&gt;
&lt;br /&gt;
and replace the pathes with your pathes.&lt;br /&gt;
&lt;br /&gt;
====Python processing package====&lt;br /&gt;
&lt;br /&gt;
* This package can be downloaded here:&lt;br /&gt;
http://pypi.python.org/pypi/processing&lt;br /&gt;
* Install the package in Slicer3-lib/python-build/lib/python2.5/site-packages/&lt;br /&gt;
* In the top directory of the package (containing setup.py and also this INSTALL file), type&lt;br /&gt;
  python setup.py install&lt;br /&gt;
&lt;br /&gt;
==Status/Progress==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=0&lt;br /&gt;
|- bgcolor=&amp;quot;#abcdef&amp;quot;&lt;br /&gt;
! Month !! Week #  !! Start Date - End Date !! Done !! Date Done&lt;br /&gt;
|-&lt;br /&gt;
|height=5|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Find optimal parameter setting of the Two-Tensor Tractography method ||align=&amp;quot;center&amp;quot; |  || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Extend Two-Tensor Tractography module by fiducial seeding ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | NA-MIC Project Week in Salt Lake City ([http://www.na-mic.org/Wiki/index.php/2009_Winter_Project_Week],[http://www.na-mic.org/Wiki/index.php/Two-tensor_tractography_in_Slicer_using_Python_and_Teem]) ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! January !!  | Week 2 || 05.01 - 11.01 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | IGT Project Week ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 50 || 08.12 - 14.12 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! December !!  | Week 49 || 01.12 - 07.12 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to compile teem with levmar (= Levenberg-Marquardt nonlinear least squares algorithm) ||align=&amp;quot;center&amp;quot; | x || Mon Dec, 1st&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 48 !! 24.11 - 30.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | document the results of the two-tensor tractography given a tensor volume ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to do mutli trace tractography given a DWI volume ||align=&amp;quot;center&amp;quot; | x || Mon Nov, 17th&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 47 !! 17.11 - 23.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Working on Python tractography module for multi fiber tracing given a tensor volume ||align=&amp;quot;center&amp;quot; | x || Mon Nov, 17th&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 46 !! 10.11 - 16.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Get vertex data out of the nvert nrrd filled by the tractography back to Slicer ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to pass image data from Python to Teem through nrrdWrap_nva function ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to generate a list of point locations that were used as tractography seedpoints in the VTK tractography ||align=&amp;quot;center&amp;quot; | x || Thu Nov, 13th&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Implement Python tractography module for single fiber tracing given a seeding starting point and a tensor volume ||align=&amp;quot;center&amp;quot; | x || Fri, Nov, 7th&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 45 || 03.11 - 09.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to get image data from numpy (= Python package) to Teem nrrd struct ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! November !!  | Week 44 || 27.10 - 02.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;20px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to get image data from numpy (= Python package) to Teem nrrd struct ||align=&amp;quot;center&amp;quot; | x ||&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !!  Week 43 || 20.10 - 26.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to access DWI volumes through Python ||align=&amp;quot;center&amp;quot; | x || Fri Oct, 17th&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Get Teem wrapped in Python ||align=&amp;quot;center&amp;quot; | x || Fri Oct, 19th&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 42 || 13.10 - 19.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Try to implement the seeding part of the (VTK) one-tensor tractography module in Python || align=&amp;quot;center&amp;quot; | x || Tue Oct, 14th&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 41 || 06.10 - 12.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
|height=10|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Try to implement the seeding part of the (VTK) one-tensor tractography module in Python || align=&amp;quot;center&amp;quot; | x || Tue Oct, 14th&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! October !!  Week 40 || 29.09 - 5.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;20px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; |Totally understand existing Python modules in Slicer || align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; |understand existing one-tensor streamline tractography in Slicer (VTK) || align=&amp;quot;center&amp;quot; | x || Tue Sep, 23rd &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Totally understand existing Python modules in Slicer ||align=&amp;quot;center&amp;quot; | x || Tue Sep, 23rd&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !!  Week 39 || 22.09 - 28.09 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; | Slicer &amp;amp; Python Tutorials || align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; | Enable Python in Slicer || align=&amp;quot;center&amp;quot; | x || Mon Sep, 22nd&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot; &lt;br /&gt;
! September !! Week 38 || 14.09 - 21.09 || ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Information==&lt;br /&gt;
* Diffusion Tensor Analysis in Slicer: http://www.na-mic.org/Wiki/images/0/04/Slicer3diffusionTutorial7.pdf&lt;br /&gt;
* Building a Slicer 3 Module GUI: http://www.slicer.org/pages/Building_a_Slicer_3_Module_GUI&lt;br /&gt;
&lt;br /&gt;
Python:&lt;br /&gt;
* SlicerWiki about Python: http://www.slicer.org/slicerWiki/index.php/Slicer3::Python&lt;br /&gt;
* Python example modules in Slicer: http://www.slicer.org/slicerWiki/index.php/Slicer3:Execution_Model_Documentation:Python&lt;/div&gt;</summary>
		<author><name>Mseeland</name></author>
		
	</entry>
	<entry>
		<id>https://www.na-mic.org/w/index.php?title=User:Mseeland&amp;diff=37622</id>
		<title>User:Mseeland</title>
		<link rel="alternate" type="text/html" href="https://www.na-mic.org/w/index.php?title=User:Mseeland&amp;diff=37622"/>
		<updated>2009-05-20T05:08:44Z</updated>

		<summary type="html">&lt;p&gt;Mseeland: /* LEVMAR */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Wiki of Madeleine Seeland =&lt;br /&gt;
&lt;br /&gt;
== General Information ==&lt;br /&gt;
&lt;br /&gt;
===About myself===&lt;br /&gt;
I am a grad student of Management Information Systems at the University of Mannheim, Germany. I'm involved in the Diffusion Tensor Imaging (DTI) project in the Laboratory of Mathematics in Imaging. Currently I'm working on two-tensor tractograohy for Neurosurgery. I will document my research experience as a diploma thesis, which I need for completing my studies in Germany.&lt;br /&gt;
&lt;br /&gt;
===Contact information===&lt;br /&gt;
E-mail: mseeland (at sign) bwh.harvard.edu&lt;br /&gt;
&lt;br /&gt;
===Collaborators &amp;amp; Contacts===&lt;br /&gt;
* Supervisors: C-F Westin, Nobuhiko Hata&lt;br /&gt;
* Gordon  Kindlmann (Teem)&lt;br /&gt;
* Sharon Peled&lt;br /&gt;
* Alireza Radmanesh&lt;br /&gt;
* Isaiah Norton&lt;br /&gt;
* Regarding Python: Steve Pieper, Julien de Siebenthal, Sylvain Bouix, Demian Wassermann, Luca Antiga&lt;br /&gt;
&lt;br /&gt;
==Project: Two-Tensor Tractography integration into Slicer==&lt;br /&gt;
&lt;br /&gt;
===Project Description===&lt;br /&gt;
*  Integration of Two-Tensor Tractography into Slicer using Python and the novel Python wrapping for Teem&lt;br /&gt;
*  Use of existing tractography methods in Teem (http://teem.sourceforge.net/)&lt;br /&gt;
*  My part: Interface between Slicer-&amp;gt;Python-&amp;gt;Teem and Teem-&amp;gt;Python-&amp;gt;Slicer&lt;br /&gt;
** pass data from VTK through Python to Teem&lt;br /&gt;
** make use of Teem tractography function calls&lt;br /&gt;
** pass resulting fiber data from Teem to Python to VTK and display fiber tracts in Slicer&lt;br /&gt;
&lt;br /&gt;
===How to enable Python in Slicer 3.3===&lt;br /&gt;
*  The current version of Slicer, Slicer 3.2, does not support Python. In order to use Python you need to install Slicer 3.3.&lt;br /&gt;
&lt;br /&gt;
*  To build Slicer Version 3.3, just do the following two commands:&lt;br /&gt;
  svn co http://svn.slicer.org/Slicer3/trunk Slicer3&lt;br /&gt;
  ./Slicer3/Scripts/getbuildtest.tcl&lt;br /&gt;
&lt;br /&gt;
*  In Slicer 3.3, Python support is disabled by default. In order to enable Python, just follow the next steps:&lt;br /&gt;
&lt;br /&gt;
# Edit slicer_variables.tcl&lt;br /&gt;
## Change &amp;quot;set ::USE_PYTHON &amp;quot;off&amp;quot;&amp;quot; to &amp;quot;on&amp;quot;&lt;br /&gt;
# '''Optional:''' If you prefer to use your system Python installation, see here: [http://www.slicer.org/slicerWiki/index.php/Slicer3::Python] &lt;br /&gt;
# '''Optional:''' installing SciPy, see here: [http://www.slicer.org/slicerWiki/index.php/Slicer3::Python]. However, there are still problems adding scipy in Slicer, whcih are not fixed yet.&lt;br /&gt;
&lt;br /&gt;
*  Rebuild Slicer3 using &amp;quot;getbuildtest.tcl&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 ./Slicer3/Scripts/getbuildtest.tcl&lt;br /&gt;
&lt;br /&gt;
A new menu command '''Python Interpreter''' should appear on the Window menu in Slicer. This command should bring up the Python Console window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Prerequisites for Two-Tensor Tractography module===&lt;br /&gt;
====Teem Python wrapping====&lt;br /&gt;
&lt;br /&gt;
=====BACKGROUND=====&lt;br /&gt;
* Teem Python wrapping is needed to make use of existing Two-Tensor tractography functions in Teem in Python&lt;br /&gt;
* The Python wrappings are based on ctypes, as well as a ctypes code generator (called &amp;quot;ctypeslib&amp;quot;)&lt;br /&gt;
** http://python.net/crew/theller/ctypes&lt;br /&gt;
** http://starship.python.net/crew/theller/wiki/CodeGenerator&lt;br /&gt;
** http://starship.python.net/crew/theller/ctypes/old/codegen.html&lt;br /&gt;
* Ctypes is a standard part of python, by which C functions in a shared library can be called from Python&lt;br /&gt;
* The ctypes code generator converts declarations in C header files into executable Python code: enums, structs, unions, function declarations, com interfaces, and preprocessor definitions.&lt;br /&gt;
* Creating wrappers for C header file(s) is a two step process. &lt;br /&gt;
** First, the ``h2xml.py`` script runs GCC-XML_ over the include file(s), creating a XML file containing declarations and definitions.  &lt;br /&gt;
** Second, the ``xml2py.py`` script parses the XML files and creates Python code containing all or a subset of these definitions.&lt;br /&gt;
* Python code is generated for C enums, structure, unions, typedefs and function declarations.&lt;br /&gt;
&lt;br /&gt;
=====REQUIREMENTS=====&lt;br /&gt;
* Ctypeslib: ctypeslib is an extension package for ctypes. It contains a ctypes code generator.&lt;br /&gt;
* GCC-XML is required to parse C header files into an XML description.&lt;br /&gt;
&lt;br /&gt;
=====GETTING THE SOFTWARE=====&lt;br /&gt;
* Python 2.6 can be got here (anything after 2.5 should work): http://www.python.org/download/&lt;br /&gt;
* Get gccxml (I used version 0.9.0), which can be got by CVS as described here: http://www.gccxml.org/HTML/Download.html&lt;br /&gt;
** follow the installation as described here: http://www.gccxml.org/HTML/Install.html&lt;br /&gt;
* use a version of ctypeslib which work with the version of gccxml: &lt;br /&gt;
  http://svn.python.org/projects/ctypes/branches/ctypeslib-gccxml-0.9&lt;br /&gt;
* But this requires some patches to work; the content of the &amp;quot;fixes.patch&amp;quot; file can be found here: [[http://wiki.na-mic.org/Wiki/images/3/3b/Fixes.patch.txt]]:&lt;br /&gt;
   svn co http://svn.python.org/projects/ctypes/branches/ctypeslib-gccxml-0.9&lt;br /&gt;
   cd ctypeslib-gccxml-0.9&lt;br /&gt;
   patch -p0 &amp;lt; ../fixes.patch&lt;br /&gt;
   cd ..&lt;br /&gt;
* ctypeslib is written in python =&amp;gt; there's nothing new to compile at this point&lt;br /&gt;
&lt;br /&gt;
=====CREATING PYTHON/TEEM=====&lt;br /&gt;
* First get Teem (starting from whatever directory should contain the &amp;quot;teem&amp;quot; source dir):&lt;br /&gt;
  svn co https://teem.svn.sourceforge.net/svnroot/teem/teem/trunk teem&lt;br /&gt;
and compile it as a shared library.  Directions for doing this with cmake are here:&lt;br /&gt;
  http://teem.sourceforge.net/build.html&lt;br /&gt;
* create the wrappings in a new directory (e.g. &amp;quot;teem-wrap&amp;quot;), where the XML and Python output will be&lt;br /&gt;
* Set the environment variables that identify where Teem and ctypeslib are:&lt;br /&gt;
** TEEM is where Teem's &amp;quot;make install&amp;quot; put subdirectories &amp;quot;bin&amp;quot;, &amp;quot;lib&amp;quot;, and &amp;quot;include&amp;quot; (e.g. ~/teem-build)&lt;br /&gt;
** CTYPES is the full path of ctypeslib-gccxml-0.9&lt;br /&gt;
* First create (in, for example, &amp;quot;teem-wrap&amp;quot;) a meta-header for all the Teem header files (in tcsh):&lt;br /&gt;
   mkdir teemincl&lt;br /&gt;
   cp -r ${TEEM}/include/teem teemincl&lt;br /&gt;
   cd teemincl&lt;br /&gt;
   ls -1 teem/*.h | awk '{print &amp;quot;#include &amp;lt;&amp;quot;$1&amp;quot;&amp;gt;&amp;quot;}' &amp;gt; all.h&lt;br /&gt;
   cd ..&lt;br /&gt;
* Then create teem.xml:&lt;br /&gt;
   setenv PYTHONPATH $CTYPES&lt;br /&gt;
   python $CTYPES/scripts/h2xml.py `pwd`/teemincl/all.h -I teemincl -o teem.xml &lt;br /&gt;
* Then create teem.py (use DYLD_LIBRARY_PATH in a mac):&lt;br /&gt;
   setenv LD_LIBRARY_PATH ${TEEM}/lib&lt;br /&gt;
   python $CTYPES/scripts/xml2py.py teem.xml -llibteem.so -o teem.py \&lt;br /&gt;
        -r &amp;quot;(air|hest|biff|nrrd|ell|unrrdu|moss|gage|bane|limn|seek|hoover|echo|ten|dye|mite).*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
====LEVMAR====&lt;br /&gt;
&lt;br /&gt;
* The 2-tensor tractography depends on Levenberg-Marquardt nonlinear optimization of Sharon Peled's constrained two-tensor model. I used the following implementation for it: http://www.ics.forth.gr/~lourakis/levmar/&lt;br /&gt;
* First, in lm.h you need to uncomment the line that says: #undef HAVE_LAPACK (around line 30)&lt;br /&gt;
* Change CMakeLists.txt in the teem folder. Below the required changes can be found.&lt;br /&gt;
* The levmar code is enabled by compiling Teem with TEEM_LEVMAR defined (turn LEVMAR ON while doing ccmake). The include paths and library link paths also need to be defined for everything to work.&lt;br /&gt;
* Here are the changes in the teem/CMakeLists.txt file that work for me:&lt;br /&gt;
&lt;br /&gt;
Replace the following line&lt;br /&gt;
  # Look for &amp;quot;levmar&amp;quot; library &amp;lt;http://www.ics.forth.gr/~lourakis/levmar/&amp;gt;&lt;br /&gt;
  OPTION(Teem_LEVMAR &amp;quot;Build Teem with levmar library support.&amp;quot; OFF)&lt;br /&gt;
  SET(Teem_LEVMAR_LIB &amp;quot;&amp;quot;)&lt;br /&gt;
  IF(Teem_LEVMAR)&lt;br /&gt;
    FIND_PACKAGE(LEVMAR)&lt;br /&gt;
    IF(LEVMAR_FOUND)&lt;br /&gt;
      ADD_DEFINITIONS(-DTEEM_LEVMAR)&lt;br /&gt;
      SET(Teem_LEVMAR_LIB ${LEVMAR_LIBRARIES})&lt;br /&gt;
      SET(Teem_LEVMAR_IPATH ${LEVMAR_INCLUDE_DIR})&lt;br /&gt;
    ELSE(LEVMAR_FOUND)&lt;br /&gt;
      # We need to set this as a cache variable, so that it will show up as&lt;br /&gt;
      # being turned off in the cache.&lt;br /&gt;
      MESSAGE(SEND_ERROR &amp;quot;Turning off Teem_LEVMAR, because it wasn't found.&amp;quot;)&lt;br /&gt;
      SET(Teem_LEVMAR OFF CACHE BOOL &amp;quot;Build Teem with levmar library support.&amp;quot; FORCE)&lt;br /&gt;
    ENDIF(LEVMAR_FOUND)&lt;br /&gt;
  ENDIF(Teem_LEVMAR)&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
&lt;br /&gt;
  # Look for &amp;quot;levmar&amp;quot; library &amp;lt;http://www.ics.forth.gr/~lourakis/levmar/&amp;gt;&lt;br /&gt;
  OPTION(Teem_LEVMAR &amp;quot;Build Teem with levmar library support.&amp;quot; OFF)&lt;br /&gt;
  IF(Teem_LEVMAR)&lt;br /&gt;
      ADD_DEFINITIONS(-DTEEM_LEVMAR)&lt;br /&gt;
      SET(Teem_LEVMAR_PATH &amp;quot;/media/sda7/Programming/levmar&amp;quot;)&lt;br /&gt;
      SET(Teem_LEVMAR_LIB &amp;quot;${LEVMAR_LEVMAR_PATH}/levmar-build/liblevmar.a&amp;quot; CACHE STRING &amp;quot;library path&amp;quot;)&lt;br /&gt;
      SET(Teem_LEVMAR_IPATH &amp;quot;${LEVMAR_LEVMAR_PATH}/levmar-2.3&amp;quot; CACHE STRING &amp;quot;ipath&amp;quot;)&lt;br /&gt;
  ENDIF(Teem_LEVMAR)&lt;br /&gt;
&lt;br /&gt;
and replace the pathes with your pathes.&lt;br /&gt;
&lt;br /&gt;
====Python processing package====&lt;br /&gt;
&lt;br /&gt;
* This package can be downloaded here:&lt;br /&gt;
http://pypi.python.org/pypi/processing&lt;br /&gt;
* Install the package in Slicer3-lib/python-build/lib/python2.5/site-packages/&lt;br /&gt;
* In the top directory of the package (containing setup.py and also this INSTALL file), type&lt;br /&gt;
  python setup.py install&lt;br /&gt;
&lt;br /&gt;
==Status/Progress==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=0&lt;br /&gt;
|- bgcolor=&amp;quot;#abcdef&amp;quot;&lt;br /&gt;
! Month !! Week #  !! Start Date - End Date !! Done !! Date Done&lt;br /&gt;
|-&lt;br /&gt;
|height=5|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Find optimal parameter setting of the Two-Tensor Tractography method ||align=&amp;quot;center&amp;quot; |  || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Extend Two-Tensor Tractography module by fiducial seeding ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | NA-MIC Project Week in Salt Lake City ([http://www.na-mic.org/Wiki/index.php/2009_Winter_Project_Week],[http://www.na-mic.org/Wiki/index.php/Two-tensor_tractography_in_Slicer_using_Python_and_Teem]) ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! January !!  | Week 2 || 05.01 - 11.01 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | IGT Project Week ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 50 || 08.12 - 14.12 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! December !!  | Week 49 || 01.12 - 07.12 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to compile teem with levmar (= Levenberg-Marquardt nonlinear least squares algorithm) ||align=&amp;quot;center&amp;quot; | x || Mon Dec, 1st&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 48 !! 24.11 - 30.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | document the results of the two-tensor tractography given a tensor volume ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to do mutli trace tractography given a DWI volume ||align=&amp;quot;center&amp;quot; | x || Mon Nov, 17th&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 47 !! 17.11 - 23.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Working on Python tractography module for multi fiber tracing given a tensor volume ||align=&amp;quot;center&amp;quot; | x || Mon Nov, 17th&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 46 !! 10.11 - 16.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Get vertex data out of the nvert nrrd filled by the tractography back to Slicer ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to pass image data from Python to Teem through nrrdWrap_nva function ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to generate a list of point locations that were used as tractography seedpoints in the VTK tractography ||align=&amp;quot;center&amp;quot; | x || Thu Nov, 13th&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Implement Python tractography module for single fiber tracing given a seeding starting point and a tensor volume ||align=&amp;quot;center&amp;quot; | x || Fri, Nov, 7th&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 45 || 03.11 - 09.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to get image data from numpy (= Python package) to Teem nrrd struct ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! November !!  | Week 44 || 27.10 - 02.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;20px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to get image data from numpy (= Python package) to Teem nrrd struct ||align=&amp;quot;center&amp;quot; | x ||&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !!  Week 43 || 20.10 - 26.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to access DWI volumes through Python ||align=&amp;quot;center&amp;quot; | x || Fri Oct, 17th&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Get Teem wrapped in Python ||align=&amp;quot;center&amp;quot; | x || Fri Oct, 19th&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 42 || 13.10 - 19.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Try to implement the seeding part of the (VTK) one-tensor tractography module in Python || align=&amp;quot;center&amp;quot; | x || Tue Oct, 14th&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 41 || 06.10 - 12.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
|height=10|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Try to implement the seeding part of the (VTK) one-tensor tractography module in Python || align=&amp;quot;center&amp;quot; | x || Tue Oct, 14th&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! October !!  Week 40 || 29.09 - 5.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;20px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; |Totally understand existing Python modules in Slicer || align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; |understand existing one-tensor streamline tractography in Slicer (VTK) || align=&amp;quot;center&amp;quot; | x || Tue Sep, 23rd &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Totally understand existing Python modules in Slicer ||align=&amp;quot;center&amp;quot; | x || Tue Sep, 23rd&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !!  Week 39 || 22.09 - 28.09 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; | Slicer &amp;amp; Python Tutorials || align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; | Enable Python in Slicer || align=&amp;quot;center&amp;quot; | x || Mon Sep, 22nd&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot; &lt;br /&gt;
! September !! Week 38 || 14.09 - 21.09 || ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Information==&lt;br /&gt;
* Diffusion Tensor Analysis in Slicer: http://www.na-mic.org/Wiki/images/0/04/Slicer3diffusionTutorial7.pdf&lt;br /&gt;
* Building a Slicer 3 Module GUI: http://www.slicer.org/pages/Building_a_Slicer_3_Module_GUI&lt;br /&gt;
&lt;br /&gt;
Python:&lt;br /&gt;
* SlicerWiki about Python: http://www.slicer.org/slicerWiki/index.php/Slicer3::Python&lt;br /&gt;
* Python example modules in Slicer: http://www.slicer.org/slicerWiki/index.php/Slicer3:Execution_Model_Documentation:Python&lt;/div&gt;</summary>
		<author><name>Mseeland</name></author>
		
	</entry>
	<entry>
		<id>https://www.na-mic.org/w/index.php?title=User:Mseeland&amp;diff=37621</id>
		<title>User:Mseeland</title>
		<link rel="alternate" type="text/html" href="https://www.na-mic.org/w/index.php?title=User:Mseeland&amp;diff=37621"/>
		<updated>2009-05-20T05:07:25Z</updated>

		<summary type="html">&lt;p&gt;Mseeland: /* Python processing package */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Wiki of Madeleine Seeland =&lt;br /&gt;
&lt;br /&gt;
== General Information ==&lt;br /&gt;
&lt;br /&gt;
===About myself===&lt;br /&gt;
I am a grad student of Management Information Systems at the University of Mannheim, Germany. I'm involved in the Diffusion Tensor Imaging (DTI) project in the Laboratory of Mathematics in Imaging. Currently I'm working on two-tensor tractograohy for Neurosurgery. I will document my research experience as a diploma thesis, which I need for completing my studies in Germany.&lt;br /&gt;
&lt;br /&gt;
===Contact information===&lt;br /&gt;
E-mail: mseeland (at sign) bwh.harvard.edu&lt;br /&gt;
&lt;br /&gt;
===Collaborators &amp;amp; Contacts===&lt;br /&gt;
* Supervisors: C-F Westin, Nobuhiko Hata&lt;br /&gt;
* Gordon  Kindlmann (Teem)&lt;br /&gt;
* Sharon Peled&lt;br /&gt;
* Alireza Radmanesh&lt;br /&gt;
* Isaiah Norton&lt;br /&gt;
* Regarding Python: Steve Pieper, Julien de Siebenthal, Sylvain Bouix, Demian Wassermann, Luca Antiga&lt;br /&gt;
&lt;br /&gt;
==Project: Two-Tensor Tractography integration into Slicer==&lt;br /&gt;
&lt;br /&gt;
===Project Description===&lt;br /&gt;
*  Integration of Two-Tensor Tractography into Slicer using Python and the novel Python wrapping for Teem&lt;br /&gt;
*  Use of existing tractography methods in Teem (http://teem.sourceforge.net/)&lt;br /&gt;
*  My part: Interface between Slicer-&amp;gt;Python-&amp;gt;Teem and Teem-&amp;gt;Python-&amp;gt;Slicer&lt;br /&gt;
** pass data from VTK through Python to Teem&lt;br /&gt;
** make use of Teem tractography function calls&lt;br /&gt;
** pass resulting fiber data from Teem to Python to VTK and display fiber tracts in Slicer&lt;br /&gt;
&lt;br /&gt;
===How to enable Python in Slicer 3.3===&lt;br /&gt;
*  The current version of Slicer, Slicer 3.2, does not support Python. In order to use Python you need to install Slicer 3.3.&lt;br /&gt;
&lt;br /&gt;
*  To build Slicer Version 3.3, just do the following two commands:&lt;br /&gt;
  svn co http://svn.slicer.org/Slicer3/trunk Slicer3&lt;br /&gt;
  ./Slicer3/Scripts/getbuildtest.tcl&lt;br /&gt;
&lt;br /&gt;
*  In Slicer 3.3, Python support is disabled by default. In order to enable Python, just follow the next steps:&lt;br /&gt;
&lt;br /&gt;
# Edit slicer_variables.tcl&lt;br /&gt;
## Change &amp;quot;set ::USE_PYTHON &amp;quot;off&amp;quot;&amp;quot; to &amp;quot;on&amp;quot;&lt;br /&gt;
# '''Optional:''' If you prefer to use your system Python installation, see here: [http://www.slicer.org/slicerWiki/index.php/Slicer3::Python] &lt;br /&gt;
# '''Optional:''' installing SciPy, see here: [http://www.slicer.org/slicerWiki/index.php/Slicer3::Python]. However, there are still problems adding scipy in Slicer, whcih are not fixed yet.&lt;br /&gt;
&lt;br /&gt;
*  Rebuild Slicer3 using &amp;quot;getbuildtest.tcl&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 ./Slicer3/Scripts/getbuildtest.tcl&lt;br /&gt;
&lt;br /&gt;
A new menu command '''Python Interpreter''' should appear on the Window menu in Slicer. This command should bring up the Python Console window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Prerequisites for Two-Tensor Tractography module===&lt;br /&gt;
====Teem Python wrapping====&lt;br /&gt;
&lt;br /&gt;
=====BACKGROUND=====&lt;br /&gt;
* Teem Python wrapping is needed to make use of existing Two-Tensor tractography functions in Teem in Python&lt;br /&gt;
* The Python wrappings are based on ctypes, as well as a ctypes code generator (called &amp;quot;ctypeslib&amp;quot;)&lt;br /&gt;
** http://python.net/crew/theller/ctypes&lt;br /&gt;
** http://starship.python.net/crew/theller/wiki/CodeGenerator&lt;br /&gt;
** http://starship.python.net/crew/theller/ctypes/old/codegen.html&lt;br /&gt;
* Ctypes is a standard part of python, by which C functions in a shared library can be called from Python&lt;br /&gt;
* The ctypes code generator converts declarations in C header files into executable Python code: enums, structs, unions, function declarations, com interfaces, and preprocessor definitions.&lt;br /&gt;
* Creating wrappers for C header file(s) is a two step process. &lt;br /&gt;
** First, the ``h2xml.py`` script runs GCC-XML_ over the include file(s), creating a XML file containing declarations and definitions.  &lt;br /&gt;
** Second, the ``xml2py.py`` script parses the XML files and creates Python code containing all or a subset of these definitions.&lt;br /&gt;
* Python code is generated for C enums, structure, unions, typedefs and function declarations.&lt;br /&gt;
&lt;br /&gt;
=====REQUIREMENTS=====&lt;br /&gt;
* Ctypeslib: ctypeslib is an extension package for ctypes. It contains a ctypes code generator.&lt;br /&gt;
* GCC-XML is required to parse C header files into an XML description.&lt;br /&gt;
&lt;br /&gt;
=====GETTING THE SOFTWARE=====&lt;br /&gt;
* Python 2.6 can be got here (anything after 2.5 should work): http://www.python.org/download/&lt;br /&gt;
* Get gccxml (I used version 0.9.0), which can be got by CVS as described here: http://www.gccxml.org/HTML/Download.html&lt;br /&gt;
** follow the installation as described here: http://www.gccxml.org/HTML/Install.html&lt;br /&gt;
* use a version of ctypeslib which work with the version of gccxml: &lt;br /&gt;
  http://svn.python.org/projects/ctypes/branches/ctypeslib-gccxml-0.9&lt;br /&gt;
* But this requires some patches to work; the content of the &amp;quot;fixes.patch&amp;quot; file can be found here: [[http://wiki.na-mic.org/Wiki/images/3/3b/Fixes.patch.txt]]:&lt;br /&gt;
   svn co http://svn.python.org/projects/ctypes/branches/ctypeslib-gccxml-0.9&lt;br /&gt;
   cd ctypeslib-gccxml-0.9&lt;br /&gt;
   patch -p0 &amp;lt; ../fixes.patch&lt;br /&gt;
   cd ..&lt;br /&gt;
* ctypeslib is written in python =&amp;gt; there's nothing new to compile at this point&lt;br /&gt;
&lt;br /&gt;
=====CREATING PYTHON/TEEM=====&lt;br /&gt;
* First get Teem (starting from whatever directory should contain the &amp;quot;teem&amp;quot; source dir):&lt;br /&gt;
  svn co https://teem.svn.sourceforge.net/svnroot/teem/teem/trunk teem&lt;br /&gt;
and compile it as a shared library.  Directions for doing this with cmake are here:&lt;br /&gt;
  http://teem.sourceforge.net/build.html&lt;br /&gt;
* create the wrappings in a new directory (e.g. &amp;quot;teem-wrap&amp;quot;), where the XML and Python output will be&lt;br /&gt;
* Set the environment variables that identify where Teem and ctypeslib are:&lt;br /&gt;
** TEEM is where Teem's &amp;quot;make install&amp;quot; put subdirectories &amp;quot;bin&amp;quot;, &amp;quot;lib&amp;quot;, and &amp;quot;include&amp;quot; (e.g. ~/teem-build)&lt;br /&gt;
** CTYPES is the full path of ctypeslib-gccxml-0.9&lt;br /&gt;
* First create (in, for example, &amp;quot;teem-wrap&amp;quot;) a meta-header for all the Teem header files (in tcsh):&lt;br /&gt;
   mkdir teemincl&lt;br /&gt;
   cp -r ${TEEM}/include/teem teemincl&lt;br /&gt;
   cd teemincl&lt;br /&gt;
   ls -1 teem/*.h | awk '{print &amp;quot;#include &amp;lt;&amp;quot;$1&amp;quot;&amp;gt;&amp;quot;}' &amp;gt; all.h&lt;br /&gt;
   cd ..&lt;br /&gt;
* Then create teem.xml:&lt;br /&gt;
   setenv PYTHONPATH $CTYPES&lt;br /&gt;
   python $CTYPES/scripts/h2xml.py `pwd`/teemincl/all.h -I teemincl -o teem.xml &lt;br /&gt;
* Then create teem.py (use DYLD_LIBRARY_PATH in a mac):&lt;br /&gt;
   setenv LD_LIBRARY_PATH ${TEEM}/lib&lt;br /&gt;
   python $CTYPES/scripts/xml2py.py teem.xml -llibteem.so -o teem.py \&lt;br /&gt;
        -r &amp;quot;(air|hest|biff|nrrd|ell|unrrdu|moss|gage|bane|limn|seek|hoover|echo|ten|dye|mite).*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
====LEVMAR====&lt;br /&gt;
&lt;br /&gt;
* The 2-tensor tractography depends on Levenberg-Marquardt nonlinear optimization of Sharon Peled's constrained two-tensor model. I used the following implementation for it: http://www.ics.forth.gr/~lourakis/levmar/&lt;br /&gt;
* First, in lm.h you need to uncomment the line that says: #undef HAVE_LAPACK (around line 30)&lt;br /&gt;
* The levmar code is enabled by compiling Teem with TEEM_LEVMAR defined (turn LEVMAR ON while doing ccmake). The include paths and library link paths also need to be defined for everything to work.&lt;br /&gt;
* Here are the changes in the teem/CMakeLists.txt file that work for me:&lt;br /&gt;
&lt;br /&gt;
Replace the following line&lt;br /&gt;
  # Look for &amp;quot;levmar&amp;quot; library &amp;lt;http://www.ics.forth.gr/~lourakis/levmar/&amp;gt;&lt;br /&gt;
  OPTION(Teem_LEVMAR &amp;quot;Build Teem with levmar library support.&amp;quot; OFF)&lt;br /&gt;
  SET(Teem_LEVMAR_LIB &amp;quot;&amp;quot;)&lt;br /&gt;
  IF(Teem_LEVMAR)&lt;br /&gt;
    FIND_PACKAGE(LEVMAR)&lt;br /&gt;
    IF(LEVMAR_FOUND)&lt;br /&gt;
      ADD_DEFINITIONS(-DTEEM_LEVMAR)&lt;br /&gt;
      SET(Teem_LEVMAR_LIB ${LEVMAR_LIBRARIES})&lt;br /&gt;
      SET(Teem_LEVMAR_IPATH ${LEVMAR_INCLUDE_DIR})&lt;br /&gt;
    ELSE(LEVMAR_FOUND)&lt;br /&gt;
      # We need to set this as a cache variable, so that it will show up as&lt;br /&gt;
      # being turned off in the cache.&lt;br /&gt;
      MESSAGE(SEND_ERROR &amp;quot;Turning off Teem_LEVMAR, because it wasn't found.&amp;quot;)&lt;br /&gt;
      SET(Teem_LEVMAR OFF CACHE BOOL &amp;quot;Build Teem with levmar library support.&amp;quot; FORCE)&lt;br /&gt;
    ENDIF(LEVMAR_FOUND)&lt;br /&gt;
  ENDIF(Teem_LEVMAR)&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
&lt;br /&gt;
  # Look for &amp;quot;levmar&amp;quot; library &amp;lt;http://www.ics.forth.gr/~lourakis/levmar/&amp;gt;&lt;br /&gt;
  OPTION(Teem_LEVMAR &amp;quot;Build Teem with levmar library support.&amp;quot; OFF)&lt;br /&gt;
  IF(Teem_LEVMAR)&lt;br /&gt;
      ADD_DEFINITIONS(-DTEEM_LEVMAR)&lt;br /&gt;
      SET(Teem_LEVMAR_PATH &amp;quot;/media/sda7/Programming/levmar&amp;quot;)&lt;br /&gt;
      SET(Teem_LEVMAR_LIB &amp;quot;${LEVMAR_LEVMAR_PATH}/levmar-build/liblevmar.a&amp;quot; CACHE STRING &amp;quot;library path&amp;quot;)&lt;br /&gt;
      SET(Teem_LEVMAR_IPATH &amp;quot;${LEVMAR_LEVMAR_PATH}/levmar-2.3&amp;quot; CACHE STRING &amp;quot;ipath&amp;quot;)&lt;br /&gt;
  ENDIF(Teem_LEVMAR)&lt;br /&gt;
&lt;br /&gt;
and replace the pathes with your pathes.&lt;br /&gt;
&lt;br /&gt;
====Python processing package====&lt;br /&gt;
&lt;br /&gt;
* This package can be downloaded here:&lt;br /&gt;
http://pypi.python.org/pypi/processing&lt;br /&gt;
* Install the package in Slicer3-lib/python-build/lib/python2.5/site-packages/&lt;br /&gt;
* In the top directory of the package (containing setup.py and also this INSTALL file), type&lt;br /&gt;
  python setup.py install&lt;br /&gt;
&lt;br /&gt;
==Status/Progress==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=0&lt;br /&gt;
|- bgcolor=&amp;quot;#abcdef&amp;quot;&lt;br /&gt;
! Month !! Week #  !! Start Date - End Date !! Done !! Date Done&lt;br /&gt;
|-&lt;br /&gt;
|height=5|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Find optimal parameter setting of the Two-Tensor Tractography method ||align=&amp;quot;center&amp;quot; |  || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Extend Two-Tensor Tractography module by fiducial seeding ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | NA-MIC Project Week in Salt Lake City ([http://www.na-mic.org/Wiki/index.php/2009_Winter_Project_Week],[http://www.na-mic.org/Wiki/index.php/Two-tensor_tractography_in_Slicer_using_Python_and_Teem]) ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! January !!  | Week 2 || 05.01 - 11.01 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | IGT Project Week ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 50 || 08.12 - 14.12 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! December !!  | Week 49 || 01.12 - 07.12 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to compile teem with levmar (= Levenberg-Marquardt nonlinear least squares algorithm) ||align=&amp;quot;center&amp;quot; | x || Mon Dec, 1st&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 48 !! 24.11 - 30.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | document the results of the two-tensor tractography given a tensor volume ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to do mutli trace tractography given a DWI volume ||align=&amp;quot;center&amp;quot; | x || Mon Nov, 17th&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 47 !! 17.11 - 23.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Working on Python tractography module for multi fiber tracing given a tensor volume ||align=&amp;quot;center&amp;quot; | x || Mon Nov, 17th&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 46 !! 10.11 - 16.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Get vertex data out of the nvert nrrd filled by the tractography back to Slicer ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to pass image data from Python to Teem through nrrdWrap_nva function ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to generate a list of point locations that were used as tractography seedpoints in the VTK tractography ||align=&amp;quot;center&amp;quot; | x || Thu Nov, 13th&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Implement Python tractography module for single fiber tracing given a seeding starting point and a tensor volume ||align=&amp;quot;center&amp;quot; | x || Fri, Nov, 7th&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 45 || 03.11 - 09.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to get image data from numpy (= Python package) to Teem nrrd struct ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! November !!  | Week 44 || 27.10 - 02.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;20px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to get image data from numpy (= Python package) to Teem nrrd struct ||align=&amp;quot;center&amp;quot; | x ||&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !!  Week 43 || 20.10 - 26.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to access DWI volumes through Python ||align=&amp;quot;center&amp;quot; | x || Fri Oct, 17th&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Get Teem wrapped in Python ||align=&amp;quot;center&amp;quot; | x || Fri Oct, 19th&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 42 || 13.10 - 19.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Try to implement the seeding part of the (VTK) one-tensor tractography module in Python || align=&amp;quot;center&amp;quot; | x || Tue Oct, 14th&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 41 || 06.10 - 12.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
|height=10|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Try to implement the seeding part of the (VTK) one-tensor tractography module in Python || align=&amp;quot;center&amp;quot; | x || Tue Oct, 14th&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! October !!  Week 40 || 29.09 - 5.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;20px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; |Totally understand existing Python modules in Slicer || align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; |understand existing one-tensor streamline tractography in Slicer (VTK) || align=&amp;quot;center&amp;quot; | x || Tue Sep, 23rd &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Totally understand existing Python modules in Slicer ||align=&amp;quot;center&amp;quot; | x || Tue Sep, 23rd&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !!  Week 39 || 22.09 - 28.09 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; | Slicer &amp;amp; Python Tutorials || align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; | Enable Python in Slicer || align=&amp;quot;center&amp;quot; | x || Mon Sep, 22nd&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot; &lt;br /&gt;
! September !! Week 38 || 14.09 - 21.09 || ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Information==&lt;br /&gt;
* Diffusion Tensor Analysis in Slicer: http://www.na-mic.org/Wiki/images/0/04/Slicer3diffusionTutorial7.pdf&lt;br /&gt;
* Building a Slicer 3 Module GUI: http://www.slicer.org/pages/Building_a_Slicer_3_Module_GUI&lt;br /&gt;
&lt;br /&gt;
Python:&lt;br /&gt;
* SlicerWiki about Python: http://www.slicer.org/slicerWiki/index.php/Slicer3::Python&lt;br /&gt;
* Python example modules in Slicer: http://www.slicer.org/slicerWiki/index.php/Slicer3:Execution_Model_Documentation:Python&lt;/div&gt;</summary>
		<author><name>Mseeland</name></author>
		
	</entry>
	<entry>
		<id>https://www.na-mic.org/w/index.php?title=User:Mseeland&amp;diff=36464</id>
		<title>User:Mseeland</title>
		<link rel="alternate" type="text/html" href="https://www.na-mic.org/w/index.php?title=User:Mseeland&amp;diff=36464"/>
		<updated>2009-04-22T18:26:15Z</updated>

		<summary type="html">&lt;p&gt;Mseeland: /* REQUIREMENTS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Wiki of Madeleine Seeland =&lt;br /&gt;
&lt;br /&gt;
== General Information ==&lt;br /&gt;
&lt;br /&gt;
===About myself===&lt;br /&gt;
I am a grad student of Management Information Systems at the University of Mannheim, Germany. I'm involved in the Diffusion Tensor Imaging (DTI) project in the Laboratory of Mathematics in Imaging. Currently I'm working on two-tensor tractograohy for Neurosurgery. I will document my research experience as a diploma thesis, which I need for completing my studies in Germany.&lt;br /&gt;
&lt;br /&gt;
===Contact information===&lt;br /&gt;
E-mail: mseeland (at sign) bwh.harvard.edu&lt;br /&gt;
&lt;br /&gt;
===Collaborators &amp;amp; Contacts===&lt;br /&gt;
* Supervisors: C-F Westin, Nobuhiko Hata&lt;br /&gt;
* Gordon  Kindlmann (Teem)&lt;br /&gt;
* Sharon Peled&lt;br /&gt;
* Alireza Radmanesh&lt;br /&gt;
* Isaiah Norton&lt;br /&gt;
* Regarding Python: Steve Pieper, Julien de Siebenthal, Sylvain Bouix, Demian Wassermann, Luca Antiga&lt;br /&gt;
&lt;br /&gt;
==Project: Two-Tensor Tractography integration into Slicer==&lt;br /&gt;
&lt;br /&gt;
===Project Description===&lt;br /&gt;
*  Integration of Two-Tensor Tractography into Slicer using Python and the novel Python wrapping for Teem&lt;br /&gt;
*  Use of existing tractography methods in Teem (http://teem.sourceforge.net/)&lt;br /&gt;
*  My part: Interface between Slicer-&amp;gt;Python-&amp;gt;Teem and Teem-&amp;gt;Python-&amp;gt;Slicer&lt;br /&gt;
** pass data from VTK through Python to Teem&lt;br /&gt;
** make use of Teem tractography function calls&lt;br /&gt;
** pass resulting fiber data from Teem to Python to VTK and display fiber tracts in Slicer&lt;br /&gt;
&lt;br /&gt;
===How to enable Python in Slicer 3.3===&lt;br /&gt;
*  The current version of Slicer, Slicer 3.2, does not support Python. In order to use Python you need to install Slicer 3.3.&lt;br /&gt;
&lt;br /&gt;
*  To build Slicer Version 3.3, just do the following two commands:&lt;br /&gt;
  svn co http://svn.slicer.org/Slicer3/trunk Slicer3&lt;br /&gt;
  ./Slicer3/Scripts/getbuildtest.tcl&lt;br /&gt;
&lt;br /&gt;
*  In Slicer 3.3, Python support is disabled by default. In order to enable Python, just follow the next steps:&lt;br /&gt;
&lt;br /&gt;
# Edit slicer_variables.tcl&lt;br /&gt;
## Change &amp;quot;set ::USE_PYTHON &amp;quot;off&amp;quot;&amp;quot; to &amp;quot;on&amp;quot;&lt;br /&gt;
# '''Optional:''' If you prefer to use your system Python installation, see here: [http://www.slicer.org/slicerWiki/index.php/Slicer3::Python] &lt;br /&gt;
# '''Optional:''' installing SciPy, see here: [http://www.slicer.org/slicerWiki/index.php/Slicer3::Python]. However, there are still problems adding scipy in Slicer, whcih are not fixed yet.&lt;br /&gt;
&lt;br /&gt;
*  Rebuild Slicer3 using &amp;quot;getbuildtest.tcl&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 ./Slicer3/Scripts/getbuildtest.tcl&lt;br /&gt;
&lt;br /&gt;
A new menu command '''Python Interpreter''' should appear on the Window menu in Slicer. This command should bring up the Python Console window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Prerequisites for Two-Tensor Tractography module===&lt;br /&gt;
====Teem Python wrapping====&lt;br /&gt;
&lt;br /&gt;
=====BACKGROUND=====&lt;br /&gt;
* Teem Python wrapping is needed to make use of existing Two-Tensor tractography functions in Teem in Python&lt;br /&gt;
* The Python wrappings are based on ctypes, as well as a ctypes code generator (called &amp;quot;ctypeslib&amp;quot;)&lt;br /&gt;
** http://python.net/crew/theller/ctypes&lt;br /&gt;
** http://starship.python.net/crew/theller/wiki/CodeGenerator&lt;br /&gt;
** http://starship.python.net/crew/theller/ctypes/old/codegen.html&lt;br /&gt;
* Ctypes is a standard part of python, by which C functions in a shared library can be called from Python&lt;br /&gt;
* The ctypes code generator converts declarations in C header files into executable Python code: enums, structs, unions, function declarations, com interfaces, and preprocessor definitions.&lt;br /&gt;
* Creating wrappers for C header file(s) is a two step process. &lt;br /&gt;
** First, the ``h2xml.py`` script runs GCC-XML_ over the include file(s), creating a XML file containing declarations and definitions.  &lt;br /&gt;
** Second, the ``xml2py.py`` script parses the XML files and creates Python code containing all or a subset of these definitions.&lt;br /&gt;
* Python code is generated for C enums, structure, unions, typedefs and function declarations.&lt;br /&gt;
&lt;br /&gt;
=====REQUIREMENTS=====&lt;br /&gt;
* Ctypeslib: ctypeslib is an extension package for ctypes. It contains a ctypes code generator.&lt;br /&gt;
* GCC-XML is required to parse C header files into an XML description.&lt;br /&gt;
&lt;br /&gt;
=====GETTING THE SOFTWARE=====&lt;br /&gt;
* Python 2.6 can be got here (anything after 2.5 should work): http://www.python.org/download/&lt;br /&gt;
* Get gccxml (I used version 0.9.0), which can be got by CVS as described here: http://www.gccxml.org/HTML/Download.html&lt;br /&gt;
** follow the installation as described here: http://www.gccxml.org/HTML/Install.html&lt;br /&gt;
* use a version of ctypeslib which work with the version of gccxml: &lt;br /&gt;
  http://svn.python.org/projects/ctypes/branches/ctypeslib-gccxml-0.9&lt;br /&gt;
* But this requires some patches to work; the content of the &amp;quot;fixes.patch&amp;quot; file can be found here: [[http://wiki.na-mic.org/Wiki/images/3/3b/Fixes.patch.txt]]:&lt;br /&gt;
   svn co http://svn.python.org/projects/ctypes/branches/ctypeslib-gccxml-0.9&lt;br /&gt;
   cd ctypeslib-gccxml-0.9&lt;br /&gt;
   patch -p0 &amp;lt; ../fixes.patch&lt;br /&gt;
   cd ..&lt;br /&gt;
* ctypeslib is written in python =&amp;gt; there's nothing new to compile at this point&lt;br /&gt;
&lt;br /&gt;
=====CREATING PYTHON/TEEM=====&lt;br /&gt;
* First get Teem (starting from whatever directory should contain the &amp;quot;teem&amp;quot; source dir):&lt;br /&gt;
  svn co https://teem.svn.sourceforge.net/svnroot/teem/teem/trunk teem&lt;br /&gt;
and compile it as a shared library.  Directions for doing this with cmake are here:&lt;br /&gt;
  http://teem.sourceforge.net/build.html&lt;br /&gt;
* create the wrappings in a new directory (e.g. &amp;quot;teem-wrap&amp;quot;), where the XML and Python output will be&lt;br /&gt;
* Set the environment variables that identify where Teem and ctypeslib are:&lt;br /&gt;
** TEEM is where Teem's &amp;quot;make install&amp;quot; put subdirectories &amp;quot;bin&amp;quot;, &amp;quot;lib&amp;quot;, and &amp;quot;include&amp;quot; (e.g. ~/teem-build)&lt;br /&gt;
** CTYPES is the full path of ctypeslib-gccxml-0.9&lt;br /&gt;
* First create (in, for example, &amp;quot;teem-wrap&amp;quot;) a meta-header for all the Teem header files (in tcsh):&lt;br /&gt;
   mkdir teemincl&lt;br /&gt;
   cp -r ${TEEM}/include/teem teemincl&lt;br /&gt;
   cd teemincl&lt;br /&gt;
   ls -1 teem/*.h | awk '{print &amp;quot;#include &amp;lt;&amp;quot;$1&amp;quot;&amp;gt;&amp;quot;}' &amp;gt; all.h&lt;br /&gt;
   cd ..&lt;br /&gt;
* Then create teem.xml:&lt;br /&gt;
   setenv PYTHONPATH $CTYPES&lt;br /&gt;
   python $CTYPES/scripts/h2xml.py `pwd`/teemincl/all.h -I teemincl -o teem.xml &lt;br /&gt;
* Then create teem.py (use DYLD_LIBRARY_PATH in a mac):&lt;br /&gt;
   setenv LD_LIBRARY_PATH ${TEEM}/lib&lt;br /&gt;
   python $CTYPES/scripts/xml2py.py teem.xml -llibteem.so -o teem.py \&lt;br /&gt;
        -r &amp;quot;(air|hest|biff|nrrd|ell|unrrdu|moss|gage|bane|limn|seek|hoover|echo|ten|dye|mite).*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
====LEVMAR====&lt;br /&gt;
&lt;br /&gt;
* The 2-tensor tractography depends on Levenberg-Marquardt nonlinear optimization of Sharon Peled's constrained two-tensor model. I used the following implementation for it: http://www.ics.forth.gr/~lourakis/levmar/&lt;br /&gt;
* First, in lm.h you need to uncomment the line that says: #undef HAVE_LAPACK (around line 30)&lt;br /&gt;
* The levmar code is enabled by compiling Teem with TEEM_LEVMAR defined (turn LEVMAR ON while doing ccmake). The include paths and library link paths also need to be defined for everything to work.&lt;br /&gt;
* Here are the changes in the teem/CMakeLists.txt file that work for me:&lt;br /&gt;
&lt;br /&gt;
Replace the following line&lt;br /&gt;
  # Look for &amp;quot;levmar&amp;quot; library &amp;lt;http://www.ics.forth.gr/~lourakis/levmar/&amp;gt;&lt;br /&gt;
  OPTION(Teem_LEVMAR &amp;quot;Build Teem with levmar library support.&amp;quot; OFF)&lt;br /&gt;
  SET(Teem_LEVMAR_LIB &amp;quot;&amp;quot;)&lt;br /&gt;
  IF(Teem_LEVMAR)&lt;br /&gt;
    FIND_PACKAGE(LEVMAR)&lt;br /&gt;
    IF(LEVMAR_FOUND)&lt;br /&gt;
      ADD_DEFINITIONS(-DTEEM_LEVMAR)&lt;br /&gt;
      SET(Teem_LEVMAR_LIB ${LEVMAR_LIBRARIES})&lt;br /&gt;
      SET(Teem_LEVMAR_IPATH ${LEVMAR_INCLUDE_DIR})&lt;br /&gt;
    ELSE(LEVMAR_FOUND)&lt;br /&gt;
      # We need to set this as a cache variable, so that it will show up as&lt;br /&gt;
      # being turned off in the cache.&lt;br /&gt;
      MESSAGE(SEND_ERROR &amp;quot;Turning off Teem_LEVMAR, because it wasn't found.&amp;quot;)&lt;br /&gt;
      SET(Teem_LEVMAR OFF CACHE BOOL &amp;quot;Build Teem with levmar library support.&amp;quot; FORCE)&lt;br /&gt;
    ENDIF(LEVMAR_FOUND)&lt;br /&gt;
  ENDIF(Teem_LEVMAR)&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
&lt;br /&gt;
  # Look for &amp;quot;levmar&amp;quot; library &amp;lt;http://www.ics.forth.gr/~lourakis/levmar/&amp;gt;&lt;br /&gt;
  OPTION(Teem_LEVMAR &amp;quot;Build Teem with levmar library support.&amp;quot; OFF)&lt;br /&gt;
  IF(Teem_LEVMAR)&lt;br /&gt;
      ADD_DEFINITIONS(-DTEEM_LEVMAR)&lt;br /&gt;
      SET(Teem_LEVMAR_PATH &amp;quot;/media/sda7/Programming/levmar&amp;quot;)&lt;br /&gt;
      SET(Teem_LEVMAR_LIB &amp;quot;${LEVMAR_LEVMAR_PATH}/levmar-build/liblevmar.a&amp;quot; CACHE STRING &amp;quot;library path&amp;quot;)&lt;br /&gt;
      SET(Teem_LEVMAR_IPATH &amp;quot;${LEVMAR_LEVMAR_PATH}/levmar-2.3&amp;quot; CACHE STRING &amp;quot;ipath&amp;quot;)&lt;br /&gt;
  ENDIF(Teem_LEVMAR)&lt;br /&gt;
&lt;br /&gt;
and replace the pathes with your pathes.&lt;br /&gt;
&lt;br /&gt;
====Python processing package====&lt;br /&gt;
&lt;br /&gt;
* This package needs to be downloaded here:&lt;br /&gt;
http://pypi.python.org/pypi/processing&lt;br /&gt;
* Install the package in Slicer3-lib/python-build/lib/python2.5/site-packages/&lt;br /&gt;
* In the top directory of the package (containing setup.py and also this INSTALL file), type&lt;br /&gt;
  python setup.py install&lt;br /&gt;
&lt;br /&gt;
==Status/Progress==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=0&lt;br /&gt;
|- bgcolor=&amp;quot;#abcdef&amp;quot;&lt;br /&gt;
! Month !! Week #  !! Start Date - End Date !! Done !! Date Done&lt;br /&gt;
|-&lt;br /&gt;
|height=5|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Find optimal parameter setting of the Two-Tensor Tractography method ||align=&amp;quot;center&amp;quot; |  || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Extend Two-Tensor Tractography module by fiducial seeding ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | NA-MIC Project Week in Salt Lake City ([http://www.na-mic.org/Wiki/index.php/2009_Winter_Project_Week],[http://www.na-mic.org/Wiki/index.php/Two-tensor_tractography_in_Slicer_using_Python_and_Teem]) ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! January !!  | Week 2 || 05.01 - 11.01 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | IGT Project Week ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 50 || 08.12 - 14.12 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! December !!  | Week 49 || 01.12 - 07.12 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to compile teem with levmar (= Levenberg-Marquardt nonlinear least squares algorithm) ||align=&amp;quot;center&amp;quot; | x || Mon Dec, 1st&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 48 !! 24.11 - 30.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | document the results of the two-tensor tractography given a tensor volume ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to do mutli trace tractography given a DWI volume ||align=&amp;quot;center&amp;quot; | x || Mon Nov, 17th&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 47 !! 17.11 - 23.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Working on Python tractography module for multi fiber tracing given a tensor volume ||align=&amp;quot;center&amp;quot; | x || Mon Nov, 17th&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 46 !! 10.11 - 16.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Get vertex data out of the nvert nrrd filled by the tractography back to Slicer ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to pass image data from Python to Teem through nrrdWrap_nva function ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to generate a list of point locations that were used as tractography seedpoints in the VTK tractography ||align=&amp;quot;center&amp;quot; | x || Thu Nov, 13th&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Implement Python tractography module for single fiber tracing given a seeding starting point and a tensor volume ||align=&amp;quot;center&amp;quot; | x || Fri, Nov, 7th&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 45 || 03.11 - 09.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to get image data from numpy (= Python package) to Teem nrrd struct ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! November !!  | Week 44 || 27.10 - 02.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;20px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to get image data from numpy (= Python package) to Teem nrrd struct ||align=&amp;quot;center&amp;quot; | x ||&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !!  Week 43 || 20.10 - 26.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to access DWI volumes through Python ||align=&amp;quot;center&amp;quot; | x || Fri Oct, 17th&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Get Teem wrapped in Python ||align=&amp;quot;center&amp;quot; | x || Fri Oct, 19th&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 42 || 13.10 - 19.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Try to implement the seeding part of the (VTK) one-tensor tractography module in Python || align=&amp;quot;center&amp;quot; | x || Tue Oct, 14th&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 41 || 06.10 - 12.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
|height=10|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Try to implement the seeding part of the (VTK) one-tensor tractography module in Python || align=&amp;quot;center&amp;quot; | x || Tue Oct, 14th&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! October !!  Week 40 || 29.09 - 5.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;20px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; |Totally understand existing Python modules in Slicer || align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; |understand existing one-tensor streamline tractography in Slicer (VTK) || align=&amp;quot;center&amp;quot; | x || Tue Sep, 23rd &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Totally understand existing Python modules in Slicer ||align=&amp;quot;center&amp;quot; | x || Tue Sep, 23rd&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !!  Week 39 || 22.09 - 28.09 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; | Slicer &amp;amp; Python Tutorials || align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; | Enable Python in Slicer || align=&amp;quot;center&amp;quot; | x || Mon Sep, 22nd&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot; &lt;br /&gt;
! September !! Week 38 || 14.09 - 21.09 || ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Information==&lt;br /&gt;
* Diffusion Tensor Analysis in Slicer: http://www.na-mic.org/Wiki/images/0/04/Slicer3diffusionTutorial7.pdf&lt;br /&gt;
* Building a Slicer 3 Module GUI: http://www.slicer.org/pages/Building_a_Slicer_3_Module_GUI&lt;br /&gt;
&lt;br /&gt;
Python:&lt;br /&gt;
* SlicerWiki about Python: http://www.slicer.org/slicerWiki/index.php/Slicer3::Python&lt;br /&gt;
* Python example modules in Slicer: http://www.slicer.org/slicerWiki/index.php/Slicer3:Execution_Model_Documentation:Python&lt;/div&gt;</summary>
		<author><name>Mseeland</name></author>
		
	</entry>
	<entry>
		<id>https://www.na-mic.org/w/index.php?title=User:Mseeland&amp;diff=36454</id>
		<title>User:Mseeland</title>
		<link rel="alternate" type="text/html" href="https://www.na-mic.org/w/index.php?title=User:Mseeland&amp;diff=36454"/>
		<updated>2009-04-22T09:11:02Z</updated>

		<summary type="html">&lt;p&gt;Mseeland: /* Python processing package */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Wiki of Madeleine Seeland =&lt;br /&gt;
&lt;br /&gt;
== General Information ==&lt;br /&gt;
&lt;br /&gt;
===About myself===&lt;br /&gt;
I am a grad student of Management Information Systems at the University of Mannheim, Germany. I'm involved in the Diffusion Tensor Imaging (DTI) project in the Laboratory of Mathematics in Imaging. Currently I'm working on two-tensor tractograohy for Neurosurgery. I will document my research experience as a diploma thesis, which I need for completing my studies in Germany.&lt;br /&gt;
&lt;br /&gt;
===Contact information===&lt;br /&gt;
E-mail: mseeland (at sign) bwh.harvard.edu&lt;br /&gt;
&lt;br /&gt;
===Collaborators &amp;amp; Contacts===&lt;br /&gt;
* Supervisors: C-F Westin, Nobuhiko Hata&lt;br /&gt;
* Gordon  Kindlmann (Teem)&lt;br /&gt;
* Sharon Peled&lt;br /&gt;
* Alireza Radmanesh&lt;br /&gt;
* Isaiah Norton&lt;br /&gt;
* Regarding Python: Steve Pieper, Julien de Siebenthal, Sylvain Bouix, Demian Wassermann, Luca Antiga&lt;br /&gt;
&lt;br /&gt;
==Project: Two-Tensor Tractography integration into Slicer==&lt;br /&gt;
&lt;br /&gt;
===Project Description===&lt;br /&gt;
*  Integration of Two-Tensor Tractography into Slicer using Python and the novel Python wrapping for Teem&lt;br /&gt;
*  Use of existing tractography methods in Teem (http://teem.sourceforge.net/)&lt;br /&gt;
*  My part: Interface between Slicer-&amp;gt;Python-&amp;gt;Teem and Teem-&amp;gt;Python-&amp;gt;Slicer&lt;br /&gt;
** pass data from VTK through Python to Teem&lt;br /&gt;
** make use of Teem tractography function calls&lt;br /&gt;
** pass resulting fiber data from Teem to Python to VTK and display fiber tracts in Slicer&lt;br /&gt;
&lt;br /&gt;
===How to enable Python in Slicer 3.3===&lt;br /&gt;
*  The current version of Slicer, Slicer 3.2, does not support Python. In order to use Python you need to install Slicer 3.3.&lt;br /&gt;
&lt;br /&gt;
*  To build Slicer Version 3.3, just do the following two commands:&lt;br /&gt;
  svn co http://svn.slicer.org/Slicer3/trunk Slicer3&lt;br /&gt;
  ./Slicer3/Scripts/getbuildtest.tcl&lt;br /&gt;
&lt;br /&gt;
*  In Slicer 3.3, Python support is disabled by default. In order to enable Python, just follow the next steps:&lt;br /&gt;
&lt;br /&gt;
# Edit slicer_variables.tcl&lt;br /&gt;
## Change &amp;quot;set ::USE_PYTHON &amp;quot;off&amp;quot;&amp;quot; to &amp;quot;on&amp;quot;&lt;br /&gt;
# '''Optional:''' If you prefer to use your system Python installation, see here: [http://www.slicer.org/slicerWiki/index.php/Slicer3::Python] &lt;br /&gt;
# '''Optional:''' installing SciPy, see here: [http://www.slicer.org/slicerWiki/index.php/Slicer3::Python]. However, there are still problems adding scipy in Slicer, whcih are not fixed yet.&lt;br /&gt;
&lt;br /&gt;
*  Rebuild Slicer3 using &amp;quot;getbuildtest.tcl&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 ./Slicer3/Scripts/getbuildtest.tcl&lt;br /&gt;
&lt;br /&gt;
A new menu command '''Python Interpreter''' should appear on the Window menu in Slicer. This command should bring up the Python Console window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Prerequisites for Two-Tensor Tractography module===&lt;br /&gt;
====Teem Python wrapping====&lt;br /&gt;
&lt;br /&gt;
=====BACKGROUND=====&lt;br /&gt;
* Teem Python wrapping is needed to make use of existing Two-Tensor tractography functions in Teem in Python&lt;br /&gt;
* The Python wrappings are based on ctypes, as well as a ctypes code generator (called &amp;quot;ctypeslib&amp;quot;)&lt;br /&gt;
** http://python.net/crew/theller/ctypes&lt;br /&gt;
** http://starship.python.net/crew/theller/wiki/CodeGenerator&lt;br /&gt;
** http://starship.python.net/crew/theller/ctypes/old/codegen.html&lt;br /&gt;
* Ctypes is a standard part of python, by which C functions in a shared library can be called from Python&lt;br /&gt;
* The ctypes code generator converts declarations in C header files into executable Python code: enums, structs, unions, function declarations, com interfaces, and preprocessor definitions.&lt;br /&gt;
* Creating wrappers for C header file(s) is a two step process. &lt;br /&gt;
** First, the ``h2xml.py`` script runs GCC-XML_ over the include file(s), creating a XML file containing declarations and definitions.  &lt;br /&gt;
** Second, the ``xml2py.py`` script parses the XML files and creates Python code containing all or a subset of these definitions.&lt;br /&gt;
* Python code is generated for C enums, structure, unions, typedefs and function declarations.&lt;br /&gt;
&lt;br /&gt;
=====REQUIREMENTS=====&lt;br /&gt;
* Ctypeslib: ctypeslib is an extension package for ctypes. It contains a ctypes code generator.&lt;br /&gt;
* GCC-XML (from http://www.gccxml.org/) is required to parse C header files into an XML description.&lt;br /&gt;
&lt;br /&gt;
=====GETTING THE SOFTWARE=====&lt;br /&gt;
* Python 2.6 can be got here (anything after 2.5 should work): http://www.python.org/download/&lt;br /&gt;
* Get gccxml (I used version 0.9.0), which can be got by CVS as described here: http://www.gccxml.org/HTML/Download.html&lt;br /&gt;
** follow the installation as described here: http://www.gccxml.org/HTML/Install.html&lt;br /&gt;
* use a version of ctypeslib which work with the version of gccxml: &lt;br /&gt;
  http://svn.python.org/projects/ctypes/branches/ctypeslib-gccxml-0.9&lt;br /&gt;
* But this requires some patches to work; the content of the &amp;quot;fixes.patch&amp;quot; file can be found here: [[http://wiki.na-mic.org/Wiki/images/3/3b/Fixes.patch.txt]]:&lt;br /&gt;
   svn co http://svn.python.org/projects/ctypes/branches/ctypeslib-gccxml-0.9&lt;br /&gt;
   cd ctypeslib-gccxml-0.9&lt;br /&gt;
   patch -p0 &amp;lt; ../fixes.patch&lt;br /&gt;
   cd ..&lt;br /&gt;
* ctypeslib is written in python =&amp;gt; there's nothing new to compile at this point&lt;br /&gt;
&lt;br /&gt;
=====CREATING PYTHON/TEEM=====&lt;br /&gt;
* First get Teem (starting from whatever directory should contain the &amp;quot;teem&amp;quot; source dir):&lt;br /&gt;
  svn co https://teem.svn.sourceforge.net/svnroot/teem/teem/trunk teem&lt;br /&gt;
and compile it as a shared library.  Directions for doing this with cmake are here:&lt;br /&gt;
  http://teem.sourceforge.net/build.html&lt;br /&gt;
* create the wrappings in a new directory (e.g. &amp;quot;teem-wrap&amp;quot;), where the XML and Python output will be&lt;br /&gt;
* Set the environment variables that identify where Teem and ctypeslib are:&lt;br /&gt;
** TEEM is where Teem's &amp;quot;make install&amp;quot; put subdirectories &amp;quot;bin&amp;quot;, &amp;quot;lib&amp;quot;, and &amp;quot;include&amp;quot; (e.g. ~/teem-build)&lt;br /&gt;
** CTYPES is the full path of ctypeslib-gccxml-0.9&lt;br /&gt;
* First create (in, for example, &amp;quot;teem-wrap&amp;quot;) a meta-header for all the Teem header files (in tcsh):&lt;br /&gt;
   mkdir teemincl&lt;br /&gt;
   cp -r ${TEEM}/include/teem teemincl&lt;br /&gt;
   cd teemincl&lt;br /&gt;
   ls -1 teem/*.h | awk '{print &amp;quot;#include &amp;lt;&amp;quot;$1&amp;quot;&amp;gt;&amp;quot;}' &amp;gt; all.h&lt;br /&gt;
   cd ..&lt;br /&gt;
* Then create teem.xml:&lt;br /&gt;
   setenv PYTHONPATH $CTYPES&lt;br /&gt;
   python $CTYPES/scripts/h2xml.py `pwd`/teemincl/all.h -I teemincl -o teem.xml &lt;br /&gt;
* Then create teem.py (use DYLD_LIBRARY_PATH in a mac):&lt;br /&gt;
   setenv LD_LIBRARY_PATH ${TEEM}/lib&lt;br /&gt;
   python $CTYPES/scripts/xml2py.py teem.xml -llibteem.so -o teem.py \&lt;br /&gt;
        -r &amp;quot;(air|hest|biff|nrrd|ell|unrrdu|moss|gage|bane|limn|seek|hoover|echo|ten|dye|mite).*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
====LEVMAR====&lt;br /&gt;
&lt;br /&gt;
* The 2-tensor tractography depends on Levenberg-Marquardt nonlinear optimization of Sharon Peled's constrained two-tensor model. I used the following implementation for it: http://www.ics.forth.gr/~lourakis/levmar/&lt;br /&gt;
* First, in lm.h you need to uncomment the line that says: #undef HAVE_LAPACK (around line 30)&lt;br /&gt;
* The levmar code is enabled by compiling Teem with TEEM_LEVMAR defined (turn LEVMAR ON while doing ccmake). The include paths and library link paths also need to be defined for everything to work.&lt;br /&gt;
* Here are the changes in the teem/CMakeLists.txt file that work for me:&lt;br /&gt;
&lt;br /&gt;
Replace the following line&lt;br /&gt;
  # Look for &amp;quot;levmar&amp;quot; library &amp;lt;http://www.ics.forth.gr/~lourakis/levmar/&amp;gt;&lt;br /&gt;
  OPTION(Teem_LEVMAR &amp;quot;Build Teem with levmar library support.&amp;quot; OFF)&lt;br /&gt;
  SET(Teem_LEVMAR_LIB &amp;quot;&amp;quot;)&lt;br /&gt;
  IF(Teem_LEVMAR)&lt;br /&gt;
    FIND_PACKAGE(LEVMAR)&lt;br /&gt;
    IF(LEVMAR_FOUND)&lt;br /&gt;
      ADD_DEFINITIONS(-DTEEM_LEVMAR)&lt;br /&gt;
      SET(Teem_LEVMAR_LIB ${LEVMAR_LIBRARIES})&lt;br /&gt;
      SET(Teem_LEVMAR_IPATH ${LEVMAR_INCLUDE_DIR})&lt;br /&gt;
    ELSE(LEVMAR_FOUND)&lt;br /&gt;
      # We need to set this as a cache variable, so that it will show up as&lt;br /&gt;
      # being turned off in the cache.&lt;br /&gt;
      MESSAGE(SEND_ERROR &amp;quot;Turning off Teem_LEVMAR, because it wasn't found.&amp;quot;)&lt;br /&gt;
      SET(Teem_LEVMAR OFF CACHE BOOL &amp;quot;Build Teem with levmar library support.&amp;quot; FORCE)&lt;br /&gt;
    ENDIF(LEVMAR_FOUND)&lt;br /&gt;
  ENDIF(Teem_LEVMAR)&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
&lt;br /&gt;
  # Look for &amp;quot;levmar&amp;quot; library &amp;lt;http://www.ics.forth.gr/~lourakis/levmar/&amp;gt;&lt;br /&gt;
  OPTION(Teem_LEVMAR &amp;quot;Build Teem with levmar library support.&amp;quot; OFF)&lt;br /&gt;
  IF(Teem_LEVMAR)&lt;br /&gt;
      ADD_DEFINITIONS(-DTEEM_LEVMAR)&lt;br /&gt;
      SET(Teem_LEVMAR_PATH &amp;quot;/media/sda7/Programming/levmar&amp;quot;)&lt;br /&gt;
      SET(Teem_LEVMAR_LIB &amp;quot;${LEVMAR_LEVMAR_PATH}/levmar-build/liblevmar.a&amp;quot; CACHE STRING &amp;quot;library path&amp;quot;)&lt;br /&gt;
      SET(Teem_LEVMAR_IPATH &amp;quot;${LEVMAR_LEVMAR_PATH}/levmar-2.3&amp;quot; CACHE STRING &amp;quot;ipath&amp;quot;)&lt;br /&gt;
  ENDIF(Teem_LEVMAR)&lt;br /&gt;
&lt;br /&gt;
and replace the pathes with your pathes.&lt;br /&gt;
&lt;br /&gt;
====Python processing package====&lt;br /&gt;
&lt;br /&gt;
* This package needs to be downloaded here:&lt;br /&gt;
http://pypi.python.org/pypi/processing&lt;br /&gt;
* Install the package in Slicer3-lib/python-build/lib/python2.5/site-packages/&lt;br /&gt;
* In the top directory of the package (containing setup.py and also this INSTALL file), type&lt;br /&gt;
  python setup.py install&lt;br /&gt;
&lt;br /&gt;
==Status/Progress==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=0&lt;br /&gt;
|- bgcolor=&amp;quot;#abcdef&amp;quot;&lt;br /&gt;
! Month !! Week #  !! Start Date - End Date !! Done !! Date Done&lt;br /&gt;
|-&lt;br /&gt;
|height=5|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Find optimal parameter setting of the Two-Tensor Tractography method ||align=&amp;quot;center&amp;quot; |  || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Extend Two-Tensor Tractography module by fiducial seeding ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | NA-MIC Project Week in Salt Lake City ([http://www.na-mic.org/Wiki/index.php/2009_Winter_Project_Week],[http://www.na-mic.org/Wiki/index.php/Two-tensor_tractography_in_Slicer_using_Python_and_Teem]) ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! January !!  | Week 2 || 05.01 - 11.01 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | IGT Project Week ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 50 || 08.12 - 14.12 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! December !!  | Week 49 || 01.12 - 07.12 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to compile teem with levmar (= Levenberg-Marquardt nonlinear least squares algorithm) ||align=&amp;quot;center&amp;quot; | x || Mon Dec, 1st&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 48 !! 24.11 - 30.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | document the results of the two-tensor tractography given a tensor volume ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to do mutli trace tractography given a DWI volume ||align=&amp;quot;center&amp;quot; | x || Mon Nov, 17th&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 47 !! 17.11 - 23.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Working on Python tractography module for multi fiber tracing given a tensor volume ||align=&amp;quot;center&amp;quot; | x || Mon Nov, 17th&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 46 !! 10.11 - 16.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Get vertex data out of the nvert nrrd filled by the tractography back to Slicer ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to pass image data from Python to Teem through nrrdWrap_nva function ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to generate a list of point locations that were used as tractography seedpoints in the VTK tractography ||align=&amp;quot;center&amp;quot; | x || Thu Nov, 13th&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Implement Python tractography module for single fiber tracing given a seeding starting point and a tensor volume ||align=&amp;quot;center&amp;quot; | x || Fri, Nov, 7th&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 45 || 03.11 - 09.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to get image data from numpy (= Python package) to Teem nrrd struct ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! November !!  | Week 44 || 27.10 - 02.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;20px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to get image data from numpy (= Python package) to Teem nrrd struct ||align=&amp;quot;center&amp;quot; | x ||&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !!  Week 43 || 20.10 - 26.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to access DWI volumes through Python ||align=&amp;quot;center&amp;quot; | x || Fri Oct, 17th&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Get Teem wrapped in Python ||align=&amp;quot;center&amp;quot; | x || Fri Oct, 19th&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 42 || 13.10 - 19.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Try to implement the seeding part of the (VTK) one-tensor tractography module in Python || align=&amp;quot;center&amp;quot; | x || Tue Oct, 14th&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 41 || 06.10 - 12.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
|height=10|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Try to implement the seeding part of the (VTK) one-tensor tractography module in Python || align=&amp;quot;center&amp;quot; | x || Tue Oct, 14th&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! October !!  Week 40 || 29.09 - 5.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;20px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; |Totally understand existing Python modules in Slicer || align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; |understand existing one-tensor streamline tractography in Slicer (VTK) || align=&amp;quot;center&amp;quot; | x || Tue Sep, 23rd &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Totally understand existing Python modules in Slicer ||align=&amp;quot;center&amp;quot; | x || Tue Sep, 23rd&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !!  Week 39 || 22.09 - 28.09 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; | Slicer &amp;amp; Python Tutorials || align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; | Enable Python in Slicer || align=&amp;quot;center&amp;quot; | x || Mon Sep, 22nd&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot; &lt;br /&gt;
! September !! Week 38 || 14.09 - 21.09 || ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Information==&lt;br /&gt;
* Diffusion Tensor Analysis in Slicer: http://www.na-mic.org/Wiki/images/0/04/Slicer3diffusionTutorial7.pdf&lt;br /&gt;
* Building a Slicer 3 Module GUI: http://www.slicer.org/pages/Building_a_Slicer_3_Module_GUI&lt;br /&gt;
&lt;br /&gt;
Python:&lt;br /&gt;
* SlicerWiki about Python: http://www.slicer.org/slicerWiki/index.php/Slicer3::Python&lt;br /&gt;
* Python example modules in Slicer: http://www.slicer.org/slicerWiki/index.php/Slicer3:Execution_Model_Documentation:Python&lt;/div&gt;</summary>
		<author><name>Mseeland</name></author>
		
	</entry>
	<entry>
		<id>https://www.na-mic.org/w/index.php?title=User:Mseeland&amp;diff=36453</id>
		<title>User:Mseeland</title>
		<link rel="alternate" type="text/html" href="https://www.na-mic.org/w/index.php?title=User:Mseeland&amp;diff=36453"/>
		<updated>2009-04-22T09:06:40Z</updated>

		<summary type="html">&lt;p&gt;Mseeland: /* Python processing package */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Wiki of Madeleine Seeland =&lt;br /&gt;
&lt;br /&gt;
== General Information ==&lt;br /&gt;
&lt;br /&gt;
===About myself===&lt;br /&gt;
I am a grad student of Management Information Systems at the University of Mannheim, Germany. I'm involved in the Diffusion Tensor Imaging (DTI) project in the Laboratory of Mathematics in Imaging. Currently I'm working on two-tensor tractograohy for Neurosurgery. I will document my research experience as a diploma thesis, which I need for completing my studies in Germany.&lt;br /&gt;
&lt;br /&gt;
===Contact information===&lt;br /&gt;
E-mail: mseeland (at sign) bwh.harvard.edu&lt;br /&gt;
&lt;br /&gt;
===Collaborators &amp;amp; Contacts===&lt;br /&gt;
* Supervisors: C-F Westin, Nobuhiko Hata&lt;br /&gt;
* Gordon  Kindlmann (Teem)&lt;br /&gt;
* Sharon Peled&lt;br /&gt;
* Alireza Radmanesh&lt;br /&gt;
* Isaiah Norton&lt;br /&gt;
* Regarding Python: Steve Pieper, Julien de Siebenthal, Sylvain Bouix, Demian Wassermann, Luca Antiga&lt;br /&gt;
&lt;br /&gt;
==Project: Two-Tensor Tractography integration into Slicer==&lt;br /&gt;
&lt;br /&gt;
===Project Description===&lt;br /&gt;
*  Integration of Two-Tensor Tractography into Slicer using Python and the novel Python wrapping for Teem&lt;br /&gt;
*  Use of existing tractography methods in Teem (http://teem.sourceforge.net/)&lt;br /&gt;
*  My part: Interface between Slicer-&amp;gt;Python-&amp;gt;Teem and Teem-&amp;gt;Python-&amp;gt;Slicer&lt;br /&gt;
** pass data from VTK through Python to Teem&lt;br /&gt;
** make use of Teem tractography function calls&lt;br /&gt;
** pass resulting fiber data from Teem to Python to VTK and display fiber tracts in Slicer&lt;br /&gt;
&lt;br /&gt;
===How to enable Python in Slicer 3.3===&lt;br /&gt;
*  The current version of Slicer, Slicer 3.2, does not support Python. In order to use Python you need to install Slicer 3.3.&lt;br /&gt;
&lt;br /&gt;
*  To build Slicer Version 3.3, just do the following two commands:&lt;br /&gt;
  svn co http://svn.slicer.org/Slicer3/trunk Slicer3&lt;br /&gt;
  ./Slicer3/Scripts/getbuildtest.tcl&lt;br /&gt;
&lt;br /&gt;
*  In Slicer 3.3, Python support is disabled by default. In order to enable Python, just follow the next steps:&lt;br /&gt;
&lt;br /&gt;
# Edit slicer_variables.tcl&lt;br /&gt;
## Change &amp;quot;set ::USE_PYTHON &amp;quot;off&amp;quot;&amp;quot; to &amp;quot;on&amp;quot;&lt;br /&gt;
# '''Optional:''' If you prefer to use your system Python installation, see here: [http://www.slicer.org/slicerWiki/index.php/Slicer3::Python] &lt;br /&gt;
# '''Optional:''' installing SciPy, see here: [http://www.slicer.org/slicerWiki/index.php/Slicer3::Python]. However, there are still problems adding scipy in Slicer, whcih are not fixed yet.&lt;br /&gt;
&lt;br /&gt;
*  Rebuild Slicer3 using &amp;quot;getbuildtest.tcl&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 ./Slicer3/Scripts/getbuildtest.tcl&lt;br /&gt;
&lt;br /&gt;
A new menu command '''Python Interpreter''' should appear on the Window menu in Slicer. This command should bring up the Python Console window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Prerequisites for Two-Tensor Tractography module===&lt;br /&gt;
====Teem Python wrapping====&lt;br /&gt;
&lt;br /&gt;
=====BACKGROUND=====&lt;br /&gt;
* Teem Python wrapping is needed to make use of existing Two-Tensor tractography functions in Teem in Python&lt;br /&gt;
* The Python wrappings are based on ctypes, as well as a ctypes code generator (called &amp;quot;ctypeslib&amp;quot;)&lt;br /&gt;
** http://python.net/crew/theller/ctypes&lt;br /&gt;
** http://starship.python.net/crew/theller/wiki/CodeGenerator&lt;br /&gt;
** http://starship.python.net/crew/theller/ctypes/old/codegen.html&lt;br /&gt;
* Ctypes is a standard part of python, by which C functions in a shared library can be called from Python&lt;br /&gt;
* The ctypes code generator converts declarations in C header files into executable Python code: enums, structs, unions, function declarations, com interfaces, and preprocessor definitions.&lt;br /&gt;
* Creating wrappers for C header file(s) is a two step process. &lt;br /&gt;
** First, the ``h2xml.py`` script runs GCC-XML_ over the include file(s), creating a XML file containing declarations and definitions.  &lt;br /&gt;
** Second, the ``xml2py.py`` script parses the XML files and creates Python code containing all or a subset of these definitions.&lt;br /&gt;
* Python code is generated for C enums, structure, unions, typedefs and function declarations.&lt;br /&gt;
&lt;br /&gt;
=====REQUIREMENTS=====&lt;br /&gt;
* Ctypeslib: ctypeslib is an extension package for ctypes. It contains a ctypes code generator.&lt;br /&gt;
* GCC-XML (from http://www.gccxml.org/) is required to parse C header files into an XML description.&lt;br /&gt;
&lt;br /&gt;
=====GETTING THE SOFTWARE=====&lt;br /&gt;
* Python 2.6 can be got here (anything after 2.5 should work): http://www.python.org/download/&lt;br /&gt;
* Get gccxml (I used version 0.9.0), which can be got by CVS as described here: http://www.gccxml.org/HTML/Download.html&lt;br /&gt;
** follow the installation as described here: http://www.gccxml.org/HTML/Install.html&lt;br /&gt;
* use a version of ctypeslib which work with the version of gccxml: &lt;br /&gt;
  http://svn.python.org/projects/ctypes/branches/ctypeslib-gccxml-0.9&lt;br /&gt;
* But this requires some patches to work; the content of the &amp;quot;fixes.patch&amp;quot; file can be found here: [[http://wiki.na-mic.org/Wiki/images/3/3b/Fixes.patch.txt]]:&lt;br /&gt;
   svn co http://svn.python.org/projects/ctypes/branches/ctypeslib-gccxml-0.9&lt;br /&gt;
   cd ctypeslib-gccxml-0.9&lt;br /&gt;
   patch -p0 &amp;lt; ../fixes.patch&lt;br /&gt;
   cd ..&lt;br /&gt;
* ctypeslib is written in python =&amp;gt; there's nothing new to compile at this point&lt;br /&gt;
&lt;br /&gt;
=====CREATING PYTHON/TEEM=====&lt;br /&gt;
* First get Teem (starting from whatever directory should contain the &amp;quot;teem&amp;quot; source dir):&lt;br /&gt;
  svn co https://teem.svn.sourceforge.net/svnroot/teem/teem/trunk teem&lt;br /&gt;
and compile it as a shared library.  Directions for doing this with cmake are here:&lt;br /&gt;
  http://teem.sourceforge.net/build.html&lt;br /&gt;
* create the wrappings in a new directory (e.g. &amp;quot;teem-wrap&amp;quot;), where the XML and Python output will be&lt;br /&gt;
* Set the environment variables that identify where Teem and ctypeslib are:&lt;br /&gt;
** TEEM is where Teem's &amp;quot;make install&amp;quot; put subdirectories &amp;quot;bin&amp;quot;, &amp;quot;lib&amp;quot;, and &amp;quot;include&amp;quot; (e.g. ~/teem-build)&lt;br /&gt;
** CTYPES is the full path of ctypeslib-gccxml-0.9&lt;br /&gt;
* First create (in, for example, &amp;quot;teem-wrap&amp;quot;) a meta-header for all the Teem header files (in tcsh):&lt;br /&gt;
   mkdir teemincl&lt;br /&gt;
   cp -r ${TEEM}/include/teem teemincl&lt;br /&gt;
   cd teemincl&lt;br /&gt;
   ls -1 teem/*.h | awk '{print &amp;quot;#include &amp;lt;&amp;quot;$1&amp;quot;&amp;gt;&amp;quot;}' &amp;gt; all.h&lt;br /&gt;
   cd ..&lt;br /&gt;
* Then create teem.xml:&lt;br /&gt;
   setenv PYTHONPATH $CTYPES&lt;br /&gt;
   python $CTYPES/scripts/h2xml.py `pwd`/teemincl/all.h -I teemincl -o teem.xml &lt;br /&gt;
* Then create teem.py (use DYLD_LIBRARY_PATH in a mac):&lt;br /&gt;
   setenv LD_LIBRARY_PATH ${TEEM}/lib&lt;br /&gt;
   python $CTYPES/scripts/xml2py.py teem.xml -llibteem.so -o teem.py \&lt;br /&gt;
        -r &amp;quot;(air|hest|biff|nrrd|ell|unrrdu|moss|gage|bane|limn|seek|hoover|echo|ten|dye|mite).*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
====LEVMAR====&lt;br /&gt;
&lt;br /&gt;
* The 2-tensor tractography depends on Levenberg-Marquardt nonlinear optimization of Sharon Peled's constrained two-tensor model. I used the following implementation for it: http://www.ics.forth.gr/~lourakis/levmar/&lt;br /&gt;
* First, in lm.h you need to uncomment the line that says: #undef HAVE_LAPACK (around line 30)&lt;br /&gt;
* The levmar code is enabled by compiling Teem with TEEM_LEVMAR defined (turn LEVMAR ON while doing ccmake). The include paths and library link paths also need to be defined for everything to work.&lt;br /&gt;
* Here are the changes in the teem/CMakeLists.txt file that work for me:&lt;br /&gt;
&lt;br /&gt;
Replace the following line&lt;br /&gt;
  # Look for &amp;quot;levmar&amp;quot; library &amp;lt;http://www.ics.forth.gr/~lourakis/levmar/&amp;gt;&lt;br /&gt;
  OPTION(Teem_LEVMAR &amp;quot;Build Teem with levmar library support.&amp;quot; OFF)&lt;br /&gt;
  SET(Teem_LEVMAR_LIB &amp;quot;&amp;quot;)&lt;br /&gt;
  IF(Teem_LEVMAR)&lt;br /&gt;
    FIND_PACKAGE(LEVMAR)&lt;br /&gt;
    IF(LEVMAR_FOUND)&lt;br /&gt;
      ADD_DEFINITIONS(-DTEEM_LEVMAR)&lt;br /&gt;
      SET(Teem_LEVMAR_LIB ${LEVMAR_LIBRARIES})&lt;br /&gt;
      SET(Teem_LEVMAR_IPATH ${LEVMAR_INCLUDE_DIR})&lt;br /&gt;
    ELSE(LEVMAR_FOUND)&lt;br /&gt;
      # We need to set this as a cache variable, so that it will show up as&lt;br /&gt;
      # being turned off in the cache.&lt;br /&gt;
      MESSAGE(SEND_ERROR &amp;quot;Turning off Teem_LEVMAR, because it wasn't found.&amp;quot;)&lt;br /&gt;
      SET(Teem_LEVMAR OFF CACHE BOOL &amp;quot;Build Teem with levmar library support.&amp;quot; FORCE)&lt;br /&gt;
    ENDIF(LEVMAR_FOUND)&lt;br /&gt;
  ENDIF(Teem_LEVMAR)&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
&lt;br /&gt;
  # Look for &amp;quot;levmar&amp;quot; library &amp;lt;http://www.ics.forth.gr/~lourakis/levmar/&amp;gt;&lt;br /&gt;
  OPTION(Teem_LEVMAR &amp;quot;Build Teem with levmar library support.&amp;quot; OFF)&lt;br /&gt;
  IF(Teem_LEVMAR)&lt;br /&gt;
      ADD_DEFINITIONS(-DTEEM_LEVMAR)&lt;br /&gt;
      SET(Teem_LEVMAR_PATH &amp;quot;/media/sda7/Programming/levmar&amp;quot;)&lt;br /&gt;
      SET(Teem_LEVMAR_LIB &amp;quot;${LEVMAR_LEVMAR_PATH}/levmar-build/liblevmar.a&amp;quot; CACHE STRING &amp;quot;library path&amp;quot;)&lt;br /&gt;
      SET(Teem_LEVMAR_IPATH &amp;quot;${LEVMAR_LEVMAR_PATH}/levmar-2.3&amp;quot; CACHE STRING &amp;quot;ipath&amp;quot;)&lt;br /&gt;
  ENDIF(Teem_LEVMAR)&lt;br /&gt;
&lt;br /&gt;
and replace the pathes with your pathes.&lt;br /&gt;
&lt;br /&gt;
====Python processing package====&lt;br /&gt;
&lt;br /&gt;
* This package needs to be downloaded here:&lt;br /&gt;
http://pypi.python.org/pypi/processing&lt;br /&gt;
* The package can be installed with:&lt;br /&gt;
  python setup.py install&lt;br /&gt;
&lt;br /&gt;
==Status/Progress==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=0&lt;br /&gt;
|- bgcolor=&amp;quot;#abcdef&amp;quot;&lt;br /&gt;
! Month !! Week #  !! Start Date - End Date !! Done !! Date Done&lt;br /&gt;
|-&lt;br /&gt;
|height=5|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Find optimal parameter setting of the Two-Tensor Tractography method ||align=&amp;quot;center&amp;quot; |  || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Extend Two-Tensor Tractography module by fiducial seeding ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | NA-MIC Project Week in Salt Lake City ([http://www.na-mic.org/Wiki/index.php/2009_Winter_Project_Week],[http://www.na-mic.org/Wiki/index.php/Two-tensor_tractography_in_Slicer_using_Python_and_Teem]) ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! January !!  | Week 2 || 05.01 - 11.01 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | IGT Project Week ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 50 || 08.12 - 14.12 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! December !!  | Week 49 || 01.12 - 07.12 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to compile teem with levmar (= Levenberg-Marquardt nonlinear least squares algorithm) ||align=&amp;quot;center&amp;quot; | x || Mon Dec, 1st&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 48 !! 24.11 - 30.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | document the results of the two-tensor tractography given a tensor volume ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to do mutli trace tractography given a DWI volume ||align=&amp;quot;center&amp;quot; | x || Mon Nov, 17th&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 47 !! 17.11 - 23.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Working on Python tractography module for multi fiber tracing given a tensor volume ||align=&amp;quot;center&amp;quot; | x || Mon Nov, 17th&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 46 !! 10.11 - 16.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Get vertex data out of the nvert nrrd filled by the tractography back to Slicer ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to pass image data from Python to Teem through nrrdWrap_nva function ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to generate a list of point locations that were used as tractography seedpoints in the VTK tractography ||align=&amp;quot;center&amp;quot; | x || Thu Nov, 13th&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Implement Python tractography module for single fiber tracing given a seeding starting point and a tensor volume ||align=&amp;quot;center&amp;quot; | x || Fri, Nov, 7th&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 45 || 03.11 - 09.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to get image data from numpy (= Python package) to Teem nrrd struct ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! November !!  | Week 44 || 27.10 - 02.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;20px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to get image data from numpy (= Python package) to Teem nrrd struct ||align=&amp;quot;center&amp;quot; | x ||&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !!  Week 43 || 20.10 - 26.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to access DWI volumes through Python ||align=&amp;quot;center&amp;quot; | x || Fri Oct, 17th&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Get Teem wrapped in Python ||align=&amp;quot;center&amp;quot; | x || Fri Oct, 19th&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 42 || 13.10 - 19.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Try to implement the seeding part of the (VTK) one-tensor tractography module in Python || align=&amp;quot;center&amp;quot; | x || Tue Oct, 14th&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 41 || 06.10 - 12.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
|height=10|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Try to implement the seeding part of the (VTK) one-tensor tractography module in Python || align=&amp;quot;center&amp;quot; | x || Tue Oct, 14th&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! October !!  Week 40 || 29.09 - 5.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;20px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; |Totally understand existing Python modules in Slicer || align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; |understand existing one-tensor streamline tractography in Slicer (VTK) || align=&amp;quot;center&amp;quot; | x || Tue Sep, 23rd &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Totally understand existing Python modules in Slicer ||align=&amp;quot;center&amp;quot; | x || Tue Sep, 23rd&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !!  Week 39 || 22.09 - 28.09 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; | Slicer &amp;amp; Python Tutorials || align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; | Enable Python in Slicer || align=&amp;quot;center&amp;quot; | x || Mon Sep, 22nd&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot; &lt;br /&gt;
! September !! Week 38 || 14.09 - 21.09 || ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Information==&lt;br /&gt;
* Diffusion Tensor Analysis in Slicer: http://www.na-mic.org/Wiki/images/0/04/Slicer3diffusionTutorial7.pdf&lt;br /&gt;
* Building a Slicer 3 Module GUI: http://www.slicer.org/pages/Building_a_Slicer_3_Module_GUI&lt;br /&gt;
&lt;br /&gt;
Python:&lt;br /&gt;
* SlicerWiki about Python: http://www.slicer.org/slicerWiki/index.php/Slicer3::Python&lt;br /&gt;
* Python example modules in Slicer: http://www.slicer.org/slicerWiki/index.php/Slicer3:Execution_Model_Documentation:Python&lt;/div&gt;</summary>
		<author><name>Mseeland</name></author>
		
	</entry>
	<entry>
		<id>https://www.na-mic.org/w/index.php?title=User:Mseeland&amp;diff=36452</id>
		<title>User:Mseeland</title>
		<link rel="alternate" type="text/html" href="https://www.na-mic.org/w/index.php?title=User:Mseeland&amp;diff=36452"/>
		<updated>2009-04-22T09:04:10Z</updated>

		<summary type="html">&lt;p&gt;Mseeland: /* LEVMAR */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Wiki of Madeleine Seeland =&lt;br /&gt;
&lt;br /&gt;
== General Information ==&lt;br /&gt;
&lt;br /&gt;
===About myself===&lt;br /&gt;
I am a grad student of Management Information Systems at the University of Mannheim, Germany. I'm involved in the Diffusion Tensor Imaging (DTI) project in the Laboratory of Mathematics in Imaging. Currently I'm working on two-tensor tractograohy for Neurosurgery. I will document my research experience as a diploma thesis, which I need for completing my studies in Germany.&lt;br /&gt;
&lt;br /&gt;
===Contact information===&lt;br /&gt;
E-mail: mseeland (at sign) bwh.harvard.edu&lt;br /&gt;
&lt;br /&gt;
===Collaborators &amp;amp; Contacts===&lt;br /&gt;
* Supervisors: C-F Westin, Nobuhiko Hata&lt;br /&gt;
* Gordon  Kindlmann (Teem)&lt;br /&gt;
* Sharon Peled&lt;br /&gt;
* Alireza Radmanesh&lt;br /&gt;
* Isaiah Norton&lt;br /&gt;
* Regarding Python: Steve Pieper, Julien de Siebenthal, Sylvain Bouix, Demian Wassermann, Luca Antiga&lt;br /&gt;
&lt;br /&gt;
==Project: Two-Tensor Tractography integration into Slicer==&lt;br /&gt;
&lt;br /&gt;
===Project Description===&lt;br /&gt;
*  Integration of Two-Tensor Tractography into Slicer using Python and the novel Python wrapping for Teem&lt;br /&gt;
*  Use of existing tractography methods in Teem (http://teem.sourceforge.net/)&lt;br /&gt;
*  My part: Interface between Slicer-&amp;gt;Python-&amp;gt;Teem and Teem-&amp;gt;Python-&amp;gt;Slicer&lt;br /&gt;
** pass data from VTK through Python to Teem&lt;br /&gt;
** make use of Teem tractography function calls&lt;br /&gt;
** pass resulting fiber data from Teem to Python to VTK and display fiber tracts in Slicer&lt;br /&gt;
&lt;br /&gt;
===How to enable Python in Slicer 3.3===&lt;br /&gt;
*  The current version of Slicer, Slicer 3.2, does not support Python. In order to use Python you need to install Slicer 3.3.&lt;br /&gt;
&lt;br /&gt;
*  To build Slicer Version 3.3, just do the following two commands:&lt;br /&gt;
  svn co http://svn.slicer.org/Slicer3/trunk Slicer3&lt;br /&gt;
  ./Slicer3/Scripts/getbuildtest.tcl&lt;br /&gt;
&lt;br /&gt;
*  In Slicer 3.3, Python support is disabled by default. In order to enable Python, just follow the next steps:&lt;br /&gt;
&lt;br /&gt;
# Edit slicer_variables.tcl&lt;br /&gt;
## Change &amp;quot;set ::USE_PYTHON &amp;quot;off&amp;quot;&amp;quot; to &amp;quot;on&amp;quot;&lt;br /&gt;
# '''Optional:''' If you prefer to use your system Python installation, see here: [http://www.slicer.org/slicerWiki/index.php/Slicer3::Python] &lt;br /&gt;
# '''Optional:''' installing SciPy, see here: [http://www.slicer.org/slicerWiki/index.php/Slicer3::Python]. However, there are still problems adding scipy in Slicer, whcih are not fixed yet.&lt;br /&gt;
&lt;br /&gt;
*  Rebuild Slicer3 using &amp;quot;getbuildtest.tcl&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 ./Slicer3/Scripts/getbuildtest.tcl&lt;br /&gt;
&lt;br /&gt;
A new menu command '''Python Interpreter''' should appear on the Window menu in Slicer. This command should bring up the Python Console window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Prerequisites for Two-Tensor Tractography module===&lt;br /&gt;
====Teem Python wrapping====&lt;br /&gt;
&lt;br /&gt;
=====BACKGROUND=====&lt;br /&gt;
* Teem Python wrapping is needed to make use of existing Two-Tensor tractography functions in Teem in Python&lt;br /&gt;
* The Python wrappings are based on ctypes, as well as a ctypes code generator (called &amp;quot;ctypeslib&amp;quot;)&lt;br /&gt;
** http://python.net/crew/theller/ctypes&lt;br /&gt;
** http://starship.python.net/crew/theller/wiki/CodeGenerator&lt;br /&gt;
** http://starship.python.net/crew/theller/ctypes/old/codegen.html&lt;br /&gt;
* Ctypes is a standard part of python, by which C functions in a shared library can be called from Python&lt;br /&gt;
* The ctypes code generator converts declarations in C header files into executable Python code: enums, structs, unions, function declarations, com interfaces, and preprocessor definitions.&lt;br /&gt;
* Creating wrappers for C header file(s) is a two step process. &lt;br /&gt;
** First, the ``h2xml.py`` script runs GCC-XML_ over the include file(s), creating a XML file containing declarations and definitions.  &lt;br /&gt;
** Second, the ``xml2py.py`` script parses the XML files and creates Python code containing all or a subset of these definitions.&lt;br /&gt;
* Python code is generated for C enums, structure, unions, typedefs and function declarations.&lt;br /&gt;
&lt;br /&gt;
=====REQUIREMENTS=====&lt;br /&gt;
* Ctypeslib: ctypeslib is an extension package for ctypes. It contains a ctypes code generator.&lt;br /&gt;
* GCC-XML (from http://www.gccxml.org/) is required to parse C header files into an XML description.&lt;br /&gt;
&lt;br /&gt;
=====GETTING THE SOFTWARE=====&lt;br /&gt;
* Python 2.6 can be got here (anything after 2.5 should work): http://www.python.org/download/&lt;br /&gt;
* Get gccxml (I used version 0.9.0), which can be got by CVS as described here: http://www.gccxml.org/HTML/Download.html&lt;br /&gt;
** follow the installation as described here: http://www.gccxml.org/HTML/Install.html&lt;br /&gt;
* use a version of ctypeslib which work with the version of gccxml: &lt;br /&gt;
  http://svn.python.org/projects/ctypes/branches/ctypeslib-gccxml-0.9&lt;br /&gt;
* But this requires some patches to work; the content of the &amp;quot;fixes.patch&amp;quot; file can be found here: [[http://wiki.na-mic.org/Wiki/images/3/3b/Fixes.patch.txt]]:&lt;br /&gt;
   svn co http://svn.python.org/projects/ctypes/branches/ctypeslib-gccxml-0.9&lt;br /&gt;
   cd ctypeslib-gccxml-0.9&lt;br /&gt;
   patch -p0 &amp;lt; ../fixes.patch&lt;br /&gt;
   cd ..&lt;br /&gt;
* ctypeslib is written in python =&amp;gt; there's nothing new to compile at this point&lt;br /&gt;
&lt;br /&gt;
=====CREATING PYTHON/TEEM=====&lt;br /&gt;
* First get Teem (starting from whatever directory should contain the &amp;quot;teem&amp;quot; source dir):&lt;br /&gt;
  svn co https://teem.svn.sourceforge.net/svnroot/teem/teem/trunk teem&lt;br /&gt;
and compile it as a shared library.  Directions for doing this with cmake are here:&lt;br /&gt;
  http://teem.sourceforge.net/build.html&lt;br /&gt;
* create the wrappings in a new directory (e.g. &amp;quot;teem-wrap&amp;quot;), where the XML and Python output will be&lt;br /&gt;
* Set the environment variables that identify where Teem and ctypeslib are:&lt;br /&gt;
** TEEM is where Teem's &amp;quot;make install&amp;quot; put subdirectories &amp;quot;bin&amp;quot;, &amp;quot;lib&amp;quot;, and &amp;quot;include&amp;quot; (e.g. ~/teem-build)&lt;br /&gt;
** CTYPES is the full path of ctypeslib-gccxml-0.9&lt;br /&gt;
* First create (in, for example, &amp;quot;teem-wrap&amp;quot;) a meta-header for all the Teem header files (in tcsh):&lt;br /&gt;
   mkdir teemincl&lt;br /&gt;
   cp -r ${TEEM}/include/teem teemincl&lt;br /&gt;
   cd teemincl&lt;br /&gt;
   ls -1 teem/*.h | awk '{print &amp;quot;#include &amp;lt;&amp;quot;$1&amp;quot;&amp;gt;&amp;quot;}' &amp;gt; all.h&lt;br /&gt;
   cd ..&lt;br /&gt;
* Then create teem.xml:&lt;br /&gt;
   setenv PYTHONPATH $CTYPES&lt;br /&gt;
   python $CTYPES/scripts/h2xml.py `pwd`/teemincl/all.h -I teemincl -o teem.xml &lt;br /&gt;
* Then create teem.py (use DYLD_LIBRARY_PATH in a mac):&lt;br /&gt;
   setenv LD_LIBRARY_PATH ${TEEM}/lib&lt;br /&gt;
   python $CTYPES/scripts/xml2py.py teem.xml -llibteem.so -o teem.py \&lt;br /&gt;
        -r &amp;quot;(air|hest|biff|nrrd|ell|unrrdu|moss|gage|bane|limn|seek|hoover|echo|ten|dye|mite).*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
====LEVMAR====&lt;br /&gt;
&lt;br /&gt;
* The 2-tensor tractography depends on Levenberg-Marquardt nonlinear optimization of Sharon Peled's constrained two-tensor model. I used the following implementation for it: http://www.ics.forth.gr/~lourakis/levmar/&lt;br /&gt;
* First, in lm.h you need to uncomment the line that says: #undef HAVE_LAPACK (around line 30)&lt;br /&gt;
* The levmar code is enabled by compiling Teem with TEEM_LEVMAR defined (turn LEVMAR ON while doing ccmake). The include paths and library link paths also need to be defined for everything to work.&lt;br /&gt;
* Here are the changes in the teem/CMakeLists.txt file that work for me:&lt;br /&gt;
&lt;br /&gt;
Replace the following line&lt;br /&gt;
  # Look for &amp;quot;levmar&amp;quot; library &amp;lt;http://www.ics.forth.gr/~lourakis/levmar/&amp;gt;&lt;br /&gt;
  OPTION(Teem_LEVMAR &amp;quot;Build Teem with levmar library support.&amp;quot; OFF)&lt;br /&gt;
  SET(Teem_LEVMAR_LIB &amp;quot;&amp;quot;)&lt;br /&gt;
  IF(Teem_LEVMAR)&lt;br /&gt;
    FIND_PACKAGE(LEVMAR)&lt;br /&gt;
    IF(LEVMAR_FOUND)&lt;br /&gt;
      ADD_DEFINITIONS(-DTEEM_LEVMAR)&lt;br /&gt;
      SET(Teem_LEVMAR_LIB ${LEVMAR_LIBRARIES})&lt;br /&gt;
      SET(Teem_LEVMAR_IPATH ${LEVMAR_INCLUDE_DIR})&lt;br /&gt;
    ELSE(LEVMAR_FOUND)&lt;br /&gt;
      # We need to set this as a cache variable, so that it will show up as&lt;br /&gt;
      # being turned off in the cache.&lt;br /&gt;
      MESSAGE(SEND_ERROR &amp;quot;Turning off Teem_LEVMAR, because it wasn't found.&amp;quot;)&lt;br /&gt;
      SET(Teem_LEVMAR OFF CACHE BOOL &amp;quot;Build Teem with levmar library support.&amp;quot; FORCE)&lt;br /&gt;
    ENDIF(LEVMAR_FOUND)&lt;br /&gt;
  ENDIF(Teem_LEVMAR)&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
&lt;br /&gt;
  # Look for &amp;quot;levmar&amp;quot; library &amp;lt;http://www.ics.forth.gr/~lourakis/levmar/&amp;gt;&lt;br /&gt;
  OPTION(Teem_LEVMAR &amp;quot;Build Teem with levmar library support.&amp;quot; OFF)&lt;br /&gt;
  IF(Teem_LEVMAR)&lt;br /&gt;
      ADD_DEFINITIONS(-DTEEM_LEVMAR)&lt;br /&gt;
      SET(Teem_LEVMAR_PATH &amp;quot;/media/sda7/Programming/levmar&amp;quot;)&lt;br /&gt;
      SET(Teem_LEVMAR_LIB &amp;quot;${LEVMAR_LEVMAR_PATH}/levmar-build/liblevmar.a&amp;quot; CACHE STRING &amp;quot;library path&amp;quot;)&lt;br /&gt;
      SET(Teem_LEVMAR_IPATH &amp;quot;${LEVMAR_LEVMAR_PATH}/levmar-2.3&amp;quot; CACHE STRING &amp;quot;ipath&amp;quot;)&lt;br /&gt;
  ENDIF(Teem_LEVMAR)&lt;br /&gt;
&lt;br /&gt;
and replace the pathes with your pathes.&lt;br /&gt;
&lt;br /&gt;
====Python processing package====&lt;br /&gt;
&lt;br /&gt;
* This package needs to be downloaded here:&lt;br /&gt;
http://pypi.python.org/pypi/processing&lt;br /&gt;
&lt;br /&gt;
==Status/Progress==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=0&lt;br /&gt;
|- bgcolor=&amp;quot;#abcdef&amp;quot;&lt;br /&gt;
! Month !! Week #  !! Start Date - End Date !! Done !! Date Done&lt;br /&gt;
|-&lt;br /&gt;
|height=5|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Find optimal parameter setting of the Two-Tensor Tractography method ||align=&amp;quot;center&amp;quot; |  || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Extend Two-Tensor Tractography module by fiducial seeding ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | NA-MIC Project Week in Salt Lake City ([http://www.na-mic.org/Wiki/index.php/2009_Winter_Project_Week],[http://www.na-mic.org/Wiki/index.php/Two-tensor_tractography_in_Slicer_using_Python_and_Teem]) ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! January !!  | Week 2 || 05.01 - 11.01 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | IGT Project Week ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 50 || 08.12 - 14.12 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! December !!  | Week 49 || 01.12 - 07.12 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to compile teem with levmar (= Levenberg-Marquardt nonlinear least squares algorithm) ||align=&amp;quot;center&amp;quot; | x || Mon Dec, 1st&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 48 !! 24.11 - 30.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | document the results of the two-tensor tractography given a tensor volume ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to do mutli trace tractography given a DWI volume ||align=&amp;quot;center&amp;quot; | x || Mon Nov, 17th&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 47 !! 17.11 - 23.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Working on Python tractography module for multi fiber tracing given a tensor volume ||align=&amp;quot;center&amp;quot; | x || Mon Nov, 17th&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 46 !! 10.11 - 16.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Get vertex data out of the nvert nrrd filled by the tractography back to Slicer ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to pass image data from Python to Teem through nrrdWrap_nva function ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to generate a list of point locations that were used as tractography seedpoints in the VTK tractography ||align=&amp;quot;center&amp;quot; | x || Thu Nov, 13th&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Implement Python tractography module for single fiber tracing given a seeding starting point and a tensor volume ||align=&amp;quot;center&amp;quot; | x || Fri, Nov, 7th&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 45 || 03.11 - 09.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to get image data from numpy (= Python package) to Teem nrrd struct ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! November !!  | Week 44 || 27.10 - 02.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;20px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to get image data from numpy (= Python package) to Teem nrrd struct ||align=&amp;quot;center&amp;quot; | x ||&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !!  Week 43 || 20.10 - 26.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to access DWI volumes through Python ||align=&amp;quot;center&amp;quot; | x || Fri Oct, 17th&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Get Teem wrapped in Python ||align=&amp;quot;center&amp;quot; | x || Fri Oct, 19th&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 42 || 13.10 - 19.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Try to implement the seeding part of the (VTK) one-tensor tractography module in Python || align=&amp;quot;center&amp;quot; | x || Tue Oct, 14th&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 41 || 06.10 - 12.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
|height=10|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Try to implement the seeding part of the (VTK) one-tensor tractography module in Python || align=&amp;quot;center&amp;quot; | x || Tue Oct, 14th&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! October !!  Week 40 || 29.09 - 5.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;20px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; |Totally understand existing Python modules in Slicer || align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; |understand existing one-tensor streamline tractography in Slicer (VTK) || align=&amp;quot;center&amp;quot; | x || Tue Sep, 23rd &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Totally understand existing Python modules in Slicer ||align=&amp;quot;center&amp;quot; | x || Tue Sep, 23rd&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !!  Week 39 || 22.09 - 28.09 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; | Slicer &amp;amp; Python Tutorials || align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; | Enable Python in Slicer || align=&amp;quot;center&amp;quot; | x || Mon Sep, 22nd&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot; &lt;br /&gt;
! September !! Week 38 || 14.09 - 21.09 || ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Information==&lt;br /&gt;
* Diffusion Tensor Analysis in Slicer: http://www.na-mic.org/Wiki/images/0/04/Slicer3diffusionTutorial7.pdf&lt;br /&gt;
* Building a Slicer 3 Module GUI: http://www.slicer.org/pages/Building_a_Slicer_3_Module_GUI&lt;br /&gt;
&lt;br /&gt;
Python:&lt;br /&gt;
* SlicerWiki about Python: http://www.slicer.org/slicerWiki/index.php/Slicer3::Python&lt;br /&gt;
* Python example modules in Slicer: http://www.slicer.org/slicerWiki/index.php/Slicer3:Execution_Model_Documentation:Python&lt;/div&gt;</summary>
		<author><name>Mseeland</name></author>
		
	</entry>
	<entry>
		<id>https://www.na-mic.org/w/index.php?title=User:Mseeland&amp;diff=36451</id>
		<title>User:Mseeland</title>
		<link rel="alternate" type="text/html" href="https://www.na-mic.org/w/index.php?title=User:Mseeland&amp;diff=36451"/>
		<updated>2009-04-22T09:03:07Z</updated>

		<summary type="html">&lt;p&gt;Mseeland: /* LEVMAR */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Wiki of Madeleine Seeland =&lt;br /&gt;
&lt;br /&gt;
== General Information ==&lt;br /&gt;
&lt;br /&gt;
===About myself===&lt;br /&gt;
I am a grad student of Management Information Systems at the University of Mannheim, Germany. I'm involved in the Diffusion Tensor Imaging (DTI) project in the Laboratory of Mathematics in Imaging. Currently I'm working on two-tensor tractograohy for Neurosurgery. I will document my research experience as a diploma thesis, which I need for completing my studies in Germany.&lt;br /&gt;
&lt;br /&gt;
===Contact information===&lt;br /&gt;
E-mail: mseeland (at sign) bwh.harvard.edu&lt;br /&gt;
&lt;br /&gt;
===Collaborators &amp;amp; Contacts===&lt;br /&gt;
* Supervisors: C-F Westin, Nobuhiko Hata&lt;br /&gt;
* Gordon  Kindlmann (Teem)&lt;br /&gt;
* Sharon Peled&lt;br /&gt;
* Alireza Radmanesh&lt;br /&gt;
* Isaiah Norton&lt;br /&gt;
* Regarding Python: Steve Pieper, Julien de Siebenthal, Sylvain Bouix, Demian Wassermann, Luca Antiga&lt;br /&gt;
&lt;br /&gt;
==Project: Two-Tensor Tractography integration into Slicer==&lt;br /&gt;
&lt;br /&gt;
===Project Description===&lt;br /&gt;
*  Integration of Two-Tensor Tractography into Slicer using Python and the novel Python wrapping for Teem&lt;br /&gt;
*  Use of existing tractography methods in Teem (http://teem.sourceforge.net/)&lt;br /&gt;
*  My part: Interface between Slicer-&amp;gt;Python-&amp;gt;Teem and Teem-&amp;gt;Python-&amp;gt;Slicer&lt;br /&gt;
** pass data from VTK through Python to Teem&lt;br /&gt;
** make use of Teem tractography function calls&lt;br /&gt;
** pass resulting fiber data from Teem to Python to VTK and display fiber tracts in Slicer&lt;br /&gt;
&lt;br /&gt;
===How to enable Python in Slicer 3.3===&lt;br /&gt;
*  The current version of Slicer, Slicer 3.2, does not support Python. In order to use Python you need to install Slicer 3.3.&lt;br /&gt;
&lt;br /&gt;
*  To build Slicer Version 3.3, just do the following two commands:&lt;br /&gt;
  svn co http://svn.slicer.org/Slicer3/trunk Slicer3&lt;br /&gt;
  ./Slicer3/Scripts/getbuildtest.tcl&lt;br /&gt;
&lt;br /&gt;
*  In Slicer 3.3, Python support is disabled by default. In order to enable Python, just follow the next steps:&lt;br /&gt;
&lt;br /&gt;
# Edit slicer_variables.tcl&lt;br /&gt;
## Change &amp;quot;set ::USE_PYTHON &amp;quot;off&amp;quot;&amp;quot; to &amp;quot;on&amp;quot;&lt;br /&gt;
# '''Optional:''' If you prefer to use your system Python installation, see here: [http://www.slicer.org/slicerWiki/index.php/Slicer3::Python] &lt;br /&gt;
# '''Optional:''' installing SciPy, see here: [http://www.slicer.org/slicerWiki/index.php/Slicer3::Python]. However, there are still problems adding scipy in Slicer, whcih are not fixed yet.&lt;br /&gt;
&lt;br /&gt;
*  Rebuild Slicer3 using &amp;quot;getbuildtest.tcl&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 ./Slicer3/Scripts/getbuildtest.tcl&lt;br /&gt;
&lt;br /&gt;
A new menu command '''Python Interpreter''' should appear on the Window menu in Slicer. This command should bring up the Python Console window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Prerequisites for Two-Tensor Tractography module===&lt;br /&gt;
====Teem Python wrapping====&lt;br /&gt;
&lt;br /&gt;
=====BACKGROUND=====&lt;br /&gt;
* Teem Python wrapping is needed to make use of existing Two-Tensor tractography functions in Teem in Python&lt;br /&gt;
* The Python wrappings are based on ctypes, as well as a ctypes code generator (called &amp;quot;ctypeslib&amp;quot;)&lt;br /&gt;
** http://python.net/crew/theller/ctypes&lt;br /&gt;
** http://starship.python.net/crew/theller/wiki/CodeGenerator&lt;br /&gt;
** http://starship.python.net/crew/theller/ctypes/old/codegen.html&lt;br /&gt;
* Ctypes is a standard part of python, by which C functions in a shared library can be called from Python&lt;br /&gt;
* The ctypes code generator converts declarations in C header files into executable Python code: enums, structs, unions, function declarations, com interfaces, and preprocessor definitions.&lt;br /&gt;
* Creating wrappers for C header file(s) is a two step process. &lt;br /&gt;
** First, the ``h2xml.py`` script runs GCC-XML_ over the include file(s), creating a XML file containing declarations and definitions.  &lt;br /&gt;
** Second, the ``xml2py.py`` script parses the XML files and creates Python code containing all or a subset of these definitions.&lt;br /&gt;
* Python code is generated for C enums, structure, unions, typedefs and function declarations.&lt;br /&gt;
&lt;br /&gt;
=====REQUIREMENTS=====&lt;br /&gt;
* Ctypeslib: ctypeslib is an extension package for ctypes. It contains a ctypes code generator.&lt;br /&gt;
* GCC-XML (from http://www.gccxml.org/) is required to parse C header files into an XML description.&lt;br /&gt;
&lt;br /&gt;
=====GETTING THE SOFTWARE=====&lt;br /&gt;
* Python 2.6 can be got here (anything after 2.5 should work): http://www.python.org/download/&lt;br /&gt;
* Get gccxml (I used version 0.9.0), which can be got by CVS as described here: http://www.gccxml.org/HTML/Download.html&lt;br /&gt;
** follow the installation as described here: http://www.gccxml.org/HTML/Install.html&lt;br /&gt;
* use a version of ctypeslib which work with the version of gccxml: &lt;br /&gt;
  http://svn.python.org/projects/ctypes/branches/ctypeslib-gccxml-0.9&lt;br /&gt;
* But this requires some patches to work; the content of the &amp;quot;fixes.patch&amp;quot; file can be found here: [[http://wiki.na-mic.org/Wiki/images/3/3b/Fixes.patch.txt]]:&lt;br /&gt;
   svn co http://svn.python.org/projects/ctypes/branches/ctypeslib-gccxml-0.9&lt;br /&gt;
   cd ctypeslib-gccxml-0.9&lt;br /&gt;
   patch -p0 &amp;lt; ../fixes.patch&lt;br /&gt;
   cd ..&lt;br /&gt;
* ctypeslib is written in python =&amp;gt; there's nothing new to compile at this point&lt;br /&gt;
&lt;br /&gt;
=====CREATING PYTHON/TEEM=====&lt;br /&gt;
* First get Teem (starting from whatever directory should contain the &amp;quot;teem&amp;quot; source dir):&lt;br /&gt;
  svn co https://teem.svn.sourceforge.net/svnroot/teem/teem/trunk teem&lt;br /&gt;
and compile it as a shared library.  Directions for doing this with cmake are here:&lt;br /&gt;
  http://teem.sourceforge.net/build.html&lt;br /&gt;
* create the wrappings in a new directory (e.g. &amp;quot;teem-wrap&amp;quot;), where the XML and Python output will be&lt;br /&gt;
* Set the environment variables that identify where Teem and ctypeslib are:&lt;br /&gt;
** TEEM is where Teem's &amp;quot;make install&amp;quot; put subdirectories &amp;quot;bin&amp;quot;, &amp;quot;lib&amp;quot;, and &amp;quot;include&amp;quot; (e.g. ~/teem-build)&lt;br /&gt;
** CTYPES is the full path of ctypeslib-gccxml-0.9&lt;br /&gt;
* First create (in, for example, &amp;quot;teem-wrap&amp;quot;) a meta-header for all the Teem header files (in tcsh):&lt;br /&gt;
   mkdir teemincl&lt;br /&gt;
   cp -r ${TEEM}/include/teem teemincl&lt;br /&gt;
   cd teemincl&lt;br /&gt;
   ls -1 teem/*.h | awk '{print &amp;quot;#include &amp;lt;&amp;quot;$1&amp;quot;&amp;gt;&amp;quot;}' &amp;gt; all.h&lt;br /&gt;
   cd ..&lt;br /&gt;
* Then create teem.xml:&lt;br /&gt;
   setenv PYTHONPATH $CTYPES&lt;br /&gt;
   python $CTYPES/scripts/h2xml.py `pwd`/teemincl/all.h -I teemincl -o teem.xml &lt;br /&gt;
* Then create teem.py (use DYLD_LIBRARY_PATH in a mac):&lt;br /&gt;
   setenv LD_LIBRARY_PATH ${TEEM}/lib&lt;br /&gt;
   python $CTYPES/scripts/xml2py.py teem.xml -llibteem.so -o teem.py \&lt;br /&gt;
        -r &amp;quot;(air|hest|biff|nrrd|ell|unrrdu|moss|gage|bane|limn|seek|hoover|echo|ten|dye|mite).*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
====LEVMAR====&lt;br /&gt;
&lt;br /&gt;
* The 2-tensor tractography depends on Levenberg-Marquardt nonlinear optimization of Sharon Peled's constrained two-tensor model. I used the following implementation for it: http://www.ics.forth.gr/~lourakis/levmar/&lt;br /&gt;
* First, in lm.h you need to uncomment the line that says: #undef HAVE_LAPACK (around line 30)&lt;br /&gt;
* The levmar code is enabled by compiling Teem with TEEM_LEVMAR defined (turn LEVMAR ON while doing ccmake). The include paths and library link paths also need to be defined for everything to work.&lt;br /&gt;
* Here are the changes in the teem/CMakeLists.txt file that work for me:&lt;br /&gt;
&lt;br /&gt;
Replace the following line&lt;br /&gt;
# Look for &amp;quot;levmar&amp;quot; library &amp;lt;http://www.ics.forth.gr/~lourakis/levmar/&amp;gt;&lt;br /&gt;
OPTION(Teem_LEVMAR &amp;quot;Build Teem with levmar library support.&amp;quot; OFF)&lt;br /&gt;
SET(Teem_LEVMAR_LIB &amp;quot;&amp;quot;)&lt;br /&gt;
IF(Teem_LEVMAR)&lt;br /&gt;
  FIND_PACKAGE(LEVMAR)&lt;br /&gt;
  IF(LEVMAR_FOUND)&lt;br /&gt;
    ADD_DEFINITIONS(-DTEEM_LEVMAR)&lt;br /&gt;
    SET(Teem_LEVMAR_LIB ${LEVMAR_LIBRARIES})&lt;br /&gt;
    SET(Teem_LEVMAR_IPATH ${LEVMAR_INCLUDE_DIR})&lt;br /&gt;
  ELSE(LEVMAR_FOUND)&lt;br /&gt;
    # We need to set this as a cache variable, so that it will show up as&lt;br /&gt;
    # being turned off in the cache.&lt;br /&gt;
    MESSAGE(SEND_ERROR &amp;quot;Turning off Teem_LEVMAR, because it wasn't found.&amp;quot;)&lt;br /&gt;
    SET(Teem_LEVMAR OFF CACHE BOOL &amp;quot;Build Teem with levmar library support.&amp;quot; FORCE)&lt;br /&gt;
  ENDIF(LEVMAR_FOUND)&lt;br /&gt;
ENDIF(Teem_LEVMAR)&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
&lt;br /&gt;
# Look for &amp;quot;levmar&amp;quot; library &amp;lt;http://www.ics.forth.gr/~lourakis/levmar/&amp;gt;&lt;br /&gt;
OPTION(Teem_LEVMAR &amp;quot;Build Teem with levmar library support.&amp;quot; OFF)&lt;br /&gt;
IF(Teem_LEVMAR)&lt;br /&gt;
    ADD_DEFINITIONS(-DTEEM_LEVMAR)&lt;br /&gt;
    SET(Teem_LEVMAR_PATH &amp;quot;/media/sda7/Programming/levmar&amp;quot;)&lt;br /&gt;
    SET(Teem_LEVMAR_LIB &amp;quot;${LEVMAR_LEVMAR_PATH}/levmar-build/liblevmar.a&amp;quot; CACHE STRING &amp;quot;library path&amp;quot;)&lt;br /&gt;
    SET(Teem_LEVMAR_IPATH &amp;quot;${LEVMAR_LEVMAR_PATH}/levmar-2.3&amp;quot; CACHE STRING &amp;quot;ipath&amp;quot;)&lt;br /&gt;
ENDIF(Teem_LEVMAR)&lt;br /&gt;
&lt;br /&gt;
and replace the pathes with your pathes.&lt;br /&gt;
&lt;br /&gt;
====Python processing package====&lt;br /&gt;
&lt;br /&gt;
* This package needs to be downloaded here:&lt;br /&gt;
http://pypi.python.org/pypi/processing&lt;br /&gt;
&lt;br /&gt;
==Status/Progress==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=0&lt;br /&gt;
|- bgcolor=&amp;quot;#abcdef&amp;quot;&lt;br /&gt;
! Month !! Week #  !! Start Date - End Date !! Done !! Date Done&lt;br /&gt;
|-&lt;br /&gt;
|height=5|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Find optimal parameter setting of the Two-Tensor Tractography method ||align=&amp;quot;center&amp;quot; |  || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Extend Two-Tensor Tractography module by fiducial seeding ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | NA-MIC Project Week in Salt Lake City ([http://www.na-mic.org/Wiki/index.php/2009_Winter_Project_Week],[http://www.na-mic.org/Wiki/index.php/Two-tensor_tractography_in_Slicer_using_Python_and_Teem]) ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! January !!  | Week 2 || 05.01 - 11.01 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | IGT Project Week ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 50 || 08.12 - 14.12 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! December !!  | Week 49 || 01.12 - 07.12 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to compile teem with levmar (= Levenberg-Marquardt nonlinear least squares algorithm) ||align=&amp;quot;center&amp;quot; | x || Mon Dec, 1st&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 48 !! 24.11 - 30.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | document the results of the two-tensor tractography given a tensor volume ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to do mutli trace tractography given a DWI volume ||align=&amp;quot;center&amp;quot; | x || Mon Nov, 17th&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 47 !! 17.11 - 23.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Working on Python tractography module for multi fiber tracing given a tensor volume ||align=&amp;quot;center&amp;quot; | x || Mon Nov, 17th&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 46 !! 10.11 - 16.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Get vertex data out of the nvert nrrd filled by the tractography back to Slicer ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to pass image data from Python to Teem through nrrdWrap_nva function ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to generate a list of point locations that were used as tractography seedpoints in the VTK tractography ||align=&amp;quot;center&amp;quot; | x || Thu Nov, 13th&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Implement Python tractography module for single fiber tracing given a seeding starting point and a tensor volume ||align=&amp;quot;center&amp;quot; | x || Fri, Nov, 7th&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 45 || 03.11 - 09.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to get image data from numpy (= Python package) to Teem nrrd struct ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! November !!  | Week 44 || 27.10 - 02.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;20px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to get image data from numpy (= Python package) to Teem nrrd struct ||align=&amp;quot;center&amp;quot; | x ||&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !!  Week 43 || 20.10 - 26.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to access DWI volumes through Python ||align=&amp;quot;center&amp;quot; | x || Fri Oct, 17th&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Get Teem wrapped in Python ||align=&amp;quot;center&amp;quot; | x || Fri Oct, 19th&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 42 || 13.10 - 19.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Try to implement the seeding part of the (VTK) one-tensor tractography module in Python || align=&amp;quot;center&amp;quot; | x || Tue Oct, 14th&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 41 || 06.10 - 12.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
|height=10|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Try to implement the seeding part of the (VTK) one-tensor tractography module in Python || align=&amp;quot;center&amp;quot; | x || Tue Oct, 14th&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! October !!  Week 40 || 29.09 - 5.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;20px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; |Totally understand existing Python modules in Slicer || align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; |understand existing one-tensor streamline tractography in Slicer (VTK) || align=&amp;quot;center&amp;quot; | x || Tue Sep, 23rd &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Totally understand existing Python modules in Slicer ||align=&amp;quot;center&amp;quot; | x || Tue Sep, 23rd&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !!  Week 39 || 22.09 - 28.09 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; | Slicer &amp;amp; Python Tutorials || align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; | Enable Python in Slicer || align=&amp;quot;center&amp;quot; | x || Mon Sep, 22nd&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot; &lt;br /&gt;
! September !! Week 38 || 14.09 - 21.09 || ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Information==&lt;br /&gt;
* Diffusion Tensor Analysis in Slicer: http://www.na-mic.org/Wiki/images/0/04/Slicer3diffusionTutorial7.pdf&lt;br /&gt;
* Building a Slicer 3 Module GUI: http://www.slicer.org/pages/Building_a_Slicer_3_Module_GUI&lt;br /&gt;
&lt;br /&gt;
Python:&lt;br /&gt;
* SlicerWiki about Python: http://www.slicer.org/slicerWiki/index.php/Slicer3::Python&lt;br /&gt;
* Python example modules in Slicer: http://www.slicer.org/slicerWiki/index.php/Slicer3:Execution_Model_Documentation:Python&lt;/div&gt;</summary>
		<author><name>Mseeland</name></author>
		
	</entry>
	<entry>
		<id>https://www.na-mic.org/w/index.php?title=User:Mseeland&amp;diff=36450</id>
		<title>User:Mseeland</title>
		<link rel="alternate" type="text/html" href="https://www.na-mic.org/w/index.php?title=User:Mseeland&amp;diff=36450"/>
		<updated>2009-04-22T09:01:49Z</updated>

		<summary type="html">&lt;p&gt;Mseeland: /* LEVMAR */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Wiki of Madeleine Seeland =&lt;br /&gt;
&lt;br /&gt;
== General Information ==&lt;br /&gt;
&lt;br /&gt;
===About myself===&lt;br /&gt;
I am a grad student of Management Information Systems at the University of Mannheim, Germany. I'm involved in the Diffusion Tensor Imaging (DTI) project in the Laboratory of Mathematics in Imaging. Currently I'm working on two-tensor tractograohy for Neurosurgery. I will document my research experience as a diploma thesis, which I need for completing my studies in Germany.&lt;br /&gt;
&lt;br /&gt;
===Contact information===&lt;br /&gt;
E-mail: mseeland (at sign) bwh.harvard.edu&lt;br /&gt;
&lt;br /&gt;
===Collaborators &amp;amp; Contacts===&lt;br /&gt;
* Supervisors: C-F Westin, Nobuhiko Hata&lt;br /&gt;
* Gordon  Kindlmann (Teem)&lt;br /&gt;
* Sharon Peled&lt;br /&gt;
* Alireza Radmanesh&lt;br /&gt;
* Isaiah Norton&lt;br /&gt;
* Regarding Python: Steve Pieper, Julien de Siebenthal, Sylvain Bouix, Demian Wassermann, Luca Antiga&lt;br /&gt;
&lt;br /&gt;
==Project: Two-Tensor Tractography integration into Slicer==&lt;br /&gt;
&lt;br /&gt;
===Project Description===&lt;br /&gt;
*  Integration of Two-Tensor Tractography into Slicer using Python and the novel Python wrapping for Teem&lt;br /&gt;
*  Use of existing tractography methods in Teem (http://teem.sourceforge.net/)&lt;br /&gt;
*  My part: Interface between Slicer-&amp;gt;Python-&amp;gt;Teem and Teem-&amp;gt;Python-&amp;gt;Slicer&lt;br /&gt;
** pass data from VTK through Python to Teem&lt;br /&gt;
** make use of Teem tractography function calls&lt;br /&gt;
** pass resulting fiber data from Teem to Python to VTK and display fiber tracts in Slicer&lt;br /&gt;
&lt;br /&gt;
===How to enable Python in Slicer 3.3===&lt;br /&gt;
*  The current version of Slicer, Slicer 3.2, does not support Python. In order to use Python you need to install Slicer 3.3.&lt;br /&gt;
&lt;br /&gt;
*  To build Slicer Version 3.3, just do the following two commands:&lt;br /&gt;
  svn co http://svn.slicer.org/Slicer3/trunk Slicer3&lt;br /&gt;
  ./Slicer3/Scripts/getbuildtest.tcl&lt;br /&gt;
&lt;br /&gt;
*  In Slicer 3.3, Python support is disabled by default. In order to enable Python, just follow the next steps:&lt;br /&gt;
&lt;br /&gt;
# Edit slicer_variables.tcl&lt;br /&gt;
## Change &amp;quot;set ::USE_PYTHON &amp;quot;off&amp;quot;&amp;quot; to &amp;quot;on&amp;quot;&lt;br /&gt;
# '''Optional:''' If you prefer to use your system Python installation, see here: [http://www.slicer.org/slicerWiki/index.php/Slicer3::Python] &lt;br /&gt;
# '''Optional:''' installing SciPy, see here: [http://www.slicer.org/slicerWiki/index.php/Slicer3::Python]. However, there are still problems adding scipy in Slicer, whcih are not fixed yet.&lt;br /&gt;
&lt;br /&gt;
*  Rebuild Slicer3 using &amp;quot;getbuildtest.tcl&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 ./Slicer3/Scripts/getbuildtest.tcl&lt;br /&gt;
&lt;br /&gt;
A new menu command '''Python Interpreter''' should appear on the Window menu in Slicer. This command should bring up the Python Console window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Prerequisites for Two-Tensor Tractography module===&lt;br /&gt;
====Teem Python wrapping====&lt;br /&gt;
&lt;br /&gt;
=====BACKGROUND=====&lt;br /&gt;
* Teem Python wrapping is needed to make use of existing Two-Tensor tractography functions in Teem in Python&lt;br /&gt;
* The Python wrappings are based on ctypes, as well as a ctypes code generator (called &amp;quot;ctypeslib&amp;quot;)&lt;br /&gt;
** http://python.net/crew/theller/ctypes&lt;br /&gt;
** http://starship.python.net/crew/theller/wiki/CodeGenerator&lt;br /&gt;
** http://starship.python.net/crew/theller/ctypes/old/codegen.html&lt;br /&gt;
* Ctypes is a standard part of python, by which C functions in a shared library can be called from Python&lt;br /&gt;
* The ctypes code generator converts declarations in C header files into executable Python code: enums, structs, unions, function declarations, com interfaces, and preprocessor definitions.&lt;br /&gt;
* Creating wrappers for C header file(s) is a two step process. &lt;br /&gt;
** First, the ``h2xml.py`` script runs GCC-XML_ over the include file(s), creating a XML file containing declarations and definitions.  &lt;br /&gt;
** Second, the ``xml2py.py`` script parses the XML files and creates Python code containing all or a subset of these definitions.&lt;br /&gt;
* Python code is generated for C enums, structure, unions, typedefs and function declarations.&lt;br /&gt;
&lt;br /&gt;
=====REQUIREMENTS=====&lt;br /&gt;
* Ctypeslib: ctypeslib is an extension package for ctypes. It contains a ctypes code generator.&lt;br /&gt;
* GCC-XML (from http://www.gccxml.org/) is required to parse C header files into an XML description.&lt;br /&gt;
&lt;br /&gt;
=====GETTING THE SOFTWARE=====&lt;br /&gt;
* Python 2.6 can be got here (anything after 2.5 should work): http://www.python.org/download/&lt;br /&gt;
* Get gccxml (I used version 0.9.0), which can be got by CVS as described here: http://www.gccxml.org/HTML/Download.html&lt;br /&gt;
** follow the installation as described here: http://www.gccxml.org/HTML/Install.html&lt;br /&gt;
* use a version of ctypeslib which work with the version of gccxml: &lt;br /&gt;
  http://svn.python.org/projects/ctypes/branches/ctypeslib-gccxml-0.9&lt;br /&gt;
* But this requires some patches to work; the content of the &amp;quot;fixes.patch&amp;quot; file can be found here: [[http://wiki.na-mic.org/Wiki/images/3/3b/Fixes.patch.txt]]:&lt;br /&gt;
   svn co http://svn.python.org/projects/ctypes/branches/ctypeslib-gccxml-0.9&lt;br /&gt;
   cd ctypeslib-gccxml-0.9&lt;br /&gt;
   patch -p0 &amp;lt; ../fixes.patch&lt;br /&gt;
   cd ..&lt;br /&gt;
* ctypeslib is written in python =&amp;gt; there's nothing new to compile at this point&lt;br /&gt;
&lt;br /&gt;
=====CREATING PYTHON/TEEM=====&lt;br /&gt;
* First get Teem (starting from whatever directory should contain the &amp;quot;teem&amp;quot; source dir):&lt;br /&gt;
  svn co https://teem.svn.sourceforge.net/svnroot/teem/teem/trunk teem&lt;br /&gt;
and compile it as a shared library.  Directions for doing this with cmake are here:&lt;br /&gt;
  http://teem.sourceforge.net/build.html&lt;br /&gt;
* create the wrappings in a new directory (e.g. &amp;quot;teem-wrap&amp;quot;), where the XML and Python output will be&lt;br /&gt;
* Set the environment variables that identify where Teem and ctypeslib are:&lt;br /&gt;
** TEEM is where Teem's &amp;quot;make install&amp;quot; put subdirectories &amp;quot;bin&amp;quot;, &amp;quot;lib&amp;quot;, and &amp;quot;include&amp;quot; (e.g. ~/teem-build)&lt;br /&gt;
** CTYPES is the full path of ctypeslib-gccxml-0.9&lt;br /&gt;
* First create (in, for example, &amp;quot;teem-wrap&amp;quot;) a meta-header for all the Teem header files (in tcsh):&lt;br /&gt;
   mkdir teemincl&lt;br /&gt;
   cp -r ${TEEM}/include/teem teemincl&lt;br /&gt;
   cd teemincl&lt;br /&gt;
   ls -1 teem/*.h | awk '{print &amp;quot;#include &amp;lt;&amp;quot;$1&amp;quot;&amp;gt;&amp;quot;}' &amp;gt; all.h&lt;br /&gt;
   cd ..&lt;br /&gt;
* Then create teem.xml:&lt;br /&gt;
   setenv PYTHONPATH $CTYPES&lt;br /&gt;
   python $CTYPES/scripts/h2xml.py `pwd`/teemincl/all.h -I teemincl -o teem.xml &lt;br /&gt;
* Then create teem.py (use DYLD_LIBRARY_PATH in a mac):&lt;br /&gt;
   setenv LD_LIBRARY_PATH ${TEEM}/lib&lt;br /&gt;
   python $CTYPES/scripts/xml2py.py teem.xml -llibteem.so -o teem.py \&lt;br /&gt;
        -r &amp;quot;(air|hest|biff|nrrd|ell|unrrdu|moss|gage|bane|limn|seek|hoover|echo|ten|dye|mite).*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
====LEVMAR====&lt;br /&gt;
&lt;br /&gt;
* The 2-tensor tractography depends on Levenberg-Marquardt nonlinear optimization of Sharon Peled's constrained two-tensor model. I used the following implementation for it: http://www.ics.forth.gr/~lourakis/levmar/&lt;br /&gt;
* First, in lm.h you need to uncomment the line that says: #undef HAVE_LAPACK (around line 30)&lt;br /&gt;
* The levmar code is enabled by compiling Teem with TEEM_LEVMAR defined (turn LEVMAR ON while doing ccmake). The include paths and library link paths also need to be defined for everything to work.&lt;br /&gt;
* Here are the changes in the teem/CMakeLists.txt file that work for me:&lt;br /&gt;
&lt;br /&gt;
Replace the following line&lt;br /&gt;
# Look for &amp;quot;levmar&amp;quot; library &amp;lt;http://www.ics.forth.gr/~lourakis/levmar/&amp;gt;&lt;br /&gt;
OPTION(Teem_LEVMAR &amp;quot;Build Teem with levmar library support.&amp;quot; OFF)&lt;br /&gt;
SET(Teem_LEVMAR_LIB &amp;quot;&amp;quot;)&lt;br /&gt;
IF(Teem_LEVMAR)&lt;br /&gt;
  FIND_PACKAGE(LEVMAR)&lt;br /&gt;
&lt;br /&gt;
  IF(LEVMAR_FOUND)&lt;br /&gt;
    ADD_DEFINITIONS(-DTEEM_LEVMAR)&lt;br /&gt;
    SET(Teem_LEVMAR_LIB ${LEVMAR_LIBRARIES})&lt;br /&gt;
    SET(Teem_LEVMAR_IPATH ${LEVMAR_INCLUDE_DIR})&lt;br /&gt;
  ELSE(LEVMAR_FOUND)&lt;br /&gt;
    # We need to set this as a cache variable, so that it will show up as&lt;br /&gt;
    # being turned off in the cache.&lt;br /&gt;
    MESSAGE(SEND_ERROR &amp;quot;Turning off Teem_LEVMAR, because it wasn't found.&amp;quot;)&lt;br /&gt;
    SET(Teem_LEVMAR OFF CACHE BOOL &amp;quot;Build Teem with levmar library support.&amp;quot; FORCE)&lt;br /&gt;
  ENDIF(LEVMAR_FOUND)&lt;br /&gt;
ENDIF(Teem_LEVMAR)&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
&lt;br /&gt;
# Look for &amp;quot;levmar&amp;quot; library &amp;lt;http://www.ics.forth.gr/~lourakis/levmar/&amp;gt;&lt;br /&gt;
OPTION(Teem_LEVMAR &amp;quot;Build Teem with levmar library support.&amp;quot; OFF)&lt;br /&gt;
IF(Teem_LEVMAR)&lt;br /&gt;
    ADD_DEFINITIONS(-DTEEM_LEVMAR)&lt;br /&gt;
    SET(Teem_LEVMAR_PATH &amp;quot;/media/sda7/Programming/levmar&amp;quot;)&lt;br /&gt;
    SET(Teem_LEVMAR_LIB &amp;quot;${LEVMAR_LEVMAR_PATH}/levmar-build/liblevmar.a&amp;quot; CACHE STRING &amp;quot;library path&amp;quot;)&lt;br /&gt;
    SET(Teem_LEVMAR_IPATH &amp;quot;${LEVMAR_LEVMAR_PATH}/levmar-2.3&amp;quot; CACHE STRING &amp;quot;ipath&amp;quot;)&lt;br /&gt;
ENDIF(Teem_LEVMAR)&lt;br /&gt;
&lt;br /&gt;
and replace the pathes with your pathes.&lt;br /&gt;
&lt;br /&gt;
====Python processing package====&lt;br /&gt;
&lt;br /&gt;
* This package needs to be downloaded here:&lt;br /&gt;
http://pypi.python.org/pypi/processing&lt;br /&gt;
&lt;br /&gt;
==Status/Progress==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=0&lt;br /&gt;
|- bgcolor=&amp;quot;#abcdef&amp;quot;&lt;br /&gt;
! Month !! Week #  !! Start Date - End Date !! Done !! Date Done&lt;br /&gt;
|-&lt;br /&gt;
|height=5|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Find optimal parameter setting of the Two-Tensor Tractography method ||align=&amp;quot;center&amp;quot; |  || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Extend Two-Tensor Tractography module by fiducial seeding ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | NA-MIC Project Week in Salt Lake City ([http://www.na-mic.org/Wiki/index.php/2009_Winter_Project_Week],[http://www.na-mic.org/Wiki/index.php/Two-tensor_tractography_in_Slicer_using_Python_and_Teem]) ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! January !!  | Week 2 || 05.01 - 11.01 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | IGT Project Week ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 50 || 08.12 - 14.12 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! December !!  | Week 49 || 01.12 - 07.12 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to compile teem with levmar (= Levenberg-Marquardt nonlinear least squares algorithm) ||align=&amp;quot;center&amp;quot; | x || Mon Dec, 1st&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 48 !! 24.11 - 30.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | document the results of the two-tensor tractography given a tensor volume ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to do mutli trace tractography given a DWI volume ||align=&amp;quot;center&amp;quot; | x || Mon Nov, 17th&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 47 !! 17.11 - 23.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Working on Python tractography module for multi fiber tracing given a tensor volume ||align=&amp;quot;center&amp;quot; | x || Mon Nov, 17th&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 46 !! 10.11 - 16.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Get vertex data out of the nvert nrrd filled by the tractography back to Slicer ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to pass image data from Python to Teem through nrrdWrap_nva function ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to generate a list of point locations that were used as tractography seedpoints in the VTK tractography ||align=&amp;quot;center&amp;quot; | x || Thu Nov, 13th&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Implement Python tractography module for single fiber tracing given a seeding starting point and a tensor volume ||align=&amp;quot;center&amp;quot; | x || Fri, Nov, 7th&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 45 || 03.11 - 09.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to get image data from numpy (= Python package) to Teem nrrd struct ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! November !!  | Week 44 || 27.10 - 02.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;20px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to get image data from numpy (= Python package) to Teem nrrd struct ||align=&amp;quot;center&amp;quot; | x ||&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !!  Week 43 || 20.10 - 26.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to access DWI volumes through Python ||align=&amp;quot;center&amp;quot; | x || Fri Oct, 17th&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Get Teem wrapped in Python ||align=&amp;quot;center&amp;quot; | x || Fri Oct, 19th&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 42 || 13.10 - 19.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Try to implement the seeding part of the (VTK) one-tensor tractography module in Python || align=&amp;quot;center&amp;quot; | x || Tue Oct, 14th&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 41 || 06.10 - 12.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
|height=10|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Try to implement the seeding part of the (VTK) one-tensor tractography module in Python || align=&amp;quot;center&amp;quot; | x || Tue Oct, 14th&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! October !!  Week 40 || 29.09 - 5.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;20px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; |Totally understand existing Python modules in Slicer || align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; |understand existing one-tensor streamline tractography in Slicer (VTK) || align=&amp;quot;center&amp;quot; | x || Tue Sep, 23rd &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Totally understand existing Python modules in Slicer ||align=&amp;quot;center&amp;quot; | x || Tue Sep, 23rd&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !!  Week 39 || 22.09 - 28.09 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; | Slicer &amp;amp; Python Tutorials || align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; | Enable Python in Slicer || align=&amp;quot;center&amp;quot; | x || Mon Sep, 22nd&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot; &lt;br /&gt;
! September !! Week 38 || 14.09 - 21.09 || ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Information==&lt;br /&gt;
* Diffusion Tensor Analysis in Slicer: http://www.na-mic.org/Wiki/images/0/04/Slicer3diffusionTutorial7.pdf&lt;br /&gt;
* Building a Slicer 3 Module GUI: http://www.slicer.org/pages/Building_a_Slicer_3_Module_GUI&lt;br /&gt;
&lt;br /&gt;
Python:&lt;br /&gt;
* SlicerWiki about Python: http://www.slicer.org/slicerWiki/index.php/Slicer3::Python&lt;br /&gt;
* Python example modules in Slicer: http://www.slicer.org/slicerWiki/index.php/Slicer3:Execution_Model_Documentation:Python&lt;/div&gt;</summary>
		<author><name>Mseeland</name></author>
		
	</entry>
	<entry>
		<id>https://www.na-mic.org/w/index.php?title=User:Mseeland&amp;diff=36449</id>
		<title>User:Mseeland</title>
		<link rel="alternate" type="text/html" href="https://www.na-mic.org/w/index.php?title=User:Mseeland&amp;diff=36449"/>
		<updated>2009-04-22T05:37:07Z</updated>

		<summary type="html">&lt;p&gt;Mseeland: /* Requirements for Two-Tensor Tractography module */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Wiki of Madeleine Seeland =&lt;br /&gt;
&lt;br /&gt;
== General Information ==&lt;br /&gt;
&lt;br /&gt;
===About myself===&lt;br /&gt;
I am a grad student of Management Information Systems at the University of Mannheim, Germany. I'm involved in the Diffusion Tensor Imaging (DTI) project in the Laboratory of Mathematics in Imaging. Currently I'm working on two-tensor tractograohy for Neurosurgery. I will document my research experience as a diploma thesis, which I need for completing my studies in Germany.&lt;br /&gt;
&lt;br /&gt;
===Contact information===&lt;br /&gt;
E-mail: mseeland (at sign) bwh.harvard.edu&lt;br /&gt;
&lt;br /&gt;
===Collaborators &amp;amp; Contacts===&lt;br /&gt;
* Supervisors: C-F Westin, Nobuhiko Hata&lt;br /&gt;
* Gordon  Kindlmann (Teem)&lt;br /&gt;
* Sharon Peled&lt;br /&gt;
* Alireza Radmanesh&lt;br /&gt;
* Isaiah Norton&lt;br /&gt;
* Regarding Python: Steve Pieper, Julien de Siebenthal, Sylvain Bouix, Demian Wassermann, Luca Antiga&lt;br /&gt;
&lt;br /&gt;
==Project: Two-Tensor Tractography integration into Slicer==&lt;br /&gt;
&lt;br /&gt;
===Project Description===&lt;br /&gt;
*  Integration of Two-Tensor Tractography into Slicer using Python and the novel Python wrapping for Teem&lt;br /&gt;
*  Use of existing tractography methods in Teem (http://teem.sourceforge.net/)&lt;br /&gt;
*  My part: Interface between Slicer-&amp;gt;Python-&amp;gt;Teem and Teem-&amp;gt;Python-&amp;gt;Slicer&lt;br /&gt;
** pass data from VTK through Python to Teem&lt;br /&gt;
** make use of Teem tractography function calls&lt;br /&gt;
** pass resulting fiber data from Teem to Python to VTK and display fiber tracts in Slicer&lt;br /&gt;
&lt;br /&gt;
===How to enable Python in Slicer 3.3===&lt;br /&gt;
*  The current version of Slicer, Slicer 3.2, does not support Python. In order to use Python you need to install Slicer 3.3.&lt;br /&gt;
&lt;br /&gt;
*  To build Slicer Version 3.3, just do the following two commands:&lt;br /&gt;
  svn co http://svn.slicer.org/Slicer3/trunk Slicer3&lt;br /&gt;
  ./Slicer3/Scripts/getbuildtest.tcl&lt;br /&gt;
&lt;br /&gt;
*  In Slicer 3.3, Python support is disabled by default. In order to enable Python, just follow the next steps:&lt;br /&gt;
&lt;br /&gt;
# Edit slicer_variables.tcl&lt;br /&gt;
## Change &amp;quot;set ::USE_PYTHON &amp;quot;off&amp;quot;&amp;quot; to &amp;quot;on&amp;quot;&lt;br /&gt;
# '''Optional:''' If you prefer to use your system Python installation, see here: [http://www.slicer.org/slicerWiki/index.php/Slicer3::Python] &lt;br /&gt;
# '''Optional:''' installing SciPy, see here: [http://www.slicer.org/slicerWiki/index.php/Slicer3::Python]. However, there are still problems adding scipy in Slicer, whcih are not fixed yet.&lt;br /&gt;
&lt;br /&gt;
*  Rebuild Slicer3 using &amp;quot;getbuildtest.tcl&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 ./Slicer3/Scripts/getbuildtest.tcl&lt;br /&gt;
&lt;br /&gt;
A new menu command '''Python Interpreter''' should appear on the Window menu in Slicer. This command should bring up the Python Console window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Prerequisites for Two-Tensor Tractography module===&lt;br /&gt;
====Teem Python wrapping====&lt;br /&gt;
&lt;br /&gt;
=====BACKGROUND=====&lt;br /&gt;
* Teem Python wrapping is needed to make use of existing Two-Tensor tractography functions in Teem in Python&lt;br /&gt;
* The Python wrappings are based on ctypes, as well as a ctypes code generator (called &amp;quot;ctypeslib&amp;quot;)&lt;br /&gt;
** http://python.net/crew/theller/ctypes&lt;br /&gt;
** http://starship.python.net/crew/theller/wiki/CodeGenerator&lt;br /&gt;
** http://starship.python.net/crew/theller/ctypes/old/codegen.html&lt;br /&gt;
* Ctypes is a standard part of python, by which C functions in a shared library can be called from Python&lt;br /&gt;
* The ctypes code generator converts declarations in C header files into executable Python code: enums, structs, unions, function declarations, com interfaces, and preprocessor definitions.&lt;br /&gt;
* Creating wrappers for C header file(s) is a two step process. &lt;br /&gt;
** First, the ``h2xml.py`` script runs GCC-XML_ over the include file(s), creating a XML file containing declarations and definitions.  &lt;br /&gt;
** Second, the ``xml2py.py`` script parses the XML files and creates Python code containing all or a subset of these definitions.&lt;br /&gt;
* Python code is generated for C enums, structure, unions, typedefs and function declarations.&lt;br /&gt;
&lt;br /&gt;
=====REQUIREMENTS=====&lt;br /&gt;
* Ctypeslib: ctypeslib is an extension package for ctypes. It contains a ctypes code generator.&lt;br /&gt;
* GCC-XML (from http://www.gccxml.org/) is required to parse C header files into an XML description.&lt;br /&gt;
&lt;br /&gt;
=====GETTING THE SOFTWARE=====&lt;br /&gt;
* Python 2.6 can be got here (anything after 2.5 should work): http://www.python.org/download/&lt;br /&gt;
* Get gccxml (I used version 0.9.0), which can be got by CVS as described here: http://www.gccxml.org/HTML/Download.html&lt;br /&gt;
** follow the installation as described here: http://www.gccxml.org/HTML/Install.html&lt;br /&gt;
* use a version of ctypeslib which work with the version of gccxml: &lt;br /&gt;
  http://svn.python.org/projects/ctypes/branches/ctypeslib-gccxml-0.9&lt;br /&gt;
* But this requires some patches to work; the content of the &amp;quot;fixes.patch&amp;quot; file can be found here: [[http://wiki.na-mic.org/Wiki/images/3/3b/Fixes.patch.txt]]:&lt;br /&gt;
   svn co http://svn.python.org/projects/ctypes/branches/ctypeslib-gccxml-0.9&lt;br /&gt;
   cd ctypeslib-gccxml-0.9&lt;br /&gt;
   patch -p0 &amp;lt; ../fixes.patch&lt;br /&gt;
   cd ..&lt;br /&gt;
* ctypeslib is written in python =&amp;gt; there's nothing new to compile at this point&lt;br /&gt;
&lt;br /&gt;
=====CREATING PYTHON/TEEM=====&lt;br /&gt;
* First get Teem (starting from whatever directory should contain the &amp;quot;teem&amp;quot; source dir):&lt;br /&gt;
  svn co https://teem.svn.sourceforge.net/svnroot/teem/teem/trunk teem&lt;br /&gt;
and compile it as a shared library.  Directions for doing this with cmake are here:&lt;br /&gt;
  http://teem.sourceforge.net/build.html&lt;br /&gt;
* create the wrappings in a new directory (e.g. &amp;quot;teem-wrap&amp;quot;), where the XML and Python output will be&lt;br /&gt;
* Set the environment variables that identify where Teem and ctypeslib are:&lt;br /&gt;
** TEEM is where Teem's &amp;quot;make install&amp;quot; put subdirectories &amp;quot;bin&amp;quot;, &amp;quot;lib&amp;quot;, and &amp;quot;include&amp;quot; (e.g. ~/teem-build)&lt;br /&gt;
** CTYPES is the full path of ctypeslib-gccxml-0.9&lt;br /&gt;
* First create (in, for example, &amp;quot;teem-wrap&amp;quot;) a meta-header for all the Teem header files (in tcsh):&lt;br /&gt;
   mkdir teemincl&lt;br /&gt;
   cp -r ${TEEM}/include/teem teemincl&lt;br /&gt;
   cd teemincl&lt;br /&gt;
   ls -1 teem/*.h | awk '{print &amp;quot;#include &amp;lt;&amp;quot;$1&amp;quot;&amp;gt;&amp;quot;}' &amp;gt; all.h&lt;br /&gt;
   cd ..&lt;br /&gt;
* Then create teem.xml:&lt;br /&gt;
   setenv PYTHONPATH $CTYPES&lt;br /&gt;
   python $CTYPES/scripts/h2xml.py `pwd`/teemincl/all.h -I teemincl -o teem.xml &lt;br /&gt;
* Then create teem.py (use DYLD_LIBRARY_PATH in a mac):&lt;br /&gt;
   setenv LD_LIBRARY_PATH ${TEEM}/lib&lt;br /&gt;
   python $CTYPES/scripts/xml2py.py teem.xml -llibteem.so -o teem.py \&lt;br /&gt;
        -r &amp;quot;(air|hest|biff|nrrd|ell|unrrdu|moss|gage|bane|limn|seek|hoover|echo|ten|dye|mite).*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
====LEVMAR====&lt;br /&gt;
&lt;br /&gt;
* The 2-tensor tractography depends on Levenberg-Marquardt nonlinear optimization of Sharon Peled's constrained two-tensor model. I used the following implementation for it: http://www.ics.forth.gr/~lourakis/levmar/&lt;br /&gt;
* This code is enabled by compiling Teem with TEEM_LEVMAR defined. The include paths and library link paths need also be defined for everything to work.&lt;br /&gt;
* There are problems compiling LEVMAR with cmake. I found no way to create a build of levmar that allows Teem to say in Teem's CMakeLists.txt simply: FIND_PACKAGE(LEVMAR)). Therefore I compiled levmar myself and then changed Teem's CMake stuff so that the user sets the Teem_LEVMAR_LIB and Teem_LEVMAR_IPATH variables directly (so that the user does by hand what's normally done by &amp;quot;FIND_PACKAGE(LEVMAR)&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
====Python processing package====&lt;br /&gt;
&lt;br /&gt;
* This package needs to be downloaded here:&lt;br /&gt;
http://pypi.python.org/pypi/processing&lt;br /&gt;
&lt;br /&gt;
==Status/Progress==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=0&lt;br /&gt;
|- bgcolor=&amp;quot;#abcdef&amp;quot;&lt;br /&gt;
! Month !! Week #  !! Start Date - End Date !! Done !! Date Done&lt;br /&gt;
|-&lt;br /&gt;
|height=5|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Find optimal parameter setting of the Two-Tensor Tractography method ||align=&amp;quot;center&amp;quot; |  || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Extend Two-Tensor Tractography module by fiducial seeding ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | NA-MIC Project Week in Salt Lake City ([http://www.na-mic.org/Wiki/index.php/2009_Winter_Project_Week],[http://www.na-mic.org/Wiki/index.php/Two-tensor_tractography_in_Slicer_using_Python_and_Teem]) ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! January !!  | Week 2 || 05.01 - 11.01 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | IGT Project Week ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 50 || 08.12 - 14.12 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! December !!  | Week 49 || 01.12 - 07.12 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to compile teem with levmar (= Levenberg-Marquardt nonlinear least squares algorithm) ||align=&amp;quot;center&amp;quot; | x || Mon Dec, 1st&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 48 !! 24.11 - 30.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | document the results of the two-tensor tractography given a tensor volume ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to do mutli trace tractography given a DWI volume ||align=&amp;quot;center&amp;quot; | x || Mon Nov, 17th&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 47 !! 17.11 - 23.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Working on Python tractography module for multi fiber tracing given a tensor volume ||align=&amp;quot;center&amp;quot; | x || Mon Nov, 17th&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 46 !! 10.11 - 16.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Get vertex data out of the nvert nrrd filled by the tractography back to Slicer ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to pass image data from Python to Teem through nrrdWrap_nva function ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to generate a list of point locations that were used as tractography seedpoints in the VTK tractography ||align=&amp;quot;center&amp;quot; | x || Thu Nov, 13th&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Implement Python tractography module for single fiber tracing given a seeding starting point and a tensor volume ||align=&amp;quot;center&amp;quot; | x || Fri, Nov, 7th&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 45 || 03.11 - 09.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to get image data from numpy (= Python package) to Teem nrrd struct ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! November !!  | Week 44 || 27.10 - 02.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;20px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to get image data from numpy (= Python package) to Teem nrrd struct ||align=&amp;quot;center&amp;quot; | x ||&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !!  Week 43 || 20.10 - 26.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to access DWI volumes through Python ||align=&amp;quot;center&amp;quot; | x || Fri Oct, 17th&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Get Teem wrapped in Python ||align=&amp;quot;center&amp;quot; | x || Fri Oct, 19th&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 42 || 13.10 - 19.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Try to implement the seeding part of the (VTK) one-tensor tractography module in Python || align=&amp;quot;center&amp;quot; | x || Tue Oct, 14th&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 41 || 06.10 - 12.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
|height=10|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Try to implement the seeding part of the (VTK) one-tensor tractography module in Python || align=&amp;quot;center&amp;quot; | x || Tue Oct, 14th&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! October !!  Week 40 || 29.09 - 5.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;20px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; |Totally understand existing Python modules in Slicer || align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; |understand existing one-tensor streamline tractography in Slicer (VTK) || align=&amp;quot;center&amp;quot; | x || Tue Sep, 23rd &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Totally understand existing Python modules in Slicer ||align=&amp;quot;center&amp;quot; | x || Tue Sep, 23rd&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !!  Week 39 || 22.09 - 28.09 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; | Slicer &amp;amp; Python Tutorials || align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; | Enable Python in Slicer || align=&amp;quot;center&amp;quot; | x || Mon Sep, 22nd&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot; &lt;br /&gt;
! September !! Week 38 || 14.09 - 21.09 || ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Information==&lt;br /&gt;
* Diffusion Tensor Analysis in Slicer: http://www.na-mic.org/Wiki/images/0/04/Slicer3diffusionTutorial7.pdf&lt;br /&gt;
* Building a Slicer 3 Module GUI: http://www.slicer.org/pages/Building_a_Slicer_3_Module_GUI&lt;br /&gt;
&lt;br /&gt;
Python:&lt;br /&gt;
* SlicerWiki about Python: http://www.slicer.org/slicerWiki/index.php/Slicer3::Python&lt;br /&gt;
* Python example modules in Slicer: http://www.slicer.org/slicerWiki/index.php/Slicer3:Execution_Model_Documentation:Python&lt;/div&gt;</summary>
		<author><name>Mseeland</name></author>
		
	</entry>
	<entry>
		<id>https://www.na-mic.org/w/index.php?title=User:Mseeland&amp;diff=36448</id>
		<title>User:Mseeland</title>
		<link rel="alternate" type="text/html" href="https://www.na-mic.org/w/index.php?title=User:Mseeland&amp;diff=36448"/>
		<updated>2009-04-22T05:36:33Z</updated>

		<summary type="html">&lt;p&gt;Mseeland: /* Requirements for running the Two-Tensor Tractography method */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Wiki of Madeleine Seeland =&lt;br /&gt;
&lt;br /&gt;
== General Information ==&lt;br /&gt;
&lt;br /&gt;
===About myself===&lt;br /&gt;
I am a grad student of Management Information Systems at the University of Mannheim, Germany. I'm involved in the Diffusion Tensor Imaging (DTI) project in the Laboratory of Mathematics in Imaging. Currently I'm working on two-tensor tractograohy for Neurosurgery. I will document my research experience as a diploma thesis, which I need for completing my studies in Germany.&lt;br /&gt;
&lt;br /&gt;
===Contact information===&lt;br /&gt;
E-mail: mseeland (at sign) bwh.harvard.edu&lt;br /&gt;
&lt;br /&gt;
===Collaborators &amp;amp; Contacts===&lt;br /&gt;
* Supervisors: C-F Westin, Nobuhiko Hata&lt;br /&gt;
* Gordon  Kindlmann (Teem)&lt;br /&gt;
* Sharon Peled&lt;br /&gt;
* Alireza Radmanesh&lt;br /&gt;
* Isaiah Norton&lt;br /&gt;
* Regarding Python: Steve Pieper, Julien de Siebenthal, Sylvain Bouix, Demian Wassermann, Luca Antiga&lt;br /&gt;
&lt;br /&gt;
==Project: Two-Tensor Tractography integration into Slicer==&lt;br /&gt;
&lt;br /&gt;
===Project Description===&lt;br /&gt;
*  Integration of Two-Tensor Tractography into Slicer using Python and the novel Python wrapping for Teem&lt;br /&gt;
*  Use of existing tractography methods in Teem (http://teem.sourceforge.net/)&lt;br /&gt;
*  My part: Interface between Slicer-&amp;gt;Python-&amp;gt;Teem and Teem-&amp;gt;Python-&amp;gt;Slicer&lt;br /&gt;
** pass data from VTK through Python to Teem&lt;br /&gt;
** make use of Teem tractography function calls&lt;br /&gt;
** pass resulting fiber data from Teem to Python to VTK and display fiber tracts in Slicer&lt;br /&gt;
&lt;br /&gt;
===How to enable Python in Slicer 3.3===&lt;br /&gt;
*  The current version of Slicer, Slicer 3.2, does not support Python. In order to use Python you need to install Slicer 3.3.&lt;br /&gt;
&lt;br /&gt;
*  To build Slicer Version 3.3, just do the following two commands:&lt;br /&gt;
  svn co http://svn.slicer.org/Slicer3/trunk Slicer3&lt;br /&gt;
  ./Slicer3/Scripts/getbuildtest.tcl&lt;br /&gt;
&lt;br /&gt;
*  In Slicer 3.3, Python support is disabled by default. In order to enable Python, just follow the next steps:&lt;br /&gt;
&lt;br /&gt;
# Edit slicer_variables.tcl&lt;br /&gt;
## Change &amp;quot;set ::USE_PYTHON &amp;quot;off&amp;quot;&amp;quot; to &amp;quot;on&amp;quot;&lt;br /&gt;
# '''Optional:''' If you prefer to use your system Python installation, see here: [http://www.slicer.org/slicerWiki/index.php/Slicer3::Python] &lt;br /&gt;
# '''Optional:''' installing SciPy, see here: [http://www.slicer.org/slicerWiki/index.php/Slicer3::Python]. However, there are still problems adding scipy in Slicer, whcih are not fixed yet.&lt;br /&gt;
&lt;br /&gt;
*  Rebuild Slicer3 using &amp;quot;getbuildtest.tcl&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 ./Slicer3/Scripts/getbuildtest.tcl&lt;br /&gt;
&lt;br /&gt;
A new menu command '''Python Interpreter''' should appear on the Window menu in Slicer. This command should bring up the Python Console window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Requirements for Two-Tensor Tractography module===&lt;br /&gt;
====Teem Python wrapping====&lt;br /&gt;
&lt;br /&gt;
=====BACKGROUND=====&lt;br /&gt;
* Teem Python wrapping is needed to make use of existing Two-Tensor tractography functions in Teem in Python&lt;br /&gt;
* The Python wrappings are based on ctypes, as well as a ctypes code generator (called &amp;quot;ctypeslib&amp;quot;)&lt;br /&gt;
** http://python.net/crew/theller/ctypes&lt;br /&gt;
** http://starship.python.net/crew/theller/wiki/CodeGenerator&lt;br /&gt;
** http://starship.python.net/crew/theller/ctypes/old/codegen.html&lt;br /&gt;
* Ctypes is a standard part of python, by which C functions in a shared library can be called from Python&lt;br /&gt;
* The ctypes code generator converts declarations in C header files into executable Python code: enums, structs, unions, function declarations, com interfaces, and preprocessor definitions.&lt;br /&gt;
* Creating wrappers for C header file(s) is a two step process. &lt;br /&gt;
** First, the ``h2xml.py`` script runs GCC-XML_ over the include file(s), creating a XML file containing declarations and definitions.  &lt;br /&gt;
** Second, the ``xml2py.py`` script parses the XML files and creates Python code containing all or a subset of these definitions.&lt;br /&gt;
* Python code is generated for C enums, structure, unions, typedefs and function declarations.&lt;br /&gt;
&lt;br /&gt;
=====REQUIREMENTS=====&lt;br /&gt;
* Ctypeslib: ctypeslib is an extension package for ctypes. It contains a ctypes code generator.&lt;br /&gt;
* GCC-XML (from http://www.gccxml.org/) is required to parse C header files into an XML description.&lt;br /&gt;
&lt;br /&gt;
=====GETTING THE SOFTWARE=====&lt;br /&gt;
* Python 2.6 can be got here (anything after 2.5 should work): http://www.python.org/download/&lt;br /&gt;
* Get gccxml (I used version 0.9.0), which can be got by CVS as described here: http://www.gccxml.org/HTML/Download.html&lt;br /&gt;
** follow the installation as described here: http://www.gccxml.org/HTML/Install.html&lt;br /&gt;
* use a version of ctypeslib which work with the version of gccxml: &lt;br /&gt;
  http://svn.python.org/projects/ctypes/branches/ctypeslib-gccxml-0.9&lt;br /&gt;
* But this requires some patches to work; the content of the &amp;quot;fixes.patch&amp;quot; file can be found here: [[http://wiki.na-mic.org/Wiki/images/3/3b/Fixes.patch.txt]]:&lt;br /&gt;
   svn co http://svn.python.org/projects/ctypes/branches/ctypeslib-gccxml-0.9&lt;br /&gt;
   cd ctypeslib-gccxml-0.9&lt;br /&gt;
   patch -p0 &amp;lt; ../fixes.patch&lt;br /&gt;
   cd ..&lt;br /&gt;
* ctypeslib is written in python =&amp;gt; there's nothing new to compile at this point&lt;br /&gt;
&lt;br /&gt;
=====CREATING PYTHON/TEEM=====&lt;br /&gt;
* First get Teem (starting from whatever directory should contain the &amp;quot;teem&amp;quot; source dir):&lt;br /&gt;
  svn co https://teem.svn.sourceforge.net/svnroot/teem/teem/trunk teem&lt;br /&gt;
and compile it as a shared library.  Directions for doing this with cmake are here:&lt;br /&gt;
  http://teem.sourceforge.net/build.html&lt;br /&gt;
* create the wrappings in a new directory (e.g. &amp;quot;teem-wrap&amp;quot;), where the XML and Python output will be&lt;br /&gt;
* Set the environment variables that identify where Teem and ctypeslib are:&lt;br /&gt;
** TEEM is where Teem's &amp;quot;make install&amp;quot; put subdirectories &amp;quot;bin&amp;quot;, &amp;quot;lib&amp;quot;, and &amp;quot;include&amp;quot; (e.g. ~/teem-build)&lt;br /&gt;
** CTYPES is the full path of ctypeslib-gccxml-0.9&lt;br /&gt;
* First create (in, for example, &amp;quot;teem-wrap&amp;quot;) a meta-header for all the Teem header files (in tcsh):&lt;br /&gt;
   mkdir teemincl&lt;br /&gt;
   cp -r ${TEEM}/include/teem teemincl&lt;br /&gt;
   cd teemincl&lt;br /&gt;
   ls -1 teem/*.h | awk '{print &amp;quot;#include &amp;lt;&amp;quot;$1&amp;quot;&amp;gt;&amp;quot;}' &amp;gt; all.h&lt;br /&gt;
   cd ..&lt;br /&gt;
* Then create teem.xml:&lt;br /&gt;
   setenv PYTHONPATH $CTYPES&lt;br /&gt;
   python $CTYPES/scripts/h2xml.py `pwd`/teemincl/all.h -I teemincl -o teem.xml &lt;br /&gt;
* Then create teem.py (use DYLD_LIBRARY_PATH in a mac):&lt;br /&gt;
   setenv LD_LIBRARY_PATH ${TEEM}/lib&lt;br /&gt;
   python $CTYPES/scripts/xml2py.py teem.xml -llibteem.so -o teem.py \&lt;br /&gt;
        -r &amp;quot;(air|hest|biff|nrrd|ell|unrrdu|moss|gage|bane|limn|seek|hoover|echo|ten|dye|mite).*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
====LEVMAR====&lt;br /&gt;
&lt;br /&gt;
* The 2-tensor tractography depends on Levenberg-Marquardt nonlinear optimization of Sharon Peled's constrained two-tensor model. I used the following implementation for it: http://www.ics.forth.gr/~lourakis/levmar/&lt;br /&gt;
* This code is enabled by compiling Teem with TEEM_LEVMAR defined. The include paths and library link paths need also be defined for everything to work.&lt;br /&gt;
* There are problems compiling LEVMAR with cmake. I found no way to create a build of levmar that allows Teem to say in Teem's CMakeLists.txt simply: FIND_PACKAGE(LEVMAR)). Therefore I compiled levmar myself and then changed Teem's CMake stuff so that the user sets the Teem_LEVMAR_LIB and Teem_LEVMAR_IPATH variables directly (so that the user does by hand what's normally done by &amp;quot;FIND_PACKAGE(LEVMAR)&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
====Python processing package====&lt;br /&gt;
&lt;br /&gt;
* This package needs to be downloaded here:&lt;br /&gt;
http://pypi.python.org/pypi/processing&lt;br /&gt;
&lt;br /&gt;
==Status/Progress==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=0&lt;br /&gt;
|- bgcolor=&amp;quot;#abcdef&amp;quot;&lt;br /&gt;
! Month !! Week #  !! Start Date - End Date !! Done !! Date Done&lt;br /&gt;
|-&lt;br /&gt;
|height=5|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Find optimal parameter setting of the Two-Tensor Tractography method ||align=&amp;quot;center&amp;quot; |  || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Extend Two-Tensor Tractography module by fiducial seeding ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | NA-MIC Project Week in Salt Lake City ([http://www.na-mic.org/Wiki/index.php/2009_Winter_Project_Week],[http://www.na-mic.org/Wiki/index.php/Two-tensor_tractography_in_Slicer_using_Python_and_Teem]) ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! January !!  | Week 2 || 05.01 - 11.01 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | IGT Project Week ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 50 || 08.12 - 14.12 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! December !!  | Week 49 || 01.12 - 07.12 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to compile teem with levmar (= Levenberg-Marquardt nonlinear least squares algorithm) ||align=&amp;quot;center&amp;quot; | x || Mon Dec, 1st&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 48 !! 24.11 - 30.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | document the results of the two-tensor tractography given a tensor volume ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to do mutli trace tractography given a DWI volume ||align=&amp;quot;center&amp;quot; | x || Mon Nov, 17th&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 47 !! 17.11 - 23.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Working on Python tractography module for multi fiber tracing given a tensor volume ||align=&amp;quot;center&amp;quot; | x || Mon Nov, 17th&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 46 !! 10.11 - 16.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Get vertex data out of the nvert nrrd filled by the tractography back to Slicer ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to pass image data from Python to Teem through nrrdWrap_nva function ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to generate a list of point locations that were used as tractography seedpoints in the VTK tractography ||align=&amp;quot;center&amp;quot; | x || Thu Nov, 13th&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Implement Python tractography module for single fiber tracing given a seeding starting point and a tensor volume ||align=&amp;quot;center&amp;quot; | x || Fri, Nov, 7th&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 45 || 03.11 - 09.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to get image data from numpy (= Python package) to Teem nrrd struct ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! November !!  | Week 44 || 27.10 - 02.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;20px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to get image data from numpy (= Python package) to Teem nrrd struct ||align=&amp;quot;center&amp;quot; | x ||&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !!  Week 43 || 20.10 - 26.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to access DWI volumes through Python ||align=&amp;quot;center&amp;quot; | x || Fri Oct, 17th&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Get Teem wrapped in Python ||align=&amp;quot;center&amp;quot; | x || Fri Oct, 19th&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 42 || 13.10 - 19.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Try to implement the seeding part of the (VTK) one-tensor tractography module in Python || align=&amp;quot;center&amp;quot; | x || Tue Oct, 14th&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 41 || 06.10 - 12.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
|height=10|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Try to implement the seeding part of the (VTK) one-tensor tractography module in Python || align=&amp;quot;center&amp;quot; | x || Tue Oct, 14th&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! October !!  Week 40 || 29.09 - 5.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;20px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; |Totally understand existing Python modules in Slicer || align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; |understand existing one-tensor streamline tractography in Slicer (VTK) || align=&amp;quot;center&amp;quot; | x || Tue Sep, 23rd &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Totally understand existing Python modules in Slicer ||align=&amp;quot;center&amp;quot; | x || Tue Sep, 23rd&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !!  Week 39 || 22.09 - 28.09 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; | Slicer &amp;amp; Python Tutorials || align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; | Enable Python in Slicer || align=&amp;quot;center&amp;quot; | x || Mon Sep, 22nd&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot; &lt;br /&gt;
! September !! Week 38 || 14.09 - 21.09 || ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Information==&lt;br /&gt;
* Diffusion Tensor Analysis in Slicer: http://www.na-mic.org/Wiki/images/0/04/Slicer3diffusionTutorial7.pdf&lt;br /&gt;
* Building a Slicer 3 Module GUI: http://www.slicer.org/pages/Building_a_Slicer_3_Module_GUI&lt;br /&gt;
&lt;br /&gt;
Python:&lt;br /&gt;
* SlicerWiki about Python: http://www.slicer.org/slicerWiki/index.php/Slicer3::Python&lt;br /&gt;
* Python example modules in Slicer: http://www.slicer.org/slicerWiki/index.php/Slicer3:Execution_Model_Documentation:Python&lt;/div&gt;</summary>
		<author><name>Mseeland</name></author>
		
	</entry>
	<entry>
		<id>https://www.na-mic.org/w/index.php?title=User:Mseeland&amp;diff=36447</id>
		<title>User:Mseeland</title>
		<link rel="alternate" type="text/html" href="https://www.na-mic.org/w/index.php?title=User:Mseeland&amp;diff=36447"/>
		<updated>2009-04-22T05:36:04Z</updated>

		<summary type="html">&lt;p&gt;Mseeland: /* Requirements for running the Two-Tensor Tractography method */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Wiki of Madeleine Seeland =&lt;br /&gt;
&lt;br /&gt;
== General Information ==&lt;br /&gt;
&lt;br /&gt;
===About myself===&lt;br /&gt;
I am a grad student of Management Information Systems at the University of Mannheim, Germany. I'm involved in the Diffusion Tensor Imaging (DTI) project in the Laboratory of Mathematics in Imaging. Currently I'm working on two-tensor tractograohy for Neurosurgery. I will document my research experience as a diploma thesis, which I need for completing my studies in Germany.&lt;br /&gt;
&lt;br /&gt;
===Contact information===&lt;br /&gt;
E-mail: mseeland (at sign) bwh.harvard.edu&lt;br /&gt;
&lt;br /&gt;
===Collaborators &amp;amp; Contacts===&lt;br /&gt;
* Supervisors: C-F Westin, Nobuhiko Hata&lt;br /&gt;
* Gordon  Kindlmann (Teem)&lt;br /&gt;
* Sharon Peled&lt;br /&gt;
* Alireza Radmanesh&lt;br /&gt;
* Isaiah Norton&lt;br /&gt;
* Regarding Python: Steve Pieper, Julien de Siebenthal, Sylvain Bouix, Demian Wassermann, Luca Antiga&lt;br /&gt;
&lt;br /&gt;
==Project: Two-Tensor Tractography integration into Slicer==&lt;br /&gt;
&lt;br /&gt;
===Project Description===&lt;br /&gt;
*  Integration of Two-Tensor Tractography into Slicer using Python and the novel Python wrapping for Teem&lt;br /&gt;
*  Use of existing tractography methods in Teem (http://teem.sourceforge.net/)&lt;br /&gt;
*  My part: Interface between Slicer-&amp;gt;Python-&amp;gt;Teem and Teem-&amp;gt;Python-&amp;gt;Slicer&lt;br /&gt;
** pass data from VTK through Python to Teem&lt;br /&gt;
** make use of Teem tractography function calls&lt;br /&gt;
** pass resulting fiber data from Teem to Python to VTK and display fiber tracts in Slicer&lt;br /&gt;
&lt;br /&gt;
===How to enable Python in Slicer 3.3===&lt;br /&gt;
*  The current version of Slicer, Slicer 3.2, does not support Python. In order to use Python you need to install Slicer 3.3.&lt;br /&gt;
&lt;br /&gt;
*  To build Slicer Version 3.3, just do the following two commands:&lt;br /&gt;
  svn co http://svn.slicer.org/Slicer3/trunk Slicer3&lt;br /&gt;
  ./Slicer3/Scripts/getbuildtest.tcl&lt;br /&gt;
&lt;br /&gt;
*  In Slicer 3.3, Python support is disabled by default. In order to enable Python, just follow the next steps:&lt;br /&gt;
&lt;br /&gt;
# Edit slicer_variables.tcl&lt;br /&gt;
## Change &amp;quot;set ::USE_PYTHON &amp;quot;off&amp;quot;&amp;quot; to &amp;quot;on&amp;quot;&lt;br /&gt;
# '''Optional:''' If you prefer to use your system Python installation, see here: [http://www.slicer.org/slicerWiki/index.php/Slicer3::Python] &lt;br /&gt;
# '''Optional:''' installing SciPy, see here: [http://www.slicer.org/slicerWiki/index.php/Slicer3::Python]. However, there are still problems adding scipy in Slicer, whcih are not fixed yet.&lt;br /&gt;
&lt;br /&gt;
*  Rebuild Slicer3 using &amp;quot;getbuildtest.tcl&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 ./Slicer3/Scripts/getbuildtest.tcl&lt;br /&gt;
&lt;br /&gt;
A new menu command '''Python Interpreter''' should appear on the Window menu in Slicer. This command should bring up the Python Console window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Requirements for running the Two-Tensor Tractography method===&lt;br /&gt;
====Teem Python wrapping====&lt;br /&gt;
&lt;br /&gt;
=====BACKGROUND=====&lt;br /&gt;
* Teem Python wrapping is needed to make use of existing Two-Tensor tractography functions in Teem in Python&lt;br /&gt;
* The Python wrappings are based on ctypes, as well as a ctypes code generator (called &amp;quot;ctypeslib&amp;quot;)&lt;br /&gt;
** http://python.net/crew/theller/ctypes&lt;br /&gt;
** http://starship.python.net/crew/theller/wiki/CodeGenerator&lt;br /&gt;
** http://starship.python.net/crew/theller/ctypes/old/codegen.html&lt;br /&gt;
* Ctypes is a standard part of python, by which C functions in a shared library can be called from Python&lt;br /&gt;
* The ctypes code generator converts declarations in C header files into executable Python code: enums, structs, unions, function declarations, com interfaces, and preprocessor definitions.&lt;br /&gt;
* Creating wrappers for C header file(s) is a two step process. &lt;br /&gt;
** First, the ``h2xml.py`` script runs GCC-XML_ over the include file(s), creating a XML file containing declarations and definitions.  &lt;br /&gt;
** Second, the ``xml2py.py`` script parses the XML files and creates Python code containing all or a subset of these definitions.&lt;br /&gt;
* Python code is generated for C enums, structure, unions, typedefs and function declarations.&lt;br /&gt;
&lt;br /&gt;
=====REQUIREMENTS=====&lt;br /&gt;
* Ctypeslib: ctypeslib is an extension package for ctypes. It contains a ctypes code generator.&lt;br /&gt;
* GCC-XML (from http://www.gccxml.org/) is required to parse C header files into an XML description.&lt;br /&gt;
&lt;br /&gt;
=====GETTING THE SOFTWARE=====&lt;br /&gt;
* Python 2.6 can be got here (anything after 2.5 should work): http://www.python.org/download/&lt;br /&gt;
* Get gccxml (I used version 0.9.0), which can be got by CVS as described here: http://www.gccxml.org/HTML/Download.html&lt;br /&gt;
** follow the installation as described here: http://www.gccxml.org/HTML/Install.html&lt;br /&gt;
* use a version of ctypeslib which work with the version of gccxml: &lt;br /&gt;
  http://svn.python.org/projects/ctypes/branches/ctypeslib-gccxml-0.9&lt;br /&gt;
* But this requires some patches to work; the content of the &amp;quot;fixes.patch&amp;quot; file can be found here: [[http://wiki.na-mic.org/Wiki/images/3/3b/Fixes.patch.txt]]:&lt;br /&gt;
   svn co http://svn.python.org/projects/ctypes/branches/ctypeslib-gccxml-0.9&lt;br /&gt;
   cd ctypeslib-gccxml-0.9&lt;br /&gt;
   patch -p0 &amp;lt; ../fixes.patch&lt;br /&gt;
   cd ..&lt;br /&gt;
* ctypeslib is written in python =&amp;gt; there's nothing new to compile at this point&lt;br /&gt;
&lt;br /&gt;
=====CREATING PYTHON/TEEM=====&lt;br /&gt;
* First get Teem (starting from whatever directory should contain the &amp;quot;teem&amp;quot; source dir):&lt;br /&gt;
  svn co https://teem.svn.sourceforge.net/svnroot/teem/teem/trunk teem&lt;br /&gt;
and compile it as a shared library.  Directions for doing this with cmake are here:&lt;br /&gt;
  http://teem.sourceforge.net/build.html&lt;br /&gt;
* create the wrappings in a new directory (e.g. &amp;quot;teem-wrap&amp;quot;), where the XML and Python output will be&lt;br /&gt;
* Set the environment variables that identify where Teem and ctypeslib are:&lt;br /&gt;
** TEEM is where Teem's &amp;quot;make install&amp;quot; put subdirectories &amp;quot;bin&amp;quot;, &amp;quot;lib&amp;quot;, and &amp;quot;include&amp;quot; (e.g. ~/teem-build)&lt;br /&gt;
** CTYPES is the full path of ctypeslib-gccxml-0.9&lt;br /&gt;
* First create (in, for example, &amp;quot;teem-wrap&amp;quot;) a meta-header for all the Teem header files (in tcsh):&lt;br /&gt;
   mkdir teemincl&lt;br /&gt;
   cp -r ${TEEM}/include/teem teemincl&lt;br /&gt;
   cd teemincl&lt;br /&gt;
   ls -1 teem/*.h | awk '{print &amp;quot;#include &amp;lt;&amp;quot;$1&amp;quot;&amp;gt;&amp;quot;}' &amp;gt; all.h&lt;br /&gt;
   cd ..&lt;br /&gt;
* Then create teem.xml:&lt;br /&gt;
   setenv PYTHONPATH $CTYPES&lt;br /&gt;
   python $CTYPES/scripts/h2xml.py `pwd`/teemincl/all.h -I teemincl -o teem.xml &lt;br /&gt;
* Then create teem.py (use DYLD_LIBRARY_PATH in a mac):&lt;br /&gt;
   setenv LD_LIBRARY_PATH ${TEEM}/lib&lt;br /&gt;
   python $CTYPES/scripts/xml2py.py teem.xml -llibteem.so -o teem.py \&lt;br /&gt;
        -r &amp;quot;(air|hest|biff|nrrd|ell|unrrdu|moss|gage|bane|limn|seek|hoover|echo|ten|dye|mite).*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
====LEVMAR====&lt;br /&gt;
&lt;br /&gt;
* The 2-tensor tractography depends on Levenberg-Marquardt nonlinear optimization of Sharon Peled's constrained two-tensor model. I used the following implementation for it: http://www.ics.forth.gr/~lourakis/levmar/&lt;br /&gt;
* This code is enabled by compiling Teem with TEEM_LEVMAR defined. The include paths and library link paths need also be defined for everything to work.&lt;br /&gt;
* There are problems compiling LEVMAR with cmake. I found no way to create a build of levmar that allows Teem to say in Teem's CMakeLists.txt simply: FIND_PACKAGE(LEVMAR)). Therefore I compiled levmar myself and then changed Teem's CMake stuff so that the user sets the Teem_LEVMAR_LIB and Teem_LEVMAR_IPATH variables directly (so that the user does by hand what's normally done by &amp;quot;FIND_PACKAGE(LEVMAR)&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
====Python processing package====&lt;br /&gt;
&lt;br /&gt;
* This package needs to be downloaded here:&lt;br /&gt;
http://pypi.python.org/pypi/processing&lt;br /&gt;
&lt;br /&gt;
==Status/Progress==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=0&lt;br /&gt;
|- bgcolor=&amp;quot;#abcdef&amp;quot;&lt;br /&gt;
! Month !! Week #  !! Start Date - End Date !! Done !! Date Done&lt;br /&gt;
|-&lt;br /&gt;
|height=5|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Find optimal parameter setting of the Two-Tensor Tractography method ||align=&amp;quot;center&amp;quot; |  || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Extend Two-Tensor Tractography module by fiducial seeding ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | NA-MIC Project Week in Salt Lake City ([http://www.na-mic.org/Wiki/index.php/2009_Winter_Project_Week],[http://www.na-mic.org/Wiki/index.php/Two-tensor_tractography_in_Slicer_using_Python_and_Teem]) ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! January !!  | Week 2 || 05.01 - 11.01 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | IGT Project Week ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 50 || 08.12 - 14.12 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! December !!  | Week 49 || 01.12 - 07.12 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to compile teem with levmar (= Levenberg-Marquardt nonlinear least squares algorithm) ||align=&amp;quot;center&amp;quot; | x || Mon Dec, 1st&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 48 !! 24.11 - 30.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | document the results of the two-tensor tractography given a tensor volume ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to do mutli trace tractography given a DWI volume ||align=&amp;quot;center&amp;quot; | x || Mon Nov, 17th&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 47 !! 17.11 - 23.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Working on Python tractography module for multi fiber tracing given a tensor volume ||align=&amp;quot;center&amp;quot; | x || Mon Nov, 17th&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 46 !! 10.11 - 16.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Get vertex data out of the nvert nrrd filled by the tractography back to Slicer ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to pass image data from Python to Teem through nrrdWrap_nva function ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to generate a list of point locations that were used as tractography seedpoints in the VTK tractography ||align=&amp;quot;center&amp;quot; | x || Thu Nov, 13th&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Implement Python tractography module for single fiber tracing given a seeding starting point and a tensor volume ||align=&amp;quot;center&amp;quot; | x || Fri, Nov, 7th&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 45 || 03.11 - 09.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to get image data from numpy (= Python package) to Teem nrrd struct ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! November !!  | Week 44 || 27.10 - 02.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;20px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to get image data from numpy (= Python package) to Teem nrrd struct ||align=&amp;quot;center&amp;quot; | x ||&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !!  Week 43 || 20.10 - 26.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to access DWI volumes through Python ||align=&amp;quot;center&amp;quot; | x || Fri Oct, 17th&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Get Teem wrapped in Python ||align=&amp;quot;center&amp;quot; | x || Fri Oct, 19th&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 42 || 13.10 - 19.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Try to implement the seeding part of the (VTK) one-tensor tractography module in Python || align=&amp;quot;center&amp;quot; | x || Tue Oct, 14th&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 41 || 06.10 - 12.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
|height=10|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Try to implement the seeding part of the (VTK) one-tensor tractography module in Python || align=&amp;quot;center&amp;quot; | x || Tue Oct, 14th&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! October !!  Week 40 || 29.09 - 5.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;20px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; |Totally understand existing Python modules in Slicer || align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; |understand existing one-tensor streamline tractography in Slicer (VTK) || align=&amp;quot;center&amp;quot; | x || Tue Sep, 23rd &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Totally understand existing Python modules in Slicer ||align=&amp;quot;center&amp;quot; | x || Tue Sep, 23rd&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !!  Week 39 || 22.09 - 28.09 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; | Slicer &amp;amp; Python Tutorials || align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; | Enable Python in Slicer || align=&amp;quot;center&amp;quot; | x || Mon Sep, 22nd&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot; &lt;br /&gt;
! September !! Week 38 || 14.09 - 21.09 || ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Information==&lt;br /&gt;
* Diffusion Tensor Analysis in Slicer: http://www.na-mic.org/Wiki/images/0/04/Slicer3diffusionTutorial7.pdf&lt;br /&gt;
* Building a Slicer 3 Module GUI: http://www.slicer.org/pages/Building_a_Slicer_3_Module_GUI&lt;br /&gt;
&lt;br /&gt;
Python:&lt;br /&gt;
* SlicerWiki about Python: http://www.slicer.org/slicerWiki/index.php/Slicer3::Python&lt;br /&gt;
* Python example modules in Slicer: http://www.slicer.org/slicerWiki/index.php/Slicer3:Execution_Model_Documentation:Python&lt;/div&gt;</summary>
		<author><name>Mseeland</name></author>
		
	</entry>
	<entry>
		<id>https://www.na-mic.org/w/index.php?title=User:Mseeland&amp;diff=36446</id>
		<title>User:Mseeland</title>
		<link rel="alternate" type="text/html" href="https://www.na-mic.org/w/index.php?title=User:Mseeland&amp;diff=36446"/>
		<updated>2009-04-22T05:31:59Z</updated>

		<summary type="html">&lt;p&gt;Mseeland: /* Project Description */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Wiki of Madeleine Seeland =&lt;br /&gt;
&lt;br /&gt;
== General Information ==&lt;br /&gt;
&lt;br /&gt;
===About myself===&lt;br /&gt;
I am a grad student of Management Information Systems at the University of Mannheim, Germany. I'm involved in the Diffusion Tensor Imaging (DTI) project in the Laboratory of Mathematics in Imaging. Currently I'm working on two-tensor tractograohy for Neurosurgery. I will document my research experience as a diploma thesis, which I need for completing my studies in Germany.&lt;br /&gt;
&lt;br /&gt;
===Contact information===&lt;br /&gt;
E-mail: mseeland (at sign) bwh.harvard.edu&lt;br /&gt;
&lt;br /&gt;
===Collaborators &amp;amp; Contacts===&lt;br /&gt;
* Supervisors: C-F Westin, Nobuhiko Hata&lt;br /&gt;
* Gordon  Kindlmann (Teem)&lt;br /&gt;
* Sharon Peled&lt;br /&gt;
* Alireza Radmanesh&lt;br /&gt;
* Isaiah Norton&lt;br /&gt;
* Regarding Python: Steve Pieper, Julien de Siebenthal, Sylvain Bouix, Demian Wassermann, Luca Antiga&lt;br /&gt;
&lt;br /&gt;
==Project: Two-Tensor Tractography integration into Slicer==&lt;br /&gt;
&lt;br /&gt;
===Project Description===&lt;br /&gt;
*  Integration of Two-Tensor Tractography into Slicer using Python and the novel Python wrapping for Teem&lt;br /&gt;
*  Use of existing tractography methods in Teem (http://teem.sourceforge.net/)&lt;br /&gt;
*  My part: Interface between Slicer-&amp;gt;Python-&amp;gt;Teem and Teem-&amp;gt;Python-&amp;gt;Slicer&lt;br /&gt;
** pass data from VTK through Python to Teem&lt;br /&gt;
** make use of Teem tractography function calls&lt;br /&gt;
** pass resulting fiber data from Teem to Python to VTK and display fiber tracts in Slicer&lt;br /&gt;
&lt;br /&gt;
===How to enable Python in Slicer 3.3===&lt;br /&gt;
*  The current version of Slicer, Slicer 3.2, does not support Python. In order to use Python you need to install Slicer 3.3.&lt;br /&gt;
&lt;br /&gt;
*  To build Slicer Version 3.3, just do the following two commands:&lt;br /&gt;
  svn co http://svn.slicer.org/Slicer3/trunk Slicer3&lt;br /&gt;
  ./Slicer3/Scripts/getbuildtest.tcl&lt;br /&gt;
&lt;br /&gt;
*  In Slicer 3.3, Python support is disabled by default. In order to enable Python, just follow the next steps:&lt;br /&gt;
&lt;br /&gt;
# Edit slicer_variables.tcl&lt;br /&gt;
## Change &amp;quot;set ::USE_PYTHON &amp;quot;off&amp;quot;&amp;quot; to &amp;quot;on&amp;quot;&lt;br /&gt;
# '''Optional:''' If you prefer to use your system Python installation, see here: [http://www.slicer.org/slicerWiki/index.php/Slicer3::Python] &lt;br /&gt;
# '''Optional:''' installing SciPy, see here: [http://www.slicer.org/slicerWiki/index.php/Slicer3::Python]. However, there are still problems adding scipy in Slicer, whcih are not fixed yet.&lt;br /&gt;
&lt;br /&gt;
*  Rebuild Slicer3 using &amp;quot;getbuildtest.tcl&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 ./Slicer3/Scripts/getbuildtest.tcl&lt;br /&gt;
&lt;br /&gt;
A new menu command '''Python Interpreter''' should appear on the Window menu in Slicer. This command should bring up the Python Console window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Requirements for running the Two-Tensor Tractography method===&lt;br /&gt;
====Teem Python wrapping====&lt;br /&gt;
&lt;br /&gt;
=====BACKGROUND=====&lt;br /&gt;
* Teem Python wrapping is needed to make use of existing Two-Tensor tractography functions in Teem in Python&lt;br /&gt;
* The Python wrappings are based on ctypes, as well as a ctypes code generator (called &amp;quot;ctypeslib&amp;quot;)&lt;br /&gt;
** http://python.net/crew/theller/ctypes&lt;br /&gt;
** http://starship.python.net/crew/theller/wiki/CodeGenerator&lt;br /&gt;
** http://starship.python.net/crew/theller/ctypes/old/codegen.html&lt;br /&gt;
* Ctypes is a standard part of python, by which C functions in a shared library can be called from Python&lt;br /&gt;
* The ctypes code generator converts declarations in C header files into executable Python code: enums, structs, unions, function declarations, com interfaces, and preprocessor definitions.&lt;br /&gt;
* Creating wrappers for C header file(s) is a two step process. &lt;br /&gt;
** First, the ``h2xml.py`` script runs GCC-XML_ over the include file(s), creating a XML file containing declarations and definitions.  &lt;br /&gt;
** Second, the ``xml2py.py`` script parses the XML files and creates Python code containing all or a subset of these definitions.&lt;br /&gt;
* Python code is generated for C enums, structure, unions, typedefs and function declarations.&lt;br /&gt;
&lt;br /&gt;
=====REQUIREMENTS=====&lt;br /&gt;
* Ctypeslib: ctypeslib is an extension package for ctypes. It contains a ctypes code generator.&lt;br /&gt;
* GCC-XML (from http://www.gccxml.org/) is required to parse C header files into an XML description.&lt;br /&gt;
&lt;br /&gt;
=====GETTING THE SOFTWARE=====&lt;br /&gt;
* Python 2.6 can be got here (anything after 2.5 should work): http://www.python.org/download/&lt;br /&gt;
* Get gccxml (I used version 0.9.0), which can be got by CVS as described here: http://www.gccxml.org/HTML/Download.html&lt;br /&gt;
** follow the installation as described here: http://www.gccxml.org/HTML/Install.html&lt;br /&gt;
* use a version of ctypeslib which work with the version of gccxml: &lt;br /&gt;
  http://svn.python.org/projects/ctypes/branches/ctypeslib-gccxml-0.9&lt;br /&gt;
* But this requires some patches to work; the content of the &amp;quot;fixes.patch&amp;quot; file can be found here: [[http://wiki.na-mic.org/Wiki/images/3/3b/Fixes.patch.txt]]:&lt;br /&gt;
   svn co http://svn.python.org/projects/ctypes/branches/ctypeslib-gccxml-0.9&lt;br /&gt;
   cd ctypeslib-gccxml-0.9&lt;br /&gt;
   patch -p0 &amp;lt; ../fixes.patch&lt;br /&gt;
   cd ..&lt;br /&gt;
* ctypeslib is written in python =&amp;gt; there's nothing new to compile at this point&lt;br /&gt;
&lt;br /&gt;
=====CREATING PYTHON/TEEM=====&lt;br /&gt;
* First get Teem (starting from whatever directory should contain the &amp;quot;teem&amp;quot; source dir):&lt;br /&gt;
  svn co https://teem.svn.sourceforge.net/svnroot/teem/teem/trunk teem&lt;br /&gt;
and compile it as a shared library.  Directions for doing this with cmake are here:&lt;br /&gt;
  http://teem.sourceforge.net/build.html&lt;br /&gt;
* create the wrappings in a new directory (e.g. &amp;quot;teem-wrap&amp;quot;), where the XML and Python output will be&lt;br /&gt;
* Set the environment variables that identify where Teem and ctypeslib are:&lt;br /&gt;
** TEEM is where Teem's &amp;quot;make install&amp;quot; put subdirectories &amp;quot;bin&amp;quot;, &amp;quot;lib&amp;quot;, and &amp;quot;include&amp;quot; (e.g. ~/teem-build)&lt;br /&gt;
** CTYPES is the full path of ctypeslib-gccxml-0.9&lt;br /&gt;
* First create (in, for example, &amp;quot;teem-wrap&amp;quot;) a meta-header for all the Teem header files (in tcsh):&lt;br /&gt;
   mkdir teemincl&lt;br /&gt;
   cp -r ${TEEM}/include/teem teemincl&lt;br /&gt;
   cd teemincl&lt;br /&gt;
   ls -1 teem/*.h | awk '{print &amp;quot;#include &amp;lt;&amp;quot;$1&amp;quot;&amp;gt;&amp;quot;}' &amp;gt; all.h&lt;br /&gt;
   cd ..&lt;br /&gt;
* Then create teem.xml:&lt;br /&gt;
   setenv PYTHONPATH $CTYPES&lt;br /&gt;
   python $CTYPES/scripts/h2xml.py `pwd`/teemincl/all.h -I teemincl -o teem.xml &lt;br /&gt;
* Then create teem.py (use DYLD_LIBRARY_PATH in a mac):&lt;br /&gt;
   setenv LD_LIBRARY_PATH ${TEEM}/lib&lt;br /&gt;
   python $CTYPES/scripts/xml2py.py teem.xml -llibteem.so -o teem.py \&lt;br /&gt;
        -r &amp;quot;(air|hest|biff|nrrd|ell|unrrdu|moss|gage|bane|limn|seek|hoover|echo|ten|dye|mite).*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
====LEVMAR====&lt;br /&gt;
&lt;br /&gt;
* The 2-tensor tractography depends on Levenberg-Marquardt nonlinear optimization of Sharon Peled's constrained two-tensor model. I used the following implementation for it: http://www.ics.forth.gr/~lourakis/levmar/&lt;br /&gt;
* This code is enabled by compiling Teem with TEEM_LEVMAR defined. The include paths and library link paths need also be defined for everything to work.&lt;br /&gt;
* There are problems compiling LEVMAR with cmake. I found no way to create a build of levmar that allows Teem to say in Teem's CMakeLists.txt simply: FIND_PACKAGE(LEVMAR)). Therefore I compiled levmar myself and then changed Teem's CMake stuff so that the user sets the Teem_LEVMAR_LIB and Teem_LEVMAR_IPATH variables directly (so that the user does by hand what's normally done by &amp;quot;FIND_PACKAGE(LEVMAR)&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
==Status/Progress==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=0&lt;br /&gt;
|- bgcolor=&amp;quot;#abcdef&amp;quot;&lt;br /&gt;
! Month !! Week #  !! Start Date - End Date !! Done !! Date Done&lt;br /&gt;
|-&lt;br /&gt;
|height=5|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Find optimal parameter setting of the Two-Tensor Tractography method ||align=&amp;quot;center&amp;quot; |  || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Extend Two-Tensor Tractography module by fiducial seeding ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | NA-MIC Project Week in Salt Lake City ([http://www.na-mic.org/Wiki/index.php/2009_Winter_Project_Week],[http://www.na-mic.org/Wiki/index.php/Two-tensor_tractography_in_Slicer_using_Python_and_Teem]) ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! January !!  | Week 2 || 05.01 - 11.01 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | IGT Project Week ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 50 || 08.12 - 14.12 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! December !!  | Week 49 || 01.12 - 07.12 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to compile teem with levmar (= Levenberg-Marquardt nonlinear least squares algorithm) ||align=&amp;quot;center&amp;quot; | x || Mon Dec, 1st&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 48 !! 24.11 - 30.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | document the results of the two-tensor tractography given a tensor volume ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to do mutli trace tractography given a DWI volume ||align=&amp;quot;center&amp;quot; | x || Mon Nov, 17th&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 47 !! 17.11 - 23.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Working on Python tractography module for multi fiber tracing given a tensor volume ||align=&amp;quot;center&amp;quot; | x || Mon Nov, 17th&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 46 !! 10.11 - 16.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Get vertex data out of the nvert nrrd filled by the tractography back to Slicer ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to pass image data from Python to Teem through nrrdWrap_nva function ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to generate a list of point locations that were used as tractography seedpoints in the VTK tractography ||align=&amp;quot;center&amp;quot; | x || Thu Nov, 13th&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Implement Python tractography module for single fiber tracing given a seeding starting point and a tensor volume ||align=&amp;quot;center&amp;quot; | x || Fri, Nov, 7th&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 45 || 03.11 - 09.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to get image data from numpy (= Python package) to Teem nrrd struct ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! November !!  | Week 44 || 27.10 - 02.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;20px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to get image data from numpy (= Python package) to Teem nrrd struct ||align=&amp;quot;center&amp;quot; | x ||&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !!  Week 43 || 20.10 - 26.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to access DWI volumes through Python ||align=&amp;quot;center&amp;quot; | x || Fri Oct, 17th&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Get Teem wrapped in Python ||align=&amp;quot;center&amp;quot; | x || Fri Oct, 19th&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 42 || 13.10 - 19.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Try to implement the seeding part of the (VTK) one-tensor tractography module in Python || align=&amp;quot;center&amp;quot; | x || Tue Oct, 14th&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 41 || 06.10 - 12.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
|height=10|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Try to implement the seeding part of the (VTK) one-tensor tractography module in Python || align=&amp;quot;center&amp;quot; | x || Tue Oct, 14th&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! October !!  Week 40 || 29.09 - 5.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;20px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; |Totally understand existing Python modules in Slicer || align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; |understand existing one-tensor streamline tractography in Slicer (VTK) || align=&amp;quot;center&amp;quot; | x || Tue Sep, 23rd &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Totally understand existing Python modules in Slicer ||align=&amp;quot;center&amp;quot; | x || Tue Sep, 23rd&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !!  Week 39 || 22.09 - 28.09 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; | Slicer &amp;amp; Python Tutorials || align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; | Enable Python in Slicer || align=&amp;quot;center&amp;quot; | x || Mon Sep, 22nd&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot; &lt;br /&gt;
! September !! Week 38 || 14.09 - 21.09 || ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Information==&lt;br /&gt;
* Diffusion Tensor Analysis in Slicer: http://www.na-mic.org/Wiki/images/0/04/Slicer3diffusionTutorial7.pdf&lt;br /&gt;
* Building a Slicer 3 Module GUI: http://www.slicer.org/pages/Building_a_Slicer_3_Module_GUI&lt;br /&gt;
&lt;br /&gt;
Python:&lt;br /&gt;
* SlicerWiki about Python: http://www.slicer.org/slicerWiki/index.php/Slicer3::Python&lt;br /&gt;
* Python example modules in Slicer: http://www.slicer.org/slicerWiki/index.php/Slicer3:Execution_Model_Documentation:Python&lt;/div&gt;</summary>
		<author><name>Mseeland</name></author>
		
	</entry>
	<entry>
		<id>https://www.na-mic.org/w/index.php?title=User:Mseeland&amp;diff=35255</id>
		<title>User:Mseeland</title>
		<link rel="alternate" type="text/html" href="https://www.na-mic.org/w/index.php?title=User:Mseeland&amp;diff=35255"/>
		<updated>2009-02-09T16:28:51Z</updated>

		<summary type="html">&lt;p&gt;Mseeland: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Wiki of Madeleine Seeland =&lt;br /&gt;
&lt;br /&gt;
== General Information ==&lt;br /&gt;
&lt;br /&gt;
===About myself===&lt;br /&gt;
I am a grad student of Management Information Systems at the University of Mannheim, Germany. I'm involved in the Diffusion Tensor Imaging (DTI) project in the Laboratory of Mathematics in Imaging. Currently I'm working on two-tensor tractograohy for Neurosurgery. I will document my research experience as a diploma thesis, which I need for completing my studies in Germany.&lt;br /&gt;
&lt;br /&gt;
===Contact information===&lt;br /&gt;
E-mail: mseeland (at sign) bwh.harvard.edu&lt;br /&gt;
&lt;br /&gt;
===Collaborators &amp;amp; Contacts===&lt;br /&gt;
* Supervisors: C-F Westin, Nobuhiko Hata&lt;br /&gt;
* Gordon  Kindlmann (Teem)&lt;br /&gt;
* Sharon Peled&lt;br /&gt;
* Alireza Radmanesh&lt;br /&gt;
* Isaiah Norton&lt;br /&gt;
* Regarding Python: Steve Pieper, Julien de Siebenthal, Sylvain Bouix, Demian Wassermann, Luca Antiga&lt;br /&gt;
&lt;br /&gt;
==Project: Two-Tensor Tractography integration into Slicer==&lt;br /&gt;
&lt;br /&gt;
===Project Description===&lt;br /&gt;
*  Integration of Two-Tensor Tractography into Slicer using Python&lt;br /&gt;
*  Use of existing tractography methods in Teem (http://teem.sourceforge.net/)&lt;br /&gt;
*  My part: Interface between Python and Slicer&lt;br /&gt;
** pass data from VTK to Python to Teem&lt;br /&gt;
** make use of Teem tractography function calls&lt;br /&gt;
** pass resulting fiber data from Teem to Python to VTK and display fiber tracts in Slicer  &lt;br /&gt;
*  The Teem Python API will be provided by Gordon Kindlmann&lt;br /&gt;
&lt;br /&gt;
===How to enable Python in Slicer 3.3===&lt;br /&gt;
*  The current version of Slicer, Slicer 3.2, does not support Python. In order to use Python you need to install Slicer 3.3.&lt;br /&gt;
&lt;br /&gt;
*  To build Slicer Version 3.3, just do the following two commands:&lt;br /&gt;
  svn co http://svn.slicer.org/Slicer3/trunk Slicer3&lt;br /&gt;
  ./Slicer3/Scripts/getbuildtest.tcl&lt;br /&gt;
&lt;br /&gt;
*  In Slicer 3.3, Python support is disabled by default. In order to enable Python, just follow the next steps:&lt;br /&gt;
&lt;br /&gt;
# Edit slicer_variables.tcl&lt;br /&gt;
## Change &amp;quot;set ::USE_PYTHON &amp;quot;off&amp;quot;&amp;quot; to &amp;quot;on&amp;quot;&lt;br /&gt;
# '''Optional:''' If you prefer to use your system Python installation, see here: [http://www.slicer.org/slicerWiki/index.php/Slicer3::Python] &lt;br /&gt;
# '''Optional:''' installing SciPy, see here: [http://www.slicer.org/slicerWiki/index.php/Slicer3::Python]. However, there are still problems adding scipy in Slicer, whcih are not fixed yet.&lt;br /&gt;
&lt;br /&gt;
*  Rebuild Slicer3 using &amp;quot;getbuildtest.tcl&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 ./Slicer3/Scripts/getbuildtest.tcl&lt;br /&gt;
&lt;br /&gt;
A new menu command '''Python Interpreter''' should appear on the Window menu in Slicer. This command should bring up the Python Console window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Requirements for running the Two-Tensor Tractography method===&lt;br /&gt;
====Teem Python wrapping====&lt;br /&gt;
&lt;br /&gt;
=====BACKGROUND=====&lt;br /&gt;
* Teem Python wrapping is needed to make use of existing Two-Tensor tractography functions in Teem in Python&lt;br /&gt;
* The Python wrappings are based on ctypes, as well as a ctypes code generator (called &amp;quot;ctypeslib&amp;quot;)&lt;br /&gt;
** http://python.net/crew/theller/ctypes&lt;br /&gt;
** http://starship.python.net/crew/theller/wiki/CodeGenerator&lt;br /&gt;
** http://starship.python.net/crew/theller/ctypes/old/codegen.html&lt;br /&gt;
* Ctypes is a standard part of python, by which C functions in a shared library can be called from Python&lt;br /&gt;
* The ctypes code generator converts declarations in C header files into executable Python code: enums, structs, unions, function declarations, com interfaces, and preprocessor definitions.&lt;br /&gt;
* Creating wrappers for C header file(s) is a two step process. &lt;br /&gt;
** First, the ``h2xml.py`` script runs GCC-XML_ over the include file(s), creating a XML file containing declarations and definitions.  &lt;br /&gt;
** Second, the ``xml2py.py`` script parses the XML files and creates Python code containing all or a subset of these definitions.&lt;br /&gt;
* Python code is generated for C enums, structure, unions, typedefs and function declarations.&lt;br /&gt;
&lt;br /&gt;
=====REQUIREMENTS=====&lt;br /&gt;
* Ctypeslib: ctypeslib is an extension package for ctypes. It contains a ctypes code generator.&lt;br /&gt;
* GCC-XML (from http://www.gccxml.org/) is required to parse C header files into an XML description.&lt;br /&gt;
&lt;br /&gt;
=====GETTING THE SOFTWARE=====&lt;br /&gt;
* Python 2.6 can be got here (anything after 2.5 should work): http://www.python.org/download/&lt;br /&gt;
* Get gccxml (I used version 0.9.0), which can be got by CVS as described here: http://www.gccxml.org/HTML/Download.html&lt;br /&gt;
** follow the installation as described here: http://www.gccxml.org/HTML/Install.html&lt;br /&gt;
* use a version of ctypeslib which work with the version of gccxml: &lt;br /&gt;
  http://svn.python.org/projects/ctypes/branches/ctypeslib-gccxml-0.9&lt;br /&gt;
* But this requires some patches to work; the content of the &amp;quot;fixes.patch&amp;quot; file can be found here: [[http://wiki.na-mic.org/Wiki/images/3/3b/Fixes.patch.txt]]:&lt;br /&gt;
   svn co http://svn.python.org/projects/ctypes/branches/ctypeslib-gccxml-0.9&lt;br /&gt;
   cd ctypeslib-gccxml-0.9&lt;br /&gt;
   patch -p0 &amp;lt; ../fixes.patch&lt;br /&gt;
   cd ..&lt;br /&gt;
* ctypeslib is written in python =&amp;gt; there's nothing new to compile at this point&lt;br /&gt;
&lt;br /&gt;
=====CREATING PYTHON/TEEM=====&lt;br /&gt;
* First get Teem (starting from whatever directory should contain the &amp;quot;teem&amp;quot; source dir):&lt;br /&gt;
  svn co https://teem.svn.sourceforge.net/svnroot/teem/teem/trunk teem&lt;br /&gt;
and compile it as a shared library.  Directions for doing this with cmake are here:&lt;br /&gt;
  http://teem.sourceforge.net/build.html&lt;br /&gt;
* create the wrappings in a new directory (e.g. &amp;quot;teem-wrap&amp;quot;), where the XML and Python output will be&lt;br /&gt;
* Set the environment variables that identify where Teem and ctypeslib are:&lt;br /&gt;
** TEEM is where Teem's &amp;quot;make install&amp;quot; put subdirectories &amp;quot;bin&amp;quot;, &amp;quot;lib&amp;quot;, and &amp;quot;include&amp;quot; (e.g. ~/teem-build)&lt;br /&gt;
** CTYPES is the full path of ctypeslib-gccxml-0.9&lt;br /&gt;
* First create (in, for example, &amp;quot;teem-wrap&amp;quot;) a meta-header for all the Teem header files (in tcsh):&lt;br /&gt;
   mkdir teemincl&lt;br /&gt;
   cp -r ${TEEM}/include/teem teemincl&lt;br /&gt;
   cd teemincl&lt;br /&gt;
   ls -1 teem/*.h | awk '{print &amp;quot;#include &amp;lt;&amp;quot;$1&amp;quot;&amp;gt;&amp;quot;}' &amp;gt; all.h&lt;br /&gt;
   cd ..&lt;br /&gt;
* Then create teem.xml:&lt;br /&gt;
   setenv PYTHONPATH $CTYPES&lt;br /&gt;
   python $CTYPES/scripts/h2xml.py `pwd`/teemincl/all.h -I teemincl -o teem.xml &lt;br /&gt;
* Then create teem.py (use DYLD_LIBRARY_PATH in a mac):&lt;br /&gt;
   setenv LD_LIBRARY_PATH ${TEEM}/lib&lt;br /&gt;
   python $CTYPES/scripts/xml2py.py teem.xml -llibteem.so -o teem.py \&lt;br /&gt;
        -r &amp;quot;(air|hest|biff|nrrd|ell|unrrdu|moss|gage|bane|limn|seek|hoover|echo|ten|dye|mite).*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
====LEVMAR====&lt;br /&gt;
&lt;br /&gt;
* The 2-tensor tractography depends on Levenberg-Marquardt nonlinear optimization of Sharon Peled's constrained two-tensor model. I used the following implementation for it: http://www.ics.forth.gr/~lourakis/levmar/&lt;br /&gt;
* This code is enabled by compiling Teem with TEEM_LEVMAR defined. The include paths and library link paths need also be defined for everything to work.&lt;br /&gt;
* There are problems compiling LEVMAR with cmake. I found no way to create a build of levmar that allows Teem to say in Teem's CMakeLists.txt simply: FIND_PACKAGE(LEVMAR)). Therefore I compiled levmar myself and then changed Teem's CMake stuff so that the user sets the Teem_LEVMAR_LIB and Teem_LEVMAR_IPATH variables directly (so that the user does by hand what's normally done by &amp;quot;FIND_PACKAGE(LEVMAR)&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
==Status/Progress==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=0&lt;br /&gt;
|- bgcolor=&amp;quot;#abcdef&amp;quot;&lt;br /&gt;
! Month !! Week #  !! Start Date - End Date !! Done !! Date Done&lt;br /&gt;
|-&lt;br /&gt;
|height=5|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Find optimal parameter setting of the Two-Tensor Tractography method ||align=&amp;quot;center&amp;quot; |  || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Extend Two-Tensor Tractography module by fiducial seeding ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | NA-MIC Project Week in Salt Lake City ([http://www.na-mic.org/Wiki/index.php/2009_Winter_Project_Week],[http://www.na-mic.org/Wiki/index.php/Two-tensor_tractography_in_Slicer_using_Python_and_Teem]) ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! January !!  | Week 2 || 05.01 - 11.01 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | IGT Project Week ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 50 || 08.12 - 14.12 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! December !!  | Week 49 || 01.12 - 07.12 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to compile teem with levmar (= Levenberg-Marquardt nonlinear least squares algorithm) ||align=&amp;quot;center&amp;quot; | x || Mon Dec, 1st&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 48 !! 24.11 - 30.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | document the results of the two-tensor tractography given a tensor volume ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to do mutli trace tractography given a DWI volume ||align=&amp;quot;center&amp;quot; | x || Mon Nov, 17th&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 47 !! 17.11 - 23.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Working on Python tractography module for multi fiber tracing given a tensor volume ||align=&amp;quot;center&amp;quot; | x || Mon Nov, 17th&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 46 !! 10.11 - 16.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Get vertex data out of the nvert nrrd filled by the tractography back to Slicer ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to pass image data from Python to Teem through nrrdWrap_nva function ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to generate a list of point locations that were used as tractography seedpoints in the VTK tractography ||align=&amp;quot;center&amp;quot; | x || Thu Nov, 13th&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Implement Python tractography module for single fiber tracing given a seeding starting point and a tensor volume ||align=&amp;quot;center&amp;quot; | x || Fri, Nov, 7th&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 45 || 03.11 - 09.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to get image data from numpy (= Python package) to Teem nrrd struct ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! November !!  | Week 44 || 27.10 - 02.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;20px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to get image data from numpy (= Python package) to Teem nrrd struct ||align=&amp;quot;center&amp;quot; | x ||&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !!  Week 43 || 20.10 - 26.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to access DWI volumes through Python ||align=&amp;quot;center&amp;quot; | x || Fri Oct, 17th&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Get Teem wrapped in Python ||align=&amp;quot;center&amp;quot; | x || Fri Oct, 19th&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 42 || 13.10 - 19.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Try to implement the seeding part of the (VTK) one-tensor tractography module in Python || align=&amp;quot;center&amp;quot; | x || Tue Oct, 14th&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 41 || 06.10 - 12.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
|height=10|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Try to implement the seeding part of the (VTK) one-tensor tractography module in Python || align=&amp;quot;center&amp;quot; | x || Tue Oct, 14th&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! October !!  Week 40 || 29.09 - 5.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;20px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; |Totally understand existing Python modules in Slicer || align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; |understand existing one-tensor streamline tractography in Slicer (VTK) || align=&amp;quot;center&amp;quot; | x || Tue Sep, 23rd &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Totally understand existing Python modules in Slicer ||align=&amp;quot;center&amp;quot; | x || Tue Sep, 23rd&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !!  Week 39 || 22.09 - 28.09 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; | Slicer &amp;amp; Python Tutorials || align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; | Enable Python in Slicer || align=&amp;quot;center&amp;quot; | x || Mon Sep, 22nd&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot; &lt;br /&gt;
! September !! Week 38 || 14.09 - 21.09 || ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Information==&lt;br /&gt;
* Diffusion Tensor Analysis in Slicer: http://www.na-mic.org/Wiki/images/0/04/Slicer3diffusionTutorial7.pdf&lt;br /&gt;
* Building a Slicer 3 Module GUI: http://www.slicer.org/pages/Building_a_Slicer_3_Module_GUI&lt;br /&gt;
&lt;br /&gt;
Python:&lt;br /&gt;
* SlicerWiki about Python: http://www.slicer.org/slicerWiki/index.php/Slicer3::Python&lt;br /&gt;
* Python example modules in Slicer: http://www.slicer.org/slicerWiki/index.php/Slicer3:Execution_Model_Documentation:Python&lt;/div&gt;</summary>
		<author><name>Mseeland</name></author>
		
	</entry>
	<entry>
		<id>https://www.na-mic.org/w/index.php?title=User:Mseeland&amp;diff=35254</id>
		<title>User:Mseeland</title>
		<link rel="alternate" type="text/html" href="https://www.na-mic.org/w/index.php?title=User:Mseeland&amp;diff=35254"/>
		<updated>2009-02-09T16:27:06Z</updated>

		<summary type="html">&lt;p&gt;Mseeland: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Wiki of Madeleine Seeland =&lt;br /&gt;
&lt;br /&gt;
== General Information ==&lt;br /&gt;
&lt;br /&gt;
===About myself===&lt;br /&gt;
I am a grad student of Management Information Systems at the University of Mannheim, Germany. I'm involved in the Diffusion Tensor Imaging (DTI) project in the Laboratory of Mathematics in Imaging. Currently I'm working on two-tensor tractograohy for Neurosurgery. I will document my research experience as a diploma thesis, which I need for completing my studies in Germany.&lt;br /&gt;
&lt;br /&gt;
===Contact information===&lt;br /&gt;
E-mail: mseeland (at sign) bwh.harvard.edu&lt;br /&gt;
&lt;br /&gt;
===Collaborators &amp;amp; Contacts===&lt;br /&gt;
* Supervisors: C-F Westin, Nobuhiko Hata&lt;br /&gt;
* Gordon  Kindlmann (Teem)&lt;br /&gt;
* Sharon Peled&lt;br /&gt;
* Alireza Radmanesh&lt;br /&gt;
* Isaiah Norton&lt;br /&gt;
* Regarding Python: Steve Pieper, Julien de Siebenthal, Sylvain Bouix, Demian Wassermann, Luca Antiga&lt;br /&gt;
&lt;br /&gt;
==Project: Two-Tensor Tractography integration into Slicer==&lt;br /&gt;
&lt;br /&gt;
===Project Description===&lt;br /&gt;
*  Integration of Two-Tensor Tractography into Slicer using Python&lt;br /&gt;
*  Use of existing tractography methods in Teem (http://teem.sourceforge.net/)&lt;br /&gt;
*  My part: Interface between Python and Slicer&lt;br /&gt;
** pass data from VTK to Python to Teem&lt;br /&gt;
** make use of Teem tractography function calls&lt;br /&gt;
** pass resulting fiber data from Teem to Python to VTK and display fiber tracts in Slicer  &lt;br /&gt;
*  The Teem Python API will be provided by Gordon Kindlmann&lt;br /&gt;
&lt;br /&gt;
===How to enable Python in Slicer 3.3===&lt;br /&gt;
*  The current version of Slicer, Slicer 3.2, does not support Python. In order to use Python you need to install Slicer 3.3.&lt;br /&gt;
&lt;br /&gt;
*  To build Slicer Version 3.3, just do the following two commands:&lt;br /&gt;
  svn co http://svn.slicer.org/Slicer3/trunk Slicer3&lt;br /&gt;
  ./Slicer3/Scripts/getbuildtest.tcl&lt;br /&gt;
&lt;br /&gt;
*  In Slicer 3.3, Python support is disabled by default. In order to enable Python, just follow the next steps:&lt;br /&gt;
&lt;br /&gt;
# Edit slicer_variables.tcl&lt;br /&gt;
## Change &amp;quot;set ::USE_PYTHON &amp;quot;off&amp;quot;&amp;quot; to &amp;quot;on&amp;quot;&lt;br /&gt;
# '''Optional:''' If you prefer to use your system Python installation, see here: [http://www.slicer.org/slicerWiki/index.php/Slicer3::Python] &lt;br /&gt;
# '''Optional:''' installing SciPy, see here: [http://www.slicer.org/slicerWiki/index.php/Slicer3::Python]. However, there are still problems adding scipy in Slicer, whcih are not fixed yet.&lt;br /&gt;
&lt;br /&gt;
*  Rebuild Slicer3 using &amp;quot;getbuildtest.tcl&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 ./Slicer3/Scripts/getbuildtest.tcl&lt;br /&gt;
&lt;br /&gt;
A new menu command '''Python Interpreter''' should appear on the Window menu in Slicer. This command should bring up the Python Console window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Requirements for running the Two-Tensor Tractography method===&lt;br /&gt;
==Teem Python wrapping==&lt;br /&gt;
&lt;br /&gt;
====BACKGROUND====&lt;br /&gt;
* Teem Python wrapping is needed to make use of existing Two-Tensor tractography functions in Teem in Python&lt;br /&gt;
* The Python wrappings are based on ctypes, as well as a ctypes code generator (called &amp;quot;ctypeslib&amp;quot;)&lt;br /&gt;
** http://python.net/crew/theller/ctypes&lt;br /&gt;
** http://starship.python.net/crew/theller/wiki/CodeGenerator&lt;br /&gt;
** http://starship.python.net/crew/theller/ctypes/old/codegen.html&lt;br /&gt;
* Ctypes is a standard part of python, by which C functions in a shared library can be called from Python&lt;br /&gt;
* The ctypes code generator converts declarations in C header files into executable Python code: enums, structs, unions, function declarations, com interfaces, and preprocessor definitions.&lt;br /&gt;
* Creating wrappers for C header file(s) is a two step process. &lt;br /&gt;
** First, the ``h2xml.py`` script runs GCC-XML_ over the include file(s), creating a XML file containing declarations and definitions.  &lt;br /&gt;
** Second, the ``xml2py.py`` script parses the XML files and creates Python code containing all or a subset of these definitions.&lt;br /&gt;
* Python code is generated for C enums, structure, unions, typedefs and function declarations.&lt;br /&gt;
&lt;br /&gt;
====REQUIREMENTS====&lt;br /&gt;
* Ctypeslib: ctypeslib is an extension package for ctypes. It contains a ctypes code generator.&lt;br /&gt;
* GCC-XML (from http://www.gccxml.org/) is required to parse C header files into an XML description.&lt;br /&gt;
&lt;br /&gt;
====GETTING THE SOFTWARE====&lt;br /&gt;
* Python 2.6 can be got here (anything after 2.5 should work): http://www.python.org/download/&lt;br /&gt;
* Get gccxml (I used version 0.9.0), which can be got by CVS as described here: http://www.gccxml.org/HTML/Download.html&lt;br /&gt;
** follow the installation as described here: http://www.gccxml.org/HTML/Install.html&lt;br /&gt;
* use a version of ctypeslib which work with the version of gccxml: &lt;br /&gt;
  http://svn.python.org/projects/ctypes/branches/ctypeslib-gccxml-0.9&lt;br /&gt;
* But this requires some patches to work; the content of the &amp;quot;fixes.patch&amp;quot; file can be found here: [[http://wiki.na-mic.org/Wiki/images/3/3b/Fixes.patch.txt]]:&lt;br /&gt;
   svn co http://svn.python.org/projects/ctypes/branches/ctypeslib-gccxml-0.9&lt;br /&gt;
   cd ctypeslib-gccxml-0.9&lt;br /&gt;
   patch -p0 &amp;lt; ../fixes.patch&lt;br /&gt;
   cd ..&lt;br /&gt;
* ctypeslib is written in python =&amp;gt; there's nothing new to compile at this point&lt;br /&gt;
&lt;br /&gt;
====CREATING PYTHON/TEEM====&lt;br /&gt;
* First get Teem (starting from whatever directory should contain the &amp;quot;teem&amp;quot; source dir):&lt;br /&gt;
  svn co https://teem.svn.sourceforge.net/svnroot/teem/teem/trunk teem&lt;br /&gt;
and compile it as a shared library.  Directions for doing this with cmake are here:&lt;br /&gt;
  http://teem.sourceforge.net/build.html&lt;br /&gt;
* create the wrappings in a new directory (e.g. &amp;quot;teem-wrap&amp;quot;), where the XML and Python output will be&lt;br /&gt;
* Set the environment variables that identify where Teem and ctypeslib are:&lt;br /&gt;
** TEEM is where Teem's &amp;quot;make install&amp;quot; put subdirectories &amp;quot;bin&amp;quot;, &amp;quot;lib&amp;quot;, and &amp;quot;include&amp;quot; (e.g. ~/teem-build)&lt;br /&gt;
** CTYPES is the full path of ctypeslib-gccxml-0.9&lt;br /&gt;
* First create (in, for example, &amp;quot;teem-wrap&amp;quot;) a meta-header for all the Teem header files (in tcsh):&lt;br /&gt;
   mkdir teemincl&lt;br /&gt;
   cp -r ${TEEM}/include/teem teemincl&lt;br /&gt;
   cd teemincl&lt;br /&gt;
   ls -1 teem/*.h | awk '{print &amp;quot;#include &amp;lt;&amp;quot;$1&amp;quot;&amp;gt;&amp;quot;}' &amp;gt; all.h&lt;br /&gt;
   cd ..&lt;br /&gt;
* Then create teem.xml:&lt;br /&gt;
   setenv PYTHONPATH $CTYPES&lt;br /&gt;
   python $CTYPES/scripts/h2xml.py `pwd`/teemincl/all.h -I teemincl -o teem.xml &lt;br /&gt;
* Then create teem.py (use DYLD_LIBRARY_PATH in a mac):&lt;br /&gt;
   setenv LD_LIBRARY_PATH ${TEEM}/lib&lt;br /&gt;
   python $CTYPES/scripts/xml2py.py teem.xml -llibteem.so -o teem.py \&lt;br /&gt;
        -r &amp;quot;(air|hest|biff|nrrd|ell|unrrdu|moss|gage|bane|limn|seek|hoover|echo|ten|dye|mite).*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==LEVMAR==&lt;br /&gt;
&lt;br /&gt;
* The 2-tensor tractography depends on Levenberg-Marquardt nonlinear optimization of Sharon Peled's constrained two-tensor model. I used the following implementation for it: http://www.ics.forth.gr/~lourakis/levmar/&lt;br /&gt;
* This code is enabled by compiling Teem with TEEM_LEVMAR defined. The include paths and library link paths need also be defined for everything to work.&lt;br /&gt;
* There are problems compiling LEVMAR with cmake. I found no way to create a build of levmar that allows Teem to say in Teem's CMakeLists.txt simply: FIND_PACKAGE(LEVMAR)). Therefore I compiled levmar myself and then changed Teem's CMake stuff so that the user sets the Teem_LEVMAR_LIB and Teem_LEVMAR_IPATH variables directly (so that the user does by hand what's normally done by &amp;quot;FIND_PACKAGE(LEVMAR)&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
==Status/Progress==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=0&lt;br /&gt;
|- bgcolor=&amp;quot;#abcdef&amp;quot;&lt;br /&gt;
! Month !! Week #  !! Start Date - End Date !! Done !! Date Done&lt;br /&gt;
|-&lt;br /&gt;
|height=5|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Find optimal parameter setting of the Two-Tensor Tractography method ||align=&amp;quot;center&amp;quot; |  || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Extend Two-Tensor Tractography module by fiducial seeding ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | NA-MIC Project Week in Salt Lake City ([http://www.na-mic.org/Wiki/index.php/2009_Winter_Project_Week],[http://www.na-mic.org/Wiki/index.php/Two-tensor_tractography_in_Slicer_using_Python_and_Teem]) ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! January !!  | Week 2 || 05.01 - 11.01 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | IGT Project Week ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 50 || 08.12 - 14.12 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! December !!  | Week 49 || 01.12 - 07.12 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to compile teem with levmar (= Levenberg-Marquardt nonlinear least squares algorithm) ||align=&amp;quot;center&amp;quot; | x || Mon Dec, 1st&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 48 !! 24.11 - 30.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | document the results of the two-tensor tractography given a tensor volume ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to do mutli trace tractography given a DWI volume ||align=&amp;quot;center&amp;quot; | x || Mon Nov, 17th&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 47 !! 17.11 - 23.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Working on Python tractography module for multi fiber tracing given a tensor volume ||align=&amp;quot;center&amp;quot; | x || Mon Nov, 17th&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 46 !! 10.11 - 16.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Get vertex data out of the nvert nrrd filled by the tractography back to Slicer ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to pass image data from Python to Teem through nrrdWrap_nva function ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to generate a list of point locations that were used as tractography seedpoints in the VTK tractography ||align=&amp;quot;center&amp;quot; | x || Thu Nov, 13th&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Implement Python tractography module for single fiber tracing given a seeding starting point and a tensor volume ||align=&amp;quot;center&amp;quot; | x || Fri, Nov, 7th&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 45 || 03.11 - 09.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to get image data from numpy (= Python package) to Teem nrrd struct ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! November !!  | Week 44 || 27.10 - 02.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;20px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to get image data from numpy (= Python package) to Teem nrrd struct ||align=&amp;quot;center&amp;quot; | x ||&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !!  Week 43 || 20.10 - 26.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to access DWI volumes through Python ||align=&amp;quot;center&amp;quot; | x || Fri Oct, 17th&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Get Teem wrapped in Python ||align=&amp;quot;center&amp;quot; | x || Fri Oct, 19th&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 42 || 13.10 - 19.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Try to implement the seeding part of the (VTK) one-tensor tractography module in Python || align=&amp;quot;center&amp;quot; | x || Tue Oct, 14th&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 41 || 06.10 - 12.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
|height=10|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Try to implement the seeding part of the (VTK) one-tensor tractography module in Python || align=&amp;quot;center&amp;quot; | x || Tue Oct, 14th&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! October !!  Week 40 || 29.09 - 5.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;20px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; |Totally understand existing Python modules in Slicer || align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; |understand existing one-tensor streamline tractography in Slicer (VTK) || align=&amp;quot;center&amp;quot; | x || Tue Sep, 23rd &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Totally understand existing Python modules in Slicer ||align=&amp;quot;center&amp;quot; | x || Tue Sep, 23rd&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !!  Week 39 || 22.09 - 28.09 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; | Slicer &amp;amp; Python Tutorials || align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; | Enable Python in Slicer || align=&amp;quot;center&amp;quot; | x || Mon Sep, 22nd&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot; &lt;br /&gt;
! September !! Week 38 || 14.09 - 21.09 || ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Information==&lt;br /&gt;
* Diffusion Tensor Analysis in Slicer: http://www.na-mic.org/Wiki/images/0/04/Slicer3diffusionTutorial7.pdf&lt;br /&gt;
* Building a Slicer 3 Module GUI: http://www.slicer.org/pages/Building_a_Slicer_3_Module_GUI&lt;br /&gt;
&lt;br /&gt;
Python:&lt;br /&gt;
* SlicerWiki about Python: http://www.slicer.org/slicerWiki/index.php/Slicer3::Python&lt;br /&gt;
* Python example modules in Slicer: http://www.slicer.org/slicerWiki/index.php/Slicer3:Execution_Model_Documentation:Python&lt;/div&gt;</summary>
		<author><name>Mseeland</name></author>
		
	</entry>
	<entry>
		<id>https://www.na-mic.org/w/index.php?title=Two-tensor_tractography_in_Slicer_using_Python_and_Teem&amp;diff=34786</id>
		<title>Two-tensor tractography in Slicer using Python and Teem</title>
		<link rel="alternate" type="text/html" href="https://www.na-mic.org/w/index.php?title=Two-tensor_tractography_in_Slicer_using_Python_and_Teem&amp;diff=34786"/>
		<updated>2009-01-09T17:04:28Z</updated>

		<summary type="html">&lt;p&gt;Mseeland: /* Key Investigators */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{|&lt;br /&gt;
|[[Image:NAMIC-SLC.jpg|thumb|320px|Return to [[2009_Winter_Project_Week|Project Week Main Page]] ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Key Investigators===&lt;br /&gt;
* BWH: Madeleine Seeland&lt;br /&gt;
* BWH: Carl-Fredrik Westin&lt;br /&gt;
* BWH: Gordon Kindlmann&lt;br /&gt;
* BWH: Nobuhiko Hata&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin: 20px;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 27%; float: left; padding-right: 3%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Objective&amp;lt;/h1&amp;gt;&lt;br /&gt;
Our objective is to finalize the integration of the Two-Tensor Streamline Tractography method in [1] into Slicer and to test it on diverse DWI datasets. Furthermore the optimal parameter settings to run the algorithm needs to be investigated.   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 27%; float: left; padding-right: 3%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Approach, Plan&amp;lt;/h1&amp;gt;&lt;br /&gt;
We are integrating the Two-Tensor Streamline Tractography into Slicer. The complete details on the method are summarized in [1].&lt;br /&gt;
&lt;br /&gt;
The implementation of our project is carried out in Python. The Two-Tensor Tractography function calls are already implemented in the Teem library and can be accessed using the Python wrappings for Teem.&lt;br /&gt;
&lt;br /&gt;
Before integrating the Two-Tensor Tractography algorithm into Slicer, the optimal parameter settings for the algorithm needs to be investigated.&lt;br /&gt;
&lt;br /&gt;
Furthermore we need to find a way to parallelize the tractography algorithm.&lt;br /&gt;
&lt;br /&gt;
Another plan is to apply a noise filter on the DWI's before applying the Two-Tensor Tractography algorithm, as this may lead to more accurate fiber results.&lt;br /&gt;
&lt;br /&gt;
Further, we want to extend the Two-Tensor Tractography module by fiducical seeding in order to be able to do interactive tractography seeding by using a tracking device.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 40%; float: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Progress&amp;lt;/h1&amp;gt;&lt;br /&gt;
* The implementation of the Two-Tensor Tractography is already finished.&lt;br /&gt;
&lt;br /&gt;
* Extension of the Two-Tensor Tractography module by fiudical seeding. &lt;br /&gt;
&lt;br /&gt;
* Working with Marco Ruiz on getting my module working with GWE (Grid Wizard Enterprise) ([http://www.na-mic.org/Wiki/index.php/Engineering:UCSD]) in order to parallelize the execution of my algorithm. Luca Antiga helped by enabling Python modules to run as command line modules without starting the GUI so they can be executed by GWE.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
* [1] Qazi AA, Radmanesh A, O'Donnell L, Kindlmann G, Peled S, Whalen S, Westin CF, Golby AJ. Resolving crossings in the corticospinal tract by two-tensor streamline tractography: method and clinical assessment using fMRI. Neuroimage 2008 &lt;br /&gt;
* [2] Peled S, Friman O, Jolesz F, Westin CF. Geometrically constrained two-tensor model for crossing tracts in DWI. Magnetic Resonance Imaging 2006;24:1263-1270.&lt;/div&gt;</summary>
		<author><name>Mseeland</name></author>
		
	</entry>
	<entry>
		<id>https://www.na-mic.org/w/index.php?title=Two-tensor_tractography_in_Slicer_using_Python_and_Teem&amp;diff=34776</id>
		<title>Two-tensor tractography in Slicer using Python and Teem</title>
		<link rel="alternate" type="text/html" href="https://www.na-mic.org/w/index.php?title=Two-tensor_tractography_in_Slicer_using_Python_and_Teem&amp;diff=34776"/>
		<updated>2009-01-09T16:26:10Z</updated>

		<summary type="html">&lt;p&gt;Mseeland: /* Key Investigators */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{|&lt;br /&gt;
|[[Image:NAMIC-SLC.jpg|thumb|320px|Return to [[2009_Winter_Project_Week|Project Week Main Page]] ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Key Investigators===&lt;br /&gt;
* BWH: Madeleine Seeland&lt;br /&gt;
* BWH: Carl-Fredrik Westin&lt;br /&gt;
* BWH: Gordon Kindlmann&lt;br /&gt;
* BWH: Nobuhiko Hata&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin: 20px;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 27%; float: left; padding-right: 3%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Objective&amp;lt;/h1&amp;gt;&lt;br /&gt;
Our objective is to finalize the integration of the Two-Tensor Streamline Tractography method in [1] into Slicer and to test it on diverse DWI datasets. Furthermore the optimal parameter settings to run the algorithm needs to be investigated.   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 27%; float: left; padding-right: 3%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Approach, Plan&amp;lt;/h1&amp;gt;&lt;br /&gt;
We are integrating the Two-Tensor Streamline Tractography into Slicer. The complete details on the method are summarized in [1].&lt;br /&gt;
&lt;br /&gt;
The implementation of our project is carried out in Python. The Two-Tensor Tractography function calls are already implemented in the Teem library and can be accessed using the Python wrappings for Teem.&lt;br /&gt;
&lt;br /&gt;
Before integrating the Two-Tensor Tractography algorithm into Slicer, the optimal parameter settings for the algorithm needs to be investigated.&lt;br /&gt;
&lt;br /&gt;
Furthermore we need to find a way to parallelize the tractography algorithm.&lt;br /&gt;
&lt;br /&gt;
Another plan is to apply a noise filter on the DWI's before applying the Two-Tensor Tractography algorithm, as this may lead to more accurate fiber results.&lt;br /&gt;
&lt;br /&gt;
Further, we want to extend the Two-Tensor Tractography module by fiducical seeding in order to be able to do interactive tractography seeding by using a tracking device.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 40%; float: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Progress&amp;lt;/h1&amp;gt;&lt;br /&gt;
* The implementation of the Two-Tensor Tractography is already finished. Currently I'm testing the algorithm with different parameter settings.&lt;br /&gt;
&lt;br /&gt;
* Extension of the Two-Tensor Tractography module by fiudical seeding. &lt;br /&gt;
&lt;br /&gt;
* Working with Marco Ruiz on getting my module working with GWE (Grid Wizard Enterprise) ([http://www.na-mic.org/Wiki/index.php/Engineering:UCSD]) in order to parallelize the execution of my algorithm. Luca Antiga helped by enabling Python modules to run as command line modules without starting the GUI so they can be executed by GWE.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
* [1] Qazi AA, Radmanesh A, O'Donnell L, Kindlmann G, Peled S, Whalen S, Westin CF, Golby AJ. Resolving crossings in the corticospinal tract by two-tensor streamline tractography: method and clinical assessment using fMRI. Neuroimage 2008 &lt;br /&gt;
* [2] Peled S, Friman O, Jolesz F, Westin CF. Geometrically constrained two-tensor model for crossing tracts in DWI. Magnetic Resonance Imaging 2006;24:1263-1270.&lt;/div&gt;</summary>
		<author><name>Mseeland</name></author>
		
	</entry>
	<entry>
		<id>https://www.na-mic.org/w/index.php?title=Two-tensor_tractography_in_Slicer_using_Python_and_Teem&amp;diff=34775</id>
		<title>Two-tensor tractography in Slicer using Python and Teem</title>
		<link rel="alternate" type="text/html" href="https://www.na-mic.org/w/index.php?title=Two-tensor_tractography_in_Slicer_using_Python_and_Teem&amp;diff=34775"/>
		<updated>2009-01-09T16:20:24Z</updated>

		<summary type="html">&lt;p&gt;Mseeland: /* Key Investigators */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{|&lt;br /&gt;
|[[Image:NAMIC-SLC.jpg|thumb|320px|Return to [[2009_Winter_Project_Week|Project Week Main Page]] ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Key Investigators===&lt;br /&gt;
* BWH: Madeleine Seeland&lt;br /&gt;
* BWH: Carl-Fredrik Westin&lt;br /&gt;
* BWH: Gordon Kindlmann&lt;br /&gt;
* BWH: Nobuhiko Hata&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin: 20px;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 27%; float: left; padding-right: 3%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Objective&amp;lt;/h1&amp;gt;&lt;br /&gt;
Our objective is to finalize the integration of the Two-Tensor Streamline Tractography method in [1] into Slicer and to test it on diverse DWI datasets. Furthermore the optimal parameter settings to run the algorithm needs to be investigated.   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 27%; float: left; padding-right: 3%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Approach, Plan&amp;lt;/h1&amp;gt;&lt;br /&gt;
We are integrating the Two-Tensor Streamline Tractography into Slicer. The complete details on the method are summarized in [1].&lt;br /&gt;
&lt;br /&gt;
The implementation of our project is carried out in Python. The Two-Tensor Tractography function calls are already implemented in the Teem library and can be accessed using the Python wrappings for Teem.&lt;br /&gt;
&lt;br /&gt;
Before integrating the Two-Tensor Tractography algorithm into Slicer, the optimal parameter settings for the algorithm needs to be investigated.&lt;br /&gt;
&lt;br /&gt;
Furthermore we need to find a way to parallelize the tractography algorithm.&lt;br /&gt;
&lt;br /&gt;
Another plan is to apply a noise filter on the DWI's before applying the Two-Tensor Tractography algorithm, as this may lead to more accurate fiber results.&lt;br /&gt;
&lt;br /&gt;
Further, we want to extend the Two-Tensor Tractography module by fiducical seeding in order to be able to do interactive tractography seeding by using a tracking device.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 40%; float: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Progress&amp;lt;/h1&amp;gt;&lt;br /&gt;
* The implementation of the Two-Tensor Tractography is already finished. Currently I'm testing the algorithm with different parameter settings.&lt;br /&gt;
&lt;br /&gt;
* Extension of the Two-Tensor Tractography module by fiudical seeding. &lt;br /&gt;
&lt;br /&gt;
* Working with Marco Ruiz on getting my module working with GWE (Grid Wizard Enterprise) ([http://www.na-mic.org/Wiki/index.php/Engineering:UCSD]) in order to parallelize the execution of my algorithm. Luca Antiga helped by enabling Python modules to run as command line modules so they can be executed by GWE.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
* [1] Qazi AA, Radmanesh A, O'Donnell L, Kindlmann G, Peled S, Whalen S, Westin CF, Golby AJ. Resolving crossings in the corticospinal tract by two-tensor streamline tractography: method and clinical assessment using fMRI. Neuroimage 2008 &lt;br /&gt;
* [2] Peled S, Friman O, Jolesz F, Westin CF. Geometrically constrained two-tensor model for crossing tracts in DWI. Magnetic Resonance Imaging 2006;24:1263-1270.&lt;/div&gt;</summary>
		<author><name>Mseeland</name></author>
		
	</entry>
	<entry>
		<id>https://www.na-mic.org/w/index.php?title=Two-tensor_tractography_in_Slicer_using_Python_and_Teem&amp;diff=34774</id>
		<title>Two-tensor tractography in Slicer using Python and Teem</title>
		<link rel="alternate" type="text/html" href="https://www.na-mic.org/w/index.php?title=Two-tensor_tractography_in_Slicer_using_Python_and_Teem&amp;diff=34774"/>
		<updated>2009-01-09T16:09:05Z</updated>

		<summary type="html">&lt;p&gt;Mseeland: /* Key Investigators */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{|&lt;br /&gt;
|[[Image:NAMIC-SLC.jpg|thumb|320px|Return to [[2009_Winter_Project_Week|Project Week Main Page]] ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Key Investigators===&lt;br /&gt;
* BWH: Madeleine Seeland&lt;br /&gt;
* BWH: Carl-Fredrik Westin&lt;br /&gt;
* BWH: Gordon Kindlmann&lt;br /&gt;
* BWH: Nobuhiko Hata&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin: 20px;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 27%; float: left; padding-right: 3%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Objective&amp;lt;/h1&amp;gt;&lt;br /&gt;
Our objective is to finalize the integration of the Two-Tensor Streamline Tractography method in [1] into Slicer and to test it on diverse DWI datasets. Furthermore the optimal parameter settings to run the algorithm needs to be investigated.   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 27%; float: left; padding-right: 3%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Approach, Plan&amp;lt;/h1&amp;gt;&lt;br /&gt;
We are integrating the Two-Tensor Streamline Tractography into Slicer. The complete details on the method are summarized in [1].&lt;br /&gt;
&lt;br /&gt;
The implementation of our project is carried out in Python. The Two-Tensor Tractography function calls are already implemented in the Teem library and can be accessed using the Python wrappings for Teem.&lt;br /&gt;
&lt;br /&gt;
Before integrating the Two-Tensor Tractography algorithm into Slicer, the optimal parameter settings for the algorithm needs to be investigated.&lt;br /&gt;
&lt;br /&gt;
Furthermore we need to find a way to parallelize the tractography algorithm.&lt;br /&gt;
&lt;br /&gt;
Another plan is to apply a noise filter on the DWI's before applying the Two-Tensor Tractography algorithm, as this may lead to more accurate fiber results.&lt;br /&gt;
&lt;br /&gt;
Further, we want to extend the Two-Tensor Tractography module by fiducical seeding in order to be able to do interactive tractography seeding by using a tracking device.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 40%; float: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Progress&amp;lt;/h1&amp;gt;&lt;br /&gt;
* The implementation of the Two-Tensor Tractography is already finished. Currently I'm testing the algorithm with different parameter settings.&lt;br /&gt;
&lt;br /&gt;
* Extension of the Two-Tensor Tractography module by fiudical seeding. &lt;br /&gt;
&lt;br /&gt;
* Working with Marco Ruiz on getting my module working with GWE (Grid Wizard Enterprise) ([http://www.na-mic.org/Wiki/index.php/Engineering:UCSD]) in order to parallelize the execution of my algorithm. Luca Antiga helped by getting Python modules to run as command line modules so they can be executed by GWE.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
* [1] Qazi AA, Radmanesh A, O'Donnell L, Kindlmann G, Peled S, Whalen S, Westin CF, Golby AJ. Resolving crossings in the corticospinal tract by two-tensor streamline tractography: method and clinical assessment using fMRI. Neuroimage 2008 &lt;br /&gt;
* [2] Peled S, Friman O, Jolesz F, Westin CF. Geometrically constrained two-tensor model for crossing tracts in DWI. Magnetic Resonance Imaging 2006;24:1263-1270.&lt;/div&gt;</summary>
		<author><name>Mseeland</name></author>
		
	</entry>
	<entry>
		<id>https://www.na-mic.org/w/index.php?title=Two-tensor_tractography_in_Slicer_using_Python_and_Teem&amp;diff=34762</id>
		<title>Two-tensor tractography in Slicer using Python and Teem</title>
		<link rel="alternate" type="text/html" href="https://www.na-mic.org/w/index.php?title=Two-tensor_tractography_in_Slicer_using_Python_and_Teem&amp;diff=34762"/>
		<updated>2009-01-09T14:23:44Z</updated>

		<summary type="html">&lt;p&gt;Mseeland: /* Key Investigators */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{|&lt;br /&gt;
|[[Image:NAMIC-SLC.jpg|thumb|320px|Return to [[2009_Winter_Project_Week|Project Week Main Page]] ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Key Investigators===&lt;br /&gt;
* BWH: Madeleine Seeland&lt;br /&gt;
* BWH: Carl-Fredrik Westin&lt;br /&gt;
* BWH: Gordon Kindlmann&lt;br /&gt;
* BWH: Nobuhiko Hata&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin: 20px;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 27%; float: left; padding-right: 3%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Objective&amp;lt;/h1&amp;gt;&lt;br /&gt;
Our objective is to finalize the integration of the Two-Tensor Streamline Tractography method in [1] into Slicer and to test it on diverse DWI datasets. Furthermore the optimal parameter settings to run the algorithm needs to be investigated.   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 27%; float: left; padding-right: 3%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Approach, Plan&amp;lt;/h1&amp;gt;&lt;br /&gt;
We are integrating the Two-Tensor Streamline Tractography into Slicer. The complete details on the method are summarized in [1].&lt;br /&gt;
&lt;br /&gt;
The implementation of our project is carried out in Python. The Two-Tensor Tractography function calls are already implemented in the Teem library and can be accessed using the Python wrappings for Teem.&lt;br /&gt;
&lt;br /&gt;
Before integrating the Two-Tensor Tractography algorithm into Slicer, the optimal parameter settings for the algorithm needs to be investigated.&lt;br /&gt;
&lt;br /&gt;
Furthermore we need to find a way to parallelize the tractography algorithm.&lt;br /&gt;
&lt;br /&gt;
Another plan is to apply a noise filter on the DWI's before applying the Two-Tensor Tractography algorithm, as this may lead to more accurate fiber results.&lt;br /&gt;
&lt;br /&gt;
Further, we want to extend the Two-Tensor Tractography module by fiducical seeding in order to be able to do interactive tractography seeding by using a tracking device.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 40%; float: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Progress&amp;lt;/h1&amp;gt;&lt;br /&gt;
* The implementation of the Two-Tensor Tractography is already finished. Currently I'm testing the algorithm with different parameter settings.&lt;br /&gt;
&lt;br /&gt;
* Extension of the Two-Tensor Tractography module by fiudical seeding. &lt;br /&gt;
&lt;br /&gt;
* Working with Marco Ruiz on getting my module working with GWE (Grid Wizard Enterprise) ([http://www.na-mic.org/Wiki/index.php/Engineering:UCSD]) in order to parallelize the execution of my algorithm. Thanks to Luca Antiga, who worked on getting Python modules run as command line modules so they can be executed by GWE.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
* [1] Qazi AA, Radmanesh A, O'Donnell L, Kindlmann G, Peled S, Whalen S, Westin CF, Golby AJ. Resolving crossings in the corticospinal tract by two-tensor streamline tractography: method and clinical assessment using fMRI. Neuroimage 2008 &lt;br /&gt;
* [2] Peled S, Friman O, Jolesz F, Westin CF. Geometrically constrained two-tensor model for crossing tracts in DWI. Magnetic Resonance Imaging 2006;24:1263-1270.&lt;/div&gt;</summary>
		<author><name>Mseeland</name></author>
		
	</entry>
	<entry>
		<id>https://www.na-mic.org/w/index.php?title=Two-tensor_tractography_in_Slicer_using_Python_and_Teem&amp;diff=34760</id>
		<title>Two-tensor tractography in Slicer using Python and Teem</title>
		<link rel="alternate" type="text/html" href="https://www.na-mic.org/w/index.php?title=Two-tensor_tractography_in_Slicer_using_Python_and_Teem&amp;diff=34760"/>
		<updated>2009-01-09T14:22:10Z</updated>

		<summary type="html">&lt;p&gt;Mseeland: /* Key Investigators */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{|&lt;br /&gt;
|[[Image:NAMIC-SLC.jpg|thumb|320px|Return to [[2009_Winter_Project_Week|Project Week Main Page]] ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Key Investigators===&lt;br /&gt;
* BWH: Madeleine Seeland&lt;br /&gt;
* BWH: Carl-Fredrik Westin&lt;br /&gt;
* BWH: Gordon Kindlmann&lt;br /&gt;
* BWH: Nobuhiko Hata&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin: 20px;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 27%; float: left; padding-right: 3%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Objective&amp;lt;/h1&amp;gt;&lt;br /&gt;
Our objective is to finalize the integration of the Two-Tensor Streamline Tractography method in [1] into Slicer and to test it on diverse DWI datasets. Furthermore the optimal parameter settings to run the algorithm needs to be investigated.   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 27%; float: left; padding-right: 3%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Approach, Plan&amp;lt;/h1&amp;gt;&lt;br /&gt;
We are integrating the Two-Tensor Streamline Tractography into Slicer. The complete details on the method are summarized in [1].&lt;br /&gt;
&lt;br /&gt;
The implementation of our project is carried out in Python. The Two-Tensor Tractography function calls are already implemented in the Teem library and can be accessed using the Python wrappings for Teem.&lt;br /&gt;
&lt;br /&gt;
Before integrating the Two-Tensor Tractography algorithm into Slicer, the optimal parameter settings for the algorithm needs to be investigated.&lt;br /&gt;
&lt;br /&gt;
Furthermore we need to find a way to parallelize the tractography algorithm.&lt;br /&gt;
&lt;br /&gt;
Another plan is to apply a noise filter on the DWI's before applying the Two-Tensor Tractography algorithm, as this may lead to more accurate fiber results.&lt;br /&gt;
&lt;br /&gt;
Further, we want to extend the Two-Tensor Tractography module by fiducical seeding in order to be able to do interactive tractography seeding by using a tracking device.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 40%; float: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Progress&amp;lt;/h1&amp;gt;&lt;br /&gt;
* The implementation of the Two-Tensor Tractography is already finished. Currently I'm testing the algorithm with different parameter settings.&lt;br /&gt;
&lt;br /&gt;
* Extension of the Two-Tensor Tractography module by fiudical seeding. &lt;br /&gt;
&lt;br /&gt;
* Working with Marco Ruiz on getting my module working with GWE (Grid Wizard Enterprise) ([http://www.na-mic.org/Wiki/index.php/Engineering:UCSD]) in order to parallelize the execution of my algorithm. Thanks to Luca Antiga, who is working on getting Python modules run as command line modules so they can be executed by GWE.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
* [1] Qazi AA, Radmanesh A, O'Donnell L, Kindlmann G, Peled S, Whalen S, Westin CF, Golby AJ. Resolving crossings in the corticospinal tract by two-tensor streamline tractography: method and clinical assessment using fMRI. Neuroimage 2008 &lt;br /&gt;
* [2] Peled S, Friman O, Jolesz F, Westin CF. Geometrically constrained two-tensor model for crossing tracts in DWI. Magnetic Resonance Imaging 2006;24:1263-1270.&lt;/div&gt;</summary>
		<author><name>Mseeland</name></author>
		
	</entry>
	<entry>
		<id>https://www.na-mic.org/w/index.php?title=Two-tensor_tractography_in_Slicer_using_Python_and_Teem&amp;diff=34748</id>
		<title>Two-tensor tractography in Slicer using Python and Teem</title>
		<link rel="alternate" type="text/html" href="https://www.na-mic.org/w/index.php?title=Two-tensor_tractography_in_Slicer_using_Python_and_Teem&amp;diff=34748"/>
		<updated>2009-01-09T13:47:32Z</updated>

		<summary type="html">&lt;p&gt;Mseeland: /* Key Investigators */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{|&lt;br /&gt;
|[[Image:NAMIC-SLC.jpg|thumb|320px|Return to [[2009_Winter_Project_Week|Project Week Main Page]] ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Key Investigators===&lt;br /&gt;
* BWH: Madeleine Seeland&lt;br /&gt;
* BWH: Carl-Fredrik Westin&lt;br /&gt;
* BWH: Gordon Kindlmann&lt;br /&gt;
* BWH: Nobuhiko Hata&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin: 20px;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 27%; float: left; padding-right: 3%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Objective&amp;lt;/h1&amp;gt;&lt;br /&gt;
Our objective is to finalize the integration of the Two-Tensor Streamline Tractography method in [1] into Slicer and to test it on diverse DWI datasets. Furthermore the optimal parameter settings to run the algorithm needs to be investigated.   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 27%; float: left; padding-right: 3%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Approach, Plan&amp;lt;/h1&amp;gt;&lt;br /&gt;
We are integrating the Two-Tensor Streamline Tractography into Slicer. The complete details on the method are summarized in [1].&lt;br /&gt;
&lt;br /&gt;
The implementation of our project is carried out in Python. The Two-Tensor Tractography function calls are already implemented in the Teem library and can be accessed using the Python wrappings for Teem.&lt;br /&gt;
&lt;br /&gt;
Before integrating the Two-Tensor Tractography algorithm into Slicer, the optimal parameter settings for the algorithm needs to be investigated.&lt;br /&gt;
&lt;br /&gt;
Furthermore we need to find a way to parallelize the tractography algorithm.&lt;br /&gt;
&lt;br /&gt;
Another plan is to apply a noise filter on the DWI's before applying the Two-Tensor Tractography algorithm, as this may lead to more accurate fiber results.&lt;br /&gt;
&lt;br /&gt;
Further, we want to extend the Two-Tensor Tractography module by fiudical seeding.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 40%; float: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Progress&amp;lt;/h1&amp;gt;&lt;br /&gt;
* The implementation of the Two-Tensor Tractography is already finished. Currently I'm testing the algorithm with different parameter settings.&lt;br /&gt;
&lt;br /&gt;
* Extension of the Two-Tensor Tractography module by fiudical seeding. The aim behind it is to use a tracking device for interactive tractography seeding&lt;br /&gt;
&lt;br /&gt;
* Working with Marco Ruiz on getting my module working with GWE (Grid Wizard Enterprise) ([http://www.na-mic.org/Wiki/index.php/Engineering:UCSD]) in order to parallelize the execution of my algorithm. Thanks to Luca Antiga, who is working on getting Python modules run as command line modules so they can be executed by GWE.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
* [1] Qazi AA, Radmanesh A, O'Donnell L, Kindlmann G, Peled S, Whalen S, Westin CF, Golby AJ. Resolving crossings in the corticospinal tract by two-tensor streamline tractography: method and clinical assessment using fMRI. Neuroimage 2008 &lt;br /&gt;
* [2] Peled S, Friman O, Jolesz F, Westin CF. Geometrically constrained two-tensor model for crossing tracts in DWI. Magnetic Resonance Imaging 2006;24:1263-1270.&lt;/div&gt;</summary>
		<author><name>Mseeland</name></author>
		
	</entry>
	<entry>
		<id>https://www.na-mic.org/w/index.php?title=Two-tensor_tractography_in_Slicer_using_Python_and_Teem&amp;diff=34746</id>
		<title>Two-tensor tractography in Slicer using Python and Teem</title>
		<link rel="alternate" type="text/html" href="https://www.na-mic.org/w/index.php?title=Two-tensor_tractography_in_Slicer_using_Python_and_Teem&amp;diff=34746"/>
		<updated>2009-01-09T13:45:35Z</updated>

		<summary type="html">&lt;p&gt;Mseeland: /* Key Investigators */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{|&lt;br /&gt;
|[[Image:NAMIC-SLC.jpg|thumb|320px|Return to [[2009_Winter_Project_Week|Project Week Main Page]] ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Key Investigators===&lt;br /&gt;
* BWH: Madeleine Seeland&lt;br /&gt;
* BWH: Carl-Fredrik Westin&lt;br /&gt;
* BWH: Gordon Kindlmann&lt;br /&gt;
* BWH: Nobuhiko Hata&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin: 20px;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 27%; float: left; padding-right: 3%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Objective&amp;lt;/h1&amp;gt;&lt;br /&gt;
Our objective is to finalize the integration of the Two-Tensor Streamline Tractography method in [1] into Slicer and to test it on diverse DWI datasets. Furthermore the optimal parameter settings to run the algorithm needs to be investigated.   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 27%; float: left; padding-right: 3%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Approach, Plan&amp;lt;/h1&amp;gt;&lt;br /&gt;
We are integrating the Two-Tensor Streamline Tractography into Slicer. The complete details on the method are summarized in [1].&lt;br /&gt;
&lt;br /&gt;
The implementation of our project is carried out in Python. The Two-Tensor Tractography function calls are already implemented in the Teem library and can be accessed using the Python wrappings for Teem.&lt;br /&gt;
&lt;br /&gt;
Before integrating the Two-Tensor Tractography algorithm into Slicer, the optimal parameter settings for the algorithm needs to be investigated.&lt;br /&gt;
&lt;br /&gt;
Furthermore we need to find a way to parallelize the tractography algorithm.&lt;br /&gt;
&lt;br /&gt;
Another plan is to apply a noise filter on the DWI's before applying the Two-Tensor Tractography algorithm, as this may lead to more accurate fiber results.&lt;br /&gt;
&lt;br /&gt;
Further, we want to extend the Two-Tensor Tractography module by fiudical seeding.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 40%; float: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Progress&amp;lt;/h1&amp;gt;&lt;br /&gt;
* The implementation of the Two-Tensor Tractography is already finished. Currently I'm testing the algorithm with different parameter settings.&lt;br /&gt;
&lt;br /&gt;
* Extension of the Two-Tensor Tractography module by fiudical seeding. The aim behind it is to use a tracking device to seed the tractography.&lt;br /&gt;
&lt;br /&gt;
* Working with Marco Ruiz on getting my module working with GWE (Grid Wizard Enterprise) ([http://www.na-mic.org/Wiki/index.php/Engineering:UCSD]) in order to parallelize the execution of my algorithm. Thanks to Luca Antiga, who is working on getting Python modules run as command line modules so they can be executed by GWE.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
* [1] Qazi AA, Radmanesh A, O'Donnell L, Kindlmann G, Peled S, Whalen S, Westin CF, Golby AJ. Resolving crossings in the corticospinal tract by two-tensor streamline tractography: method and clinical assessment using fMRI. Neuroimage 2008 &lt;br /&gt;
* [2] Peled S, Friman O, Jolesz F, Westin CF. Geometrically constrained two-tensor model for crossing tracts in DWI. Magnetic Resonance Imaging 2006;24:1263-1270.&lt;/div&gt;</summary>
		<author><name>Mseeland</name></author>
		
	</entry>
	<entry>
		<id>https://www.na-mic.org/w/index.php?title=Two-tensor_tractography_in_Slicer_using_Python_and_Teem&amp;diff=34740</id>
		<title>Two-tensor tractography in Slicer using Python and Teem</title>
		<link rel="alternate" type="text/html" href="https://www.na-mic.org/w/index.php?title=Two-tensor_tractography_in_Slicer_using_Python_and_Teem&amp;diff=34740"/>
		<updated>2009-01-09T13:31:10Z</updated>

		<summary type="html">&lt;p&gt;Mseeland: /* Key Investigators */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{|&lt;br /&gt;
|[[Image:NAMIC-SLC.jpg|thumb|320px|Return to [[2009_Winter_Project_Week|Project Week Main Page]] ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Key Investigators===&lt;br /&gt;
* BWH: Madeleine Seeland&lt;br /&gt;
* BWH: Carl-Fredrik Westin&lt;br /&gt;
* BWH: Gordon Kindlmann&lt;br /&gt;
* BWH: Nobuhiko Hata&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin: 20px;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 27%; float: left; padding-right: 3%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Objective&amp;lt;/h1&amp;gt;&lt;br /&gt;
Our objective is to finalize the integration of the Two-Tensor Streamline Tractography method in [1] into Slicer and to test it on diverse DWI datasets. Furthermore the optimal parameter settings to run the algorithm needs to be investigated.   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 27%; float: left; padding-right: 3%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Approach, Plan&amp;lt;/h1&amp;gt;&lt;br /&gt;
We are integrating the Two-Tensor Streamline Tractography into Slicer. The complete details on the method are summarized in [1].&lt;br /&gt;
&lt;br /&gt;
The implementation of our project is carried out in Python. The Two-Tensor Tractography function calls are already implemented in the Teem library and can be accessed using the Python wrappings for Teem.&lt;br /&gt;
&lt;br /&gt;
Besides the integration of the Two-Tensor Tractography algorithm into Slicer, the optimal parameter settings for the algorithm needs to be investigated.&lt;br /&gt;
&lt;br /&gt;
Furthermore we need to find a way to parallelize the tractography algorithm.&lt;br /&gt;
&lt;br /&gt;
Another plan is to apply a noise filter on the DWI's before applying the Two-Tensor Tractography algorithm, as this may lead to more accurate fiber results.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 40%; float: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Progress&amp;lt;/h1&amp;gt;&lt;br /&gt;
* The implementation of the Two-Tensor Tractography is already finished. Currently I'm testing the algorithm with different parameter settings.&lt;br /&gt;
&lt;br /&gt;
* Extension of the Two-Tensor Tractography module by fiudical seeding.&lt;br /&gt;
&lt;br /&gt;
* Working with Marco Ruiz on getting my module working with GWE (Grid Wizard Enterprise) ([http://www.na-mic.org/Wiki/index.php/Engineering:UCSD]) in order to parallelize the execution of my algorithm. Thanks to Luca Antiga, who is working on getting Python modules run as command line modules so they can be executed by GWE.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
* [1] Qazi AA, Radmanesh A, O'Donnell L, Kindlmann G, Peled S, Whalen S, Westin CF, Golby AJ. Resolving crossings in the corticospinal tract by two-tensor streamline tractography: method and clinical assessment using fMRI. Neuroimage 2008 &lt;br /&gt;
* [2] Peled S, Friman O, Jolesz F, Westin CF. Geometrically constrained two-tensor model for crossing tracts in DWI. Magnetic Resonance Imaging 2006;24:1263-1270.&lt;/div&gt;</summary>
		<author><name>Mseeland</name></author>
		
	</entry>
	<entry>
		<id>https://www.na-mic.org/w/index.php?title=Two-tensor_tractography_in_Slicer_using_Python_and_Teem&amp;diff=34739</id>
		<title>Two-tensor tractography in Slicer using Python and Teem</title>
		<link rel="alternate" type="text/html" href="https://www.na-mic.org/w/index.php?title=Two-tensor_tractography_in_Slicer_using_Python_and_Teem&amp;diff=34739"/>
		<updated>2009-01-09T13:30:40Z</updated>

		<summary type="html">&lt;p&gt;Mseeland: /* Key Investigators */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{|&lt;br /&gt;
|[[Image:NAMIC-SLC.jpg|thumb|320px|Return to [[2009_Winter_Project_Week|Project Week Main Page]] ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Key Investigators===&lt;br /&gt;
* BWH: Madeleine Seeland&lt;br /&gt;
* BWH: Carl-Fredrik Westin&lt;br /&gt;
* BWH: Gordon Kindlmann&lt;br /&gt;
* BWH: Nobuhiko Hata&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin: 20px;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 27%; float: left; padding-right: 3%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Objective&amp;lt;/h1&amp;gt;&lt;br /&gt;
Our objective is to finalize the integration of the Two-Tensor Streamline Tractography method in [1] into Slicer and to test it on diverse DWI datasets. Furthermore the optimal parameter settings to run the algorithm needs to be investigated.   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 27%; float: left; padding-right: 3%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Approach, Plan&amp;lt;/h1&amp;gt;&lt;br /&gt;
We are integrating the Two-Tensor Streamline Tractography into Slicer. The complete details on the method are summarized in [1].&lt;br /&gt;
&lt;br /&gt;
The implementation of our project is carried out in Python. The Two-Tensor Tractography function calls are already implemented in the Teem library and can be accessed using the Python wrappings for Teem.&lt;br /&gt;
&lt;br /&gt;
Besides the integration of the Two-Tensor Tractography algorithm into Slicer, the optimal parameter settings for the algorithm needs to be investigated.&lt;br /&gt;
&lt;br /&gt;
Furthermore we need to find a way to parallelize the tractography algorithm (one idea is to use IPython).&lt;br /&gt;
&lt;br /&gt;
Another plan is to apply a noise filter on the DWI's before applying the Two-Tensor Tractography algorithm, as this may lead to more accurate fiber results.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 40%; float: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Progress&amp;lt;/h1&amp;gt;&lt;br /&gt;
* The implementation of the Two-Tensor Tractography is already finished. Currently I'm testing the algorithm with different parameter settings.&lt;br /&gt;
&lt;br /&gt;
* Extension of the Two-Tensor Tractography module by fiudical seeding.&lt;br /&gt;
&lt;br /&gt;
* Working with Marco Ruiz on getting my module working with GWE (Grid Wizard Enterprise) ([http://www.na-mic.org/Wiki/index.php/Engineering:UCSD]) in order to parallelize the execution of my algorithm. Thanks to Luca Antiga, who is working on getting Python modules run as command line modules so they can be executed by GWE.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
* [1] Qazi AA, Radmanesh A, O'Donnell L, Kindlmann G, Peled S, Whalen S, Westin CF, Golby AJ. Resolving crossings in the corticospinal tract by two-tensor streamline tractography: method and clinical assessment using fMRI. Neuroimage 2008 &lt;br /&gt;
* [2] Peled S, Friman O, Jolesz F, Westin CF. Geometrically constrained two-tensor model for crossing tracts in DWI. Magnetic Resonance Imaging 2006;24:1263-1270.&lt;/div&gt;</summary>
		<author><name>Mseeland</name></author>
		
	</entry>
	<entry>
		<id>https://www.na-mic.org/w/index.php?title=Two-tensor_tractography_in_Slicer_using_Python_and_Teem&amp;diff=34738</id>
		<title>Two-tensor tractography in Slicer using Python and Teem</title>
		<link rel="alternate" type="text/html" href="https://www.na-mic.org/w/index.php?title=Two-tensor_tractography_in_Slicer_using_Python_and_Teem&amp;diff=34738"/>
		<updated>2009-01-09T13:23:20Z</updated>

		<summary type="html">&lt;p&gt;Mseeland: /* Key Investigators */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{|&lt;br /&gt;
|[[Image:NAMIC-SLC.jpg|thumb|320px|Return to [[2009_Winter_Project_Week|Project Week Main Page]] ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Key Investigators===&lt;br /&gt;
* BWH: Madeleine Seeland&lt;br /&gt;
* BWH: Carl-Fredrik Westin&lt;br /&gt;
* BWH: Gordon Kindlmann&lt;br /&gt;
* BWH: Nobuhiko Hata&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin: 20px;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 27%; float: left; padding-right: 3%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Objective&amp;lt;/h1&amp;gt;&lt;br /&gt;
Our objective is to finalize the integration of the Two-Tensor Streamline Tractography method in [1] into Slicer and to test it on diverse DWI datasets. Furthermore the optimal parameter settings to run the algorithm needs to be investigated.   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 27%; float: left; padding-right: 3%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Approach, Plan&amp;lt;/h1&amp;gt;&lt;br /&gt;
We are integrating the Two-Tensor Streamline Tractography into Slicer. The complete details on the method are summarized in [1].&lt;br /&gt;
&lt;br /&gt;
The implementation of our project is carried out in Python. The Two-Tensor Tractography function calls are already implemented in the Teem library and can be accessed using the Python wrappings for Teem.&lt;br /&gt;
&lt;br /&gt;
Besides the integration of the Two-Tensor Tractography algorithm into Slicer, the optimal parameter settings for the algorithm needs to be investigated.&lt;br /&gt;
&lt;br /&gt;
Furthermore we need to find a way to parallelize the tractography algorithm (one idea is to use IPython).&lt;br /&gt;
&lt;br /&gt;
Another plan is to apply a noise filter on the DWI's before applying the Two-Tensor Tractography algorithm, as this may lead to more accurate fiber results.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 40%; float: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Progress&amp;lt;/h1&amp;gt;&lt;br /&gt;
* The implementation of the Two-Tensor Tractography is already finished. Currently I'm testing the algorithm with different parameter settings.&lt;br /&gt;
&lt;br /&gt;
* Extension of the Two-Tensor Tractography module by fiudical seeding.&lt;br /&gt;
&lt;br /&gt;
* Working on using Grid Wizard Enterprise tool ([http://www.na-mic.org/Wiki/index.php/Engineering:UCSD]) to parallelize the execution of my algorithm (thanks to Marco Ruiz and Luca Antiga for helping me making this possible)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
* [1] Qazi AA, Radmanesh A, O'Donnell L, Kindlmann G, Peled S, Whalen S, Westin CF, Golby AJ. Resolving crossings in the corticospinal tract by two-tensor streamline tractography: method and clinical assessment using fMRI. Neuroimage 2008 &lt;br /&gt;
* [2] Peled S, Friman O, Jolesz F, Westin CF. Geometrically constrained two-tensor model for crossing tracts in DWI. Magnetic Resonance Imaging 2006;24:1263-1270.&lt;/div&gt;</summary>
		<author><name>Mseeland</name></author>
		
	</entry>
	<entry>
		<id>https://www.na-mic.org/w/index.php?title=Two-tensor_tractography_in_Slicer_using_Python_and_Teem&amp;diff=34737</id>
		<title>Two-tensor tractography in Slicer using Python and Teem</title>
		<link rel="alternate" type="text/html" href="https://www.na-mic.org/w/index.php?title=Two-tensor_tractography_in_Slicer_using_Python_and_Teem&amp;diff=34737"/>
		<updated>2009-01-09T13:22:22Z</updated>

		<summary type="html">&lt;p&gt;Mseeland: /* Key Investigators */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{|&lt;br /&gt;
|[[Image:NAMIC-SLC.jpg|thumb|320px|Return to [[2009_Winter_Project_Week|Project Week Main Page]] ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Key Investigators===&lt;br /&gt;
* BWH: Madeleine Seeland&lt;br /&gt;
* BWH: Carl-Fredrik Westin&lt;br /&gt;
* BWH: Gordon Kindlmann&lt;br /&gt;
* BWH: Nobuhiko Hata&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin: 20px;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 27%; float: left; padding-right: 3%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Objective&amp;lt;/h1&amp;gt;&lt;br /&gt;
Our objective is to finalize the integration of the Two-Tensor Streamline Tractography method in [1] into Slicer and to test it on diverse DWI datasets. Furthermore the optimal parameter settings to run the algorithm needs to be investigated.   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 27%; float: left; padding-right: 3%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Approach, Plan&amp;lt;/h1&amp;gt;&lt;br /&gt;
We are integrating the Two-Tensor Streamline Tractography into Slicer. The complete details on the method are summarized in [1].&lt;br /&gt;
&lt;br /&gt;
The implementation of our project is carried out in Python. The Two-Tensor Tractography function calls are already implemented in the Teem library and can be accessed using the Python wrappings for Teem.&lt;br /&gt;
&lt;br /&gt;
Besides the integration of the Two-Tensor Tractography algorithm into Slicer, the optimal parameter settings for the algorithm needs to be investigated.&lt;br /&gt;
&lt;br /&gt;
Furthermore we need to find a way to parallelize the tractography algorithm (one idea is to use IPython).&lt;br /&gt;
&lt;br /&gt;
Another plan is to apply a noise filter on the DWI's before applying the Two-Tensor Tractography algorithm, as this may lead to more accurate fiber results.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 40%; float: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Progress&amp;lt;/h1&amp;gt;&lt;br /&gt;
* The implementation of the Two-Tensor Tractography is already finished. Currently I'm testing the algorithm with different parameter settings.&lt;br /&gt;
&lt;br /&gt;
* Extension of the Two-Tensor Tractography module by fiudical seeding.&lt;br /&gt;
&lt;br /&gt;
* Working on using Grid Wizard Enterprise tool ([http://www.na-mic.org/Wiki/index.php/Engineering:UCSD]) to parallelize the execution of my algorithm (thanks to Marco Guiz and Luca Antiga for helping me making this possible)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
* [1] Qazi AA, Radmanesh A, O'Donnell L, Kindlmann G, Peled S, Whalen S, Westin CF, Golby AJ. Resolving crossings in the corticospinal tract by two-tensor streamline tractography: method and clinical assessment using fMRI. Neuroimage 2008 &lt;br /&gt;
* [2] Peled S, Friman O, Jolesz F, Westin CF. Geometrically constrained two-tensor model for crossing tracts in DWI. Magnetic Resonance Imaging 2006;24:1263-1270.&lt;/div&gt;</summary>
		<author><name>Mseeland</name></author>
		
	</entry>
	<entry>
		<id>https://www.na-mic.org/w/index.php?title=Two-tensor_tractography_in_Slicer_using_Python_and_Teem&amp;diff=34727</id>
		<title>Two-tensor tractography in Slicer using Python and Teem</title>
		<link rel="alternate" type="text/html" href="https://www.na-mic.org/w/index.php?title=Two-tensor_tractography_in_Slicer_using_Python_and_Teem&amp;diff=34727"/>
		<updated>2009-01-08T23:52:06Z</updated>

		<summary type="html">&lt;p&gt;Mseeland: /* Key Investigators */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{|&lt;br /&gt;
|[[Image:NAMIC-SLC.jpg|thumb|320px|Return to [[2009_Winter_Project_Week|Project Week Main Page]] ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Key Investigators===&lt;br /&gt;
* BWH: Madeleine Seeland&lt;br /&gt;
* BWH: Carl-Fredrik Westin&lt;br /&gt;
* BWH: Gordon Kindlmann&lt;br /&gt;
* BWH: Nobuhiko Hata&lt;br /&gt;
* Marco Ruiz&lt;br /&gt;
* Luca Antiga&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin: 20px;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 27%; float: left; padding-right: 3%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Objective&amp;lt;/h1&amp;gt;&lt;br /&gt;
Our objective is to finalize the integration of the Two-Tensor Streamline Tractography method in [1] into Slicer and to test it on diverse DWI datasets. Furthermore the optimal parameter settings to run the algorithm needs to be investigated.   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 27%; float: left; padding-right: 3%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Approach, Plan&amp;lt;/h1&amp;gt;&lt;br /&gt;
We are integrating the Two-Tensor Streamline Tractography into Slicer. The complete details on the method are summarized in [1].&lt;br /&gt;
&lt;br /&gt;
The implementation of our project is carried out in Python. The Two-Tensor Tractography function calls are already implemented in the Teem library and can be accessed using the Python wrappings for Teem.&lt;br /&gt;
&lt;br /&gt;
Besides the integration of the Two-Tensor Tractography algorithm into Slicer, the optimal parameter settings for the algorithm needs to be investigated.&lt;br /&gt;
&lt;br /&gt;
Furthermore we need to find a way to parallelize the tractography algorithm (one idea is to use IPython).&lt;br /&gt;
&lt;br /&gt;
Another plan is to apply a noise filter on the DWI's before applying the Two-Tensor Tractography algorithm, as this may lead to more accurate fiber results.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 40%; float: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Progress&amp;lt;/h1&amp;gt;&lt;br /&gt;
The implementation of the Two-Tensor Tractography is already finished. Currently I'm testing the algorithm with different parameter settings.&lt;br /&gt;
&lt;br /&gt;
Extension of the Two-Tensor Tractography module by fiudical seeding.&lt;br /&gt;
&lt;br /&gt;
Plan: to use Grid Wizard Enterprise tool ([http://www.na-mic.org/Wiki/index.php/Engineering:UCSD]) (with the help of Marco Ruiz) to parallelize the execution of my algorithm &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
* [1] Qazi AA, Radmanesh A, O'Donnell L, Kindlmann G, Peled S, Whalen S, Westin CF, Golby AJ. Resolving crossings in the corticospinal tract by two-tensor streamline tractography: method and clinical assessment using fMRI. Neuroimage 2008 &lt;br /&gt;
* [2] Peled S, Friman O, Jolesz F, Westin CF. Geometrically constrained two-tensor model for crossing tracts in DWI. Magnetic Resonance Imaging 2006;24:1263-1270.&lt;/div&gt;</summary>
		<author><name>Mseeland</name></author>
		
	</entry>
	<entry>
		<id>https://www.na-mic.org/w/index.php?title=Two-tensor_tractography_in_Slicer_using_Python_and_Teem&amp;diff=34726</id>
		<title>Two-tensor tractography in Slicer using Python and Teem</title>
		<link rel="alternate" type="text/html" href="https://www.na-mic.org/w/index.php?title=Two-tensor_tractography_in_Slicer_using_Python_and_Teem&amp;diff=34726"/>
		<updated>2009-01-08T23:51:54Z</updated>

		<summary type="html">&lt;p&gt;Mseeland: /* Key Investigators */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{|&lt;br /&gt;
|[[Image:NAMIC-SLC.jpg|thumb|320px|Return to [[2009_Winter_Project_Week|Project Week Main Page]] ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Key Investigators===&lt;br /&gt;
* BWH: Madeleine Seeland&lt;br /&gt;
* BWH: Carl-Fredrik Westin&lt;br /&gt;
* BWH: Gordon Kindlmann&lt;br /&gt;
* Nobuhiko Hata&lt;br /&gt;
* Marco Ruiz&lt;br /&gt;
* Luca Antiga&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin: 20px;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 27%; float: left; padding-right: 3%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Objective&amp;lt;/h1&amp;gt;&lt;br /&gt;
Our objective is to finalize the integration of the Two-Tensor Streamline Tractography method in [1] into Slicer and to test it on diverse DWI datasets. Furthermore the optimal parameter settings to run the algorithm needs to be investigated.   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 27%; float: left; padding-right: 3%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Approach, Plan&amp;lt;/h1&amp;gt;&lt;br /&gt;
We are integrating the Two-Tensor Streamline Tractography into Slicer. The complete details on the method are summarized in [1].&lt;br /&gt;
&lt;br /&gt;
The implementation of our project is carried out in Python. The Two-Tensor Tractography function calls are already implemented in the Teem library and can be accessed using the Python wrappings for Teem.&lt;br /&gt;
&lt;br /&gt;
Besides the integration of the Two-Tensor Tractography algorithm into Slicer, the optimal parameter settings for the algorithm needs to be investigated.&lt;br /&gt;
&lt;br /&gt;
Furthermore we need to find a way to parallelize the tractography algorithm (one idea is to use IPython).&lt;br /&gt;
&lt;br /&gt;
Another plan is to apply a noise filter on the DWI's before applying the Two-Tensor Tractography algorithm, as this may lead to more accurate fiber results.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 40%; float: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Progress&amp;lt;/h1&amp;gt;&lt;br /&gt;
The implementation of the Two-Tensor Tractography is already finished. Currently I'm testing the algorithm with different parameter settings.&lt;br /&gt;
&lt;br /&gt;
Extension of the Two-Tensor Tractography module by fiudical seeding.&lt;br /&gt;
&lt;br /&gt;
Plan: to use Grid Wizard Enterprise tool ([http://www.na-mic.org/Wiki/index.php/Engineering:UCSD]) (with the help of Marco Ruiz) to parallelize the execution of my algorithm &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
* [1] Qazi AA, Radmanesh A, O'Donnell L, Kindlmann G, Peled S, Whalen S, Westin CF, Golby AJ. Resolving crossings in the corticospinal tract by two-tensor streamline tractography: method and clinical assessment using fMRI. Neuroimage 2008 &lt;br /&gt;
* [2] Peled S, Friman O, Jolesz F, Westin CF. Geometrically constrained two-tensor model for crossing tracts in DWI. Magnetic Resonance Imaging 2006;24:1263-1270.&lt;/div&gt;</summary>
		<author><name>Mseeland</name></author>
		
	</entry>
	<entry>
		<id>https://www.na-mic.org/w/index.php?title=Two-tensor_tractography_in_Slicer_using_Python_and_Teem&amp;diff=34722</id>
		<title>Two-tensor tractography in Slicer using Python and Teem</title>
		<link rel="alternate" type="text/html" href="https://www.na-mic.org/w/index.php?title=Two-tensor_tractography_in_Slicer_using_Python_and_Teem&amp;diff=34722"/>
		<updated>2009-01-08T23:48:35Z</updated>

		<summary type="html">&lt;p&gt;Mseeland: /* Key Investigators */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{|&lt;br /&gt;
|[[Image:NAMIC-SLC.jpg|thumb|320px|Return to [[2009_Winter_Project_Week|Project Week Main Page]] ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Key Investigators===&lt;br /&gt;
* BWH: Madeleine Seeland&lt;br /&gt;
* BWH: Carl-Fredrik Westin&lt;br /&gt;
* BWH: Gordon Kindlmann&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin: 20px;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 27%; float: left; padding-right: 3%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Objective&amp;lt;/h1&amp;gt;&lt;br /&gt;
Our objective is to finalize the integration of the Two-Tensor Streamline Tractography method in [1] into Slicer and to test it on diverse DWI datasets. Furthermore the optimal parameter settings to run the algorithm needs to be investigated.   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 27%; float: left; padding-right: 3%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Approach, Plan&amp;lt;/h1&amp;gt;&lt;br /&gt;
We are integrating the Two-Tensor Streamline Tractography into Slicer. The complete details on the method are summarized in [1].&lt;br /&gt;
&lt;br /&gt;
The implementation of our project is carried out in Python. The Two-Tensor Tractography function calls are already implemented in the Teem library and can be accessed using the Python wrappings for Teem.&lt;br /&gt;
&lt;br /&gt;
Besides the integration of the Two-Tensor Tractography algorithm into Slicer, the optimal parameter settings for the algorithm needs to be investigated.&lt;br /&gt;
&lt;br /&gt;
Furthermore we need to find a way to parallelize the tractography algorithm (one idea is to use IPython).&lt;br /&gt;
&lt;br /&gt;
Another plan is to apply a noise filter on the DWI's before applying the Two-Tensor Tractography algorithm, as this may lead to more accurate fiber results.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 40%; float: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Progress&amp;lt;/h1&amp;gt;&lt;br /&gt;
The implementation of the Two-Tensor Tractography is already finished. Currently I'm testing the algorithm with different parameter settings.&lt;br /&gt;
&lt;br /&gt;
Extension of the Two-Tensor Tractography module by fiudical seeding.&lt;br /&gt;
&lt;br /&gt;
Plan: to use Grid Wizard Enterprise tool ([http://www.na-mic.org/Wiki/index.php/Engineering:UCSD]) (with the help of Marco Ruiz) to parallelize the execution of my algorithm &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
* [1] Qazi AA, Radmanesh A, O'Donnell L, Kindlmann G, Peled S, Whalen S, Westin CF, Golby AJ. Resolving crossings in the corticospinal tract by two-tensor streamline tractography: method and clinical assessment using fMRI. Neuroimage 2008 &lt;br /&gt;
* [2] Peled S, Friman O, Jolesz F, Westin CF. Geometrically constrained two-tensor model for crossing tracts in DWI. Magnetic Resonance Imaging 2006;24:1263-1270.&lt;/div&gt;</summary>
		<author><name>Mseeland</name></author>
		
	</entry>
	<entry>
		<id>https://www.na-mic.org/w/index.php?title=Two-tensor_tractography_in_Slicer_using_Python_and_Teem&amp;diff=34719</id>
		<title>Two-tensor tractography in Slicer using Python and Teem</title>
		<link rel="alternate" type="text/html" href="https://www.na-mic.org/w/index.php?title=Two-tensor_tractography_in_Slicer_using_Python_and_Teem&amp;diff=34719"/>
		<updated>2009-01-08T23:42:40Z</updated>

		<summary type="html">&lt;p&gt;Mseeland: /* Key Investigators */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{|&lt;br /&gt;
|[[Image:NAMIC-SLC.jpg|thumb|320px|Return to [[2009_Winter_Project_Week|Project Week Main Page]] ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Key Investigators===&lt;br /&gt;
* BWH: Madeleine Seeland&lt;br /&gt;
* BWH: Carl-Fredrik Westin&lt;br /&gt;
* BWH: Gordon Kindlmann&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin: 20px;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 27%; float: left; padding-right: 3%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Objective&amp;lt;/h1&amp;gt;&lt;br /&gt;
Our objective is to finalize the integration of the Two-Tensor Streamline Tractography method in [1] into Slicer and to test it on diverse DWI datasets. Furthermore the optimal parameter settings to run the algorithm needs to be investigated.   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 27%; float: left; padding-right: 3%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Approach, Plan&amp;lt;/h1&amp;gt;&lt;br /&gt;
We are integrating the Two-Tensor Streamline Tractography into Slicer. The complete details on the method are summarized in [1].&lt;br /&gt;
&lt;br /&gt;
The implementation of our project is carried out in Python. The Two-Tensor Tractography function calls are already implemented in the Teem library and can be accessed using the Python wrappings for Teem.&lt;br /&gt;
&lt;br /&gt;
Besides the integration of the Two-Tensor Tractography algorithm into Slicer, the optimal parameter settings for the algorithm needs to be investigated.&lt;br /&gt;
&lt;br /&gt;
Furthermore we need to find a way to parallelize the tractography algorithm (one idea is to use IPython).&lt;br /&gt;
&lt;br /&gt;
Another plan is to apply a noise filter on the DWI's before applying the Two-Tensor Tractography algorithm, as this may lead to more accurate fiber results.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 40%; float: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Progress&amp;lt;/h1&amp;gt;&lt;br /&gt;
The implementation of the Two-Tensor Tractography is already finished. Currently I'm testing the algorithm with different parameter settings.&lt;br /&gt;
&lt;br /&gt;
Extension of the Two-Tensor Tractography module by fiudical seeding.&lt;br /&gt;
&lt;br /&gt;
Plan: to use Grid Wizard Enterprise tool (with the help of Marco Ruiz) to parallelize the execution of my algorithm &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
* [1] Qazi AA, Radmanesh A, O'Donnell L, Kindlmann G, Peled S, Whalen S, Westin CF, Golby AJ. Resolving crossings in the corticospinal tract by two-tensor streamline tractography: method and clinical assessment using fMRI. Neuroimage 2008 &lt;br /&gt;
* [2] Peled S, Friman O, Jolesz F, Westin CF. Geometrically constrained two-tensor model for crossing tracts in DWI. Magnetic Resonance Imaging 2006;24:1263-1270.&lt;/div&gt;</summary>
		<author><name>Mseeland</name></author>
		
	</entry>
	<entry>
		<id>https://www.na-mic.org/w/index.php?title=Two-tensor_tractography_in_Slicer_using_Python_and_Teem&amp;diff=34718</id>
		<title>Two-tensor tractography in Slicer using Python and Teem</title>
		<link rel="alternate" type="text/html" href="https://www.na-mic.org/w/index.php?title=Two-tensor_tractography_in_Slicer_using_Python_and_Teem&amp;diff=34718"/>
		<updated>2009-01-08T23:39:16Z</updated>

		<summary type="html">&lt;p&gt;Mseeland: /* Key Investigators */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{|&lt;br /&gt;
|[[Image:NAMIC-SLC.jpg|thumb|320px|Return to [[2009_Winter_Project_Week|Project Week Main Page]] ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Key Investigators===&lt;br /&gt;
* BWH: Madeleine Seeland&lt;br /&gt;
* BWH: Carl-Fredrik Westin&lt;br /&gt;
* BWH: Gordon Kindlmann&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin: 20px;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 27%; float: left; padding-right: 3%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Objective&amp;lt;/h1&amp;gt;&lt;br /&gt;
Our objective is to finalize the integration of the Two-Tensor Streamline Tractography method in [1] into Slicer and to test it on diverse DWI datasets. Furthermore the optimal parameter settings to run the algorithm needs to be investigated.   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 27%; float: left; padding-right: 3%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Approach, Plan&amp;lt;/h1&amp;gt;&lt;br /&gt;
We are integrating the Two-Tensor Streamline Tractography into Slicer. The complete details on the method are summarized in [1].&lt;br /&gt;
&lt;br /&gt;
The implementation of our project is carried out in Python. The Two-Tensor Tractography function calls are already implemented in the Teem library and can be accessed using the Python wrappings for Teem.&lt;br /&gt;
&lt;br /&gt;
Besides the integration of the Two-Tensor Tractography algorithm into Slicer, the optimal parameter settings for the algorithm needs to be investigated.&lt;br /&gt;
&lt;br /&gt;
Furthermore we need to find a way to parallelize the tractography algorithm (one idea is to use IPython).&lt;br /&gt;
&lt;br /&gt;
Another plan is to apply a noise filter on the DWI's before applying the Two-Tensor Tractography algorithm, as this may lead to more accurate fiber results.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 40%; float: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Progress&amp;lt;/h1&amp;gt;&lt;br /&gt;
The implementation of the Two-Tensor Tractography is already finished. Currently I'm testing the algorithm with different parameter settings.&lt;br /&gt;
&lt;br /&gt;
Extension of the Two-Tensor Tractography module by fiudical seeding.&lt;br /&gt;
&lt;br /&gt;
Plan: use Grid Wizard Enterprise tool (with the help of Marco Ruiz) to parallelize the execution of my algorithm &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
* [1] Qazi AA, Radmanesh A, O'Donnell L, Kindlmann G, Peled S, Whalen S, Westin CF, Golby AJ. Resolving crossings in the corticospinal tract by two-tensor streamline tractography: method and clinical assessment using fMRI. Neuroimage 2008 &lt;br /&gt;
* [2] Peled S, Friman O, Jolesz F, Westin CF. Geometrically constrained two-tensor model for crossing tracts in DWI. Magnetic Resonance Imaging 2006;24:1263-1270.&lt;/div&gt;</summary>
		<author><name>Mseeland</name></author>
		
	</entry>
	<entry>
		<id>https://www.na-mic.org/w/index.php?title=Two-tensor_tractography_in_Slicer_using_Python_and_Teem&amp;diff=34712</id>
		<title>Two-tensor tractography in Slicer using Python and Teem</title>
		<link rel="alternate" type="text/html" href="https://www.na-mic.org/w/index.php?title=Two-tensor_tractography_in_Slicer_using_Python_and_Teem&amp;diff=34712"/>
		<updated>2009-01-08T23:22:23Z</updated>

		<summary type="html">&lt;p&gt;Mseeland: /* Key Investigators */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{|&lt;br /&gt;
|[[Image:NAMIC-SLC.jpg|thumb|320px|Return to [[2009_Winter_Project_Week|Project Week Main Page]] ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Key Investigators===&lt;br /&gt;
* BWH: Madeleine Seeland&lt;br /&gt;
* BWH: Carl-Fredrik Westin&lt;br /&gt;
* BWH: Gordon Kindlmann&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin: 20px;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 27%; float: left; padding-right: 3%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Objective&amp;lt;/h1&amp;gt;&lt;br /&gt;
Our objective is to finalize the integration of the Two-Tensor Streamline Tractography method in [1] into Slicer and to test it on diverse DWI datasets. Furthermore the optimal parameter settings to run the algorithm needs to be investigated.   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 27%; float: left; padding-right: 3%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Approach, Plan&amp;lt;/h1&amp;gt;&lt;br /&gt;
We are integrating the Two-Tensor Streamline Tractography into Slicer. The complete details on the method are summarized in [1].&lt;br /&gt;
&lt;br /&gt;
The implementation of our project is carried out in Python. The Two-Tensor Tractography function calls are already implemented in the Teem library and can be accessed using the Python wrappings for Teem.&lt;br /&gt;
&lt;br /&gt;
Besides the integration of the Two-Tensor Tractography algorithm into Slicer, the optimal parameter settings for the algorithm needs to be investigated.&lt;br /&gt;
&lt;br /&gt;
Furthermore we need to find a way to parallelize the tractography algorithm (one idea is to use IPython).&lt;br /&gt;
&lt;br /&gt;
Another plan is to apply a noise filter on the DWI's before applying the Two-Tensor Tractography algorithm, as this may lead to more accurate fiber results.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 40%; float: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Progress&amp;lt;/h1&amp;gt;&lt;br /&gt;
The implementation of the Two-Tensor Tractography is already finished. Currently I'm testing the algorithm with different parameter settings.&lt;br /&gt;
&lt;br /&gt;
Extension of the Two-Tensor Tractography module by fiudical seeding.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
* [1] Qazi AA, Radmanesh A, O'Donnell L, Kindlmann G, Peled S, Whalen S, Westin CF, Golby AJ. Resolving crossings in the corticospinal tract by two-tensor streamline tractography: method and clinical assessment using fMRI. Neuroimage 2008 &lt;br /&gt;
* [2] Peled S, Friman O, Jolesz F, Westin CF. Geometrically constrained two-tensor model for crossing tracts in DWI. Magnetic Resonance Imaging 2006;24:1263-1270.&lt;/div&gt;</summary>
		<author><name>Mseeland</name></author>
		
	</entry>
	<entry>
		<id>https://www.na-mic.org/w/index.php?title=User:Mseeland&amp;diff=34665</id>
		<title>User:Mseeland</title>
		<link rel="alternate" type="text/html" href="https://www.na-mic.org/w/index.php?title=User:Mseeland&amp;diff=34665"/>
		<updated>2009-01-08T19:25:00Z</updated>

		<summary type="html">&lt;p&gt;Mseeland: /* Status/Progress */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Wiki of Madeleine Seeland =&lt;br /&gt;
&lt;br /&gt;
== General Information ==&lt;br /&gt;
&lt;br /&gt;
===About myself===&lt;br /&gt;
I am a grad student of Management Information Systems at the University of Mannheim, Germany. I'm involved in the Diffusion Tensor Imaging (DTI) project in the Laboratory of Mathematics in Imaging. Currently I'm working on two-tensor tractograohy for Neurosurgery. I will document my research experience as a diploma thesis, which I need for completing my studies in Germany.&lt;br /&gt;
&lt;br /&gt;
===Contact information===&lt;br /&gt;
E-mail: mseeland (at sign) bwh.harvard.edu&lt;br /&gt;
&lt;br /&gt;
===Collaborators &amp;amp; Contacts===&lt;br /&gt;
* Supervisors: C-F Westin, Nobuhiko Hata&lt;br /&gt;
* Gordon  Kindlmann (Teem)&lt;br /&gt;
* Sharon Peled&lt;br /&gt;
* Alireza Radmanesh&lt;br /&gt;
* Isaiah Norton&lt;br /&gt;
* Regarding Python: Steve Pieper, Julien de Siebenthal, Sylvain Bouix, Demian Wassermann, Luca Antiga&lt;br /&gt;
&lt;br /&gt;
==Project: Two-Tensor Tractography integration into Slicer==&lt;br /&gt;
&lt;br /&gt;
===Project Description===&lt;br /&gt;
*  Integration of Two-Tensor Tractography into Slicer using Python&lt;br /&gt;
*  Use of existing tractography methods in Teem (http://teem.sourceforge.net/)&lt;br /&gt;
*  My part: Interface between Python and Slicer&lt;br /&gt;
** pass data from VTK to Python to Teem&lt;br /&gt;
** make use of Teem tractography function calls&lt;br /&gt;
** pass resulting fiber data from Teem to Python to VTK and display fiber tracts in Slicer  &lt;br /&gt;
*  The Teem Python API will be provided by Gordon Kindlmann&lt;br /&gt;
&lt;br /&gt;
===How to enable Python in Slicer 3.3===&lt;br /&gt;
*  The current version of Slicer, Slicer 3.2, does not support Python. In order to use Python you need to install Slicer 3.3.&lt;br /&gt;
&lt;br /&gt;
*  To build Slicer Version 3.3, just do the following two commands:&lt;br /&gt;
  svn co http://svn.slicer.org/Slicer3/trunk Slicer3&lt;br /&gt;
  ./Slicer3/Scripts/getbuildtest.tcl&lt;br /&gt;
&lt;br /&gt;
*  In Slicer 3.3, Python support is disabled by default. In order to enable Python, just follow the next steps:&lt;br /&gt;
&lt;br /&gt;
# Edit slicer_variables.tcl&lt;br /&gt;
## Change &amp;quot;set ::USE_PYTHON &amp;quot;off&amp;quot;&amp;quot; to &amp;quot;on&amp;quot;&lt;br /&gt;
# '''Optional:''' If you prefer to use your system Python installation, see here: [http://www.slicer.org/slicerWiki/index.php/Slicer3::Python] &lt;br /&gt;
# '''Optional:''' installing SciPy, see here: [http://www.slicer.org/slicerWiki/index.php/Slicer3::Python]. However, there are still problems adding scipy in Slicer, whcih are not fixed yet.&lt;br /&gt;
&lt;br /&gt;
*  Rebuild Slicer3 using &amp;quot;getbuildtest.tcl&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 ./Slicer3/Scripts/getbuildtest.tcl&lt;br /&gt;
&lt;br /&gt;
A new menu command '''Python Interpreter''' should appear on the Window menu in Slicer. This command should bring up the Python Console window.&lt;br /&gt;
&lt;br /&gt;
===Teem Python wrapping===&lt;br /&gt;
&lt;br /&gt;
====BACKGROUND====&lt;br /&gt;
* Teem Python wrapping is needed to make use of existing Two-Tensor tractography functions in Teem in Python&lt;br /&gt;
* The Python wrappings are based on ctypes, as well as a ctypes code generator (called &amp;quot;ctypeslib&amp;quot;)&lt;br /&gt;
** http://python.net/crew/theller/ctypes&lt;br /&gt;
** http://starship.python.net/crew/theller/wiki/CodeGenerator&lt;br /&gt;
** http://starship.python.net/crew/theller/ctypes/old/codegen.html&lt;br /&gt;
* Ctypes is a standard part of python, by which C functions in a shared library can be called from Python&lt;br /&gt;
* The ctypes code generator converts declarations in C header files into executable Python code: enums, structs, unions, function declarations, com interfaces, and preprocessor definitions.&lt;br /&gt;
* Creating wrappers for C header file(s) is a two step process. &lt;br /&gt;
** First, the ``h2xml.py`` script runs GCC-XML_ over the include file(s), creating a XML file containing declarations and definitions.  &lt;br /&gt;
** Second, the ``xml2py.py`` script parses the XML files and creates Python code containing all or a subset of these definitions.&lt;br /&gt;
* Python code is generated for C enums, structure, unions, typedefs and function declarations.&lt;br /&gt;
&lt;br /&gt;
====REQUIREMENTS====&lt;br /&gt;
* Ctypeslib: ctypeslib is an extension package for ctypes. It contains a ctypes code generator.&lt;br /&gt;
* GCC-XML (from http://www.gccxml.org/) is required to parse C header files into an XML description.&lt;br /&gt;
&lt;br /&gt;
====GETTING THE SOFTWARE====&lt;br /&gt;
* Python 2.6 can be got here (anything after 2.5 should work): http://www.python.org/download/&lt;br /&gt;
* Get gccxml (I used version 0.9.0), which can be got by CVS as described here: http://www.gccxml.org/HTML/Download.html&lt;br /&gt;
** follow the installation as described here: http://www.gccxml.org/HTML/Install.html&lt;br /&gt;
* use a version of ctypeslib which work with the version of gccxml: &lt;br /&gt;
  http://svn.python.org/projects/ctypes/branches/ctypeslib-gccxml-0.9&lt;br /&gt;
* But this requires some patches to work; the content of the &amp;quot;fixes.patch&amp;quot; file can be found here: [[http://wiki.na-mic.org/Wiki/images/3/3b/Fixes.patch.txt]]:&lt;br /&gt;
   svn co http://svn.python.org/projects/ctypes/branches/ctypeslib-gccxml-0.9&lt;br /&gt;
   cd ctypeslib-gccxml-0.9&lt;br /&gt;
   patch -p0 &amp;lt; ../fixes.patch&lt;br /&gt;
   cd ..&lt;br /&gt;
* ctypeslib is written in python =&amp;gt; there's nothing new to compile at this point&lt;br /&gt;
&lt;br /&gt;
====CREATING PYTHON/TEEM====&lt;br /&gt;
* First get Teem (starting from whatever directory should contain the &amp;quot;teem&amp;quot; source dir):&lt;br /&gt;
  svn co https://teem.svn.sourceforge.net/svnroot/teem/teem/trunk teem&lt;br /&gt;
and compile it as a shared library.  Directions for doing this with cmake are here:&lt;br /&gt;
  http://teem.sourceforge.net/build.html&lt;br /&gt;
* create the wrappings in a new directory (e.g. &amp;quot;teem-wrap&amp;quot;), where the XML and Python output will be&lt;br /&gt;
* Set the environment variables that identify where Teem and ctypeslib are:&lt;br /&gt;
** TEEM is where Teem's &amp;quot;make install&amp;quot; put subdirectories &amp;quot;bin&amp;quot;, &amp;quot;lib&amp;quot;, and &amp;quot;include&amp;quot; (e.g. ~/teem-build)&lt;br /&gt;
** CTYPES is the full path of ctypeslib-gccxml-0.9&lt;br /&gt;
* First create (in, for example, &amp;quot;teem-wrap&amp;quot;) a meta-header for all the Teem header files (in tcsh):&lt;br /&gt;
   mkdir teemincl&lt;br /&gt;
   cp -r ${TEEM}/include/teem teemincl&lt;br /&gt;
   cd teemincl&lt;br /&gt;
   ls -1 teem/*.h | awk '{print &amp;quot;#include &amp;lt;&amp;quot;$1&amp;quot;&amp;gt;&amp;quot;}' &amp;gt; all.h&lt;br /&gt;
   cd ..&lt;br /&gt;
* Then create teem.xml:&lt;br /&gt;
   setenv PYTHONPATH $CTYPES&lt;br /&gt;
   python $CTYPES/scripts/h2xml.py `pwd`/teemincl/all.h -I teemincl -o teem.xml &lt;br /&gt;
* Then create teem.py (use DYLD_LIBRARY_PATH in a mac):&lt;br /&gt;
   setenv LD_LIBRARY_PATH ${TEEM}/lib&lt;br /&gt;
   python $CTYPES/scripts/xml2py.py teem.xml -llibteem.so -o teem.py \&lt;br /&gt;
        -r &amp;quot;(air|hest|biff|nrrd|ell|unrrdu|moss|gage|bane|limn|seek|hoover|echo|ten|dye|mite).*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===LEVMAR===&lt;br /&gt;
&lt;br /&gt;
* The 2-tensor tractography depends on Levenberg-Marquardt nonlinear optimization of Sharon Peled's constrained two-tensor model. I used the following implementation for it: http://www.ics.forth.gr/~lourakis/levmar/&lt;br /&gt;
* This code is enabled by compiling Teem with TEEM_LEVMAR defined. The include paths and library link paths need also be defined for everything to work.&lt;br /&gt;
* There are problems compiling LEVMAR with cmake. I found no way to create a build of levmar that allows Teem to say in Teem's CMakeLists.txt simply: FIND_PACKAGE(LEVMAR)). Therefore I compiled levmar myself and then changed Teem's CMake stuff so that the user sets the Teem_LEVMAR_LIB and Teem_LEVMAR_IPATH variables directly (so that the user does by hand what's normally done by &amp;quot;FIND_PACKAGE(LEVMAR)&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
==Status/Progress==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=0&lt;br /&gt;
|- bgcolor=&amp;quot;#abcdef&amp;quot;&lt;br /&gt;
! Month !! Week #  !! Start Date - End Date !! Done !! Date Done&lt;br /&gt;
|-&lt;br /&gt;
|height=5|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Find optimal parameter setting of the Two-Tensor Tractography method ||align=&amp;quot;center&amp;quot; |  || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Extend Two-Tensor Tractography module by fiducial seeding ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | NA-MIC Project Week in Salt Lake City ([http://www.na-mic.org/Wiki/index.php/2009_Winter_Project_Week],[http://www.na-mic.org/Wiki/index.php/Two-tensor_tractography_in_Slicer_using_Python_and_Teem]) ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! January !!  | Week 2 || 05.01 - 11.01 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | IGT Project Week ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 50 || 08.12 - 14.12 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! December !!  | Week 49 || 01.12 - 07.12 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to compile teem with levmar (= Levenberg-Marquardt nonlinear least squares algorithm) ||align=&amp;quot;center&amp;quot; | x || Mon Dec, 1st&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 48 !! 24.11 - 30.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | document the results of the two-tensor tractography given a tensor volume ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to do mutli trace tractography given a DWI volume ||align=&amp;quot;center&amp;quot; | x || Mon Nov, 17th&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 47 !! 17.11 - 23.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Working on Python tractography module for multi fiber tracing given a tensor volume ||align=&amp;quot;center&amp;quot; | x || Mon Nov, 17th&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 46 !! 10.11 - 16.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Get vertex data out of the nvert nrrd filled by the tractography back to Slicer ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to pass image data from Python to Teem through nrrdWrap_nva function ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to generate a list of point locations that were used as tractography seedpoints in the VTK tractography ||align=&amp;quot;center&amp;quot; | x || Thu Nov, 13th&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Implement Python tractography module for single fiber tracing given a seeding starting point and a tensor volume ||align=&amp;quot;center&amp;quot; | x || Fri, Nov, 7th&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 45 || 03.11 - 09.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to get image data from numpy (= Python package) to Teem nrrd struct ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! November !!  | Week 44 || 27.10 - 02.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;20px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to get image data from numpy (= Python package) to Teem nrrd struct ||align=&amp;quot;center&amp;quot; | x ||&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !!  Week 43 || 20.10 - 26.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to access DWI volumes through Python ||align=&amp;quot;center&amp;quot; | x || Fri Oct, 17th&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Get Teem wrapped in Python ||align=&amp;quot;center&amp;quot; | x || Fri Oct, 19th&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 42 || 13.10 - 19.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Try to implement the seeding part of the (VTK) one-tensor tractography module in Python || align=&amp;quot;center&amp;quot; | x || Tue Oct, 14th&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 41 || 06.10 - 12.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
|height=10|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Try to implement the seeding part of the (VTK) one-tensor tractography module in Python || align=&amp;quot;center&amp;quot; | x || Tue Oct, 14th&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! October !!  Week 40 || 29.09 - 5.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;20px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; |Totally understand existing Python modules in Slicer || align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; |understand existing one-tensor streamline tractography in Slicer (VTK) || align=&amp;quot;center&amp;quot; | x || Tue Sep, 23rd &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Totally understand existing Python modules in Slicer ||align=&amp;quot;center&amp;quot; | x || Tue Sep, 23rd&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !!  Week 39 || 22.09 - 28.09 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; | Slicer &amp;amp; Python Tutorials || align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; | Enable Python in Slicer || align=&amp;quot;center&amp;quot; | x || Mon Sep, 22nd&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot; &lt;br /&gt;
! September !! Week 38 || 14.09 - 21.09 || ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Information==&lt;br /&gt;
* Diffusion Tensor Analysis in Slicer: http://www.na-mic.org/Wiki/images/0/04/Slicer3diffusionTutorial7.pdf&lt;br /&gt;
* Building a Slicer 3 Module GUI: http://www.slicer.org/pages/Building_a_Slicer_3_Module_GUI&lt;br /&gt;
&lt;br /&gt;
Python:&lt;br /&gt;
* SlicerWiki about Python: http://www.slicer.org/slicerWiki/index.php/Slicer3::Python&lt;br /&gt;
* Python example modules in Slicer: http://www.slicer.org/slicerWiki/index.php/Slicer3:Execution_Model_Documentation:Python&lt;/div&gt;</summary>
		<author><name>Mseeland</name></author>
		
	</entry>
	<entry>
		<id>https://www.na-mic.org/w/index.php?title=User:Mseeland&amp;diff=34664</id>
		<title>User:Mseeland</title>
		<link rel="alternate" type="text/html" href="https://www.na-mic.org/w/index.php?title=User:Mseeland&amp;diff=34664"/>
		<updated>2009-01-08T19:23:01Z</updated>

		<summary type="html">&lt;p&gt;Mseeland: /* Collaborators &amp;amp; Contacts */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Wiki of Madeleine Seeland =&lt;br /&gt;
&lt;br /&gt;
== General Information ==&lt;br /&gt;
&lt;br /&gt;
===About myself===&lt;br /&gt;
I am a grad student of Management Information Systems at the University of Mannheim, Germany. I'm involved in the Diffusion Tensor Imaging (DTI) project in the Laboratory of Mathematics in Imaging. Currently I'm working on two-tensor tractograohy for Neurosurgery. I will document my research experience as a diploma thesis, which I need for completing my studies in Germany.&lt;br /&gt;
&lt;br /&gt;
===Contact information===&lt;br /&gt;
E-mail: mseeland (at sign) bwh.harvard.edu&lt;br /&gt;
&lt;br /&gt;
===Collaborators &amp;amp; Contacts===&lt;br /&gt;
* Supervisors: C-F Westin, Nobuhiko Hata&lt;br /&gt;
* Gordon  Kindlmann (Teem)&lt;br /&gt;
* Sharon Peled&lt;br /&gt;
* Alireza Radmanesh&lt;br /&gt;
* Isaiah Norton&lt;br /&gt;
* Regarding Python: Steve Pieper, Julien de Siebenthal, Sylvain Bouix, Demian Wassermann, Luca Antiga&lt;br /&gt;
&lt;br /&gt;
==Project: Two-Tensor Tractography integration into Slicer==&lt;br /&gt;
&lt;br /&gt;
===Project Description===&lt;br /&gt;
*  Integration of Two-Tensor Tractography into Slicer using Python&lt;br /&gt;
*  Use of existing tractography methods in Teem (http://teem.sourceforge.net/)&lt;br /&gt;
*  My part: Interface between Python and Slicer&lt;br /&gt;
** pass data from VTK to Python to Teem&lt;br /&gt;
** make use of Teem tractography function calls&lt;br /&gt;
** pass resulting fiber data from Teem to Python to VTK and display fiber tracts in Slicer  &lt;br /&gt;
*  The Teem Python API will be provided by Gordon Kindlmann&lt;br /&gt;
&lt;br /&gt;
===How to enable Python in Slicer 3.3===&lt;br /&gt;
*  The current version of Slicer, Slicer 3.2, does not support Python. In order to use Python you need to install Slicer 3.3.&lt;br /&gt;
&lt;br /&gt;
*  To build Slicer Version 3.3, just do the following two commands:&lt;br /&gt;
  svn co http://svn.slicer.org/Slicer3/trunk Slicer3&lt;br /&gt;
  ./Slicer3/Scripts/getbuildtest.tcl&lt;br /&gt;
&lt;br /&gt;
*  In Slicer 3.3, Python support is disabled by default. In order to enable Python, just follow the next steps:&lt;br /&gt;
&lt;br /&gt;
# Edit slicer_variables.tcl&lt;br /&gt;
## Change &amp;quot;set ::USE_PYTHON &amp;quot;off&amp;quot;&amp;quot; to &amp;quot;on&amp;quot;&lt;br /&gt;
# '''Optional:''' If you prefer to use your system Python installation, see here: [http://www.slicer.org/slicerWiki/index.php/Slicer3::Python] &lt;br /&gt;
# '''Optional:''' installing SciPy, see here: [http://www.slicer.org/slicerWiki/index.php/Slicer3::Python]. However, there are still problems adding scipy in Slicer, whcih are not fixed yet.&lt;br /&gt;
&lt;br /&gt;
*  Rebuild Slicer3 using &amp;quot;getbuildtest.tcl&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 ./Slicer3/Scripts/getbuildtest.tcl&lt;br /&gt;
&lt;br /&gt;
A new menu command '''Python Interpreter''' should appear on the Window menu in Slicer. This command should bring up the Python Console window.&lt;br /&gt;
&lt;br /&gt;
===Teem Python wrapping===&lt;br /&gt;
&lt;br /&gt;
====BACKGROUND====&lt;br /&gt;
* Teem Python wrapping is needed to make use of existing Two-Tensor tractography functions in Teem in Python&lt;br /&gt;
* The Python wrappings are based on ctypes, as well as a ctypes code generator (called &amp;quot;ctypeslib&amp;quot;)&lt;br /&gt;
** http://python.net/crew/theller/ctypes&lt;br /&gt;
** http://starship.python.net/crew/theller/wiki/CodeGenerator&lt;br /&gt;
** http://starship.python.net/crew/theller/ctypes/old/codegen.html&lt;br /&gt;
* Ctypes is a standard part of python, by which C functions in a shared library can be called from Python&lt;br /&gt;
* The ctypes code generator converts declarations in C header files into executable Python code: enums, structs, unions, function declarations, com interfaces, and preprocessor definitions.&lt;br /&gt;
* Creating wrappers for C header file(s) is a two step process. &lt;br /&gt;
** First, the ``h2xml.py`` script runs GCC-XML_ over the include file(s), creating a XML file containing declarations and definitions.  &lt;br /&gt;
** Second, the ``xml2py.py`` script parses the XML files and creates Python code containing all or a subset of these definitions.&lt;br /&gt;
* Python code is generated for C enums, structure, unions, typedefs and function declarations.&lt;br /&gt;
&lt;br /&gt;
====REQUIREMENTS====&lt;br /&gt;
* Ctypeslib: ctypeslib is an extension package for ctypes. It contains a ctypes code generator.&lt;br /&gt;
* GCC-XML (from http://www.gccxml.org/) is required to parse C header files into an XML description.&lt;br /&gt;
&lt;br /&gt;
====GETTING THE SOFTWARE====&lt;br /&gt;
* Python 2.6 can be got here (anything after 2.5 should work): http://www.python.org/download/&lt;br /&gt;
* Get gccxml (I used version 0.9.0), which can be got by CVS as described here: http://www.gccxml.org/HTML/Download.html&lt;br /&gt;
** follow the installation as described here: http://www.gccxml.org/HTML/Install.html&lt;br /&gt;
* use a version of ctypeslib which work with the version of gccxml: &lt;br /&gt;
  http://svn.python.org/projects/ctypes/branches/ctypeslib-gccxml-0.9&lt;br /&gt;
* But this requires some patches to work; the content of the &amp;quot;fixes.patch&amp;quot; file can be found here: [[http://wiki.na-mic.org/Wiki/images/3/3b/Fixes.patch.txt]]:&lt;br /&gt;
   svn co http://svn.python.org/projects/ctypes/branches/ctypeslib-gccxml-0.9&lt;br /&gt;
   cd ctypeslib-gccxml-0.9&lt;br /&gt;
   patch -p0 &amp;lt; ../fixes.patch&lt;br /&gt;
   cd ..&lt;br /&gt;
* ctypeslib is written in python =&amp;gt; there's nothing new to compile at this point&lt;br /&gt;
&lt;br /&gt;
====CREATING PYTHON/TEEM====&lt;br /&gt;
* First get Teem (starting from whatever directory should contain the &amp;quot;teem&amp;quot; source dir):&lt;br /&gt;
  svn co https://teem.svn.sourceforge.net/svnroot/teem/teem/trunk teem&lt;br /&gt;
and compile it as a shared library.  Directions for doing this with cmake are here:&lt;br /&gt;
  http://teem.sourceforge.net/build.html&lt;br /&gt;
* create the wrappings in a new directory (e.g. &amp;quot;teem-wrap&amp;quot;), where the XML and Python output will be&lt;br /&gt;
* Set the environment variables that identify where Teem and ctypeslib are:&lt;br /&gt;
** TEEM is where Teem's &amp;quot;make install&amp;quot; put subdirectories &amp;quot;bin&amp;quot;, &amp;quot;lib&amp;quot;, and &amp;quot;include&amp;quot; (e.g. ~/teem-build)&lt;br /&gt;
** CTYPES is the full path of ctypeslib-gccxml-0.9&lt;br /&gt;
* First create (in, for example, &amp;quot;teem-wrap&amp;quot;) a meta-header for all the Teem header files (in tcsh):&lt;br /&gt;
   mkdir teemincl&lt;br /&gt;
   cp -r ${TEEM}/include/teem teemincl&lt;br /&gt;
   cd teemincl&lt;br /&gt;
   ls -1 teem/*.h | awk '{print &amp;quot;#include &amp;lt;&amp;quot;$1&amp;quot;&amp;gt;&amp;quot;}' &amp;gt; all.h&lt;br /&gt;
   cd ..&lt;br /&gt;
* Then create teem.xml:&lt;br /&gt;
   setenv PYTHONPATH $CTYPES&lt;br /&gt;
   python $CTYPES/scripts/h2xml.py `pwd`/teemincl/all.h -I teemincl -o teem.xml &lt;br /&gt;
* Then create teem.py (use DYLD_LIBRARY_PATH in a mac):&lt;br /&gt;
   setenv LD_LIBRARY_PATH ${TEEM}/lib&lt;br /&gt;
   python $CTYPES/scripts/xml2py.py teem.xml -llibteem.so -o teem.py \&lt;br /&gt;
        -r &amp;quot;(air|hest|biff|nrrd|ell|unrrdu|moss|gage|bane|limn|seek|hoover|echo|ten|dye|mite).*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===LEVMAR===&lt;br /&gt;
&lt;br /&gt;
* The 2-tensor tractography depends on Levenberg-Marquardt nonlinear optimization of Sharon Peled's constrained two-tensor model. I used the following implementation for it: http://www.ics.forth.gr/~lourakis/levmar/&lt;br /&gt;
* This code is enabled by compiling Teem with TEEM_LEVMAR defined. The include paths and library link paths need also be defined for everything to work.&lt;br /&gt;
* There are problems compiling LEVMAR with cmake. I found no way to create a build of levmar that allows Teem to say in Teem's CMakeLists.txt simply: FIND_PACKAGE(LEVMAR)). Therefore I compiled levmar myself and then changed Teem's CMake stuff so that the user sets the Teem_LEVMAR_LIB and Teem_LEVMAR_IPATH variables directly (so that the user does by hand what's normally done by &amp;quot;FIND_PACKAGE(LEVMAR)&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
==Status/Progress==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=0&lt;br /&gt;
|- bgcolor=&amp;quot;#abcdef&amp;quot;&lt;br /&gt;
! Month !! Week #  !! Start Date - End Date !! Done !! Date Done&lt;br /&gt;
|-&lt;br /&gt;
|height=5|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Find optimal parameter setting of the Two-Tensor Tractography method ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Extend Two-Tensor Tractography module by fiducial seeding ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | NA-MIC Project Week in Salt Lake City ([http://www.na-mic.org/Wiki/index.php/2009_Winter_Project_Week],[http://www.na-mic.org/Wiki/index.php/Two-tensor_tractography_in_Slicer_using_Python_and_Teem]) ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! January !!  | Week 2 || 05.01 - 11.01 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | IGT Project Week ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 50 || 08.12 - 14.12 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! December !!  | Week 49 || 01.12 - 07.12 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to compile teem with levmar (= Levenberg-Marquardt nonlinear least squares algorithm) ||align=&amp;quot;center&amp;quot; | x || Mon Dec, 1st&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 48 !! 24.11 - 30.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | document the results of the two-tensor tractography given a tensor volume ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to do mutli trace tractography given a DWI volume ||align=&amp;quot;center&amp;quot; | x || Mon Nov, 17th&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 47 !! 17.11 - 23.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Working on Python tractography module for multi fiber tracing given a tensor volume ||align=&amp;quot;center&amp;quot; | x || Mon Nov, 17th&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 46 !! 10.11 - 16.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Get vertex data out of the nvert nrrd filled by the tractography back to Slicer ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to pass image data from Python to Teem through nrrdWrap_nva function ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to generate a list of point locations that were used as tractography seedpoints in the VTK tractography ||align=&amp;quot;center&amp;quot; | x || Thu Nov, 13th&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Implement Python tractography module for single fiber tracing given a seeding starting point and a tensor volume ||align=&amp;quot;center&amp;quot; | x || Fri, Nov, 7th&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 45 || 03.11 - 09.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to get image data from numpy (= Python package) to Teem nrrd struct ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! November !!  | Week 44 || 27.10 - 02.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;20px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to get image data from numpy (= Python package) to Teem nrrd struct ||align=&amp;quot;center&amp;quot; | x ||&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !!  Week 43 || 20.10 - 26.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to access DWI volumes through Python ||align=&amp;quot;center&amp;quot; | x || Fri Oct, 17th&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Get Teem wrapped in Python ||align=&amp;quot;center&amp;quot; | x || Fri Oct, 19th&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 42 || 13.10 - 19.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Try to implement the seeding part of the (VTK) one-tensor tractography module in Python || align=&amp;quot;center&amp;quot; | x || Tue Oct, 14th&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 41 || 06.10 - 12.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
|height=10|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Try to implement the seeding part of the (VTK) one-tensor tractography module in Python || align=&amp;quot;center&amp;quot; | x || Tue Oct, 14th&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! October !!  Week 40 || 29.09 - 5.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;20px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; |Totally understand existing Python modules in Slicer || align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; |understand existing one-tensor streamline tractography in Slicer (VTK) || align=&amp;quot;center&amp;quot; | x || Tue Sep, 23rd &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Totally understand existing Python modules in Slicer ||align=&amp;quot;center&amp;quot; | x || Tue Sep, 23rd&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !!  Week 39 || 22.09 - 28.09 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; | Slicer &amp;amp; Python Tutorials || align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; | Enable Python in Slicer || align=&amp;quot;center&amp;quot; | x || Mon Sep, 22nd&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot; &lt;br /&gt;
! September !! Week 38 || 14.09 - 21.09 || ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Information==&lt;br /&gt;
* Diffusion Tensor Analysis in Slicer: http://www.na-mic.org/Wiki/images/0/04/Slicer3diffusionTutorial7.pdf&lt;br /&gt;
* Building a Slicer 3 Module GUI: http://www.slicer.org/pages/Building_a_Slicer_3_Module_GUI&lt;br /&gt;
&lt;br /&gt;
Python:&lt;br /&gt;
* SlicerWiki about Python: http://www.slicer.org/slicerWiki/index.php/Slicer3::Python&lt;br /&gt;
* Python example modules in Slicer: http://www.slicer.org/slicerWiki/index.php/Slicer3:Execution_Model_Documentation:Python&lt;/div&gt;</summary>
		<author><name>Mseeland</name></author>
		
	</entry>
	<entry>
		<id>https://www.na-mic.org/w/index.php?title=User:Mseeland&amp;diff=34663</id>
		<title>User:Mseeland</title>
		<link rel="alternate" type="text/html" href="https://www.na-mic.org/w/index.php?title=User:Mseeland&amp;diff=34663"/>
		<updated>2009-01-08T19:20:54Z</updated>

		<summary type="html">&lt;p&gt;Mseeland: /* Status/Progress */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Wiki of Madeleine Seeland =&lt;br /&gt;
&lt;br /&gt;
== General Information ==&lt;br /&gt;
&lt;br /&gt;
===About myself===&lt;br /&gt;
I am a grad student of Management Information Systems at the University of Mannheim, Germany. I'm involved in the Diffusion Tensor Imaging (DTI) project in the Laboratory of Mathematics in Imaging. Currently I'm working on two-tensor tractograohy for Neurosurgery. I will document my research experience as a diploma thesis, which I need for completing my studies in Germany.&lt;br /&gt;
&lt;br /&gt;
===Contact information===&lt;br /&gt;
E-mail: mseeland (at sign) bwh.harvard.edu&lt;br /&gt;
&lt;br /&gt;
===Collaborators &amp;amp; Contacts===&lt;br /&gt;
* Supervisors: C-F Westin, Nobuhiko Hata&lt;br /&gt;
* Gordon  Kindlmann (Teem)&lt;br /&gt;
* Sharon Peled&lt;br /&gt;
* Alireza Radmanesh&lt;br /&gt;
* Isaiah Norton&lt;br /&gt;
* Regarding Python: Steve Pieper, Julien de Siebenthal, Sylvain Bouix, Demian Wassermann&lt;br /&gt;
&lt;br /&gt;
==Project: Two-Tensor Tractography integration into Slicer==&lt;br /&gt;
&lt;br /&gt;
===Project Description===&lt;br /&gt;
*  Integration of Two-Tensor Tractography into Slicer using Python&lt;br /&gt;
*  Use of existing tractography methods in Teem (http://teem.sourceforge.net/)&lt;br /&gt;
*  My part: Interface between Python and Slicer&lt;br /&gt;
** pass data from VTK to Python to Teem&lt;br /&gt;
** make use of Teem tractography function calls&lt;br /&gt;
** pass resulting fiber data from Teem to Python to VTK and display fiber tracts in Slicer  &lt;br /&gt;
*  The Teem Python API will be provided by Gordon Kindlmann&lt;br /&gt;
&lt;br /&gt;
===How to enable Python in Slicer 3.3===&lt;br /&gt;
*  The current version of Slicer, Slicer 3.2, does not support Python. In order to use Python you need to install Slicer 3.3.&lt;br /&gt;
&lt;br /&gt;
*  To build Slicer Version 3.3, just do the following two commands:&lt;br /&gt;
  svn co http://svn.slicer.org/Slicer3/trunk Slicer3&lt;br /&gt;
  ./Slicer3/Scripts/getbuildtest.tcl&lt;br /&gt;
&lt;br /&gt;
*  In Slicer 3.3, Python support is disabled by default. In order to enable Python, just follow the next steps:&lt;br /&gt;
&lt;br /&gt;
# Edit slicer_variables.tcl&lt;br /&gt;
## Change &amp;quot;set ::USE_PYTHON &amp;quot;off&amp;quot;&amp;quot; to &amp;quot;on&amp;quot;&lt;br /&gt;
# '''Optional:''' If you prefer to use your system Python installation, see here: [http://www.slicer.org/slicerWiki/index.php/Slicer3::Python] &lt;br /&gt;
# '''Optional:''' installing SciPy, see here: [http://www.slicer.org/slicerWiki/index.php/Slicer3::Python]. However, there are still problems adding scipy in Slicer, whcih are not fixed yet.&lt;br /&gt;
&lt;br /&gt;
*  Rebuild Slicer3 using &amp;quot;getbuildtest.tcl&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 ./Slicer3/Scripts/getbuildtest.tcl&lt;br /&gt;
&lt;br /&gt;
A new menu command '''Python Interpreter''' should appear on the Window menu in Slicer. This command should bring up the Python Console window.&lt;br /&gt;
&lt;br /&gt;
===Teem Python wrapping===&lt;br /&gt;
&lt;br /&gt;
====BACKGROUND====&lt;br /&gt;
* Teem Python wrapping is needed to make use of existing Two-Tensor tractography functions in Teem in Python&lt;br /&gt;
* The Python wrappings are based on ctypes, as well as a ctypes code generator (called &amp;quot;ctypeslib&amp;quot;)&lt;br /&gt;
** http://python.net/crew/theller/ctypes&lt;br /&gt;
** http://starship.python.net/crew/theller/wiki/CodeGenerator&lt;br /&gt;
** http://starship.python.net/crew/theller/ctypes/old/codegen.html&lt;br /&gt;
* Ctypes is a standard part of python, by which C functions in a shared library can be called from Python&lt;br /&gt;
* The ctypes code generator converts declarations in C header files into executable Python code: enums, structs, unions, function declarations, com interfaces, and preprocessor definitions.&lt;br /&gt;
* Creating wrappers for C header file(s) is a two step process. &lt;br /&gt;
** First, the ``h2xml.py`` script runs GCC-XML_ over the include file(s), creating a XML file containing declarations and definitions.  &lt;br /&gt;
** Second, the ``xml2py.py`` script parses the XML files and creates Python code containing all or a subset of these definitions.&lt;br /&gt;
* Python code is generated for C enums, structure, unions, typedefs and function declarations.&lt;br /&gt;
&lt;br /&gt;
====REQUIREMENTS====&lt;br /&gt;
* Ctypeslib: ctypeslib is an extension package for ctypes. It contains a ctypes code generator.&lt;br /&gt;
* GCC-XML (from http://www.gccxml.org/) is required to parse C header files into an XML description.&lt;br /&gt;
&lt;br /&gt;
====GETTING THE SOFTWARE====&lt;br /&gt;
* Python 2.6 can be got here (anything after 2.5 should work): http://www.python.org/download/&lt;br /&gt;
* Get gccxml (I used version 0.9.0), which can be got by CVS as described here: http://www.gccxml.org/HTML/Download.html&lt;br /&gt;
** follow the installation as described here: http://www.gccxml.org/HTML/Install.html&lt;br /&gt;
* use a version of ctypeslib which work with the version of gccxml: &lt;br /&gt;
  http://svn.python.org/projects/ctypes/branches/ctypeslib-gccxml-0.9&lt;br /&gt;
* But this requires some patches to work; the content of the &amp;quot;fixes.patch&amp;quot; file can be found here: [[http://wiki.na-mic.org/Wiki/images/3/3b/Fixes.patch.txt]]:&lt;br /&gt;
   svn co http://svn.python.org/projects/ctypes/branches/ctypeslib-gccxml-0.9&lt;br /&gt;
   cd ctypeslib-gccxml-0.9&lt;br /&gt;
   patch -p0 &amp;lt; ../fixes.patch&lt;br /&gt;
   cd ..&lt;br /&gt;
* ctypeslib is written in python =&amp;gt; there's nothing new to compile at this point&lt;br /&gt;
&lt;br /&gt;
====CREATING PYTHON/TEEM====&lt;br /&gt;
* First get Teem (starting from whatever directory should contain the &amp;quot;teem&amp;quot; source dir):&lt;br /&gt;
  svn co https://teem.svn.sourceforge.net/svnroot/teem/teem/trunk teem&lt;br /&gt;
and compile it as a shared library.  Directions for doing this with cmake are here:&lt;br /&gt;
  http://teem.sourceforge.net/build.html&lt;br /&gt;
* create the wrappings in a new directory (e.g. &amp;quot;teem-wrap&amp;quot;), where the XML and Python output will be&lt;br /&gt;
* Set the environment variables that identify where Teem and ctypeslib are:&lt;br /&gt;
** TEEM is where Teem's &amp;quot;make install&amp;quot; put subdirectories &amp;quot;bin&amp;quot;, &amp;quot;lib&amp;quot;, and &amp;quot;include&amp;quot; (e.g. ~/teem-build)&lt;br /&gt;
** CTYPES is the full path of ctypeslib-gccxml-0.9&lt;br /&gt;
* First create (in, for example, &amp;quot;teem-wrap&amp;quot;) a meta-header for all the Teem header files (in tcsh):&lt;br /&gt;
   mkdir teemincl&lt;br /&gt;
   cp -r ${TEEM}/include/teem teemincl&lt;br /&gt;
   cd teemincl&lt;br /&gt;
   ls -1 teem/*.h | awk '{print &amp;quot;#include &amp;lt;&amp;quot;$1&amp;quot;&amp;gt;&amp;quot;}' &amp;gt; all.h&lt;br /&gt;
   cd ..&lt;br /&gt;
* Then create teem.xml:&lt;br /&gt;
   setenv PYTHONPATH $CTYPES&lt;br /&gt;
   python $CTYPES/scripts/h2xml.py `pwd`/teemincl/all.h -I teemincl -o teem.xml &lt;br /&gt;
* Then create teem.py (use DYLD_LIBRARY_PATH in a mac):&lt;br /&gt;
   setenv LD_LIBRARY_PATH ${TEEM}/lib&lt;br /&gt;
   python $CTYPES/scripts/xml2py.py teem.xml -llibteem.so -o teem.py \&lt;br /&gt;
        -r &amp;quot;(air|hest|biff|nrrd|ell|unrrdu|moss|gage|bane|limn|seek|hoover|echo|ten|dye|mite).*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===LEVMAR===&lt;br /&gt;
&lt;br /&gt;
* The 2-tensor tractography depends on Levenberg-Marquardt nonlinear optimization of Sharon Peled's constrained two-tensor model. I used the following implementation for it: http://www.ics.forth.gr/~lourakis/levmar/&lt;br /&gt;
* This code is enabled by compiling Teem with TEEM_LEVMAR defined. The include paths and library link paths need also be defined for everything to work.&lt;br /&gt;
* There are problems compiling LEVMAR with cmake. I found no way to create a build of levmar that allows Teem to say in Teem's CMakeLists.txt simply: FIND_PACKAGE(LEVMAR)). Therefore I compiled levmar myself and then changed Teem's CMake stuff so that the user sets the Teem_LEVMAR_LIB and Teem_LEVMAR_IPATH variables directly (so that the user does by hand what's normally done by &amp;quot;FIND_PACKAGE(LEVMAR)&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
==Status/Progress==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=0&lt;br /&gt;
|- bgcolor=&amp;quot;#abcdef&amp;quot;&lt;br /&gt;
! Month !! Week #  !! Start Date - End Date !! Done !! Date Done&lt;br /&gt;
|-&lt;br /&gt;
|height=5|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Find optimal parameter setting of the Two-Tensor Tractography method ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Extend Two-Tensor Tractography module by fiducial seeding ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | NA-MIC Project Week in Salt Lake City ([http://www.na-mic.org/Wiki/index.php/2009_Winter_Project_Week],[http://www.na-mic.org/Wiki/index.php/Two-tensor_tractography_in_Slicer_using_Python_and_Teem]) ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! January !!  | Week 2 || 05.01 - 11.01 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | IGT Project Week ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 50 || 08.12 - 14.12 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! December !!  | Week 49 || 01.12 - 07.12 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to compile teem with levmar (= Levenberg-Marquardt nonlinear least squares algorithm) ||align=&amp;quot;center&amp;quot; | x || Mon Dec, 1st&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 48 !! 24.11 - 30.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | document the results of the two-tensor tractography given a tensor volume ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to do mutli trace tractography given a DWI volume ||align=&amp;quot;center&amp;quot; | x || Mon Nov, 17th&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 47 !! 17.11 - 23.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Working on Python tractography module for multi fiber tracing given a tensor volume ||align=&amp;quot;center&amp;quot; | x || Mon Nov, 17th&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 46 !! 10.11 - 16.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Get vertex data out of the nvert nrrd filled by the tractography back to Slicer ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to pass image data from Python to Teem through nrrdWrap_nva function ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to generate a list of point locations that were used as tractography seedpoints in the VTK tractography ||align=&amp;quot;center&amp;quot; | x || Thu Nov, 13th&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Implement Python tractography module for single fiber tracing given a seeding starting point and a tensor volume ||align=&amp;quot;center&amp;quot; | x || Fri, Nov, 7th&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 45 || 03.11 - 09.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to get image data from numpy (= Python package) to Teem nrrd struct ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! November !!  | Week 44 || 27.10 - 02.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;20px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to get image data from numpy (= Python package) to Teem nrrd struct ||align=&amp;quot;center&amp;quot; | x ||&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !!  Week 43 || 20.10 - 26.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to access DWI volumes through Python ||align=&amp;quot;center&amp;quot; | x || Fri Oct, 17th&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Get Teem wrapped in Python ||align=&amp;quot;center&amp;quot; | x || Fri Oct, 19th&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 42 || 13.10 - 19.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Try to implement the seeding part of the (VTK) one-tensor tractography module in Python || align=&amp;quot;center&amp;quot; | x || Tue Oct, 14th&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 41 || 06.10 - 12.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
|height=10|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Try to implement the seeding part of the (VTK) one-tensor tractography module in Python || align=&amp;quot;center&amp;quot; | x || Tue Oct, 14th&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! October !!  Week 40 || 29.09 - 5.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;20px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; |Totally understand existing Python modules in Slicer || align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; |understand existing one-tensor streamline tractography in Slicer (VTK) || align=&amp;quot;center&amp;quot; | x || Tue Sep, 23rd &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Totally understand existing Python modules in Slicer ||align=&amp;quot;center&amp;quot; | x || Tue Sep, 23rd&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !!  Week 39 || 22.09 - 28.09 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; | Slicer &amp;amp; Python Tutorials || align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; | Enable Python in Slicer || align=&amp;quot;center&amp;quot; | x || Mon Sep, 22nd&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot; &lt;br /&gt;
! September !! Week 38 || 14.09 - 21.09 || ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Information==&lt;br /&gt;
* Diffusion Tensor Analysis in Slicer: http://www.na-mic.org/Wiki/images/0/04/Slicer3diffusionTutorial7.pdf&lt;br /&gt;
* Building a Slicer 3 Module GUI: http://www.slicer.org/pages/Building_a_Slicer_3_Module_GUI&lt;br /&gt;
&lt;br /&gt;
Python:&lt;br /&gt;
* SlicerWiki about Python: http://www.slicer.org/slicerWiki/index.php/Slicer3::Python&lt;br /&gt;
* Python example modules in Slicer: http://www.slicer.org/slicerWiki/index.php/Slicer3:Execution_Model_Documentation:Python&lt;/div&gt;</summary>
		<author><name>Mseeland</name></author>
		
	</entry>
	<entry>
		<id>https://www.na-mic.org/w/index.php?title=User:Mseeland&amp;diff=34662</id>
		<title>User:Mseeland</title>
		<link rel="alternate" type="text/html" href="https://www.na-mic.org/w/index.php?title=User:Mseeland&amp;diff=34662"/>
		<updated>2009-01-08T19:18:14Z</updated>

		<summary type="html">&lt;p&gt;Mseeland: /* Status/Progress */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Wiki of Madeleine Seeland =&lt;br /&gt;
&lt;br /&gt;
== General Information ==&lt;br /&gt;
&lt;br /&gt;
===About myself===&lt;br /&gt;
I am a grad student of Management Information Systems at the University of Mannheim, Germany. I'm involved in the Diffusion Tensor Imaging (DTI) project in the Laboratory of Mathematics in Imaging. Currently I'm working on two-tensor tractograohy for Neurosurgery. I will document my research experience as a diploma thesis, which I need for completing my studies in Germany.&lt;br /&gt;
&lt;br /&gt;
===Contact information===&lt;br /&gt;
E-mail: mseeland (at sign) bwh.harvard.edu&lt;br /&gt;
&lt;br /&gt;
===Collaborators &amp;amp; Contacts===&lt;br /&gt;
* Supervisors: C-F Westin, Nobuhiko Hata&lt;br /&gt;
* Gordon  Kindlmann (Teem)&lt;br /&gt;
* Sharon Peled&lt;br /&gt;
* Alireza Radmanesh&lt;br /&gt;
* Isaiah Norton&lt;br /&gt;
* Regarding Python: Steve Pieper, Julien de Siebenthal, Sylvain Bouix, Demian Wassermann&lt;br /&gt;
&lt;br /&gt;
==Project: Two-Tensor Tractography integration into Slicer==&lt;br /&gt;
&lt;br /&gt;
===Project Description===&lt;br /&gt;
*  Integration of Two-Tensor Tractography into Slicer using Python&lt;br /&gt;
*  Use of existing tractography methods in Teem (http://teem.sourceforge.net/)&lt;br /&gt;
*  My part: Interface between Python and Slicer&lt;br /&gt;
** pass data from VTK to Python to Teem&lt;br /&gt;
** make use of Teem tractography function calls&lt;br /&gt;
** pass resulting fiber data from Teem to Python to VTK and display fiber tracts in Slicer  &lt;br /&gt;
*  The Teem Python API will be provided by Gordon Kindlmann&lt;br /&gt;
&lt;br /&gt;
===How to enable Python in Slicer 3.3===&lt;br /&gt;
*  The current version of Slicer, Slicer 3.2, does not support Python. In order to use Python you need to install Slicer 3.3.&lt;br /&gt;
&lt;br /&gt;
*  To build Slicer Version 3.3, just do the following two commands:&lt;br /&gt;
  svn co http://svn.slicer.org/Slicer3/trunk Slicer3&lt;br /&gt;
  ./Slicer3/Scripts/getbuildtest.tcl&lt;br /&gt;
&lt;br /&gt;
*  In Slicer 3.3, Python support is disabled by default. In order to enable Python, just follow the next steps:&lt;br /&gt;
&lt;br /&gt;
# Edit slicer_variables.tcl&lt;br /&gt;
## Change &amp;quot;set ::USE_PYTHON &amp;quot;off&amp;quot;&amp;quot; to &amp;quot;on&amp;quot;&lt;br /&gt;
# '''Optional:''' If you prefer to use your system Python installation, see here: [http://www.slicer.org/slicerWiki/index.php/Slicer3::Python] &lt;br /&gt;
# '''Optional:''' installing SciPy, see here: [http://www.slicer.org/slicerWiki/index.php/Slicer3::Python]. However, there are still problems adding scipy in Slicer, whcih are not fixed yet.&lt;br /&gt;
&lt;br /&gt;
*  Rebuild Slicer3 using &amp;quot;getbuildtest.tcl&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 ./Slicer3/Scripts/getbuildtest.tcl&lt;br /&gt;
&lt;br /&gt;
A new menu command '''Python Interpreter''' should appear on the Window menu in Slicer. This command should bring up the Python Console window.&lt;br /&gt;
&lt;br /&gt;
===Teem Python wrapping===&lt;br /&gt;
&lt;br /&gt;
====BACKGROUND====&lt;br /&gt;
* Teem Python wrapping is needed to make use of existing Two-Tensor tractography functions in Teem in Python&lt;br /&gt;
* The Python wrappings are based on ctypes, as well as a ctypes code generator (called &amp;quot;ctypeslib&amp;quot;)&lt;br /&gt;
** http://python.net/crew/theller/ctypes&lt;br /&gt;
** http://starship.python.net/crew/theller/wiki/CodeGenerator&lt;br /&gt;
** http://starship.python.net/crew/theller/ctypes/old/codegen.html&lt;br /&gt;
* Ctypes is a standard part of python, by which C functions in a shared library can be called from Python&lt;br /&gt;
* The ctypes code generator converts declarations in C header files into executable Python code: enums, structs, unions, function declarations, com interfaces, and preprocessor definitions.&lt;br /&gt;
* Creating wrappers for C header file(s) is a two step process. &lt;br /&gt;
** First, the ``h2xml.py`` script runs GCC-XML_ over the include file(s), creating a XML file containing declarations and definitions.  &lt;br /&gt;
** Second, the ``xml2py.py`` script parses the XML files and creates Python code containing all or a subset of these definitions.&lt;br /&gt;
* Python code is generated for C enums, structure, unions, typedefs and function declarations.&lt;br /&gt;
&lt;br /&gt;
====REQUIREMENTS====&lt;br /&gt;
* Ctypeslib: ctypeslib is an extension package for ctypes. It contains a ctypes code generator.&lt;br /&gt;
* GCC-XML (from http://www.gccxml.org/) is required to parse C header files into an XML description.&lt;br /&gt;
&lt;br /&gt;
====GETTING THE SOFTWARE====&lt;br /&gt;
* Python 2.6 can be got here (anything after 2.5 should work): http://www.python.org/download/&lt;br /&gt;
* Get gccxml (I used version 0.9.0), which can be got by CVS as described here: http://www.gccxml.org/HTML/Download.html&lt;br /&gt;
** follow the installation as described here: http://www.gccxml.org/HTML/Install.html&lt;br /&gt;
* use a version of ctypeslib which work with the version of gccxml: &lt;br /&gt;
  http://svn.python.org/projects/ctypes/branches/ctypeslib-gccxml-0.9&lt;br /&gt;
* But this requires some patches to work; the content of the &amp;quot;fixes.patch&amp;quot; file can be found here: [[http://wiki.na-mic.org/Wiki/images/3/3b/Fixes.patch.txt]]:&lt;br /&gt;
   svn co http://svn.python.org/projects/ctypes/branches/ctypeslib-gccxml-0.9&lt;br /&gt;
   cd ctypeslib-gccxml-0.9&lt;br /&gt;
   patch -p0 &amp;lt; ../fixes.patch&lt;br /&gt;
   cd ..&lt;br /&gt;
* ctypeslib is written in python =&amp;gt; there's nothing new to compile at this point&lt;br /&gt;
&lt;br /&gt;
====CREATING PYTHON/TEEM====&lt;br /&gt;
* First get Teem (starting from whatever directory should contain the &amp;quot;teem&amp;quot; source dir):&lt;br /&gt;
  svn co https://teem.svn.sourceforge.net/svnroot/teem/teem/trunk teem&lt;br /&gt;
and compile it as a shared library.  Directions for doing this with cmake are here:&lt;br /&gt;
  http://teem.sourceforge.net/build.html&lt;br /&gt;
* create the wrappings in a new directory (e.g. &amp;quot;teem-wrap&amp;quot;), where the XML and Python output will be&lt;br /&gt;
* Set the environment variables that identify where Teem and ctypeslib are:&lt;br /&gt;
** TEEM is where Teem's &amp;quot;make install&amp;quot; put subdirectories &amp;quot;bin&amp;quot;, &amp;quot;lib&amp;quot;, and &amp;quot;include&amp;quot; (e.g. ~/teem-build)&lt;br /&gt;
** CTYPES is the full path of ctypeslib-gccxml-0.9&lt;br /&gt;
* First create (in, for example, &amp;quot;teem-wrap&amp;quot;) a meta-header for all the Teem header files (in tcsh):&lt;br /&gt;
   mkdir teemincl&lt;br /&gt;
   cp -r ${TEEM}/include/teem teemincl&lt;br /&gt;
   cd teemincl&lt;br /&gt;
   ls -1 teem/*.h | awk '{print &amp;quot;#include &amp;lt;&amp;quot;$1&amp;quot;&amp;gt;&amp;quot;}' &amp;gt; all.h&lt;br /&gt;
   cd ..&lt;br /&gt;
* Then create teem.xml:&lt;br /&gt;
   setenv PYTHONPATH $CTYPES&lt;br /&gt;
   python $CTYPES/scripts/h2xml.py `pwd`/teemincl/all.h -I teemincl -o teem.xml &lt;br /&gt;
* Then create teem.py (use DYLD_LIBRARY_PATH in a mac):&lt;br /&gt;
   setenv LD_LIBRARY_PATH ${TEEM}/lib&lt;br /&gt;
   python $CTYPES/scripts/xml2py.py teem.xml -llibteem.so -o teem.py \&lt;br /&gt;
        -r &amp;quot;(air|hest|biff|nrrd|ell|unrrdu|moss|gage|bane|limn|seek|hoover|echo|ten|dye|mite).*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===LEVMAR===&lt;br /&gt;
&lt;br /&gt;
* The 2-tensor tractography depends on Levenberg-Marquardt nonlinear optimization of Sharon Peled's constrained two-tensor model. I used the following implementation for it: http://www.ics.forth.gr/~lourakis/levmar/&lt;br /&gt;
* This code is enabled by compiling Teem with TEEM_LEVMAR defined. The include paths and library link paths need also be defined for everything to work.&lt;br /&gt;
* There are problems compiling LEVMAR with cmake. I found no way to create a build of levmar that allows Teem to say in Teem's CMakeLists.txt simply: FIND_PACKAGE(LEVMAR)). Therefore I compiled levmar myself and then changed Teem's CMake stuff so that the user sets the Teem_LEVMAR_LIB and Teem_LEVMAR_IPATH variables directly (so that the user does by hand what's normally done by &amp;quot;FIND_PACKAGE(LEVMAR)&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
==Status/Progress==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=0&lt;br /&gt;
|- bgcolor=&amp;quot;#abcdef&amp;quot;&lt;br /&gt;
! Month !! Week #  !! Start Date - End Date !! Done !! Date Done&lt;br /&gt;
|-&lt;br /&gt;
|height=5|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | NA-MIC Project Week in Salt Lake City ([http://www.na-mic.org/Wiki/index.php/2009_Winter_Project_Week],[http://www.na-mic.org/Wiki/index.php/Two-tensor_tractography_in_Slicer_using_Python_and_Teem]) ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! January !!  | Week 2 || 05.01 - 11.01 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | IGT Project Week ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 50 || 08.12 - 14.12 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! December !!  | Week 49 || 01.12 - 07.12 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to compile teem with levmar (= Levenberg-Marquardt nonlinear least squares algorithm) ||align=&amp;quot;center&amp;quot; | x || Mon Dec, 1st&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 48 !! 24.11 - 30.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | document the results of the two-tensor tractography given a tensor volume ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to do mutli trace tractography given a DWI volume ||align=&amp;quot;center&amp;quot; | x || Mon Nov, 17th&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 47 !! 17.11 - 23.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Working on Python tractography module for multi fiber tracing given a tensor volume ||align=&amp;quot;center&amp;quot; | x || Mon Nov, 17th&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 46 !! 10.11 - 16.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Get vertex data out of the nvert nrrd filled by the tractography back to Slicer ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to pass image data from Python to Teem through nrrdWrap_nva function ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to generate a list of point locations that were used as tractography seedpoints in the VTK tractography ||align=&amp;quot;center&amp;quot; | x || Thu Nov, 13th&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Implement Python tractography module for single fiber tracing given a seeding starting point and a tensor volume ||align=&amp;quot;center&amp;quot; | x || Fri, Nov, 7th&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 45 || 03.11 - 09.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to get image data from numpy (= Python package) to Teem nrrd struct ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! November !!  | Week 44 || 27.10 - 02.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;20px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to get image data from numpy (= Python package) to Teem nrrd struct ||align=&amp;quot;center&amp;quot; | x ||&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !!  Week 43 || 20.10 - 26.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to access DWI volumes through Python ||align=&amp;quot;center&amp;quot; | x || Fri Oct, 17th&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Get Teem wrapped in Python ||align=&amp;quot;center&amp;quot; | x || Fri Oct, 19th&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 42 || 13.10 - 19.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Try to implement the seeding part of the (VTK) one-tensor tractography module in Python || align=&amp;quot;center&amp;quot; | x || Tue Oct, 14th&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 41 || 06.10 - 12.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
|height=10|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Try to implement the seeding part of the (VTK) one-tensor tractography module in Python || align=&amp;quot;center&amp;quot; | x || Tue Oct, 14th&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! October !!  Week 40 || 29.09 - 5.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;20px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; |Totally understand existing Python modules in Slicer || align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; |understand existing one-tensor streamline tractography in Slicer (VTK) || align=&amp;quot;center&amp;quot; | x || Tue Sep, 23rd &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Totally understand existing Python modules in Slicer ||align=&amp;quot;center&amp;quot; | x || Tue Sep, 23rd&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !!  Week 39 || 22.09 - 28.09 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; | Slicer &amp;amp; Python Tutorials || align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; | Enable Python in Slicer || align=&amp;quot;center&amp;quot; | x || Mon Sep, 22nd&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot; &lt;br /&gt;
! September !! Week 38 || 14.09 - 21.09 || ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Information==&lt;br /&gt;
* Diffusion Tensor Analysis in Slicer: http://www.na-mic.org/Wiki/images/0/04/Slicer3diffusionTutorial7.pdf&lt;br /&gt;
* Building a Slicer 3 Module GUI: http://www.slicer.org/pages/Building_a_Slicer_3_Module_GUI&lt;br /&gt;
&lt;br /&gt;
Python:&lt;br /&gt;
* SlicerWiki about Python: http://www.slicer.org/slicerWiki/index.php/Slicer3::Python&lt;br /&gt;
* Python example modules in Slicer: http://www.slicer.org/slicerWiki/index.php/Slicer3:Execution_Model_Documentation:Python&lt;/div&gt;</summary>
		<author><name>Mseeland</name></author>
		
	</entry>
	<entry>
		<id>https://www.na-mic.org/w/index.php?title=User:Mseeland&amp;diff=34660</id>
		<title>User:Mseeland</title>
		<link rel="alternate" type="text/html" href="https://www.na-mic.org/w/index.php?title=User:Mseeland&amp;diff=34660"/>
		<updated>2009-01-08T19:17:40Z</updated>

		<summary type="html">&lt;p&gt;Mseeland: /* Status/Progress */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Wiki of Madeleine Seeland =&lt;br /&gt;
&lt;br /&gt;
== General Information ==&lt;br /&gt;
&lt;br /&gt;
===About myself===&lt;br /&gt;
I am a grad student of Management Information Systems at the University of Mannheim, Germany. I'm involved in the Diffusion Tensor Imaging (DTI) project in the Laboratory of Mathematics in Imaging. Currently I'm working on two-tensor tractograohy for Neurosurgery. I will document my research experience as a diploma thesis, which I need for completing my studies in Germany.&lt;br /&gt;
&lt;br /&gt;
===Contact information===&lt;br /&gt;
E-mail: mseeland (at sign) bwh.harvard.edu&lt;br /&gt;
&lt;br /&gt;
===Collaborators &amp;amp; Contacts===&lt;br /&gt;
* Supervisors: C-F Westin, Nobuhiko Hata&lt;br /&gt;
* Gordon  Kindlmann (Teem)&lt;br /&gt;
* Sharon Peled&lt;br /&gt;
* Alireza Radmanesh&lt;br /&gt;
* Isaiah Norton&lt;br /&gt;
* Regarding Python: Steve Pieper, Julien de Siebenthal, Sylvain Bouix, Demian Wassermann&lt;br /&gt;
&lt;br /&gt;
==Project: Two-Tensor Tractography integration into Slicer==&lt;br /&gt;
&lt;br /&gt;
===Project Description===&lt;br /&gt;
*  Integration of Two-Tensor Tractography into Slicer using Python&lt;br /&gt;
*  Use of existing tractography methods in Teem (http://teem.sourceforge.net/)&lt;br /&gt;
*  My part: Interface between Python and Slicer&lt;br /&gt;
** pass data from VTK to Python to Teem&lt;br /&gt;
** make use of Teem tractography function calls&lt;br /&gt;
** pass resulting fiber data from Teem to Python to VTK and display fiber tracts in Slicer  &lt;br /&gt;
*  The Teem Python API will be provided by Gordon Kindlmann&lt;br /&gt;
&lt;br /&gt;
===How to enable Python in Slicer 3.3===&lt;br /&gt;
*  The current version of Slicer, Slicer 3.2, does not support Python. In order to use Python you need to install Slicer 3.3.&lt;br /&gt;
&lt;br /&gt;
*  To build Slicer Version 3.3, just do the following two commands:&lt;br /&gt;
  svn co http://svn.slicer.org/Slicer3/trunk Slicer3&lt;br /&gt;
  ./Slicer3/Scripts/getbuildtest.tcl&lt;br /&gt;
&lt;br /&gt;
*  In Slicer 3.3, Python support is disabled by default. In order to enable Python, just follow the next steps:&lt;br /&gt;
&lt;br /&gt;
# Edit slicer_variables.tcl&lt;br /&gt;
## Change &amp;quot;set ::USE_PYTHON &amp;quot;off&amp;quot;&amp;quot; to &amp;quot;on&amp;quot;&lt;br /&gt;
# '''Optional:''' If you prefer to use your system Python installation, see here: [http://www.slicer.org/slicerWiki/index.php/Slicer3::Python] &lt;br /&gt;
# '''Optional:''' installing SciPy, see here: [http://www.slicer.org/slicerWiki/index.php/Slicer3::Python]. However, there are still problems adding scipy in Slicer, whcih are not fixed yet.&lt;br /&gt;
&lt;br /&gt;
*  Rebuild Slicer3 using &amp;quot;getbuildtest.tcl&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 ./Slicer3/Scripts/getbuildtest.tcl&lt;br /&gt;
&lt;br /&gt;
A new menu command '''Python Interpreter''' should appear on the Window menu in Slicer. This command should bring up the Python Console window.&lt;br /&gt;
&lt;br /&gt;
===Teem Python wrapping===&lt;br /&gt;
&lt;br /&gt;
====BACKGROUND====&lt;br /&gt;
* Teem Python wrapping is needed to make use of existing Two-Tensor tractography functions in Teem in Python&lt;br /&gt;
* The Python wrappings are based on ctypes, as well as a ctypes code generator (called &amp;quot;ctypeslib&amp;quot;)&lt;br /&gt;
** http://python.net/crew/theller/ctypes&lt;br /&gt;
** http://starship.python.net/crew/theller/wiki/CodeGenerator&lt;br /&gt;
** http://starship.python.net/crew/theller/ctypes/old/codegen.html&lt;br /&gt;
* Ctypes is a standard part of python, by which C functions in a shared library can be called from Python&lt;br /&gt;
* The ctypes code generator converts declarations in C header files into executable Python code: enums, structs, unions, function declarations, com interfaces, and preprocessor definitions.&lt;br /&gt;
* Creating wrappers for C header file(s) is a two step process. &lt;br /&gt;
** First, the ``h2xml.py`` script runs GCC-XML_ over the include file(s), creating a XML file containing declarations and definitions.  &lt;br /&gt;
** Second, the ``xml2py.py`` script parses the XML files and creates Python code containing all or a subset of these definitions.&lt;br /&gt;
* Python code is generated for C enums, structure, unions, typedefs and function declarations.&lt;br /&gt;
&lt;br /&gt;
====REQUIREMENTS====&lt;br /&gt;
* Ctypeslib: ctypeslib is an extension package for ctypes. It contains a ctypes code generator.&lt;br /&gt;
* GCC-XML (from http://www.gccxml.org/) is required to parse C header files into an XML description.&lt;br /&gt;
&lt;br /&gt;
====GETTING THE SOFTWARE====&lt;br /&gt;
* Python 2.6 can be got here (anything after 2.5 should work): http://www.python.org/download/&lt;br /&gt;
* Get gccxml (I used version 0.9.0), which can be got by CVS as described here: http://www.gccxml.org/HTML/Download.html&lt;br /&gt;
** follow the installation as described here: http://www.gccxml.org/HTML/Install.html&lt;br /&gt;
* use a version of ctypeslib which work with the version of gccxml: &lt;br /&gt;
  http://svn.python.org/projects/ctypes/branches/ctypeslib-gccxml-0.9&lt;br /&gt;
* But this requires some patches to work; the content of the &amp;quot;fixes.patch&amp;quot; file can be found here: [[http://wiki.na-mic.org/Wiki/images/3/3b/Fixes.patch.txt]]:&lt;br /&gt;
   svn co http://svn.python.org/projects/ctypes/branches/ctypeslib-gccxml-0.9&lt;br /&gt;
   cd ctypeslib-gccxml-0.9&lt;br /&gt;
   patch -p0 &amp;lt; ../fixes.patch&lt;br /&gt;
   cd ..&lt;br /&gt;
* ctypeslib is written in python =&amp;gt; there's nothing new to compile at this point&lt;br /&gt;
&lt;br /&gt;
====CREATING PYTHON/TEEM====&lt;br /&gt;
* First get Teem (starting from whatever directory should contain the &amp;quot;teem&amp;quot; source dir):&lt;br /&gt;
  svn co https://teem.svn.sourceforge.net/svnroot/teem/teem/trunk teem&lt;br /&gt;
and compile it as a shared library.  Directions for doing this with cmake are here:&lt;br /&gt;
  http://teem.sourceforge.net/build.html&lt;br /&gt;
* create the wrappings in a new directory (e.g. &amp;quot;teem-wrap&amp;quot;), where the XML and Python output will be&lt;br /&gt;
* Set the environment variables that identify where Teem and ctypeslib are:&lt;br /&gt;
** TEEM is where Teem's &amp;quot;make install&amp;quot; put subdirectories &amp;quot;bin&amp;quot;, &amp;quot;lib&amp;quot;, and &amp;quot;include&amp;quot; (e.g. ~/teem-build)&lt;br /&gt;
** CTYPES is the full path of ctypeslib-gccxml-0.9&lt;br /&gt;
* First create (in, for example, &amp;quot;teem-wrap&amp;quot;) a meta-header for all the Teem header files (in tcsh):&lt;br /&gt;
   mkdir teemincl&lt;br /&gt;
   cp -r ${TEEM}/include/teem teemincl&lt;br /&gt;
   cd teemincl&lt;br /&gt;
   ls -1 teem/*.h | awk '{print &amp;quot;#include &amp;lt;&amp;quot;$1&amp;quot;&amp;gt;&amp;quot;}' &amp;gt; all.h&lt;br /&gt;
   cd ..&lt;br /&gt;
* Then create teem.xml:&lt;br /&gt;
   setenv PYTHONPATH $CTYPES&lt;br /&gt;
   python $CTYPES/scripts/h2xml.py `pwd`/teemincl/all.h -I teemincl -o teem.xml &lt;br /&gt;
* Then create teem.py (use DYLD_LIBRARY_PATH in a mac):&lt;br /&gt;
   setenv LD_LIBRARY_PATH ${TEEM}/lib&lt;br /&gt;
   python $CTYPES/scripts/xml2py.py teem.xml -llibteem.so -o teem.py \&lt;br /&gt;
        -r &amp;quot;(air|hest|biff|nrrd|ell|unrrdu|moss|gage|bane|limn|seek|hoover|echo|ten|dye|mite).*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===LEVMAR===&lt;br /&gt;
&lt;br /&gt;
* The 2-tensor tractography depends on Levenberg-Marquardt nonlinear optimization of Sharon Peled's constrained two-tensor model. I used the following implementation for it: http://www.ics.forth.gr/~lourakis/levmar/&lt;br /&gt;
* This code is enabled by compiling Teem with TEEM_LEVMAR defined. The include paths and library link paths need also be defined for everything to work.&lt;br /&gt;
* There are problems compiling LEVMAR with cmake. I found no way to create a build of levmar that allows Teem to say in Teem's CMakeLists.txt simply: FIND_PACKAGE(LEVMAR)). Therefore I compiled levmar myself and then changed Teem's CMake stuff so that the user sets the Teem_LEVMAR_LIB and Teem_LEVMAR_IPATH variables directly (so that the user does by hand what's normally done by &amp;quot;FIND_PACKAGE(LEVMAR)&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
==Status/Progress==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=0&lt;br /&gt;
|- bgcolor=&amp;quot;#abcdef&amp;quot;&lt;br /&gt;
! Month !! Week #  !! Start Date - End Date !! Done !! Date Done&lt;br /&gt;
|-&lt;br /&gt;
|height=5|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | NA-MIC Project Week in Salt Lake City ([http://www.na-mic.org/Wiki/index.php/2009_Winter_Project_Week]) ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! January !!  | Week 2 || 05.01 - 11.01 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | IGT Project Week ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 50 || 08.12 - 14.12 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! December !!  | Week 49 || 01.12 - 07.12 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to compile teem with levmar (= Levenberg-Marquardt nonlinear least squares algorithm) ||align=&amp;quot;center&amp;quot; | x || Mon Dec, 1st&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 48 !! 24.11 - 30.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | document the results of the two-tensor tractography given a tensor volume ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to do mutli trace tractography given a DWI volume ||align=&amp;quot;center&amp;quot; | x || Mon Nov, 17th&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 47 !! 17.11 - 23.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Working on Python tractography module for multi fiber tracing given a tensor volume ||align=&amp;quot;center&amp;quot; | x || Mon Nov, 17th&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 46 !! 10.11 - 16.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Get vertex data out of the nvert nrrd filled by the tractography back to Slicer ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to pass image data from Python to Teem through nrrdWrap_nva function ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to generate a list of point locations that were used as tractography seedpoints in the VTK tractography ||align=&amp;quot;center&amp;quot; | x || Thu Nov, 13th&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Implement Python tractography module for single fiber tracing given a seeding starting point and a tensor volume ||align=&amp;quot;center&amp;quot; | x || Fri, Nov, 7th&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 45 || 03.11 - 09.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to get image data from numpy (= Python package) to Teem nrrd struct ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! November !!  | Week 44 || 27.10 - 02.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;20px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to get image data from numpy (= Python package) to Teem nrrd struct ||align=&amp;quot;center&amp;quot; | x ||&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !!  Week 43 || 20.10 - 26.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to access DWI volumes through Python ||align=&amp;quot;center&amp;quot; | x || Fri Oct, 17th&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Get Teem wrapped in Python ||align=&amp;quot;center&amp;quot; | x || Fri Oct, 19th&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 42 || 13.10 - 19.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Try to implement the seeding part of the (VTK) one-tensor tractography module in Python || align=&amp;quot;center&amp;quot; | x || Tue Oct, 14th&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 41 || 06.10 - 12.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
|height=10|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Try to implement the seeding part of the (VTK) one-tensor tractography module in Python || align=&amp;quot;center&amp;quot; | x || Tue Oct, 14th&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! October !!  Week 40 || 29.09 - 5.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;20px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; |Totally understand existing Python modules in Slicer || align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; |understand existing one-tensor streamline tractography in Slicer (VTK) || align=&amp;quot;center&amp;quot; | x || Tue Sep, 23rd &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Totally understand existing Python modules in Slicer ||align=&amp;quot;center&amp;quot; | x || Tue Sep, 23rd&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !!  Week 39 || 22.09 - 28.09 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; | Slicer &amp;amp; Python Tutorials || align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; | Enable Python in Slicer || align=&amp;quot;center&amp;quot; | x || Mon Sep, 22nd&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot; &lt;br /&gt;
! September !! Week 38 || 14.09 - 21.09 || ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Information==&lt;br /&gt;
* Diffusion Tensor Analysis in Slicer: http://www.na-mic.org/Wiki/images/0/04/Slicer3diffusionTutorial7.pdf&lt;br /&gt;
* Building a Slicer 3 Module GUI: http://www.slicer.org/pages/Building_a_Slicer_3_Module_GUI&lt;br /&gt;
&lt;br /&gt;
Python:&lt;br /&gt;
* SlicerWiki about Python: http://www.slicer.org/slicerWiki/index.php/Slicer3::Python&lt;br /&gt;
* Python example modules in Slicer: http://www.slicer.org/slicerWiki/index.php/Slicer3:Execution_Model_Documentation:Python&lt;/div&gt;</summary>
		<author><name>Mseeland</name></author>
		
	</entry>
	<entry>
		<id>https://www.na-mic.org/w/index.php?title=User:Mseeland&amp;diff=34659</id>
		<title>User:Mseeland</title>
		<link rel="alternate" type="text/html" href="https://www.na-mic.org/w/index.php?title=User:Mseeland&amp;diff=34659"/>
		<updated>2009-01-08T19:17:17Z</updated>

		<summary type="html">&lt;p&gt;Mseeland: /* Status/Progress */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Wiki of Madeleine Seeland =&lt;br /&gt;
&lt;br /&gt;
== General Information ==&lt;br /&gt;
&lt;br /&gt;
===About myself===&lt;br /&gt;
I am a grad student of Management Information Systems at the University of Mannheim, Germany. I'm involved in the Diffusion Tensor Imaging (DTI) project in the Laboratory of Mathematics in Imaging. Currently I'm working on two-tensor tractograohy for Neurosurgery. I will document my research experience as a diploma thesis, which I need for completing my studies in Germany.&lt;br /&gt;
&lt;br /&gt;
===Contact information===&lt;br /&gt;
E-mail: mseeland (at sign) bwh.harvard.edu&lt;br /&gt;
&lt;br /&gt;
===Collaborators &amp;amp; Contacts===&lt;br /&gt;
* Supervisors: C-F Westin, Nobuhiko Hata&lt;br /&gt;
* Gordon  Kindlmann (Teem)&lt;br /&gt;
* Sharon Peled&lt;br /&gt;
* Alireza Radmanesh&lt;br /&gt;
* Isaiah Norton&lt;br /&gt;
* Regarding Python: Steve Pieper, Julien de Siebenthal, Sylvain Bouix, Demian Wassermann&lt;br /&gt;
&lt;br /&gt;
==Project: Two-Tensor Tractography integration into Slicer==&lt;br /&gt;
&lt;br /&gt;
===Project Description===&lt;br /&gt;
*  Integration of Two-Tensor Tractography into Slicer using Python&lt;br /&gt;
*  Use of existing tractography methods in Teem (http://teem.sourceforge.net/)&lt;br /&gt;
*  My part: Interface between Python and Slicer&lt;br /&gt;
** pass data from VTK to Python to Teem&lt;br /&gt;
** make use of Teem tractography function calls&lt;br /&gt;
** pass resulting fiber data from Teem to Python to VTK and display fiber tracts in Slicer  &lt;br /&gt;
*  The Teem Python API will be provided by Gordon Kindlmann&lt;br /&gt;
&lt;br /&gt;
===How to enable Python in Slicer 3.3===&lt;br /&gt;
*  The current version of Slicer, Slicer 3.2, does not support Python. In order to use Python you need to install Slicer 3.3.&lt;br /&gt;
&lt;br /&gt;
*  To build Slicer Version 3.3, just do the following two commands:&lt;br /&gt;
  svn co http://svn.slicer.org/Slicer3/trunk Slicer3&lt;br /&gt;
  ./Slicer3/Scripts/getbuildtest.tcl&lt;br /&gt;
&lt;br /&gt;
*  In Slicer 3.3, Python support is disabled by default. In order to enable Python, just follow the next steps:&lt;br /&gt;
&lt;br /&gt;
# Edit slicer_variables.tcl&lt;br /&gt;
## Change &amp;quot;set ::USE_PYTHON &amp;quot;off&amp;quot;&amp;quot; to &amp;quot;on&amp;quot;&lt;br /&gt;
# '''Optional:''' If you prefer to use your system Python installation, see here: [http://www.slicer.org/slicerWiki/index.php/Slicer3::Python] &lt;br /&gt;
# '''Optional:''' installing SciPy, see here: [http://www.slicer.org/slicerWiki/index.php/Slicer3::Python]. However, there are still problems adding scipy in Slicer, whcih are not fixed yet.&lt;br /&gt;
&lt;br /&gt;
*  Rebuild Slicer3 using &amp;quot;getbuildtest.tcl&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 ./Slicer3/Scripts/getbuildtest.tcl&lt;br /&gt;
&lt;br /&gt;
A new menu command '''Python Interpreter''' should appear on the Window menu in Slicer. This command should bring up the Python Console window.&lt;br /&gt;
&lt;br /&gt;
===Teem Python wrapping===&lt;br /&gt;
&lt;br /&gt;
====BACKGROUND====&lt;br /&gt;
* Teem Python wrapping is needed to make use of existing Two-Tensor tractography functions in Teem in Python&lt;br /&gt;
* The Python wrappings are based on ctypes, as well as a ctypes code generator (called &amp;quot;ctypeslib&amp;quot;)&lt;br /&gt;
** http://python.net/crew/theller/ctypes&lt;br /&gt;
** http://starship.python.net/crew/theller/wiki/CodeGenerator&lt;br /&gt;
** http://starship.python.net/crew/theller/ctypes/old/codegen.html&lt;br /&gt;
* Ctypes is a standard part of python, by which C functions in a shared library can be called from Python&lt;br /&gt;
* The ctypes code generator converts declarations in C header files into executable Python code: enums, structs, unions, function declarations, com interfaces, and preprocessor definitions.&lt;br /&gt;
* Creating wrappers for C header file(s) is a two step process. &lt;br /&gt;
** First, the ``h2xml.py`` script runs GCC-XML_ over the include file(s), creating a XML file containing declarations and definitions.  &lt;br /&gt;
** Second, the ``xml2py.py`` script parses the XML files and creates Python code containing all or a subset of these definitions.&lt;br /&gt;
* Python code is generated for C enums, structure, unions, typedefs and function declarations.&lt;br /&gt;
&lt;br /&gt;
====REQUIREMENTS====&lt;br /&gt;
* Ctypeslib: ctypeslib is an extension package for ctypes. It contains a ctypes code generator.&lt;br /&gt;
* GCC-XML (from http://www.gccxml.org/) is required to parse C header files into an XML description.&lt;br /&gt;
&lt;br /&gt;
====GETTING THE SOFTWARE====&lt;br /&gt;
* Python 2.6 can be got here (anything after 2.5 should work): http://www.python.org/download/&lt;br /&gt;
* Get gccxml (I used version 0.9.0), which can be got by CVS as described here: http://www.gccxml.org/HTML/Download.html&lt;br /&gt;
** follow the installation as described here: http://www.gccxml.org/HTML/Install.html&lt;br /&gt;
* use a version of ctypeslib which work with the version of gccxml: &lt;br /&gt;
  http://svn.python.org/projects/ctypes/branches/ctypeslib-gccxml-0.9&lt;br /&gt;
* But this requires some patches to work; the content of the &amp;quot;fixes.patch&amp;quot; file can be found here: [[http://wiki.na-mic.org/Wiki/images/3/3b/Fixes.patch.txt]]:&lt;br /&gt;
   svn co http://svn.python.org/projects/ctypes/branches/ctypeslib-gccxml-0.9&lt;br /&gt;
   cd ctypeslib-gccxml-0.9&lt;br /&gt;
   patch -p0 &amp;lt; ../fixes.patch&lt;br /&gt;
   cd ..&lt;br /&gt;
* ctypeslib is written in python =&amp;gt; there's nothing new to compile at this point&lt;br /&gt;
&lt;br /&gt;
====CREATING PYTHON/TEEM====&lt;br /&gt;
* First get Teem (starting from whatever directory should contain the &amp;quot;teem&amp;quot; source dir):&lt;br /&gt;
  svn co https://teem.svn.sourceforge.net/svnroot/teem/teem/trunk teem&lt;br /&gt;
and compile it as a shared library.  Directions for doing this with cmake are here:&lt;br /&gt;
  http://teem.sourceforge.net/build.html&lt;br /&gt;
* create the wrappings in a new directory (e.g. &amp;quot;teem-wrap&amp;quot;), where the XML and Python output will be&lt;br /&gt;
* Set the environment variables that identify where Teem and ctypeslib are:&lt;br /&gt;
** TEEM is where Teem's &amp;quot;make install&amp;quot; put subdirectories &amp;quot;bin&amp;quot;, &amp;quot;lib&amp;quot;, and &amp;quot;include&amp;quot; (e.g. ~/teem-build)&lt;br /&gt;
** CTYPES is the full path of ctypeslib-gccxml-0.9&lt;br /&gt;
* First create (in, for example, &amp;quot;teem-wrap&amp;quot;) a meta-header for all the Teem header files (in tcsh):&lt;br /&gt;
   mkdir teemincl&lt;br /&gt;
   cp -r ${TEEM}/include/teem teemincl&lt;br /&gt;
   cd teemincl&lt;br /&gt;
   ls -1 teem/*.h | awk '{print &amp;quot;#include &amp;lt;&amp;quot;$1&amp;quot;&amp;gt;&amp;quot;}' &amp;gt; all.h&lt;br /&gt;
   cd ..&lt;br /&gt;
* Then create teem.xml:&lt;br /&gt;
   setenv PYTHONPATH $CTYPES&lt;br /&gt;
   python $CTYPES/scripts/h2xml.py `pwd`/teemincl/all.h -I teemincl -o teem.xml &lt;br /&gt;
* Then create teem.py (use DYLD_LIBRARY_PATH in a mac):&lt;br /&gt;
   setenv LD_LIBRARY_PATH ${TEEM}/lib&lt;br /&gt;
   python $CTYPES/scripts/xml2py.py teem.xml -llibteem.so -o teem.py \&lt;br /&gt;
        -r &amp;quot;(air|hest|biff|nrrd|ell|unrrdu|moss|gage|bane|limn|seek|hoover|echo|ten|dye|mite).*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===LEVMAR===&lt;br /&gt;
&lt;br /&gt;
* The 2-tensor tractography depends on Levenberg-Marquardt nonlinear optimization of Sharon Peled's constrained two-tensor model. I used the following implementation for it: http://www.ics.forth.gr/~lourakis/levmar/&lt;br /&gt;
* This code is enabled by compiling Teem with TEEM_LEVMAR defined. The include paths and library link paths need also be defined for everything to work.&lt;br /&gt;
* There are problems compiling LEVMAR with cmake. I found no way to create a build of levmar that allows Teem to say in Teem's CMakeLists.txt simply: FIND_PACKAGE(LEVMAR)). Therefore I compiled levmar myself and then changed Teem's CMake stuff so that the user sets the Teem_LEVMAR_LIB and Teem_LEVMAR_IPATH variables directly (so that the user does by hand what's normally done by &amp;quot;FIND_PACKAGE(LEVMAR)&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
==Status/Progress==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=0&lt;br /&gt;
|- bgcolor=&amp;quot;#abcdef&amp;quot;&lt;br /&gt;
! Month !! Week #  !! Start Date - End Date !! Done !! Date Done&lt;br /&gt;
|-&lt;br /&gt;
|height=5|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | NA-MIC Project Week in Salt Lake City (http://www.na-mic.org/Wiki/index.php/2009_Winter_Project_Week) ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! January !!  | Week 2 || 05.01 - 11.01 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | IGT Project Week ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 50 || 08.12 - 14.12 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! December !!  | Week 49 || 01.12 - 07.12 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to compile teem with levmar (= Levenberg-Marquardt nonlinear least squares algorithm) ||align=&amp;quot;center&amp;quot; | x || Mon Dec, 1st&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 48 !! 24.11 - 30.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | document the results of the two-tensor tractography given a tensor volume ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to do mutli trace tractography given a DWI volume ||align=&amp;quot;center&amp;quot; | x || Mon Nov, 17th&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 47 !! 17.11 - 23.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Working on Python tractography module for multi fiber tracing given a tensor volume ||align=&amp;quot;center&amp;quot; | x || Mon Nov, 17th&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 46 !! 10.11 - 16.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Get vertex data out of the nvert nrrd filled by the tractography back to Slicer ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to pass image data from Python to Teem through nrrdWrap_nva function ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to generate a list of point locations that were used as tractography seedpoints in the VTK tractography ||align=&amp;quot;center&amp;quot; | x || Thu Nov, 13th&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Implement Python tractography module for single fiber tracing given a seeding starting point and a tensor volume ||align=&amp;quot;center&amp;quot; | x || Fri, Nov, 7th&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 45 || 03.11 - 09.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to get image data from numpy (= Python package) to Teem nrrd struct ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! November !!  | Week 44 || 27.10 - 02.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;20px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to get image data from numpy (= Python package) to Teem nrrd struct ||align=&amp;quot;center&amp;quot; | x ||&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !!  Week 43 || 20.10 - 26.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to access DWI volumes through Python ||align=&amp;quot;center&amp;quot; | x || Fri Oct, 17th&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Get Teem wrapped in Python ||align=&amp;quot;center&amp;quot; | x || Fri Oct, 19th&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 42 || 13.10 - 19.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Try to implement the seeding part of the (VTK) one-tensor tractography module in Python || align=&amp;quot;center&amp;quot; | x || Tue Oct, 14th&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 41 || 06.10 - 12.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
|height=10|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Try to implement the seeding part of the (VTK) one-tensor tractography module in Python || align=&amp;quot;center&amp;quot; | x || Tue Oct, 14th&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! October !!  Week 40 || 29.09 - 5.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;20px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; |Totally understand existing Python modules in Slicer || align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; |understand existing one-tensor streamline tractography in Slicer (VTK) || align=&amp;quot;center&amp;quot; | x || Tue Sep, 23rd &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Totally understand existing Python modules in Slicer ||align=&amp;quot;center&amp;quot; | x || Tue Sep, 23rd&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !!  Week 39 || 22.09 - 28.09 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; | Slicer &amp;amp; Python Tutorials || align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; | Enable Python in Slicer || align=&amp;quot;center&amp;quot; | x || Mon Sep, 22nd&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot; &lt;br /&gt;
! September !! Week 38 || 14.09 - 21.09 || ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Information==&lt;br /&gt;
* Diffusion Tensor Analysis in Slicer: http://www.na-mic.org/Wiki/images/0/04/Slicer3diffusionTutorial7.pdf&lt;br /&gt;
* Building a Slicer 3 Module GUI: http://www.slicer.org/pages/Building_a_Slicer_3_Module_GUI&lt;br /&gt;
&lt;br /&gt;
Python:&lt;br /&gt;
* SlicerWiki about Python: http://www.slicer.org/slicerWiki/index.php/Slicer3::Python&lt;br /&gt;
* Python example modules in Slicer: http://www.slicer.org/slicerWiki/index.php/Slicer3:Execution_Model_Documentation:Python&lt;/div&gt;</summary>
		<author><name>Mseeland</name></author>
		
	</entry>
	<entry>
		<id>https://www.na-mic.org/w/index.php?title=User:Mseeland&amp;diff=34658</id>
		<title>User:Mseeland</title>
		<link rel="alternate" type="text/html" href="https://www.na-mic.org/w/index.php?title=User:Mseeland&amp;diff=34658"/>
		<updated>2009-01-08T19:16:45Z</updated>

		<summary type="html">&lt;p&gt;Mseeland: /* Status/Progress */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Wiki of Madeleine Seeland =&lt;br /&gt;
&lt;br /&gt;
== General Information ==&lt;br /&gt;
&lt;br /&gt;
===About myself===&lt;br /&gt;
I am a grad student of Management Information Systems at the University of Mannheim, Germany. I'm involved in the Diffusion Tensor Imaging (DTI) project in the Laboratory of Mathematics in Imaging. Currently I'm working on two-tensor tractograohy for Neurosurgery. I will document my research experience as a diploma thesis, which I need for completing my studies in Germany.&lt;br /&gt;
&lt;br /&gt;
===Contact information===&lt;br /&gt;
E-mail: mseeland (at sign) bwh.harvard.edu&lt;br /&gt;
&lt;br /&gt;
===Collaborators &amp;amp; Contacts===&lt;br /&gt;
* Supervisors: C-F Westin, Nobuhiko Hata&lt;br /&gt;
* Gordon  Kindlmann (Teem)&lt;br /&gt;
* Sharon Peled&lt;br /&gt;
* Alireza Radmanesh&lt;br /&gt;
* Isaiah Norton&lt;br /&gt;
* Regarding Python: Steve Pieper, Julien de Siebenthal, Sylvain Bouix, Demian Wassermann&lt;br /&gt;
&lt;br /&gt;
==Project: Two-Tensor Tractography integration into Slicer==&lt;br /&gt;
&lt;br /&gt;
===Project Description===&lt;br /&gt;
*  Integration of Two-Tensor Tractography into Slicer using Python&lt;br /&gt;
*  Use of existing tractography methods in Teem (http://teem.sourceforge.net/)&lt;br /&gt;
*  My part: Interface between Python and Slicer&lt;br /&gt;
** pass data from VTK to Python to Teem&lt;br /&gt;
** make use of Teem tractography function calls&lt;br /&gt;
** pass resulting fiber data from Teem to Python to VTK and display fiber tracts in Slicer  &lt;br /&gt;
*  The Teem Python API will be provided by Gordon Kindlmann&lt;br /&gt;
&lt;br /&gt;
===How to enable Python in Slicer 3.3===&lt;br /&gt;
*  The current version of Slicer, Slicer 3.2, does not support Python. In order to use Python you need to install Slicer 3.3.&lt;br /&gt;
&lt;br /&gt;
*  To build Slicer Version 3.3, just do the following two commands:&lt;br /&gt;
  svn co http://svn.slicer.org/Slicer3/trunk Slicer3&lt;br /&gt;
  ./Slicer3/Scripts/getbuildtest.tcl&lt;br /&gt;
&lt;br /&gt;
*  In Slicer 3.3, Python support is disabled by default. In order to enable Python, just follow the next steps:&lt;br /&gt;
&lt;br /&gt;
# Edit slicer_variables.tcl&lt;br /&gt;
## Change &amp;quot;set ::USE_PYTHON &amp;quot;off&amp;quot;&amp;quot; to &amp;quot;on&amp;quot;&lt;br /&gt;
# '''Optional:''' If you prefer to use your system Python installation, see here: [http://www.slicer.org/slicerWiki/index.php/Slicer3::Python] &lt;br /&gt;
# '''Optional:''' installing SciPy, see here: [http://www.slicer.org/slicerWiki/index.php/Slicer3::Python]. However, there are still problems adding scipy in Slicer, whcih are not fixed yet.&lt;br /&gt;
&lt;br /&gt;
*  Rebuild Slicer3 using &amp;quot;getbuildtest.tcl&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 ./Slicer3/Scripts/getbuildtest.tcl&lt;br /&gt;
&lt;br /&gt;
A new menu command '''Python Interpreter''' should appear on the Window menu in Slicer. This command should bring up the Python Console window.&lt;br /&gt;
&lt;br /&gt;
===Teem Python wrapping===&lt;br /&gt;
&lt;br /&gt;
====BACKGROUND====&lt;br /&gt;
* Teem Python wrapping is needed to make use of existing Two-Tensor tractography functions in Teem in Python&lt;br /&gt;
* The Python wrappings are based on ctypes, as well as a ctypes code generator (called &amp;quot;ctypeslib&amp;quot;)&lt;br /&gt;
** http://python.net/crew/theller/ctypes&lt;br /&gt;
** http://starship.python.net/crew/theller/wiki/CodeGenerator&lt;br /&gt;
** http://starship.python.net/crew/theller/ctypes/old/codegen.html&lt;br /&gt;
* Ctypes is a standard part of python, by which C functions in a shared library can be called from Python&lt;br /&gt;
* The ctypes code generator converts declarations in C header files into executable Python code: enums, structs, unions, function declarations, com interfaces, and preprocessor definitions.&lt;br /&gt;
* Creating wrappers for C header file(s) is a two step process. &lt;br /&gt;
** First, the ``h2xml.py`` script runs GCC-XML_ over the include file(s), creating a XML file containing declarations and definitions.  &lt;br /&gt;
** Second, the ``xml2py.py`` script parses the XML files and creates Python code containing all or a subset of these definitions.&lt;br /&gt;
* Python code is generated for C enums, structure, unions, typedefs and function declarations.&lt;br /&gt;
&lt;br /&gt;
====REQUIREMENTS====&lt;br /&gt;
* Ctypeslib: ctypeslib is an extension package for ctypes. It contains a ctypes code generator.&lt;br /&gt;
* GCC-XML (from http://www.gccxml.org/) is required to parse C header files into an XML description.&lt;br /&gt;
&lt;br /&gt;
====GETTING THE SOFTWARE====&lt;br /&gt;
* Python 2.6 can be got here (anything after 2.5 should work): http://www.python.org/download/&lt;br /&gt;
* Get gccxml (I used version 0.9.0), which can be got by CVS as described here: http://www.gccxml.org/HTML/Download.html&lt;br /&gt;
** follow the installation as described here: http://www.gccxml.org/HTML/Install.html&lt;br /&gt;
* use a version of ctypeslib which work with the version of gccxml: &lt;br /&gt;
  http://svn.python.org/projects/ctypes/branches/ctypeslib-gccxml-0.9&lt;br /&gt;
* But this requires some patches to work; the content of the &amp;quot;fixes.patch&amp;quot; file can be found here: [[http://wiki.na-mic.org/Wiki/images/3/3b/Fixes.patch.txt]]:&lt;br /&gt;
   svn co http://svn.python.org/projects/ctypes/branches/ctypeslib-gccxml-0.9&lt;br /&gt;
   cd ctypeslib-gccxml-0.9&lt;br /&gt;
   patch -p0 &amp;lt; ../fixes.patch&lt;br /&gt;
   cd ..&lt;br /&gt;
* ctypeslib is written in python =&amp;gt; there's nothing new to compile at this point&lt;br /&gt;
&lt;br /&gt;
====CREATING PYTHON/TEEM====&lt;br /&gt;
* First get Teem (starting from whatever directory should contain the &amp;quot;teem&amp;quot; source dir):&lt;br /&gt;
  svn co https://teem.svn.sourceforge.net/svnroot/teem/teem/trunk teem&lt;br /&gt;
and compile it as a shared library.  Directions for doing this with cmake are here:&lt;br /&gt;
  http://teem.sourceforge.net/build.html&lt;br /&gt;
* create the wrappings in a new directory (e.g. &amp;quot;teem-wrap&amp;quot;), where the XML and Python output will be&lt;br /&gt;
* Set the environment variables that identify where Teem and ctypeslib are:&lt;br /&gt;
** TEEM is where Teem's &amp;quot;make install&amp;quot; put subdirectories &amp;quot;bin&amp;quot;, &amp;quot;lib&amp;quot;, and &amp;quot;include&amp;quot; (e.g. ~/teem-build)&lt;br /&gt;
** CTYPES is the full path of ctypeslib-gccxml-0.9&lt;br /&gt;
* First create (in, for example, &amp;quot;teem-wrap&amp;quot;) a meta-header for all the Teem header files (in tcsh):&lt;br /&gt;
   mkdir teemincl&lt;br /&gt;
   cp -r ${TEEM}/include/teem teemincl&lt;br /&gt;
   cd teemincl&lt;br /&gt;
   ls -1 teem/*.h | awk '{print &amp;quot;#include &amp;lt;&amp;quot;$1&amp;quot;&amp;gt;&amp;quot;}' &amp;gt; all.h&lt;br /&gt;
   cd ..&lt;br /&gt;
* Then create teem.xml:&lt;br /&gt;
   setenv PYTHONPATH $CTYPES&lt;br /&gt;
   python $CTYPES/scripts/h2xml.py `pwd`/teemincl/all.h -I teemincl -o teem.xml &lt;br /&gt;
* Then create teem.py (use DYLD_LIBRARY_PATH in a mac):&lt;br /&gt;
   setenv LD_LIBRARY_PATH ${TEEM}/lib&lt;br /&gt;
   python $CTYPES/scripts/xml2py.py teem.xml -llibteem.so -o teem.py \&lt;br /&gt;
        -r &amp;quot;(air|hest|biff|nrrd|ell|unrrdu|moss|gage|bane|limn|seek|hoover|echo|ten|dye|mite).*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===LEVMAR===&lt;br /&gt;
&lt;br /&gt;
* The 2-tensor tractography depends on Levenberg-Marquardt nonlinear optimization of Sharon Peled's constrained two-tensor model. I used the following implementation for it: http://www.ics.forth.gr/~lourakis/levmar/&lt;br /&gt;
* This code is enabled by compiling Teem with TEEM_LEVMAR defined. The include paths and library link paths need also be defined for everything to work.&lt;br /&gt;
* There are problems compiling LEVMAR with cmake. I found no way to create a build of levmar that allows Teem to say in Teem's CMakeLists.txt simply: FIND_PACKAGE(LEVMAR)). Therefore I compiled levmar myself and then changed Teem's CMake stuff so that the user sets the Teem_LEVMAR_LIB and Teem_LEVMAR_IPATH variables directly (so that the user does by hand what's normally done by &amp;quot;FIND_PACKAGE(LEVMAR)&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
==Status/Progress==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=0&lt;br /&gt;
|- bgcolor=&amp;quot;#abcdef&amp;quot;&lt;br /&gt;
! Month !! Week #  !! Start Date - End Date !! Done !! Date Done&lt;br /&gt;
|-&lt;br /&gt;
|height=5|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | NA-MIC Project Week in Salt Lake City ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! January !!  | Week 2 || 05.01 - 11.01 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | IGT Project Week ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 50 || 08.12 - 14.12 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! December !!  | Week 49 || 01.12 - 07.12 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to compile teem with levmar (= Levenberg-Marquardt nonlinear least squares algorithm) ||align=&amp;quot;center&amp;quot; | x || Mon Dec, 1st&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 48 !! 24.11 - 30.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | document the results of the two-tensor tractography given a tensor volume ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to do mutli trace tractography given a DWI volume ||align=&amp;quot;center&amp;quot; | x || Mon Nov, 17th&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 47 !! 17.11 - 23.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Working on Python tractography module for multi fiber tracing given a tensor volume ||align=&amp;quot;center&amp;quot; | x || Mon Nov, 17th&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 46 !! 10.11 - 16.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Get vertex data out of the nvert nrrd filled by the tractography back to Slicer ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to pass image data from Python to Teem through nrrdWrap_nva function ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to generate a list of point locations that were used as tractography seedpoints in the VTK tractography ||align=&amp;quot;center&amp;quot; | x || Thu Nov, 13th&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Implement Python tractography module for single fiber tracing given a seeding starting point and a tensor volume ||align=&amp;quot;center&amp;quot; | x || Fri, Nov, 7th&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 45 || 03.11 - 09.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to get image data from numpy (= Python package) to Teem nrrd struct ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! November !!  | Week 44 || 27.10 - 02.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;20px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to get image data from numpy (= Python package) to Teem nrrd struct ||align=&amp;quot;center&amp;quot; | x ||&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !!  Week 43 || 20.10 - 26.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to access DWI volumes through Python ||align=&amp;quot;center&amp;quot; | x || Fri Oct, 17th&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Get Teem wrapped in Python ||align=&amp;quot;center&amp;quot; | x || Fri Oct, 19th&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 42 || 13.10 - 19.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Try to implement the seeding part of the (VTK) one-tensor tractography module in Python || align=&amp;quot;center&amp;quot; | x || Tue Oct, 14th&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 41 || 06.10 - 12.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
|height=10|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Try to implement the seeding part of the (VTK) one-tensor tractography module in Python || align=&amp;quot;center&amp;quot; | x || Tue Oct, 14th&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! October !!  Week 40 || 29.09 - 5.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;20px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; |Totally understand existing Python modules in Slicer || align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; |understand existing one-tensor streamline tractography in Slicer (VTK) || align=&amp;quot;center&amp;quot; | x || Tue Sep, 23rd &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Totally understand existing Python modules in Slicer ||align=&amp;quot;center&amp;quot; | x || Tue Sep, 23rd&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !!  Week 39 || 22.09 - 28.09 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; | Slicer &amp;amp; Python Tutorials || align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; | Enable Python in Slicer || align=&amp;quot;center&amp;quot; | x || Mon Sep, 22nd&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot; &lt;br /&gt;
! September !! Week 38 || 14.09 - 21.09 || ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Information==&lt;br /&gt;
* Diffusion Tensor Analysis in Slicer: http://www.na-mic.org/Wiki/images/0/04/Slicer3diffusionTutorial7.pdf&lt;br /&gt;
* Building a Slicer 3 Module GUI: http://www.slicer.org/pages/Building_a_Slicer_3_Module_GUI&lt;br /&gt;
&lt;br /&gt;
Python:&lt;br /&gt;
* SlicerWiki about Python: http://www.slicer.org/slicerWiki/index.php/Slicer3::Python&lt;br /&gt;
* Python example modules in Slicer: http://www.slicer.org/slicerWiki/index.php/Slicer3:Execution_Model_Documentation:Python&lt;/div&gt;</summary>
		<author><name>Mseeland</name></author>
		
	</entry>
	<entry>
		<id>https://www.na-mic.org/w/index.php?title=User:Mseeland&amp;diff=34656</id>
		<title>User:Mseeland</title>
		<link rel="alternate" type="text/html" href="https://www.na-mic.org/w/index.php?title=User:Mseeland&amp;diff=34656"/>
		<updated>2009-01-08T19:15:57Z</updated>

		<summary type="html">&lt;p&gt;Mseeland: /* Status/Progress */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Wiki of Madeleine Seeland =&lt;br /&gt;
&lt;br /&gt;
== General Information ==&lt;br /&gt;
&lt;br /&gt;
===About myself===&lt;br /&gt;
I am a grad student of Management Information Systems at the University of Mannheim, Germany. I'm involved in the Diffusion Tensor Imaging (DTI) project in the Laboratory of Mathematics in Imaging. Currently I'm working on two-tensor tractograohy for Neurosurgery. I will document my research experience as a diploma thesis, which I need for completing my studies in Germany.&lt;br /&gt;
&lt;br /&gt;
===Contact information===&lt;br /&gt;
E-mail: mseeland (at sign) bwh.harvard.edu&lt;br /&gt;
&lt;br /&gt;
===Collaborators &amp;amp; Contacts===&lt;br /&gt;
* Supervisors: C-F Westin, Nobuhiko Hata&lt;br /&gt;
* Gordon  Kindlmann (Teem)&lt;br /&gt;
* Sharon Peled&lt;br /&gt;
* Alireza Radmanesh&lt;br /&gt;
* Isaiah Norton&lt;br /&gt;
* Regarding Python: Steve Pieper, Julien de Siebenthal, Sylvain Bouix, Demian Wassermann&lt;br /&gt;
&lt;br /&gt;
==Project: Two-Tensor Tractography integration into Slicer==&lt;br /&gt;
&lt;br /&gt;
===Project Description===&lt;br /&gt;
*  Integration of Two-Tensor Tractography into Slicer using Python&lt;br /&gt;
*  Use of existing tractography methods in Teem (http://teem.sourceforge.net/)&lt;br /&gt;
*  My part: Interface between Python and Slicer&lt;br /&gt;
** pass data from VTK to Python to Teem&lt;br /&gt;
** make use of Teem tractography function calls&lt;br /&gt;
** pass resulting fiber data from Teem to Python to VTK and display fiber tracts in Slicer  &lt;br /&gt;
*  The Teem Python API will be provided by Gordon Kindlmann&lt;br /&gt;
&lt;br /&gt;
===How to enable Python in Slicer 3.3===&lt;br /&gt;
*  The current version of Slicer, Slicer 3.2, does not support Python. In order to use Python you need to install Slicer 3.3.&lt;br /&gt;
&lt;br /&gt;
*  To build Slicer Version 3.3, just do the following two commands:&lt;br /&gt;
  svn co http://svn.slicer.org/Slicer3/trunk Slicer3&lt;br /&gt;
  ./Slicer3/Scripts/getbuildtest.tcl&lt;br /&gt;
&lt;br /&gt;
*  In Slicer 3.3, Python support is disabled by default. In order to enable Python, just follow the next steps:&lt;br /&gt;
&lt;br /&gt;
# Edit slicer_variables.tcl&lt;br /&gt;
## Change &amp;quot;set ::USE_PYTHON &amp;quot;off&amp;quot;&amp;quot; to &amp;quot;on&amp;quot;&lt;br /&gt;
# '''Optional:''' If you prefer to use your system Python installation, see here: [http://www.slicer.org/slicerWiki/index.php/Slicer3::Python] &lt;br /&gt;
# '''Optional:''' installing SciPy, see here: [http://www.slicer.org/slicerWiki/index.php/Slicer3::Python]. However, there are still problems adding scipy in Slicer, whcih are not fixed yet.&lt;br /&gt;
&lt;br /&gt;
*  Rebuild Slicer3 using &amp;quot;getbuildtest.tcl&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 ./Slicer3/Scripts/getbuildtest.tcl&lt;br /&gt;
&lt;br /&gt;
A new menu command '''Python Interpreter''' should appear on the Window menu in Slicer. This command should bring up the Python Console window.&lt;br /&gt;
&lt;br /&gt;
===Teem Python wrapping===&lt;br /&gt;
&lt;br /&gt;
====BACKGROUND====&lt;br /&gt;
* Teem Python wrapping is needed to make use of existing Two-Tensor tractography functions in Teem in Python&lt;br /&gt;
* The Python wrappings are based on ctypes, as well as a ctypes code generator (called &amp;quot;ctypeslib&amp;quot;)&lt;br /&gt;
** http://python.net/crew/theller/ctypes&lt;br /&gt;
** http://starship.python.net/crew/theller/wiki/CodeGenerator&lt;br /&gt;
** http://starship.python.net/crew/theller/ctypes/old/codegen.html&lt;br /&gt;
* Ctypes is a standard part of python, by which C functions in a shared library can be called from Python&lt;br /&gt;
* The ctypes code generator converts declarations in C header files into executable Python code: enums, structs, unions, function declarations, com interfaces, and preprocessor definitions.&lt;br /&gt;
* Creating wrappers for C header file(s) is a two step process. &lt;br /&gt;
** First, the ``h2xml.py`` script runs GCC-XML_ over the include file(s), creating a XML file containing declarations and definitions.  &lt;br /&gt;
** Second, the ``xml2py.py`` script parses the XML files and creates Python code containing all or a subset of these definitions.&lt;br /&gt;
* Python code is generated for C enums, structure, unions, typedefs and function declarations.&lt;br /&gt;
&lt;br /&gt;
====REQUIREMENTS====&lt;br /&gt;
* Ctypeslib: ctypeslib is an extension package for ctypes. It contains a ctypes code generator.&lt;br /&gt;
* GCC-XML (from http://www.gccxml.org/) is required to parse C header files into an XML description.&lt;br /&gt;
&lt;br /&gt;
====GETTING THE SOFTWARE====&lt;br /&gt;
* Python 2.6 can be got here (anything after 2.5 should work): http://www.python.org/download/&lt;br /&gt;
* Get gccxml (I used version 0.9.0), which can be got by CVS as described here: http://www.gccxml.org/HTML/Download.html&lt;br /&gt;
** follow the installation as described here: http://www.gccxml.org/HTML/Install.html&lt;br /&gt;
* use a version of ctypeslib which work with the version of gccxml: &lt;br /&gt;
  http://svn.python.org/projects/ctypes/branches/ctypeslib-gccxml-0.9&lt;br /&gt;
* But this requires some patches to work; the content of the &amp;quot;fixes.patch&amp;quot; file can be found here: [[http://wiki.na-mic.org/Wiki/images/3/3b/Fixes.patch.txt]]:&lt;br /&gt;
   svn co http://svn.python.org/projects/ctypes/branches/ctypeslib-gccxml-0.9&lt;br /&gt;
   cd ctypeslib-gccxml-0.9&lt;br /&gt;
   patch -p0 &amp;lt; ../fixes.patch&lt;br /&gt;
   cd ..&lt;br /&gt;
* ctypeslib is written in python =&amp;gt; there's nothing new to compile at this point&lt;br /&gt;
&lt;br /&gt;
====CREATING PYTHON/TEEM====&lt;br /&gt;
* First get Teem (starting from whatever directory should contain the &amp;quot;teem&amp;quot; source dir):&lt;br /&gt;
  svn co https://teem.svn.sourceforge.net/svnroot/teem/teem/trunk teem&lt;br /&gt;
and compile it as a shared library.  Directions for doing this with cmake are here:&lt;br /&gt;
  http://teem.sourceforge.net/build.html&lt;br /&gt;
* create the wrappings in a new directory (e.g. &amp;quot;teem-wrap&amp;quot;), where the XML and Python output will be&lt;br /&gt;
* Set the environment variables that identify where Teem and ctypeslib are:&lt;br /&gt;
** TEEM is where Teem's &amp;quot;make install&amp;quot; put subdirectories &amp;quot;bin&amp;quot;, &amp;quot;lib&amp;quot;, and &amp;quot;include&amp;quot; (e.g. ~/teem-build)&lt;br /&gt;
** CTYPES is the full path of ctypeslib-gccxml-0.9&lt;br /&gt;
* First create (in, for example, &amp;quot;teem-wrap&amp;quot;) a meta-header for all the Teem header files (in tcsh):&lt;br /&gt;
   mkdir teemincl&lt;br /&gt;
   cp -r ${TEEM}/include/teem teemincl&lt;br /&gt;
   cd teemincl&lt;br /&gt;
   ls -1 teem/*.h | awk '{print &amp;quot;#include &amp;lt;&amp;quot;$1&amp;quot;&amp;gt;&amp;quot;}' &amp;gt; all.h&lt;br /&gt;
   cd ..&lt;br /&gt;
* Then create teem.xml:&lt;br /&gt;
   setenv PYTHONPATH $CTYPES&lt;br /&gt;
   python $CTYPES/scripts/h2xml.py `pwd`/teemincl/all.h -I teemincl -o teem.xml &lt;br /&gt;
* Then create teem.py (use DYLD_LIBRARY_PATH in a mac):&lt;br /&gt;
   setenv LD_LIBRARY_PATH ${TEEM}/lib&lt;br /&gt;
   python $CTYPES/scripts/xml2py.py teem.xml -llibteem.so -o teem.py \&lt;br /&gt;
        -r &amp;quot;(air|hest|biff|nrrd|ell|unrrdu|moss|gage|bane|limn|seek|hoover|echo|ten|dye|mite).*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===LEVMAR===&lt;br /&gt;
&lt;br /&gt;
* The 2-tensor tractography depends on Levenberg-Marquardt nonlinear optimization of Sharon Peled's constrained two-tensor model. I used the following implementation for it: http://www.ics.forth.gr/~lourakis/levmar/&lt;br /&gt;
* This code is enabled by compiling Teem with TEEM_LEVMAR defined. The include paths and library link paths need also be defined for everything to work.&lt;br /&gt;
* There are problems compiling LEVMAR with cmake. I found no way to create a build of levmar that allows Teem to say in Teem's CMakeLists.txt simply: FIND_PACKAGE(LEVMAR)). Therefore I compiled levmar myself and then changed Teem's CMake stuff so that the user sets the Teem_LEVMAR_LIB and Teem_LEVMAR_IPATH variables directly (so that the user does by hand what's normally done by &amp;quot;FIND_PACKAGE(LEVMAR)&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
==Status/Progress==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=0&lt;br /&gt;
|- bgcolor=&amp;quot;#abcdef&amp;quot;&lt;br /&gt;
! Month !! Week #  !! Start Date - End Date !! Done !! Date Done&lt;br /&gt;
|-&lt;br /&gt;
|height=5|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! January !!  | Week 2 || 05.01 - 11.01 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | IGT Project Week ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 50 || 08.12 - 14.12 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! December !!  | Week 49 || 01.12 - 07.12 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to compile teem with levmar (= Levenberg-Marquardt nonlinear least squares algorithm) ||align=&amp;quot;center&amp;quot; | x || Mon Dec, 1st&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 48 !! 24.11 - 30.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | document the results of the two-tensor tractography given a tensor volume ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to do mutli trace tractography given a DWI volume ||align=&amp;quot;center&amp;quot; | x || Mon Nov, 17th&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 47 !! 17.11 - 23.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Working on Python tractography module for multi fiber tracing given a tensor volume ||align=&amp;quot;center&amp;quot; | x || Mon Nov, 17th&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 46 !! 10.11 - 16.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Get vertex data out of the nvert nrrd filled by the tractography back to Slicer ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to pass image data from Python to Teem through nrrdWrap_nva function ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to generate a list of point locations that were used as tractography seedpoints in the VTK tractography ||align=&amp;quot;center&amp;quot; | x || Thu Nov, 13th&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Implement Python tractography module for single fiber tracing given a seeding starting point and a tensor volume ||align=&amp;quot;center&amp;quot; | x || Fri, Nov, 7th&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 45 || 03.11 - 09.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to get image data from numpy (= Python package) to Teem nrrd struct ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! November !!  | Week 44 || 27.10 - 02.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;20px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to get image data from numpy (= Python package) to Teem nrrd struct ||align=&amp;quot;center&amp;quot; | x ||&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !!  Week 43 || 20.10 - 26.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to access DWI volumes through Python ||align=&amp;quot;center&amp;quot; | x || Fri Oct, 17th&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Get Teem wrapped in Python ||align=&amp;quot;center&amp;quot; | x || Fri Oct, 19th&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 42 || 13.10 - 19.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Try to implement the seeding part of the (VTK) one-tensor tractography module in Python || align=&amp;quot;center&amp;quot; | x || Tue Oct, 14th&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 41 || 06.10 - 12.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
|height=10|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Try to implement the seeding part of the (VTK) one-tensor tractography module in Python || align=&amp;quot;center&amp;quot; | x || Tue Oct, 14th&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! October !!  Week 40 || 29.09 - 5.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;20px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; |Totally understand existing Python modules in Slicer || align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; |understand existing one-tensor streamline tractography in Slicer (VTK) || align=&amp;quot;center&amp;quot; | x || Tue Sep, 23rd &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Totally understand existing Python modules in Slicer ||align=&amp;quot;center&amp;quot; | x || Tue Sep, 23rd&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !!  Week 39 || 22.09 - 28.09 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; | Slicer &amp;amp; Python Tutorials || align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; | Enable Python in Slicer || align=&amp;quot;center&amp;quot; | x || Mon Sep, 22nd&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot; &lt;br /&gt;
! September !! Week 38 || 14.09 - 21.09 || ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Information==&lt;br /&gt;
* Diffusion Tensor Analysis in Slicer: http://www.na-mic.org/Wiki/images/0/04/Slicer3diffusionTutorial7.pdf&lt;br /&gt;
* Building a Slicer 3 Module GUI: http://www.slicer.org/pages/Building_a_Slicer_3_Module_GUI&lt;br /&gt;
&lt;br /&gt;
Python:&lt;br /&gt;
* SlicerWiki about Python: http://www.slicer.org/slicerWiki/index.php/Slicer3::Python&lt;br /&gt;
* Python example modules in Slicer: http://www.slicer.org/slicerWiki/index.php/Slicer3:Execution_Model_Documentation:Python&lt;/div&gt;</summary>
		<author><name>Mseeland</name></author>
		
	</entry>
	<entry>
		<id>https://www.na-mic.org/w/index.php?title=User:Mseeland&amp;diff=34655</id>
		<title>User:Mseeland</title>
		<link rel="alternate" type="text/html" href="https://www.na-mic.org/w/index.php?title=User:Mseeland&amp;diff=34655"/>
		<updated>2009-01-08T19:15:27Z</updated>

		<summary type="html">&lt;p&gt;Mseeland: /* Status/Progress */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Wiki of Madeleine Seeland =&lt;br /&gt;
&lt;br /&gt;
== General Information ==&lt;br /&gt;
&lt;br /&gt;
===About myself===&lt;br /&gt;
I am a grad student of Management Information Systems at the University of Mannheim, Germany. I'm involved in the Diffusion Tensor Imaging (DTI) project in the Laboratory of Mathematics in Imaging. Currently I'm working on two-tensor tractograohy for Neurosurgery. I will document my research experience as a diploma thesis, which I need for completing my studies in Germany.&lt;br /&gt;
&lt;br /&gt;
===Contact information===&lt;br /&gt;
E-mail: mseeland (at sign) bwh.harvard.edu&lt;br /&gt;
&lt;br /&gt;
===Collaborators &amp;amp; Contacts===&lt;br /&gt;
* Supervisors: C-F Westin, Nobuhiko Hata&lt;br /&gt;
* Gordon  Kindlmann (Teem)&lt;br /&gt;
* Sharon Peled&lt;br /&gt;
* Alireza Radmanesh&lt;br /&gt;
* Isaiah Norton&lt;br /&gt;
* Regarding Python: Steve Pieper, Julien de Siebenthal, Sylvain Bouix, Demian Wassermann&lt;br /&gt;
&lt;br /&gt;
==Project: Two-Tensor Tractography integration into Slicer==&lt;br /&gt;
&lt;br /&gt;
===Project Description===&lt;br /&gt;
*  Integration of Two-Tensor Tractography into Slicer using Python&lt;br /&gt;
*  Use of existing tractography methods in Teem (http://teem.sourceforge.net/)&lt;br /&gt;
*  My part: Interface between Python and Slicer&lt;br /&gt;
** pass data from VTK to Python to Teem&lt;br /&gt;
** make use of Teem tractography function calls&lt;br /&gt;
** pass resulting fiber data from Teem to Python to VTK and display fiber tracts in Slicer  &lt;br /&gt;
*  The Teem Python API will be provided by Gordon Kindlmann&lt;br /&gt;
&lt;br /&gt;
===How to enable Python in Slicer 3.3===&lt;br /&gt;
*  The current version of Slicer, Slicer 3.2, does not support Python. In order to use Python you need to install Slicer 3.3.&lt;br /&gt;
&lt;br /&gt;
*  To build Slicer Version 3.3, just do the following two commands:&lt;br /&gt;
  svn co http://svn.slicer.org/Slicer3/trunk Slicer3&lt;br /&gt;
  ./Slicer3/Scripts/getbuildtest.tcl&lt;br /&gt;
&lt;br /&gt;
*  In Slicer 3.3, Python support is disabled by default. In order to enable Python, just follow the next steps:&lt;br /&gt;
&lt;br /&gt;
# Edit slicer_variables.tcl&lt;br /&gt;
## Change &amp;quot;set ::USE_PYTHON &amp;quot;off&amp;quot;&amp;quot; to &amp;quot;on&amp;quot;&lt;br /&gt;
# '''Optional:''' If you prefer to use your system Python installation, see here: [http://www.slicer.org/slicerWiki/index.php/Slicer3::Python] &lt;br /&gt;
# '''Optional:''' installing SciPy, see here: [http://www.slicer.org/slicerWiki/index.php/Slicer3::Python]. However, there are still problems adding scipy in Slicer, whcih are not fixed yet.&lt;br /&gt;
&lt;br /&gt;
*  Rebuild Slicer3 using &amp;quot;getbuildtest.tcl&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 ./Slicer3/Scripts/getbuildtest.tcl&lt;br /&gt;
&lt;br /&gt;
A new menu command '''Python Interpreter''' should appear on the Window menu in Slicer. This command should bring up the Python Console window.&lt;br /&gt;
&lt;br /&gt;
===Teem Python wrapping===&lt;br /&gt;
&lt;br /&gt;
====BACKGROUND====&lt;br /&gt;
* Teem Python wrapping is needed to make use of existing Two-Tensor tractography functions in Teem in Python&lt;br /&gt;
* The Python wrappings are based on ctypes, as well as a ctypes code generator (called &amp;quot;ctypeslib&amp;quot;)&lt;br /&gt;
** http://python.net/crew/theller/ctypes&lt;br /&gt;
** http://starship.python.net/crew/theller/wiki/CodeGenerator&lt;br /&gt;
** http://starship.python.net/crew/theller/ctypes/old/codegen.html&lt;br /&gt;
* Ctypes is a standard part of python, by which C functions in a shared library can be called from Python&lt;br /&gt;
* The ctypes code generator converts declarations in C header files into executable Python code: enums, structs, unions, function declarations, com interfaces, and preprocessor definitions.&lt;br /&gt;
* Creating wrappers for C header file(s) is a two step process. &lt;br /&gt;
** First, the ``h2xml.py`` script runs GCC-XML_ over the include file(s), creating a XML file containing declarations and definitions.  &lt;br /&gt;
** Second, the ``xml2py.py`` script parses the XML files and creates Python code containing all or a subset of these definitions.&lt;br /&gt;
* Python code is generated for C enums, structure, unions, typedefs and function declarations.&lt;br /&gt;
&lt;br /&gt;
====REQUIREMENTS====&lt;br /&gt;
* Ctypeslib: ctypeslib is an extension package for ctypes. It contains a ctypes code generator.&lt;br /&gt;
* GCC-XML (from http://www.gccxml.org/) is required to parse C header files into an XML description.&lt;br /&gt;
&lt;br /&gt;
====GETTING THE SOFTWARE====&lt;br /&gt;
* Python 2.6 can be got here (anything after 2.5 should work): http://www.python.org/download/&lt;br /&gt;
* Get gccxml (I used version 0.9.0), which can be got by CVS as described here: http://www.gccxml.org/HTML/Download.html&lt;br /&gt;
** follow the installation as described here: http://www.gccxml.org/HTML/Install.html&lt;br /&gt;
* use a version of ctypeslib which work with the version of gccxml: &lt;br /&gt;
  http://svn.python.org/projects/ctypes/branches/ctypeslib-gccxml-0.9&lt;br /&gt;
* But this requires some patches to work; the content of the &amp;quot;fixes.patch&amp;quot; file can be found here: [[http://wiki.na-mic.org/Wiki/images/3/3b/Fixes.patch.txt]]:&lt;br /&gt;
   svn co http://svn.python.org/projects/ctypes/branches/ctypeslib-gccxml-0.9&lt;br /&gt;
   cd ctypeslib-gccxml-0.9&lt;br /&gt;
   patch -p0 &amp;lt; ../fixes.patch&lt;br /&gt;
   cd ..&lt;br /&gt;
* ctypeslib is written in python =&amp;gt; there's nothing new to compile at this point&lt;br /&gt;
&lt;br /&gt;
====CREATING PYTHON/TEEM====&lt;br /&gt;
* First get Teem (starting from whatever directory should contain the &amp;quot;teem&amp;quot; source dir):&lt;br /&gt;
  svn co https://teem.svn.sourceforge.net/svnroot/teem/teem/trunk teem&lt;br /&gt;
and compile it as a shared library.  Directions for doing this with cmake are here:&lt;br /&gt;
  http://teem.sourceforge.net/build.html&lt;br /&gt;
* create the wrappings in a new directory (e.g. &amp;quot;teem-wrap&amp;quot;), where the XML and Python output will be&lt;br /&gt;
* Set the environment variables that identify where Teem and ctypeslib are:&lt;br /&gt;
** TEEM is where Teem's &amp;quot;make install&amp;quot; put subdirectories &amp;quot;bin&amp;quot;, &amp;quot;lib&amp;quot;, and &amp;quot;include&amp;quot; (e.g. ~/teem-build)&lt;br /&gt;
** CTYPES is the full path of ctypeslib-gccxml-0.9&lt;br /&gt;
* First create (in, for example, &amp;quot;teem-wrap&amp;quot;) a meta-header for all the Teem header files (in tcsh):&lt;br /&gt;
   mkdir teemincl&lt;br /&gt;
   cp -r ${TEEM}/include/teem teemincl&lt;br /&gt;
   cd teemincl&lt;br /&gt;
   ls -1 teem/*.h | awk '{print &amp;quot;#include &amp;lt;&amp;quot;$1&amp;quot;&amp;gt;&amp;quot;}' &amp;gt; all.h&lt;br /&gt;
   cd ..&lt;br /&gt;
* Then create teem.xml:&lt;br /&gt;
   setenv PYTHONPATH $CTYPES&lt;br /&gt;
   python $CTYPES/scripts/h2xml.py `pwd`/teemincl/all.h -I teemincl -o teem.xml &lt;br /&gt;
* Then create teem.py (use DYLD_LIBRARY_PATH in a mac):&lt;br /&gt;
   setenv LD_LIBRARY_PATH ${TEEM}/lib&lt;br /&gt;
   python $CTYPES/scripts/xml2py.py teem.xml -llibteem.so -o teem.py \&lt;br /&gt;
        -r &amp;quot;(air|hest|biff|nrrd|ell|unrrdu|moss|gage|bane|limn|seek|hoover|echo|ten|dye|mite).*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===LEVMAR===&lt;br /&gt;
&lt;br /&gt;
* The 2-tensor tractography depends on Levenberg-Marquardt nonlinear optimization of Sharon Peled's constrained two-tensor model. I used the following implementation for it: http://www.ics.forth.gr/~lourakis/levmar/&lt;br /&gt;
* This code is enabled by compiling Teem with TEEM_LEVMAR defined. The include paths and library link paths need also be defined for everything to work.&lt;br /&gt;
* There are problems compiling LEVMAR with cmake. I found no way to create a build of levmar that allows Teem to say in Teem's CMakeLists.txt simply: FIND_PACKAGE(LEVMAR)). Therefore I compiled levmar myself and then changed Teem's CMake stuff so that the user sets the Teem_LEVMAR_LIB and Teem_LEVMAR_IPATH variables directly (so that the user does by hand what's normally done by &amp;quot;FIND_PACKAGE(LEVMAR)&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
==Status/Progress==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=0&lt;br /&gt;
|- bgcolor=&amp;quot;#abcdef&amp;quot;&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! January !!  | Week 2 || 05.01 - 11.01 || ||&lt;br /&gt;
|-&lt;br /&gt;
! Month !! Week #  !! Start Date - End Date !! Done !! Date Done&lt;br /&gt;
|-&lt;br /&gt;
|height=5|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | IGT Project Week ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 50 || 08.12 - 14.12 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! December !!  | Week 49 || 01.12 - 07.12 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to compile teem with levmar (= Levenberg-Marquardt nonlinear least squares algorithm) ||align=&amp;quot;center&amp;quot; | x || Mon Dec, 1st&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 48 !! 24.11 - 30.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | document the results of the two-tensor tractography given a tensor volume ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to do mutli trace tractography given a DWI volume ||align=&amp;quot;center&amp;quot; | x || Mon Nov, 17th&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 47 !! 17.11 - 23.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Working on Python tractography module for multi fiber tracing given a tensor volume ||align=&amp;quot;center&amp;quot; | x || Mon Nov, 17th&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 46 !! 10.11 - 16.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Get vertex data out of the nvert nrrd filled by the tractography back to Slicer ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to pass image data from Python to Teem through nrrdWrap_nva function ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to generate a list of point locations that were used as tractography seedpoints in the VTK tractography ||align=&amp;quot;center&amp;quot; | x || Thu Nov, 13th&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Implement Python tractography module for single fiber tracing given a seeding starting point and a tensor volume ||align=&amp;quot;center&amp;quot; | x || Fri, Nov, 7th&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 45 || 03.11 - 09.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to get image data from numpy (= Python package) to Teem nrrd struct ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! November !!  | Week 44 || 27.10 - 02.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;20px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to get image data from numpy (= Python package) to Teem nrrd struct ||align=&amp;quot;center&amp;quot; | x ||&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !!  Week 43 || 20.10 - 26.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to access DWI volumes through Python ||align=&amp;quot;center&amp;quot; | x || Fri Oct, 17th&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Get Teem wrapped in Python ||align=&amp;quot;center&amp;quot; | x || Fri Oct, 19th&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 42 || 13.10 - 19.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Try to implement the seeding part of the (VTK) one-tensor tractography module in Python || align=&amp;quot;center&amp;quot; | x || Tue Oct, 14th&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 41 || 06.10 - 12.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
|height=10|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Try to implement the seeding part of the (VTK) one-tensor tractography module in Python || align=&amp;quot;center&amp;quot; | x || Tue Oct, 14th&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! October !!  Week 40 || 29.09 - 5.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;20px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; |Totally understand existing Python modules in Slicer || align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; |understand existing one-tensor streamline tractography in Slicer (VTK) || align=&amp;quot;center&amp;quot; | x || Tue Sep, 23rd &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Totally understand existing Python modules in Slicer ||align=&amp;quot;center&amp;quot; | x || Tue Sep, 23rd&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !!  Week 39 || 22.09 - 28.09 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; | Slicer &amp;amp; Python Tutorials || align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; | Enable Python in Slicer || align=&amp;quot;center&amp;quot; | x || Mon Sep, 22nd&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot; &lt;br /&gt;
! September !! Week 38 || 14.09 - 21.09 || ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Information==&lt;br /&gt;
* Diffusion Tensor Analysis in Slicer: http://www.na-mic.org/Wiki/images/0/04/Slicer3diffusionTutorial7.pdf&lt;br /&gt;
* Building a Slicer 3 Module GUI: http://www.slicer.org/pages/Building_a_Slicer_3_Module_GUI&lt;br /&gt;
&lt;br /&gt;
Python:&lt;br /&gt;
* SlicerWiki about Python: http://www.slicer.org/slicerWiki/index.php/Slicer3::Python&lt;br /&gt;
* Python example modules in Slicer: http://www.slicer.org/slicerWiki/index.php/Slicer3:Execution_Model_Documentation:Python&lt;/div&gt;</summary>
		<author><name>Mseeland</name></author>
		
	</entry>
	<entry>
		<id>https://www.na-mic.org/w/index.php?title=User:Mseeland&amp;diff=34320</id>
		<title>User:Mseeland</title>
		<link rel="alternate" type="text/html" href="https://www.na-mic.org/w/index.php?title=User:Mseeland&amp;diff=34320"/>
		<updated>2009-01-06T15:18:54Z</updated>

		<summary type="html">&lt;p&gt;Mseeland: /* LEVMAR */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Wiki of Madeleine Seeland =&lt;br /&gt;
&lt;br /&gt;
== General Information ==&lt;br /&gt;
&lt;br /&gt;
===About myself===&lt;br /&gt;
I am a grad student of Management Information Systems at the University of Mannheim, Germany. I'm involved in the Diffusion Tensor Imaging (DTI) project in the Laboratory of Mathematics in Imaging. Currently I'm working on two-tensor tractograohy for Neurosurgery. I will document my research experience as a diploma thesis, which I need for completing my studies in Germany.&lt;br /&gt;
&lt;br /&gt;
===Contact information===&lt;br /&gt;
E-mail: mseeland (at sign) bwh.harvard.edu&lt;br /&gt;
&lt;br /&gt;
===Collaborators &amp;amp; Contacts===&lt;br /&gt;
* Supervisors: C-F Westin, Nobuhiko Hata&lt;br /&gt;
* Gordon  Kindlmann (Teem)&lt;br /&gt;
* Sharon Peled&lt;br /&gt;
* Alireza Radmanesh&lt;br /&gt;
* Isaiah Norton&lt;br /&gt;
* Regarding Python: Steve Pieper, Julien de Siebenthal, Sylvain Bouix, Demian Wassermann&lt;br /&gt;
&lt;br /&gt;
==Project: Two-Tensor Tractography integration into Slicer==&lt;br /&gt;
&lt;br /&gt;
===Project Description===&lt;br /&gt;
*  Integration of Two-Tensor Tractography into Slicer using Python&lt;br /&gt;
*  Use of existing tractography methods in Teem (http://teem.sourceforge.net/)&lt;br /&gt;
*  My part: Interface between Python and Slicer&lt;br /&gt;
** pass data from VTK to Python to Teem&lt;br /&gt;
** make use of Teem tractography function calls&lt;br /&gt;
** pass resulting fiber data from Teem to Python to VTK and display fiber tracts in Slicer  &lt;br /&gt;
*  The Teem Python API will be provided by Gordon Kindlmann&lt;br /&gt;
&lt;br /&gt;
===How to enable Python in Slicer 3.3===&lt;br /&gt;
*  The current version of Slicer, Slicer 3.2, does not support Python. In order to use Python you need to install Slicer 3.3.&lt;br /&gt;
&lt;br /&gt;
*  To build Slicer Version 3.3, just do the following two commands:&lt;br /&gt;
  svn co http://svn.slicer.org/Slicer3/trunk Slicer3&lt;br /&gt;
  ./Slicer3/Scripts/getbuildtest.tcl&lt;br /&gt;
&lt;br /&gt;
*  In Slicer 3.3, Python support is disabled by default. In order to enable Python, just follow the next steps:&lt;br /&gt;
&lt;br /&gt;
# Edit slicer_variables.tcl&lt;br /&gt;
## Change &amp;quot;set ::USE_PYTHON &amp;quot;off&amp;quot;&amp;quot; to &amp;quot;on&amp;quot;&lt;br /&gt;
# '''Optional:''' If you prefer to use your system Python installation, see here: [http://www.slicer.org/slicerWiki/index.php/Slicer3::Python] &lt;br /&gt;
# '''Optional:''' installing SciPy, see here: [http://www.slicer.org/slicerWiki/index.php/Slicer3::Python]. However, there are still problems adding scipy in Slicer, whcih are not fixed yet.&lt;br /&gt;
&lt;br /&gt;
*  Rebuild Slicer3 using &amp;quot;getbuildtest.tcl&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 ./Slicer3/Scripts/getbuildtest.tcl&lt;br /&gt;
&lt;br /&gt;
A new menu command '''Python Interpreter''' should appear on the Window menu in Slicer. This command should bring up the Python Console window.&lt;br /&gt;
&lt;br /&gt;
===Teem Python wrapping===&lt;br /&gt;
&lt;br /&gt;
====BACKGROUND====&lt;br /&gt;
* Teem Python wrapping is needed to make use of existing Two-Tensor tractography functions in Teem in Python&lt;br /&gt;
* The Python wrappings are based on ctypes, as well as a ctypes code generator (called &amp;quot;ctypeslib&amp;quot;)&lt;br /&gt;
** http://python.net/crew/theller/ctypes&lt;br /&gt;
** http://starship.python.net/crew/theller/wiki/CodeGenerator&lt;br /&gt;
** http://starship.python.net/crew/theller/ctypes/old/codegen.html&lt;br /&gt;
* Ctypes is a standard part of python, by which C functions in a shared library can be called from Python&lt;br /&gt;
* The ctypes code generator converts declarations in C header files into executable Python code: enums, structs, unions, function declarations, com interfaces, and preprocessor definitions.&lt;br /&gt;
* Creating wrappers for C header file(s) is a two step process. &lt;br /&gt;
** First, the ``h2xml.py`` script runs GCC-XML_ over the include file(s), creating a XML file containing declarations and definitions.  &lt;br /&gt;
** Second, the ``xml2py.py`` script parses the XML files and creates Python code containing all or a subset of these definitions.&lt;br /&gt;
* Python code is generated for C enums, structure, unions, typedefs and function declarations.&lt;br /&gt;
&lt;br /&gt;
====REQUIREMENTS====&lt;br /&gt;
* Ctypeslib: ctypeslib is an extension package for ctypes. It contains a ctypes code generator.&lt;br /&gt;
* GCC-XML (from http://www.gccxml.org/) is required to parse C header files into an XML description.&lt;br /&gt;
&lt;br /&gt;
====GETTING THE SOFTWARE====&lt;br /&gt;
* Python 2.6 can be got here (anything after 2.5 should work): http://www.python.org/download/&lt;br /&gt;
* Get gccxml (I used version 0.9.0), which can be got by CVS as described here: http://www.gccxml.org/HTML/Download.html&lt;br /&gt;
** follow the installation as described here: http://www.gccxml.org/HTML/Install.html&lt;br /&gt;
* use a version of ctypeslib which work with the version of gccxml: &lt;br /&gt;
  http://svn.python.org/projects/ctypes/branches/ctypeslib-gccxml-0.9&lt;br /&gt;
* But this requires some patches to work; the content of the &amp;quot;fixes.patch&amp;quot; file can be found here: [[http://wiki.na-mic.org/Wiki/images/3/3b/Fixes.patch.txt]]:&lt;br /&gt;
   svn co http://svn.python.org/projects/ctypes/branches/ctypeslib-gccxml-0.9&lt;br /&gt;
   cd ctypeslib-gccxml-0.9&lt;br /&gt;
   patch -p0 &amp;lt; ../fixes.patch&lt;br /&gt;
   cd ..&lt;br /&gt;
* ctypeslib is written in python =&amp;gt; there's nothing new to compile at this point&lt;br /&gt;
&lt;br /&gt;
====CREATING PYTHON/TEEM====&lt;br /&gt;
* First get Teem (starting from whatever directory should contain the &amp;quot;teem&amp;quot; source dir):&lt;br /&gt;
  svn co https://teem.svn.sourceforge.net/svnroot/teem/teem/trunk teem&lt;br /&gt;
and compile it as a shared library.  Directions for doing this with cmake are here:&lt;br /&gt;
  http://teem.sourceforge.net/build.html&lt;br /&gt;
* create the wrappings in a new directory (e.g. &amp;quot;teem-wrap&amp;quot;), where the XML and Python output will be&lt;br /&gt;
* Set the environment variables that identify where Teem and ctypeslib are:&lt;br /&gt;
** TEEM is where Teem's &amp;quot;make install&amp;quot; put subdirectories &amp;quot;bin&amp;quot;, &amp;quot;lib&amp;quot;, and &amp;quot;include&amp;quot; (e.g. ~/teem-build)&lt;br /&gt;
** CTYPES is the full path of ctypeslib-gccxml-0.9&lt;br /&gt;
* First create (in, for example, &amp;quot;teem-wrap&amp;quot;) a meta-header for all the Teem header files (in tcsh):&lt;br /&gt;
   mkdir teemincl&lt;br /&gt;
   cp -r ${TEEM}/include/teem teemincl&lt;br /&gt;
   cd teemincl&lt;br /&gt;
   ls -1 teem/*.h | awk '{print &amp;quot;#include &amp;lt;&amp;quot;$1&amp;quot;&amp;gt;&amp;quot;}' &amp;gt; all.h&lt;br /&gt;
   cd ..&lt;br /&gt;
* Then create teem.xml:&lt;br /&gt;
   setenv PYTHONPATH $CTYPES&lt;br /&gt;
   python $CTYPES/scripts/h2xml.py `pwd`/teemincl/all.h -I teemincl -o teem.xml &lt;br /&gt;
* Then create teem.py (use DYLD_LIBRARY_PATH in a mac):&lt;br /&gt;
   setenv LD_LIBRARY_PATH ${TEEM}/lib&lt;br /&gt;
   python $CTYPES/scripts/xml2py.py teem.xml -llibteem.so -o teem.py \&lt;br /&gt;
        -r &amp;quot;(air|hest|biff|nrrd|ell|unrrdu|moss|gage|bane|limn|seek|hoover|echo|ten|dye|mite).*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===LEVMAR===&lt;br /&gt;
&lt;br /&gt;
* The 2-tensor tractography depends on Levenberg-Marquardt nonlinear optimization of Sharon Peled's constrained two-tensor model. I used the following implementation for it: http://www.ics.forth.gr/~lourakis/levmar/&lt;br /&gt;
* This code is enabled by compiling Teem with TEEM_LEVMAR defined. The include paths and library link paths need also be defined for everything to work.&lt;br /&gt;
* There are problems compiling LEVMAR with cmake. I found no way to create a build of levmar that allows Teem to say in Teem's CMakeLists.txt simply: FIND_PACKAGE(LEVMAR)). Therefore I compiled levmar myself and then changed Teem's CMake stuff so that the user sets the Teem_LEVMAR_LIB and Teem_LEVMAR_IPATH variables directly (so that the user does by hand what's normally done by &amp;quot;FIND_PACKAGE(LEVMAR)&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
==Status/Progress==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=0&lt;br /&gt;
|- bgcolor=&amp;quot;#abcdef&amp;quot;&lt;br /&gt;
! Month !! Week #  !! Start Date - End Date !! Done !! Date Done&lt;br /&gt;
|-&lt;br /&gt;
|height=5|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | IGT Project Week ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 50 || 08.12 - 14.12 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! December !!  | Week 49 || 01.12 - 07.12 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to compile teem with levmar (= Levenberg-Marquardt nonlinear least squares algorithm) ||align=&amp;quot;center&amp;quot; | x || Mon Dec, 1st&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 48 !! 24.11 - 30.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | document the results of the two-tensor tractography given a tensor volume ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to do mutli trace tractography given a DWI volume ||align=&amp;quot;center&amp;quot; | x || Mon Nov, 17th&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 47 !! 17.11 - 23.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Working on Python tractography module for multi fiber tracing given a tensor volume ||align=&amp;quot;center&amp;quot; | x || Mon Nov, 17th&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 46 !! 10.11 - 16.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Get vertex data out of the nvert nrrd filled by the tractography back to Slicer ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to pass image data from Python to Teem through nrrdWrap_nva function ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to generate a list of point locations that were used as tractography seedpoints in the VTK tractography ||align=&amp;quot;center&amp;quot; | x || Thu Nov, 13th&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Implement Python tractography module for single fiber tracing given a seeding starting point and a tensor volume ||align=&amp;quot;center&amp;quot; | x || Fri, Nov, 7th&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 45 || 03.11 - 09.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to get image data from numpy (= Python package) to Teem nrrd struct ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! November !!  | Week 44 || 27.10 - 02.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;20px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to get image data from numpy (= Python package) to Teem nrrd struct ||align=&amp;quot;center&amp;quot; | x ||&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !!  Week 43 || 20.10 - 26.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to access DWI volumes through Python ||align=&amp;quot;center&amp;quot; | x || Fri Oct, 17th&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Get Teem wrapped in Python ||align=&amp;quot;center&amp;quot; | x || Fri Oct, 19th&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 42 || 13.10 - 19.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Try to implement the seeding part of the (VTK) one-tensor tractography module in Python || align=&amp;quot;center&amp;quot; | x || Tue Oct, 14th&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 41 || 06.10 - 12.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
|height=10|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Try to implement the seeding part of the (VTK) one-tensor tractography module in Python || align=&amp;quot;center&amp;quot; | x || Tue Oct, 14th&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! October !!  Week 40 || 29.09 - 5.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;20px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; |Totally understand existing Python modules in Slicer || align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; |understand existing one-tensor streamline tractography in Slicer (VTK) || align=&amp;quot;center&amp;quot; | x || Tue Sep, 23rd &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Totally understand existing Python modules in Slicer ||align=&amp;quot;center&amp;quot; | x || Tue Sep, 23rd&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !!  Week 39 || 22.09 - 28.09 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; | Slicer &amp;amp; Python Tutorials || align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; | Enable Python in Slicer || align=&amp;quot;center&amp;quot; | x || Mon Sep, 22nd&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot; &lt;br /&gt;
! September !! Week 38 || 14.09 - 21.09 || ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Information==&lt;br /&gt;
* Diffusion Tensor Analysis in Slicer: http://www.na-mic.org/Wiki/images/0/04/Slicer3diffusionTutorial7.pdf&lt;br /&gt;
* Building a Slicer 3 Module GUI: http://www.slicer.org/pages/Building_a_Slicer_3_Module_GUI&lt;br /&gt;
&lt;br /&gt;
Python:&lt;br /&gt;
* SlicerWiki about Python: http://www.slicer.org/slicerWiki/index.php/Slicer3::Python&lt;br /&gt;
* Python example modules in Slicer: http://www.slicer.org/slicerWiki/index.php/Slicer3:Execution_Model_Documentation:Python&lt;/div&gt;</summary>
		<author><name>Mseeland</name></author>
		
	</entry>
	<entry>
		<id>https://www.na-mic.org/w/index.php?title=User:Mseeland&amp;diff=34318</id>
		<title>User:Mseeland</title>
		<link rel="alternate" type="text/html" href="https://www.na-mic.org/w/index.php?title=User:Mseeland&amp;diff=34318"/>
		<updated>2009-01-06T15:03:21Z</updated>

		<summary type="html">&lt;p&gt;Mseeland: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Wiki of Madeleine Seeland =&lt;br /&gt;
&lt;br /&gt;
== General Information ==&lt;br /&gt;
&lt;br /&gt;
===About myself===&lt;br /&gt;
I am a grad student of Management Information Systems at the University of Mannheim, Germany. I'm involved in the Diffusion Tensor Imaging (DTI) project in the Laboratory of Mathematics in Imaging. Currently I'm working on two-tensor tractograohy for Neurosurgery. I will document my research experience as a diploma thesis, which I need for completing my studies in Germany.&lt;br /&gt;
&lt;br /&gt;
===Contact information===&lt;br /&gt;
E-mail: mseeland (at sign) bwh.harvard.edu&lt;br /&gt;
&lt;br /&gt;
===Collaborators &amp;amp; Contacts===&lt;br /&gt;
* Supervisors: C-F Westin, Nobuhiko Hata&lt;br /&gt;
* Gordon  Kindlmann (Teem)&lt;br /&gt;
* Sharon Peled&lt;br /&gt;
* Alireza Radmanesh&lt;br /&gt;
* Isaiah Norton&lt;br /&gt;
* Regarding Python: Steve Pieper, Julien de Siebenthal, Sylvain Bouix, Demian Wassermann&lt;br /&gt;
&lt;br /&gt;
==Project: Two-Tensor Tractography integration into Slicer==&lt;br /&gt;
&lt;br /&gt;
===Project Description===&lt;br /&gt;
*  Integration of Two-Tensor Tractography into Slicer using Python&lt;br /&gt;
*  Use of existing tractography methods in Teem (http://teem.sourceforge.net/)&lt;br /&gt;
*  My part: Interface between Python and Slicer&lt;br /&gt;
** pass data from VTK to Python to Teem&lt;br /&gt;
** make use of Teem tractography function calls&lt;br /&gt;
** pass resulting fiber data from Teem to Python to VTK and display fiber tracts in Slicer  &lt;br /&gt;
*  The Teem Python API will be provided by Gordon Kindlmann&lt;br /&gt;
&lt;br /&gt;
===How to enable Python in Slicer 3.3===&lt;br /&gt;
*  The current version of Slicer, Slicer 3.2, does not support Python. In order to use Python you need to install Slicer 3.3.&lt;br /&gt;
&lt;br /&gt;
*  To build Slicer Version 3.3, just do the following two commands:&lt;br /&gt;
  svn co http://svn.slicer.org/Slicer3/trunk Slicer3&lt;br /&gt;
  ./Slicer3/Scripts/getbuildtest.tcl&lt;br /&gt;
&lt;br /&gt;
*  In Slicer 3.3, Python support is disabled by default. In order to enable Python, just follow the next steps:&lt;br /&gt;
&lt;br /&gt;
# Edit slicer_variables.tcl&lt;br /&gt;
## Change &amp;quot;set ::USE_PYTHON &amp;quot;off&amp;quot;&amp;quot; to &amp;quot;on&amp;quot;&lt;br /&gt;
# '''Optional:''' If you prefer to use your system Python installation, see here: [http://www.slicer.org/slicerWiki/index.php/Slicer3::Python] &lt;br /&gt;
# '''Optional:''' installing SciPy, see here: [http://www.slicer.org/slicerWiki/index.php/Slicer3::Python]. However, there are still problems adding scipy in Slicer, whcih are not fixed yet.&lt;br /&gt;
&lt;br /&gt;
*  Rebuild Slicer3 using &amp;quot;getbuildtest.tcl&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 ./Slicer3/Scripts/getbuildtest.tcl&lt;br /&gt;
&lt;br /&gt;
A new menu command '''Python Interpreter''' should appear on the Window menu in Slicer. This command should bring up the Python Console window.&lt;br /&gt;
&lt;br /&gt;
===Teem Python wrapping===&lt;br /&gt;
&lt;br /&gt;
====BACKGROUND====&lt;br /&gt;
* Teem Python wrapping is needed to make use of existing Two-Tensor tractography functions in Teem in Python&lt;br /&gt;
* The Python wrappings are based on ctypes, as well as a ctypes code generator (called &amp;quot;ctypeslib&amp;quot;)&lt;br /&gt;
** http://python.net/crew/theller/ctypes&lt;br /&gt;
** http://starship.python.net/crew/theller/wiki/CodeGenerator&lt;br /&gt;
** http://starship.python.net/crew/theller/ctypes/old/codegen.html&lt;br /&gt;
* Ctypes is a standard part of python, by which C functions in a shared library can be called from Python&lt;br /&gt;
* The ctypes code generator converts declarations in C header files into executable Python code: enums, structs, unions, function declarations, com interfaces, and preprocessor definitions.&lt;br /&gt;
* Creating wrappers for C header file(s) is a two step process. &lt;br /&gt;
** First, the ``h2xml.py`` script runs GCC-XML_ over the include file(s), creating a XML file containing declarations and definitions.  &lt;br /&gt;
** Second, the ``xml2py.py`` script parses the XML files and creates Python code containing all or a subset of these definitions.&lt;br /&gt;
* Python code is generated for C enums, structure, unions, typedefs and function declarations.&lt;br /&gt;
&lt;br /&gt;
====REQUIREMENTS====&lt;br /&gt;
* Ctypeslib: ctypeslib is an extension package for ctypes. It contains a ctypes code generator.&lt;br /&gt;
* GCC-XML (from http://www.gccxml.org/) is required to parse C header files into an XML description.&lt;br /&gt;
&lt;br /&gt;
====GETTING THE SOFTWARE====&lt;br /&gt;
* Python 2.6 can be got here (anything after 2.5 should work): http://www.python.org/download/&lt;br /&gt;
* Get gccxml (I used version 0.9.0), which can be got by CVS as described here: http://www.gccxml.org/HTML/Download.html&lt;br /&gt;
** follow the installation as described here: http://www.gccxml.org/HTML/Install.html&lt;br /&gt;
* use a version of ctypeslib which work with the version of gccxml: &lt;br /&gt;
  http://svn.python.org/projects/ctypes/branches/ctypeslib-gccxml-0.9&lt;br /&gt;
* But this requires some patches to work; the content of the &amp;quot;fixes.patch&amp;quot; file can be found here: [[http://wiki.na-mic.org/Wiki/images/3/3b/Fixes.patch.txt]]:&lt;br /&gt;
   svn co http://svn.python.org/projects/ctypes/branches/ctypeslib-gccxml-0.9&lt;br /&gt;
   cd ctypeslib-gccxml-0.9&lt;br /&gt;
   patch -p0 &amp;lt; ../fixes.patch&lt;br /&gt;
   cd ..&lt;br /&gt;
* ctypeslib is written in python =&amp;gt; there's nothing new to compile at this point&lt;br /&gt;
&lt;br /&gt;
====CREATING PYTHON/TEEM====&lt;br /&gt;
* First get Teem (starting from whatever directory should contain the &amp;quot;teem&amp;quot; source dir):&lt;br /&gt;
  svn co https://teem.svn.sourceforge.net/svnroot/teem/teem/trunk teem&lt;br /&gt;
and compile it as a shared library.  Directions for doing this with cmake are here:&lt;br /&gt;
  http://teem.sourceforge.net/build.html&lt;br /&gt;
* create the wrappings in a new directory (e.g. &amp;quot;teem-wrap&amp;quot;), where the XML and Python output will be&lt;br /&gt;
* Set the environment variables that identify where Teem and ctypeslib are:&lt;br /&gt;
** TEEM is where Teem's &amp;quot;make install&amp;quot; put subdirectories &amp;quot;bin&amp;quot;, &amp;quot;lib&amp;quot;, and &amp;quot;include&amp;quot; (e.g. ~/teem-build)&lt;br /&gt;
** CTYPES is the full path of ctypeslib-gccxml-0.9&lt;br /&gt;
* First create (in, for example, &amp;quot;teem-wrap&amp;quot;) a meta-header for all the Teem header files (in tcsh):&lt;br /&gt;
   mkdir teemincl&lt;br /&gt;
   cp -r ${TEEM}/include/teem teemincl&lt;br /&gt;
   cd teemincl&lt;br /&gt;
   ls -1 teem/*.h | awk '{print &amp;quot;#include &amp;lt;&amp;quot;$1&amp;quot;&amp;gt;&amp;quot;}' &amp;gt; all.h&lt;br /&gt;
   cd ..&lt;br /&gt;
* Then create teem.xml:&lt;br /&gt;
   setenv PYTHONPATH $CTYPES&lt;br /&gt;
   python $CTYPES/scripts/h2xml.py `pwd`/teemincl/all.h -I teemincl -o teem.xml &lt;br /&gt;
* Then create teem.py (use DYLD_LIBRARY_PATH in a mac):&lt;br /&gt;
   setenv LD_LIBRARY_PATH ${TEEM}/lib&lt;br /&gt;
   python $CTYPES/scripts/xml2py.py teem.xml -llibteem.so -o teem.py \&lt;br /&gt;
        -r &amp;quot;(air|hest|biff|nrrd|ell|unrrdu|moss|gage|bane|limn|seek|hoover|echo|ten|dye|mite).*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===LEVMAR===&lt;br /&gt;
&lt;br /&gt;
* The 2-tensor tractography depends on Levenberg-Marquardt nonlinear optimization of Sharon Peled's constrained two-tensor model. I used the following implementation for it: http://www.ics.forth.gr/~lourakis/levmar/&lt;br /&gt;
* This code is enabled by compiling Teem with TEEM_LEVMAR defined&lt;br /&gt;
&lt;br /&gt;
==Status/Progress==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=0&lt;br /&gt;
|- bgcolor=&amp;quot;#abcdef&amp;quot;&lt;br /&gt;
! Month !! Week #  !! Start Date - End Date !! Done !! Date Done&lt;br /&gt;
|-&lt;br /&gt;
|height=5|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | IGT Project Week ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 50 || 08.12 - 14.12 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! December !!  | Week 49 || 01.12 - 07.12 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to compile teem with levmar (= Levenberg-Marquardt nonlinear least squares algorithm) ||align=&amp;quot;center&amp;quot; | x || Mon Dec, 1st&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 48 !! 24.11 - 30.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | document the results of the two-tensor tractography given a tensor volume ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to do mutli trace tractography given a DWI volume ||align=&amp;quot;center&amp;quot; | x || Mon Nov, 17th&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 47 !! 17.11 - 23.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Working on Python tractography module for multi fiber tracing given a tensor volume ||align=&amp;quot;center&amp;quot; | x || Mon Nov, 17th&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
!bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 46 !! 10.11 - 16.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Get vertex data out of the nvert nrrd filled by the tractography back to Slicer ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to pass image data from Python to Teem through nrrdWrap_nva function ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to generate a list of point locations that were used as tractography seedpoints in the VTK tractography ||align=&amp;quot;center&amp;quot; | x || Thu Nov, 13th&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Implement Python tractography module for single fiber tracing given a seeding starting point and a tensor volume ||align=&amp;quot;center&amp;quot; | x || Fri, Nov, 7th&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 45 || 03.11 - 09.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to get image data from numpy (= Python package) to Teem nrrd struct ||align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|height=&amp;quot;10px&amp;quot; |&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! November !!  | Week 44 || 27.10 - 02.11 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;20px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to get image data from numpy (= Python package) to Teem nrrd struct ||align=&amp;quot;center&amp;quot; | x ||&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !!  Week 43 || 20.10 - 26.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Try to access DWI volumes through Python ||align=&amp;quot;center&amp;quot; | x || Fri Oct, 17th&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; | Get Teem wrapped in Python ||align=&amp;quot;center&amp;quot; | x || Fri Oct, 19th&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 42 || 13.10 - 19.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Try to implement the seeding part of the (VTK) one-tensor tractography module in Python || align=&amp;quot;center&amp;quot; | x || Tue Oct, 14th&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !! Week 41 || 06.10 - 12.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
|height=10|&lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Try to implement the seeding part of the (VTK) one-tensor tractography module in Python || align=&amp;quot;center&amp;quot; | x || Tue Oct, 14th&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot;&lt;br /&gt;
! October !!  Week 40 || 29.09 - 5.10 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;20px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; |Totally understand existing Python modules in Slicer || align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; |understand existing one-tensor streamline tractography in Slicer (VTK) || align=&amp;quot;center&amp;quot; | x || Tue Sep, 23rd &lt;br /&gt;
|-&lt;br /&gt;
| || colspan=&amp;quot;2&amp;quot; |Totally understand existing Python modules in Slicer ||align=&amp;quot;center&amp;quot; | x || Tue Sep, 23rd&lt;br /&gt;
|- bgcolor=&amp;quot;#E8E8E8&amp;quot;&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFFF&amp;quot;| !!  Week 39 || 22.09 - 28.09 || ||&lt;br /&gt;
|-&lt;br /&gt;
| height=&amp;quot;10px&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; | Slicer &amp;amp; Python Tutorials || align=&amp;quot;center&amp;quot; | x || &lt;br /&gt;
|-&lt;br /&gt;
|  || colspan=&amp;quot;2&amp;quot; | Enable Python in Slicer || align=&amp;quot;center&amp;quot; | x || Mon Sep, 22nd&lt;br /&gt;
|- bgcolor=&amp;quot;#D0D0D0&amp;quot; &lt;br /&gt;
! September !! Week 38 || 14.09 - 21.09 || ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Information==&lt;br /&gt;
* Diffusion Tensor Analysis in Slicer: http://www.na-mic.org/Wiki/images/0/04/Slicer3diffusionTutorial7.pdf&lt;br /&gt;
* Building a Slicer 3 Module GUI: http://www.slicer.org/pages/Building_a_Slicer_3_Module_GUI&lt;br /&gt;
&lt;br /&gt;
Python:&lt;br /&gt;
* SlicerWiki about Python: http://www.slicer.org/slicerWiki/index.php/Slicer3::Python&lt;br /&gt;
* Python example modules in Slicer: http://www.slicer.org/slicerWiki/index.php/Slicer3:Execution_Model_Documentation:Python&lt;/div&gt;</summary>
		<author><name>Mseeland</name></author>
		
	</entry>
	<entry>
		<id>https://www.na-mic.org/w/index.php?title=Two-tensor_tractography_in_Slicer_using_Python_and_Teem&amp;diff=34257</id>
		<title>Two-tensor tractography in Slicer using Python and Teem</title>
		<link rel="alternate" type="text/html" href="https://www.na-mic.org/w/index.php?title=Two-tensor_tractography_in_Slicer_using_Python_and_Teem&amp;diff=34257"/>
		<updated>2009-01-05T17:31:46Z</updated>

		<summary type="html">&lt;p&gt;Mseeland: /* Key Investigators */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{|&lt;br /&gt;
|[[Image:NAMIC-SLC.jpg|thumb|320px|Return to [[2009_Winter_Project_Week|Project Week Main Page]] ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Key Investigators===&lt;br /&gt;
* BWH: Madeleine Seeland&lt;br /&gt;
* BWH: Carl-Fredrik Westin&lt;br /&gt;
* BWH: Gordon Kindlmann&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin: 20px;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 27%; float: left; padding-right: 3%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Objective&amp;lt;/h1&amp;gt;&lt;br /&gt;
Our objective is to finalize the integration of the Two-Tensor Streamline Tractography method in [1] into Slicer and to test it on diverse DWI datasets. Furthermore the optimal parameter settings to run the algorithm needs to be investigated.   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 27%; float: left; padding-right: 3%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Approach, Plan&amp;lt;/h1&amp;gt;&lt;br /&gt;
We are integrating the Two-Tensor Streamline Tractography into Slicer. The complete details on the method are summarized in [1].&lt;br /&gt;
&lt;br /&gt;
The implementation of our project is carried out in Python. The Two-Tensor Tractography function calls are already implemented in the Teem library and can be accessed using the Python wrappings for Teem.&lt;br /&gt;
&lt;br /&gt;
Besides the integration of the Two-Tensor Tractography algorithm into Slicer, the optimal parameter settings for the algorithm needs to be investigated.&lt;br /&gt;
&lt;br /&gt;
Furthermore we need to find a way to parallelize the tractography algorithm (one idea is to use IPython).&lt;br /&gt;
&lt;br /&gt;
Another plan is to apply a noise filter on the DWI's before applying the Two-Tensor Tractography algorithm, as this may lead to more accurate fiber results.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 40%; float: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Progress&amp;lt;/h1&amp;gt;&lt;br /&gt;
The implementation of the Two-Tensor Tractography is already finished. Currently I'm testing the algorithm with different parameter settings.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
* [1] Qazi AA, Radmanesh A, O'Donnell L, Kindlmann G, Peled S, Whalen S, Westin CF, Golby AJ. Resolving crossings in the corticospinal tract by two-tensor streamline tractography: method and clinical assessment using fMRI. Neuroimage 2008 &lt;br /&gt;
* [2] Peled S, Friman O, Jolesz F, Westin CF. Geometrically constrained two-tensor model for crossing tracts in DWI. Magnetic Resonance Imaging 2006;24:1263-1270.&lt;/div&gt;</summary>
		<author><name>Mseeland</name></author>
		
	</entry>
	<entry>
		<id>https://www.na-mic.org/w/index.php?title=Two-tensor_tractography_in_Slicer_using_Python_and_Teem&amp;diff=34256</id>
		<title>Two-tensor tractography in Slicer using Python and Teem</title>
		<link rel="alternate" type="text/html" href="https://www.na-mic.org/w/index.php?title=Two-tensor_tractography_in_Slicer_using_Python_and_Teem&amp;diff=34256"/>
		<updated>2009-01-05T17:28:29Z</updated>

		<summary type="html">&lt;p&gt;Mseeland: /* Key Investigators */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{|&lt;br /&gt;
|[[Image:NAMIC-SLC.jpg|thumb|320px|Return to [[2009_Winter_Project_Week|Project Week Main Page]] ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Key Investigators===&lt;br /&gt;
* BWH: Madeleine Seeland&lt;br /&gt;
* BWH: Carl-Fredrik Westin&lt;br /&gt;
* BWH: Gordon Kindlmann&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin: 20px;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 27%; float: left; padding-right: 3%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Objective&amp;lt;/h1&amp;gt;&lt;br /&gt;
Our objective is to finalize the integration of the Two-Tensor Streamline Tractography method in [1] into Slicer and to test it on diverse DWI datasets. Furthermore the optimal parameter settings to run the algorithm needs to be investigated.   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 27%; float: left; padding-right: 3%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Approach, Plan&amp;lt;/h1&amp;gt;&lt;br /&gt;
We are integrating the Two-Tensor Streamline Tractography into Slicer. The complete details on the method are summarized in [1].&lt;br /&gt;
&lt;br /&gt;
The implementation of our project is carried out in Python. The Two-Tensor Tractography function calls are already implemented in the Teem library and can be accessed using the Python wrappings for Teem.&lt;br /&gt;
&lt;br /&gt;
Besides the integration of the Two-Tensor Tractography algorithm into Slicer, the optimal parameter settings for the algorithm needs to be investigated.&lt;br /&gt;
&lt;br /&gt;
Furthermore we need to find a way to parallelize the tractography algorithm (one idea is to use IPython).&lt;br /&gt;
&lt;br /&gt;
Another plan is to apply a noise filter on the DWI's before applying the Two-Tensor Tractography algorithm, as this may lead to more accurate fiber results.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 40%; float: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Progress&amp;lt;/h1&amp;gt;&lt;br /&gt;
The implementation of the Two-Tensor Tractography is already finished. Currently I'm testing the algorithm with different parameter settings and try to find a way to parallelize the algorithm.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
* [1] Qazi AA, Radmanesh A, O'Donnell L, Kindlmann G, Peled S, Whalen S, Westin CF, Golby AJ. Resolving crossings in the corticospinal tract by two-tensor streamline tractography: method and clinical assessment using fMRI. Neuroimage 2008 &lt;br /&gt;
* [2] Peled S, Friman O, Jolesz F, Westin CF. Geometrically constrained two-tensor model for crossing tracts in DWI. Magnetic Resonance Imaging 2006;24:1263-1270.&lt;/div&gt;</summary>
		<author><name>Mseeland</name></author>
		
	</entry>
	<entry>
		<id>https://www.na-mic.org/w/index.php?title=Two-tensor_tractography_in_Slicer_using_Python_and_Teem&amp;diff=34253</id>
		<title>Two-tensor tractography in Slicer using Python and Teem</title>
		<link rel="alternate" type="text/html" href="https://www.na-mic.org/w/index.php?title=Two-tensor_tractography_in_Slicer_using_Python_and_Teem&amp;diff=34253"/>
		<updated>2009-01-05T17:23:51Z</updated>

		<summary type="html">&lt;p&gt;Mseeland: /* Key Investigators */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{|&lt;br /&gt;
|[[Image:NAMIC-SLC.jpg|thumb|320px|Return to [[2009_Winter_Project_Week|Project Week Main Page]] ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Key Investigators===&lt;br /&gt;
* BWH: Madeleine Seeland&lt;br /&gt;
* BWH: Carl-Fredrik Westin&lt;br /&gt;
* BWH: Gordon Kindlmann&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin: 20px;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 27%; float: left; padding-right: 3%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Objective&amp;lt;/h1&amp;gt;&lt;br /&gt;
Our objective is to finalize the integration of the Two-Tensor Streamline Tractography method in [1] into Slicer and to test it on diverse DWI datasets. Furthermore the optimal parameter settings to run the algorithm needs to be investigated.   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 27%; float: left; padding-right: 3%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Approach, Plan&amp;lt;/h1&amp;gt;&lt;br /&gt;
We are integrating the Two-Tensor Streamline Tractography into Slicer. The complete details on the method are summarized in [1].&lt;br /&gt;
&lt;br /&gt;
The implementation of our project is carried out in Python. The Two-Tensor Tractography function calls are already implemented in the Teem library and can be accessed using the Python wrappings for Teem which are based on ctypes. &lt;br /&gt;
&lt;br /&gt;
Besides the integration of the Two-Tensor Tractography algorithm into Slicer, the optimal parameter settings for the algorithm needs to be investigated.&lt;br /&gt;
&lt;br /&gt;
Furthermore we need to find a way to parallelize the tractography algorithm (one idea is to use IPython).&lt;br /&gt;
&lt;br /&gt;
Another plan is to apply a noise filter on the DWI's before applying the Two-Tensor Tractography algorithm, as this may lead to more accurate fiber results.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 40%; float: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Progress&amp;lt;/h1&amp;gt;&lt;br /&gt;
The implementation of the Two-Tensor Tractography is already finished. Currently I'm testing the algorithm with different parameter settings and try to find a way to parallelize the algorithm.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
* [1] Qazi AA, Radmanesh A, O'Donnell L, Kindlmann G, Peled S, Whalen S, Westin CF, Golby AJ. Resolving crossings in the corticospinal tract by two-tensor streamline tractography: method and clinical assessment using fMRI. Neuroimage 2008 &lt;br /&gt;
* [2] Peled S, Friman O, Jolesz F, Westin CF. Geometrically constrained two-tensor model for crossing tracts in DWI. Magnetic Resonance Imaging 2006;24:1263-1270.&lt;/div&gt;</summary>
		<author><name>Mseeland</name></author>
		
	</entry>
	<entry>
		<id>https://www.na-mic.org/w/index.php?title=Two-tensor_tractography_in_Slicer_using_Python_and_Teem&amp;diff=34252</id>
		<title>Two-tensor tractography in Slicer using Python and Teem</title>
		<link rel="alternate" type="text/html" href="https://www.na-mic.org/w/index.php?title=Two-tensor_tractography_in_Slicer_using_Python_and_Teem&amp;diff=34252"/>
		<updated>2009-01-05T17:23:21Z</updated>

		<summary type="html">&lt;p&gt;Mseeland: /* Key Investigators */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{|&lt;br /&gt;
|[[Image:NAMIC-SLC.jpg|thumb|320px|Return to [[2009_Winter_Project_Week|Project Week Main Page]] ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Key Investigators===&lt;br /&gt;
* BWH: Madeleine Seeland&lt;br /&gt;
* BWH: Carl-Fredrik Westin&lt;br /&gt;
* BWH: Gordon Kindlmann&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin: 20px;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 27%; float: left; padding-right: 3%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Objective&amp;lt;/h1&amp;gt;&lt;br /&gt;
Our objective is to finalize the integration of the Two-Tensor Streamline Tractography method [1] into Slicer and to test it on diverse DWI datasets. Furthermore the optimal parameter settings to run the algorithm needs to be investigated.   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 27%; float: left; padding-right: 3%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Approach, Plan&amp;lt;/h1&amp;gt;&lt;br /&gt;
We are integrating the Two-Tensor Streamline Tractography into Slicer. The complete details on the method are summarized in [1].&lt;br /&gt;
&lt;br /&gt;
The implementation of our project is carried out in Python. The Two-Tensor Tractography function calls are already implemented in the Teem library and can be accessed using the Python wrappings for Teem which are based on ctypes. &lt;br /&gt;
&lt;br /&gt;
Besides the integration of the Two-Tensor Tractography algorithm into Slicer, the optimal parameter settings for the algorithm needs to be investigated.&lt;br /&gt;
&lt;br /&gt;
Furthermore we need to find a way to parallelize the tractography algorithm (one idea is to use IPython).&lt;br /&gt;
&lt;br /&gt;
Another plan is to apply a noise filter on the DWI's before applying the Two-Tensor Tractography algorithm, as this may lead to more accurate fiber results.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 40%; float: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Progress&amp;lt;/h1&amp;gt;&lt;br /&gt;
The implementation of the Two-Tensor Tractography is already finished. Currently I'm testing the algorithm with different parameter settings and try to find a way to parallelize the algorithm.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
* [1] Qazi AA, Radmanesh A, O'Donnell L, Kindlmann G, Peled S, Whalen S, Westin CF, Golby AJ. Resolving crossings in the corticospinal tract by two-tensor streamline tractography: method and clinical assessment using fMRI. Neuroimage 2008 &lt;br /&gt;
* [2] Peled S, Friman O, Jolesz F, Westin CF. Geometrically constrained two-tensor model for crossing tracts in DWI. Magnetic Resonance Imaging 2006;24:1263-1270.&lt;/div&gt;</summary>
		<author><name>Mseeland</name></author>
		
	</entry>
	<entry>
		<id>https://www.na-mic.org/w/index.php?title=Two-tensor_tractography_in_Slicer_using_Python_and_Teem&amp;diff=34251</id>
		<title>Two-tensor tractography in Slicer using Python and Teem</title>
		<link rel="alternate" type="text/html" href="https://www.na-mic.org/w/index.php?title=Two-tensor_tractography_in_Slicer_using_Python_and_Teem&amp;diff=34251"/>
		<updated>2009-01-05T17:23:07Z</updated>

		<summary type="html">&lt;p&gt;Mseeland: /* Key Investigators */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{|&lt;br /&gt;
|[[Image:NAMIC-SLC.jpg|thumb|320px|Return to [[2009_Winter_Project_Week|Project Week Main Page]] ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Key Investigators===&lt;br /&gt;
* BWH: Madeleine Seeland&lt;br /&gt;
* BWH: Carl-Fredrik Westin&lt;br /&gt;
* BWH: Gordon Kindlmann&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin: 20px;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 27%; float: left; padding-right: 3%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Objective&amp;lt;/h1&amp;gt;&lt;br /&gt;
Our objective is to finalize the integration of the Two-Tensor Streamline Tractography method ([1]) into Slicer and to test it on diverse DWI datasets. Furthermore the optimal parameter settings to run the algorithm needs to be investigated.   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 27%; float: left; padding-right: 3%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Approach, Plan&amp;lt;/h1&amp;gt;&lt;br /&gt;
We are integrating the Two-Tensor Streamline Tractography into Slicer. The complete details on the method are summarized in [1].&lt;br /&gt;
&lt;br /&gt;
The implementation of our project is carried out in Python. The Two-Tensor Tractography function calls are already implemented in the Teem library and can be accessed using the Python wrappings for Teem which are based on ctypes. &lt;br /&gt;
&lt;br /&gt;
Besides the integration of the Two-Tensor Tractography algorithm into Slicer, the optimal parameter settings for the algorithm needs to be investigated.&lt;br /&gt;
&lt;br /&gt;
Furthermore we need to find a way to parallelize the tractography algorithm (one idea is to use IPython).&lt;br /&gt;
&lt;br /&gt;
Another plan is to apply a noise filter on the DWI's before applying the Two-Tensor Tractography algorithm, as this may lead to more accurate fiber results.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 40%; float: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Progress&amp;lt;/h1&amp;gt;&lt;br /&gt;
The implementation of the Two-Tensor Tractography is already finished. Currently I'm testing the algorithm with different parameter settings and try to find a way to parallelize the algorithm.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
* [1] Qazi AA, Radmanesh A, O'Donnell L, Kindlmann G, Peled S, Whalen S, Westin CF, Golby AJ. Resolving crossings in the corticospinal tract by two-tensor streamline tractography: method and clinical assessment using fMRI. Neuroimage 2008 &lt;br /&gt;
* [2] Peled S, Friman O, Jolesz F, Westin CF. Geometrically constrained two-tensor model for crossing tracts in DWI. Magnetic Resonance Imaging 2006;24:1263-1270.&lt;/div&gt;</summary>
		<author><name>Mseeland</name></author>
		
	</entry>
	<entry>
		<id>https://www.na-mic.org/w/index.php?title=Two-tensor_tractography_in_Slicer_using_Python_and_Teem&amp;diff=34250</id>
		<title>Two-tensor tractography in Slicer using Python and Teem</title>
		<link rel="alternate" type="text/html" href="https://www.na-mic.org/w/index.php?title=Two-tensor_tractography_in_Slicer_using_Python_and_Teem&amp;diff=34250"/>
		<updated>2009-01-05T17:21:30Z</updated>

		<summary type="html">&lt;p&gt;Mseeland: /* Key Investigators */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{|&lt;br /&gt;
|[[Image:NAMIC-SLC.jpg|thumb|320px|Return to [[2009_Winter_Project_Week|Project Week Main Page]] ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Key Investigators===&lt;br /&gt;
* BWH: Madeleine Seeland&lt;br /&gt;
* BWH: Carl-Fredrik Westin&lt;br /&gt;
* BWH: Gordon Kindlmann&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin: 20px;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 27%; float: left; padding-right: 3%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Objective&amp;lt;/h1&amp;gt;&lt;br /&gt;
Our objective is to finalize the integration of the Two-Tensor Streamline Tractography method into Slicer and to test it on diverse DWI datasets. Furthermore the optimal parameter settings to run the algorithm needs to be investigated.   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 27%; float: left; padding-right: 3%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Approach, Plan&amp;lt;/h1&amp;gt;&lt;br /&gt;
We are integrating the Two-Tensor Streamline Tractography into Slicer. The complete details on the method are summarized in [1].&lt;br /&gt;
&lt;br /&gt;
The implementation of our project is carried out in Python. The Two-Tensor Tractography function calls are already implemented in the Teem library and can be accessed using the Python wrappings for Teem which are based on ctypes. &lt;br /&gt;
&lt;br /&gt;
Besides the integration of the Two-Tensor Tractography algorithm into Slicer, the optimal parameter settings for the algorithm needs to be investigated.&lt;br /&gt;
&lt;br /&gt;
Furthermore we need to find a way to parallelize the tractography algorithm (one idea is to use IPython).&lt;br /&gt;
&lt;br /&gt;
Another plan is to apply a noise filter on the DWI's before applying the Two-Tensor Tractography algorithm, as this may lead to more accurate fiber results.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width: 40%; float: left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Progress&amp;lt;/h1&amp;gt;&lt;br /&gt;
The implementation of the Two-Tensor Tractography is already finished. Currently I'm testing the algorithm with different parameter settings and try to find a way to parallelize the algorithm.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
* [1] Qazi AA, Radmanesh A, O'Donnell L, Kindlmann G, Peled S, Whalen S, Westin CF, Golby AJ. Resolving crossings in the corticospinal tract by two-tensor streamline tractography: method and clinical assessment using fMRI. Neuroimage 2008 &lt;br /&gt;
* [2] Peled S, Friman O, Jolesz F, Westin CF. Geometrically constrained two-tensor model for crossing tracts in DWI. Magnetic Resonance Imaging 2006;24:1263-1270.&lt;/div&gt;</summary>
		<author><name>Mseeland</name></author>
		
	</entry>
</feed>