XNAT Docs Index

Related Pages

 Click here to expand...
Child pages
  • Customizing Pipelines

This documentation is for XNAT versions 1.6.0 - 1.6.5. You can find the latest documentation for XNAT 1.7 at https://xnat.org/documentation

Skip to end of metadata
Go to start of metadata

Quick Index

Related: XNAT Pipeline Development Schema

 

Customizing the user interface for a pipeline

If you want to have a custom screen to launch a pipeline, a site administrator will have to do the following:

  1. Create the velocity file for the pipeline in <XNAT_HOME>/projects/<YOUR PROJECT>/src/templates/screens. (ex: PipelineScreen_MyPipeline.vm)
  2. Create the associated java screen class in <XNAT_HOME>/projects/<YOUR PROJECT>/src/java/org/apache/turbine/app/xnat/modules/screens. (ex: PipelineScreen_MyPipeline.java)
  3. There is a default interface provided which enables setting up the pipeline for a project. If you want to customize this interface also, then create a screen file called PipelineScreen_MyPipeline_add.vm.
  4. Update the XNAT instance
  5. Enter the name of the screen file (PipelineScreen_MyPipeline.vm) in the box labeled "Enter Name of the custom webpage to launch this pipeline."

Creating custom functions

One can write custom extension function and call such functions while running the pipeline. For example, in order to extract some parameters from a dicom file associated with a scan, one could write such a function and invoke it to set a parameter in the pipeline.

Step 1: Create a static method and a jar containing the class. Include the jar in the classpath

Step 2: Assign a name space

<Pipeline xmlns:fileUtils="http://www.xnat.org/java/org.nrg.imagingtools.utils.FileUtils" ....>

Step 3: Invoke the custom function

<parameter>
    <name>nx</name>
    <values>
       <unique>^fileUtils:getNXArgumentForUnpack4dfp(/Pipeline/parameters/parameter[name='nx_ny_catalog_file']/values/unique/text())^</unique>
    </values>
</parameter>

Customization Questions and Answers

Q: I have an internal and an external IP address for my XNAT site, how do I setup pipelines to work in such a scenario?

  • Add -aliashost <DESIRED ADDRESS> to PIPELINE_HOME/bin/XnatPipelineLauncher

Q: How do I run a pipeline on TOMCAT_HOST?

  • Apart from setting aliasHost as mentioned above, pass -useAlias while invoking PIPELINE_HOME/bin/XnatPipelineLauncher

Q: Where can I get source code for action, screen and velocity files for a custom pipeline?

  • No labels