Project-MONAI / Project-MONAI/tutorials

using collection names with spaces in them breaks tcia_dataset.ipynb

Open
#876 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Jupyter Notebook
Stars
2.5k
Forks
803
Avg merge
6d 22h
Merged PRs (30d)
3

Description

Describe the bug
In the "Create TciaDataset" step of the notebook if you enter a collection with spaces (e.g. "Lung Phantom") into the collection variable it produces an error. Here is the relevant part of the code:

Let's take the "QIN-PROSTATE-Repeatability" collection for example

collection, seg_type = "QIN-PROSTATE-Repeatability", "SEG"

Here is the error:

KeyError Traceback (most recent call last)
in
5 transform = Compose(
6 [
----> 7 LoadImaged(reader="PydicomReader", keys=["image", "seg"], label_dict=TCIA_LABEL_DICT[collection]),
8 ]
9 )

KeyError: 'Lung Phantom'

Environment (please complete the following information):
I was working on Google Colab

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in tcia_dataset.ipynb at the “Create TciaDataset” step, examining TCIA_LABEL_DICT[collection] and the LoadImaged configuration. Reproduce the failure with the “Lung Phantom” collection in Google Colab; done means the notebook accepts collection names containing spaces without raising KeyError.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter-notebook
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.