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, 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 transformation based change. |
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' )#> Error in py_discover_config(required_module, use_environment): Python specified in RETICULATE_PYTHON (/Users/ntustison/anaconda3/envs/antsx/bin/python3) does not exist#> used (Mb) gc trigger (Mb) limit (Mb) max used (Mb) #> Ncells 2544371 135.9 4570014 244.1 NA 4570014 244.1 #> Vcells 4491876 34.3 12255594 93.6 65536 12254504 93.5#> used (Mb) gc trigger (Mb) limit (Mb) max used (Mb) #> Ncells 2544143 135.9 4570014 244.1 NA 4570014 244.1 #> Vcells 4491532 34.3 12255594 93.6 65536 12254504 93.5#> used (Mb) gc trigger (Mb) limit (Mb) max used (Mb) #> Ncells 2544133 135.9 4570014 244.1 NA 4570014 244.1 #> Vcells 4491537 34.3 12255594 93.6 65536 12254504 93.5#> used (Mb) gc trigger (Mb) limit (Mb) max used (Mb) #> Ncells 2544123 135.9 4570014 244.1 NA 4570014 244.1 #> Vcells 4491542 34.3 12255594 93.6 65536 12254504 93.5