paraview vtk文件乱码_在Paraview等可视化软件中读取VTK文件时,它们的尾部顺序是否独立?...

I am working on a file whose endian is different from my desktop and I need to convert it, but When I visualized the vtk it worked. So are vtkreaders of vtk files endian independent

解决方案

ParaView can read VTK files written using either big- or little-endian byte ordering and will try to work out which format has been used when writing a given file. From the VTK File format documentation:

Binary Files.

Binary files in VTK are portable across different computer systems as long as you observe two conditions.

First, make sure that the byte ordering of the data is correct, and second, make sure that the length of each data type is consistent. Most of the time VTK manages the byte ordering of binary files for you. When you write a binary file on one computer and read it in from another computer, the bytes representing the data will be automatically swapped as necessary. For example, binary files written on a Sun are stored in big endian order, while those on a PC are stored in little endian order. As a result, files written on a Sun workstation require byte swapping when read on a PC. (See the class vtkByteSwap for implementation details.) The VTK data files described here are written in big endian form.

Note, that if you are using the newer XML VTK file formats you can specify the byte ordering explicitly in the file, see, for example, the VTK wiki for more information on this. Basically the VTKFile element has the form

...rest of file...

where the byte_order specified:

may be either "LittleEndian" or "BigEndian" and indicates the byte order used for any binary data in the file.

It should be emphasied that this is only a issue for binary data. Legacy ASCII VTK files do not care about byte ordering.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值