import dipy as dp
import platform
print("DIPY VERSION:",dp.__version__)
print("PYTHON VERSION:",platform.python_version())
DIPY VERSION: 1.5.0 PYTHON VERSION: 3.8.5
from dipy.workflows.io import FetchFlow
from tempfile import TemporaryDirectory # 官网上没有写,记得加上,不然后续报错
available_data = FetchFlow.get_fetcher_datanames().keys()
print("供下载的数据集名称:\n",available_data)
# 或者访问https://dipy.org/documentation/1.5.0/data/#datasets,可在表格DIPY name一列查看所需数据集的名称
供下载的数据集名称: dict_keys(['bundle_atlas_hcp842', 'bundle_fa_hcp', 'bundles_2_subjects', 'cenir_multib', 'cfin_multib', 'file_formats', 'fury_surface', 'gold_standard_io', 'isbi2013_2shell', 'ivim', 'mni_template', 'qtdMRI_test_retest_2subjects', 'qte_lte_pte', 'resdnn_weights', 'scil_b0', 'sherbrooke_3shell', 'stanford_hardi', 'stanford_labels', 'stanford_pve_maps', 'stanford_t1', 'syn_data', 'taiwan_ntu_dsi', 'target_tractogram_hcp', 'tissue_data'])
# 方式一:下载特定数据集
fetch_flow = FetchFlow()
with TemporaryDirectory() as outdir:
print("download dir:",outdir)
fetch_flow.run(['bundle_fa_hcp'])
# 方式二: from dipy.data import fetch_<上面特定数据集的名称>
from dipy.data import fetch_bundle_atlas_hcp842
files,folder = fetch_bundle_atlas_hcp842()
print("files:",files,"\n folder:",)