草庐IT

python - 如何在 Python(不使用 MedPy)或 C 中将 *.mha 文件转换为 *.nii 文件?

我想在Python中处理*.mha文件。但它需要MedPy包,而MedPy包依赖于ITK包。我目前在安装ITK包时遇到问题。我在想是否有办法将*.mha文件转换为*.nii文件(使用其他方式,可能是C++)因为我可以使用Python来读取*.nii文件。欢迎任何相关的指点。 最佳答案 您可以在Python中安装SimpleITK并使用它来进行转换。例如,importSimpleITKassitkroot_path='/path/to/image'nii_path=root_path+'/data.nii'mha_path=root_

Python第三方库之MedPy

文章目录1.MedPy简介2.MedPy安装3.MedPy常用函数3.1`medpy.io.load(image)`3.2`medpy.metric.binary.dc(result,reference)`3.3`medpy.metric.binary.jc(result,reference)`3.4`medpy.metric.binary.hd(result,reference,voxelspacing=None,connectivity=1,)`3.5`medpy.metric.binary.hd95(result,reference,voxelspacing=None,connectiv

Python第三方库之MedPy

文章目录1.MedPy简介2.MedPy安装3.MedPy常用函数3.1`medpy.io.load(image)`3.2`medpy.metric.binary.dc(result,reference)`3.3`medpy.metric.binary.jc(result,reference)`3.4`medpy.metric.binary.hd(result,reference,voxelspacing=None,connectivity=1,)`3.5`medpy.metric.binary.hd95(result,reference,voxelspacing=None,connectiv