Skip to content

Visualization examples

stnava edited this page Jul 21, 2021 · 2 revisions
import ants
image = ants.image_read( ants.get_ants_data('ch2')  )
mask = ants.get_mask(image)
segs1 = ants.kmeans_segmentation( image, 3 )
stats = ants.label_stats(image, segs1['segmentation'])
ants.plot( image, ants.mask_image( segs1['segmentation'], segs1['segmentation'], [2,3] ) )
imageol = image * ants.threshold_image( image, 66 , 100 )
ants.plot( image, imageol, overlay_cmap='twilight_shifted', cbar=True )
oll = [
ants.mask_image( segs1['segmentation'], segs1['segmentation'], [1,3] ) ,
ants.mask_image( segs1['segmentation'], segs1['segmentation'], [2,3] ) ,
ants.mask_image( segs1['segmentation'], segs1['segmentation'], [3] )
]
ants.plot_ortho_stack([image,image,image], overlays=oll)
mni = ants.image_read(ants.get_data('mni'))
ants.plot_ortho_double(mni, image , imageol, imageol )