Skip to content

Commit

Permalink
Merge branch 'master' into mb/rm-torch-install-doc
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieuboudreau committed Aug 5, 2022
2 parents 317a9f4 + f9653c0 commit 41f49d3
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 13 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ log.txt
# Pycharm stuff
.idea

# VSCode stuff
.vscode

# Pytest Cache, anywhere:
.pytest_cache/

Expand All @@ -33,4 +36,4 @@ data_multi_testing/
.DS_Store

# venv
venv/
venv/
6 changes: 3 additions & 3 deletions ivadomed/loader/segmentation_pair.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,11 +311,11 @@ def convert_file_to_nifti(self, filename, extension, is_gt=False):
# For '.png', '.tif', '.tiff', '.jpg' and 'jpeg' extentions
# Read image as 8 bit grayscale in numpy array (behavior TBD in ivadomed for RGB, RBGA or higher bit depth)
if "tif" in extension:
img = np.expand_dims(imageio.imread(filename, format='tiff-pil'), axis=-1).astype(np.uint8)
img = np.expand_dims(imageio.v2.imread(filename, format='tiff-pil'), axis=-1).astype(np.uint8)
if len(img.shape) > 3:
img = np.expand_dims(imageio.imread(filename, format='tiff-pil', as_gray=True), axis=-1).astype(np.uint8)
img = np.expand_dims(imageio.v2.imread(filename, format='tiff-pil', as_gray=True), axis=-1).astype(np.uint8)
else:
img = np.expand_dims(imageio.imread(filename, as_gray=True), axis=-1).astype(np.uint8)
img = np.expand_dims(imageio.v2.imread(filename, as_gray=True), axis=-1).astype(np.uint8)

# Binarize ground-truth values (0-255) to 0 and 1 in uint8 with threshold 0.5
if is_gt:
Expand Down
2 changes: 1 addition & 1 deletion ivadomed/scripts/download_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"url": ["https://github.com/ivadomed/model_find_disc_t2/archive/r20200928.zip"],
"description": "Intervertebral disc detection model trained on T2-weighted images."},
"data_functional_testing": {
"url": ["https://github.com/ivadomed/data_functional_testing/archive/r20210617.zip"],
"url": ["https://github.com/ivadomed/data_functional_testing/archive/r20211002.zip"],
"description": "Data used for functional testing in Ivadomed."},
"data_axondeepseg_sem": {
"url": ["https://github.com/axondeepseg/data_axondeepseg_sem/archive/r20211130.zip"],
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
pyparsing<3,>=2.0.2
csv-diff>=1.0
loguru~=0.5
imageio~=2.19
joblib~=1.0
matplotlib>=3.3.0
nibabel~=3.2
onnxruntime==1.7.0
pandas~=1.1
pillow>=7.0.0
pybids>=0.14.0
scikit-learn>=0.20.3
scikit-image~=0.17
Expand Down
15 changes: 8 additions & 7 deletions testing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,22 @@ Checkout `ivadomed/.github/workflows/run_tests.yml` to see how tests are run on

## Running Locally

1. Download the required dataset(s) using the `ivadomed` command line tools:
1. Install dependencies
```
cd ivadomed # root of the repo
ivadomed_download_data -d data_testing -o data_testing # for unit tests
ivadomed_download_data -d data_functional_testing -o data_functional_testing # for functional tests
pip install -e .[dev]
```

2. To run all tests:
```
pytest
pytest -v
```

or, to run specific tests:
```
pytest testing/functional_tests/
pytest testing/unit_tests/
pytest testing/functional_tests/test_example.py
pytest -v testing/functional_tests/
pytest -v testing/unit_tests/
pytest -v testing/functional_tests/test_example.py
```

## Wiki
Expand Down

0 comments on commit 41f49d3

Please sign in to comment.