DEC VAX 与 IA-32 的字节顺序

发布于 2024-08-03 18:09:20 字数 561 浏览 3 评论 0原文

问题的描述如下。如果您不感兴趣,可以跳到最后一行。


我正在使用

人体头部的 109 切片 MRI 数据集。完整的切片连续存储为 256 x 256 数组。像素由 2 个连续字节组成,构成一个二进制整数。数据在西门子 Magnetom 上采集,由新泽西州艾斯林的西门子医疗系统公司提供。

进而:

数据集是在数字设备公司 (DEC) VAX 计算机上写入的。每个文件仅包含像素,以行主顺序存储,每个像素 2 字节整数。要在具有正常字节顺序(DEC 使用反向字节顺序)的计算机上使用图像,您应该交换备用字节,例如在 UNIX 中使用“dd”命令。对 3dknee 数据集执行此操作的示例命令是:

% dd if=3dknee of=3dknee.new conv=swab

我不知道实际值是什么,所以我不能仅通过查看字节顺序是否正确来判断。

底线

DEC VAX 的字节顺序与 IA-32 中的字节顺序相同还是相反?

A description of the problem follows. You can skip to the bottom line if you're not interested.


I am working with a data file with this description:

A 109-slice MRI data set of a human head. Complete slices are stored consecutively as a 256 x 256 array. Pixels consist of 2 consecutive bytes making one binary integer. Data taken on the Siemens Magnetom and provided courtesy of Siemens Medical Systems, Inc., Iselin, NJ.

and then:

The data sets were written on a Digital Equipment Corporation (DEC) VAX computer. Each file contains only pixels, stored in row major order with 2-byte integers per pixel. To use the images on machines that have normal byte order (DECs use reverse byte order), you should swap alternate bytes, for example using the 'dd' command in UNIX. A sample command that does this for the 3dknee data set is:

% dd if=3dknee of=3dknee.new conv=swab

I don't know what the real values are, so I can't judge just by looking if the byte order is correct.

The Bottom line

Is the byte order of a DEC VAX the same as in IA-32, or reversed?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

夕色琉璃 2024-08-10 18:09:20

根据此页面此页面,VAX 和 x86 都使用小端字节顺序。所以不需要转换。

According to this page and this page, the VAX and x86 both use little-endian byte order. So no conversion should be needed.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文