References
convert(input_filename, output_folder, alt_output_folder=None, output_format=None, show_progress=False, verbose=False, max_attempts=RETRY_ATTEMPTS, **kwargs)
Source code in converter.py
33 34 35 36 37 38 39 40 41 42 43 44 45 | |
init_logging(log_filename, verbose=False)
Initialize logging to file and optionally to console.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
log_filename
|
str
|
Path to the log file. |
required |
verbose
|
bool
|
If True, also log to console. |
False
|
Source code in converter.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | |
DbReader
DbReader
Reads and queries a SQLite database, returning results as dictionaries.
Source code in src/DbReader.py
4 5 6 7 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 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | |
conn = sqlite3.connect(db_file)
instance-attribute
__init__(db_file)
Initialize DBReader with a database file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
db_file
|
str
|
Path to the SQLite database file. |
required |
Source code in src/DbReader.py
9 10 11 12 13 14 15 16 17 | |
close()
Closes the database connection.
Source code in src/DbReader.py
60 61 62 63 64 | |
dict_factory(cursor, row)
staticmethod
Converts a database row to a dictionary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cursor
|
SQLite cursor object. |
required | |
row
|
Row data. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
Mapping column names to values. |
Source code in src/DbReader.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | |
fetch_all(query, params=[], return_dicts=True)
Executes a query and fetches all results.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
str
|
SQL query string. |
required |
params
|
list
|
Query parameters. |
[]
|
return_dicts
|
bool
|
If True, returns list of dicts; else, returns first column values. |
True
|
Returns:
| Name | Type | Description |
|---|---|---|
list |
Query results. |
Source code in src/DbReader.py
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | |
list_tables()
Source code in src/DbReader.py
57 58 | |
DicomSource
DicomSource
Bases: ImageSource
ImageSource subclass for reading DICOM files using pydicom.
Source code in src/DicomSource.py
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 49 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 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 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 | |
dicom = dcmread(uri)
instance-attribute
filenames = [uri]
instance-attribute
__init__(uri, metadata={})
Source code in src/DicomSource.py
17 18 19 20 21 22 23 24 | |
get_acquisition_datetime()
Source code in src/DicomSource.py
120 121 | |
get_acquisitions()
Source code in src/DicomSource.py
141 142 | |
get_channels()
Source code in src/DicomSource.py
100 101 102 103 104 105 106 | |
get_columns()
Source code in src/DicomSource.py
132 133 | |
get_data(dim_order, level=0, well_id=None, field_id=None, **kwargs)
Source code in src/DicomSource.py
144 145 146 147 148 149 150 151 152 | |
get_dim_order()
Source code in src/DicomSource.py
97 98 | |
get_dtype()
Source code in src/DicomSource.py
91 92 | |
get_fields()
Source code in src/DicomSource.py
138 139 | |
get_name()
Source code in src/DicomSource.py
82 83 | |
get_nchannels()
Source code in src/DicomSource.py
108 109 | |
get_pixel_size_um()
Source code in src/DicomSource.py
111 112 | |
get_position_um(well_id=None)
Source code in src/DicomSource.py
114 115 116 117 118 | |
get_rows()
Source code in src/DicomSource.py
129 130 | |
get_scales()
Source code in src/DicomSource.py
94 95 | |
get_shape()
Source code in src/DicomSource.py
85 86 | |
get_shapes()
Source code in src/DicomSource.py
88 89 | |
get_significant_bits()
Source code in src/DicomSource.py
123 124 | |
get_time_points()
Source code in src/DicomSource.py
126 127 | |
get_wells()
Source code in src/DicomSource.py
135 136 | |
init_metadata()
Source code in src/DicomSource.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | |
is_rgb()
Source code in src/DicomSource.py
79 80 | |
is_screen()
Source code in src/DicomSource.py
75 76 77 | |
GenericSource
GenericSource
Bases: ImageSource
Source code in src/GenericSource.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 | |
data_func = im.read
instance-attribute
format = os.path.splitext(uri)[1].lower().lstrip('.')
instance-attribute
metadata = im.metadata()
instance-attribute
__init__(uri, **kwargs)
Source code in src/GenericSource.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | |
get_data(**kwargs)
Source code in src/GenericSource.py
36 37 | |
init_metadata()
Source code in src/GenericSource.py
33 34 | |
ISyntaxSource
OME_DIR = 'OME'
module-attribute
OME_FILE = 'METADATA.ome.xml'
module-attribute
PYRAMID_DOWNSCALE = 2
module-attribute
PYRAMID_LEVELS = 6
module-attribute
RETRY_ATTEMPTS = 3
module-attribute
TIFF_COMPRESSION = 'LZW'
module-attribute
TILE_SIZE = 1024
module-attribute
VERSION = 'v0.1.24'
module-attribute
ZARR_CHUNK_SIZE = TILE_SIZE
module-attribute
ZARR_SHARD_MULTIPLIER = 10
module-attribute
ISyntaxSource
Bases: ImageSource
Loads image and metadata from ISyntax format files.
Source code in src/ISyntaxSource.py
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 49 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 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 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 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 | |
close()
Source code in src/ISyntaxSource.py
184 185 186 | |
get_acquisition_datetime()
Source code in src/ISyntaxSource.py
178 179 | |
get_acquisitions()
Source code in src/ISyntaxSource.py
175 176 | |
get_channels()
Source code in src/ISyntaxSource.py
145 146 147 148 149 150 151 152 | |
get_columns()
Source code in src/ISyntaxSource.py
163 164 | |
get_data(dim_order, level=0, well_id=None, field_id=None, **kwargs)
Source code in src/ISyntaxSource.py
96 97 98 | |
get_data_as_dask(dim_order, level=0, **kwargs)
Source code in src/ISyntaxSource.py
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | |
get_data_as_generator(dim_order, **kwargs)
Source code in src/ISyntaxSource.py
117 118 119 120 121 122 123 124 125 126 127 128 | |
get_dim_order()
Source code in src/ISyntaxSource.py
133 134 | |
get_dtype()
Source code in src/ISyntaxSource.py
139 140 | |
get_fields()
Source code in src/ISyntaxSource.py
172 173 | |
get_name()
Source code in src/ISyntaxSource.py
130 131 | |
get_nchannels()
Source code in src/ISyntaxSource.py
154 155 | |
get_pixel_size_um()
Source code in src/ISyntaxSource.py
136 137 | |
get_position_um(well_id=None)
Source code in src/ISyntaxSource.py
142 143 | |
get_rows()
Source code in src/ISyntaxSource.py
160 161 | |
get_scales()
Source code in src/ISyntaxSource.py
87 88 | |
get_shape()
Source code in src/ISyntaxSource.py
81 82 | |
get_shapes()
Source code in src/ISyntaxSource.py
84 85 | |
get_significant_bits()
Source code in src/ISyntaxSource.py
181 182 | |
get_time_points()
Source code in src/ISyntaxSource.py
169 170 | |
get_wells()
Source code in src/ISyntaxSource.py
166 167 | |
init_metadata()
Source code in src/ISyntaxSource.py
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 49 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 | |
is_rgb()
Source code in src/ISyntaxSource.py
157 158 | |
is_screen()
Source code in src/ISyntaxSource.py
78 79 | |
read_array(x, y, width, height, level=0)
Source code in src/ISyntaxSource.py
90 91 92 93 94 | |
ImageDbSource
ImageDbSource
Bases: ImageSource
Loads image and metadata from a database source for high-content screening.
Source code in src/ImageDbSource.py
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 49 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 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 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 167 168 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 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 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 | |
data = None
instance-attribute
data_level = None
instance-attribute
data_well_id = None
instance-attribute
db = DbReader(self.uri)
instance-attribute
dim_order = 'tczyx'
instance-attribute
__init__(uri, metadata={})
Source code in src/ImageDbSource.py
17 18 19 20 21 22 23 | |
close()
Closes the database connection.
Source code in src/ImageDbSource.py
381 382 383 384 385 | |
get_acquisition_datetime()
Source code in src/ImageDbSource.py
349 350 | |
get_acquisitions()
Source code in src/ImageDbSource.py
337 338 339 340 341 342 343 344 345 346 347 | |
get_channels()
Source code in src/ImageDbSource.py
314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 | |
get_columns()
Source code in src/ImageDbSource.py
287 288 | |
get_data(dim_order, level=0, well_id=None, field_id=None, **kwargs)
Source code in src/ImageDbSource.py
271 272 273 274 275 276 | |
get_dim_order()
Source code in src/ImageDbSource.py
299 300 | |
get_dtype()
Source code in src/ImageDbSource.py
302 303 | |
get_fields()
Source code in src/ImageDbSource.py
296 297 | |
get_microscope_info()
Source code in src/ImageDbSource.py
378 379 | |
get_name()
Source code in src/ImageDbSource.py
278 279 280 281 282 | |
get_nchannels()
Source code in src/ImageDbSource.py
331 332 | |
get_pixel_size_um()
Source code in src/ImageDbSource.py
305 306 | |
get_position_um(well_id=None, level=0)
Source code in src/ImageDbSource.py
308 309 310 311 312 | |
get_rows()
Source code in src/ImageDbSource.py
284 285 | |
get_scales()
Source code in src/ImageDbSource.py
39 40 | |
get_shape()
Source code in src/ImageDbSource.py
33 34 | |
get_shapes()
Source code in src/ImageDbSource.py
36 37 | |
get_significant_bits()
Source code in src/ImageDbSource.py
352 353 | |
get_time_points()
Source code in src/ImageDbSource.py
293 294 | |
get_wells()
Source code in src/ImageDbSource.py
290 291 | |
init_metadata()
Source code in src/ImageDbSource.py
25 26 27 28 29 30 31 | |
is_rgb()
Source code in src/ImageDbSource.py
334 335 | |
is_screen()
Source code in src/ImageDbSource.py
268 269 | |
print_timepoint_well_matrix()
Source code in src/ImageDbSource.py
355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 | |
camel_to_snake(name)
Source code in src/util.py
204 205 206 | |
camel_to_snake_keys_dict(dct)
Source code in src/util.py
196 197 198 199 200 201 | |
convert_dotnet_ticks_to_datetime(net_ticks)
Source code in src/util.py
149 150 | |
convert_to_um(value, unit)
Source code in src/util.py
209 210 211 212 213 214 215 216 217 | |
ensure_list(item)
Source code in src/util.py
7 8 9 10 | |
get_bits_type(nbits)
Source code in src/util.py
64 65 66 67 68 69 70 71 72 73 | |
get_filetitle(filename)
Source code in src/util.py
80 81 | |
get_level_from_scale(source_scales, target_scale=1)
Source code in src/util.py
54 55 56 57 58 59 60 61 | |
get_numpy_data(data, dim_order, t, c, z, y, x, y_size, x_size)
Source code in src/util.py
39 40 41 42 43 44 45 46 47 48 49 50 51 | |
get_rows_cols_plate(nwells)
Source code in src/util.py
134 135 136 137 138 139 140 141 142 143 144 145 146 | |
pad_leading_zero(input_string, num_digits=2)
Source code in src/util.py
116 117 118 119 120 121 122 123 124 125 126 | |
print_dict(value, tab=0, max_len=250, bullet=False)
Source code in src/util.py
220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 | |
print_hbytes(nbytes)
Source code in src/util.py
244 245 246 247 248 249 250 251 252 253 254 255 | |
redimension_data(data, old_order, new_order, **indices)
Source code in src/util.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | |
split_well_name(well_name, remove_leading_zeros=True, col_as_int=False)
Source code in src/util.py
100 101 102 103 104 105 106 107 108 109 110 111 112 113 | |
splitall(path)
Source code in src/util.py
84 85 86 87 88 89 90 91 92 93 94 95 96 97 | |
strip_leading_zeros(well_name)
Source code in src/util.py
129 130 131 | |
validate_filename(filename)
Source code in src/util.py
76 77 | |
xml_content_to_dict(element)
Source code in src/util.py
153 154 155 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 183 184 185 186 187 188 189 190 191 192 193 | |
ImageSource
ImageSource
Bases: ABC
Abstract base class for image sources.
Source code in src/ImageSource.py
7 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 49 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 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 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 167 168 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 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 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 | |
metadata = metadata
instance-attribute
uri = uri
instance-attribute
__init__(uri, metadata={})
Initialize ImageSource.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
uri
|
str
|
Path to the image source. |
required |
metadata
|
dict
|
Optional metadata dictionary. |
{}
|
Source code in src/ImageSource.py
12 13 14 15 16 17 18 19 20 21 | |
close()
Close the image source.
Source code in src/ImageSource.py
290 291 292 293 294 | |
get_acquisition_datetime()
Get the acquisition datetime.
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
Must be implemented by subclasses. |
Source code in src/ImageSource.py
250 251 252 253 254 255 256 257 | |
get_acquisitions()
Get acquisition metadata.
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
Must be implemented by subclasses. |
Source code in src/ImageSource.py
241 242 243 244 245 246 247 248 | |
get_channels()
Get channel metadata in NGFF format, color provided as RGBA list with values between 0 and 1 e.g. white = [1, 1, 1, 1]
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
Must be implemented by subclasses. |
Source code in src/ImageSource.py
171 172 173 174 175 176 177 178 179 | |
get_columns()
Get the list of column identifiers.
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
Must be implemented by subclasses. |
Source code in src/ImageSource.py
205 206 207 208 209 210 211 212 | |
get_data(dim_order, level=0, well_id=None, field_id=None, **kwargs)
Get image data for a well and field.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dim_order
|
Dimension order of data |
required | |
level
|
int
|
Image resolution level |
0
|
well_id
|
str
|
Well identifier |
None
|
field_id
|
int
|
Field identifier |
None
|
kwargs
|
optional
|
Format specific keyword arguments. |
{}
|
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
Must be implemented by subclasses. |
Source code in src/ImageSource.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | |
get_data_as_dask(dim_order, level=0, **kwargs)
Get image data (WSI) as dask array.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dim_order
|
Dimension order of data |
required | |
level
|
int
|
Image resolution level |
0
|
kwargs
|
optional
|
Format specific keyword arguments. |
{}
|
Source code in src/ImageSource.py
84 85 86 87 88 89 90 91 92 93 | |
get_data_as_generator(dim_order, **kwargs)
Get image data (WSI) as generator.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dim_order
|
Dimension order of data |
required | |
kwargs
|
optional
|
Format specific keyword arguments. |
{}
|
Source code in src/ImageSource.py
95 96 97 98 99 100 101 102 103 | |
get_dim_order()
Get the dimension order string.
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
Must be implemented by subclasses. |
Source code in src/ImageSource.py
135 136 137 138 139 140 141 142 | |
get_dtype()
Get the numpy dtype of the image data.
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
Must be implemented by subclasses. |
Source code in src/ImageSource.py
144 145 146 147 148 149 150 151 | |
get_fields()
Get the list of field indices.
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
Must be implemented by subclasses. |
Source code in src/ImageSource.py
232 233 234 235 236 237 238 239 | |
get_image_window(window_scanner, well_id=None, field_id=None, data=None)
Get image value range window (for a well & field or from provided data).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
window_scanner
|
WindowScanner
|
WindowScanner object to compute window. |
required |
well_id
|
str
|
Well identifier |
None
|
field_id
|
int
|
Field identifier |
None
|
data
|
ndarray
|
Image data to compute window from. |
None
|
Source code in src/ImageSource.py
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | |
get_microscope_info()
Get microscope information. This can include details such as the microscope model, objective lens, and other relevant information.
Source code in src/ImageSource.py
268 269 270 271 272 | |
get_name()
Get the name of the image source.
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
Must be implemented by subclasses. |
Source code in src/ImageSource.py
126 127 128 129 130 131 132 133 | |
get_nchannels()
Get the number of channels.
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
Must be implemented by subclasses. |
Source code in src/ImageSource.py
181 182 183 184 185 186 187 188 | |
get_pixel_size_um()
Get the pixel size in micrometers.
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
Must be implemented by subclasses. |
Source code in src/ImageSource.py
153 154 155 156 157 158 159 160 | |
get_position_um(well_id=None)
Get the position in micrometers for a well.
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
Must be implemented by subclasses. |
Source code in src/ImageSource.py
162 163 164 165 166 167 168 169 | |
get_rows()
Get the list of row identifiers.
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
Must be implemented by subclasses. |
Source code in src/ImageSource.py
196 197 198 199 200 201 202 203 | |
get_scales()
Get the list of image scales.
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
Must be implemented by subclasses. |
Source code in src/ImageSource.py
59 60 61 62 63 64 65 66 | |
get_shape()
Get the shape of the image data.
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
Must be implemented by subclasses. |
Source code in src/ImageSource.py
41 42 43 44 45 46 47 48 | |
get_shapes()
Get a list of shapes corresponding to the image data levels.
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
Must be implemented by subclasses. |
Source code in src/ImageSource.py
50 51 52 53 54 55 56 57 | |
get_significant_bits()
Get the number of significant bits in the image data.
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
Must be implemented by subclasses. |
Source code in src/ImageSource.py
259 260 261 262 263 264 265 266 | |
get_time_points()
Get the list of time points.
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
Must be implemented by subclasses. |
Source code in src/ImageSource.py
223 224 225 226 227 228 229 230 | |
get_total_data_size()
Get the estimated total data size.
Returns:
| Name | Type | Description |
|---|---|---|
int |
Total data size in bytes. |
Source code in src/ImageSource.py
274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 | |
get_wells()
Get the list of well identifiers.
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
Must be implemented by subclasses. |
Source code in src/ImageSource.py
214 215 216 217 218 219 220 221 | |
init_metadata()
Initialize and load metadata.
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
Must be implemented by subclasses. |
Source code in src/ImageSource.py
23 24 25 26 27 28 29 30 | |
is_rgb()
Check if the source is a RGB(A) image.
Source code in src/ImageSource.py
190 191 192 193 194 | |
is_screen()
Check if the source is a screen (multi-well).
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
Must be implemented by subclasses. |
Source code in src/ImageSource.py
32 33 34 35 36 37 38 39 | |
print_well_matrix()
Print a matrix representation of the well plate.
Source code in src/ImageSource.py
296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 | |
IncucyteSource
IncucyteSource
Bases: ImageSource
ImageSource implementation for Incucyte data
Handles the specific directory structure: EssenFiles/ScanData/YYMM/DD/HHMM/XXXX/*.tif
Filenames follow pattern: WELL-FIELD-CHANNEL.tif e.g., A1-1-C1.tif, B2-1-Ph.tif
Note: Multiple plates can exist in the same archive, identified by the XXXX folder. Use plate_id parameter to select a specific plate, or use get_available_plates() to discover all plates in the archive.
Source code in src/IncucyteSource.py
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 49 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 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 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 167 168 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 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 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 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 398 399 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 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 | |
DIAG_LOG_FILENAME = 'Diag.log'
class-attribute
instance-attribute
DIAG_ZIP_FILENAME = 'Diag.zip'
class-attribute
instance-attribute
base_path = Path(self.uri)
instance-attribute
fill_missing_images = True
instance-attribute
plate_id = plate_id
instance-attribute
scan_data_path = self.base_path / 'EssenFiles' / 'ScanData'
instance-attribute
__init__(uri, metadata={}, plate_id=None)
Initialize IncucyteSource.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
uri
|
str
|
Path to the Incucyte archive folder |
required |
metadata
|
dict
|
Optional metadata dictionary |
{}
|
plate_id
|
str
|
Specific plate ID to process (e.g., '700', '701'). If None, will use the first available plate or all if only one exists. |
None
|
Source code in src/IncucyteSource.py
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | |
close()
Clean up resources
Source code in src/IncucyteSource.py
805 806 807 | |
enable_file_caching(file_caching=True)
Enable or disable file caching for image data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_caching
|
bool
|
If True, enable file caching; if False, disable it. |
True
|
Source code in src/IncucyteSource.py
89 90 91 92 93 94 95 96 97 98 | |
get_acquisition_datetime()
Source code in src/IncucyteSource.py
739 740 741 742 743 | |
get_acquisitions()
Return acquisition information based on timepoints
Source code in src/IncucyteSource.py
721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 | |
get_available_plates(uri)
staticmethod
Discover all available plate IDs in an Incucyte archive.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
uri
|
str
|
Path to the Incucyte archive folder |
required |
Returns:
| Name | Type | Description |
|---|---|---|
list |
List of plate IDs (strings) found in the archive |
Source code in src/IncucyteSource.py
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 | |
get_channels()
Source code in src/IncucyteSource.py
696 697 | |
get_columns()
Source code in src/IncucyteSource.py
705 706 | |
get_data(dim_order, level=0, well_id=None, field_id=None, **kwargs)
Get data for a specific well and field
Source code in src/IncucyteSource.py
638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 | |
get_dim_order()
Source code in src/IncucyteSource.py
680 681 | |
get_dtype()
Source code in src/IncucyteSource.py
683 684 | |
get_fields()
Source code in src/IncucyteSource.py
714 715 | |
get_name()
Source code in src/IncucyteSource.py
677 678 | |
get_nchannels()
Source code in src/IncucyteSource.py
699 700 | |
get_pixel_size_um()
Source code in src/IncucyteSource.py
686 687 | |
get_position_um(well_id=None)
Source code in src/IncucyteSource.py
689 690 691 692 693 694 | |
get_rows()
Source code in src/IncucyteSource.py
702 703 | |
get_scales()
Source code in src/IncucyteSource.py
674 675 | |
get_shape()
Source code in src/IncucyteSource.py
671 672 | |
get_significant_bits()
Source code in src/IncucyteSource.py
745 746 | |
get_time_points()
Source code in src/IncucyteSource.py
711 712 | |
get_total_data_size()
Source code in src/IncucyteSource.py
748 749 | |
get_well_coords_um(well_id)
Get well coordinates (placeholder - Incucyte doesn't typically have stage coordinates)
Source code in src/IncucyteSource.py
717 718 719 | |
get_wells()
Source code in src/IncucyteSource.py
708 709 | |
init_metadata()
Initialize all metadata from Incucyte structure
Source code in src/IncucyteSource.py
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 | |
is_rgb()
Check if the source is a RGB(A) image. Incucyte data stores channels separately, not as RGB.
Source code in src/IncucyteSource.py
798 799 800 801 802 803 | |
is_screen()
Source code in src/IncucyteSource.py
635 636 | |
print_timepoint_well_matrix()
Print timepoint vs well matrix
Source code in src/IncucyteSource.py
773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 | |
print_well_matrix()
Print a visual representation of the plate layout
Source code in src/IncucyteSource.py
751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 | |
MiraxSource
OME_DIR = 'OME'
module-attribute
OME_FILE = 'METADATA.ome.xml'
module-attribute
PYRAMID_DOWNSCALE = 2
module-attribute
PYRAMID_LEVELS = 6
module-attribute
RETRY_ATTEMPTS = 3
module-attribute
TIFF_COMPRESSION = 'LZW'
module-attribute
TILE_SIZE = 1024
module-attribute
VERSION = 'v0.1.24'
module-attribute
ZARR_CHUNK_SIZE = TILE_SIZE
module-attribute
ZARR_SHARD_MULTIPLIER = 10
module-attribute
MiraxSource
Bases: ImageSource
ImageSource subclass for reading Mirax files using OpenSlide.
Source code in src/MiraxSource.py
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 49 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 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 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 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | |
slide = openslide.open_slide(uri)
instance-attribute
__init__(uri, metadata={})
Source code in src/MiraxSource.py
21 22 23 | |
close()
Source code in src/MiraxSource.py
180 181 | |
get_acquisition_datetime()
Source code in src/MiraxSource.py
174 175 | |
get_acquisitions()
Source code in src/MiraxSource.py
171 172 | |
get_channels()
Source code in src/MiraxSource.py
141 142 143 144 145 146 147 148 | |
get_columns()
Source code in src/MiraxSource.py
159 160 | |
get_data(dim_order, level=0, well_id=None, field_id=None, **kwargs)
Source code in src/MiraxSource.py
91 92 93 | |
get_data_as_dask(dim_order, level=0, **kwargs)
Source code in src/MiraxSource.py
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | |
get_data_as_generator(dim_order, **kwargs)
Source code in src/MiraxSource.py
112 113 114 115 116 117 118 119 120 121 122 123 | |
get_dim_order()
Source code in src/MiraxSource.py
128 129 | |
get_dtype()
Source code in src/MiraxSource.py
131 132 | |
get_fields()
Source code in src/MiraxSource.py
168 169 | |
get_name()
Source code in src/MiraxSource.py
125 126 | |
get_nchannels()
Source code in src/MiraxSource.py
150 151 | |
get_pixel_size_um()
Source code in src/MiraxSource.py
134 135 | |
get_position_um(well_id=None)
Source code in src/MiraxSource.py
137 138 139 | |
get_rows()
Source code in src/MiraxSource.py
156 157 | |
get_scales()
Source code in src/MiraxSource.py
75 76 | |
get_shape()
Source code in src/MiraxSource.py
69 70 | |
get_shapes()
Source code in src/MiraxSource.py
72 73 | |
get_significant_bits()
Source code in src/MiraxSource.py
177 178 | |
get_time_points()
Source code in src/MiraxSource.py
165 166 | |
get_wells()
Source code in src/MiraxSource.py
162 163 | |
init_metadata()
Source code in src/MiraxSource.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | |
is_rgb()
Source code in src/MiraxSource.py
153 154 | |
is_screen()
Source code in src/MiraxSource.py
65 66 67 | |
read_array(x, y, width, height, level=0)
Source code in src/MiraxSource.py
81 82 83 84 85 86 87 88 89 | |
OmeTiffWriter
OME_DIR = 'OME'
module-attribute
OME_FILE = 'METADATA.ome.xml'
module-attribute
PYRAMID_DOWNSCALE = 2
module-attribute
PYRAMID_LEVELS = 6
module-attribute
RETRY_ATTEMPTS = 3
module-attribute
TIFF_COMPRESSION = 'LZW'
module-attribute
TILE_SIZE = 1024
module-attribute
VERSION = 'v0.1.24'
module-attribute
ZARR_CHUNK_SIZE = TILE_SIZE
module-attribute
ZARR_SHARD_MULTIPLIER = 10
module-attribute
OmeTiffWriter
Bases: OmeWriter
Writes image data and metadata to OME-TIFF files.
Source code in src/OmeTiffWriter.py
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 49 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 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 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 167 168 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 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 | |
verbose = verbose
instance-attribute
__init__(verbose=False)
Initialize OmeTiffWriter.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
verbose
|
bool
|
If True, prints progress info. |
False
|
Source code in src/OmeTiffWriter.py
19 20 21 22 23 24 25 26 27 | |
write(filepath, source, **kwargs)
Writes image or screen data to OME-TIFF files.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filepath
|
str
|
Output file path. |
required |
source
|
ImageSource
|
Source object. |
required |
**kwargs
|
Additional options (e.g. wells selection). |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
dict |
Containing output_path: str or list Output file path(s) and data window. |
Source code in src/OmeTiffWriter.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | |
camel_to_snake(name)
Source code in src/util.py
204 205 206 | |
camel_to_snake_keys_dict(dct)
Source code in src/util.py
196 197 198 199 200 201 | |
convert_dotnet_ticks_to_datetime(net_ticks)
Source code in src/util.py
149 150 | |
convert_to_um(value, unit)
Source code in src/util.py
209 210 211 212 213 214 215 216 217 | |
ensure_list(item)
Source code in src/util.py
7 8 9 10 | |
get_bits_type(nbits)
Source code in src/util.py
64 65 66 67 68 69 70 71 72 73 | |
get_filetitle(filename)
Source code in src/util.py
80 81 | |
get_level_from_scale(source_scales, target_scale=1)
Source code in src/util.py
54 55 56 57 58 59 60 61 | |
get_numpy_data(data, dim_order, t, c, z, y, x, y_size, x_size)
Source code in src/util.py
39 40 41 42 43 44 45 46 47 48 49 50 51 | |
get_rows_cols_plate(nwells)
Source code in src/util.py
134 135 136 137 138 139 140 141 142 143 144 145 146 | |
pad_leading_zero(input_string, num_digits=2)
Source code in src/util.py
116 117 118 119 120 121 122 123 124 125 126 | |
print_dict(value, tab=0, max_len=250, bullet=False)
Source code in src/util.py
220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 | |
print_hbytes(nbytes)
Source code in src/util.py
244 245 246 247 248 249 250 251 252 253 254 255 | |
redimension_data(data, old_order, new_order, **indices)
Source code in src/util.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | |
split_well_name(well_name, remove_leading_zeros=True, col_as_int=False)
Source code in src/util.py
100 101 102 103 104 105 106 107 108 109 110 111 112 113 | |
splitall(path)
Source code in src/util.py
84 85 86 87 88 89 90 91 92 93 94 95 96 97 | |
strip_leading_zeros(well_name)
Source code in src/util.py
129 130 131 | |
validate_filename(filename)
Source code in src/util.py
76 77 | |
xml_content_to_dict(element)
Source code in src/util.py
153 154 155 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 183 184 185 186 187 188 189 190 191 192 193 | |
OmeWriter
OmeWriter
Bases: ABC
Abstract base class for OME writers.
Source code in src/OmeWriter.py
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | |
write(filepath, source, verbose=False, **kwargs)
Write image data and metadata to output.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filepath
|
str
|
Output file path. |
required |
source
|
ImageSource
|
Source object. |
required |
verbose
|
bool
|
If True, prints progress info. |
False
|
**kwargs
|
Additional options. |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
dict |
str
|
Containing output_path: str or list Output file path(s), and other optional output. |
Source code in src/OmeWriter.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | |
OmeZarrSource
OME_DIR = 'OME'
module-attribute
OME_FILE = 'METADATA.ome.xml'
module-attribute
PYRAMID_DOWNSCALE = 2
module-attribute
PYRAMID_LEVELS = 6
module-attribute
RETRY_ATTEMPTS = 3
module-attribute
TIFF_COMPRESSION = 'LZW'
module-attribute
TILE_SIZE = 1024
module-attribute
VERSION = 'v0.1.24'
module-attribute
ZARR_CHUNK_SIZE = TILE_SIZE
module-attribute
ZARR_SHARD_MULTIPLIER = 10
module-attribute
OmeZarrSource
Bases: ImageSource
Source code in src/OmeZarrSource.py
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 49 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 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 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 167 168 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 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 | |
get_acquisition_datetime()
Source code in src/OmeZarrSource.py
206 207 | |
get_acquisitions()
Source code in src/OmeZarrSource.py
203 204 | |
get_channels()
Source code in src/OmeZarrSource.py
178 179 | |
get_columns()
Source code in src/OmeZarrSource.py
190 191 | |
get_data(dim_order, level=0, well_id=None, field_id=None, **kwargs)
Source code in src/OmeZarrSource.py
121 122 123 124 125 126 127 | |
get_data_as_generator(dim_order, **kwargs)
Source code in src/OmeZarrSource.py
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 | |
get_dim_order()
Source code in src/OmeZarrSource.py
159 160 | |
get_dtype()
Source code in src/OmeZarrSource.py
162 163 | |
get_fields()
Source code in src/OmeZarrSource.py
200 201 | |
get_image_window(window_scanner, well_id=None, field_id=None, data=None)
Source code in src/OmeZarrSource.py
148 149 150 151 152 153 154 | |
get_microscope_info()
Source code in src/OmeZarrSource.py
212 213 | |
get_name()
Source code in src/OmeZarrSource.py
156 157 | |
get_nchannels()
Source code in src/OmeZarrSource.py
181 182 | |
get_pixel_size_um()
Source code in src/OmeZarrSource.py
165 166 | |
get_position_um(well_id=None)
Source code in src/OmeZarrSource.py
168 169 170 171 172 173 174 175 176 | |
get_rows()
Source code in src/OmeZarrSource.py
187 188 | |
get_scales()
Source code in src/OmeZarrSource.py
118 119 | |
get_shape()
Source code in src/OmeZarrSource.py
112 113 | |
get_shapes()
Source code in src/OmeZarrSource.py
115 116 | |
get_significant_bits()
Source code in src/OmeZarrSource.py
209 210 | |
get_time_points()
Source code in src/OmeZarrSource.py
196 197 198 | |
get_wells()
Source code in src/OmeZarrSource.py
193 194 | |
init_metadata()
Source code in src/OmeZarrSource.py
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 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 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 | |
is_rgb()
Source code in src/OmeZarrSource.py
184 185 | |
is_screen()
Source code in src/OmeZarrSource.py
109 110 | |
create_axes_metadata(dimension_order)
Create axes metadata for OME-Zarr from dimension order.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dimension_order
|
str
|
String of dimension characters. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
list |
List of axis metadata dictionaries. |
Source code in src/ome_zarr_util.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | |
create_channel_metadata(dtype, channels, nchannels, is_rgb, window, ome_version)
Create channel metadata for OME-Zarr.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dtype
|
Numpy dtype of image data. |
required | |
channels
|
list
|
List of channel dicts. |
required |
nchannels
|
int
|
Number of channels. |
required |
window
|
tuple
|
Min/max window values. |
required |
ome_version
|
str
|
OME-Zarr version. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
Channel metadata dictionary. |
Source code in src/ome_zarr_util.py
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 117 118 119 | |
create_transformation_metadata(dimension_order, pixel_size_um, factor, translation_um=None)
Create transformation metadata (scale and translation) for OME-Zarr.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dimension_order
|
str
|
String of dimension characters. |
required |
pixel_size_um
|
dict
|
Pixel size in micrometers per dimension. |
required |
factor
|
float
|
Scaling factor. |
required |
translation_um
|
dict
|
Translation in micrometers per dimension. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
list |
List of transformation metadata dictionaries. |
Source code in src/ome_zarr_util.py
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | |
rgba_to_hexrgb(rgba)
Source code in src/color_conversion.py
16 17 18 | |
scale_dimensions_dict(shape0, scale)
Scale x and y dimensions in a shape dictionary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
shape0
|
dict
|
Original shape dictionary. |
required |
scale
|
float
|
Scaling factor. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
Scaled shape dictionary. |
Source code in src/ome_zarr_util.py
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 | |
scale_dimensions_xy(shape0, dimension_order, scale)
Scale x and y dimensions in a shape tuple.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
shape0
|
tuple
|
Original shape. |
required |
dimension_order
|
str
|
String of dimension characters. |
required |
scale
|
float
|
Scaling factor. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
list |
Scaled shape. |
Source code in src/ome_zarr_util.py
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 | |
OmeZarrWriter
OME_DIR = 'OME'
module-attribute
OME_FILE = 'METADATA.ome.xml'
module-attribute
PYRAMID_DOWNSCALE = 2
module-attribute
PYRAMID_LEVELS = 6
module-attribute
RETRY_ATTEMPTS = 3
module-attribute
TIFF_COMPRESSION = 'LZW'
module-attribute
TILE_SIZE = 1024
module-attribute
VERSION = 'v0.1.24'
module-attribute
ZARR_CHUNK_SIZE = TILE_SIZE
module-attribute
ZARR_SHARD_MULTIPLIER = 10
module-attribute
OmeZarrWriter
Bases: OmeWriter
Writer for exporting image or screen data to OME-Zarr format. Supports both single images and high-content screening (HCS) plates.
Source code in src/OmeZarrWriter.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 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 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 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 167 168 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 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 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 | |
dim_order = 'tczyx'
instance-attribute
ome_format = FormatV04()
instance-attribute
ome_version = ome_version
instance-attribute
verbose = verbose
instance-attribute
zarr_version = zarr_version
instance-attribute
__init__(zarr_version=2, ome_version='0.4', verbose=False)
Initialize the OmeZarrWriter.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
zarr_version
|
int
|
Zarr format version (2 or 3). |
2
|
ome_version
|
str
|
OME-Zarr metadata version ('0.4' or '0.5'). |
'0.4'
|
verbose
|
bool
|
If True, print additional information. |
False
|
Source code in src/OmeZarrWriter.py
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | |
write(filepath, source, **kwargs)
Write the provided source data to an OME-Zarr file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filepath
|
str
|
Output path for the Zarr file. |
required |
source
|
source reader supporting required interface. |
required | |
**kwargs
|
Additional arguments (e.g. wells selection). |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
dict |
Containing output_path: str Output file path. |
Source code in src/OmeZarrWriter.py
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 | |
create_axes_metadata(dimension_order)
Create axes metadata for OME-Zarr from dimension order.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dimension_order
|
str
|
String of dimension characters. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
list |
List of axis metadata dictionaries. |
Source code in src/ome_zarr_util.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | |
create_channel_metadata(dtype, channels, nchannels, is_rgb, window, ome_version)
Create channel metadata for OME-Zarr.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dtype
|
Numpy dtype of image data. |
required | |
channels
|
list
|
List of channel dicts. |
required |
nchannels
|
int
|
Number of channels. |
required |
window
|
tuple
|
Min/max window values. |
required |
ome_version
|
str
|
OME-Zarr version. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
Channel metadata dictionary. |
Source code in src/ome_zarr_util.py
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 117 118 119 | |
create_transformation_metadata(dimension_order, pixel_size_um, factor, translation_um=None)
Create transformation metadata (scale and translation) for OME-Zarr.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dimension_order
|
str
|
String of dimension characters. |
required |
pixel_size_um
|
dict
|
Pixel size in micrometers per dimension. |
required |
factor
|
float
|
Scaling factor. |
required |
translation_um
|
dict
|
Translation in micrometers per dimension. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
list |
List of transformation metadata dictionaries. |
Source code in src/ome_zarr_util.py
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | |
rgba_to_hexrgb(rgba)
Source code in src/color_conversion.py
16 17 18 | |
scale_dimensions_dict(shape0, scale)
Scale x and y dimensions in a shape dictionary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
shape0
|
dict
|
Original shape dictionary. |
required |
scale
|
float
|
Scaling factor. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
Scaled shape dictionary. |
Source code in src/ome_zarr_util.py
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 | |
scale_dimensions_xy(shape0, dimension_order, scale)
Scale x and y dimensions in a shape tuple.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
shape0
|
tuple
|
Original shape. |
required |
dimension_order
|
str
|
String of dimension characters. |
required |
scale
|
float
|
Scaling factor. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
list |
Scaled shape. |
Source code in src/ome_zarr_util.py
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 | |
TiffSource
TiffSource
Bases: ImageSource
Loads image and metadata from TIFF or OME-TIFF files.
Source code in src/TiffSource.py
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 49 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 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 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 167 168 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 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 | |
image_filenames = {}
instance-attribute
metadata = metadata_to_dict(file.read().decode())
instance-attribute
tiff = TiffFile(image_filename)
instance-attribute
__init__(uri, metadata={})
Initialize TiffSource.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
uri
|
str
|
Path to the TIFF file. |
required |
metadata
|
dict
|
Optional metadata dictionary. |
{}
|
Source code in src/TiffSource.py
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 | |
close()
Source code in src/TiffSource.py
222 223 | |
get_acquisition_datetime()
Source code in src/TiffSource.py
213 214 | |
get_acquisitions()
Source code in src/TiffSource.py
210 211 | |
get_channels()
Source code in src/TiffSource.py
182 183 | |
get_columns()
Source code in src/TiffSource.py
194 195 | |
get_data(dim_order, level=0, well_id=None, field_id=None, **kwargs)
Source code in src/TiffSource.py
147 148 149 150 151 152 153 154 | |
get_data_as_dask(dim_order, level=0, **kwargs)
Source code in src/TiffSource.py
156 157 158 159 160 161 162 | |
get_dim_order()
Source code in src/TiffSource.py
167 168 | |
get_dtype()
Source code in src/TiffSource.py
170 171 | |
get_fields()
Source code in src/TiffSource.py
207 208 | |
get_microscope_info()
Source code in src/TiffSource.py
219 220 | |
get_name()
Source code in src/TiffSource.py
164 165 | |
get_nchannels()
Source code in src/TiffSource.py
185 186 | |
get_pixel_size_um()
Source code in src/TiffSource.py
173 174 175 176 177 | |
get_position_um(well_id=None)
Source code in src/TiffSource.py
179 180 | |
get_rows()
Source code in src/TiffSource.py
191 192 | |
get_scales()
Source code in src/TiffSource.py
144 145 | |
get_shape()
Source code in src/TiffSource.py
138 139 | |
get_shapes()
Source code in src/TiffSource.py
141 142 | |
get_significant_bits()
Source code in src/TiffSource.py
216 217 | |
get_time_points()
Source code in src/TiffSource.py
200 201 202 203 204 205 | |
get_wells()
Source code in src/TiffSource.py
197 198 | |
init_metadata()
Source code in src/TiffSource.py
49 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 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 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 | |
is_rgb()
Source code in src/TiffSource.py
188 189 | |
is_screen()
Source code in src/TiffSource.py
135 136 | |
convert_rational_value(value)
Converts a rational value tuple to a float.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
tuple or None
|
Rational value. |
required |
Returns:
| Type | Description |
|---|---|
|
float or None: Converted value. |
Source code in src/TiffSource.py
245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 | |
tags_to_dict(tags)
Converts TIFF tags to a dictionary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tags
|
TIFF tags object. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
Tag name-value mapping. |
Source code in src/TiffSource.py
226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 | |
Timer
Timer
Bases: object
Context manager for timing code execution and logging the elapsed time.
Source code in src/Timer.py
7 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 49 50 51 52 53 54 55 | |
auto_unit = auto_unit
instance-attribute
title = title
instance-attribute
verbose = verbose
instance-attribute
__enter__()
Start timing.
Source code in src/Timer.py
25 26 27 28 29 30 | |
__exit__(type, value, traceback)
Stop timing and log the elapsed time.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
type
|
Exception type, if any. |
required | |
value
|
Exception value, if any. |
required | |
traceback
|
Exception traceback, if any. |
required |
Source code in src/Timer.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | |
__init__(title, auto_unit=True, verbose=True)
Initialize the Timer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
title
|
str
|
Description for the timed block. |
required |
auto_unit
|
bool
|
Automatically select time unit (seconds/minutes/hours). |
True
|
verbose
|
bool
|
If True, log the elapsed time. |
True
|
Source code in src/Timer.py
12 13 14 15 16 17 18 19 20 21 22 23 | |
WindowScanner
WindowScanner
Computes quantile-based min/max window for image channels.
Source code in src/WindowScanner.py
6 7 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 49 50 | |
maxs = []
instance-attribute
mins = []
instance-attribute
__init__()
Initialize WindowScanner.
Source code in src/WindowScanner.py
11 12 13 14 15 16 | |
get_window()
Returns the computed min/max window for channels.
Returns:
| Name | Type | Description |
|---|---|---|
tuple |
(min dict, max dict) |
Source code in src/WindowScanner.py
43 44 45 46 47 48 49 50 | |
process(data, dim_order, min_quantile=0.01, max_quantile=0.99)
Processes image data to compute min/max quantiles for each channel.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
ndarray
|
Image data. |
required |
dim_order
|
str
|
Dimension order string. |
required |
min_quantile
|
float
|
Lower quantile. |
0.01
|
max_quantile
|
float
|
Upper quantile. |
0.99
|
Source code in src/WindowScanner.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | |
color_conversion
hexrgb_to_rgba(hexrgb)
Source code in src/color_conversion.py
21 22 23 24 25 26 | |
int_to_rgba(intrgba)
Source code in src/color_conversion.py
3 4 5 6 7 8 | |
rgba_to_hexrgb(rgba)
Source code in src/color_conversion.py
16 17 18 | |
rgba_to_int(rgba)
Source code in src/color_conversion.py
11 12 13 | |
helper
create_incucyte_source(filename, plate_id=None)
Create an IncucyteSource object for a specific plate.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename
|
str
|
Path to the Incucyte archive folder or .icarch file. |
required |
plate_id
|
str
|
Specific plate ID to process. If None, uses the first available plate if multiple plates exist. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
IncucyteSource |
Source object for the specified plate. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the path is not a valid Incucyte archive. |
Source code in src/helper.py
95 96 97 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 | |
create_source(filename, **kwargs)
Create an image source object based on the input file extension.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename
|
str
|
Path to the input file or Incucyte .icarch file. |
required |
**kwargs
|
Source-specific parameters (e.g., plate_id for Incucyte). |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
ImageSource |
Source object for the input file. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the file format is unsupported. |
Source code in src/helper.py
4 5 6 7 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 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | |
create_writer(output_format, verbose=False)
Create a writer object and output extension based on the output format.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
output_format
|
str
|
Output format string. |
required |
verbose
|
bool
|
If True, enables verbose output. |
False
|
Returns:
| Name | Type | Description |
|---|---|---|
tuple |
(writer object, output file extension) |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the output format is unsupported. |
Source code in src/helper.py
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 | |
get_incucyte_plates(filename)
Get all available plate IDs from an Incucyte archive.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename
|
str
|
Path to the Incucyte archive folder or .icarch file. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
list |
List of plate IDs (strings) found in the archive. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the path is not a valid Incucyte archive. |
Source code in src/helper.py
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 | |
ome_tiff_util
camel_to_snake(name)
Source code in src/util.py
204 205 206 | |
camel_to_snake_keys_dict(dct)
Source code in src/util.py
196 197 198 199 200 201 | |
convert_dotnet_ticks_to_datetime(net_ticks)
Source code in src/util.py
149 150 | |
convert_to_um(value, unit)
Source code in src/util.py
209 210 211 212 213 214 215 216 217 | |
create_binaryonly_metadata(metadata_filename, companion_uuid)
Source code in src/ome_tiff_util.py
309 310 311 312 313 314 | |
create_image_metadata(source, image_name, dim_order='tczyx', image_uuid=None, image_filename=None, instrument_id=None, objective_id=None, metadata_only=False)
Source code in src/ome_tiff_util.py
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 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 | |
create_metadata(source, dim_order='tczyx', uuid=None, image_uuids=None, image_filenames=None, wells=None, metadata_only=False)
Source code in src/ome_tiff_util.py
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 167 168 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 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 | |
create_resolution_metadata(source)
Source code in src/ome_tiff_util.py
344 345 346 347 348 | |
create_row_col_label(index, naming_convention)
Source code in src/ome_tiff_util.py
336 337 338 339 340 341 | |
create_uuid()
Source code in src/ome_tiff_util.py
20 21 | |
ensure_list(item)
Source code in src/util.py
7 8 9 10 | |
get_bits_type(nbits)
Source code in src/util.py
64 65 66 67 68 69 70 71 72 73 | |
get_filetitle(filename)
Source code in src/util.py
80 81 | |
get_level_from_scale(source_scales, target_scale=1)
Source code in src/util.py
54 55 56 57 58 59 60 61 | |
get_numpy_data(data, dim_order, t, c, z, y, x, y_size, x_size)
Source code in src/util.py
39 40 41 42 43 44 45 46 47 48 49 50 51 | |
get_row_col_index(label)
Source code in src/ome_tiff_util.py
328 329 330 331 332 333 | |
get_row_col_len_type(labels)
Source code in src/ome_tiff_util.py
317 318 319 320 321 322 323 324 325 | |
get_rows_cols_plate(nwells)
Source code in src/util.py
134 135 136 137 138 139 140 141 142 143 144 145 146 | |
metadata_to_dict(xml_metadata)
Source code in src/ome_tiff_util.py
13 14 15 16 17 | |
pad_leading_zero(input_string, num_digits=2)
Source code in src/util.py
116 117 118 119 120 121 122 123 124 125 126 | |
print_dict(value, tab=0, max_len=250, bullet=False)
Source code in src/util.py
220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 | |
print_hbytes(nbytes)
Source code in src/util.py
244 245 246 247 248 249 250 251 252 253 254 255 | |
read_ome_xml_metadata(metadata)
Source code in src/ome_tiff_util.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 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 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 | |
redimension_data(data, old_order, new_order, **indices)
Source code in src/util.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | |
reset_ome_ids()
Source code in src/ome_tiff_util.py
24 25 | |
split_well_name(well_name, remove_leading_zeros=True, col_as_int=False)
Source code in src/util.py
100 101 102 103 104 105 106 107 108 109 110 111 112 113 | |
splitall(path)
Source code in src/util.py
84 85 86 87 88 89 90 91 92 93 94 95 96 97 | |
strip_leading_zeros(well_name)
Source code in src/util.py
129 130 131 | |
validate_filename(filename)
Source code in src/util.py
76 77 | |
xml_content_to_dict(element)
Source code in src/util.py
153 154 155 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 183 184 185 186 187 188 189 190 191 192 193 | |
ome_zarr_util
create_axes_metadata(dimension_order)
Create axes metadata for OME-Zarr from dimension order.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dimension_order
|
str
|
String of dimension characters. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
list |
List of axis metadata dictionaries. |
Source code in src/ome_zarr_util.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | |
create_channel_metadata(dtype, channels, nchannels, is_rgb, window, ome_version)
Create channel metadata for OME-Zarr.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dtype
|
Numpy dtype of image data. |
required | |
channels
|
list
|
List of channel dicts. |
required |
nchannels
|
int
|
Number of channels. |
required |
window
|
tuple
|
Min/max window values. |
required |
ome_version
|
str
|
OME-Zarr version. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
Channel metadata dictionary. |
Source code in src/ome_zarr_util.py
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 117 118 119 | |
create_transformation_metadata(dimension_order, pixel_size_um, factor, translation_um=None)
Create transformation metadata (scale and translation) for OME-Zarr.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dimension_order
|
str
|
String of dimension characters. |
required |
pixel_size_um
|
dict
|
Pixel size in micrometers per dimension. |
required |
factor
|
float
|
Scaling factor. |
required |
translation_um
|
dict
|
Translation in micrometers per dimension. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
list |
List of transformation metadata dictionaries. |
Source code in src/ome_zarr_util.py
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | |
scale_dimensions_dict(shape0, scale)
Scale x and y dimensions in a shape dictionary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
shape0
|
dict
|
Original shape dictionary. |
required |
scale
|
float
|
Scaling factor. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
Scaled shape dictionary. |
Source code in src/ome_zarr_util.py
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 | |
scale_dimensions_xy(shape0, dimension_order, scale)
Scale x and y dimensions in a shape tuple.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
shape0
|
tuple
|
Original shape. |
required |
dimension_order
|
str
|
String of dimension characters. |
required |
scale
|
float
|
Scaling factor. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
list |
Scaled shape. |
Source code in src/ome_zarr_util.py
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 | |
parameters
OME_DIR = 'OME'
module-attribute
OME_FILE = 'METADATA.ome.xml'
module-attribute
PYRAMID_DOWNSCALE = 2
module-attribute
PYRAMID_LEVELS = 6
module-attribute
RETRY_ATTEMPTS = 3
module-attribute
TIFF_COMPRESSION = 'LZW'
module-attribute
TILE_SIZE = 1024
module-attribute
VERSION = 'v0.1.24'
module-attribute
ZARR_CHUNK_SIZE = TILE_SIZE
module-attribute
ZARR_SHARD_MULTIPLIER = 10
module-attribute
util
camel_to_snake(name)
Source code in src/util.py
204 205 206 | |
camel_to_snake_keys_dict(dct)
Source code in src/util.py
196 197 198 199 200 201 | |
convert_dotnet_ticks_to_datetime(net_ticks)
Source code in src/util.py
149 150 | |
convert_to_um(value, unit)
Source code in src/util.py
209 210 211 212 213 214 215 216 217 | |
ensure_list(item)
Source code in src/util.py
7 8 9 10 | |
get_bits_type(nbits)
Source code in src/util.py
64 65 66 67 68 69 70 71 72 73 | |
get_filetitle(filename)
Source code in src/util.py
80 81 | |
get_level_from_scale(source_scales, target_scale=1)
Source code in src/util.py
54 55 56 57 58 59 60 61 | |
get_numpy_data(data, dim_order, t, c, z, y, x, y_size, x_size)
Source code in src/util.py
39 40 41 42 43 44 45 46 47 48 49 50 51 | |
get_rows_cols_plate(nwells)
Source code in src/util.py
134 135 136 137 138 139 140 141 142 143 144 145 146 | |
pad_leading_zero(input_string, num_digits=2)
Source code in src/util.py
116 117 118 119 120 121 122 123 124 125 126 | |
print_dict(value, tab=0, max_len=250, bullet=False)
Source code in src/util.py
220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 | |
print_hbytes(nbytes)
Source code in src/util.py
244 245 246 247 248 249 250 251 252 253 254 255 | |
redimension_data(data, old_order, new_order, **indices)
Source code in src/util.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | |
split_well_name(well_name, remove_leading_zeros=True, col_as_int=False)
Source code in src/util.py
100 101 102 103 104 105 106 107 108 109 110 111 112 113 | |
splitall(path)
Source code in src/util.py
84 85 86 87 88 89 90 91 92 93 94 95 96 97 | |
strip_leading_zeros(well_name)
Source code in src/util.py
129 130 131 | |
validate_filename(filename)
Source code in src/util.py
76 77 | |
xml_content_to_dict(element)
Source code in src/util.py
153 154 155 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 183 184 185 186 187 188 189 190 191 192 193 | |