io
¤
Functions:
| Name | Description |
|---|---|
ensure_unzipped |
unzip a (downloaded) source to a file in folder if source is a zip archive |
get_suffix |
Deprecated use source.suffix instead. |
load_dataset_stat |
DEPRECATED alias for |
load_image |
load a single image as numpy array |
load_stat |
Load sample and dataset statistics from JSON |
load_tensor |
|
save_dataset_stat |
DEPRECATED alias for save_stat(): use |
save_sample |
Save a sample to a path pattern |
save_stat |
Save sample and dataset statistics as a JSON file |
save_tensor |
|
serialize_stat |
Serialize a stat mapping to a JSON string |
Attributes:
| Name | Type | Description |
|---|---|---|
JsonValue |
TypeAlias
|
|
Suffix |
|
JsonValue
module-attribute
¤
JsonValue: TypeAlias = Union[bool, int, float, str, None, List['JsonValue'], Dict[str, 'JsonValue']]
-
API Reference
ioserialize_stat
-
clientSerializedSampleBlock -
serializerSerializedSampleBlock -
API Reference
ioload_stat
ensure_unzipped
¤
ensure_unzipped(source: Union[PermissiveFileSource, ZipPath, BytesReader], folder: Path)
unzip a (downloaded) source to a file in folder if source is a zip archive otherwise copy source to a file in folder.
Source code in src/bioimageio/core/io.py
259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 | |
get_suffix
¤
get_suffix(source: Union[ZipPath, FileSource]) -> Suffix
Deprecated
use source.suffix instead.
Source code in src/bioimageio/core/io.py
288 289 290 | |
load_dataset_stat
¤
load_dataset_stat(path: Path) -> Stat
DEPRECATED alias for load_stat(): use load_stat() instead.
Source code in src/bioimageio/core/io.py
253 254 255 256 | |
load_image
¤
load_image(source: Union[PermissiveFileSource, ZipPath], is_volume: Optional[bool] = None) -> NDArray[Any]
load a single image as numpy array
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
Union[PermissiveFileSource, ZipPath]
|
image source |
required |
|
Optional[bool]
|
deprecated |
None
|
Source code in src/bioimageio/core/io.py
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | |
load_stat
¤
Load sample and dataset statistics from JSON
Source code in src/bioimageio/core/io.py
234 235 236 237 238 239 240 241 242 243 244 | |
load_tensor
¤
load_tensor(source: Union[PermissiveFileSource, ZipPath], /, axes: Optional[Sequence[AxisLike]] = None) -> Tensor
Source code in src/bioimageio/core/io.py
95 96 97 98 99 100 101 102 103 | |
save_dataset_stat
¤
save_dataset_stat(stat: Mapping[DatasetMeasure, MeasureValue], path: Path) -> None
DEPRECATED alias for save_stat(): use save_stats() instead.
Source code in src/bioimageio/core/io.py
247 248 249 250 | |
save_sample
¤
Save a sample to a path pattern or all sample members in the path mapping.
If path is a pathlib.Path or a string and the sample has multiple members,
path it must contain {member_id} (or {input_id} or {output_id}).
(Each) path may contain {sample_id} to be formatted with the sample object.
Source code in src/bioimageio/core/io.py
169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 | |
save_stat
¤
save_stat(stat: Mapping[Union[DatasetMeasure, SampleMeasure], MeasureValue], output: Union[Path, BytesIO]) -> None
Save sample and dataset statistics as a JSON file
Source code in src/bioimageio/core/io.py
219 220 221 222 223 224 225 226 227 228 229 230 231 | |
save_tensor
¤
save_tensor(path: Union[Path, str], tensor: Tensor) -> None
Source code in src/bioimageio/core/io.py
111 112 113 114 115 116 117 118 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 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 | |
serialize_stat
¤
serialize_stat(stat: Mapping[Union[DatasetMeasure, SampleMeasure], MeasureValue]) -> List[JsonValue]
Serialize a stat mapping to a JSON string
Source code in src/bioimageio/core/io.py
211 212 213 214 215 216 | |