def project_with_removed_image_without_image_data(removable_svs_small): with tempfile.TemporaryDirectory(prefix='paquo-') as tmpdir: qp = QuPathProject(tmpdir, mode='x') _ = qp.add_image(removable_svs_small) qp.save() removable_svs_small.unlink() yield qp.path
def project_with_removed_image(removable_svs_small): with tempfile.TemporaryDirectory(prefix='paquo-') as tmpdir: qp = QuPathProject(tmpdir, mode='x') _ = qp.add_image(removable_svs_small, image_type=QuPathImageType.BRIGHTFIELD_H_E) qp.save() removable_svs_small.unlink() yield qp.path
def project_and_changes(svs_small): with tempfile.TemporaryDirectory(prefix='paquo-') as tmpdir: qp = QuPathProject(tmpdir, mode='x') entry = qp.add_image(svs_small) entry.hierarchy.add_annotation( roi=shapely.geometry.Point(1, 2) ) qp.save() project_path = qp.path.parent del qp last_changes = {} for file in project_path.glob("**/*.*"): p = str(file.absolute()) last_changes[p] = file.stat().st_mtime yield project_path, last_changes
def image_entry(svs_small): with tempfile.TemporaryDirectory(prefix='paquo-') as tmpdir: qp = QuPathProject(tmpdir, mode='x') entry = qp.add_image(svs_small) yield entry
def test_project_add_image_writes_project(tmp_path, svs_small): qp = QuPathProject(tmp_path, mode='x') qp.add_image(svs_small) assert qp.path.is_file()