BodenmillerGroup / ImcSegmentationPipeline

A pixel classification based multiplexed image segmentation pipeline
https://bodenmillergroup.github.io/ImcSegmentationPipeline/
MIT License
84 stars 35 forks source link

Image Stacks Generation - Key Error #120

Closed Guille916 closed 1 year ago

Guille916 commented 1 year ago

Hi, thanks for the Pipeline. It's been very helpfull so far!

I get this Key Error in the Image Stacks Generation step! Don't have much experience and don't know why. Hope you could help me out please!

imagen
nilseling commented 1 year ago

Hi @Guille916

Could you please add a screenshot of the first code chunk of the script and a screenshot of your panel file?

Guille916 commented 1 year ago

Hi @nilseling

Thanks for the quick response! Here you go..

imagen imagen
nilseling commented 1 year ago

Hmm, that does look correct to me. @jwindhager could you quickly check if I'm missing anything?

jwindhager commented 1 year ago

@nilseling LGTM. Maybe check whether the correct panel file is being loaded (e.g. csv vs xlsx or other formats, directory, ...)?

nilseling commented 1 year ago

Hi @Guille916, would it be possible if you shared a single MCD file and the panel file with me (nils.eling@uzh.ch)?

Guille916 commented 1 year ago

Hi @nilseling, I just sent them to your email!

Thanks,

nilseling commented 1 year ago

Perfect, thanks! I'll take a look at it tonight and will come back to you asap

nilseling commented 1 year ago

Hey @Guille916 thanks for sharing the data! Looking at your panel file you use ; as separator instead of ,. I haven't gotten access yet to the MCD but could you try saving the panel as comma-separated CSV and test again?

Guille916 commented 1 year ago

Many thanks @nilseling I did the change about the comma-separated that you suggested me, and it seems to work. I have another message (Here the screenshot), not sure of its meaning...

imagen

Thank you very much for your quick help and response on this matter!

Cheers, Guille

nilseling commented 1 year ago

Hi @Guille916

I was not able to reproduce this error on my side. You could remove the current conda environment (conda env remove -n imcsegpipe) and build it again? You should get a new warning (see #122) but you can safely ignore it.

Guille916 commented 1 year ago

Hi @nilseling Will do. Thank you for all the help!

Cheers, Guille

Guille916 commented 1 year ago

Hi @nilseling I removed the current conda environment and built it again, but still got the same warning...do you think I should worry or just move ahead?

imagen

Best, Guille

nilseling commented 1 year ago

Could you please open the generated TIFF files in FIJI and check if they are correct? And could you also please add the output of !conda list here?

Guille916 commented 1 year ago

Thank you @nilseling I wasn't able to open any TIFF file from the cpout/images directory (full.tiff) Please see screenshot. But I was able to open TIFF files from the ilsatik repository (ilastik.tiff) and they look ok.

imagen

Here's the output of !conda list:

packages in environment at /Users/Guille/opt/anaconda3/envs/imcsegpipe:

#

Name Version Build Channel

aiofiles 22.1.0 pyhd8ed1ab_0 conda-forge aiosqlite 0.18.0 pyhd8ed1ab_0 conda-forge anyio 3.6.2 pyhd8ed1ab_0 conda-forge appnope 0.1.3 pyhd8ed1ab_0 conda-forge argon2-cffi 21.3.0 pyhd8ed1ab_0 conda-forge argon2-cffi-bindings 21.2.0 py39ha30fb19_3 conda-forge asttokens 2.2.1 pyhd8ed1ab_0 conda-forge attrs 22.2.0 pyh71513ae_0 conda-forge babel 2.11.0 pyhd8ed1ab_0 conda-forge backcall 0.2.0 pyh9f0ad1d_0 conda-forge backports 1.0 pyhd8ed1ab_3 conda-forge backports.functools_lru_cache 1.6.4 pyhd8ed1ab_0 conda-forge beautifulsoup4 4.11.2 pyha770c72_0 conda-forge bleach 6.0.0 pyhd8ed1ab_0 conda-forge brotlipy 0.7.0 py39ha30fb19_1005 conda-forge bzip2 1.0.8 h0d85af4_4 conda-forge ca-certificates 2022.12.7 h033912b_0 conda-forge certifi 2022.12.7 pyhd8ed1ab_0 conda-forge cffi 1.15.1 py39h131948b_3 conda-forge charset-normalizer 2.1.1 pyhd8ed1ab_0 conda-forge comm 0.1.2 pyhd8ed1ab_0 conda-forge cryptography 39.0.1 py39hbeae22c_0 conda-forge debugpy 1.6.6 py39h7a8716b_0 conda-forge decorator 5.1.1 pyhd8ed1ab_0 conda-forge defusedxml 0.7.1 pyhd8ed1ab_0 conda-forge entrypoints 0.4 pyhd8ed1ab_0 conda-forge executing 1.2.0 pyhd8ed1ab_0 conda-forge flit-core 3.8.0 pyhd8ed1ab_0 conda-forge idna 3.4 pyhd8ed1ab_0 conda-forge imageio 2.25.1 pypi_0 pypi imcsegpipe 1.0.0 pypi_0 pypi importlib-metadata 6.0.0 pyha770c72_0 conda-forge importlib_metadata 6.0.0 hd8ed1ab_0 conda-forge importlib_resources 5.10.2 pyhd8ed1ab_0 conda-forge ipykernel 6.21.2 pyh736e0ef_0 conda-forge ipython 8.10.0 pyhd1c38e8_0 conda-forge ipython_genutils 0.2.0 py_1 conda-forge jedi 0.18.2 pyhd8ed1ab_0 conda-forge jinja2 3.1.2 pyhd8ed1ab_1 conda-forge json5 0.9.5 pyh9f0ad1d_0 conda-forge jsonschema 4.17.3 pyhd8ed1ab_0 conda-forge jupyter_client 8.0.2 pyhd8ed1ab_0 conda-forge jupyter_core 5.2.0 py39h6e9494a_0 conda-forge jupyter_events 0.5.0 pyhd8ed1ab_1 conda-forge jupyter_server 2.3.0 pyhd8ed1ab_0 conda-forge jupyter_server_fileid 0.6.0 pyhd8ed1ab_0 conda-forge jupyter_server_terminals 0.4.4 pyhd8ed1ab_1 conda-forge jupyter_server_ydoc 0.6.1 pyhd8ed1ab_0 conda-forge jupyter_ydoc 0.2.2 pyhd8ed1ab_0 conda-forge jupyterlab 3.6.1 pyhd8ed1ab_0 conda-forge jupyterlab_pygments 0.2.2 pyhd8ed1ab_0 conda-forge jupyterlab_server 2.19.0 pyhd8ed1ab_0 conda-forge jupytext 1.14.4 pyhcff175f_0 conda-forge libcxx 14.0.6 hccf4f1f_0 conda-forge libffi 3.4.2 h0d85af4_5 conda-forge libsodium 1.0.18 hbcb3906_1 conda-forge libsqlite 3.40.0 ha978bb4_0 conda-forge libzlib 1.2.13 hfd90126_4 conda-forge markdown-it-py 2.1.0 pyhd8ed1ab_0 conda-forge markupsafe 2.1.2 py39ha30fb19_0 conda-forge matplotlib-inline 0.1.6 pyhd8ed1ab_0 conda-forge mdit-py-plugins 0.3.3 pyhd8ed1ab_0 conda-forge mdurl 0.1.0 pyhd8ed1ab_0 conda-forge mistune 2.0.5 pyhd8ed1ab_0 conda-forge nbclassic 0.5.1 pyhd8ed1ab_0 conda-forge nbclient 0.7.2 pyhd8ed1ab_0 conda-forge nbconvert 7.2.9 pyhd8ed1ab_0 conda-forge nbconvert-core 7.2.9 pyhd8ed1ab_0 conda-forge nbconvert-pandoc 7.2.9 pyhd8ed1ab_0 conda-forge nbformat 5.7.3 pyhd8ed1ab_0 conda-forge ncurses 6.3 h96cf925_1 conda-forge nest-asyncio 1.5.6 pyhd8ed1ab_0 conda-forge notebook 6.5.2 pyha770c72_1 conda-forge notebook-shim 0.2.2 pyhd8ed1ab_0 conda-forge numpy 1.24.2 pypi_0 pypi openssl 3.0.8 hfd90126_0 conda-forge packaging 23.0 pyhd8ed1ab_0 conda-forge pandas 1.5.3 pypi_0 pypi pandoc 2.19.2 h694c41f_1 conda-forge pandocfilters 1.5.0 pyhd8ed1ab_0 conda-forge parso 0.8.3 pyhd8ed1ab_0 conda-forge pexpect 4.8.0 pyh1a96a4e_2 conda-forge pickleshare 0.7.5 py_1003 conda-forge pillow 9.4.0 pypi_0 pypi pip 23.0 pyhd8ed1ab_0 conda-forge pkgutil-resolve-name 1.3.10 pyhd8ed1ab_0 conda-forge platformdirs 3.0.0 pyhd8ed1ab_0 conda-forge prometheus_client 0.16.0 pyhd8ed1ab_0 conda-forge prompt-toolkit 3.0.36 pyha770c72_0 conda-forge psutil 5.9.4 py39ha30fb19_0 conda-forge ptyprocess 0.7.0 pyhd3deb0d_0 conda-forge pure_eval 0.2.2 pyhd8ed1ab_0 conda-forge pycparser 2.21 pyhd8ed1ab_0 conda-forge pygments 2.14.0 pyhd8ed1ab_0 conda-forge pyopenssl 23.0.0 pyhd8ed1ab_0 conda-forge pyrsistent 0.19.3 py39ha30fb19_0 conda-forge pysocks 1.7.1 pyha2e5f31_6 conda-forge python 3.9.16 h709bd14_0_cpython conda-forge python-dateutil 2.8.2 pyhd8ed1ab_0 conda-forge python-fastjsonschema 2.16.2 pyhd8ed1ab_0 conda-forge python-json-logger 2.0.6 pyhd8ed1ab_0 conda-forge python_abi 3.9 3_cp39 conda-forge pytz 2022.7.1 pyhd8ed1ab_0 conda-forge pyyaml 6.0 py39ha30fb19_5 conda-forge pyzmq 25.0.0 py39hed8f129_0 conda-forge readimc 0.6.2 pypi_0 pypi readline 8.1.2 h3899abd_0 conda-forge requests 2.28.2 pyhd8ed1ab_0 conda-forge scipy 1.10.0 pypi_0 pypi send2trash 1.8.0 pyhd8ed1ab_0 conda-forge setuptools 67.3.1 pyhd8ed1ab_0 conda-forge six 1.16.0 pyh6c4a22f_0 conda-forge sniffio 1.3.0 pyhd8ed1ab_0 conda-forge soupsieve 2.3.2.post1 pyhd8ed1ab_0 conda-forge stack_data 0.6.2 pyhd8ed1ab_0 conda-forge terminado 0.17.1 pyhd1c38e8_0 conda-forge tifffile 2023.2.3 pypi_0 pypi tinycss2 1.2.1 pyhd8ed1ab_0 conda-forge tk 8.6.12 h5dbffcc_0 conda-forge toml 0.10.2 pyhd8ed1ab_0 conda-forge tomli 2.0.1 pyhd8ed1ab_0 conda-forge tornado 6.2 py39ha30fb19_1 conda-forge traitlets 5.9.0 pyhd8ed1ab_0 conda-forge typing-extensions 4.4.0 hd8ed1ab_0 conda-forge typing_extensions 4.4.0 pyha770c72_0 conda-forge tzdata 2022g h191b570_0 conda-forge urllib3 1.26.14 pyhd8ed1ab_0 conda-forge wcwidth 0.2.6 pyhd8ed1ab_0 conda-forge webencodings 0.5.1 py_1 conda-forge websocket-client 1.5.1 pyhd8ed1ab_0 conda-forge wheel 0.38.4 pyhd8ed1ab_0 conda-forge xtiff 0.7.9 pypi_0 pypi xz 5.2.6 h775f41a_0 conda-forge y-py 0.5.5 py39hd4bc93a_2 conda-forge yaml 0.2.5 h0d85af4_2 conda-forge ypy-websocket 0.8.2 pyhd8ed1ab_0 conda-forge zeromq 4.3.4 he49afe7_1 conda-forge zipp 3.13.0 pyhd8ed1ab_0 conda-forge

nilseling commented 1 year ago

Hmm, these are the same package version I'm using on my side. Is the affected file the one you send me?

Guille916 commented 1 year ago

Hmm, yes it is. It seems that the TIFF files from the ilastik folder (ilastik.tiff) are ok, but the ones in the cpout folder aren't (full.tiff). But not sure if this has something to do with the warning message..Not sure what else could be? Maybe try to remove and build the environment again?

Sorry for the trouble!

nilseling commented 1 year ago

Yes, the warning message tells you that empty TIFF files have been written out. Could you please to restart the python kernel and run all chunks again? There should be a button for this at the top.

Guille916 commented 1 year ago

@nilseling Restarting the kernel did work! Now I have the full as well as the ilastick stacks!

Many thanks for your help!

Best, Guille

nilseling commented 1 year ago

Excellent :) I will close this issue now