|
| 1 | +# Command line interface |
| 2 | + |
| 3 | +`ome-zarr-models` has a command line interface. |
| 4 | +To see available commands, |
| 5 | + |
| 6 | +```sh |
| 7 | +ome-zarr-models --help |
| 8 | +``` |
| 9 | + |
| 10 | +``` |
| 11 | +usage: ome-zarr-models [-h] [--version] COMMAND ... |
| 12 | +
|
| 13 | +OME-Zarr Models CLI |
| 14 | +
|
| 15 | +positional arguments: |
| 16 | + COMMAND Available commands |
| 17 | + validate Validate an OME-Zarr |
| 18 | + info Get information about an OME-Zarr group |
| 19 | +
|
| 20 | +options: |
| 21 | + -h, --help show this help message and exit |
| 22 | + --version show program's version number and exit |
| 23 | +``` |
| 24 | + |
| 25 | +## Validation |
| 26 | + |
| 27 | +To validate a OME-Zarr group, pass the path to the group to `ome-zarr-models validate`, for example |
| 28 | + |
| 29 | +```sh |
| 30 | +ome-zarr-models validate https://uk1s3.embassy.ebi.ac.uk/idr/zarr/v0.5/idr0066/ExpD_chicken_embryo_MIP.ome.zarr |
| 31 | +``` |
| 32 | + |
| 33 | +``` |
| 34 | +✅ Valid OME-Zarr |
| 35 | +``` |
| 36 | + |
| 37 | +The group can be specified as any string that can be parsed by **link to zarr.open_group**. |
| 38 | + |
| 39 | +## Info |
| 40 | + |
| 41 | +To get information about an OME-Zarr group, pass the path to a group to `ome-zarr-models info`. |
| 42 | +This will print the metadata (see below for an example). |
| 43 | +If you have the `rich` Python package installed, a more readable output will be produced. |
| 44 | + |
| 45 | +```sh |
| 46 | +ome-zarr-models info https://uk1s3.embassy.ebi.ac.uk/idr/zarr/v0.5/idr0066/ExpD_chicken_embryo_MIP.ome.zarr |
| 47 | +``` |
| 48 | + |
| 49 | +``` |
| 50 | +ImageLabel( |
| 51 | + zarr_format=3, |
| 52 | + node_type='group', |
| 53 | + attributes=BaseZarrAttrs[ImageLabelAttrs]( |
| 54 | + ome=ImageLabelAttrs( |
| 55 | + version='0.5', |
| 56 | + image_label=None, |
| 57 | + multiscales=[ |
| 58 | + Multiscale( |
| 59 | + axes=[Axis(name='y', type='space', unit='micrometer'), Axis(name='x', type='space', unit='micrometer')], |
| 60 | + datasets=( |
| 61 | + Dataset(path='0', coordinateTransformations=(VectorScale(type='scale', scale=[1.6, 1.6]),)), |
| 62 | + Dataset(path='1', coordinateTransformations=(VectorScale(type='scale', scale=[3.2, 3.2]),)), |
| 63 | + Dataset(path='2', coordinateTransformations=(VectorScale(type='scale', scale=[6.4, 6.4]),)), |
| 64 | + Dataset(path='3', coordinateTransformations=(VectorScale(type='scale', scale=[12.8, 12.8]),)), |
| 65 | + Dataset(path='4', coordinateTransformations=(VectorScale(type='scale', scale=[25.6, 25.6]),)), |
| 66 | + Dataset(path='5', coordinateTransformations=(VectorScale(type='scale', scale=[51.2, 51.2]),)), |
| 67 | + Dataset(path='6', coordinateTransformations=(VectorScale(type='scale', scale=[102.4, 102.4]),)), |
| 68 | + Dataset(path='7', coordinateTransformations=(VectorScale(type='scale', scale=[204.8, 204.8]),)) |
| 69 | + ), |
| 70 | + coordinateTransformations=None, |
| 71 | + metadata=None, |
| 72 | + name='/', |
| 73 | + type=None |
| 74 | + ) |
| 75 | + ], |
| 76 | + _creator={'name': 'ome2024-ngff-challenge', 'version': '1.0.2', 'notes': None}, |
| 77 | + omero={ |
| 78 | + 'channels': [ |
| 79 | + { |
| 80 | + 'active': True, |
| 81 | + 'coefficient': 1.0, |
| 82 | + 'color': 'FFFFFF', |
| 83 | + 'family': 'linear', |
| 84 | + 'inverted': False, |
| 85 | + 'label': 'Cy3', |
| 86 | + 'window': {'end': 55.0, 'max': 255.0, 'min': 0.0, 'start': 0.0} |
| 87 | + } |
| 88 | + ], |
| 89 | + 'id': 1, |
| 90 | + 'rdefs': {'defaultT': 0, 'defaultZ': 0, 'model': 'greyscale'} |
| 91 | + } |
| 92 | + ) |
| 93 | + ), |
| 94 | + members={ |
| 95 | + '0': ArraySpec( |
| 96 | + zarr_format=3, |
| 97 | + node_type='array', |
| 98 | + attributes={ |
| 99 | + '_ome2024_ngff_challenge_stats': { |
| 100 | + 'input': '', |
| 101 | + 'output': '', |
| 102 | + 'start': 1729085217.2919362, |
| 103 | + 'stop': 1729085219.378162, |
| 104 | + 'read': 29620797, |
| 105 | + 'written': 19813141, |
| 106 | + 'elapsed': 2.086225748062134, |
| 107 | + 'threads': 16, |
| 108 | + 'cpu_count': 16, |
| 109 | + 'sched_affinity': 16 |
| 110 | + } |
| 111 | + }, |
| 112 | + shape=(8978, 6510), |
| 113 | + data_type='uint8', |
| 114 | + chunk_grid={'name': 'regular', 'configuration': {'chunk_shape': (2048, 2048)}}, |
| 115 | + chunk_key_encoding={'name': 'default', 'configuration': {'separator': '/'}}, |
| 116 | + fill_value=0, |
| 117 | + codecs=( |
| 118 | + { |
| 119 | + 'name': 'sharding_indexed', |
| 120 | + 'configuration': { |
| 121 | + 'chunk_shape': (256, 256), |
| 122 | + 'codecs': ({'name': 'bytes'}, {'name': 'blosc', 'configuration': {'typesize': 1, 'cname': 'zstd', 'clevel': 5, 'shuffle': 'bitshuffle', 'blocksize': 0}}), |
| 123 | + 'index_codecs': ({'name': 'bytes', 'configuration': {'endian': 'little'}}, {'name': 'crc32c'}), |
| 124 | + 'index_location': 'end' |
| 125 | + } |
| 126 | + }, |
| 127 | + ), |
| 128 | + storage_transformers=(), |
| 129 | + dimension_names=('y', 'x') |
| 130 | + ), |
| 131 | + '1': ArraySpec( |
| 132 | + zarr_format=3, |
| 133 | + node_type='array', |
| 134 | + attributes={ |
| 135 | + '_ome2024_ngff_challenge_stats': { |
| 136 | + 'input': '', |
| 137 | + 'output': '', |
| 138 | + 'start': 1729085219.4806092, |
| 139 | + 'stop': 1729085219.9208982, |
| 140 | + 'read': 7529704, |
| 141 | + 'written': 5313738, |
| 142 | + 'elapsed': 0.4402890205383301, |
| 143 | + 'threads': 16, |
| 144 | + 'cpu_count': 16, |
| 145 | + 'sched_affinity': 16 |
| 146 | + } |
| 147 | + }, |
| 148 | + shape=(4489, 3255), |
| 149 | + data_type='uint8', |
| 150 | + chunk_grid={'name': 'regular', 'configuration': {'chunk_shape': (2048, 2048)}}, |
| 151 | + chunk_key_encoding={'name': 'default', 'configuration': {'separator': '/'}}, |
| 152 | + fill_value=0, |
| 153 | + codecs=( |
| 154 | + { |
| 155 | + 'name': 'sharding_indexed', |
| 156 | + 'configuration': { |
| 157 | + 'chunk_shape': (256, 256), |
| 158 | + 'codecs': ({'name': 'bytes'}, {'name': 'blosc', 'configuration': {'typesize': 1, 'cname': 'zstd', 'clevel': 5, 'shuffle': 'bitshuffle', 'blocksize': 0}}), |
| 159 | + 'index_codecs': ({'name': 'bytes', 'configuration': {'endian': 'little'}}, {'name': 'crc32c'}), |
| 160 | + 'index_location': 'end' |
| 161 | + } |
| 162 | + }, |
| 163 | + ), |
| 164 | + storage_transformers=(), |
| 165 | + dimension_names=('y', 'x') |
| 166 | + ), |
| 167 | + '2': ArraySpec( |
| 168 | + zarr_format=3, |
| 169 | + node_type='array', |
| 170 | + attributes={ |
| 171 | + '_ome2024_ngff_challenge_stats': { |
| 172 | + 'input': '', |
| 173 | + 'output': '', |
| 174 | + 'start': 1729085220.1890664, |
| 175 | + 'stop': 1729085220.455311, |
| 176 | + 'read': 1980204, |
| 177 | + 'written': 1412021, |
| 178 | + 'elapsed': 0.26624464988708496, |
| 179 | + 'threads': 16, |
| 180 | + 'cpu_count': 16, |
| 181 | + 'sched_affinity': 16 |
| 182 | + } |
| 183 | + }, |
| 184 | + shape=(2244, 1627), |
| 185 | + data_type='uint8', |
| 186 | + chunk_grid={'name': 'regular', 'configuration': {'chunk_shape': (2048, 2048)}}, |
| 187 | + chunk_key_encoding={'name': 'default', 'configuration': {'separator': '/'}}, |
| 188 | + fill_value=0, |
| 189 | + codecs=( |
| 190 | + { |
| 191 | + 'name': 'sharding_indexed', |
| 192 | + 'configuration': { |
| 193 | + 'chunk_shape': (256, 256), |
| 194 | + 'codecs': ({'name': 'bytes'}, {'name': 'blosc', 'configuration': {'typesize': 1, 'cname': 'zstd', 'clevel': 5, 'shuffle': 'bitshuffle', 'blocksize': 0}}), |
| 195 | + 'index_codecs': ({'name': 'bytes', 'configuration': {'endian': 'little'}}, {'name': 'crc32c'}), |
| 196 | + 'index_location': 'end' |
| 197 | + } |
| 198 | + }, |
| 199 | + ), |
| 200 | + storage_transformers=(), |
| 201 | + dimension_names=('y', 'x') |
| 202 | + ), |
| 203 | + '3': ArraySpec( |
| 204 | + zarr_format=3, |
| 205 | + node_type='array', |
| 206 | + attributes={ |
| 207 | + '_ome2024_ngff_challenge_stats': { |
| 208 | + 'input': '', |
| 209 | + 'output': '', |
| 210 | + 'start': 1729085220.5030446, |
| 211 | + 'stop': 1729085220.6317737, |
| 212 | + 'read': 510798, |
| 213 | + 'written': 371051, |
| 214 | + 'elapsed': 0.12872910499572754, |
| 215 | + 'threads': 16, |
| 216 | + 'cpu_count': 16, |
| 217 | + 'sched_affinity': 16 |
| 218 | + } |
| 219 | + }, |
| 220 | + shape=(1122, 813), |
| 221 | + data_type='uint8', |
| 222 | + chunk_grid={'name': 'regular', 'configuration': {'chunk_shape': (2048, 2048)}}, |
| 223 | + chunk_key_encoding={'name': 'default', 'configuration': {'separator': '/'}}, |
| 224 | + fill_value=0, |
| 225 | + codecs=( |
| 226 | + { |
| 227 | + 'name': 'sharding_indexed', |
| 228 | + 'configuration': { |
| 229 | + 'chunk_shape': (256, 256), |
| 230 | + 'codecs': ({'name': 'bytes'}, {'name': 'blosc', 'configuration': {'typesize': 1, 'cname': 'zstd', 'clevel': 5, 'shuffle': 'bitshuffle', 'blocksize': 0}}), |
| 231 | + 'index_codecs': ({'name': 'bytes', 'configuration': {'endian': 'little'}}, {'name': 'crc32c'}), |
| 232 | + 'index_location': 'end' |
| 233 | + } |
| 234 | + }, |
| 235 | + ), |
| 236 | + storage_transformers=(), |
| 237 | + dimension_names=('y', 'x') |
| 238 | + ), |
| 239 | + '4': ArraySpec( |
| 240 | + zarr_format=3, |
| 241 | + node_type='array', |
| 242 | + attributes={ |
| 243 | + '_ome2024_ngff_challenge_stats': { |
| 244 | + 'input': '', |
| 245 | + 'output': '', |
| 246 | + 'start': 1729085220.7549112, |
| 247 | + 'stop': 1729085220.8107944, |
| 248 | + 'read': 133911, |
| 249 | + 'written': 99335, |
| 250 | + 'elapsed': 0.055883169174194336, |
| 251 | + 'threads': 16, |
| 252 | + 'cpu_count': 16, |
| 253 | + 'sched_affinity': 16 |
| 254 | + } |
| 255 | + }, |
| 256 | + shape=(561, 406), |
| 257 | + data_type='uint8', |
| 258 | + chunk_grid={'name': 'regular', 'configuration': {'chunk_shape': (2048, 2048)}}, |
| 259 | + chunk_key_encoding={'name': 'default', 'configuration': {'separator': '/'}}, |
| 260 | + fill_value=0, |
| 261 | + codecs=( |
| 262 | + { |
| 263 | + 'name': 'sharding_indexed', |
| 264 | + 'configuration': { |
| 265 | + 'chunk_shape': (256, 256), |
| 266 | + 'codecs': ({'name': 'bytes'}, {'name': 'blosc', 'configuration': {'typesize': 1, 'cname': 'zstd', 'clevel': 5, 'shuffle': 'bitshuffle', 'blocksize': 0}}), |
| 267 | + 'index_codecs': ({'name': 'bytes', 'configuration': {'endian': 'little'}}, {'name': 'crc32c'}), |
| 268 | + 'index_location': 'end' |
| 269 | + } |
| 270 | + }, |
| 271 | + ), |
| 272 | + storage_transformers=(), |
| 273 | + dimension_names=('y', 'x') |
| 274 | + ), |
| 275 | + '5': ArraySpec( |
| 276 | + zarr_format=3, |
| 277 | + node_type='array', |
| 278 | + attributes={ |
| 279 | + '_ome2024_ngff_challenge_stats': { |
| 280 | + 'input': '', |
| 281 | + 'output': '', |
| 282 | + 'start': 1729085220.852728, |
| 283 | + 'stop': 1729085220.8804672, |
| 284 | + 'read': 36408, |
| 285 | + 'written': 26760, |
| 286 | + 'elapsed': 0.027739286422729492, |
| 287 | + 'threads': 16, |
| 288 | + 'cpu_count': 16, |
| 289 | + 'sched_affinity': 16 |
| 290 | + } |
| 291 | + }, |
| 292 | + shape=(280, 203), |
| 293 | + data_type='uint8', |
| 294 | + chunk_grid={'name': 'regular', 'configuration': {'chunk_shape': (2048, 2048)}}, |
| 295 | + chunk_key_encoding={'name': 'default', 'configuration': {'separator': '/'}}, |
| 296 | + fill_value=0, |
| 297 | + codecs=( |
| 298 | + { |
| 299 | + 'name': 'sharding_indexed', |
| 300 | + 'configuration': { |
| 301 | + 'chunk_shape': (256, 256), |
| 302 | + 'codecs': ({'name': 'bytes'}, {'name': 'blosc', 'configuration': {'typesize': 1, 'cname': 'zstd', 'clevel': 5, 'shuffle': 'bitshuffle', 'blocksize': 0}}), |
| 303 | + 'index_codecs': ({'name': 'bytes', 'configuration': {'endian': 'little'}}, {'name': 'crc32c'}), |
| 304 | + 'index_location': 'end' |
| 305 | + } |
| 306 | + }, |
| 307 | + ), |
| 308 | + storage_transformers=(), |
| 309 | + dimension_names=('y', 'x') |
| 310 | + ), |
| 311 | + '6': ArraySpec( |
| 312 | + zarr_format=3, |
| 313 | + node_type='array', |
| 314 | + attributes={ |
| 315 | + '_ome2024_ngff_challenge_stats': { |
| 316 | + 'input': '', |
| 317 | + 'output': '', |
| 318 | + 'start': 1729085220.9772055, |
| 319 | + 'stop': 1729085221.0321193, |
| 320 | + 'read': 9845, |
| 321 | + 'written': 7913, |
| 322 | + 'elapsed': 0.05491375923156738, |
| 323 | + 'threads': 16, |
| 324 | + 'cpu_count': 16, |
| 325 | + 'sched_affinity': 16 |
| 326 | + } |
| 327 | + }, |
| 328 | + shape=(140, 101), |
| 329 | + data_type='uint8', |
| 330 | + chunk_grid={'name': 'regular', 'configuration': {'chunk_shape': (2048, 2048)}}, |
| 331 | + chunk_key_encoding={'name': 'default', 'configuration': {'separator': '/'}}, |
| 332 | + fill_value=0, |
| 333 | + codecs=( |
| 334 | + { |
| 335 | + 'name': 'sharding_indexed', |
| 336 | + 'configuration': { |
| 337 | + 'chunk_shape': (256, 256), |
| 338 | + 'codecs': ({'name': 'bytes'}, {'name': 'blosc', 'configuration': {'typesize': 1, 'cname': 'zstd', 'clevel': 5, 'shuffle': 'bitshuffle', 'blocksize': 0}}), |
| 339 | + 'index_codecs': ({'name': 'bytes', 'configuration': {'endian': 'little'}}, {'name': 'crc32c'}), |
| 340 | + 'index_location': 'end' |
| 341 | + } |
| 342 | + }, |
| 343 | + ), |
| 344 | + storage_transformers=(), |
| 345 | + dimension_names=('y', 'x') |
| 346 | + ), |
| 347 | + '7': ArraySpec( |
| 348 | + zarr_format=3, |
| 349 | + node_type='array', |
| 350 | + attributes={ |
| 351 | + '_ome2024_ngff_challenge_stats': { |
| 352 | + 'input': '', |
| 353 | + 'output': '', |
| 354 | + 'start': 1729085221.1716456, |
| 355 | + 'stop': 1729085221.211354, |
| 356 | + 'read': 2677, |
| 357 | + 'written': 2953, |
| 358 | + 'elapsed': 0.03970837593078613, |
| 359 | + 'threads': 16, |
| 360 | + 'cpu_count': 16, |
| 361 | + 'sched_affinity': 16 |
| 362 | + } |
| 363 | + }, |
| 364 | + shape=(70, 50), |
| 365 | + data_type='uint8', |
| 366 | + chunk_grid={'name': 'regular', 'configuration': {'chunk_shape': (2048, 2048)}}, |
| 367 | + chunk_key_encoding={'name': 'default', 'configuration': {'separator': '/'}}, |
| 368 | + fill_value=0, |
| 369 | + codecs=( |
| 370 | + { |
| 371 | + 'name': 'sharding_indexed', |
| 372 | + 'configuration': { |
| 373 | + 'chunk_shape': (256, 256), |
| 374 | + 'codecs': ({'name': 'bytes'}, {'name': 'blosc', 'configuration': {'typesize': 1, 'cname': 'zstd', 'clevel': 5, 'shuffle': 'bitshuffle', 'blocksize': 0}}), |
| 375 | + 'index_codecs': ({'name': 'bytes', 'configuration': {'endian': 'little'}}, {'name': 'crc32c'}), |
| 376 | + 'index_location': 'end' |
| 377 | + } |
| 378 | + }, |
| 379 | + ), |
| 380 | + storage_transformers=(), |
| 381 | + dimension_names=('y', 'x') |
| 382 | + ) |
| 383 | + } |
| 384 | +) |
| 385 | +``` |
0 commit comments