Batchmake slicer

From KitwarePublic
Revision as of 14:30, 27 March 2009 by Finetjul (talk | contribs)
Jump to navigationJump to search
  • BatchMake in Slicer

BatchMake has been integrated in Slicer since version 3. A "BatchProcessing" subsection can be found in the list of Slicer modules. There are BatchMake into that section: "Gaussian Blur BatchMake", "Registration BatchMake" and "EMSegment BatchMake". All three modules are internally calling the Slicer modules, respectively "Gaussian Blur", "Register Images" and "EMSegment Simple".

The ultimate strength of BatchProcessing is to run multiple modules multiples times with multiple parameters on multiple inputs without any human interaction. This is done by writing a script and executing it locally on your machine or externally using grid computing (Condor). In this tutorial we will introduce you with BatchMake in Slicer and guide you step by step to do batch processing. We will also explain how you can create your own BatchMake module in Slicer.

    • How to run a BatchMake module locally?
GaussianBlurBatchMake.png

In this section, we will see how to run locally (on your machine) a Gaussian Blur filter on a single image with different sigma values.

      • Launch Slicer
      • Open the "Gaussian Blur BatchMake" module located in "BatchProcessing"
      • Choose the different values you want sigma to vary. Generated files will have in their name a sigma suffix.
      • Select a directory with images to process for "Data directory"
      • Create a mask that matches the filenames of the images to process in the previous directory for "Data file mask"
      • Choose an output directory where all the result images will be saved in for "Output directory
      • Make sure the "Run using Grid/Condor" checkbox is unchecked
      • Press apply to launch the processing

We do not use the Slicer objects in this example. The inputs of the Gaussian Blur filter are the files found in the input directory. If Sigma minimum, Sigma maximum and Sigma step are respectively equal to 1, 10 and 1, 10 files will be created for each input file. For example, if you had 3 files in your input directory that match the "Data file mask", ie imageX.mha, imageY.mha and imageZ.mha; your output directory will contain after the module is executed, imageX-1.mha, imageX-2.mha ... imageX-10.mha, imageY-1.mha, imageY-2.mha ... imageY-10.mha, imageZ-1.mha, imageZ-2.mha ... imageZ-10.mha.

    • Step by step tutorial to run Registration on a Condor grid

In this tutorial, we will see how to execute the "Register Images" filter on a Condor grid. For a single fixed image, we will automatically register multiple moving images to the fixed image. We will assume that Condor has been already installed on your machine(s) and works properly. The first thing you have to do is to run Slicer as a Condor user. If you are a Condor user, you can launch Slicer normally.

$ ./Slicer3-build/Slicer3 

If you are not a Condor user but you created a Condor user (called condor) on your machine, you should run Slicer using your environment variables as a Condor user:

$ su condor -m -c ./Slicer3-build/Slicer3

Note: you would probably have to change the read/write access to your Slicer temporary files.


    • How to vary the module parameters ?
    • How to write your own Batch Processing module ?