Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions _testdata/testdata_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
'sha256',
)
)
OPTIONAL_FIELDS = frozenset(('credit',))
OPTIONAL_FIELDS = frozenset(('credit', 'deprecated'))

INDEX_TEMPLATE = """<!doctype html>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
Expand All @@ -59,6 +59,10 @@
padding-left: 10px;
padding-right: 10px;
}
tr.deprecated {
color: #888888;
background: #f4e8e8;
}
td {
padding-top: 0.5em;
padding-bottom: 0.5em;
Expand Down Expand Up @@ -88,14 +92,17 @@
<th>Credit</th>
</tr>
{% macro row(icon, href, name, size='', description='', license='',
credit='') %}
<tr>
credit='', deprecated=false) %}
<tr class="{% if deprecated %}deprecated{% endif %}">
<td class="filename">
<i class="filetype fa {{ icon }}"></i>
<a href="{{ href }}">{{ name }}</a>
</td>
<td class="size">{{ size }}</td>
<td class="description">{{ description }}</td>
<td class="description">
{{ description }}
{% if deprecated %}(deprecated){% endif %}
</td>
<td class="license">
{% if license == 'distributable' %}
Free to use and distribute, with or without modification
Expand All @@ -122,7 +129,7 @@
{% for name, info in (files or {}).items()|sort %}
{{ row('fa-file-archive-o' if name.endswith('.zip') else 'fa-file-image-o',
name, name, info.size|file_size_units, info.description,
info.license, info.credit) }}
info.license, info.credit, info.deprecated) }}
{% endfor %}
{% for extra in extras %}
{{ row('fa-file-code-o', extra.name, extra.name,
Expand Down
6 changes: 6 additions & 0 deletions demo/_synctiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ class TestDataSlide(TypedDict):
"""One openslide-testdata slide from index.json."""

credit: NotRequired[str]
deprecated: NotRequired[bool]
description: str
format: str
license: str
Expand Down Expand Up @@ -577,6 +578,11 @@ def start_retile(
r = requests.get(urljoin(DOWNLOAD_BASE_URL, DOWNLOAD_INDEX))
r.raise_for_status()
slides: TestDataIndex = r.json()
slides = {
slide_relpath: slide_info
for slide_relpath, slide_info in slides.items()
if not slide_info.get('deprecated', False)
}

# Initialize context for the run
context: Context = {
Expand Down
14 changes: 8 additions & 6 deletions docs/newformat/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ Your driver can use the *grid* module to map pixel coordinates to tile
addresses:

- The `simple` grid is suitable for slide formats that have non-overlapping,
regularly-spaced, equal-sized tiles, and do not need to record individual
information about each tile. (TIFF images often have this property.)
regularly-spaced, equal-sized tiles, possibly sparse, and do not need to
record additional information about each tile. (TIFF images often have
this property.)

- The `tilemap` grid is suitable for formats in which each tile is assigned
a row and column on a regular grid, but the tiles may be offset from their
Expand Down Expand Up @@ -139,10 +140,11 @@ Your driver is also responsible for setting some
`openslide.background-color` should be set with
`_openslide_set_background_color_prop()`.

The `openslide.bounds-*` properties should be set for formats that do not
store image data for every pixel in the level. Drivers that use a single
`tilemap` or `range` grid per level can set these properties with
`_openslide_set_bounds_props_from_grid()`.
The `openslide.bounds-*` properties should be set for slides that omit image
data along an entire edge of level 0. Drivers that use a single grid per
level can set these properties with
`_openslide_set_bounds_props_from_grid()`, which automatically omits the
properties if the bounding box entirely covers level 0.

`openslide.mpp-x`, `openslide.mpp-y`, and `openslide.objective-power` should
be a copy of, or otherwise derived from, another vendor-specific property.
Expand Down
6 changes: 3 additions & 3 deletions formats/aperio/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ page 14:

Some Aperio files use compression type 33003 or 33005. Images using
this compression need to be decoded as a JPEG 2000 codestream. For
33003: YCbCr format, possibly with a chroma subsampling of 4:2:2. For
33005: RGB format. Note that the TIFF file may not encode the
colorspace or subsampling parameters in the
33003: YCbCr format with no MCT, possibly with a chroma subsampling of
4:2:2. For 33005: MCT, which OpenJPEG decodes into RGB. Note that the TIFF
file may not encode the colorspace or subsampling parameters in the
`PhotometricInterpretation` field, nor the `YCbCrSubsampling` field,
even though the TIFF standard seems to require this. The correct
subsampling can be found in the JPEG 2000 codestream.
Expand Down
26 changes: 15 additions & 11 deletions formats/dicom/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,19 @@ to parse and load DICOM files.

OpenSlide non-recursively scans the containing directory for other DICOM
files with the same _Series Instance UID_ attribute value as the specified
file. It uses the _Image Type_ attribute of each matching file to determine
the file's role within the whole slide image:
file. It uses the _Image Flavor_ (value 3 of the _Image Type_ attribute)
of each matching file to determine the file's role within the whole slide
image:

| Role | Allowed _Image Type_ values |
| Role | _Image Flavor_ values |
| - | - | - |
| Slide level | `ORIGINAL\PRIMARY\VOLUME\NONE`<br>`DERIVED\PRIMARY\VOLUME\NONE`<br>`DERIVED\PRIMARY\VOLUME\RESAMPLED` |
| Associated image | `ORIGINAL\PRIMARY\LABEL\NONE`<br>`ORIGINAL\PRIMARY\OVERVIEW\NONE`<br>`ORIGINAL\PRIMARY\THUMBNAIL\RESAMPLED`<br>`DERIVED\PRIMARY\LABEL\NONE`<br>`DERIVED\PRIMARY\OVERVIEW\NONE`<br>`DERIVED\PRIMARY\THUMBNAIL\RESAMPLED` |
| Slide level | `VOLUME` |
| Associated image | `LABEL`<br>`OVERVIEW`<br>`THUMBNAIL` |
| Ignored | All others |

A slide level can be spread across multiple files that share a
_Concatenation UID_.

If multiple files in the directory have the same _SOP Instance UID_,
the extra copies are ignored.

Expand All @@ -55,8 +59,8 @@ supported:
| - | - | - |
| Uncompressed little-endian | `1.2.840.10008.1.2.1` | `RGB` |
| JPEG baseline | `1.2.840.10008.1.2.4.50` | `RGB`<br>`YBR_FULL_422` |
| JPEG 2000 | `1.2.840.10008.1.2.4.91` | `RGB`<br>`YBR_ICT` |
| JPEG 2000 lossless | `1.2.840.10008.1.2.4.90` | `RGB`<br>`YBR_ICT` |
| JPEG 2000 | `1.2.840.10008.1.2.4.91` | `RGB`<br>`YBR_ICT`<br>`YBR_RCT` |
| JPEG 2000 (lossless only) | `1.2.840.10008.1.2.4.90` | `RGB`<br>`YBR_RCT` |


## ICC Profiles
Expand All @@ -68,11 +72,11 @@ _ICC Profile_ of the associated image.

## Associated Images

| Associated image | Allowed _Image Type_ values |
| Associated image | _Image Flavor_ |
| - | - | - |
| `label` | `ORIGINAL\PRIMARY\LABEL\NONE`<br>`DERIVED\PRIMARY\LABEL\NONE` |
| `macro` | `ORIGINAL\PRIMARY\OVERVIEW\NONE`<br>`DERIVED\PRIMARY\OVERVIEW\NONE` |
| `thumbnail` | `ORIGINAL\PRIMARY\THUMBNAIL\RESAMPLED`<br>`DERIVED\PRIMARY\THUMBNAIL\RESAMPLED` |
| `label` | `LABEL` |
| `macro` | `OVERVIEW` |
| `thumbnail` | `THUMBNAIL` |


## Known Properties
Expand Down