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

bugs in lung1 dataset preprocess #314

Open
yanniangu opened this issue Nov 28, 2024 · 0 comments
Open

bugs in lung1 dataset preprocess #314

yanniangu opened this issue Nov 28, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@yanniangu
Copy link

I downloaded the lung1 dataset using the lung1.sh script and ran data/preprocessing/lung1/preprocess.ipynb to generate the annotations.csv file. However, when executing the following line in the notebook:

preprocessed_df = build_image_seed_dict(download_dir)

I encountered the following error:

_RemoteTraceback                          Traceback (most recent call last):
_RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/ailab/user/leiwenhui/.conda/envs/gyn/lib/python3.10/concurrent/futures/process.py", line 246, in _process_worker
    r = call_item.fn(*call_item.args, **call_item.kwargs)
  File "/ailab/user/leiwenhui/.conda/envs/gyn/lib/python3.10/concurrent/futures/process.py", line 205, in _process_chunk
    return [fn(*args) for args in chunk]
  File "/ailab/user/leiwenhui/.conda/envs/gyn/lib/python3.10/concurrent/futures/process.py", line 205, in <listcomp>
    return [fn(*args) for args in chunk]
  File "/ailab/user/leiwenhui/.conda/envs/gyn/lib/python3.10/site-packages/fmcib/utils/idc_helper.py", line 225, in process_series_dir
    mask = sitk.ReadImage(str(list(series_dir.glob("*GTV-1*"))[0]))
IndexError: list index out of range
"""

The error above was caused by the following exception:

IndexError                                Traceback (most recent call last)
Cell In[6], [line 1](vscode-notebook-cell:?execution_count=6&line=1)
----> [1](vscode-notebook-cell:?execution_count=6&line=1) preprocessed_df = build_image_seed_dict(
      [2](vscode-notebook-cell:?execution_count=6&line=2)     download_dir
      [3](vscode-notebook-cell:?execution_count=6&line=3) )  # samples=5 is for testing purposes. Remove it to pre-process all images

File ~/.conda/envs/gyn/lib/python3.10/site-packages/fmcib/utils/idc_helper.py:273, in build_image_seed_dict(path, samples)
...
    [404](https://vscode-remote+ssh-002dremote-002bleiwenhui.vscode-resource.vscode-cdn.net/ailab/user/leiwenhui/gyn/foundation-cancer-image-biomarker/data/preprocessing/lung1/~/.conda/envs/gyn/lib/python3.10/concurrent/futures/_base.py:404)     finally:
    [405](https://vscode-remote+ssh-002dremote-002bleiwenhui.vscode-resource.vscode-cdn.net/ailab/user/leiwenhui/gyn/foundation-cancer-image-biomarker/data/preprocessing/lung1/~/.conda/envs/gyn/lib/python3.10/concurrent/futures/_base.py:405)         # Break a reference cycle with the exception in self._exception
    [406](https://vscode-remote+ssh-002dremote-002bleiwenhui.vscode-resource.vscode-cdn.net/ailab/user/leiwenhui/gyn/foundation-cancer-image-biomarker/data/preprocessing/lung1/~/.conda/envs/gyn/lib/python3.10/concurrent/futures/_base.py:406)         self = None

IndexError: list index out of range
``

This issue arises in the `process_series_dir` function in the `idc_helper.py` file when attempting to read the image using `sitk.ReadImage` from a directory containing `GTV-1` in its name. The error occurs because the list created by `series_dir.glob("*GTV-1*")` is empty, leading to an `IndexError` when attempting to access the first element.
@yanniangu yanniangu added the bug Something isn't working label Nov 28, 2024
PaulShiLi added a commit to earlydx-cloud/foundation-cancer-image-biomarker that referenced this issue Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant