View source: R/dataAugmentation.R
dataAugmentation | R Documentation |
Given an input image list (possibly multi-modal) and an optional corresponding segmentation image list, this function will perform data augmentation with the following augmentation possibilities: spatial transformations, added image noise, simulated bias field, and histogram warping.
dataAugmentation(
inputImageList,
segmentationImageList = NULL,
pointsetList = NULL,
numberOfSimulations = 10,
referenceImage = NULL,
transformType = "affineAndDeformation",
noiseModel = "additivegaussian",
noiseParameters = c(0, 0.05),
sdSimulatedBiasField = 1,
sdHistogramWarping = 0.05,
sdAffine = 0.05,
sdDeformation = 0.2,
outputNumpyFilePrefix = NULL,
verbose = FALSE
)
inputImageList |
list of lists of input images to warp. The internal list sets contains one or more images (per subject) which are assumed to be mutually aligned. The outer list contains multiple subject lists which are randomly sampled to produce output image list. |
segmentationImageList |
list of segmentation images corresponding to the input image list (optional). |
pointsetList |
list of pointsets (matrices) corresponding to the input image list (optional). If using this option, the transformType must be invertible. |
numberOfSimulations |
number of output images. Default = 10. |
referenceImage |
defines the spatial domain for all output images. If
the input images do not match the spatial domain of the reference image, we
internally resample the target to the reference image. This could have
unexpected consequences. Resampling to the reference domain is performed by
testing using |
transformType |
one of the following options
|
noiseModel |
one of the following options
|
sdSimulatedBiasField |
Characterize the standard deviation of the amplitude. |
sdHistogramWarping |
Determines the strength of the histogram transformation. |
sdAffine |
Determines the amount of affine transformation. |
sdDeformation |
Determines the amount of deformable transformation. |
outputNumpyFilePrefix |
Filename of output numpy array containing all the simulated images and segmentations. |
list of lists of transformed images and/or outputs to a numpy array.
Tustison NJ
library( ANTsR )
image1 <- antsImageRead( getANTsRData( "r16" ) )
image2 <- antsImageRead( getANTsRData( "r64" ) )
segmentation1 <- thresholdImage( image1, "Otsu", 3 )
segmentation2 <- thresholdImage( image2, "Otsu", 3 )
points1 = getCentroids( segmentation1 )[,1:2]
points2 = getCentroids( segmentation2 )[,1:2]
data <- dataAugmentation(
list( list( image1 ), list( image2 ) ),
list( segmentation1, segmentation2 ),
list( points1, points2 ), transformType = 'scaleShear' )
rm(segmentation1); gc()
rm(segmentation2); gc()
rm(image1); gc()
rm(image2); gc()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.