Slicer3:FiberTrackingIntegration

From Slicer Wiki
Revision as of 18:01, 15 May 2008 by Marianna (talk | contribs) (1 revision)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Home < Slicer3:FiberTrackingIntegration

Introduction

The purpose of this page is to describe a proof of concept integration between the UNC FiberTracking application and the Slicer 3 execution model. We use the XML based description of a Slicer 3 module along with a simple python script to interface FiberTracking into the Slicer 3 execution model. The result is that a set of diffusion weighted images (DWI) can be loaded from Slicer into FiberTracking and the computed FA image can be transferred back to Slicer. Future work will also allow us to save back fiber tract geometry information.

This work can also serve as a model for integrating other external applications into the Slicer 3 execution model.

Current Work

The following steps were taken to allow FiberTracking to be used from within Slicer 3

  1. Development of fibertracking.xml description for Slicer 3
<?xml version="1.0" encoding="utf-8"?>
<executable>
 <category>
 Filtering
 </category>
 <title>
 FiberTracking
 </title>
 <description>
Calls up FiberTracking in an external window.
 </description>
 <version>1.0</version>
 <documentationurl></documentationurl>
 <license></license>
 <contributor>Casey Goodlett</contributor>
 <parameters>
   <label>IO</label>
   <description>Input/output parameters</description>
   <image>
     <name>inputVolume0</name>
     <label>Input Volume 1</label>
     <channel>input</channel>
     <index>1</index>
     <description>Input volume to be filtered</description>
   </image>
   <image>
     <name>inputVolume1</name>
     <label>Input Volume 2</label>
     <channel>input</channel>
     <index>2</index>
     <description>Input volume to be filtered</description>
   </image>
   <image>
     <name>inputVolume2</name>
     <label>Input Volume 3</label>
     <channel>input</channel>
     <index>3</index>
     <description>Input volume to be filtered</description>
   </image>
   <image>
     <name>inputVolume3</name>
     <label>Input Volume 4</label>
     <channel>input</channel>
     <index>4</index>
     <description>Input volume to be filtered</description>
   </image>
   <image>
     <name>inputVolume4</name>
     <label>Input Volume 5</label>
     <channel>input</channel>
     <index>5</index>
     <description>Input volume to be filtered</description>
   </image>
   <image>
     <name>inputVolume5</name>
     <label>Input Volume 6</label>
     <channel>input</channel>
     <index>6</index>
     <description>Input volume to be filtered</description>
   </image>
   <image>
     <name>inputVolume6</name>
     <label>Input Volume 7</label>
     <channel>input</channel>
     <index>7</index>
     <description>Input volume to be filtered</description>
   </image>
   <image>
     <name>outputVolume</name>
     <label>Output Volume</label>
     <channel>output</channel>
     <index>8</index>
     <description>Output filtered</description>
   </image>
 </parameters>
</executable>


  1. Development of fibertracking.py a simple script that translates the command line arguments written by slicer 3 into a form understandable by FiberTracking. This was only done as a rapid prototyping step. Future integration will allow FiberTracking and FiberViewer to directly understand the command line arguments written by slicer.
  #!/usr/bin/python
 
  import os
  import sys
  import getopt
 
  try:
     optlist, args = getopt.getopt(sys.argv[1:],'',['xml'])
  except getopt.GetOptError:
     print 'option error'
     sys.exit(2)
  for o, a in optlist:
     if o in '--xml':
         fid = open('computefa.xml')
         for line in fid:
             print line
         fid.close()
         sys.exit(0)
 
  argstr = ' '.join(args)
  cmdline = 'FiberTrackingSlicer --slicer ' + argstr
  print cmdline
  os.system(cmdline)
 
  1. Minor modification of FiberTracking to accept a set of parameters which describe how to pass image information to and from Slicer

Screenshots

FiberTracking - Slicer 3 integration
Here the Diffusion weighted images are loaded in Slicer 3
FiberTracking is launched from Slicer 3 and automatically loads the diffusion weighted images
The FA image produced in FiberTracking is loaded back into Slicer 3 when the user exits FiberTracking

Future Work

  1. Allow transfer of more complex images such as vector, tensor images along with relevant metadata about image and measurement orientation
  2. Allow transfer of model information describing fiber tract geometry