-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from AMYPAD/devel
- Loading branch information
Showing
8 changed files
with
197 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import logging | ||
|
||
from miutil.fdio import extractall | ||
from miutil.web import urlopen_cached | ||
|
||
from .conftest import HOME | ||
|
||
log = logging.getLogger(__name__) | ||
DATA_URL = ( | ||
"https://zenodo.org/record/3877529/files/amyloidPET_FBP_TP0_extra.zip?download=1" | ||
) | ||
|
||
|
||
def main(): | ||
log.info(f"Downloading {DATA_URL}\nto ${{DATA_ROOT:-~}} ({HOME})") | ||
with urlopen_cached(DATA_URL, HOME) as fd: | ||
extractall(fd, HOME) | ||
|
||
|
||
if __name__ == "__main__": | ||
logging.basicConfig(level=logging.INFO) | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
from os import getenv | ||
from textwrap import dedent | ||
|
||
from miutil.fdio import Path | ||
from pytest import fixture, skip | ||
|
||
HOME = Path(getenv("DATA_ROOT", "~")).expanduser() | ||
|
||
|
||
@fixture(scope="session") | ||
def folder_in(): | ||
Ab_PET_mMR_test = HOME / "Ab_PET_mMR_test" | ||
if not Ab_PET_mMR_test.is_dir(): | ||
skip( | ||
dedent( | ||
"""\ | ||
Cannot find Ab_PET_mMR_test in ${DATA_ROOT:-~} (%s). | ||
Try running `python -m tests` to download it. | ||
""" | ||
) | ||
% HOME | ||
) | ||
return Ab_PET_mMR_test | ||
|
||
|
||
@fixture(scope="session") | ||
def folder_ref(folder_in): | ||
Ab_PET_mMR_ref = folder_in / "testing_reference" / "Ab_PET_mMR_ref" | ||
if not Ab_PET_mMR_ref.is_dir(): | ||
skip( | ||
dedent( | ||
"""\ | ||
Cannot find Ab_PET_mMR_ref in | ||
${DATA_ROOT:-~}/testing_reference (%s/testing_reference). | ||
Try running `python -m tests` to download it. | ||
""" | ||
) | ||
% HOME | ||
) | ||
return Ab_PET_mMR_ref | ||
|
||
|
||
@fixture | ||
def PET(folder_ref): | ||
res = folder_ref / "basic" / "17598013_t-3000-3600sec_itr-4_suvr.nii.gz" | ||
assert res.is_file() | ||
return res | ||
|
||
|
||
@fixture | ||
def MRI(folder_in): | ||
res = folder_in / "T1w_N4" / "t1_S00113_17598013_N4bias_cut.nii.gz" | ||
assert res.is_file() | ||
return res |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.