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