NII 文件体素数据排序

问题描述 投票:0回答:1

我有一个

.nii
文件,其中包含以下元数据

NII Header Size:               348
NII Magic Number:              n+1
Dimension Information:
       Frequency Dimension:    0
       Phase Dimension:        0
       Slice Dimension:        0
Number of Image Dimensions:    3
        Spatial Dimension X has length:         91
        Spatial Dimension Y has length:         109
        Spatial Dimension Z has length:         91
Intent Code:                   0
Data Type:                     FLOAT
Number of bits per Voxel:      32
Description:                   6.0.5:9e026117
Voxel Dimensions:
        Voxel Dimension X has length:         2.000000
        Voxel Dimension Y has length:         2.000000
        Voxel Dimension Z has length:         2.000000
Image data begins at byte:     352
Data Scaling:
        Slope:                 1.000000
        Y-Intercept:           0.000000
Color Range:
        Min:                   0.020708
        Max:                   9.358182
Slicing Information:
        Slice Start:            0
        Slice End:              0
        Slice Duration:         0.000000
        Slice Code:             0
Measurement Units:
       Spatial Dimension:      MILLIMETER
       Temporal Dimension:     SECOND
Auxiliary File:                render1t
Q Form Code:                   4
       b:                      0.000000
       c:                      1.000000
       d:                      0.000000
       x offset:               90.000000
       y offset:               -126.000000
       z offset:               -72.000000
S Form Code:                   4
Affine Matrix:
-2.000000      0.000000      0.000000      90.000000
0.000000      2.000000      0.000000      -126.000000
0.000000      0.000000      2.000000      -72.000000
0.000000      0.000000      0.000000      1.000000
Total number of voxels:        902629

我怎么知道如何读取图像数据?我知道它是一个浮点数组,但是对于该数组中的每个索引,如何将其转换为

ijk
体素坐标?我真的在寻找正确的函数,可以将 .nii 文件中的每个浮点索引转换为适当的
ijk
体素坐标。

我一直在看这个:https://brainder.org/2012/09/23/the-nifti-file-format/,但要么从未提及,要么我不理解某些东西。

c 3d nifti
1个回答
0
投票

来自 A. M. Winkler 在您链接的页面上的评论:

存储是RAS,即第一个要填充的维度(即运行速度更快的),是“x”,从左到右,然后是“y”,从后到前,然后是“z”,从下到前优越的。当然,这些方向可能与实际的大脑方向不符(如果这根本就是大脑),但是一旦阅读,您就可以使用标题中的 3 种方向方法之一来调整方向,如上所述。

© www.soinside.com 2019 - 2024. All rights reserved.