[vtkusers] can't use vtkStructuredPointsReader

Shun Wong shw206 at doc.ic.ac.uk
Wed Nov 12 09:24:07 EST 2008


Hi everyone,

    I am trying to use vtkStructuredPointsReader in java, and the first 
line of the code ensures the vtk file exists.
But it doesn't work!!(if it does, originXYZ should have been [-81.987493 
-92.294492 -74.491504] )


        System.out.println(new 
File("a01.vtk").exists());                         //true
        reader = new vtkStructuredPointsReader();
        reader.SetFileName("a01.vtk");
        originXYZ = 
reader.GetOutput().GetOrigin();                              //[0,0,0] !!!!!



Here is the header of the vtk file(a01.vtk):
# vtk DataFile Version 2.0
Created by itkImageToFileVTK
BINARY
DATASET STRUCTURED_POINTS
DIMENSIONS 176 198 160
ORIGIN -81.987493 -92.294492 -74.491504
SPACING 0.937000 0.937000 0.937000
POINT_DATA 5575680
SCALARS scalars short 1
LOOKUP_TABLE default


Did I miss anything for the reader?

Thanks in advance,
shw206



More information about the vtkusers mailing list