applySuperResolutionModelToImage: Apply a pretrained model for super resolution.

View source: R/superResolutionUtilities.R

applySuperResolutionModelToImageR Documentation

Apply a pretrained model for super resolution.

Description

Helper function for applying a pretrained super resolution model. Apply a patch-wise trained network to perform super-resolution. Can be applied to variable sized inputs. Warning: This function may be better used on CPU unless the GPU can accommodate the full image size. Warning 2: The global intensity range (min to max) of the output will match the input where the range is taken over all channels.

Usage

applySuperResolutionModelToImage(
  image,
  model,
  targetRange = c(-127.5, 127.5),
  batchSize = 32,
  regressionOrder = NA,
  verbose = FALSE
)

Arguments

image

input image.

model

pretrained model or filename (cf getPretrainedNetwork).

targetRange

a vector defining the c(min, max) of each input image (e.g., -127.5, 127.5). Output images will be scaled back to original intensity. This range should match the mapping used in the training of the network.

batchSize

batch size used for the prediction call.

regressionOrder

if specified, then apply the function regressionMatchImage with polyOrder = regressionOrder.

verbose

If TRUE, show status messages.

Value

super-resolution image upscaled to resolution specified by the network.

Author(s)

Avants BB

Examples

## Not run: 
image <- applySuperResolutionModelToImage( ri( 1 ), getPretrainedNetwork( "dbpn4x" ) )

## End(Not run)

ANTsX/ANTsRNet documentation built on Nov. 21, 2024, 4:07 a.m.