[vtkusers] Problem with creating binary files; NOT byte order - I think

Ruff albin.nilsson at gmail.com
Thu Jul 25 08:18:13 EDT 2013


Reading binary files that I've written, VTK is giving me "/ Unsupported point
attribute type:  for file: points_frame1.vtk/"
It looks like Im doing everything by the book (and writing ASCII works
perfectly), so what have I done wrong?

The following code is used to produce a simple 2x2x2 structuredPoints-grid
with one value to every point.

program testbinary
    implicit none

    open(unit=1,file='points_frame1.vtk', form='formatted')
    write(1,'(a)')"# vtk DataFile Version 3.0"
    write(1,'(a)')"Some values written as vtkStructuredPoints"
    write(1,'(a)')"BINARY"
    write(1,'(a)')"DATASET STRUCTURED_POINTS"
    write(1,'(a)')"DIMENSIONS 2 2 2"
    write(1,'(a)')"SPACING 1 1 1"
    write(1,'(a)')"ORIGIN 1 1 1"
    write(1,'(a)')"POINT_DATA 8"
    write(1,'(a)')"SCALARS ImageScalars unsigned_short"
    write(1,'(a)')"LOOKUP_TABLE default"
    
    ! Changing to binary input
    close(1)
    open(unit = 1, file='points_frame1.vtk',
position='append',form='unformatted', convert='BIG_ENDIAN',
access='sequential')
    
    ! Adding scalars to the vtkStructuredPoints
    write(1) 10,20,30,40,50,60,70,80
    close(1)
    
end program testbinary




--
View this message in context: http://vtk.1045678.n5.nabble.com/Problem-with-creating-binary-files-NOT-byte-order-I-think-tp5722241.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list