Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: Make pcasl available in get_ants_data #465

Merged
merged 1 commit into from
May 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions ants/utils/get_ants_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def get_data(file_id=None, target_file_name=None, antsx_cache_directory=None):
- 'ch2'
- 'mni'
- 'surf'
- 'pcasl'
Returns
-------
string
Expand All @@ -50,7 +51,8 @@ def switch_data(argument):
"r85": "https://ndownloader.figshare.com/files/28726527",
"ch2": "https://ndownloader.figshare.com/files/28726494",
"mni": "https://ndownloader.figshare.com/files/28726500",
"surf": "https://ndownloader.figshare.com/files/28726530"
"surf": "https://ndownloader.figshare.com/files/28726530",
"pcasl": "http://files.figshare.com/1862041/101_pcasl.nii.gz",
}
return(switcher.get(argument, "Invalid argument."))

Expand All @@ -69,7 +71,8 @@ def switch_data(argument):
"r85",
"ch2",
"mni",
"surf"
"surf",
"pcasl",
"show")

if file_id == "show" or file_id is None:
Expand All @@ -78,13 +81,16 @@ def switch_data(argument):
url = switch_data(file_id)

if target_file_name == None:
extension = ".jpg"
if file_id == "ch2" or file_id == "mni" or file_id == "surf":
extension = ".nii.gz"
if extension == ".jpg":
target_file_name = antsx_cache_directory + file_id + "slice" + extension
if file_id == "pcasl":
target_file_name = antsx_cache_directory + "pcasl.nii.gz"
else:
target_file_name = antsx_cache_directory + file_id + extension
extension = ".jpg"
if file_id == "ch2" or file_id == "mni" or file_id == "surf":
extension = ".nii.gz"
if extension == ".jpg":
target_file_name = antsx_cache_directory + file_id + "slice" + extension
else:
target_file_name = antsx_cache_directory + file_id + extension

target_file_name_path = target_file_name
if target_file_name == None:
Expand Down