-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix sample data loading to be independent of current working directory (
#47)
- Loading branch information
1 parent
149a183
commit f365acf
Showing
2 changed files
with
27 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from importlib.resources import files | ||
from typing import List | ||
|
||
from napari.types import LayerData | ||
from tifffile import imread | ||
|
||
|
||
def load_sample_data() -> List[LayerData]: | ||
""" | ||
Load the sample data. | ||
Returns | ||
------- | ||
List[LayerData] | ||
The sample data. | ||
""" | ||
path = str( | ||
files("brainglobe_registration").joinpath("resources/sample_hipp.tif") | ||
) | ||
|
||
return [(imread(path), {"name": "Sample Data"})] |