Skip to content
Aditi Iyer edited this page Feb 2, 2023 · 3 revisions

This is a simple sliding-window spatial filter that replaces the center value in the window with the average (mean) of all the pixel values in the window.

Filter parameters

  • KernelSize: Patch size [numRows, numCols, numSlices]

Usage

Filters can be applied by manually creating a dictionary of parameters or passing them via JSON-format configuration files.

  • Dictionaries are created using the syntax:
paramS.<parameter_name>.val = <value>;

where parameter_name is one of the supported filter parameters listed above and value, one of the associated arguments.

  • Sample filter configuration
    The following settings can be used to apply a 5x5 (2D) mean filter after cropping around the specified structure and padding by 2 voxel widths, and calculate first-order statistics from the filtered image.
{

"structures": ["ROI"],                               

"imageType": {                                   
  		  "Mean": {
			    "KernelSize": [5,5]
			  }
	    },

"settings": {		   

                   "padding": {
                                "cropToMaskBounds": "yes",
                                "method": "mirror",  
                                "size": [2,2,0]
			       },

                   "firstOrder": { 
				     "offsetForEnergy": 0,
                                     "binNumEntropy": 64   
                                 }

    }
}

Configurations are parsed and converted to parameter dictionaries using

paramFile = 'Path/to/config_file.json'
paramS = getRadiomicsParamTemplate(paramFile);

Generating filtered images

global planC
strNum = 1;
scanNum = [];  % leave empty when passing structNum to automatically identify associated scan index
planC = generateTextureMapFromPlanC(planC,scanNum,strNum,paramS)

Extracting radiomic features

global planC
scanNum  = 1;
strNum = 2; 
featureS = calcGlobalRadiomicsFeatures(scanNum, structNum, paramS, planC);
Clone this wiki locally