Preprocessing settings for scans - cerr/CERR GitHub Wiki

This field contains nested JSON objects specifying scan identifiers and pre-processing parameters. Settings for multiple scans can be input using nested lists. Note : Exported CT images are converted to HU (offset subtracted by default).

Required settings

  • identifier : Identifiers are used to determine the series to be exported.
    Supported identifiers:

    • imageType : "CT SCAN" or "MR SCAN"
    • seriesDescription :
    • scanType :
    • scanNum :
    • scanDate : first" or "last"
    • assocStructure : (list of structure names or "none").

    Derived images (filtered/registered) generated using this pipeline can be selected by setting the "filtered" or "warped" flags (default: 0 (off)).

          "identifier": {"identifier_name": "value",  "warped" : 1,  "filtered" : 1}

For further details, see getScanNumFromIdentifiers.m

Optional settings

I/O

  • required : Indicate if scan volume is strictly required ("yes"— this is the default) or optional ("no").

Pre-processing

These include parameters for image pre-processing ("filter", "register", "resample", "crop", "resize", "view", and "channels"), described below.

Settings applied to all input scans


  • filter : Dictionary specifying "imageType" (any of the supported image filters) along with required parameters.

  • register : Dictionary of parameters for image registration. Required sub-fields include:baseScan, movingScan, (registration) tool, andmethod. inputCmdFile and copyStr may also be specified. Base and moving scans are specified through supported identifiers, with the optional addition of a binary filtered flag (default:0) if using the result of the previous "filter" stage.

    • baseScan: Dictionary specifying "identifier" and (optional) "filtered" flag.
    • movingScan: Dictionary specifying "identifier" and (optional) "filtered" flag.
    • tool: Define registration tool: "plastimatch","elastix","ants", or "custom"
    • method: "align center", "rigid", "bspline", "demons plastimatch"
    • inputCmdFile: Path to text file containing registration commands.
    • copyStr: List of structures to deform from moving to base scan frame of reference.
      Example:
      "register" : {"baseScan": {"identifier":{"name":"value", "filtered":1}},
      "movingScan":{"identifier":{"name":"value", "filtered":0}},
      "tool": "plastimatch",
      "method": "rigid",
      "inputCmdFile":"plastimatch_command/plm_reg_settings_with_starting_transform.txt",
      "copyStr":["Str1","Str2"]}
  • view : Transform image orientation to axial, sagittal or coronal orientations. Note: Input scans are assumed to have axial orientation.

Settings for select input scans


  • required : Indicate if scan volume is strictly required ("yes" by default) or optional ("no").

  • view : List of output image orientations. Supported options: "axial" (default), "sagittal", "coronal" or combination.
    E.g. Single view: "view" : ["axial"],
    Multi-view: "view" = ["axial","sagittal"],

  • resample : Dictionary of resampling parameters with fields:

    • resolutionXCm, resolutionYcm, resolutionZCm: Voxel dimensions in cm.
    • method : Supported methods include "sinc", "linear", "cubic", "spline", "makima", "nearest", and "none". (default).
  • crop : Dictionary of parameters for cropping. Valid fields include "method", "params", and "operator".

    • method: Valid cropping method (see table). May contain a list of supported methods, which are applied sequentially.
    • params: Dictionary of parameters required for selected cropping method.
    • operator: Supported values for chaining cropping methods are "" (empty/none), "union" and "intersection".

    For descriptions and examples of the cropping methods listed below, see section on pre-processing methods. For further details, see getMaskForModelConfig.m.

Method Parameters Usage
crop_fixed_amt margins "margins" : [rowStart,rowEnd,colStart,colEnd,slcStart,slcEnd]
crop_to_bounding_box OR crop_to_bounding_box_2d label "label" : L (numeric)
crop_to_str OR crop_to_str_2d structureName "structureName" : "str1"
crop_to_str_on_scan OR crop_to_str_2d_on_scan structureName, scanIdentifier "scanIdentifier": {"imageType":"CT"}, "structureName" : "str1"
crop_around_center margins "margins": [numRows,numCols]
crop_around_structure_center structureName,margins "structureName" : "str1", "margins": [numRows,numCols]
crop_pt_outline OR crop_pt_outline_2d Required: outlineThreshold, structureName "outlineThreshold": N (HU),
"structureName": "outlineStrName"c
crop_pt_outline_on_scan OR crop_pt_outline_2d_on_scan Required: scanIdentifier, outlineThreshold, structureName "scanIdentifier": {"imageType": "CT"}, "outlineThreshold": N (HU),
"structureName": "outlineStrName"
crop_sup_inf - -
custom method (specify function name) - -
none - -

To save the ROI mask(s) returned by the selected cropping method(s) to planC (including auto-generated patient outline), include the following under "params":

      "saveStrToPlanCFlag": 1,  
      "outStrName": "roi_out" 
  1. resize : Dictionary of parameters for resizing with fields:

    • methods: Supported methods include "pad2d", "pad3d", "padorcrop2d", "padorcrop3d", "bilinear", "bicubic", "sinc" and "none" (default). padorcrop determines the appropriate operation from input and output image dimensions.
    • size : Output dimensions [numRows, numCols]
  2. channels : Dictionary of parameters for populating image channels. For each channel, the following fields may be specified:

    • imageType: Valid options include "original" (default) or any of the supported image filters along with required parameters.
    • slice : Supported options include "current", "current-n" for the 'n'th slice above the current slice, and "current+n", for the 'n'th slice below the current slice.
      Syntax:
      "channels":{"imageType": validType, "slice": validSlice}

    Optional input:

    • "intensityOutsideMask: Replace intensities outside the region of interest (structure used in cropping) with user-specified value. E.g.: "intensityOutsideMask" : {"val": 0},

    Examples

  • Configuration for single channel output
    • With original image (default)
      "channels": {"imageType":"original", "slice":"current"}
    • With image texture
      "channels": {"imageType":{"Wavelets":{"Wavelets":"Coif", "Index":"1", "Direction": "HLH"}}, "slice":"current"}
  • Configuration for multi-channel output
    • 2.5D
      "channels": [{"imageType":"original", "slice":"current-1"},
      {"imageType":"original", "slice":"current"},
      {"imageType":"original", "slice":"current+1"}]
    • Combination of original and derived images (same slice)
      "channels": [{"imageType":"original", "slice":"current"},
      {"imageType":{"Wavelets":{"Wavelets":"Coif", "Index":"1", "Direction": "HLH"}},
      "slice":"current"}]
⚠️ **GitHub.com Fallback** ⚠️