R/surgeRy.R
generateDiskData.Rd
Generate segmentation-based augmentation data with on disk storage
generateDiskData( inputImageList, segmentationImageList, segmentationNumbers, selector, addCoordConv = TRUE, segmentationsArePoints = FALSE, maskIndex, smoothHeatMaps = 0, numpynames, numberOfSimulations = 16, referenceImage = NULL, transformType = "rigid", noiseModel = "additivegaussian", noiseParameters = c(0, 0.002), sdSimulatedBiasField = 5e-04, sdHistogramWarping = 5e-04, sdAffine = 0.2 )
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 | of segmentation images corresponding to the input image list. |
segmentationNumbers | the integer list of values in the segmentation to model |
selector | subsets the inputImageList and segmentationImageList (eg to define train test splits) |
addCoordConv | boolean - generates another array with CoordConv data |
segmentationsArePoints | boolean - converts segmentations to points |
maskIndex | the entry within the list of lists that contains a mask |
smoothHeatMaps | numeric greater than zero will cause method to return heatmaps.
the value passed here also sets the smoothing parameter passed to |
numpynames | the names of the numpy on disk files should contain something with the string mask if using maskIndex and something with the word coordconv if using CC. should include something with the word heatmaps if using heatmaps. |
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
|
noiseParameters | 'additivegaussian': |
sdSimulatedBiasField | Characterize the standard deviation of the amplitude. |
sdHistogramWarping | Determines the strength of the bias field. |
sdAffine | Determines the amount of transformation based change |
list of array
Avants BB
#>#>#> #> #> #> #> #> #>#> #>#>#> #>#>#> #>ilist = list( list( ri(1) ), list( ri(2) ) ) slist = list( thresholdImage( ilist[[1]][[1]], "Otsu",3), thresholdImage( ilist[[2]][[1]], "Otsu",3) ) npn = paste0(tempfile(), c('i.npy','s.npy','heatmap.npy','coordconv.npy') ) temp = generateDiskData( ilist, slist, c(0:3), c(TRUE,TRUE), numpynames = npn ) temp = generateDiskData( ilist, slist, c(0:3), c(TRUE,TRUE), segmentationsArePoints=TRUE, numpynames = npn ) temp = generateDiskData( ilist, slist, c(0:3), c(TRUE,TRUE), segmentationsArePoints=TRUE, smoothHeatMaps = 3.0, numpynames = npn )