sample
¤
Classes:
| Name | Description |
|---|---|
LinearSampleAxisTransform |
|
Sample |
A dataset sample. |
SampleBlock |
A block of a dataset sample |
SampleBlockBase |
base class for |
SampleBlockMeta |
Meta data of a dataset sample block |
SampleBlockWithOrigin |
A |
Functions:
| Name | Description |
|---|---|
sample_block_generator |
|
sample_block_meta_generator |
|
Attributes:
| Name | Type | Description |
|---|---|---|
BlockT |
|
BlockT
module-attribute
¤
-
API Reference
sampleSampleBlockBase
-
API Reference
sample
LinearSampleAxisTransform
dataclass
¤
Bases: LinearAxisTransform
flowchart TD
bioimageio.core.sample.LinearSampleAxisTransform[LinearSampleAxisTransform]
bioimageio.core.block_meta.LinearAxisTransform[LinearAxisTransform]
bioimageio.core.block_meta.LinearAxisTransform --> bioimageio.core.sample.LinearSampleAxisTransform
click bioimageio.core.sample.LinearSampleAxisTransform href "" "bioimageio.core.sample.LinearSampleAxisTransform"
click bioimageio.core.block_meta.LinearAxisTransform href "" "bioimageio.core.block_meta.LinearAxisTransform"
-
API Reference
digest_specget_block_transform
Methods:
| Name | Description |
|---|---|
compute |
|
Attributes:
| Name | Type | Description |
|---|---|---|
axis |
AxisId
|
|
member |
MemberId
|
|
offset |
int
|
|
scale |
float
|
|
compute
¤
compute(s: int, round: Callable[[float], int] = floor) -> int
Source code in src/bioimageio/core/block_meta.py
41 42 | |
Sample
dataclass
¤
A dataset sample.
A Sample has members, which allows to combine multiple tensors into a single
sample.
For example a Sample from a dataset with masked images may contain a
MemberId("raw") and MemberId("mask") image.
- API Reference
- API Reference
Methods:
| Name | Description |
|---|---|
as_arrays |
Return sample as dictionary of arrays. |
as_single_block |
|
from_blocks |
|
split_into_blocks |
|
Attributes:
| Name | Type | Description |
|---|---|---|
id |
SampleId
|
Identifies the |
members |
Dict[MemberId, Tensor]
|
The sample's tensors |
shape |
PerMember[PerAxis[int]]
|
|
stat |
Stat
|
Sample and dataset statistics |
id
instance-attribute
¤
id: SampleId
Identifies the Sample within the dataset -- typically a number or a string.
as_arrays
¤
as_arrays() -> Dict[str, NDArray[Any]]
Return sample as dictionary of arrays.
Source code in src/bioimageio/core/sample.py
68 69 70 | |
as_single_block
¤
Source code in src/bioimageio/core/sample.py
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | |
from_blocks
classmethod
¤
from_blocks(sample_blocks: Iterable[SampleBlock], *, fill_value: float = float('nan')) -> Self
Source code in src/bioimageio/core/sample.py
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 | |
split_into_blocks
¤
split_into_blocks(block_shapes: PerMember[PerAxis[int]], halo: PerMember[PerAxis[HaloLike]], pad_mode: PadMode, broadcast: bool = False) -> Tuple[TotalNumberOfBlocks, Iterable[SampleBlockWithOrigin]]
Source code in src/bioimageio/core/sample.py
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | |
SampleBlock
dataclass
¤
SampleBlock(sample_shape: PerMember[PerAxis[int]], sample_id: SampleId, blocks: Dict[MemberId, BlockT], block_index: BlockIndex, blocks_in_sample: TotalNumberOfBlocks, stat: Stat)
Bases: SampleBlockBase[Block]
flowchart TD
bioimageio.core.sample.SampleBlock[SampleBlock]
bioimageio.core.sample.SampleBlockBase[SampleBlockBase]
bioimageio.core.sample.SampleBlockBase --> bioimageio.core.sample.SampleBlock
click bioimageio.core.sample.SampleBlock href "" "bioimageio.core.sample.SampleBlock"
click bioimageio.core.sample.SampleBlockBase href "" "bioimageio.core.sample.SampleBlockBase"
A block of a dataset sample
-
API Reference
sampleSampleBlockWithOrigin
Methods:
| Name | Description |
|---|---|
get_transformed_meta |
|
Attributes:
| Name | Type | Description |
|---|---|---|
block_index |
BlockIndex
|
the n-th block of the sample |
blocks |
Dict[MemberId, BlockT]
|
Individual tensor blocks comprising this sample block |
blocks_in_sample |
TotalNumberOfBlocks
|
total number of blocks in the sample |
inner_shape |
PerMember[PerAxis[int]]
|
|
members |
PerMember[Tensor]
|
the sample block's tensors |
sample_id |
SampleId
|
identifier for the sample within its dataset |
sample_shape |
PerMember[PerAxis[int]]
|
the sample shape this block represents a part of |
shape |
PerMember[PerAxis[int]]
|
|
stat |
Stat
|
computed statistics |
blocks
instance-attribute
¤
Individual tensor blocks comprising this sample block
blocks_in_sample
instance-attribute
¤
blocks_in_sample: TotalNumberOfBlocks
total number of blocks in the sample
sample_shape
instance-attribute
¤
the sample shape this block represents a part of
get_transformed_meta
¤
get_transformed_meta(new_axes: PerMember[PerAxis[Union[LinearSampleAxisTransform, int]]]) -> SampleBlockMeta
Source code in src/bioimageio/core/sample.py
296 297 298 299 300 301 302 303 304 305 | |
SampleBlockBase
dataclass
¤
SampleBlockBase(sample_shape: PerMember[PerAxis[int]], sample_id: SampleId, blocks: Dict[MemberId, BlockT], block_index: BlockIndex, blocks_in_sample: TotalNumberOfBlocks)
Bases: Generic[BlockT]
flowchart TD
bioimageio.core.sample.SampleBlockBase[SampleBlockBase]
click bioimageio.core.sample.SampleBlockBase href "" "bioimageio.core.sample.SampleBlockBase"
base class for SampleBlockMeta and SampleBlock
-
API Reference
sample
Attributes:
| Name | Type | Description |
|---|---|---|
block_index |
BlockIndex
|
the n-th block of the sample |
blocks |
Dict[MemberId, BlockT]
|
Individual tensor blocks comprising this sample block |
blocks_in_sample |
TotalNumberOfBlocks
|
total number of blocks in the sample |
inner_shape |
PerMember[PerAxis[int]]
|
|
sample_id |
SampleId
|
identifier for the sample within its dataset |
sample_shape |
PerMember[PerAxis[int]]
|
the sample shape this block represents a part of |
shape |
PerMember[PerAxis[int]]
|
|
blocks
instance-attribute
¤
Individual tensor blocks comprising this sample block
blocks_in_sample
instance-attribute
¤
blocks_in_sample: TotalNumberOfBlocks
total number of blocks in the sample
sample_shape
instance-attribute
¤
the sample shape this block represents a part of
SampleBlockMeta
dataclass
¤
SampleBlockMeta(sample_shape: PerMember[PerAxis[int]], sample_id: SampleId, blocks: Dict[MemberId, BlockT], block_index: BlockIndex, blocks_in_sample: TotalNumberOfBlocks)
Bases: SampleBlockBase[BlockMeta]
flowchart TD
bioimageio.core.sample.SampleBlockMeta[SampleBlockMeta]
bioimageio.core.sample.SampleBlockBase[SampleBlockBase]
bioimageio.core.sample.SampleBlockBase --> bioimageio.core.sample.SampleBlockMeta
click bioimageio.core.sample.SampleBlockMeta href "" "bioimageio.core.sample.SampleBlockMeta"
click bioimageio.core.sample.SampleBlockBase href "" "bioimageio.core.sample.SampleBlockBase"
Meta data of a dataset sample block
Methods:
| Name | Description |
|---|---|
get_transformed |
|
with_data |
|
Attributes:
| Name | Type | Description |
|---|---|---|
block_index |
BlockIndex
|
the n-th block of the sample |
blocks |
Dict[MemberId, BlockT]
|
Individual tensor blocks comprising this sample block |
blocks_in_sample |
TotalNumberOfBlocks
|
total number of blocks in the sample |
inner_shape |
PerMember[PerAxis[int]]
|
|
sample_id |
SampleId
|
identifier for the sample within its dataset |
sample_shape |
PerMember[PerAxis[int]]
|
the sample shape this block represents a part of |
shape |
PerMember[PerAxis[int]]
|
|
blocks
instance-attribute
¤
Individual tensor blocks comprising this sample block
blocks_in_sample
instance-attribute
¤
blocks_in_sample: TotalNumberOfBlocks
total number of blocks in the sample
sample_shape
instance-attribute
¤
the sample shape this block represents a part of
get_transformed
¤
get_transformed(new_axes: PerMember[PerAxis[Union[LinearSampleAxisTransform, int]]]) -> Self
Source code in src/bioimageio/core/sample.py
194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 | |
with_data
¤
with_data(data: PerMember[Tensor], *, stat: Stat) -> SampleBlock
Source code in src/bioimageio/core/sample.py
265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 | |
SampleBlockWithOrigin
dataclass
¤
SampleBlockWithOrigin(sample_shape: PerMember[PerAxis[int]], sample_id: SampleId, blocks: Dict[MemberId, BlockT], block_index: BlockIndex, blocks_in_sample: TotalNumberOfBlocks, stat: Stat, origin: Sample)
Bases: SampleBlock
flowchart TD
bioimageio.core.sample.SampleBlockWithOrigin[SampleBlockWithOrigin]
bioimageio.core.sample.SampleBlock[SampleBlock]
bioimageio.core.sample.SampleBlockBase[SampleBlockBase]
bioimageio.core.sample.SampleBlock --> bioimageio.core.sample.SampleBlockWithOrigin
bioimageio.core.sample.SampleBlockBase --> bioimageio.core.sample.SampleBlock
click bioimageio.core.sample.SampleBlockWithOrigin href "" "bioimageio.core.sample.SampleBlockWithOrigin"
click bioimageio.core.sample.SampleBlock href "" "bioimageio.core.sample.SampleBlock"
click bioimageio.core.sample.SampleBlockBase href "" "bioimageio.core.sample.SampleBlockBase"
A SampleBlock with a reference (origin) to the whole Sample
-
API Reference
samplesample_block_generator
Methods:
| Name | Description |
|---|---|
get_transformed_meta |
|
Attributes:
| Name | Type | Description |
|---|---|---|
block_index |
BlockIndex
|
the n-th block of the sample |
blocks |
Dict[MemberId, BlockT]
|
Individual tensor blocks comprising this sample block |
blocks_in_sample |
TotalNumberOfBlocks
|
total number of blocks in the sample |
inner_shape |
PerMember[PerAxis[int]]
|
|
members |
PerMember[Tensor]
|
the sample block's tensors |
origin |
Sample
|
the sample this sample block was taken from |
sample_id |
SampleId
|
identifier for the sample within its dataset |
sample_shape |
PerMember[PerAxis[int]]
|
the sample shape this block represents a part of |
shape |
PerMember[PerAxis[int]]
|
|
stat |
Stat
|
computed statistics |
blocks
instance-attribute
¤
Individual tensor blocks comprising this sample block
blocks_in_sample
instance-attribute
¤
blocks_in_sample: TotalNumberOfBlocks
total number of blocks in the sample
sample_shape
instance-attribute
¤
the sample shape this block represents a part of
get_transformed_meta
¤
get_transformed_meta(new_axes: PerMember[PerAxis[Union[LinearSampleAxisTransform, int]]]) -> SampleBlockMeta
Source code in src/bioimageio/core/sample.py
296 297 298 299 300 301 302 303 304 305 | |
sample_block_generator
¤
sample_block_generator(blocks: Iterable[PerMember[BlockMeta]], *, origin: Sample, pad_mode: PadMode) -> Iterable[SampleBlockWithOrigin]
Source code in src/bioimageio/core/sample.py
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 | |
sample_block_meta_generator
¤
sample_block_meta_generator(blocks: Iterable[PerMember[BlockMeta]], *, sample_shape: PerMember[PerAxis[int]], sample_id: SampleId)
Source code in src/bioimageio/core/sample.py
327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 | |