deepFeatures: extract deep features from 2D or 3D image

View source: R/patchMatch.R

deepFeaturesR Documentation

extract deep features from 2D or 3D image

Description

High-level function for extracting features based on a pretrained network.

Usage

deepFeatures(
  x,
  mask,
  patchSize = 64,
  featureSubset,
  block_name = "block2_conv2",
  vggmodel,
  subtractor = 127.5,
  patchVarEx = 0.95,
  meanCenter = FALSE
)

Arguments

x

input input image

mask

defines the object of interest in the fixedImage

patchSize

vector or scalar defining patch dimensions

featureSubset

a vector that selects a subset of features

block_name

name of vgg feature block, either block2_conv2 or integer. use the former for smaller patch sizes. Or try ripmmarc.

vggmodel

prebuilt feature model

subtractor

value to subtract when scaling image intensity; should be chosen to match training paradigm eg 127.5 for vgg and 0.5 for resnet like.

patchVarEx

patch variance explained for ripmmarc

meanCenter

boolean mean center the patch for ripmmarc

Value

feature array, patches and patch coordinates

Author(s)

Avants BB

Examples


library(ANTsR)
img <- ri( 1 ) %>% iMath( "Normalize" )
mask = randomMask( getMask( img ), 20 )
features = deepFeatures( img, mask, patchSize = 32 )


stnava/patchMatchR documentation built on March 23, 2022, 6:47 a.m.