[vtkusers] exception:the memory cannot be written

xujf xujf at sjtu.edu.cn
Fri May 13 09:43:02 EDT 2005


hello,everyone:

      When I Eroded the imagedata employing the vtkimagedilateerode3D, an exception happened, which said the memory cannot be written. If the imagedata is smaller,no such  exception happens. I don\'t know why?

the code is shown below:
th2 = vtkImageThreshold()
        th2.SetInput(self.castToFloat.GetOutput())
        th2.ThresholdBetween(self.lowth,self.ScalarRange[1])
        th2.SetOutValue(0)
        th2.SetInValue(1)
        th2.Update()
        pre_result = th2.GetOutput()
        pre_result.Update()
                
        for i in xrange(self.iterator):
            print i
            morph_e1 = vtkImageDilateErode3D()
            morph_e1.SetInput(pre_result)
            morph_e1.SetKernelSize(3,3,3)
            morph_e1.SetDilateValue(0)
            morph_e1.SetErodeValue(1)
            morph_e1.ReleaseDataFlagOff()
            morph_e1.Update()
            pre_result = morph_e1.GetOutput()
            
            pre_result.Update()
            morph_e1.UnRegisterAllOutputs()   
            del morph_e1 


More information about the vtkusers mailing list