randomImageTransformParametersBatchGenerator: Random image transform parameters batch generator

randomImageTransformParametersBatchGeneratorR Documentation

Random image transform parameters batch generator

Description

This R6 class can be used to generate parameters to affine and other transformations applied to an input image population. The class calls randomImageTransformParametersAugmentation.

Usage

bgen = randomImageTransformParametersBatchGenerator$new( ... )

bgen$generate( batchSize = 32L )

Arguments

imageDomain defines the spatial domain for all images. imageList List contains k images.

transformType random transform type to generate; one of the following options c("Translation","Rigid","ScaleShear","Affine","DeformationBasis" )

NOTE: if the input images do not match the spatial domain of the domain image, we internally resample the target to the domain. This may have unexpected consequences if you are not aware of this. This operation will test antsImagePhysicalSpaceConsistency then call resampleImageToTarget upon failure.

spatialSmoothing spatial smoothing for simulated deformation

numberOfCompositions number of compositions

deformationBasis list of basis deformations txParamMeans vector of basis deformations means txParamSDs vector of basis deformations sds center center the parameters before passing to Y

Methods

$new() Initialize the class in default empty or filled form.

$generate generate the batch of samples with given batch size

See Also

randomImageTransformParametersAugmentation

Examples


library( ANTsR )
i1 = antsImageRead( getANTsRData( "r16" ) )
i2 = antsImageRead( getANTsRData( "r64" ) )
s1 = thresholdImage( i1, "Otsu", 3 )
s2 = thresholdImage( i2, "Otsu", 3 )
# see ANTsRNet randomImageTransformAugmentation
predictors = list( i1, i2, i2, i1 )
trainingData <- randomImageTransformParametersBatchGenerator$new(
  imageList = predictors,
  transformType = "Affine",
  imageDomain = i1, txParamMeans=c(1,0,0,1,0,0), txParamSDs=diag(6)*0.01
  )
testBatchGenFunction = trainingData$generate( 2 )
myout = testBatchGenFunction( )


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