View source: R/oneHotSegmentation.R
segmentationToOneHot | R Documentation |
Basic one-hot transformation of segmentations array.
segmentationToOneHot(
segmentationsArray,
segmentationLabels = NULL,
channelFirstOrdering = FALSE
)
segmentationsArray |
multi-label numpy array |
segmentationLabels |
vector of segmentation labels. Note that a background label (typically 0) needs to be included. |
channelFirstOrdering |
Specifies the ordering of the dimensions. |
an n-D array of shape where the segmentation labels are expanded in a one-hot fashion in the channels dimension.
Tustison NJ
r16 <- antsImageRead( getANTsRData( "r16" ) )
seg <- kmeansSegmentation( r16, 3 )$segmentation
oneHot <- segmentationToOneHot( as.array( seg ) )
r16 <- antsImageRead( getANTsRData( "r16" ) )
seg <- kmeansSegmentation( r16, 3 )$segmentation
oneHot <- segmentationToOneHot( as.array( seg ),
channelFirstOrdering = TRUE )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.