Import and export tasks
Import task
plantseg.tasks.io_tasks.import_image_task(input_path: Path, semantic_type: str, stack_layout: str, image_name: str | None = None, key: str | None = None, m_slicing: str | None = None) -> PlantSegImage
Task wrapper creating a PlantSegImage object from an image file.
Parameters:
-
input_path
(Path
) –path to the image file
-
semantic_type
(str
) –semantic type of the image (raw, segmentation, prediction)
-
stack_layout
(str
) –stack layout of the image (3D, 2D, 2D_time)
-
image_name
(str
, default:None
) –name of the image, if None the name will be the same as the file name
-
key
(str | None
, default:None
) –key for the image (used only for h5 and zarr formats)
-
m_slicing
(str | None
, default:None
) –m_slicing of the image (None, time, z, y, x)
Source code in plantseg/tasks/io_tasks.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
|
Export task
plantseg.tasks.io_tasks.export_image_task(image: PlantSegImage, export_directory: Path, name_pattern: str = '{file_name}_export', key: str | None = None, scale_to_origin: bool = True, export_format: str = 'tiff', data_type: str = 'uint16') -> None
Task wrapper for saving an PlantSegImage object to disk.
Parameters:
-
image
(PlantSegImage
) –input image to be saved to disk
-
export_directory
(Path
) –output directory path where the image will be saved
-
name_pattern
(str
, default:'{file_name}_export'
) –output file name pattern, can contain the {image_name} or {file_name} tokens to be replaced in the final file name.
-
key
(str | None
, default:None
) –key for the image (used only for h5 and zarr formats).
-
scale_to_origin
(bool
, default:True
) –scale the voxel size to the original one
-
export_format
(str
, default:'tiff'
) –file format (tiff, h5, zarr)
-
data_type
(str
, default:'uint16'
) –data type to save the image.
Source code in plantseg/tasks/io_tasks.py
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 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
|