misc.imshow
ipython
import os
from scipy import misc
dataDir = os.environ["HOME"] + "/Downloads/SimpleITK-MICCAI-2001-Tutorial-master/Data"
print dataDir
image = misc.imread(dataDir + "FA.png")
misc.imshow(image)
或者
ipython
import os
from scipy import misc
fileName ='/home/bids/Downloads/SimpleITK-MICCAI-2001-Tutorial-master/Data/FA.png'
print dataDir
image = misc.imread(fileName)
misc.imshow(image)
sitk.Show
ipython
import SimpleITK as sitk
fileName ='/home/bids/Downloads/SimpleITK-MICCAI-2001-Tutorial-master/Data/FA.png'
img = sitk.ReadImage(fileName)
scalarImage = sitk.Cast(img,sitk.sitkUInt32)
sitk.Show(scalarImage)
或者
ipython
import SimpleITK as sitk
import os
dataDir = os.environ["HOME"] + "/Downloads/SimpleITK-MICCAI-2001-Tutorial-master/Data"
print dataDir
image = sitk.ReadImage(dataDir + "/FA.png")
sitk.Show(image)
备注:
采用sitk.Show 是 默认打开imagej去打开图像,往往有时候仅仅是打开了imagej,而无法显示图像。