diff --git a/helpers/extract_hdf5_images.py b/helpers/extract_hdf5_images.py index a093412d6d6a8e2a50b45ac620fc5b65d95e525e..61c79c912ac47aa2d3b035ced0938f114d12d7c6 100644 --- a/helpers/extract_hdf5_images.py +++ b/helpers/extract_hdf5_images.py @@ -23,8 +23,8 @@ def extract_images_from_hdf5(hdf5_file): return tensors_dict -def get_hdf5_files(directory, recursive=False) -> list[pathlib.Path]: - return directory.glob("**/*.hdf5", recursive=recursive) +def get_hdf5_files(directory) -> list[pathlib.Path]: + return directory.glob("**/*.hdf5") def main(): @@ -34,16 +34,10 @@ def main(): type=pathlib.Path, help="Directory in which hdf5 files are located.", ) - parser.add_argument( - "--recursive", - "-r", - action="store_true", - help="Set to true to search recursively in the input directory.", - ) args = parser.parse_args() - hdf5_files = get_hdf5_files(args.input_dir, recursive=args.recursive) + hdf5_files = get_hdf5_files(args.input_dir) for hdf5_file in hdf5_files: tensors_dict = extract_images_from_hdf5(hdf5_file) diff --git a/pyproject.toml b/pyproject.toml index 5d2bcc6476083cfb7021e5ced001344a0d2e08a4..0be3495ef1bda54fe004d446c5d2f0b47fdc0591 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -425,6 +425,8 @@ lwnet = "mednet.libs.segmentation.config.models.lwnet" # drive dataset - retinal vessel segmentation drive = "mednet.libs.segmentation.config.data.drive.default" +stare = "mednet.libs.segmentation.config.data.stare.ah" +stare-2nd = "mednet.libs.segmentation.config.data.stare.vk" [tool.ruff] line-length = 88 diff --git a/src/mednet/libs/segmentation/config/data/stare/__init__.py b/src/mednet/libs/segmentation/config/data/stare/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/mednet/libs/segmentation/config/data/stare/ah.json b/src/mednet/libs/segmentation/config/data/stare/ah.json new file mode 100644 index 0000000000000000000000000000000000000000..1192d3feebe368d831c8f7444e6303e1427988bc --- /dev/null +++ b/src/mednet/libs/segmentation/config/data/stare/ah.json @@ -0,0 +1,106 @@ +{ + "train": [ + [ + "stare-images/im0001.ppm", + "labels-ah/im0001.ah.ppm", + "stare-images/im0001.png" + ], + [ + "stare-images/im0002.ppm", + "labels-ah/im0002.ah.ppm", + "stare-images/im0002.png" + ], + [ + "stare-images/im0003.ppm", + "labels-ah/im0003.ah.ppm", + "stare-images/im0003.png" + ], + [ + "stare-images/im0004.ppm", + "labels-ah/im0004.ah.ppm", + "stare-images/im0004.png" + ], + [ + "stare-images/im0005.ppm", + "labels-ah/im0005.ah.ppm", + "stare-images/im0005.png" + ], + [ + "stare-images/im0044.ppm", + "labels-ah/im0044.ah.ppm", + "stare-images/im0044.png" + ], + [ + "stare-images/im0077.ppm", + "labels-ah/im0077.ah.ppm", + "stare-images/im0077.png" + ], + [ + "stare-images/im0081.ppm", + "labels-ah/im0081.ah.ppm", + "stare-images/im0081.png" + ], + [ + "stare-images/im0082.ppm", + "labels-ah/im0082.ah.ppm", + "stare-images/im0082.png" + ], + [ + "stare-images/im0139.ppm", + "labels-ah/im0139.ah.ppm", + "stare-images/im0139.png" + ] + ], + "test": [ + [ + "stare-images/im0162.ppm", + "labels-ah/im0162.ah.ppm", + "stare-images/im0162.png" + ], + [ + "stare-images/im0163.ppm", + "labels-ah/im0163.ah.ppm", + "stare-images/im0163.png" + ], + [ + "stare-images/im0235.ppm", + "labels-ah/im0235.ah.ppm", + "stare-images/im0235.png" + ], + [ + "stare-images/im0236.ppm", + "labels-ah/im0236.ah.ppm", + "stare-images/im0236.png" + ], + [ + "stare-images/im0239.ppm", + "labels-ah/im0239.ah.ppm", + "stare-images/im0239.png" + ], + [ + "stare-images/im0240.ppm", + "labels-ah/im0240.ah.ppm", + "stare-images/im0240.png" + ], + [ + "stare-images/im0255.ppm", + "labels-ah/im0255.ah.ppm", + "stare-images/im0255.png" + ], + [ + "stare-images/im0291.ppm", + "labels-ah/im0291.ah.ppm", + "stare-images/im0291.png" + ], + [ + "stare-images/im0319.ppm", + "labels-ah/im0319.ah.ppm", + "stare-images/im0319.png" + ], + [ + "stare-images/im0324.ppm", + "labels-ah/im0324.ah.ppm", + "stare-images/im0324.png" + ] + ] +} diff --git a/src/mednet/libs/segmentation/config/data/stare/ah.py b/src/mednet/libs/segmentation/config/data/stare/ah.py new file mode 100644 index 0000000000000000000000000000000000000000..cf6051a10585ae245a086e8223ffbd0d716c35a2 --- /dev/null +++ b/src/mednet/libs/segmentation/config/data/stare/ah.py @@ -0,0 +1,6 @@ +# SPDX-FileCopyrightText: Copyright © 2024 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: GPL-3.0-or-later +from mednet.libs.segmentation.config.data.stare.datamodule import DataModule + +datamodule = DataModule("ah.json") diff --git a/src/mednet/libs/segmentation/config/data/stare/datamodule.py b/src/mednet/libs/segmentation/config/data/stare/datamodule.py new file mode 100644 index 0000000000000000000000000000000000000000..5fc90042b6c34d06ae1e780e27c3cb30f16698b8 --- /dev/null +++ b/src/mednet/libs/segmentation/config/data/stare/datamodule.py @@ -0,0 +1,128 @@ +# SPDX-FileCopyrightText: Copyright © 2024 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: GPL-3.0-or-later +"""STARE dataset for Vessel Segmentation.""" + +import importlib.resources +import os +from pathlib import Path + +import PIL.Image +import pkg_resources +from mednet.libs.common.data.datamodule import CachingDataModule +from mednet.libs.common.data.split import JSONDatabaseSplit +from mednet.libs.common.data.typing import DatabaseSplit, Sample +from mednet.libs.segmentation.data.typing import ( + SegmentationRawDataLoader as _SegmentationRawDataLoader, +) +from torchvision import tv_tensors +from torchvision.transforms.functional import to_tensor + +from ....utils.rc import load_rc + +CONFIGURATION_KEY_DATADIR = "datadir." + (__name__.rsplit(".", 2)[-2]) +"""Key to search for in the configuration file for the root directory of this +database.""" + + +class SegmentationRawDataLoader(_SegmentationRawDataLoader): + """A specialized raw-data-loader for the Stare dataset.""" + + datadir: str + """This variable contains the base directory where the database raw data is + stored.""" + + def __init__(self): + self.datadir = load_rc().get( + CONFIGURATION_KEY_DATADIR, os.path.realpath(os.curdir) + ) + self._pkg_path = pkg_resources.resource_filename(__name__, "masks") + + def sample(self, sample: tuple[str, str, str]) -> Sample: + """Load a single image sample from the disk. + + Parameters + ---------- + sample + A tuple containing the path suffix, within the dataset root folder, + where to find the image to be loaded, and an integer, representing the + sample label. + + Returns + ------- + The sample representation. + """ + + image = PIL.Image.open(Path(self.datadir) / str(sample[0])).convert( + mode="RGB" + ) + tensor = tv_tensors.Image(to_tensor(image)) + target = tv_tensors.Image( + to_tensor( + PIL.Image.open(Path(self.datadir) / str(sample[1])).convert( + mode="1", dither=None + ) + ) + ) + mask = tv_tensors.Mask( + to_tensor( + PIL.Image.open(Path(self._pkg_path) / str(sample[2])).convert( + mode="1", dither=None + ) + ) + ) + + return tensor, dict(target=target, mask=mask, name=sample[0]) # type: ignore[arg-type] + + +def make_split(basename: str) -> DatabaseSplit: + """Return a database split for the Stare database. + + Parameters + ---------- + basename + Name of the .json file containing the split to load. + + Returns + ------- + An instance of DatabaseSplit. + """ + + return JSONDatabaseSplit( + importlib.resources.files(__name__.rsplit(".", 1)[0]).joinpath(basename) + ) + + +class DataModule(CachingDataModule): + """STARE dataset for Vessel Segmentation. + + A subset of the original STARE dataset contains 20 annotated eye fundus images + with a resolution of 700 x 605 (width x height). Two sets of ground-truth + vessel annotations are available. The first set by Adam Hoover ("ah") is + commonly used for training and testing. The second set by Valentina Kouznetsova + ("vk") is typically used as a “human†baseline. + + * Reference: [STARE-2000]_ + * Original resolution (width x height): 700 x 605 + * Split reference: [MANINIS-2016]_ + * Protocol ``ah`` (default baseline): + + * Training samples: 10 (including labels from annotator "ah") + * Test samples: 10 (including labels from annotator "ah") + + * Protocol ``vk`` (normally used as human comparison): + + * Training samples: 10 (including labels from annotator "vk") + * Test samples: 10 (including labels from annotator "vk") + + Parameters + ---------- + split_filename + Name of the .json file containing the split to load. + """ + + def __init__(self, split_filename: str): + super().__init__( + database_split=make_split(split_filename), + raw_data_loader=SegmentationRawDataLoader(), + ) diff --git a/src/mednet/libs/segmentation/config/data/stare/masks/stare-images/im0001.png b/src/mednet/libs/segmentation/config/data/stare/masks/stare-images/im0001.png new file mode 100644 index 0000000000000000000000000000000000000000..a168919fce790aa441e8f44653ee940f0cc16267 Binary files /dev/null and b/src/mednet/libs/segmentation/config/data/stare/masks/stare-images/im0001.png differ diff --git a/src/mednet/libs/segmentation/config/data/stare/masks/stare-images/im0002.png b/src/mednet/libs/segmentation/config/data/stare/masks/stare-images/im0002.png new file mode 100644 index 0000000000000000000000000000000000000000..8f8c8a3ffea28dac46ee6b14e074baee673c1af8 Binary files /dev/null and b/src/mednet/libs/segmentation/config/data/stare/masks/stare-images/im0002.png differ diff --git a/src/mednet/libs/segmentation/config/data/stare/masks/stare-images/im0003.png b/src/mednet/libs/segmentation/config/data/stare/masks/stare-images/im0003.png new file mode 100644 index 0000000000000000000000000000000000000000..6f24a81234ed08c0105c52b7aaf8646874564ef3 Binary files /dev/null and b/src/mednet/libs/segmentation/config/data/stare/masks/stare-images/im0003.png differ diff --git a/src/mednet/libs/segmentation/config/data/stare/masks/stare-images/im0004.png b/src/mednet/libs/segmentation/config/data/stare/masks/stare-images/im0004.png new file mode 100644 index 0000000000000000000000000000000000000000..bcff601759547854daa8b2d80a307d3bfacf801f Binary files /dev/null and b/src/mednet/libs/segmentation/config/data/stare/masks/stare-images/im0004.png differ diff --git a/src/mednet/libs/segmentation/config/data/stare/masks/stare-images/im0005.png b/src/mednet/libs/segmentation/config/data/stare/masks/stare-images/im0005.png new file mode 100644 index 0000000000000000000000000000000000000000..4ecb4ee387df3f47d61b0b3eeb17aafe5219ec5e Binary files /dev/null and b/src/mednet/libs/segmentation/config/data/stare/masks/stare-images/im0005.png differ diff --git a/src/mednet/libs/segmentation/config/data/stare/masks/stare-images/im0044.png b/src/mednet/libs/segmentation/config/data/stare/masks/stare-images/im0044.png new file mode 100644 index 0000000000000000000000000000000000000000..8cfdf3b2d0a21aaf729eef8b6270d2c7f12d4133 Binary files /dev/null and b/src/mednet/libs/segmentation/config/data/stare/masks/stare-images/im0044.png differ diff --git a/src/mednet/libs/segmentation/config/data/stare/masks/stare-images/im0077.png b/src/mednet/libs/segmentation/config/data/stare/masks/stare-images/im0077.png new file mode 100644 index 0000000000000000000000000000000000000000..c7fcbf7ad307bdbfd78b69f3884eba1c46daa003 Binary files /dev/null and b/src/mednet/libs/segmentation/config/data/stare/masks/stare-images/im0077.png differ diff --git a/src/mednet/libs/segmentation/config/data/stare/masks/stare-images/im0081.png b/src/mednet/libs/segmentation/config/data/stare/masks/stare-images/im0081.png new file mode 100644 index 0000000000000000000000000000000000000000..f777c9fd83e783e7121b89e650c1df5d14e8ff91 Binary files /dev/null and b/src/mednet/libs/segmentation/config/data/stare/masks/stare-images/im0081.png differ diff --git a/src/mednet/libs/segmentation/config/data/stare/masks/stare-images/im0082.png b/src/mednet/libs/segmentation/config/data/stare/masks/stare-images/im0082.png new file mode 100644 index 0000000000000000000000000000000000000000..39905f1111f58853f096c5819528bbf8047584d4 Binary files /dev/null and b/src/mednet/libs/segmentation/config/data/stare/masks/stare-images/im0082.png differ diff --git a/src/mednet/libs/segmentation/config/data/stare/masks/stare-images/im0139.png b/src/mednet/libs/segmentation/config/data/stare/masks/stare-images/im0139.png new file mode 100644 index 0000000000000000000000000000000000000000..325b4b0359d557511abe1d996523e4af36ba1f32 Binary files /dev/null and b/src/mednet/libs/segmentation/config/data/stare/masks/stare-images/im0139.png differ diff --git a/src/mednet/libs/segmentation/config/data/stare/masks/stare-images/im0162.png b/src/mednet/libs/segmentation/config/data/stare/masks/stare-images/im0162.png new file mode 100644 index 0000000000000000000000000000000000000000..38c96484682446831c41646dd76c57d431bf6e72 Binary files /dev/null and b/src/mednet/libs/segmentation/config/data/stare/masks/stare-images/im0162.png differ diff --git a/src/mednet/libs/segmentation/config/data/stare/masks/stare-images/im0163.png b/src/mednet/libs/segmentation/config/data/stare/masks/stare-images/im0163.png new file mode 100644 index 0000000000000000000000000000000000000000..19bb36c7c60560d531f15ae3e9a90873a6d26048 Binary files /dev/null and b/src/mednet/libs/segmentation/config/data/stare/masks/stare-images/im0163.png differ diff --git a/src/mednet/libs/segmentation/config/data/stare/masks/stare-images/im0235.png b/src/mednet/libs/segmentation/config/data/stare/masks/stare-images/im0235.png new file mode 100644 index 0000000000000000000000000000000000000000..24358ce041de1b544aac62feef7b14f730cea82b Binary files /dev/null and b/src/mednet/libs/segmentation/config/data/stare/masks/stare-images/im0235.png differ diff --git a/src/mednet/libs/segmentation/config/data/stare/masks/stare-images/im0236.png b/src/mednet/libs/segmentation/config/data/stare/masks/stare-images/im0236.png new file mode 100644 index 0000000000000000000000000000000000000000..c1a2ccedf662de55343bdfdcc0da7a20cd58af47 Binary files /dev/null and b/src/mednet/libs/segmentation/config/data/stare/masks/stare-images/im0236.png differ diff --git a/src/mednet/libs/segmentation/config/data/stare/masks/stare-images/im0239.png b/src/mednet/libs/segmentation/config/data/stare/masks/stare-images/im0239.png new file mode 100644 index 0000000000000000000000000000000000000000..22a32b77471b69acdd66b7d2cd4b9fc7e4fc2d3d Binary files /dev/null and b/src/mednet/libs/segmentation/config/data/stare/masks/stare-images/im0239.png differ diff --git a/src/mednet/libs/segmentation/config/data/stare/masks/stare-images/im0240.png b/src/mednet/libs/segmentation/config/data/stare/masks/stare-images/im0240.png new file mode 100644 index 0000000000000000000000000000000000000000..4f010e2386c25ec34eaa1ef4e3991e3748dc6233 Binary files /dev/null and b/src/mednet/libs/segmentation/config/data/stare/masks/stare-images/im0240.png differ diff --git a/src/mednet/libs/segmentation/config/data/stare/masks/stare-images/im0255.png b/src/mednet/libs/segmentation/config/data/stare/masks/stare-images/im0255.png new file mode 100644 index 0000000000000000000000000000000000000000..fab4ff67973f55c7659f23f13665d246274ab1a6 Binary files /dev/null and b/src/mednet/libs/segmentation/config/data/stare/masks/stare-images/im0255.png differ diff --git a/src/mednet/libs/segmentation/config/data/stare/masks/stare-images/im0291.png b/src/mednet/libs/segmentation/config/data/stare/masks/stare-images/im0291.png new file mode 100644 index 0000000000000000000000000000000000000000..823233d0b2dcb05a6e51e813f1426a6d4e169cd8 Binary files /dev/null and b/src/mednet/libs/segmentation/config/data/stare/masks/stare-images/im0291.png differ diff --git a/src/mednet/libs/segmentation/config/data/stare/masks/stare-images/im0319.png b/src/mednet/libs/segmentation/config/data/stare/masks/stare-images/im0319.png new file mode 100644 index 0000000000000000000000000000000000000000..27ad8cdfee613c4afc44126c95d4714ff67a13a9 Binary files /dev/null and b/src/mednet/libs/segmentation/config/data/stare/masks/stare-images/im0319.png differ diff --git a/src/mednet/libs/segmentation/config/data/stare/masks/stare-images/im0324.png b/src/mednet/libs/segmentation/config/data/stare/masks/stare-images/im0324.png new file mode 100644 index 0000000000000000000000000000000000000000..1d7a5a616fbbd0bc99f4fe69a20e940f8d6c7308 Binary files /dev/null and b/src/mednet/libs/segmentation/config/data/stare/masks/stare-images/im0324.png differ diff --git a/src/mednet/libs/segmentation/config/data/stare/vk.json b/src/mednet/libs/segmentation/config/data/stare/vk.json new file mode 100644 index 0000000000000000000000000000000000000000..3af0c7834596b798b348120446c36062af81eb52 --- /dev/null +++ b/src/mednet/libs/segmentation/config/data/stare/vk.json @@ -0,0 +1,106 @@ +{ + "train": [ + [ + "stare-images/im0001.ppm", + "labels-vk/im0001.vk.ppm", + "stare-images/im0001.png" + ], + [ + "stare-images/im0002.ppm", + "labels-vk/im0002.vk.ppm", + "stare-images/im0002.png" + ], + [ + "stare-images/im0003.ppm", + "labels-vk/im0003.vk.ppm", + "stare-images/im0003.png" + ], + [ + "stare-images/im0004.ppm", + "labels-vk/im0004.vk.ppm", + "stare-images/im0004.png" + ], + [ + "stare-images/im0005.ppm", + "labels-vk/im0005.vk.ppm", + "stare-images/im0005.png" + ], + [ + "stare-images/im0044.ppm", + "labels-vk/im0044.vk.ppm", + "stare-images/im0044.png" + ], + [ + "stare-images/im0077.ppm", + "labels-vk/im0077.vk.ppm", + "stare-images/im0077.png" + ], + [ + "stare-images/im0081.ppm", + "labels-vk/im0081.vk.ppm", + "stare-images/im0081.png" + ], + [ + "stare-images/im0082.ppm", + "labels-vk/im0082.vk.ppm", + "stare-images/im0082.png" + ], + [ + "stare-images/im0139.ppm", + "labels-vk/im0139.vk.ppm", + "stare-images/im0139.png" + ] + ], + "test": [ + [ + "stare-images/im0162.ppm", + "labels-vk/im0162.vk.ppm", + "stare-images/im0162.png" + ], + [ + "stare-images/im0163.ppm", + "labels-vk/im0163.vk.ppm", + "stare-images/im0163.png" + ], + [ + "stare-images/im0235.ppm", + "labels-vk/im0235.vk.ppm", + "stare-images/im0235.png" + ], + [ + "stare-images/im0236.ppm", + "labels-vk/im0236.vk.ppm", + "stare-images/im0236.png" + ], + [ + "stare-images/im0239.ppm", + "labels-vk/im0239.vk.ppm", + "stare-images/im0239.png" + ], + [ + "stare-images/im0240.ppm", + "labels-vk/im0240.vk.ppm", + "stare-images/im0240.png" + ], + [ + "stare-images/im0255.ppm", + "labels-vk/im0255.vk.ppm", + "stare-images/im0255.png" + ], + [ + "stare-images/im0291.ppm", + "labels-vk/im0291.vk.ppm", + "stare-images/im0291.png" + ], + [ + "stare-images/im0319.ppm", + "labels-vk/im0319.vk.ppm", + "stare-images/im0319.png" + ], + [ + "stare-images/im0324.ppm", + "labels-vk/im0324.vk.ppm", + "stare-images/im0324.png" + ] + ] +} diff --git a/src/mednet/libs/segmentation/config/data/stare/vk.py b/src/mednet/libs/segmentation/config/data/stare/vk.py new file mode 100644 index 0000000000000000000000000000000000000000..f4c88abc6cd2d54ac376f9fa9a5597fcd791bd77 --- /dev/null +++ b/src/mednet/libs/segmentation/config/data/stare/vk.py @@ -0,0 +1,6 @@ +# SPDX-FileCopyrightText: Copyright © 2024 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: GPL-3.0-or-later +from mednet.libs.segmentation.config.data.stare.datamodule import DataModule + +datamodule = DataModule("vk.json") diff --git a/src/mednet/libs/segmentation/tests/data/histograms/models/histograms_lwnet_stare_ah.json b/src/mednet/libs/segmentation/tests/data/histograms/models/histograms_lwnet_stare_ah.json new file mode 100644 index 0000000000000000000000000000000000000000..aa9585edc780fbae5bd324ee677e74978112f3a9 --- /dev/null +++ b/src/mednet/libs/segmentation/tests/data/histograms/models/histograms_lwnet_stare_ah.json @@ -0,0 +1,16 @@ +{ + "train": [ + ["stare-images/im0002.ppm", [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 13, 61, 337, 1045, 1529, 1759, 2068, 2152, 2175, 1749, 1187, 921, 793, 699, 434, 227, 157, 136, 139, 117, 83, 60, 43, 44, 44, 36, 31, 38, 38, 32, 19, 30, 40, 59, 113, 145, 154, 174, 196, 230, 224, 268, 314, 346, 357, 371, 439, 494, 511, 479, 528, 497, 488, 476, 507, 431, 405, 399, 412, 376, 412, 339, 332, 329, 336, 347, 386, 411, 461, 491, 555, 587, 537, 474, 519, 502, 606, 614, 621, 616, 671, 683, 712, 714, 799, 765, 800, 840, 796, 725, 715, 717, 721, 769, 818, 835, 835, 793, 772, 702, 714, 783, 763, 782, 818, 931, 1014, 1060, 1045, 1157, 1134, 1234, 1283, 1318, 1259, 1279, 1286, 1240, 1250, 1227, 1142, 1080, 1133, 1238, 1268, 1219, 1298, 1265, 1254, 1349, 1353, 1327, 1279, 1350, 1289, 1266, 1330, 1251, 1243, 1215, 1190, 1204, 1224, 1297, 1223, 1301, 1318, 1293, 1200, 1157, 1195, 1168, 1129, 1118, 1154, 1214, 1146, 1143, 1223, 1165, 1188, 1144, 1166, 1194, 1165, 1273, 1339, 1384, 1466, 1454, 1505, 1549, 1689, 1656, 1634, 1576, 1579, 1639, 1564, 1711, 1710, 1711, 1726, 1825, 1813, 1987, 2155, 2152, 2299, 2320, 2397, 2524, 2429, 2492, 2501, 2510, 2528, 2541, 2638, 2584, 2720, 2825, 2755, 2770, 2904, 2894, 2937, 2947, 2841, 2811, 2761, 2742, 2711, 2685, 2512, 2566, 2350, 2210, 2075, 2059, 2111, 1983, 1921, 1855, 1786, 1847, 1732, 1619, 1431, 1280, 1175, 1104, 1099, 1063, 993, 1045, 1045, 1018, 1076, 1131, 1225, 1432, 1893, 2355, 2828, 8022, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 9, 13, 25, 55, 124, 186, 313, 446, 675, 922, 1159, 1313, 1554, 1641, 1706, 1705, 1575, 1308, 957, 668, 511, 409, 349, 252, 169, 87, 61, 72, 140, 335, 620, 1130, 2482, 4143, 4627, 4393, 3905, 3562, 3446, 3138, 2893, 2787, 2802, 2905, 2903, 2781, 2450, 2393, 2367, 2582, 2836, 3109, 3361, 3453, 3396, 3590, 3536, 3485, 3203, 3136, 2986, 2839, 2712, 2766, 2904, 3195, 3522, 3800, 4177, 4393, 5060, 5845, 6570, 6850, 6732, 6281, 5725, 5329, 4974, 4573, 4375, 4431, 4114, 3753, 3219, 2927, 2729, 2652, 2494, 2391, 2349, 2385, 2366, 2341, 2271, 2206, 2136, 2095, 1929, 1768, 1799, 1642, 1566, 1439, 1407, 1354, 1346, 1366, 1360, 1378, 1421, 1454, 1499, 1472, 1274, 1080, 966, 884, 813, 692, 674, 619, 565, 566, 525, 495, 480, 459, 445, 410, 380, 369, 372, 386, 370, 324, 303, 324, 282, 267, 269, 251, 265, 236, 252, 189, 229, 193, 198, 188, 192, 191, 160, 161, 153, 119, 130, 92, 99, 84, 89, 74, 58, 66, 59, 55, 44, 57, 49, 41, 37, 33, 38, 40, 26, 39, 22, 36, 26, 24, 18, 37, 23, 26, 26, 26, 22, 16, 17, 6, 1, 3, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96947, 10107, 7995, 6447, 5203, 4299, 3769, 3461, 3021, 2718, 2525, 2332, 2241, 2147, 2133, 2241, 2563, 3305, 4663, 5776, 6176, 5258, 4091, 3480, 3321, 3384, 3402, 3650, 4174, 5329, 7975, 10587, 12981, 12717, 10121, 7260, 5661, 4429, 3081, 1970, 1162, 664, 342, 211, 131, 106, 101, 71, 73, 56, 40, 24, 8, 3, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], + ["stare-images/im0001.ppm", [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 107, 538, 1147, 1752, 2109, 2255, 2013, 1420, 869, 537, 335, 195, 114, 51, 42, 53, 40, 21, 28, 22, 27, 19, 24, 16, 19, 21, 16, 19, 18, 22, 19, 18, 16, 20, 14, 24, 21, 14, 11, 16, 21, 13, 14, 16, 24, 15, 11, 16, 17, 15, 13, 15, 13, 11, 19, 16, 23, 15, 19, 29, 28, 24, 35, 36, 73, 119, 166, 190, 199, 284, 273, 280, 280, 340, 332, 418, 453, 466, 544, 598, 587, 533, 580, 478, 470, 466, 518, 530, 494, 501, 535, 516, 549, 665, 833, 868, 906, 953, 1040, 1003, 1015, 1131, 1204, 1277, 1188, 1264, 1377, 1589, 1693, 1650, 1691, 1893, 1888, 1894, 1895, 2099, 2144, 2155, 2147, 2126, 2147, 2087, 2055, 2111, 2047, 1993, 2045, 2145, 2136, 2071, 2162, 2233, 2346, 2349, 2457, 2330, 2437, 2423, 2373, 2226, 2346, 2240, 2168, 2257, 2436, 2652, 2632, 2480, 2596, 2530, 2596, 2493, 2424, 2321, 2318, 2389, 2277, 2328, 2457, 2554, 2422, 2398, 2431, 2374, 2454, 2322, 2222, 2298, 2269, 2254, 2030, 2032, 2015, 2108, 2255, 2390, 2444, 2611, 2798, 2860, 2799, 2765, 2756, 2866, 2952, 2811, 2941, 2903, 3092, 3213, 3109, 3218, 3153, 3122, 2990, 2763, 2628, 2476, 2243, 2056, 2067, 2010, 2030, 1979, 1916, 1858, 1668, 1583, 1347, 1223, 1138, 947, 882, 753, 645, 576, 577, 508, 438, 454, 374, 320, 348, 321, 261, 251, 247, 225, 261, 239, 221, 210, 165, 163, 145, 135, 133, 168, 130, 182, 139, 258, 4078, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 6, 21, 21, 61, 153, 304, 513, 690, 901, 1068, 1214, 1341, 1427, 1337, 1218, 917, 787, 635, 559, 320, 180, 82, 51, 34, 33, 38, 38, 30, 37, 31, 42, 75, 89, 141, 163, 241, 300, 309, 327, 340, 459, 577, 527, 616, 604, 632, 711, 733, 812, 923, 1302, 1681, 1882, 1979, 2038, 2171, 2351, 2792, 3287, 3664, 3846, 3910, 4181, 4362, 4766, 5346, 6118, 7075, 7707, 7575, 7315, 6852, 6473, 6244, 6394, 6245, 5951, 6290, 6274, 6171, 6086, 6175, 6248, 5784, 5522, 5402, 5284, 5089, 4885, 4785, 4793, 4381, 4264, 4039, 3798, 3751, 3725, 3613, 3428, 3351, 3185, 2852, 2653, 2357, 2114, 1747, 1526, 1350, 1277, 1160, 919, 884, 754, 625, 592, 506, 460, 407, 342, 342, 309, 273, 268, 248, 225, 225, 211, 178, 177, 167, 183, 150, 162, 144, 157, 152, 129, 153, 155, 161, 134, 108, 115, 134, 135, 122, 128, 112, 107, 87, 95, 89, 84, 82, 73, 87, 87, 65, 74, 87, 79, 73, 66, 75, 58, 55, 60, 78, 65, 70, 59, 75, 60, 56, 68, 67, 61, 71, 76, 59, 76, 70, 62, 52, 69, 59, 74, 67, 60, 75, 63, 65, 61, 55, 63, 66, 64, 65, 68, 58, 56, 51, 75, 56, 56, 63, 64, 62, 57, 63, 56, 62, 45, 56, 40, 41, 47, 34, 34, 42, 38, 38, 30, 41, 62, 149, 454, 171, 69, 0, 0, 0, 0, 0, 0, 157033, 3138, 2591, 2066, 1875, 1740, 1725, 1717, 1794, 1954, 2107, 2507, 2868, 3124, 3376, 3233, 3312, 3741, 4981, 6868, 8607, 8492, 8341, 7806, 7875, 7640, 5902, 5035, 4908, 5431, 6122, 5135, 2283, 539, 62, 2, 0, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], + ["stare-images/im0005.ppm", [0, 0, 0, 0, 0, 0, 0, 1, 4, 45, 184, 529, 1172, 1802, 1797, 1648, 1497, 1159, 963, 743, 503, 337, 280, 264, 292, 268, 176, 129, 120, 132, 133, 111, 60, 49, 46, 23, 29, 22, 22, 28, 20, 24, 27, 24, 10, 11, 17, 15, 16, 11, 16, 16, 12, 16, 15, 22, 12, 12, 15, 11, 11, 17, 11, 17, 14, 23, 17, 21, 11, 11, 12, 12, 10, 16, 6, 14, 20, 12, 9, 13, 10, 6, 13, 19, 17, 11, 15, 12, 13, 12, 18, 16, 20, 23, 21, 20, 10, 13, 12, 13, 19, 25, 18, 24, 20, 31, 32, 56, 50, 63, 74, 59, 74, 78, 78, 96, 102, 83, 94, 110, 105, 133, 136, 130, 146, 149, 140, 172, 160, 217, 199, 213, 234, 282, 267, 361, 354, 461, 470, 536, 589, 558, 519, 508, 523, 549, 577, 635, 596, 606, 646, 747, 740, 743, 828, 843, 800, 896, 949, 901, 946, 1042, 1041, 1104, 1147, 1255, 1318, 1383, 1464, 1527, 1585, 1843, 2032, 2173, 2270, 2610, 2654, 2873, 2853, 2868, 3121, 3256, 3237, 3504, 3647, 4091, 4201, 4244, 4428, 4380, 4493, 4529, 4519, 4377, 4181, 4160, 3930, 4113, 4099, 4073, 4281, 4180, 4091, 3933, 3740, 3625, 3610, 3456, 3539, 3403, 3376, 3221, 3072, 3102, 2990, 3070, 2973, 2806, 2836, 2750, 2498, 2378, 2378, 2410, 2389, 2327, 2464, 2290, 2261, 2212, 2191, 2205, 2176, 2155, 2186, 2186, 2352, 2351, 2426, 2449, 2406, 2557, 2643, 2694, 2646, 2696, 2645, 2676, 2229, 1730, 1390, 1099, 977, 899, 463, 12, 0, 0, 0, 0, 0, 0, 0, 2, 6, 10, 33, 65, 141, 218, 328, 471, 582, 706, 800, 894, 880, 1007, 994, 1004, 958, 939, 791, 719, 647, 505, 416, 299, 202, 161, 148, 134, 133, 111, 133, 71, 57, 41, 37, 52, 69, 91, 118, 156, 113, 140, 147, 166, 143, 202, 210, 263, 282, 337, 361, 344, 403, 370, 407, 418, 409, 419, 368, 360, 379, 432, 407, 429, 425, 437, 499, 524, 564, 568, 648, 632, 661, 740, 691, 770, 728, 752, 778, 815, 889, 979, 1064, 1227, 1263, 1340, 1548, 1699, 1852, 2267, 2723, 3381, 3532, 4093, 4742, 5496, 6474, 7334, 7702, 8420, 7992, 7925, 7926, 7945, 7366, 7413, 7508, 7216, 7229, 6742, 5965, 5665, 5110, 4537, 4131, 3739, 3666, 3336, 3047, 2896, 2873, 2907, 2553, 2251, 2253, 2189, 2006, 1948, 1800, 1828, 1692, 1782, 1889, 1855, 1894, 1879, 1941, 1947, 1897, 1837, 1942, 1800, 1836, 1817, 1795, 1729, 1593, 1432, 1482, 1442, 1486, 1527, 1490, 1545, 1473, 1313, 1262, 1104, 1021, 877, 890, 802, 764, 710, 586, 485, 386, 345, 286, 238, 156, 173, 124, 110, 88, 59, 64, 48, 47, 38, 37, 19, 16, 15, 8, 4, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 12, 30, 85, 220, 491, 1059, 1635, 1745, 1792, 1633, 1357, 1010, 723, 555, 416, 333, 246, 195, 164, 118, 133, 187, 302, 372, 399, 495, 415, 306, 286, 297, 332, 406, 434, 426, 443, 504, 553, 596, 654, 615, 625, 663, 678, 653, 686, 835, 845, 978, 1058, 1200, 1454, 1840, 2134, 2474, 2910, 3237, 3899, 4305, 4537, 4962, 5531, 6601, 7431, 8293, 9009, 9850, 10199, 10265, 10241, 9869, 9871, 9532, 8818, 8113, 7496, 7314, 6595, 6087, 5548, 4978, 4597, 4249, 4000, 3507, 3318, 2943, 2830, 2627, 2506, 2431, 2228, 2126, 2091, 2097, 1932, 1869, 1717, 1727, 1701, 1520, 1391, 1264, 1160, 1015, 979, 836, 769, 760, 637, 619, 592, 515, 514, 455, 361, 292, 272, 279, 251, 223, 200, 213, 219, 223, 178, 227, 266, 256, 261, 285, 294, 251, 237, 228, 240, 221, 205, 227, 199, 248, 201, 202, 188, 184, 185, 197, 198, 131, 113, 111, 99, 78, 70, 86, 62, 82, 44, 36, 41, 42, 28, 18, 11, 15, 8, 10, 12, 2, 4, 4, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], + ["stare-images/im0004.ppm", [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 43, 251, 532, 954, 1398, 1796, 2169, 2198, 1750, 1292, 971, 783, 839, 801, 826, 795, 803, 634, 563, 481, 330, 192, 95, 51, 50, 67, 61, 51, 62, 70, 73, 90, 83, 98, 91, 50, 68, 71, 101, 82, 79, 94, 98, 110, 130, 124, 139, 144, 165, 166, 200, 247, 286, 310, 297, 329, 365, 452, 527, 488, 461, 459, 410, 428, 486, 494, 512, 516, 522, 527, 627, 588, 643, 666, 700, 676, 685, 703, 848, 737, 700, 694, 722, 748, 671, 653, 604, 596, 502, 558, 603, 619, 644, 632, 709, 780, 731, 779, 836, 886, 791, 767, 829, 857, 789, 802, 880, 946, 901, 784, 806, 854, 840, 878, 904, 945, 956, 888, 883, 760, 785, 759, 753, 795, 793, 763, 796, 817, 768, 804, 867, 931, 1041, 1085, 1026, 1108, 1242, 1187, 1159, 1032, 1001, 1016, 1025, 1049, 1018, 1044, 1027, 1078, 1110, 1136, 1168, 1190, 1177, 1294, 1291, 1356, 1393, 1426, 1464, 1598, 1688, 1774, 1731, 1708, 1705, 1669, 1551, 1595, 1634, 1579, 1507, 1559, 1622, 1594, 1628, 1651, 1654, 1566, 1469, 1557, 1590, 1743, 1774, 1827, 2026, 2015, 2142, 2203, 2205, 2260, 2278, 2336, 2510, 2599, 2454, 2589, 2683, 2837, 2840, 2804, 3043, 3133, 3344, 3223, 3146, 3321, 3197, 3165, 3000, 2901, 3046, 3235, 3336, 3576, 3641, 3469, 3497, 3517, 3637, 3589, 3568, 3318, 2990, 2565, 2105, 1668, 1463, 1265, 1168, 1123, 1071, 1067, 1039, 1022, 948, 917, 949, 987, 999, 960, 904, 991, 7417, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 5, 14, 40, 68, 92, 179, 272, 324, 448, 634, 830, 942, 1049, 1142, 1292, 1397, 1485, 1578, 1798, 1952, 1900, 1505, 871, 486, 319, 172, 179, 248, 367, 579, 588, 613, 586, 626, 751, 808, 1000, 1029, 1068, 1132, 1215, 1448, 1629, 1757, 1961, 1962, 2023, 2089, 2135, 1769, 1295, 1177, 1249, 1245, 1325, 1249, 1266, 1477, 1686, 1803, 1817, 1872, 1934, 1878, 1688, 1764, 1809, 1877, 1946, 2087, 2143, 2167, 2190, 2269, 2255, 2188, 2337, 2563, 2663, 2841, 3352, 3606, 4161, 4711, 4752, 4547, 4752, 4734, 4861, 5031, 5856, 6987, 7440, 8134, 8723, 9016, 8280, 7742, 7868, 8029, 8448, 8355, 7623, 7231, 6172, 4728, 3477, 2573, 2029, 1807, 1516, 1388, 1164, 1062, 911, 869, 875, 839, 817, 817, 731, 779, 702, 661, 637, 518, 467, 440, 449, 366, 264, 138, 61, 18, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 104119, 6731, 5538, 4203, 3541, 3082, 2857, 2662, 2587, 2488, 2485, 2474, 2612, 3151, 3881, 5098, 6409, 7034, 6878, 6037, 5191, 4353, 3959, 3728, 3660, 3746, 3453, 3770, 4159, 4667, 5301, 5522, 6123, 8162, 10773, 10622, 8058, 4486, 2241, 1514, 1377, 1368, 1373, 1261, 1099, 796, 587, 346, 198, 100, 49, 16, 9, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], + ["stare-images/im0004.ppm", [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 43, 251, 532, 954, 1398, 1796, 2169, 2198, 1750, 1292, 971, 783, 839, 801, 826, 795, 803, 634, 563, 481, 330, 192, 95, 51, 50, 67, 61, 51, 62, 70, 73, 90, 83, 98, 91, 50, 68, 71, 101, 82, 79, 94, 98, 110, 130, 124, 139, 144, 165, 166, 200, 247, 286, 310, 297, 329, 365, 452, 527, 488, 461, 459, 410, 428, 486, 494, 512, 516, 522, 527, 627, 588, 643, 666, 700, 676, 685, 703, 848, 737, 700, 694, 722, 748, 671, 653, 604, 596, 502, 558, 603, 619, 644, 632, 709, 780, 731, 779, 836, 886, 791, 767, 829, 857, 789, 802, 880, 946, 901, 784, 806, 854, 840, 878, 904, 945, 956, 888, 883, 760, 785, 759, 753, 795, 793, 763, 796, 817, 768, 804, 867, 931, 1041, 1085, 1026, 1108, 1242, 1187, 1159, 1032, 1001, 1016, 1025, 1049, 1018, 1044, 1027, 1078, 1110, 1136, 1168, 1190, 1177, 1294, 1291, 1356, 1393, 1426, 1464, 1598, 1688, 1774, 1731, 1708, 1705, 1669, 1551, 1595, 1634, 1579, 1507, 1559, 1622, 1594, 1628, 1651, 1654, 1566, 1469, 1557, 1590, 1743, 1774, 1827, 2026, 2015, 2142, 2203, 2205, 2260, 2278, 2336, 2510, 2599, 2454, 2589, 2683, 2837, 2840, 2804, 3043, 3133, 3344, 3223, 3146, 3321, 3197, 3165, 3000, 2901, 3046, 3235, 3336, 3576, 3641, 3469, 3497, 3517, 3637, 3589, 3568, 3318, 2990, 2565, 2105, 1668, 1463, 1265, 1168, 1123, 1071, 1067, 1039, 1022, 948, 917, 949, 987, 999, 960, 904, 991, 7417, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 5, 14, 40, 68, 92, 179, 272, 324, 448, 634, 830, 942, 1049, 1142, 1292, 1397, 1485, 1578, 1798, 1952, 1900, 1505, 871, 486, 319, 172, 179, 248, 367, 579, 588, 613, 586, 626, 751, 808, 1000, 1029, 1068, 1132, 1215, 1448, 1629, 1757, 1961, 1962, 2023, 2089, 2135, 1769, 1295, 1177, 1249, 1245, 1325, 1249, 1266, 1477, 1686, 1803, 1817, 1872, 1934, 1878, 1688, 1764, 1809, 1877, 1946, 2087, 2143, 2167, 2190, 2269, 2255, 2188, 2337, 2563, 2663, 2841, 3352, 3606, 4161, 4711, 4752, 4547, 4752, 4734, 4861, 5031, 5856, 6987, 7440, 8134, 8723, 9016, 8280, 7742, 7868, 8029, 8448, 8355, 7623, 7231, 6172, 4728, 3477, 2573, 2029, 1807, 1516, 1388, 1164, 1062, 911, 869, 875, 839, 817, 817, 731, 779, 702, 661, 637, 518, 467, 440, 449, 366, 264, 138, 61, 18, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 104119, 6731, 5538, 4203, 3541, 3082, 2857, 2662, 2587, 2488, 2485, 2474, 2612, 3151, 3881, 5098, 6409, 7034, 6878, 6037, 5191, 4353, 3959, 3728, 3660, 3746, 3453, 3770, 4159, 4667, 5301, 5522, 6123, 8162, 10773, 10622, 8058, 4486, 2241, 1514, 1377, 1368, 1373, 1261, 1099, 796, 587, 346, 198, 100, 49, 16, 9, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]] + ], + "test": [ + ["stare-images/im0235.ppm", [0, 0, 0, 0, 0, 0, 1, 3, 66, 256, 733, 1441, 2032, 2054, 1561, 1171, 768, 619, 528, 431, 406, 391, 417, 402, 442, 463, 437, 479, 448, 440, 319, 191, 114, 69, 61, 39, 25, 18, 24, 27, 26, 37, 28, 19, 16, 21, 12, 21, 20, 32, 22, 38, 30, 36, 27, 20, 23, 18, 10, 11, 11, 10, 10, 10, 12, 9, 6, 4, 7, 6, 7, 13, 11, 9, 13, 9, 11, 8, 7, 11, 6, 12, 8, 8, 9, 5, 12, 10, 11, 9, 13, 7, 16, 14, 12, 15, 10, 13, 8, 8, 9, 13, 10, 14, 7, 13, 9, 12, 14, 15, 17, 14, 18, 12, 21, 14, 19, 11, 16, 21, 24, 21, 24, 18, 29, 36, 37, 46, 38, 37, 33, 42, 46, 60, 68, 64, 113, 110, 144, 138, 173, 164, 183, 193, 223, 258, 280, 300, 332, 371, 406, 498, 554, 585, 747, 728, 796, 842, 895, 1027, 989, 1098, 1167, 1164, 1163, 1132, 1230, 1277, 1242, 1280, 1342, 1370, 1372, 1467, 1466, 1452, 1471, 1528, 1445, 1464, 1586, 1569, 1591, 1649, 1699, 1804, 1768, 1884, 1903, 2009, 1911, 1918, 1968, 2025, 2022, 2096, 2060, 2056, 2048, 2049, 2069, 2150, 2145, 2323, 2296, 2332, 2284, 2472, 2474, 2532, 2760, 2859, 2934, 2954, 3133, 3152, 3261, 3289, 3520, 3516, 3502, 3520, 3640, 3789, 3736, 3924, 3930, 3811, 3749, 3801, 3571, 3427, 3478, 3396, 3314, 3377, 3429, 3596, 3940, 4309, 4415, 4765, 5310, 5584, 5941, 6232, 6750, 7006, 6953, 6119, 4738, 2746, 1588, 1425, 1474, 4767, 0, 1, 3, 17, 20, 51, 111, 170, 282, 414, 608, 870, 1037, 1202, 1286, 1253, 1229, 1179, 1132, 1013, 906, 853, 753, 713, 607, 452, 334, 245, 156, 93, 70, 68, 60, 62, 52, 61, 51, 39, 49, 39, 49, 56, 49, 86, 103, 169, 249, 278, 288, 314, 282, 301, 274, 315, 308, 333, 461, 493, 546, 676, 804, 970, 1236, 1419, 1779, 1972, 2130, 2118, 2375, 2726, 3139, 3359, 3652, 4036, 4176, 4276, 4468, 4234, 4040, 3789, 3479, 3290, 3265, 3134, 3222, 3118, 3020, 2905, 2836, 2774, 2706, 2705, 2557, 2440, 2432, 2512, 2382, 2524, 2540, 2562, 2689, 2592, 2571, 2510, 2570, 2565, 2672, 2617, 2633, 2511, 2508, 2543, 2593, 2542, 2377, 2392, 2469, 2369, 2440, 2526, 2481, 2388, 2483, 2472, 2400, 2300, 2033, 2107, 1864, 1885, 1838, 1857, 1911, 1960, 1914, 2151, 2260, 2339, 2419, 2523, 2497, 2481, 2498, 2406, 2479, 2501, 2460, 2508, 2553, 2654, 2627, 2545, 2600, 2630, 2502, 2531, 2193, 2107, 1998, 1667, 1524, 1381, 1228, 1065, 944, 785, 603, 466, 343, 283, 226, 170, 154, 106, 95, 91, 97, 85, 87, 90, 72, 68, 100, 82, 62, 79, 68, 56, 42, 60, 67, 68, 41, 47, 61, 48, 49, 65, 56, 69, 61, 52, 67, 66, 73, 66, 67, 84, 94, 119, 113, 125, 95, 112, 102, 98, 102, 86, 105, 81, 89, 91, 84, 104, 112, 124, 105, 136, 133, 155, 187, 118, 135, 109, 113, 93, 101, 101, 94, 80, 96, 95, 95, 108, 90, 106, 123, 119, 99, 103, 129, 135, 135, 139, 142, 124, 1433, 269, 241, 262, 247, 273, 318, 350, 457, 649, 933, 1486, 2181, 2713, 3292, 3298, 3156, 2955, 2728, 2604, 2663, 2793, 3168, 3550, 4044, 4772, 5472, 6020, 7048, 7567, 8487, 9266, 9883, 9952, 9801, 9279, 8861, 8186, 7251, 6672, 6168, 5985, 5611, 5586, 5608, 5445, 5458, 5603, 5439, 5574, 5311, 5308, 5120, 4890, 4760, 4593, 4372, 4117, 3857, 3513, 3185, 2856, 2561, 2218, 1969, 1769, 1451, 1307, 1068, 969, 823, 734, 548, 443, 379, 283, 216, 200, 182, 131, 127, 109, 104, 101, 97, 101, 104, 105, 93, 94, 81, 103, 92, 96, 107, 81, 83, 70, 79, 80, 100, 80, 104, 92, 78, 86, 67, 85, 80, 86, 61, 72, 60, 56, 62, 46, 48, 52, 45, 42, 35, 36, 33, 31, 28, 38, 38, 39, 47, 30, 31, 25, 42, 33, 36, 41, 40, 35, 42, 47, 41, 29, 25, 45, 32, 46, 42, 33, 43, 42, 43, 44, 35, 35, 35, 39, 39, 39, 35, 34, 26, 36, 43, 28, 28, 30, 37, 26, 35, 42, 24, 36, 25, 38, 28, 33, 38, 35, 25, 38, 35, 28, 23, 33, 33, 25, 25, 24, 11, 16, 5, 14, 6, 8, 5, 5, 3, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], + ["stare-images/im0163.ppm", [0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 106, 373, 867, 1487, 1649, 1450, 1218, 913, 662, 498, 345, 299, 250, 273, 260, 313, 229, 218, 227, 242, 311, 250, 231, 227, 195, 226, 244, 361, 467, 384, 185, 103, 80, 78, 48, 62, 54, 38, 19, 19, 19, 18, 19, 22, 13, 17, 29, 31, 17, 17, 22, 13, 8, 9, 18, 19, 19, 12, 20, 16, 14, 10, 20, 12, 13, 15, 12, 8, 12, 11, 12, 7, 9, 11, 14, 14, 10, 17, 10, 8, 10, 6, 13, 12, 18, 13, 10, 13, 9, 4, 4, 4, 5, 4, 6, 9, 6, 6, 6, 5, 8, 4, 10, 8, 8, 10, 3, 6, 9, 8, 8, 12, 7, 9, 6, 10, 9, 12, 5, 8, 11, 8, 7, 9, 7, 10, 7, 7, 8, 5, 11, 5, 8, 8, 13, 4, 4, 15, 7, 9, 7, 7, 8, 10, 5, 11, 7, 12, 10, 7, 5, 3, 9, 12, 8, 7, 7, 6, 4, 10, 7, 7, 3, 13, 9, 12, 7, 9, 6, 6, 7, 10, 11, 11, 8, 13, 16, 12, 16, 16, 16, 10, 5, 12, 12, 2, 12, 9, 15, 27, 20, 27, 41, 68, 59, 77, 96, 119, 114, 183, 276, 369, 502, 676, 905, 1132, 1413, 1762, 2176, 2508, 2804, 3123, 3600, 4188, 4878, 5656, 6604, 7283, 8079, 8734, 9749, 10417, 10845, 11077, 11066, 11274, 10877, 10423, 9713, 8728, 7921, 7362, 6832, 6200, 5834, 5650, 5596, 5413, 5319, 5530, 5846, 5868, 5488, 4877, 5541, 17979, 0, 0, 0, 2, 10, 19, 27, 90, 143, 214, 377, 523, 749, 917, 1069, 1093, 1107, 1055, 946, 835, 791, 669, 601, 496, 433, 413, 355, 360, 456, 463, 475, 393, 284, 188, 130, 74, 85, 61, 41, 33, 53, 45, 52, 52, 34, 29, 32, 32, 37, 63, 59, 90, 90, 84, 87, 99, 92, 112, 117, 123, 157, 179, 206, 253, 243, 294, 291, 390, 388, 418, 418, 455, 487, 539, 553, 546, 622, 721, 854, 984, 1288, 1586, 1766, 1904, 1897, 1887, 1951, 1961, 2017, 2065, 2192, 2240, 2468, 2862, 3159, 3601, 3941, 4148, 4202, 4758, 4847, 5015, 5233, 5294, 5456, 5493, 5785, 5753, 5909, 5752, 5574, 5566, 5243, 5149, 5307, 5255, 5388, 4970, 4958, 4528, 4342, 3908, 3557, 3301, 2965, 2865, 2687, 2583, 2397, 2343, 2281, 2276, 2227, 2071, 2108, 2009, 2023, 2047, 2081, 1856, 1873, 1784, 1813, 1787, 1773, 1759, 1664, 1673, 1627, 1517, 1478, 1562, 1480, 1509, 1358, 1399, 1289, 1243, 1167, 1143, 1068, 1053, 1038, 948, 989, 988, 893, 924, 894, 905, 924, 831, 807, 779, 692, 618, 582, 622, 587, 495, 450, 368, 371, 321, 333, 304, 283, 295, 287, 243, 220, 229, 199, 171, 206, 192, 218, 180, 168, 185, 179, 156, 153, 161, 149, 137, 134, 112, 120, 108, 108, 87, 89, 88, 81, 90, 106, 88, 111, 110, 107, 86, 132, 130, 128, 164, 173, 184, 166, 196, 206, 244, 247, 252, 238, 232, 228, 210, 212, 177, 146, 115, 93, 58, 18, 11, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127068, 13707, 11484, 9659, 8208, 7042, 6325, 6109, 5301, 5075, 5033, 4929, 5189, 5710, 6013, 5746, 5628, 5148, 4503, 4311, 3953, 3694, 3419, 2981, 2804, 2359, 2132, 1990, 1831, 1671, 1453, 1300, 1166, 1024, 933, 850, 804, 672, 607, 562, 510, 447, 392, 358, 328, 299, 241, 244, 186, 172, 135, 155, 154, 113, 103, 89, 108, 102, 97, 78, 101, 88, 92, 120, 91, 81, 97, 93, 91, 89, 79, 103, 74, 77, 108, 98, 91, 102, 124, 107, 120, 96, 109, 109, 82, 101, 108, 78, 67, 75, 62, 74, 42, 38, 29, 23, 26, 22, 18, 14, 6, 7, 2, 6, 7, 0, 1, 2, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], + ["stare-images/im0319.ppm", [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 69, 261, 762, 1309, 1724, 1752, 1680, 1303, 885, 615, 436, 350, 378, 416, 422, 387, 348, 384, 368, 344, 311, 282, 377, 365, 297, 222, 131, 82, 58, 58, 36, 35, 28, 26, 21, 18, 21, 14, 23, 15, 14, 15, 11, 12, 14, 14, 18, 16, 21, 14, 11, 27, 15, 14, 14, 13, 10, 8, 9, 11, 12, 9, 15, 8, 16, 6, 6, 8, 9, 8, 9, 8, 7, 11, 5, 9, 8, 3, 6, 15, 10, 8, 10, 14, 7, 12, 10, 7, 14, 11, 10, 8, 3, 3, 11, 10, 5, 6, 8, 5, 9, 3, 7, 9, 6, 7, 6, 5, 10, 6, 9, 8, 6, 6, 6, 8, 5, 7, 7, 5, 8, 7, 3, 5, 5, 9, 9, 14, 8, 11, 12, 5, 14, 17, 18, 10, 9, 10, 5, 21, 12, 14, 19, 14, 22, 27, 55, 65, 98, 120, 141, 180, 206, 220, 255, 300, 380, 505, 513, 582, 596, 652, 677, 661, 761, 752, 704, 710, 720, 733, 734, 888, 857, 929, 958, 988, 1016, 1053, 1000, 1119, 1061, 1133, 1190, 1311, 1443, 1603, 1633, 1841, 1890, 2032, 1960, 2030, 2187, 2155, 2182, 2281, 2425, 2462, 2468, 2531, 2369, 2386, 2374, 2362, 2298, 2267, 2247, 2257, 2293, 2282, 2238, 2432, 2518, 2594, 2883, 2865, 3089, 3252, 3181, 3172, 3378, 3363, 3430, 3488, 3402, 3361, 3596, 3593, 3630, 3596, 3499, 3666, 3661, 3647, 3801, 3898, 4191, 4274, 4686, 5210, 5948, 6657, 7210, 9889, 63857, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6, 6, 21, 32, 70, 126, 199, 284, 422, 570, 736, 969, 1059, 1237, 1309, 1210, 1098, 859, 716, 677, 627, 693, 711, 668, 686, 524, 390, 282, 173, 84, 64, 53, 51, 51, 28, 29, 22, 22, 24, 27, 22, 19, 29, 14, 19, 21, 10, 13, 28, 15, 26, 12, 21, 13, 18, 12, 7, 14, 19, 11, 17, 15, 9, 20, 16, 15, 14, 12, 13, 11, 19, 11, 18, 17, 12, 10, 19, 24, 39, 53, 63, 71, 73, 101, 128, 178, 184, 207, 203, 265, 297, 384, 651, 1181, 1751, 2252, 2403, 2493, 2334, 2368, 2389, 2637, 2551, 2662, 2775, 2935, 3074, 3254, 3519, 3835, 3923, 3887, 3975, 4446, 4994, 4942, 4681, 4523, 4683, 4666, 4578, 4587, 5054, 5356, 5504, 5900, 6154, 5824, 5788, 5798, 5527, 5548, 5203, 5172, 5198, 4946, 5122, 5160, 5334, 5746, 5999, 5739, 5241, 5067, 4772, 4591, 4509, 4524, 4539, 4546, 4322, 4152, 3958, 3835, 3577, 3042, 2347, 1699, 1066, 662, 387, 195, 114, 44, 31, 13, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 213242, 6685, 5440, 4381, 3406, 2963, 2530, 2473, 2190, 2252, 2448, 3042, 3442, 3859, 3617, 3417, 3057, 2748, 2441, 1967, 1718, 1486, 1297, 1246, 1255, 1243, 1212, 1250, 1254, 1290, 1264, 1205, 1176, 947, 767, 635, 464, 278, 186, 83, 56, 19, 4, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], + ["stare-images/im0163.ppm", [0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 106, 373, 867, 1487, 1649, 1450, 1218, 913, 662, 498, 345, 299, 250, 273, 260, 313, 229, 218, 227, 242, 311, 250, 231, 227, 195, 226, 244, 361, 467, 384, 185, 103, 80, 78, 48, 62, 54, 38, 19, 19, 19, 18, 19, 22, 13, 17, 29, 31, 17, 17, 22, 13, 8, 9, 18, 19, 19, 12, 20, 16, 14, 10, 20, 12, 13, 15, 12, 8, 12, 11, 12, 7, 9, 11, 14, 14, 10, 17, 10, 8, 10, 6, 13, 12, 18, 13, 10, 13, 9, 4, 4, 4, 5, 4, 6, 9, 6, 6, 6, 5, 8, 4, 10, 8, 8, 10, 3, 6, 9, 8, 8, 12, 7, 9, 6, 10, 9, 12, 5, 8, 11, 8, 7, 9, 7, 10, 7, 7, 8, 5, 11, 5, 8, 8, 13, 4, 4, 15, 7, 9, 7, 7, 8, 10, 5, 11, 7, 12, 10, 7, 5, 3, 9, 12, 8, 7, 7, 6, 4, 10, 7, 7, 3, 13, 9, 12, 7, 9, 6, 6, 7, 10, 11, 11, 8, 13, 16, 12, 16, 16, 16, 10, 5, 12, 12, 2, 12, 9, 15, 27, 20, 27, 41, 68, 59, 77, 96, 119, 114, 183, 276, 369, 502, 676, 905, 1132, 1413, 1762, 2176, 2508, 2804, 3123, 3600, 4188, 4878, 5656, 6604, 7283, 8079, 8734, 9749, 10417, 10845, 11077, 11066, 11274, 10877, 10423, 9713, 8728, 7921, 7362, 6832, 6200, 5834, 5650, 5596, 5413, 5319, 5530, 5846, 5868, 5488, 4877, 5541, 17979, 0, 0, 0, 2, 10, 19, 27, 90, 143, 214, 377, 523, 749, 917, 1069, 1093, 1107, 1055, 946, 835, 791, 669, 601, 496, 433, 413, 355, 360, 456, 463, 475, 393, 284, 188, 130, 74, 85, 61, 41, 33, 53, 45, 52, 52, 34, 29, 32, 32, 37, 63, 59, 90, 90, 84, 87, 99, 92, 112, 117, 123, 157, 179, 206, 253, 243, 294, 291, 390, 388, 418, 418, 455, 487, 539, 553, 546, 622, 721, 854, 984, 1288, 1586, 1766, 1904, 1897, 1887, 1951, 1961, 2017, 2065, 2192, 2240, 2468, 2862, 3159, 3601, 3941, 4148, 4202, 4758, 4847, 5015, 5233, 5294, 5456, 5493, 5785, 5753, 5909, 5752, 5574, 5566, 5243, 5149, 5307, 5255, 5388, 4970, 4958, 4528, 4342, 3908, 3557, 3301, 2965, 2865, 2687, 2583, 2397, 2343, 2281, 2276, 2227, 2071, 2108, 2009, 2023, 2047, 2081, 1856, 1873, 1784, 1813, 1787, 1773, 1759, 1664, 1673, 1627, 1517, 1478, 1562, 1480, 1509, 1358, 1399, 1289, 1243, 1167, 1143, 1068, 1053, 1038, 948, 989, 988, 893, 924, 894, 905, 924, 831, 807, 779, 692, 618, 582, 622, 587, 495, 450, 368, 371, 321, 333, 304, 283, 295, 287, 243, 220, 229, 199, 171, 206, 192, 218, 180, 168, 185, 179, 156, 153, 161, 149, 137, 134, 112, 120, 108, 108, 87, 89, 88, 81, 90, 106, 88, 111, 110, 107, 86, 132, 130, 128, 164, 173, 184, 166, 196, 206, 244, 247, 252, 238, 232, 228, 210, 212, 177, 146, 115, 93, 58, 18, 11, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127068, 13707, 11484, 9659, 8208, 7042, 6325, 6109, 5301, 5075, 5033, 4929, 5189, 5710, 6013, 5746, 5628, 5148, 4503, 4311, 3953, 3694, 3419, 2981, 2804, 2359, 2132, 1990, 1831, 1671, 1453, 1300, 1166, 1024, 933, 850, 804, 672, 607, 562, 510, 447, 392, 358, 328, 299, 241, 244, 186, 172, 135, 155, 154, 113, 103, 89, 108, 102, 97, 78, 101, 88, 92, 120, 91, 81, 97, 93, 91, 89, 79, 103, 74, 77, 108, 98, 91, 102, 124, 107, 120, 96, 109, 109, 82, 101, 108, 78, 67, 75, 62, 74, 42, 38, 29, 23, 26, 22, 18, 14, 6, 7, 2, 6, 7, 0, 1, 2, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], + ["stare-images/im0324.ppm", [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 22, 115, 431, 829, 1255, 1577, 1655, 1627, 1218, 725, 461, 359, 284, 329, 376, 365, 372, 433, 522, 603, 547, 544, 503, 481, 462, 468, 419, 423, 319, 221, 152, 127, 86, 98, 91, 47, 36, 20, 22, 13, 23, 14, 18, 13, 11, 14, 11, 8, 10, 21, 8, 13, 17, 15, 14, 15, 16, 17, 13, 19, 15, 20, 17, 11, 10, 7, 19, 13, 19, 21, 12, 17, 11, 13, 18, 22, 23, 17, 10, 22, 10, 8, 14, 16, 9, 9, 2, 5, 5, 11, 4, 5, 2, 7, 6, 2, 3, 6, 3, 4, 3, 2, 2, 5, 5, 1, 1, 1, 1, 4, 0, 6, 5, 5, 3, 1, 4, 5, 1, 2, 5, 3, 3, 4, 2, 10, 0, 2, 7, 3, 4, 3, 7, 6, 1, 6, 4, 4, 6, 1, 5, 10, 8, 9, 5, 12, 10, 12, 8, 4, 7, 11, 10, 8, 13, 8, 13, 10, 10, 8, 15, 13, 6, 4, 6, 8, 7, 10, 12, 17, 15, 19, 29, 34, 60, 63, 81, 117, 102, 155, 175, 187, 244, 256, 320, 316, 385, 426, 449, 496, 515, 597, 569, 630, 651, 681, 752, 725, 743, 707, 725, 744, 751, 849, 823, 919, 899, 926, 1008, 1122, 1244, 1328, 1387, 1492, 1628, 1818, 2119, 2341, 2625, 2886, 3051, 3358, 3484, 3638, 3870, 4254, 4645, 4863, 4967, 5025, 4914, 4900, 4951, 5310, 5583, 6115, 6749, 7383, 8328, 9443, 10221, 11109, 13022, 18976, 79848, 0, 0, 0, 0, 0, 0, 0, 1, 3, 3, 3, 10, 23, 57, 104, 189, 277, 366, 510, 646, 799, 956, 1106, 1147, 1191, 1074, 958, 808, 810, 788, 747, 840, 870, 813, 744, 619, 527, 498, 409, 280, 187, 134, 101, 75, 54, 43, 51, 35, 41, 49, 52, 33, 34, 32, 25, 32, 34, 34, 30, 23, 20, 12, 8, 10, 4, 4, 8, 10, 5, 10, 4, 5, 8, 4, 7, 10, 3, 4, 6, 5, 12, 4, 5, 5, 5, 6, 13, 16, 17, 24, 48, 92, 99, 136, 176, 152, 153, 151, 153, 159, 214, 237, 320, 422, 504, 580, 748, 1085, 1601, 2451, 3093, 3610, 3309, 3230, 3328, 3427, 3728, 3930, 4115, 4634, 5223, 5222, 5145, 5140, 4834, 4507, 4378, 4177, 4206, 4268, 4460, 4662, 4874, 4955, 5075, 5221, 5224, 4828, 4788, 4491, 4529, 4368, 4546, 4496, 4662, 4622, 4394, 4390, 4739, 5159, 5546, 5582, 5584, 5307, 5002, 4956, 4659, 4455, 4198, 3724, 3381, 3065, 2874, 2619, 2485, 2345, 2223, 2219, 2075, 1975, 1801, 1679, 1467, 1410, 1168, 1062, 999, 854, 773, 719, 633, 546, 492, 427, 328, 166, 69, 31, 12, 8, 5, 7, 7, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 257606, 1831, 1491, 1158, 964, 801, 718, 618, 609, 484, 502, 488, 503, 697, 1100, 1610, 2215, 2790, 3020, 2853, 2581, 2331, 2158, 1638, 1173, 803, 555, 454, 406, 386, 310, 274, 236, 171, 149, 97, 68, 37, 29, 11, 5, 2, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]] + ] +} diff --git a/src/mednet/libs/segmentation/tests/data/histograms/raw_data/histograms_stare_ah.json b/src/mednet/libs/segmentation/tests/data/histograms/raw_data/histograms_stare_ah.json new file mode 100644 index 0000000000000000000000000000000000000000..901cb9aee6d78efea366cedf676e45f0977fd33c --- /dev/null +++ b/src/mednet/libs/segmentation/tests/data/histograms/raw_data/histograms_stare_ah.json @@ -0,0 +1,16 @@ +{ + "train": [ + ["stare-images/im0002.ppm", [125, 308, 639, 1007, 1512, 1689, 2015, 2082, 2333, 2410, 3570, 7914, 15185, 14415, 9619, 7240, 6538, 6051, 5923, 5405, 4638, 3818, 2818, 1772, 940, 451, 332, 278, 300, 296, 273, 247, 260, 189, 215, 220, 257, 272, 167, 127, 70, 69, 76, 92, 142, 170, 182, 200, 227, 270, 247, 289, 343, 376, 394, 404, 466, 538, 581, 577, 666, 643, 649, 662, 743, 677, 639, 666, 692, 651, 639, 539, 469, 456, 438, 441, 471, 500, 543, 596, 683, 707, 671, 586, 646, 625, 700, 706, 737, 756, 803, 881, 886, 935, 1049, 1047, 1096, 1144, 1099, 1077, 1059, 1027, 1009, 1055, 1087, 1132, 1154, 1144, 1140, 1037, 1029, 1077, 1008, 1034, 1054, 1135, 1199, 1244, 1218, 1289, 1262, 1346, 1386, 1458, 1406, 1430, 1439, 1382, 1405, 1375, 1271, 1189, 1249, 1346, 1402, 1379, 1495, 1440, 1424, 1530, 1565, 1536, 1478, 1574, 1525, 1492, 1607, 1488, 1513, 1464, 1441, 1430, 1422, 1516, 1420, 1487, 1531, 1520, 1423, 1417, 1463, 1434, 1398, 1380, 1424, 1493, 1420, 1440, 1513, 1489, 1471, 1433, 1475, 1463, 1434, 1589, 1593, 1632, 1698, 1688, 1727, 1751, 1894, 1861, 1852, 1770, 1776, 1845, 1748, 1889, 1937, 1945, 1960, 2047, 2013, 2175, 2320, 2337, 2450, 2462, 2508, 2628, 2536, 2561, 2575, 2604, 2574, 2594, 2688, 2635, 2766, 2875, 2807, 2827, 2957, 2979, 3027, 3021, 2925, 2871, 2800, 2780, 2746, 2729, 2553, 2603, 2375, 2241, 2089, 2066, 2121, 1993, 1927, 1860, 1786, 1847, 1732, 1619, 1431, 1280, 1175, 1104, 1099, 1063, 993, 1045, 1045, 1018, 1076, 1131, 1225, 1432, 1893, 2355, 2828, 8022, 13897, 950, 670, 410, 363, 350, 351, 329, 671, 374, 212, 182, 198, 285, 434, 778, 1276, 1958, 2936, 3979, 5315, 6082, 6987, 7109, 6905, 5980, 5325, 4702, 4570, 4476, 4384, 3873, 3218, 2455, 1772, 1516, 1660, 1748, 1596, 1291, 904, 684, 681, 738, 799, 1211, 2550, 4191, 4681, 4453, 3960, 3643, 3565, 3355, 3142, 3053, 3101, 3247, 3383, 3391, 3118, 3208, 3242, 3478, 3796, 4013, 4247, 4330, 4317, 4537, 4489, 4445, 4149, 3980, 3741, 3528, 3312, 3453, 3639, 3999, 4268, 4526, 4941, 5160, 5715, 6439, 7187, 7485, 7464, 7074, 6571, 6150, 5663, 5142, 4825, 4780, 4391, 3980, 3396, 3034, 2811, 2721, 2538, 2418, 2367, 2399, 2371, 2343, 2271, 2206, 2136, 2095, 1929, 1768, 1799, 1642, 1566, 1439, 1407, 1354, 1346, 1366, 1360, 1378, 1421, 1454, 1499, 1472, 1274, 1080, 966, 884, 813, 692, 674, 619, 565, 566, 525, 495, 480, 459, 445, 410, 380, 369, 372, 386, 370, 324, 303, 324, 282, 267, 269, 251, 265, 236, 252, 189, 229, 193, 198, 188, 192, 191, 160, 161, 153, 119, 130, 92, 99, 84, 89, 74, 58, 66, 59, 55, 44, 57, 49, 41, 37, 33, 38, 40, 26, 39, 22, 36, 26, 24, 18, 37, 23, 26, 26, 26, 22, 16, 17, 6, 1, 3, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 98438, 10698, 8559, 6964, 5663, 4839, 4469, 4421, 4310, 4417, 4618, 4929, 5226, 5101, 4951, 6198, 8748, 13413, 18891, 22401, 20787, 14012, 8651, 5694, 4563, 4344, 4347, 4522, 4971, 6132, 8844, 11552, 14030, 13847, 11458, 8822, 7566, 6557, 4993, 3594, 2413, 1537, 913, 549, 396, 309, 254, 198, 159, 109, 62, 37, 12, 5, 3, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], + ["stare-images/im0001.ppm", [136, 354, 732, 993, 1507, 1645, 1718, 1728, 1926, 1777, 1813, 3001, 8934, 16443, 12821, 8771, 7318, 6461, 6111, 5892, 5047, 3972, 2793, 2057, 1800, 1632, 1187, 972, 649, 372, 244, 226, 138, 135, 90, 82, 80, 60, 58, 67, 77, 64, 69, 57, 55, 45, 50, 39, 51, 43, 38, 35, 34, 52, 34, 51, 43, 60, 42, 44, 40, 33, 48, 39, 45, 41, 45, 65, 49, 51, 45, 58, 65, 67, 54, 58, 65, 90, 147, 184, 225, 236, 319, 333, 356, 356, 474, 514, 653, 759, 832, 954, 1020, 1025, 972, 1068, 915, 913, 903, 970, 976, 936, 959, 1023, 1012, 1027, 1133, 1276, 1264, 1277, 1336, 1428, 1443, 1417, 1551, 1643, 1682, 1592, 1692, 1758, 1982, 2074, 2028, 2085, 2210, 2220, 2212, 2192, 2371, 2394, 2363, 2346, 2329, 2366, 2294, 2309, 2309, 2260, 2226, 2276, 2345, 2355, 2301, 2388, 2510, 2591, 2625, 2719, 2577, 2726, 2694, 2617, 2498, 2544, 2433, 2375, 2468, 2608, 2848, 2796, 2653, 2793, 2701, 2754, 2652, 2567, 2443, 2415, 2486, 2374, 2431, 2530, 2636, 2494, 2465, 2501, 2430, 2517, 2368, 2262, 2346, 2313, 2299, 2088, 2083, 2075, 2175, 2330, 2450, 2513, 2684, 2863, 2926, 2874, 2841, 2819, 2910, 2997, 2859, 2989, 2947, 3132, 3253, 3153, 3265, 3191, 3166, 3030, 2824, 2673, 2521, 2278, 2092, 2093, 2043, 2053, 2008, 1934, 1875, 1684, 1602, 1362, 1235, 1158, 957, 894, 765, 654, 586, 586, 511, 445, 462, 384, 332, 361, 332, 270, 261, 250, 232, 262, 244, 222, 216, 165, 163, 145, 135, 133, 168, 130, 182, 139, 258, 4078, 11222, 2194, 1675, 859, 470, 286, 189, 135, 93, 71, 59, 53, 52, 61, 70, 70, 83, 121, 164, 287, 537, 897, 1575, 2590, 4035, 5630, 6993, 7324, 6939, 6239, 5432, 4788, 4375, 4168, 4114, 4421, 4515, 4825, 4417, 3648, 2394, 1637, 1029, 635, 375, 261, 154, 126, 108, 118, 111, 114, 187, 228, 280, 333, 433, 529, 594, 624, 640, 753, 868, 846, 907, 893, 918, 1022, 1076, 1148, 1294, 1668, 2129, 2379, 2527, 2657, 2818, 2973, 3480, 4113, 4491, 4683, 4820, 5102, 5361, 5865, 6620, 7396, 8376, 9053, 8817, 8469, 7857, 7265, 6910, 6869, 6664, 6310, 6568, 6498, 6359, 6231, 6334, 6388, 5897, 5609, 5481, 5339, 5124, 4917, 4810, 4806, 4392, 4281, 4048, 3807, 3760, 3731, 3622, 3434, 3358, 3190, 2854, 2657, 2365, 2121, 1751, 1536, 1359, 1281, 1166, 924, 890, 757, 631, 597, 510, 463, 407, 344, 344, 311, 274, 270, 250, 226, 225, 212, 178, 177, 167, 183, 150, 162, 144, 157, 152, 129, 153, 155, 161, 134, 108, 115, 134, 135, 122, 128, 112, 107, 87, 95, 89, 84, 82, 73, 87, 87, 65, 74, 87, 79, 73, 66, 75, 58, 55, 60, 78, 65, 70, 59, 75, 60, 56, 68, 67, 61, 71, 76, 59, 76, 70, 62, 52, 69, 59, 74, 67, 60, 75, 63, 65, 61, 55, 63, 66, 64, 65, 68, 58, 56, 51, 75, 56, 56, 63, 64, 62, 57, 63, 56, 62, 45, 56, 40, 41, 47, 34, 34, 42, 38, 38, 30, 41, 62, 149, 454, 171, 69, 0, 0, 0, 0, 0, 0, 159578, 3368, 2820, 2272, 2143, 2122, 2342, 2604, 3019, 3596, 4262, 5133, 5752, 5729, 5454, 4915, 5278, 7315, 12649, 21085, 29219, 26402, 19240, 13890, 11400, 10349, 8080, 7069, 7119, 7731, 8663, 7607, 3846, 1168, 219, 38, 7, 3, 1, 0, 1, 0, 2, 1, 1, 2, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], + ["stare-images/im0005.ppm", [92, 245, 479, 667, 1099, 1258, 1665, 2061, 5088, 9521, 13163, 12890, 12024, 9837, 7550, 6002, 4882, 3855, 3080, 2227, 1436, 1051, 926, 971, 1009, 1082, 976, 947, 1017, 1124, 1021, 719, 378, 223, 164, 124, 104, 86, 71, 70, 60, 60, 61, 58, 41, 43, 42, 42, 42, 40, 44, 49, 35, 46, 41, 43, 40, 32, 47, 43, 37, 41, 37, 49, 45, 60, 43, 57, 35, 40, 36, 50, 35, 38, 24, 29, 37, 29, 23, 31, 25, 24, 28, 38, 31, 31, 34, 24, 19, 29, 34, 51, 33, 47, 54, 47, 27, 41, 39, 32, 38, 48, 36, 54, 39, 57, 53, 91, 88, 94, 112, 102, 123, 117, 109, 135, 153, 110, 127, 145, 136, 165, 165, 165, 179, 177, 177, 203, 180, 262, 255, 269, 312, 371, 344, 473, 499, 621, 616, 713, 789, 761, 723, 718, 744, 747, 789, 822, 808, 822, 900, 1020, 1040, 1103, 1214, 1223, 1184, 1261, 1278, 1190, 1244, 1313, 1320, 1440, 1510, 1677, 1777, 1893, 1988, 2053, 2218, 2551, 2851, 3082, 3246, 3604, 3714, 3921, 4025, 4005, 4301, 4326, 4296, 4407, 4495, 4807, 4771, 4690, 4752, 4693, 4735, 4757, 4730, 4525, 4274, 4235, 3970, 4141, 4119, 4086, 4297, 4187, 4098, 3935, 3743, 3629, 3615, 3460, 3540, 3404, 3378, 3221, 3072, 3102, 2990, 3070, 2973, 2806, 2836, 2750, 2498, 2378, 2378, 2410, 2389, 2327, 2464, 2290, 2261, 2212, 2191, 2205, 2176, 2155, 2186, 2186, 2352, 2351, 2426, 2449, 2406, 2557, 2643, 2694, 2646, 2696, 2645, 2676, 2229, 1730, 1390, 1099, 977, 899, 463, 12, 5920, 2922, 2685, 1891, 1539, 1042, 819, 822, 981, 1382, 2063, 3017, 4023, 4957, 5599, 6067, 6036, 5688, 5355, 5111, 4500, 4458, 4201, 3976, 3629, 3276, 2663, 2406, 2052, 1902, 1738, 1407, 1166, 1058, 1075, 1069, 934, 772, 588, 302, 202, 141, 114, 117, 106, 134, 148, 203, 153, 198, 218, 229, 196, 238, 258, 315, 312, 373, 396, 366, 429, 390, 434, 448, 434, 447, 398, 391, 406, 459, 431, 458, 468, 465, 539, 565, 603, 626, 688, 686, 703, 790, 722, 815, 777, 791, 828, 866, 966, 1069, 1204, 1334, 1373, 1460, 1676, 1831, 2039, 2439, 2932, 3708, 3950, 4663, 5496, 6402, 7436, 8153, 8484, 9154, 8594, 8351, 8196, 8104, 7419, 7450, 7535, 7240, 7256, 6766, 5988, 5694, 5154, 4597, 4229, 3908, 3885, 3620, 3466, 3361, 3331, 3394, 3037, 2719, 2760, 2754, 2579, 2553, 2405, 2405, 2265, 2449, 2613, 2668, 2694, 2624, 2673, 2649, 2541, 2452, 2592, 2360, 2375, 2251, 2237, 2068, 1874, 1644, 1669, 1607, 1677, 1707, 1659, 1706, 1645, 1456, 1372, 1187, 1103, 949, 933, 840, 785, 729, 595, 495, 390, 350, 287, 238, 156, 173, 124, 110, 88, 59, 64, 48, 47, 38, 37, 19, 16, 15, 8, 4, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 14, 18, 45, 100, 192, 465, 891, 1647, 2937, 5244, 9338, 14890, 17075, 14647, 11364, 8211, 5783, 4035, 3092, 2474, 2147, 1721, 1202, 872, 618, 480, 473, 500, 568, 561, 526, 596, 507, 390, 356, 355, 418, 459, 487, 487, 482, 566, 594, 635, 695, 662, 656, 691, 714, 678, 720, 868, 879, 1004, 1090, 1244, 1493, 1889, 2168, 2507, 2946, 3274, 3947, 4364, 4603, 5047, 5629, 6765, 7624, 8563, 9324, 10189, 10507, 10575, 10484, 10049, 10025, 9681, 8943, 8228, 7609, 7450, 6791, 6368, 5950, 5475, 5191, 4995, 4692, 4121, 3896, 3439, 3300, 3038, 2842, 2749, 2492, 2350, 2268, 2266, 2124, 2027, 1900, 1925, 1910, 1697, 1585, 1427, 1349, 1200, 1146, 990, 948, 894, 800, 748, 715, 634, 675, 613, 537, 475, 468, 528, 534, 483, 518, 564, 604, 581, 583, 635, 666, 589, 608, 638, 683, 632, 650, 656, 677, 650, 627, 642, 588, 641, 617, 567, 546, 553, 500, 546, 555, 485, 448, 431, 365, 295, 279, 289, 222, 243, 197, 194, 183, 165, 133, 123, 94, 68, 54, 35, 30, 19, 9, 8, 5, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], + ["stare-images/im0004.ppm", [15, 49, 136, 309, 612, 1063, 1494, 1751, 2362, 2377, 2375, 2298, 2876, 6639, 11236, 11757, 10023, 8730, 8014, 7263, 6312, 5075, 4067, 3576, 3426, 3116, 2074, 1363, 1034, 940, 746, 651, 541, 384, 261, 162, 139, 137, 167, 173, 161, 179, 180, 170, 170, 179, 186, 162, 159, 147, 172, 205, 171, 203, 187, 222, 242, 320, 306, 360, 357, 422, 440, 418, 515, 499, 504, 495, 541, 558, 644, 720, 657, 581, 561, 511, 516, 599, 607, 619, 610, 628, 628, 745, 720, 765, 772, 791, 792, 818, 840, 1003, 913, 876, 862, 896, 904, 847, 831, 773, 755, 644, 703, 750, 791, 820, 775, 821, 891, 863, 865, 936, 999, 907, 887, 935, 921, 857, 847, 927, 980, 949, 855, 890, 956, 950, 1005, 1085, 1133, 1123, 1057, 1054, 944, 1002, 945, 929, 943, 993, 972, 1057, 1066, 1014, 1068, 1187, 1292, 1421, 1427, 1387, 1409, 1542, 1500, 1394, 1268, 1266, 1279, 1339, 1417, 1465, 1459, 1476, 1508, 1522, 1577, 1577, 1504, 1459, 1552, 1572, 1642, 1698, 1733, 1721, 1910, 2007, 2142, 2210, 2250, 2198, 2209, 2064, 2022, 2003, 1888, 1783, 1829, 1927, 1889, 1912, 1990, 1923, 1846, 1708, 1754, 1723, 1859, 1886, 1930, 2106, 2093, 2193, 2236, 2231, 2271, 2284, 2340, 2515, 2602, 2455, 2589, 2683, 2837, 2840, 2804, 3043, 3133, 3344, 3223, 3146, 3321, 3197, 3165, 3000, 2901, 3046, 3235, 3336, 3576, 3641, 3469, 3497, 3517, 3637, 3589, 3568, 3318, 2990, 2565, 2105, 1668, 1463, 1265, 1168, 1123, 1071, 1067, 1039, 1022, 948, 917, 949, 987, 999, 960, 904, 991, 7417, 14017, 2049, 1608, 1012, 803, 597, 513, 374, 326, 211, 142, 114, 92, 93, 122, 218, 364, 627, 998, 1564, 2154, 2986, 3945, 4812, 5752, 6384, 6123, 5711, 5117, 4510, 4186, 3991, 3985, 4207, 4538, 4766, 4506, 3495, 2261, 1713, 1616, 1505, 1402, 1217, 1133, 1231, 1243, 1347, 1229, 1306, 1453, 1537, 1605, 1440, 1363, 1427, 1504, 1672, 1780, 1890, 2028, 1986, 2045, 2129, 2188, 1854, 1426, 1332, 1378, 1370, 1476, 1468, 1495, 1657, 1838, 1893, 1904, 1959, 2045, 2030, 1812, 1883, 1931, 2012, 2069, 2213, 2269, 2310, 2406, 2525, 2471, 2329, 2403, 2629, 2732, 2962, 3550, 3784, 4313, 4877, 4968, 4757, 4908, 4883, 4989, 5208, 6101, 7306, 7733, 8398, 8927, 9186, 8550, 8098, 8331, 8530, 8918, 8876, 8221, 7960, 7172, 5896, 4697, 3956, 3512, 3429, 2963, 2449, 1906, 1561, 1209, 1084, 1002, 912, 865, 865, 758, 796, 717, 670, 644, 518, 467, 440, 449, 366, 264, 138, 61, 18, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 104125, 6755, 5576, 4262, 3670, 3332, 3311, 3433, 3774, 4210, 4874, 5902, 7831, 10954, 15228, 19740, 21821, 20486, 15962, 10817, 6999, 5078, 4287, 3923, 3830, 3921, 3766, 4155, 4709, 5514, 6621, 7210, 8581, 11491, 14140, 12990, 9460, 5567, 3259, 2626, 2518, 2600, 2752, 2652, 2450, 1927, 1558, 1138, 737, 483, 256, 115, 77, 23, 9, 10, 4, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], + ["stare-images/im0004.ppm", [15, 49, 136, 309, 612, 1063, 1494, 1751, 2362, 2377, 2375, 2298, 2876, 6639, 11236, 11757, 10023, 8730, 8014, 7263, 6312, 5075, 4067, 3576, 3426, 3116, 2074, 1363, 1034, 940, 746, 651, 541, 384, 261, 162, 139, 137, 167, 173, 161, 179, 180, 170, 170, 179, 186, 162, 159, 147, 172, 205, 171, 203, 187, 222, 242, 320, 306, 360, 357, 422, 440, 418, 515, 499, 504, 495, 541, 558, 644, 720, 657, 581, 561, 511, 516, 599, 607, 619, 610, 628, 628, 745, 720, 765, 772, 791, 792, 818, 840, 1003, 913, 876, 862, 896, 904, 847, 831, 773, 755, 644, 703, 750, 791, 820, 775, 821, 891, 863, 865, 936, 999, 907, 887, 935, 921, 857, 847, 927, 980, 949, 855, 890, 956, 950, 1005, 1085, 1133, 1123, 1057, 1054, 944, 1002, 945, 929, 943, 993, 972, 1057, 1066, 1014, 1068, 1187, 1292, 1421, 1427, 1387, 1409, 1542, 1500, 1394, 1268, 1266, 1279, 1339, 1417, 1465, 1459, 1476, 1508, 1522, 1577, 1577, 1504, 1459, 1552, 1572, 1642, 1698, 1733, 1721, 1910, 2007, 2142, 2210, 2250, 2198, 2209, 2064, 2022, 2003, 1888, 1783, 1829, 1927, 1889, 1912, 1990, 1923, 1846, 1708, 1754, 1723, 1859, 1886, 1930, 2106, 2093, 2193, 2236, 2231, 2271, 2284, 2340, 2515, 2602, 2455, 2589, 2683, 2837, 2840, 2804, 3043, 3133, 3344, 3223, 3146, 3321, 3197, 3165, 3000, 2901, 3046, 3235, 3336, 3576, 3641, 3469, 3497, 3517, 3637, 3589, 3568, 3318, 2990, 2565, 2105, 1668, 1463, 1265, 1168, 1123, 1071, 1067, 1039, 1022, 948, 917, 949, 987, 999, 960, 904, 991, 7417, 14017, 2049, 1608, 1012, 803, 597, 513, 374, 326, 211, 142, 114, 92, 93, 122, 218, 364, 627, 998, 1564, 2154, 2986, 3945, 4812, 5752, 6384, 6123, 5711, 5117, 4510, 4186, 3991, 3985, 4207, 4538, 4766, 4506, 3495, 2261, 1713, 1616, 1505, 1402, 1217, 1133, 1231, 1243, 1347, 1229, 1306, 1453, 1537, 1605, 1440, 1363, 1427, 1504, 1672, 1780, 1890, 2028, 1986, 2045, 2129, 2188, 1854, 1426, 1332, 1378, 1370, 1476, 1468, 1495, 1657, 1838, 1893, 1904, 1959, 2045, 2030, 1812, 1883, 1931, 2012, 2069, 2213, 2269, 2310, 2406, 2525, 2471, 2329, 2403, 2629, 2732, 2962, 3550, 3784, 4313, 4877, 4968, 4757, 4908, 4883, 4989, 5208, 6101, 7306, 7733, 8398, 8927, 9186, 8550, 8098, 8331, 8530, 8918, 8876, 8221, 7960, 7172, 5896, 4697, 3956, 3512, 3429, 2963, 2449, 1906, 1561, 1209, 1084, 1002, 912, 865, 865, 758, 796, 717, 670, 644, 518, 467, 440, 449, 366, 264, 138, 61, 18, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 104125, 6755, 5576, 4262, 3670, 3332, 3311, 3433, 3774, 4210, 4874, 5902, 7831, 10954, 15228, 19740, 21821, 20486, 15962, 10817, 6999, 5078, 4287, 3923, 3830, 3921, 3766, 4155, 4709, 5514, 6621, 7210, 8581, 11491, 14140, 12990, 9460, 5567, 3259, 2626, 2518, 2600, 2752, 2652, 2450, 1927, 1558, 1138, 737, 483, 256, 115, 77, 23, 9, 10, 4, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]] + ], + "test": [ + ["stare-images/im0235.ppm", [37, 162, 363, 787, 1653, 2804, 4939, 6568, 14915, 14374, 12449, 10386, 8745, 6669, 4648, 3318, 2500, 1949, 1797, 1703, 1580, 1465, 1452, 1416, 1462, 1473, 1067, 823, 658, 570, 373, 232, 149, 108, 106, 61, 56, 42, 43, 49, 42, 49, 42, 30, 32, 33, 27, 28, 32, 41, 45, 58, 43, 50, 38, 36, 34, 26, 25, 21, 18, 21, 22, 15, 18, 19, 13, 14, 18, 15, 14, 22, 24, 20, 26, 22, 21, 25, 16, 18, 15, 26, 21, 19, 18, 16, 23, 17, 22, 21, 23, 15, 23, 21, 23, 20, 18, 16, 19, 15, 21, 28, 18, 21, 18, 27, 16, 23, 19, 26, 31, 19, 34, 30, 32, 22, 35, 27, 37, 45, 47, 48, 68, 58, 71, 94, 110, 142, 136, 155, 137, 207, 228, 238, 306, 305, 363, 393, 528, 526, 638, 649, 737, 758, 768, 769, 789, 814, 823, 863, 920, 1003, 1028, 1025, 1111, 1052, 1080, 1045, 1074, 1162, 1113, 1178, 1262, 1279, 1263, 1245, 1364, 1383, 1395, 1442, 1514, 1590, 1634, 1798, 1852, 1898, 1986, 2139, 2034, 2111, 2231, 2231, 2209, 2299, 2353, 2409, 2424, 2538, 2542, 2621, 2458, 2407, 2442, 2504, 2441, 2507, 2484, 2439, 2429, 2378, 2359, 2410, 2383, 2538, 2483, 2482, 2418, 2573, 2566, 2623, 2811, 2894, 2957, 2973, 3144, 3160, 3265, 3293, 3521, 3516, 3502, 3521, 3640, 3789, 3736, 3924, 3930, 3811, 3749, 3801, 3571, 3427, 3478, 3396, 3314, 3377, 3429, 3596, 3940, 4309, 4415, 4765, 5310, 5584, 5941, 6232, 6750, 7006, 6953, 6119, 4738, 2746, 1588, 1425, 1474, 4767, 14835, 2526, 2238, 1913, 2408, 3115, 4132, 5224, 7179, 7566, 7231, 7026, 6429, 5678, 5040, 4355, 3760, 3402, 3088, 2802, 2549, 2337, 2137, 1949, 1676, 1246, 894, 620, 445, 242, 171, 127, 109, 98, 74, 92, 75, 65, 75, 66, 81, 80, 79, 121, 128, 196, 261, 300, 304, 348, 300, 337, 314, 365, 377, 407, 566, 609, 704, 832, 978, 1176, 1462, 1682, 2137, 2473, 2856, 3013, 3506, 3904, 4456, 4637, 4786, 5104, 5085, 5193, 5569, 5486, 5424, 5252, 4822, 4524, 4336, 4045, 3978, 3855, 3681, 3515, 3320, 3214, 3110, 3015, 2858, 2712, 2670, 2764, 2588, 2700, 2673, 2671, 2789, 2683, 2673, 2593, 2652, 2630, 2735, 2669, 2682, 2552, 2544, 2578, 2621, 2569, 2385, 2404, 2480, 2374, 2448, 2527, 2484, 2389, 2483, 2472, 2400, 2300, 2033, 2107, 1864, 1885, 1838, 1857, 1911, 1960, 1914, 2151, 2260, 2339, 2419, 2523, 2497, 2481, 2498, 2406, 2479, 2501, 2460, 2508, 2553, 2654, 2627, 2545, 2600, 2630, 2502, 2531, 2193, 2107, 1998, 1667, 1524, 1381, 1228, 1065, 944, 785, 603, 466, 343, 283, 226, 170, 154, 106, 95, 91, 97, 85, 87, 90, 72, 68, 100, 82, 62, 79, 68, 56, 42, 60, 67, 68, 41, 47, 61, 48, 49, 65, 56, 69, 61, 52, 67, 66, 73, 66, 67, 84, 94, 119, 113, 125, 95, 112, 102, 98, 102, 86, 105, 81, 89, 91, 84, 104, 112, 124, 105, 136, 133, 155, 187, 118, 135, 109, 113, 93, 101, 101, 94, 80, 96, 95, 95, 108, 90, 106, 123, 119, 99, 103, 129, 135, 135, 139, 142, 124, 1436, 281, 260, 318, 386, 573, 1084, 1962, 3454, 5652, 8572, 13307, 17887, 17873, 14951, 11847, 9175, 7116, 5464, 4175, 3515, 3233, 3424, 3738, 4231, 4979, 5704, 6301, 7395, 7974, 9053, 9962, 10778, 11185, 11396, 11215, 11258, 10956, 10185, 9498, 8619, 7814, 7007, 6609, 6318, 5963, 5883, 5981, 5747, 5834, 5541, 5513, 5289, 5003, 4855, 4672, 4438, 4156, 3897, 3538, 3196, 2863, 2568, 2221, 1971, 1770, 1452, 1307, 1068, 969, 823, 734, 548, 443, 379, 283, 216, 200, 182, 131, 127, 109, 104, 101, 97, 101, 104, 105, 93, 94, 81, 103, 92, 96, 107, 81, 83, 70, 79, 80, 100, 80, 104, 92, 78, 86, 67, 85, 80, 86, 61, 72, 60, 56, 62, 46, 48, 52, 45, 42, 35, 36, 33, 31, 28, 38, 38, 39, 47, 30, 31, 25, 42, 33, 36, 41, 40, 35, 42, 47, 41, 29, 25, 45, 32, 46, 42, 33, 43, 42, 43, 44, 35, 35, 35, 39, 39, 39, 35, 34, 26, 36, 43, 28, 28, 30, 37, 26, 35, 42, 24, 36, 25, 38, 28, 33, 38, 35, 25, 38, 35, 28, 23, 33, 33, 25, 25, 24, 11, 16, 5, 14, 6, 8, 5, 5, 3, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], + ["stare-images/im0163.ppm", [59, 190, 366, 617, 1239, 1983, 3475, 4875, 11518, 12017, 11083, 9543, 8920, 7610, 5881, 4372, 3284, 2572, 2009, 1781, 1652, 1373, 1216, 1067, 963, 873, 811, 851, 949, 1000, 835, 661, 637, 642, 609, 681, 699, 727, 697, 550, 342, 203, 151, 124, 78, 84, 77, 61, 41, 36, 45, 29, 40, 40, 24, 29, 48, 46, 38, 23, 36, 39, 21, 24, 29, 34, 40, 21, 36, 30, 17, 17, 29, 28, 25, 30, 32, 28, 28, 27, 31, 20, 34, 23, 33, 23, 25, 27, 17, 16, 23, 12, 25, 21, 25, 25, 18, 18, 13, 10, 14, 10, 11, 10, 12, 18, 13, 17, 12, 10, 13, 11, 14, 12, 13, 20, 12, 15, 17, 14, 14, 19, 16, 15, 14, 14, 12, 18, 9, 17, 18, 14, 10, 15, 19, 20, 13, 18, 16, 11, 17, 10, 18, 15, 28, 15, 20, 18, 13, 20, 15, 13, 12, 14, 12, 18, 14, 21, 15, 15, 18, 9, 19, 21, 16, 14, 16, 10, 14, 26, 16, 14, 17, 31, 21, 28, 24, 27, 19, 18, 19, 25, 23, 25, 28, 28, 27, 26, 38, 21, 24, 20, 18, 25, 17, 17, 29, 28, 34, 48, 32, 45, 55, 80, 73, 96, 118, 149, 147, 233, 322, 449, 617, 881, 1217, 1638, 2147, 2745, 3431, 3979, 4573, 5302, 6151, 6962, 7680, 8244, 8951, 9221, 9578, 9905, 10718, 10945, 11073, 11138, 11086, 11275, 10877, 10423, 9713, 8728, 7921, 7362, 6832, 6200, 5834, 5650, 5596, 5413, 5319, 5530, 5846, 5868, 5488, 4877, 5541, 17979, 13079, 2469, 2173, 1849, 2505, 2923, 3909, 4934, 7011, 6959, 7178, 6980, 6211, 5411, 4876, 4212, 3602, 3061, 2628, 2310, 2080, 1827, 1631, 1527, 1474, 1399, 1299, 1214, 1317, 1150, 989, 712, 515, 375, 315, 279, 234, 175, 158, 116, 127, 88, 90, 88, 58, 45, 56, 53, 60, 86, 84, 118, 117, 98, 103, 123, 117, 147, 141, 156, 188, 209, 247, 283, 280, 331, 343, 441, 436, 475, 479, 537, 570, 627, 638, 632, 705, 815, 963, 1140, 1463, 1816, 2079, 2325, 2375, 2441, 2686, 2815, 3065, 3261, 3546, 3844, 4229, 4800, 5123, 5733, 5976, 6162, 5920, 6253, 6020, 5987, 5911, 5825, 5865, 5756, 5963, 5891, 5993, 5800, 5611, 5591, 5246, 5152, 5307, 5255, 5388, 4970, 4958, 4528, 4342, 3908, 3557, 3301, 2965, 2865, 2687, 2583, 2397, 2343, 2281, 2276, 2227, 2071, 2108, 2009, 2023, 2047, 2081, 1856, 1873, 1784, 1813, 1787, 1773, 1759, 1664, 1673, 1627, 1517, 1478, 1562, 1480, 1509, 1358, 1399, 1289, 1243, 1167, 1143, 1068, 1053, 1038, 948, 989, 988, 893, 924, 894, 905, 924, 831, 807, 779, 692, 618, 582, 622, 587, 495, 450, 368, 371, 321, 333, 304, 283, 295, 287, 243, 220, 229, 199, 171, 206, 192, 218, 180, 168, 185, 179, 156, 153, 161, 149, 137, 134, 112, 120, 108, 108, 87, 89, 88, 81, 90, 106, 88, 111, 110, 107, 86, 132, 130, 128, 164, 173, 184, 166, 196, 206, 244, 247, 252, 238, 232, 228, 210, 212, 177, 146, 115, 93, 58, 18, 11, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 139709, 14926, 12518, 10512, 8933, 7869, 7482, 7853, 7917, 9356, 11644, 15264, 20443, 21773, 19183, 15881, 12910, 10260, 7952, 6776, 5829, 5069, 4402, 3672, 3412, 2882, 2689, 2484, 2315, 2106, 1872, 1664, 1474, 1324, 1179, 1060, 983, 793, 703, 643, 569, 499, 427, 383, 351, 310, 250, 251, 193, 174, 142, 156, 154, 115, 103, 90, 108, 102, 97, 78, 101, 88, 92, 120, 91, 81, 97, 93, 91, 89, 79, 103, 74, 77, 108, 98, 91, 102, 124, 107, 120, 96, 109, 109, 82, 101, 108, 78, 67, 75, 62, 74, 42, 38, 29, 23, 26, 22, 18, 14, 6, 7, 2, 6, 7, 0, 1, 2, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], + ["stare-images/im0319.ppm", [40, 130, 296, 508, 884, 1257, 1685, 2314, 4941, 8759, 11460, 11660, 11111, 9568, 7647, 6341, 5293, 4538, 3750, 3138, 2415, 1830, 1367, 1163, 1049, 972, 860, 758, 774, 704, 656, 644, 605, 694, 620, 533, 450, 392, 375, 388, 331, 199, 113, 65, 66, 58, 55, 46, 36, 42, 36, 27, 29, 32, 30, 28, 28, 39, 29, 34, 31, 25, 42, 28, 27, 21, 24, 21, 15, 25, 30, 33, 20, 25, 18, 30, 12, 16, 16, 21, 21, 16, 19, 16, 21, 15, 17, 15, 12, 11, 24, 22, 18, 24, 24, 19, 22, 18, 18, 22, 23, 20, 22, 14, 16, 19, 21, 20, 20, 12, 12, 14, 11, 22, 18, 15, 14, 9, 10, 23, 17, 23, 18, 13, 11, 9, 13, 15, 8, 15, 11, 14, 15, 14, 16, 15, 20, 16, 22, 20, 20, 20, 9, 28, 20, 28, 20, 19, 22, 16, 37, 18, 22, 25, 26, 31, 33, 67, 72, 113, 131, 156, 190, 223, 238, 308, 358, 488, 672, 742, 863, 1021, 1169, 1249, 1329, 1442, 1409, 1358, 1284, 1218, 1170, 1171, 1305, 1273, 1344, 1389, 1395, 1423, 1507, 1455, 1526, 1534, 1596, 1613, 1711, 1783, 1994, 2019, 2175, 2205, 2381, 2299, 2452, 2618, 2576, 2643, 2707, 2871, 2850, 2805, 2853, 2626, 2668, 2675, 2708, 2685, 2661, 2655, 2718, 2698, 2697, 2624, 2782, 2810, 2845, 3072, 3025, 3224, 3365, 3304, 3281, 3480, 3452, 3511, 3554, 3477, 3423, 3667, 3654, 3686, 3675, 3563, 3741, 3731, 3729, 3905, 3997, 4280, 4356, 4779, 5309, 6070, 6786, 7333, 10069, 66627, 11575, 2958, 2580, 1541, 1384, 750, 708, 696, 1071, 1201, 1630, 2265, 3046, 3857, 4527, 4869, 5277, 5497, 5364, 5138, 4860, 4657, 4359, 4002, 3589, 3121, 2633, 2109, 1819, 1744, 1711, 1843, 1852, 1753, 1699, 1346, 866, 644, 396, 290, 309, 427, 539, 495, 340, 210, 122, 81, 50, 60, 44, 54, 54, 46, 44, 39, 37, 39, 50, 34, 47, 28, 39, 35, 36, 30, 25, 35, 35, 24, 32, 32, 26, 36, 31, 25, 28, 31, 33, 24, 32, 29, 41, 30, 29, 29, 43, 33, 57, 69, 76, 93, 84, 123, 150, 198, 204, 219, 226, 290, 311, 395, 670, 1221, 1800, 2311, 2493, 2666, 2604, 2731, 2932, 3460, 3511, 3891, 4292, 4397, 4602, 4658, 4599, 4603, 4432, 4242, 4286, 4781, 5396, 5377, 5189, 5115, 5327, 5301, 5213, 5163, 5628, 5966, 6076, 6453, 6757, 6372, 6362, 6286, 5950, 5879, 5422, 5335, 5326, 5057, 5242, 5272, 5446, 5848, 6089, 5821, 5304, 5132, 4817, 4655, 4556, 4599, 4584, 4599, 4371, 4198, 4006, 3899, 3620, 3079, 2388, 1737, 1111, 705, 432, 241, 166, 85, 68, 59, 47, 48, 46, 57, 50, 49, 60, 63, 61, 64, 60, 62, 79, 68, 72, 50, 59, 57, 70, 64, 78, 77, 70, 72, 84, 82, 72, 97, 78, 80, 106, 98, 96, 121, 108, 102, 95, 119, 123, 99, 97, 88, 81, 62, 52, 50, 40, 28, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 221289, 7288, 6076, 5122, 4340, 4475, 4912, 6306, 8077, 10813, 14157, 17869, 18490, 15983, 12102, 9332, 7104, 5633, 4506, 3480, 2984, 2515, 2000, 1783, 1690, 1672, 1597, 1706, 1778, 1899, 2041, 2139, 2248, 2094, 1988, 1755, 1409, 1024, 797, 478, 300, 135, 68, 28, 13, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], + ["stare-images/im0163.ppm", [59, 190, 366, 617, 1239, 1983, 3475, 4875, 11518, 12017, 11083, 9543, 8920, 7610, 5881, 4372, 3284, 2572, 2009, 1781, 1652, 1373, 1216, 1067, 963, 873, 811, 851, 949, 1000, 835, 661, 637, 642, 609, 681, 699, 727, 697, 550, 342, 203, 151, 124, 78, 84, 77, 61, 41, 36, 45, 29, 40, 40, 24, 29, 48, 46, 38, 23, 36, 39, 21, 24, 29, 34, 40, 21, 36, 30, 17, 17, 29, 28, 25, 30, 32, 28, 28, 27, 31, 20, 34, 23, 33, 23, 25, 27, 17, 16, 23, 12, 25, 21, 25, 25, 18, 18, 13, 10, 14, 10, 11, 10, 12, 18, 13, 17, 12, 10, 13, 11, 14, 12, 13, 20, 12, 15, 17, 14, 14, 19, 16, 15, 14, 14, 12, 18, 9, 17, 18, 14, 10, 15, 19, 20, 13, 18, 16, 11, 17, 10, 18, 15, 28, 15, 20, 18, 13, 20, 15, 13, 12, 14, 12, 18, 14, 21, 15, 15, 18, 9, 19, 21, 16, 14, 16, 10, 14, 26, 16, 14, 17, 31, 21, 28, 24, 27, 19, 18, 19, 25, 23, 25, 28, 28, 27, 26, 38, 21, 24, 20, 18, 25, 17, 17, 29, 28, 34, 48, 32, 45, 55, 80, 73, 96, 118, 149, 147, 233, 322, 449, 617, 881, 1217, 1638, 2147, 2745, 3431, 3979, 4573, 5302, 6151, 6962, 7680, 8244, 8951, 9221, 9578, 9905, 10718, 10945, 11073, 11138, 11086, 11275, 10877, 10423, 9713, 8728, 7921, 7362, 6832, 6200, 5834, 5650, 5596, 5413, 5319, 5530, 5846, 5868, 5488, 4877, 5541, 17979, 13079, 2469, 2173, 1849, 2505, 2923, 3909, 4934, 7011, 6959, 7178, 6980, 6211, 5411, 4876, 4212, 3602, 3061, 2628, 2310, 2080, 1827, 1631, 1527, 1474, 1399, 1299, 1214, 1317, 1150, 989, 712, 515, 375, 315, 279, 234, 175, 158, 116, 127, 88, 90, 88, 58, 45, 56, 53, 60, 86, 84, 118, 117, 98, 103, 123, 117, 147, 141, 156, 188, 209, 247, 283, 280, 331, 343, 441, 436, 475, 479, 537, 570, 627, 638, 632, 705, 815, 963, 1140, 1463, 1816, 2079, 2325, 2375, 2441, 2686, 2815, 3065, 3261, 3546, 3844, 4229, 4800, 5123, 5733, 5976, 6162, 5920, 6253, 6020, 5987, 5911, 5825, 5865, 5756, 5963, 5891, 5993, 5800, 5611, 5591, 5246, 5152, 5307, 5255, 5388, 4970, 4958, 4528, 4342, 3908, 3557, 3301, 2965, 2865, 2687, 2583, 2397, 2343, 2281, 2276, 2227, 2071, 2108, 2009, 2023, 2047, 2081, 1856, 1873, 1784, 1813, 1787, 1773, 1759, 1664, 1673, 1627, 1517, 1478, 1562, 1480, 1509, 1358, 1399, 1289, 1243, 1167, 1143, 1068, 1053, 1038, 948, 989, 988, 893, 924, 894, 905, 924, 831, 807, 779, 692, 618, 582, 622, 587, 495, 450, 368, 371, 321, 333, 304, 283, 295, 287, 243, 220, 229, 199, 171, 206, 192, 218, 180, 168, 185, 179, 156, 153, 161, 149, 137, 134, 112, 120, 108, 108, 87, 89, 88, 81, 90, 106, 88, 111, 110, 107, 86, 132, 130, 128, 164, 173, 184, 166, 196, 206, 244, 247, 252, 238, 232, 228, 210, 212, 177, 146, 115, 93, 58, 18, 11, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 139709, 14926, 12518, 10512, 8933, 7869, 7482, 7853, 7917, 9356, 11644, 15264, 20443, 21773, 19183, 15881, 12910, 10260, 7952, 6776, 5829, 5069, 4402, 3672, 3412, 2882, 2689, 2484, 2315, 2106, 1872, 1664, 1474, 1324, 1179, 1060, 983, 793, 703, 643, 569, 499, 427, 383, 351, 310, 250, 251, 193, 174, 142, 156, 154, 115, 103, 90, 108, 102, 97, 78, 101, 88, 92, 120, 91, 81, 97, 93, 91, 89, 79, 103, 74, 77, 108, 98, 91, 102, 124, 107, 120, 96, 109, 109, 82, 101, 108, 78, 67, 75, 62, 74, 42, 38, 29, 23, 26, 22, 18, 14, 6, 7, 2, 6, 7, 0, 1, 2, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], + ["stare-images/im0324.ppm", [143, 282, 513, 721, 1000, 1061, 1379, 1760, 4375, 8532, 11395, 12048, 11722, 9618, 7073, 5597, 4596, 3939, 3279, 2603, 1717, 1242, 1013, 874, 945, 1135, 1236, 1196, 1312, 1254, 1188, 905, 814, 732, 660, 620, 614, 553, 583, 490, 402, 315, 250, 162, 171, 135, 87, 77, 73, 67, 54, 58, 51, 37, 33, 32, 28, 36, 23, 29, 43, 29, 31, 33, 25, 28, 33, 35, 32, 27, 30, 31, 31, 31, 24, 21, 15, 25, 20, 30, 29, 21, 29, 19, 21, 29, 30, 33, 27, 17, 29, 17, 16, 20, 23, 14, 13, 8, 17, 13, 16, 7, 13, 13, 16, 13, 10, 13, 21, 9, 16, 13, 7, 10, 15, 13, 13, 10, 9, 6, 15, 13, 18, 14, 14, 12, 10, 11, 12, 10, 14, 17, 7, 13, 10, 11, 17, 7, 12, 13, 15, 18, 11, 16, 13, 5, 15, 12, 8, 13, 11, 11, 16, 13, 20, 12, 22, 17, 20, 17, 13, 14, 23, 18, 16, 22, 18, 25, 17, 22, 16, 24, 19, 14, 10, 17, 15, 16, 16, 19, 22, 25, 23, 40, 45, 70, 77, 97, 128, 111, 164, 190, 202, 270, 293, 391, 454, 564, 674, 768, 850, 876, 970, 903, 969, 1089, 1152, 1228, 1173, 1171, 1152, 1160, 1187, 1206, 1310, 1269, 1453, 1421, 1549, 1632, 1751, 1886, 1991, 2050, 2254, 2366, 2634, 2853, 3035, 3282, 3536, 3716, 3892, 4010, 4102, 4327, 4620, 4886, 5021, 5076, 5077, 4960, 4924, 4968, 5328, 5595, 6124, 6763, 7386, 8335, 9451, 10239, 11157, 13162, 19392, 90053, 15198, 2090, 1513, 820, 770, 332, 407, 598, 996, 1648, 2370, 3305, 4146, 4762, 5007, 5182, 5083, 5072, 4694, 4518, 4264, 3949, 3726, 3325, 3029, 2692, 2452, 2068, 1986, 1895, 1804, 1883, 1843, 1629, 1486, 1266, 1028, 921, 763, 583, 466, 395, 342, 256, 142, 91, 96, 74, 80, 80, 89, 71, 70, 54, 61, 48, 64, 46, 49, 50, 43, 37, 32, 36, 33, 27, 30, 30, 23, 29, 18, 22, 34, 19, 18, 32, 21, 24, 20, 33, 27, 22, 17, 14, 20, 17, 24, 27, 30, 38, 61, 105, 119, 165, 222, 221, 212, 208, 204, 218, 281, 292, 390, 515, 668, 867, 1193, 1720, 2630, 4116, 5295, 6032, 5279, 4737, 4436, 4296, 4428, 4563, 4751, 5352, 5965, 5886, 5635, 5541, 5121, 4717, 4547, 4304, 4314, 4337, 4526, 4725, 4933, 5023, 5131, 5276, 5289, 4868, 4822, 4516, 4548, 4387, 4562, 4508, 4674, 4627, 4397, 4399, 4747, 5164, 5549, 5583, 5587, 5313, 5004, 4958, 4662, 4457, 4208, 3728, 3387, 3069, 2878, 2625, 2490, 2349, 2233, 2245, 2117, 2011, 1864, 1762, 1542, 1552, 1331, 1259, 1246, 1107, 1112, 1114, 963, 985, 986, 1074, 1030, 887, 847, 772, 713, 620, 494, 407, 314, 277, 254, 193, 183, 123, 80, 81, 70, 49, 46, 38, 37, 18, 13, 10, 4, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 280294, 2594, 2171, 1736, 1499, 1424, 1528, 1820, 2196, 2746, 3658, 4913, 7604, 11056, 13988, 15004, 14431, 13139, 10443, 7835, 5551, 4159, 3557, 2651, 1928, 1325, 892, 704, 588, 494, 385, 318, 260, 187, 162, 99, 70, 38, 30, 11, 6, 2, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]] + ] +} diff --git a/src/mednet/libs/segmentation/tests/test_stare.py b/src/mednet/libs/segmentation/tests/test_stare.py new file mode 100644 index 0000000000000000000000000000000000000000..99b36913fae67d5d75178d2383e6430898d0509a --- /dev/null +++ b/src/mednet/libs/segmentation/tests/test_stare.py @@ -0,0 +1,143 @@ +# SPDX-FileCopyrightText: Copyright © 2024 Idiap Research Institute <contact@idiap.ch> +# +# SPDX-License-Identifier: GPL-3.0-or-later +"""Tests for stare dataset.""" + +import importlib + +import pytest +from click.testing import CliRunner + + +def id_function(val): + if isinstance(val, dict): + return str(val) + return repr(val) + + +@pytest.mark.parametrize( + "split,lengths", + [ + ("ah", dict(train=10, test=10)), + ("vk", dict(train=10, test=10)), + ], + ids=id_function, # just changes how pytest prints it +) +def test_protocol_consistency( + database_checkers, + split: str, + lengths: dict[str, int], +): + from mednet.libs.segmentation.config.data.stare.datamodule import ( + make_split, + ) + + database_checkers.check_split( + make_split(f"{split}.json"), + lengths=lengths, + ) + + +@pytest.mark.skip_if_rc_var_not_set("datadir.stare") +def test_database_check(): + from mednet.libs.segmentation.scripts.database import check + + runner = CliRunner() + result = runner.invoke(check, ["stare"]) + assert ( + result.exit_code == 0 + ), f"Exit code {result.exit_code} != 0 -- Output:\n{result.output}" + + +@pytest.mark.skip_if_rc_var_not_set("datadir.stare") +@pytest.mark.parametrize( + "dataset", + [ + "train", + "test", + ], +) +@pytest.mark.parametrize( + "name", + [ + "ah", + "vk", + ], +) +def test_loading(database_checkers, name: str, dataset: str): + datamodule = importlib.import_module( + f".{name}", + "mednet.libs.segmentation.config.data.stare", + ).datamodule + + datamodule.model_transforms = [] # should be done before setup() + datamodule.setup("predict") # sets up all datasets + + loader = datamodule.predict_dataloader()[dataset] + + limit = 3 # limit load checking + for batch in loader: + if limit == 0: + break + database_checkers.check_loaded_batch( + batch, + batch_size=1, + color_planes=3, + expected_num_targets=1, + ) + limit -= 1 + + +@pytest.mark.skip_if_rc_var_not_set("datadir.stare") +def test_raw_transforms_image_quality(database_checkers, datadir): + reference_histogram_file = str( + datadir / "histograms/raw_data/histograms_stare_ah.json", + ) + + datamodule = importlib.import_module( + ".ah", + "mednet.libs.segmentation.config.data.stare", + ).datamodule + + datamodule.model_transforms = [] + datamodule.setup("predict") + + database_checkers.check_image_quality(datamodule, reference_histogram_file) + + +@pytest.mark.skip_if_rc_var_not_set("datadir.stare") +@pytest.mark.parametrize( + "model_name", + ["lwnet"], +) +def test_model_transforms_image_quality(database_checkers, datadir, model_name): + # Densenet's model.name is "densenet-212" and does not correspond to its module name. + if model_name == "densenet": + reference_histogram_file = str( + datadir / "histograms/models/histograms_densenet-121_stare_ah.json", + ) + else: + reference_histogram_file = str( + datadir + / f"histograms/models/histograms_{model_name}_stare_ah.json", + ) + + datamodule = importlib.import_module( + ".ah", + "mednet.libs.segmentation.config.data.stare", + ).datamodule + + model = importlib.import_module( + f".{model_name}", + "mednet.libs.segmentation.config.models", + ).model + + datamodule.model_transforms = model.model_transforms + datamodule.setup("predict") + + database_checkers.check_image_quality( + datamodule, + reference_histogram_file, + compare_type="statistical", + pearson_coeff_threshold=0.005, + )