Home > other >  Python VTK 3 d reconstruction error
Python VTK 3 d reconstruction error

Time:02-10


Error is written File operation failed. The row=0, Read=867, Skip0=1, Skip1=0, FilePos=1, FileName=D://bisheshuju//all 50 p//dong5 biaoding////dong5//000. BMP
But under the similar mistakes I found on the web all have no reply the solution
The code below
 import VTK 

ARender=VTK. VtkRenderer ()
Renwin=VTK. VtkRenderWindow ()
Renwin. AddRenderer (aRender)
Iren=VTK. VtkRenderWindowInteractor ()
Iren. SetRenderWindow (Renwin)

# define a picture read interface
Jpg_Reader=VTK. VtkBMPReader ()
Jpg_Reader. SetNumberOfScalarComponents (1)
Jpg_Reader. SetFileDimensionality (# 3) that the image is 3 d

Jpg_Reader. SetDataSpacing (3.2, 3.2, 1.5)
Jpg_Reader. SetDataExtent (0, 289, 0, 289, 0, 240)
# set the location of the image
Jpg_Reader. SetFilePrefix (" D://bisheshuju//all biaoding 50 p////dong5//dong5//")
# set image prefix name
Jpg_Reader. SetFilePattern (" % s % 3 d. The BMP ")
Jpg_Reader. SetAllow8BitBMP (16)
Jpg_Reader. The Update ()
Jpg_Reader. SetDataByteOrderToLittleEndian ()


Contour=VTK. VtkMarchingCubes ()
Contour. SetInputConnection (Jpg_Reader GetOutputPort ())
Contour.Com puteNormalsOn ()
Contour. SetValue (0, 175)


Mapper=VTK. VtkPolyDataMapper ()
Mapper. SetInputConnection (contour. GetOutputPort ())
Mapper. ScalarVisibilityOff ()

The actor=VTK. VtkActor ()
The actor. SetMapper (mapper)

The renderer=VTK. VtkRenderer ()
The renderer. SetBackground ([0.1, 0.1, 0.5])
The renderer. AddActor (actor)

The window=VTK. VtkRenderWindow ()
Window. SetSize (512, 512)
Window. AddRenderer (the renderer)


Interactor=VTK. VtkRenderWindowInteractor ()
Interactor. SetRenderWindow (Windows)

# started to show
Window. The Render ()
Interactor. The Initialize ()
Interactor. Start ()
  • Related