Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] recOrder convert key error #121

Closed
JohannaRahm opened this issue Jun 28, 2022 · 1 comment · Fixed by #123
Closed

[BUG] recOrder convert key error #121

JohannaRahm opened this issue Jun 28, 2022 · 1 comment · Fixed by #123

Comments

@JohannaRahm
Copy link

Hi,

I want to convert ome.tif files to zarr using recOrder.convert, but a key error is produced. I have never encountered this error and am using the usual recOrder.converter command. Do you know why this is happening? Thanks for having a look!

Best,
Johanna

Commands

module load anaconda; module load comp_micro; conda activate recorder

recOrder.convert --input /hpc/projects/gpfsml/ML_group/opencell-infection-microscopy/TICM0026-1/all_3 --output /hpc/projects/comp_micro/projects/virtualstaining/2022_microDL_nuc_mem/preprocess/infected_cells/TICM0026/TICM0026_all_3.zarr --data_type ometiff --replace_pos_name False

Executed in hpc terminal

Error message

Initializing Data...
Finished initializing data
Found Dataset TICM0026_all_3.zarr w/ dimensions (P, T, C, Z, Y, X): (384, 1, 4, 81, 1024, 1024)
Creating new zarr store at /hpc/projects/comp_micro/projects/virtualstaining/2022_microDL_nuc_mem/preprocess/infected_cells/TICM0026/TICM0026_all_3.zarr
Running Conversion...
Setting up zarr
Traceback (most recent call last):
  File "/hpc/user_apps/comp_micro/conda_envs/recorder/bin/recOrder.convert", line 8, in <module>
    sys.exit(main())
  File "/hpc/user_apps/comp_micro/conda_envs/recorder/lib/python3.7/site-packages/recOrder/scripts/convert_tiff_to_zarr.py", line 28, in main
    converter.run_conversion()
  File "/hpc/user_apps/comp_micro/conda_envs/recorder/lib/python3.7/site-packages/recOrder/io/zarr_converter.py", line 366, in run_conversion
    self.init_zarr_structure()
  File "/hpc/user_apps/comp_micro/conda_envs/recorder/lib/python3.7/site-packages/recOrder/io/zarr_converter.py", line 333, in init_zarr_structure
    self._get_position_names()
  File "/hpc/user_apps/comp_micro/conda_envs/recorder/lib/python3.7/site-packages/recOrder/io/zarr_converter.py", line 253, in _get_position_names
    name = self.summary_metadata['StagePositions'][p]['Label']
KeyError: 'Label'

Expected behavior
Here the command applied to another dataset, where it works without error. Perhaps the error is linked differences in input dataset structure.

recOrder.convert --input /hpc/projects/comp_micro/rawdata/hummingbird/Janie/2022_01_20_orgs_BF_GFP_63x_04NA/BF_GFP_first11_1 --output /hpc/projects/comp_micro/rawdata/hummingbird/Janie/2022_01_20_orgs_BF_GFP_63x_04NA/BF_GFP_first11_1_test.zarr --data_type ometiff --replace_pos_name False

Environment:
Operating system: HPC
Python version: 3.7.11
Python environment (command line, IDE, Jupyter notebook, etc): shared environment
MicroManager/pycromanager version: 0.17.8

@talonchandler
Copy link
Collaborator

Thanks for the clear bug report, Johanna!

I'm able to recreate the bug on the HPC and locally, and I'm working on a fix.

If the surface-level error is any indication, it seems like the reader is having trouble finding position names. Are the position names necessary for downstream processing?

The quickest fix will likely be to just ignore the position names if they don't exist...more work may be necessary to understand why the position names aren't there in the first place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants