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 |
|
|
Suffix |
|
JsonValue
module-attribute
¤
JsonValue = Union[bool, int, float, str, None, List['JsonValue'], Dict[str, 'JsonValue']]
-
API Reference
ioserialize_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
246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 | |
get_suffix
¤
get_suffix(source: Union[ZipPath, FileSource]) -> Suffix
Deprecated
use source.suffix instead.
Source code in src/bioimageio/core/io.py
275 276 277 | |
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
240 241 242 243 | |
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
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | |
load_stat
¤
Load sample and dataset statistics from JSON
Source code in src/bioimageio/core/io.py
221 222 223 224 225 226 227 228 229 230 231 | |
load_tensor
¤
load_tensor(source: Union[PermissiveFileSource, ZipPath], /, axes: Optional[Sequence[AxisLike]] = None) -> Tensor
Source code in src/bioimageio/core/io.py
82 83 84 85 86 87 88 89 90 | |
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
234 235 236 237 | |
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
156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 | |
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
206 207 208 209 210 211 212 213 214 215 216 217 218 | |
save_tensor
¤
save_tensor(path: Union[Path, str], tensor: Tensor) -> None
Source code in src/bioimageio/core/io.py
98 99 100 101 102 103 104 105 106 107 108 109 110 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 | |
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
198 199 200 201 202 203 | |