reorder_img函数的作用是什么?

image原来的情况是:

<class 'nibabel.nifti1.Nifti1Image'>
data shape (134, 35, 152)
affine: 
[[  0.390625     0.           0.         -45.4126606 ]
 [  0.           1.99999988   0.         -35.06213651]
 [  0.           0.           0.390625   -34.27560146]
 [  0.           0.           0.           1.        ]]
metadata:
<class 'nibabel.nifti1.Nifti1Header'> object, endian='<'
sizeof_hdr      : 348
data_type       : b''
db_name         : b''
extents         : 0
session_error   : 0
regular         : b''
dim_info        : 0
dim             : [  3 134  35 152   1   1   1   1]
intent_p1       : 0.0
intent_p2       : 0.0
intent_p3       : 0.0
intent_code     : none
datatype        : float32
bitpix          : 32
slice_start     : 0
pixdim          : [1.        0.390625  1.9999999 0.390625  1.        1.        1.
 1.       ]
vox_offset      : 0.0
scl_slope       : nan
scl_inter       : nan
slice_end       : 0
slice_code      : unknown
xyzt_units      : 0
cal_max         : 0.0
cal_min         : 0.0
slice_duration  : 0.0
toffset         : 0.0
glmax           : 0
glmin           : 0
descrip         : b''
aux_file        : b''
qform_code      : unknown
sform_code      : aligned
quatern_b       : 0.0
quatern_c       : 0.0
quatern_d       : 0.0
qoffset_x       : -45.412663
qoffset_y       : -35.062138
qoffset_z       : -34.2756
srow_x          : [  0.390625   0.         0.       -45.412663]
srow_y          : [  0.          1.9999999   0.        -35.062138 ]
srow_z          : [  0.         0.         0.390625 -34.2756  ]
intent_name     : b''
magic           : b'n+1'

经过reorder_img之后变成了:

<class 'nibabel.nifti1.Nifti1Image'>
data shape (134, 35, 152)
affine: 
[[  0.390625     0.           0.         -45.4126606 ]
 [  0.           1.99999988   0.         -35.06213651]
 [  0.           0.           0.390625   -34.27560146]
 [  0.           0.           0.           1.        ]]
metadata:
<class 'nibabel.nifti1.Nifti1Header'> object, endian='<'
sizeof_hdr      : 348
data_type       : b''
db_name         : b''
extents         : 0
session_error   : 0
regular         : b''
dim_info        : 0
dim             : [  3 134  35 152   1   1   1   1]
intent_p1       : 0.0
intent_p2       : 0.0
intent_p3       : 0.0
intent_code     : none
datatype        : float32
bitpix          : 32
slice_start     : 0
pixdim          : [1.        0.390625  1.9999999 0.390625  1.        1.        1.
 1.       ]
vox_offset      : 0.0
scl_slope       : nan
scl_inter       : nan
slice_end       : 0
slice_code      : unknown
xyzt_units      : 0
cal_max         : 0.0
cal_min         : 0.0
slice_duration  : 0.0
toffset         : 0.0
glmax           : 0
glmin           : 0
descrip         : b''
aux_file        : b''
qform_code      : unknown
sform_code      : aligned
quatern_b       : 0.0
quatern_c       : 0.0
quatern_d       : 0.0
qoffset_x       : -45.412663
qoffset_y       : -35.062138
qoffset_z       : -34.2756
srow_x          : [  0.390625   0.         0.       -45.412663]
srow_y          : [  0.          1.9999999   0.        -35.062138 ]
srow_z          : [  0.         0.         0.390625 -34.2756  ]
intent_name     : b''
magic           : b'n+1'

看起来好像没有什么变化,reorder_img源码中的注释为:

Returns an image with the affine diagonal (by permuting axes).
The orientation of the new image will be RAS (Right, Anterior, Superior).
If it is impossible to get xyz ordering by permuting the axes, a
‘ValueError’ is raised.
返回带有放射对角线的图片,是不是给图片加了这个所谓的“放射对角线”这个属性呢?
暂且认为是吧,这个是3D-CNN-UNET代码中用来缩放图片时候用到的,望有志之士给予解答。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

MichaelToLearn

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值