Skip to content

Texture calculation

aditiiyer edited this page Oct 7, 2020 · 45 revisions

Introduction

Patch-wise texture features are derived from the local neighborhoods around each voxel in an image. The resulting "filtered" image can be used for radiomics feature extraction, image segmentation etc. CERR supports the following categories of textures:

Computing texture maps

A. Graphical interface

After loading the scan and segmentation in CERR, the interface to compute texture maps can be accessed from Scan --> Texture Browser.

Graphical user interface to select from the available pre-processing filters and textures and define associated parameters.
Eg.: 3-D wavelets filter.

B. Code

planC = createTextureMaps(scanNum,structNum,ftype,paramS,label,planC);  

ftype is the class of texture to be computed. Supported classes include HaralickCooccurance, Wavelets, Sobel, LoG, Gabor, FirstOrderStatistics, LawsConvolution, CoLlage, Mean, and LawsEnergy. SITK filters can be invoked by specifying SimpleITK as the filter type.

paramS is a dictionary of parameters specific to each texture class:

1. Haralick co-occurrence

Optional parameters (for image quantization)

  • paramS.minIntensity.val
  • paramS.maxIntensity.val
  • paramS.binWidth.val

Required parameters:

  • paramS.NumLevels.val : No. gray levels
  • paramS.PatchSize.val : Patch size [numRows, numCols, numSlices]
  • paramS.Directionality.val : 1- 3D, 2 - 2D
  • paramS.Type.val : Entropy','Energy','Sum Avg','Homogeneity','Contrast','Correlation','Cluster Shade','Cluster Promincence', 'Haralick Correlation' or 'All'

2. Wavelets Supported wavelet types include Daybechies, Haar, Coiflets, FejerKorovkin, Symlets, Discrete meyer, Biorthogonal, and Reverse biorthogonal.

  • paramS.Wavelets.val : 'db','haar','coif','fk','sym','dmey','bior','rbio'
  • paramS.Index.val : See wfilters.m for supported subtypes
  • paramS.Direction.val : ''HHH','LHH','HLH','HHL','LLH','LHL','HLL','LLL', 'All'
  • paramS.Normalize.val : 'Yes','No'

3. Sobel
none

4. LoG

  • paramS.Sigma_mm.val : Gaussian smoothing width in physical units (mm)

5. Gabor

  • paramS.Radius.val : Radius to define mask size (2radius+1 x 2radius+1)
  • paramS.Sigma.val : Gaussian smoothing width
  • paramS.AspectRatio.val : Elongation of Gaussian mask
  • paramS.Orientation.val : Orientation (in degrees)
  • paramS.Wavlength.val : Wavelength of underlying sinusoid (should be >=1)

6. FirstOrderStatistics

  • paramS.PatchSize.val : Patch size [numRows, numCols, numSlices]

7. Laws' convolution filters

  • paramS.Direction.val : 1- 2D 2- 3D 3- All
  • paramS.Type.val : 1- 3, 2- 5, 3- All
  • paramS.Normalize.val : 'Yes', 'No'

8. CoLlage

  • paramS.Dimension.val : 1- 2D 2- 3D
  • paramS.Dominant_Dir_Radius.val : Patch size [numRows, numCols, numSlices]
  • paramS.Cooccur_Radius.val : Patch size [numRows, numCols, numSlices]
  • paramS.Number_Gray_Levels.val : No. gray levels

9. Mean

  • paramS.KernelSize.val : Patch size (scalar)

10. Laws' energy

  • paramS.Direction.val : 1- 2D 2- 3D 3- All
  • paramS.KernelSize.val : 1- 3, 2- 5, 3- All
  • paramS.Normalize.val : 'Yes', 'No'

11. SimpleITK

  • paramS.sitkFilterName.val : SITK filter name
  • paramS.(parName).val : Required parameters ('parName') for SITK filter

Examples

global planC
indexS = planC{end};
scanNum = 1;
structNum = 5;

% Wavelets
fType = 'Wavelets'
paramS.Wavelets.val = 'coif';
paramS.Index.val = 1;
paramS.Direction.val = 'HLH';
label = 'textureMap1';
planC = createTextureMaps(scanNum,structNum,fType,paramS,label,planC);

%Haralick
fType = 'HaralickCooccurance';
paramS.NumLevels.val = 64;
paramS.PatchSize.val = [2 2 0];   %2D
paramS.Directionality.val = 2;    
paramS.Type.val = 'All';
label = 'textureMap2';
planC = createTextureMaps(scanNum,structNum,fType,paramS,label,planC);

%First-order statistics
fType = 'FirstOrderStatistics';
[xUnifV, yUnifV, zUnifV] = getUniformScanXYZVals(planC{indexS.scan}(scanNum));
pixelSpacingXi = abs(xUnifV(2)-xUnifV(1));
pixelSpacingYi = abs(yUnifV(2)-yUnifV(1));
pixelSpacingZi = abs(zUnifV(2)-zUnifV(1));
voxelVol = pixelSpacingXi*pixelSpacingYi*pixelSpacingZi;
paramS.PatchSize.val = [2,2,2];
paramS.VoxelVolume.val = voxelVol; 
label = 'textureMap3';
planC = createTextureMaps(scanNum,structNum,fType,paramS,label,planC);
Clone this wiki locally