Skip to content

Commit

Permalink
Allowing users to alternatively provide image path list instead of pa…
Browse files Browse the repository at this point in the history
…th to image containing folders.
  • Loading branch information
RichardObi committed May 1, 2024
1 parent 8b88062 commit 0706f97
Show file tree
Hide file tree
Showing 7 changed files with 152 additions and 86 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,7 @@ dmypy.json
.nox/

# pytest cache dirs
.pytest_cache/
.pytest_cache/

# csv files with features
*.csv
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ Requirements:
- numpy
- opencv_contrib_python_headless
- scipy
- tqdm

## Usage

Expand All @@ -55,11 +54,23 @@ If you would like to import frd as a module, you can use the following code snip
from frd_score import frd
paths=['path/to/dataset_A', 'path/to/dataset_B']
paths_masks=[path_mask_A, path_mask_B] # optionally, we can add masks.
# optionally, use masks.
paths_masks=[path_mask_A, path_mask_B]
frd_value = frd.compute_frd(paths, paths_masks=paths_masks)
```

Instead of providing the path to a folder, you may also directly provide a list to image paths (and/or masks).
```
img_paths_A = ['path/to/image1', 'path/to/image2']
img_paths_B = ['path/to/image3', 'path/to/image4']
paths=[img_paths_A, img_paths_B]
frd_value = frd.compute_frd(paths)
```

## Additional arguments

`--paths_masks` or `-M`: The two paths to the masks of the two datasets. The masks should have the same dimensions as the images. The masks should be binary images, where the region of interest is white (pixel value 255) and the background is black (pixel value 0). Masks are used to localize radiomics features.
Expand Down
2 changes: 1 addition & 1 deletion requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Pillow~=10.3.0
scipy~=1.10.0
SimpleITK~=2.3.1
pyradiomics==3.0.1a3
tqdm~=4.64.1
#tqdm~=4.64.1

# Required for testing
setuptools~=65.6.3
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ tomli==2.0.1
# via
# nox
# pytest
tqdm==4.64.1
#tqdm==4.64.1
# via -r requirements.in
virtualenv==20.26.0
# via nox
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def get_version(rel_path):
"scipy>=1.10.0",
"opencv_contrib_python_headless>=4.8.1.78",
"SimpleITK>=2.3.1",
"tqdm>=4.64.1",
#"tqdm>=4.64.1",
],
extras_require={
"dev": ["flake8", "flake8-bugbear", "flake8-isort", "black==24.3.0", "isort", "nox", "pytest>=8.1.1", "nibabel>=3.2.1", ]
Expand Down
Loading

0 comments on commit 0706f97

Please sign in to comment.