[Insight-users] What's wrong with this code?
tsai
tsai at sjtu.edu.cn
Fri, 9 Apr 2004 23:11:55 +0800
Hello,insight-users=A3=A1
import sys,os
import paths
from InsightToolkit import *
from vtkMINCReader import *
from ConnectVTKITK import *
reader =3DitkImageFileReaderF2_New()
reader.SetFileName("d:/Life/photo/genius.jpg")
diffusion =3D itkGradientAnisotropicDiffusionImageFilterF2F2_New()
diffusion.SetInput(reader.GetOutput())
diffusion.SetTimeStep(0.0625)
diffusion.SetConductanceParameter(9.0)
diffusion.SetNumberOfIterations( 5 );
##
gradient =3D itkGradientMagnitudeImageFilterF2F2_New()
gradient.SetInput(diffusion.GetOutput())
Watershed =3D itkWatershedImageFilterF2_New()
Watershed.SetInput(gradient.GetOutput())
Watershed.SetThreshold(1.0)
Watershed.SetLevel(0.6)
#print Watershed.GetOutput()
writer =3D itkImageFileWriterF2_New()
writer.SetFileName("e:/xjf.png")
writer.SetInput( Watershed.GetOutput() )
writer.Write()
Best Regards,
tsai
tsai at sjtu.edu.cn