Modules:BRAINSDemonWarp

From Slicer Wiki
Jump to: navigation, search
Home < Modules:BRAINSDemonWarp

Return to Slicer 3.6 Documentation

Gallery of New Features


Module Name

MyModule

User Interface

General Information

Module Type & Category

Type: CLI

Category: Registration


Authors, Collaborators & Contact

Author: This tool was developed by Hans J. Johnson and Greg Harris.

Contributors: The development of this tool was supported by funding from grants NS050568 and NS40068 from the National Institute of Neurological Disorders and Stroke and grants MH31593, MH40856, from the National Institute of Mental Health.


Module Description

Program title BRAINSDemonWarp
Program version 3.0.0
Program documentation-url http://wiki.slicer.org/slicerWiki/index.php/Modules:BRAINSDemonWarp


Usage

The module registers the template (moving) image onto the physical space of the target (fixed) image. The resultant deformation fields and metric values can be written to a file. The program uses the Insight Toolkit (www.ITK.org) for all the computations, and can operate on any of the image file types supported by that library.

Use Cases, Examples

The inputs to the BrainDemonsWarp program are the target image, the template image and the optional parameters. These parameters define the arguments for histogram matching and multi resolution registration. The outputs are the deformation field, output image, checkerboard image of the output and the fixed image and the x,y,z displacement vectors. If we specify debug option we can get the outputs at different stages. The filter is templated over the input image type, real image type and the output image types. We implement the algorithm by parsing the input, preprocessing them and registering the processed images.

  1. Parsing - The images are initialized by the ValidationInputParser. This function reads in the arguments from the parameter file. It sets the histogram bins, match points, number of levels in the multi resolution registration, shrink factors and number of iterations at each levels. If the orientations of the images are different it sets the orientation of the moving image to that of the fixed image.
  2. PreProcessing - In the next step the DemonsPreProcessor preprocesses the images by resampling the template image to target image space. The intensity mismatch problem is solved by histogram matching the images. Histogram matching is done only if the command line option -e is set. ItkHistogramMatchingImageFilter is used to perform this function. Another important step in preprocessing is skull stripping. Skull stripping is done only if the command line option -maskProcessingMode is set to BOBF. We have written an itk filter, named itkBOBFFilter for this purpose. This filter takes in an input image and a whole brain mask and outputs a Brain Only Background Filled(BOBF) image. The non-brain parts in the image are filled with the user specified background value. All computations are performed in the precision of float data.
  3. Registration - The resulting moving Image and the fixed image are given as inputs to the demons registrator.It uses the MultiResolutionPDEDeformableRegistration filter with NN extrapolation as interpolator and implements the demons deformable algorithm by computing the deformation field which will map a moving image onto a fixed image. It is assumed that the vector elements behave like floating point scalars. Each vector in the deformation field represent the distance between a geometric point in the input space and a point in the output space. The output image is generated by warping the input image with the deformation field using the ItkWarpImageFilter. WarpImageFilter warps an existing image with respect to a given deformation field. Typically the mapped position does not correspond to an integer pixel position in the input image. Interpolation via an image function is used to compute values at non-integer positions. We have used the LinearInterpolateImageFunction for our application. To write the output image we cast the image to the user specified output pixel type.

Quick Tour of Features and Use

  • Inputs Common input parameters. All must be specified
    • Moving Image Volume [--movingVolume][-m]: Required: input moving image
    • Fixed Image Volume [--fixedVolume][-f]: Required: input fixed (target) image
    • Input Type [--inputPixelType]: Input volumes will be typecast to this format: float|short|ushort|int|uchar
  • Outputs Common output parameters. At least one must be specified.
    • Output Image Volume [--outputVolume][-o]: Required: output resampled moving image (will have the same physical space as the fixedVolume).
    • Output Deformation Field Volume [--outputDeformationFieldVolume][-O]: Output deformation field vector image (will have the same physical space as the fixedVolume).
    • Output Type [--outputPixelType]: outputVolume will be typecast to this format: float|short|ushort|int|uchar
    • Interpolation Mode [--interpolationMode]: Type of interpolation to be used when applying transform to moving volume. Options are Linear, NearestNeighbor, BSpline, or WindowedSinc
  • Registration Parameters Input parameters controlling the behavior of the demons registration.
    • Registration Filter Type [--registrationFilterType]: Registration Filter Type: Demons|FastSymmetricForces|Diffeomorphic|LogDemons|SymmetricLogDemons
    • Deformation field smoothing sigma [--smoothDeformationFieldSigma][-s]: A gaussian smoothing value to be applied to the deformation feild at each iteration.
    • Pyramid Levels [--numberOfPyramidLevels][-n]: Number of image pyramid levels to use in the multi-resolution registration.
    • Moving Shrink Factors [--minimumFixedPyramid]: The shrink factor for the first level of the fixed image pyramid. (i.e. start at 1/16 scale, then 1/8, then 1/4, then 1/2, and finally full scale)
    • Moving Shrink Factors [--minimumMovingPyramid]: The shrink factor for the first level of the moving image pyramid. (i.e. start at 1/16 scale, then 1/8, then 1/4, then 1/2, and finally full scale)
    • the iteration count for each pyramid level [--arrayOfPyramidLevelIterations][-i]: The number of iterations for each pyramid level
  • Input image pre-processing options Operations to perform on the images before starting the registration.
    • Histogram Match [--histogramMatch][-e]: Histogram Match the input images. This is suitable for images of the same modality that may have different absolute scales, but the same overall intensity profile.
    • Number of histogram bins to use in histogramMatch [--numberOfHistogramBins]: The number of histogram levels
    • Number of Match Points [--numberOfMatchPoints]: The number of match points for histrogramMatch
    • Median Filter Size [--medianFilterSize]: Median filter radius in all 3 directions. When images have a lot of salt and pepper noise, this step can improve the registration.
  • Deformation field initialziation Options for initializing the deformation field.
    • Initial Deformation Field Volume [--initializeWithDeformationField]: Initial deformation field vector image file name
    • Initial Transform Filename [--initializeWithTransform]: Initial Transform filename
  • Mask Options Options for setting binary masks for the registration.
    • Mask Processing Mode [--maskProcessingMode]: What mode to use for using the masks: NOMASK|ROIAUTO|ROI|BOBF. If ROIAUTO is choosen, then the mask is implicitly defined using a otsu forground and hole filling algorithm. Where the Region Of Interest mode uses the masks to define what parts of the image should be used for computing the deformation field. Brain Only Background Fill uses the masks to pre-process the input images by clipping and filling in the background with a predefined value.
    • Input Fixed Mask Filename [--fixedBinaryVolume]: Mask filename for desired region of interest in the Fixed image.
    • Input Moving Mask Filename [--movingBinaryVolume]: Mask filename for desired region of interest in the Moving image.
    • BOBF Lower Threshold [--lowerThresholdForBOBF]: Lower threshold for performing BOBF
    • BOBF Upper Threshold [--upperThresholdForBOBF]: Upper threshold for performing BOBF
    • BOBF Background Replacement Value [--backgroundFillValue]: Replacement value to overwrite background when performing BOBF
    • Seed For BOBF [--seedForBOBF]: coordinates in all 3 directions for Seed when performing BOBF
    • Seed For BOBF [--neighborhoodForBOBF]: neighborhood in all 3 directions to be included when performing BOBF
  • Advanced Options Uncommon debugging or other advanced options.
    • Component displacement field prefix [--outputDisplacementFieldPrefix]: Displacement field filename prefix for writing separate x, y, and z component images
    • Output Checkerboard Volume [--outputCheckerboardVolume]: Genete a checkerboard image volume between the fixedVolume and the deformed movingVolume.
    • Checkerboard Pattern Subdivisions [--checkerboardPatternSubdivisions]: Number of Checkerboard subdivisions in all 3 directions
    • Warp Normalized Images [--outputNormalized]: Flag to warp and write the normalized images to output. In normalized images the image values are fit-scaled to be between 0 and the maximum storage type value.
    • Write Intermediate Images [--outputDebug][-v]: Flag to write debugging images after each step.
    • Gradient Type [--gradient_type][-t]: Type of gradient used for computing the demons force (0 is symmetrized, 1 is fixed image, 2 is moving image)
    • Update field smoothing [--upFieldSmoothing][-g]: Smoothing sigma for the update field at each iteration
    • Max Step Length [--max_step_length][-l]: Maximum length of an update vector (0: no restriction)
    • Turn off Diffeomorphism [--use_vanilla_dem][-a]: Run vanilla demons algorithm


Development

Notes from the Developer(s)

Dependencies

Tests

http://testing.psychiatry.uiowa.edu/CDash

Usability issues

Follow this link to the Slicer3 bug tracker. Please select the usability issue category when browsing or contributing.

More Information

Acknowledgment

The development of this tool was supported by funding from grants NS050568 and NS40068 from the National Institute of Neurological Disorders and Stroke and grants MH31593, MH40856, from the National Institute of Mental Health.

References