mobie/mobie-utils-python

add 2D image metadata error

Closed this issue · 10 comments

Hi,

I tried adding a 2D image (Project:/g/emcf/Mizzon/projects/2021/CLEM_course_2021/F30/g4_CLEMcourse/ temp folder just above).

and got an error at the end when writing the metadata:

riteDownscalingMetadata(tmp_folder=tmp_data_1-A, output_path=test/data/images/ome-zarr/1-A.ome.zarr, scale_factors=[[2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2]], dependency=DownscalingSlurm, metadata_format=ome.zarr, metadata_dict={"resolution": [0.03412], "unit": "micrometer", "setup_name": "1-A"}, output_key_prefix=, scale_offset=0, prefix=downscaling)
Traceback (most recent call last):
  File "/g/emcf/software/python/miniconda/envs/mobie/lib/python3.8/site-packages/luigi/worker.py", line 191, in run
    new_deps = self._run_get_new_deps()
  File "/g/emcf/software/python/miniconda/envs/mobie/lib/python3.8/site-packages/luigi/worker.py", line 133, in _run_get_new_deps
    task_gen = self.task.run()
  File "/g/emcf/software/python/miniconda/envs/mobie/lib/python3.8/site-packages/cluster_tools/downscaling/downscaling_workflow.py", line 33, in run
    vu.write_format_metadata(self.metadata_format, self.output_path, self.metadata_dict,
  File "/g/emcf/software/python/miniconda/envs/mobie/lib/python3.8/site-packages/cluster_tools/utils/volume_utils.py", line 529, in write_format_metadata
    _ome_zarr_metadata(path, prefix, metadata_dict, scale_factors, scale_offset)
  File "/g/emcf/software/python/miniconda/envs/mobie/lib/python3.8/site-packages/cluster_tools/utils/volume_utils.py", line 518, in _ome_zarr_metadata
    create_ngff_metadata(g, setup_name, axes_names, units=units, scales=scales)
  File "/g/emcf/software/python/miniconda/envs/mobie/lib/python3.8/site-packages/cluster_tools/utils/volume_utils.py", line 484, in create_ngff_metadata
    assert all(len(scale) == len(axes_names) for scale in scales)
AssertionError

I changed the resolution value to [res]*2 to make the dimensions consistent and this made it work.
I think it makes sense to check all these dimensions before starting the conversion process.

Could you also please check what is wrong with the local MoBIE project:

/g/emcf/Mizzon/projects/2021/CLEM_course_2021/clem-example-project

?

I have added the overview image as 2D OME-Zarr. But now the other local sources won't show up anymore but instead throw null pointer exceptions.

oh, and I noticed that I have no access to the bucket to upload that modified image...

I changed the resolution value to [res]*2 to make the dimensions consistent and this made it work.
I think it makes sense to check all these dimensions before starting the conversion process.

Yes, that's a good point.

Could you also please check what is wrong with the local MoBIE project:

/g/emcf/Mizzon/projects/2021/CLEM_course_2021/clem-example-project

Please run mobie.validate_project whenever you run into issues first. It often tells you what's going wrong:

mobie.validate_project -i /g/emcf/Mizzon/projects/2021/CLEM_course_2021/clem-example-project/data
...
ValueError: Source name and name in ngff metadata don't match: em-overview != 1-A

oh, and I noticed that I have no access to the bucket to upload that modified image...

You'll need to contact Josep about this.

do you have the local n5 data for this project somewhere? It seems that this one is outdated.

Yes, the most recent version of the project is here: /g/kreshuk/pape/Work/mobie/clem-example-project.

Let me know if that works for you, otherwise I can copy it somewhere to /g/emcf and give you write permissions.

Alright,
would you mind copying over data/hela/images/ome-zarr/ from /g/emcf/Mizzon/projects/2021/CLEM_course_2021/clem-example-project/ to update it the EM overview?

I have pushed the updated metadata to the "publication" branch.

I don't want to mess with the permissions when git pulling myself...

I have copied it.