Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions tests/test_cuimage_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
PILImage, has_pil = optional_import("PIL.Image")

FILE_URL = "http://openslide.cs.cmu.edu/download/openslide-testdata/Generic-TIFF/CMU-1.tiff"
FILE_PATH = os.path.join(os.path.dirname(__file__), "testing_data", os.path.basename(FILE_URL))
FILE_PATH = os.path.join(os.path.dirname(__file__), "testing_data", "temp_" + os.path.basename(FILE_URL))

HEIGHT = 32914
WIDTH = 46000
Expand Down Expand Up @@ -105,7 +105,7 @@ def test_read_rgba(self, img_expected):
image = {}
reader = WSIReader("cuCIM")
for mode in ["RGB", "RGBA"]:
file_path = self.create_rgba_image(img_expected, "test_cu_tiff_image", mode=mode)
file_path = self.create_rgba_image(img_expected, "temp_cu_tiff_image", mode=mode)
img_obj = reader.read(file_path)
image[mode], _ = reader.get_data(img_obj)

Expand Down
38 changes: 20 additions & 18 deletions tests/test_masked_inference_wsi_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@
_, has_osl = optional_import("openslide")

FILE_URL = "http://openslide.cs.cmu.edu/download/openslide-testdata/Generic-TIFF/CMU-1.tiff"
FILE_PATH = os.path.join(os.path.dirname(__file__), "testing_data", os.path.basename(FILE_URL))
base_name, extension = os.path.splitext(os.path.basename(FILE_URL))
FILE_NAME = "temp_" + base_name
FILE_PATH = os.path.join(os.path.dirname(__file__), "testing_data", FILE_NAME + extension)

MASK1 = os.path.join(os.path.dirname(__file__), "testing_data", "tissue_mask1.npy")
MASK2 = os.path.join(os.path.dirname(__file__), "testing_data", "tissue_mask2.npy")
MASK4 = os.path.join(os.path.dirname(__file__), "testing_data", "tissue_mask4.npy")
MASK1 = os.path.join(os.path.dirname(__file__), "testing_data", "temp_tissue_mask1.npy")
MASK2 = os.path.join(os.path.dirname(__file__), "testing_data", "temp_tissue_mask2.npy")
MASK4 = os.path.join(os.path.dirname(__file__), "testing_data", "temp_tissue_mask4.npy")

HEIGHT = 32914
WIDTH = 46000
Expand Down Expand Up @@ -47,7 +49,7 @@ def prepare_data():
[
{
"image": np.array([[[243]], [[243]], [[243]]], dtype=np.uint8),
"name": "CMU-1",
"name": FILE_NAME,
"mask_location": [100, 100],
},
],
Expand All @@ -62,12 +64,12 @@ def prepare_data():
[
{
"image": np.array([[[243]], [[243]], [[243]]], dtype=np.uint8),
"name": "CMU-1",
"name": FILE_NAME,
"mask_location": [100, 100],
},
{
"image": np.array([[[243]], [[243]], [[243]]], dtype=np.uint8),
"name": "CMU-1",
"name": FILE_NAME,
"mask_location": [101, 100],
},
],
Expand All @@ -82,22 +84,22 @@ def prepare_data():
[
{
"image": np.array([[[243]], [[243]], [[243]]], dtype=np.uint8),
"name": "CMU-1",
"name": FILE_NAME,
"mask_location": [100, 100],
},
{
"image": np.array([[[243]], [[243]], [[243]]], dtype=np.uint8),
"name": "CMU-1",
"name": FILE_NAME,
"mask_location": [100, 101],
},
{
"image": np.array([[[243]], [[243]], [[243]]], dtype=np.uint8),
"name": "CMU-1",
"name": FILE_NAME,
"mask_location": [101, 100],
},
{
"image": np.array([[[243]], [[243]], [[243]]], dtype=np.uint8),
"name": "CMU-1",
"name": FILE_NAME,
"mask_location": [101, 101],
},
],
Expand All @@ -121,7 +123,7 @@ def prepare_data():
],
dtype=np.uint8,
),
"name": "CMU-1",
"name": FILE_NAME,
"mask_location": [100, 100],
},
],
Expand All @@ -139,17 +141,17 @@ def prepare_data():
[
{
"image": np.array([[[243]], [[243]], [[243]]], dtype=np.uint8),
"name": "CMU-1",
"name": FILE_NAME,
"mask_location": [100, 100],
},
{
"image": np.array([[[243]], [[243]], [[243]]], dtype=np.uint8),
"name": "CMU-1",
"name": FILE_NAME,
"mask_location": [100, 100],
},
{
"image": np.array([[[243]], [[243]], [[243]]], dtype=np.uint8),
"name": "CMU-1",
"name": FILE_NAME,
"mask_location": [101, 100],
},
],
Expand All @@ -167,7 +169,7 @@ def prepare_data():
[
{
"image": np.array([[[243]], [[243]], [[243]]], dtype=np.uint8),
"name": "CMU-1",
"name": FILE_NAME,
"mask_location": [100, 100],
},
],
Expand All @@ -182,12 +184,12 @@ def prepare_data():
[
{
"image": np.array([[[243]], [[243]], [[243]]], dtype=np.uint8),
"name": "CMU-1",
"name": FILE_NAME,
"mask_location": [100, 100],
},
{
"image": np.array([[[243]], [[243]], [[243]]], dtype=np.uint8),
"name": "CMU-1",
"name": FILE_NAME,
"mask_location": [101, 100],
},
],
Expand Down
2 changes: 1 addition & 1 deletion tests/test_openslide_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@


FILE_URL = "http://openslide.cs.cmu.edu/download/openslide-testdata/Generic-TIFF/CMU-1.tiff"
FILE_PATH = os.path.join(os.path.dirname(__file__), "testing_data", os.path.basename(FILE_URL))
FILE_PATH = os.path.join(os.path.dirname(__file__), "testing_data", "temp_" + os.path.basename(FILE_URL))

HEIGHT = 32914
WIDTH = 46000
Expand Down
2 changes: 1 addition & 1 deletion tests/test_patch_wsi_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
_, has_osl = optional_import("openslide")

FILE_URL = "http://openslide.cs.cmu.edu/download/openslide-testdata/Generic-TIFF/CMU-1.tiff"
FILE_PATH = os.path.join(os.path.dirname(__file__), "testing_data", os.path.basename(FILE_URL))
FILE_PATH = os.path.join(os.path.dirname(__file__), "testing_data", "temp_" + os.path.basename(FILE_URL))

TEST_CASE_0 = [
{
Expand Down
2 changes: 1 addition & 1 deletion tests/test_smartcache_patch_wsi_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
_, has_cim = optional_import("cucim")

FILE_URL = "http://openslide.cs.cmu.edu/download/openslide-testdata/Generic-TIFF/CMU-1.tiff"
FILE_PATH = os.path.join(os.path.dirname(__file__), "testing_data", os.path.basename(FILE_URL))
FILE_PATH = os.path.join(os.path.dirname(__file__), "testing_data", "temp_" + os.path.basename(FILE_URL))

TEST_CASE_0 = [
{
Expand Down