steinbock
steinbock copied to clipboard
Segmentation issues
There are few issues running steinbock: Once I have # Select a random image rng = np.random.default_rng() ix = rng.choice(len(segstacks)) I see a value error (ValueError: a must be a positive integer unless no samples are taken) Additionally, ModuleNotFoundError: No module named 'deepcell_toolbox' And in preprocessing I see NameError: name 'Acquisition' is not defined. If you can help, it would be great.
Best, Saeed
Hi @KHALILISAEED, thanks for reaching out. From @nilseling I understand that you're using steinbock v0.15. Could you please post the exact script/command you're trying to run? And, if you're using the steinbock Docker container (recommended), the steinbock
command alias? Thanks
I have installed steinbock through Python (not docker). I copied your Steinbock repository into colab google, chose examples under Branch, and then select and copied all codes from 01preprocessing_if, 01preprocessing_imc, 02segmentation_deepcell and 03 measurement paste into jupyter notebook. I have practically used all of the codes from these 4 examples. Please see the attached and let me know if you have any question. I appreciate your help.
Best
Please note that #135 has not yet been merged into main
and that we therefore do not fully support scripts from the examples
branch at this point. However, the scripts will likely be reviewed and merged over the coming two weeks. In the meantime, their main author, @ndamond, may be able to help.
Hi @KHALILISAEED,
As @jwindhager mentioned, the jupyter scripts are not finalized yet. The standard way to use steinbock
is currently to use docker: https://bodenmillergroup.github.io/steinbock/latest/install-docker/
If you still want to use the notebooks:
- Note that the
01_preprocessing_if
notebook is not usable yet. - Can you describe how you installed the python libraries in google colab?
- After the installation, could you paste the output of
!pip list -v
here? - The error you see is caused by an empty image list. After running after running the first script (
01_preprocessing_imc
), can you check if the folder tree below is being generated? And can you check the content of theimg
subfolder?
steinbock data/working directory
├── raw
| └── *.zip (raw data)
├── img
├── segstacks
├── masks
├── intensities
├── regionprops
└── neighbors
Best, Nicolas
Hi Nicolas and team members: Thanks so much for getting back to me so quickly with your feedback and comments. I am not a data scientist!I only took a course for basic python as a Stem Cell Biologist and started using it. Regarding docket, I do not know how to use it. Is there a page or simple step by step setting up docker document where I can learn and use it. It would mean a lot to me if you can help me with that. I can start using it today. We are a group at U of T in Toronto, Canada alongside a few others who use IMC (Vincent Piguet Lab). I only used colab to reveal the codes and then copy and paste the codes into a new jupyter notebook and started running them. I have not run any script or installed any package in the colab directly.
I will go through your comments when I get to the lab. Many thanks.
Best, Saeed
On Wed, Nov 2, 2022 at 3:33 AM Nicolas Damond @.***> wrote:
Hi @KHALILISAEED https://github.com/KHALILISAEED,
As @jwindhager https://github.com/jwindhager mentioned, the jupyter scripts are not finalized yet. The standard way to use steinbock is currently to use docker: https://bodenmillergroup.github.io/steinbock/latest/install-docker/
If you still want to use the notebooks:
- Note that the 01_preprocessing_if notebook is not usable yet.
- Can you describe how you installed the python libraries in google colab?
- After the installation, could you paste the output of !pip list -v here?
- The error you see is caused by an empty image list. After running after running the first script (01_preprocessing_imc), can you check if the folder tree below is being generated? And can you check the content of the img subfolder?
steinbock data/working directory
├── raw
| └── *.zip (raw data)
├── img
├── segstacks
├── masks
├── intensities
├── regionprops
└── neighbors
Best, Nicolas
— Reply to this email directly, view it on GitHub https://github.com/BodenmillerGroup/steinbock/issues/153#issuecomment-1299695413, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZ5YYYM4SWAUJHVWQU4PTU3WGIKODANCNFSM6AAAAAARUNA56Q . You are receiving this because you were mentioned.Message ID: @.***>
Hi @KHALILISAEED,
have a look at the documentation of steinbock
here.
Please zip each MCD + related TXT files and place all ZIP files in the folder /path/to/data/raw
. When docker is installed and running (see installation instructions) you define an alias in the command line via (e.g. for Mac):
alias steinbock="docker run -v /path/to/data:/data -v /tmp/.X11-unix:/tmp/.X11-unix -v ~/.Xauthority:/home/steinbock/.Xauthority:ro -u $(id -u):$(id -g) -e DISPLAY=$(hostname):0 ghcr.io/bodenmillergroup/steinbock:0.15.0"
Please note that you will need to adjust the /path/to/data
folder to where you data is located.
After this you create a panel file directly from the MCD metadata running:
steinbock preprocess imc panel
open the generated /path/to/data/panel.csv
file, specify which channels you want to process by adding a 1
in the keep
column and otherwise 0
and indicate nuclear channels with a 1
in the deepcell
column and cytoplasmic channels with a 2
in the deepcell
column.
Image processing, cell segmentation and feature extraction is then performed via following command line calls:
steinbock preprocess imc images --hpf 50
steinbock segment deepcell --minmax
steinbock measure intensities
steinbock measure regionprops
steinbock measure neighbors --type expansion --dmax 4
Assuming this is resolved.