Description Usage Arguments Value Author(s) Examples
View source: R/writeNormalizedPopulationData.R
This function reads a file created by writeNormalizedPopulationData
.
1 | readNormalizedPopulationData(filename)
|
filename |
input filename for hdf5 file. |
list containing demographics, imageMat, imageMask and imageBoolean
Avants BB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | tfn = system.file("extdata", "normpop.h5", package = "ANTsR")
if (file.exists(tfn)) {
dlist = readNormalizedPopulationData( tfn)
}
## Not run:
ilist = getANTsRData( "population" )
mask = getMask( ilist[[ 1 ]] )
imat = imageListToMatrix( ilist, mask )
demog = data.frame( age = c( 11, 7, 18, 22 ), sex = c("M","M","F","F") )
ibool = c( TRUE, TRUE, TRUE, FALSE )
tfn = tempfile(fileext=".h5")
if ( usePkg( "hdf5r" ) ) writeNormalizedPopulationData( demog, imat, mask, ibool, tfn )
if ( usePkg( "hdf5r" ) ) {
dlist = readNormalizedPopulationData( tfn )
all.equal(dlist$demographics, demog)
all.equal(dlist$imageMat, imat)
all.equal(as.array(dlist$imageMask), as.array(mask))
all.equal(dlist$imageBool, ibool)
}
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.