Jump to: navigation, search
Home < Slicer3:JavaBasedChainCLMsEngine

Chain CLMs Engine


  • Java application which behaves as a regular Slicer3 module (JVM 1.5 or higher required).
  • Requires as its first parameter the location of a chain descriptor.
  • The rest of its parameters are the usual Slicer3 modules parameters.
  • This java application is currently wrapped in a shell script; which would be the actual Slicer3 chain module.
  • As such this script has to be deployed in the Slicer's Plugins folder.
  • This script does pre and post processing before invoking the engine and hardcodes a chain descriptor.


  • Unbundle the chain module engine right under your Slicer3 installation.
  • Set the environmental variable SLICER_HOME to point to your Slicer3 installation. For example:
export SLICER_HOME=~/Slicer3.2-2008-06-02-darwin-x86
  • For each chain module desired create:
    • A "X-Chain.xml" chain descriptor file to be stored under the Slicer3 "Plugins" directory (see "Chain Descriptor" section for details).
    • A chain script module for "X-Chain.xml"; which should look like:
# Chain Slicer Module

export GWE_HOME=`ls -d -t $SLICER_HOME/gwe-*/ | head -1`
export GWE_FAT_JAR=`ls $GWE_HOME/lib/gwe-*-fatjar.jar`
rm -fdr $SLICER_HOME/chains
mkdir $SLICER_HOME/chains 
java -Xmx512m -cp $GWE_HOME/conf:$GWE_FAT_JAR org.gwe.integration.slicer.chains.ChainCLMProxyApp $SLICER_HOME/lib/Slicer3/Plugins/X-Chain.xml $@
if [ "x$1" != "x--xml" ]
    chmod a+x $SLICER_HOME/chains/
    $SLICER_HOME/chains/ > $SLICER_HOME/chains/result.log

Chain Descriptor

  • This is an XML file which contains all the information necessary to deterministically proxy into CLMs and:
    • Build the new XML descriptor corresponding to the composition of the modules (removing chain arguments, applying namespaces, autogenerating certain values, etc.)
    • Invoke them when necessary in sequential order respecting the argument piping instructions and the corresponding arguments for each modules' (using its namespaces).
  • It must conform to the following schema:
<xs:schema xmlns:xs="" xmlns:clm="" targetNamespace="" elementFormDefault="qualified">
   <xs:element name="modules">
             <xs:element name="module" type="clm:module" minOccurs="2" maxOccurs="unbounded"/>
   <xs:complexType name="module">
          <xs:element name="argument" type="clm:argument" minOccurs="0" maxOccurs="unbounded"/>
      <xs:attribute name="id" type="xs:string"/>
   <xs:complexType name="argument">
      <xs:attribute name="name" type="xs:string"/>
      <xs:attribute name="value-ref" type="xs:string"/>
  • "Chain Descriptor" template example:
<?xml version="1.0" encoding="UTF-8"?>
<modules xmlns="" xmlns:xsi="" xsi:schemaLocation="">
 <module id="Module1"/>
 <module id="Module2">
     <argument name="param2A" value-ref="Module1.param1A" />
     <argument name="param2B" value-ref="Module1.param1B" />
 <module id="Module3">
     <argument name="param3C" value-ref="Module1.param1C" />
     <argument name="param3D" value-ref="Module2.param2D" />

Real Examples


  • Chaining modules GaussianBlurImageFilter and OtsuThresholdSegmentation:
<?xml version="1.0" encoding="UTF-8"?>
<modules xmlns="" xmlns:xsi="" xsi:schemaLocation="">
  <module id="GaussianBlurImageFilter"/>
  <module id="OtsuThresholdSegmentation">
      <argument name="inputVolume" value-ref="GaussianBlurImageFilter.outputVolume" />


  • Chaining modules dwiNoiseFilter, CurvatureAnisotropicDiffusion and GradientAnisotropicDiffusion:
<?xml version="1.0" encoding="UTF-8"?>
<modules xmlns="" xmlns:xsi="" xsi:schemaLocation="">
  <module id="dwiNoiseFilter"/>
  <module id="CurvatureAnisotropicDiffusion">
      <argument name="inputVolume" value-ref="dwiNoiseFilter.outputVolume" />
  <module id="GradientAnisotropicDiffusion">
      <argument name="inputVolume" value-ref="CurvatureAnisotropicDiffusion.outputVolume" />


  • Chaining modules brainsegCLP, AffineRegistration, BSplineDeformableRegistration, ResampleVolume2, CortThickCLP
<?xml version="1.0" encoding="UTF-8"?>
<modules xmlns="" xmlns:xsi="" xsi:schemaLocation="">
  <module id="brainsegCLP"/>
  <module id="AffineRegistration"/>
  <module id="BSplineDeformableRegistration">
     <argument name="inputVolume" value-ref="AffineRegistration.ResampledImageFileName" />
     <argument name="InitialTransform" value-ref="AffineRegistration.OutputTransform" />
     <argument name="FixedImageFileName" value-ref="AffineRegistration.FixedImageFileName" />
     <argument name="MovingImageFileName" value-ref="AffineRegistration.MovingImageFileName" />
  <module id="ResampleVolume2">
     <argument name="InitialTransform" value-ref="BSplineRegistration.OutputTransform" />
  <module id="CortThickCLP">
     <argument name="SegmentationInput" value-ref="brainseg.SegmentationFile" />
     <argument name="ParcellationOption" value-ref="ResampleVolume2.outputVolume" />


Key Investigators

  • UCSD: Marco Ruiz
  • Isomics: Steve Pieper
  • GE: Jim Miller