infer_subc/core/file_io
Helpers for file input and output
AICSImageReaderWrap
dataclass
Simple dataclass wrapper for the AICSImage output to prepare for imprting to our bioim class TODO: make a nice reppr
Source code in infer_subc/core/file_io.py
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 |
|
etree_to_dict(t)
etree dumper from stackoverflow use to dump meta_dict[metadata][raw_image_metadata]
Source code in infer_subc/core/file_io.py
302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 |
|
export_inferred_organelle(img_out, name, meta_dict, out_data_path)
write inferred organelle to ome.tif file
Parameters
img_out
a 3d np.ndarray image of the inferred organelle (labels or boolean)
str
name of organelle. i.e. nuc, lyso, etc.
out_data_path
Path object where tiffs are written to
Returns
exported file name
Source code in infer_subc/core/file_io.py
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 |
|
export_inferred_organelle_AICS(img_out, name, meta_dict, out_data_path)
write inferred organelle to ome.tif file with AICSIMAGEIO
Parameters
img_out
a 3d np.ndarray image of the inferred organelle (labels or boolean)
str
name of organelle. i.e. nuc, lyso, etc.
out_data_path
Path object where tiffs are written to
Returns
exported file name
Source code in infer_subc/core/file_io.py
400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 |
|
export_inferred_organelle_stack(img_out, layer_names, meta_dict, data_root_path)
stack all the inferred objects and stack along 0 dimension
Source code in infer_subc/core/file_io.py
254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 |
|
export_ndarray(data_in, img_name, out_path)
data_in: types.ArrayLike,
meta_in: dict,
img_name: types.PathLike,
out_path: types.PathLike,
curr_chan: int
assumes a single image
Source code in infer_subc/core/file_io.py
348 349 350 351 352 353 354 355 356 357 358 359 |
|
export_tiff(data_in, img_name, out_path, channel_names=None, meta_in=None)
wrapper for exporting tiff with tifffile.imwrite --> usiong AICSimage is too slow prsumably handling the OME meta data is what is so slow.
Source code in infer_subc/core/file_io.py
61 62 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 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
|
export_tiff_AICS(data_in, img_name, out_path, channel_names=None, meta_in=None)
aicssegmentation way to do it
Source code in infer_subc/core/file_io.py
452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 |
|
get_raw_meta_data(meta_dict)
not sure why the linux backend works for ome... need to solve
Source code in infer_subc/core/file_io.py
326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 |
|
import_inferred_organelle(name, meta_dict, out_data_path)
read inferred organelle from ome.tif file
Parameters
str
name of organelle. i.e. nuc, lyso, etc.
out_data_path
Path object of directory where tiffs are read from
Returns
exported file name
Source code in infer_subc/core/file_io.py
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 |
|
import_inferred_organelle_AICS(name, meta_dict, out_data_path)
read inferred organelle from ome.tif file with AICSIMAGEIO
Parameters
str
name of organelle. i.e. nuc, lyso, etc.
out_data_path
Path object of directory where tiffs are read from
Returns
exported file name
Source code in infer_subc/core/file_io.py
364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 |
|
list_image_files(data_folder, file_type, postfix=None)
get a list of all the filetypes TODO: aics has cleaner functions than this "lambda" should this use Path methods? or return Path?
Source code in infer_subc/core/file_io.py
120 121 122 123 124 125 126 127 128 129 130 |
|
read_czi_image(image_name)
return output from napari aiscioimage reader (alias for read_ome_image)
Source code in infer_subc/core/file_io.py
40 41 42 43 44 |
|
read_input_image(image_name)
send output from napari aiscioimage reader wrapped in dataclass
Source code in infer_subc/core/file_io.py
146 147 148 149 150 151 |
|
read_ome_image(image_name)
return output from napari aiscioimage reader
Source code in infer_subc/core/file_io.py
30 31 32 33 34 35 36 37 |
|
read_tiff_image(image_name)
return tiff image with tifffile.imread. Using the reader_function
(vial read_ome_image) and AICSimage is too slow
prsumably handling the OME meta data is what is so slow.
Source code in infer_subc/core/file_io.py
47 48 49 50 51 52 53 54 55 56 57 58 |
|
read_tiff_image_AICS(image_name)
aicssegmentation way to do it
Source code in infer_subc/core/file_io.py
433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 |
|