Skip to content

KeyError: 'Series UID' in TCIA_PROSTATEx_Prostate_MRI_Anatomy_Model.ipynb #2029

Description

@KumoLiu
[2025-09-17T02:57:30.769Z] Running ./model_zoo/TCIA_PROSTATEx_Prostate_MRI_Anatomy_Model.ipynb

[2025-09-17T02:57:30.769Z] Checking PEP8 compliance...

[2025-09-17T02:57:31.356Z] Running notebook...

[2025-09-17T02:57:41.458Z] <frozen importlib._bootstrap>:914: ImportWarning: _SixMetaPathImporter.find_spec() not found; falling back to find_module()

[2025-09-17T02:57:42.887Z] <frozen importlib._bootstrap>:914: ImportWarning: _SixMetaPathImporter.find_spec() not found; falling back to find_module()

[2025-09-17T02:57:46.245Z] MONAI version: 1.5.0+20.g401ea4a0

[2025-09-17T02:57:46.245Z] Numpy version: 1.24.4

[2025-09-17T02:57:46.245Z] Pytorch version: 2.5.0a0+e000cf0ad9.nv24.10

[2025-09-17T02:57:46.245Z] MONAI flags: HAS_EXT = False, USE_COMPILED = False, USE_META_DICT = False

[2025-09-17T02:57:46.245Z] MONAI rev id: 401ea4a0af2b9d475989a78e1bae387875fa2384

[2025-09-17T02:57:46.245Z] MONAI __file__: /home/jenkins/agent/workspace/Monai-notebooks/MONAI/monai/__init__.py

[2025-09-17T02:57:46.245Z] 

[2025-09-17T02:57:46.245Z] Optional dependencies:

[2025-09-17T02:57:46.245Z] Pytorch Ignite version: 0.4.11

[2025-09-17T02:57:46.245Z] ITK version: 5.4.4

[2025-09-17T02:57:46.245Z] Nibabel version: 5.3.2

[2025-09-17T02:57:46.245Z] scikit-image version: 0.19.3

[2025-09-17T02:57:46.245Z] scipy version: 1.14.0

[2025-09-17T02:57:46.245Z] Pillow version: 11.3.0

[2025-09-17T02:57:46.245Z] Tensorboard version: 2.16.2

[2025-09-17T02:57:46.245Z] gdown version: 5.2.0

[2025-09-17T02:57:46.245Z] TorchVision version: 0.20.0a0

[2025-09-17T02:57:46.245Z] tqdm version: 4.66.5

[2025-09-17T02:57:46.245Z] lmdb version: 1.7.3

[2025-09-17T02:57:46.245Z] psutil version: 6.0.0

[2025-09-17T02:57:46.245Z] pandas version: 2.2.2

[2025-09-17T02:57:46.245Z] einops version: 0.8.0

[2025-09-17T02:57:46.245Z] transformers version: 4.40.2

[2025-09-17T02:57:46.245Z] mlflow version: 3.3.2

[2025-09-17T02:57:46.245Z] pynrrd version: 1.1.3

[2025-09-17T02:57:46.245Z] clearml version: 2.0.3rc0

[2025-09-17T02:57:46.245Z] 

[2025-09-17T02:57:46.245Z] For details about installing the optional dependencies, please visit:

[2025-09-17T02:57:46.245Z]     https://docs.monai.io/en/latest/installation.html#installing-the-recommended-dependencies

[2025-09-17T02:57:46.245Z] 

[2025-09-17T02:57:48.887Z] papermill  --progress-bar --log-output -k python3

[2025-09-17T02:57:49.179Z] /usr/local/lib/python3.10/dist-packages/papermill/iorw.py:149: UserWarning: the file is not specified with any extension : -

[2025-09-17T02:57:49.179Z]   warnings.warn(f"the file is not specified with any extension : {os.path.basename(path)}")

[2025-09-17T02:57:49.179Z] 
[2025-09-17T02:57:50.175Z] Executing:   0%|          | 0/32 [00:00<?, ?cell/s]
[2025-09-17T02:59:11.808Z] Executing:   3%|▎         | 1/32 [00:00<00:27,  1.11cell/s]
[2025-09-17T02:59:24.154Z] Executing:  22%|██▏       | 7/32 [01:20<04:59, 12.00s/cell]
[2025-09-17T02:59:27.504Z] Executing:  28%|██▊       | 9/32 [01:34<03:59, 10.43s/cell]
[2025-09-17T02:59:28.907Z] Executing:  38%|███▊      | 12/32 [01:38<02:17,  6.87s/cell]
[2025-09-17T02:59:33.159Z] Executing:  44%|████▍     | 14/32 [01:39<01:34,  5.23s/cell]
[2025-09-17T02:59:33.159Z] Executing:  44%|████▍     | 14/32 [01:43<02:12,  7.38s/cell]

[2025-09-17T02:59:33.159Z] /usr/local/lib/python3.10/dist-packages/papermill/iorw.py:149: UserWarning: the file is not specified with any extension : -

[2025-09-17T02:59:33.159Z]   warnings.warn(f"the file is not specified with any extension : {os.path.basename(path)}")

[2025-09-17T02:59:33.159Z] Traceback (most recent call last):

[2025-09-17T02:59:33.159Z]   File "/usr/local/bin/papermill", line 7, in <module>

[2025-09-17T02:59:33.159Z]     sys.exit(papermill())

[2025-09-17T02:59:33.159Z]   File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1157, in __call__

[2025-09-17T02:59:33.159Z]     return self.main(*args, **kwargs)

[2025-09-17T02:59:33.159Z]   File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1078, in main

[2025-09-17T02:59:33.159Z]     rv = self.invoke(ctx)

[2025-09-17T02:59:33.159Z]   File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1434, in invoke

[2025-09-17T02:59:33.159Z]     return ctx.invoke(self.callback, **ctx.params)

[2025-09-17T02:59:33.159Z]   File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 783, in invoke

[2025-09-17T02:59:33.159Z]     return __callback(*args, **kwargs)

[2025-09-17T02:59:33.159Z]   File "/usr/local/lib/python3.10/dist-packages/click/decorators.py", line 33, in new_func

[2025-09-17T02:59:33.159Z]     return f(get_current_context(), *args, **kwargs)

[2025-09-17T02:59:33.159Z]   File "/usr/local/lib/python3.10/dist-packages/papermill/cli.py", line 235, in papermill

[2025-09-17T02:59:33.159Z]     execute_notebook(

[2025-09-17T02:59:33.159Z]   File "/usr/local/lib/python3.10/dist-packages/papermill/execute.py", line 131, in execute_notebook

[2025-09-17T02:59:33.159Z]     raise_for_execution_errors(nb, output_path)

[2025-09-17T02:59:33.159Z]   File "/usr/local/lib/python3.10/dist-packages/papermill/execute.py", line 251, in raise_for_execution_errors

[2025-09-17T02:59:33.159Z]     raise error

[2025-09-17T02:59:33.159Z] papermill.exceptions.PapermillExecutionError: 

[2025-09-17T02:59:33.159Z] ---------------------------------------------------------------------------

[2025-09-17T02:59:33.159Z] Exception encountered at "In [5]":

[2025-09-17T02:59:33.159Z] ---------------------------------------------------------------------------

[2025-09-17T02:59:33.159Z] KeyError                                  Traceback (most recent call last)

[2025-09-17T02:59:33.159Z] File /usr/local/lib/python3.10/dist-packages/pandas/core/indexes/base.py:3805, in Index.get_loc(self, key)

[2025-09-17T02:59:33.159Z]    3804 try:

[2025-09-17T02:59:33.159Z] -> 3805     return self._engine.get_loc(casted_key)

[2025-09-17T02:59:33.159Z]    3806 except KeyError as err:

[2025-09-17T02:59:33.159Z] 

[2025-09-17T02:59:33.159Z] File index.pyx:167, in pandas._libs.index.IndexEngine.get_loc()

[2025-09-17T02:59:33.159Z] 

[2025-09-17T02:59:33.159Z] File index.pyx:196, in pandas._libs.index.IndexEngine.get_loc()

[2025-09-17T02:59:33.159Z] 

[2025-09-17T02:59:33.159Z] File pandas/_libs/hashtable_class_helper.pxi:7081, in pandas._libs.hashtable.PyObjectHashTable.get_item()

[2025-09-17T02:59:33.159Z] 

[2025-09-17T02:59:33.159Z] File pandas/_libs/hashtable_class_helper.pxi:7089, in pandas._libs.hashtable.PyObjectHashTable.get_item()

[2025-09-17T02:59:33.159Z] 

[2025-09-17T02:59:33.159Z] KeyError: 'Series UID'

[2025-09-17T02:59:33.159Z] 

[2025-09-17T02:59:33.159Z] The above exception was the direct cause of the following exception:

[2025-09-17T02:59:33.159Z] 

[2025-09-17T02:59:33.159Z] KeyError                                  Traceback (most recent call last)

[2025-09-17T02:59:33.159Z] Cell In[5], line 4

[2025-09-17T02:59:33.159Z]       1 dicom_data_dir = "tciaDownload"

[2025-09-17T02:59:33.159Z]       3 # The series_uid defines their directory where the MR data was stored on disk.

[2025-09-17T02:59:33.159Z] ----> 4 mr_series_uid = df.at[df.Modality.eq("MR").idxmax(), "Series UID"]

[2025-09-17T02:59:33.159Z]       5 mr_dir = os.path.join(dicom_data_dir, mr_series_uid)

[2025-09-17T02:59:33.159Z]       7 # Read the DICOM MR series' objects and reconstruct them into a 3D ITK image.

[2025-09-17T02:59:33.159Z]       8 #   The itk.F option is added to store the image in memory using floating-point precision pixels (useful if you will filter the image or use it with MONAI).

[2025-09-17T02:59:33.159Z]       9 #   For more info on imread, see https://itkpythonpackage.readthedocs.io/en/master/Quick_start_guide.html.

[2025-09-17T02:59:33.159Z] 

[2025-09-17T02:59:33.159Z] File /usr/local/lib/python3.10/dist-packages/pandas/core/indexing.py:2575, in _AtIndexer.__getitem__(self, key)

[2025-09-17T02:59:33.159Z]    2572         raise ValueError("Invalid call for scalar access (getting)!")

[2025-09-17T02:59:33.159Z]    2573     return self.obj.loc[key]

[2025-09-17T02:59:33.159Z] -> 2575 return super().__getitem__(key)

[2025-09-17T02:59:33.159Z] 

[2025-09-17T02:59:33.159Z] File /usr/local/lib/python3.10/dist-packages/pandas/core/indexing.py:2527, in _ScalarAccessIndexer.__getitem__(self, key)

[2025-09-17T02:59:33.159Z]    2524         raise ValueError("Invalid call for scalar access (getting)!")

[2025-09-17T02:59:33.159Z]    2526 key = self._convert_key(key)

[2025-09-17T02:59:33.159Z] -> 2527 return self.obj._get_value(*key, takeable=self._takeable)

[2025-09-17T02:59:33.159Z] 

[2025-09-17T02:59:33.159Z] File /usr/local/lib/python3.10/dist-packages/pandas/core/frame.py:4214, in DataFrame._get_value(self, index, col, takeable)

[2025-09-17T02:59:33.159Z]    4211     series = self._ixs(col, axis=1)

[2025-09-17T02:59:33.159Z]    4212     return series._values[index]

[2025-09-17T02:59:33.159Z] -> 4214 series = self._get_item_cache(col)

[2025-09-17T02:59:33.159Z]    4215 engine = self.index._engine

[2025-09-17T02:59:33.159Z]    4217 if not isinstance(self.index, MultiIndex):

[2025-09-17T02:59:33.159Z]    4218     # CategoricalIndex: Trying to use the engine fastpath may give incorrect

[2025-09-17T02:59:33.159Z]    4219     #  results if our categories are integers that dont match our codes

[2025-09-17T02:59:33.159Z]    4220     # IntervalIndex: IntervalTree has no get_loc

[2025-09-17T02:59:33.159Z] 

[2025-09-17T02:59:33.159Z] File /usr/local/lib/python3.10/dist-packages/pandas/core/frame.py:4638, in DataFrame._get_item_cache(self, item)

[2025-09-17T02:59:33.159Z]    4633 res = cache.get(item)

[2025-09-17T02:59:33.159Z]    4634 if res is None:

[2025-09-17T02:59:33.159Z]    4635     # All places that call _get_item_cache have unique columns,

[2025-09-17T02:59:33.159Z]    4636     #  pending resolution of GH#33047

[2025-09-17T02:59:33.159Z] -> 4638     loc = self.columns.get_loc(item)

[2025-09-17T02:59:33.159Z]    4639     res = self._ixs(loc, axis=1)

[2025-09-17T02:59:33.159Z]    4641     cache[item] = res

[2025-09-17T02:59:33.159Z] 

[2025-09-17T02:59:33.159Z] File /usr/local/lib/python3.10/dist-packages/pandas/core/indexes/base.py:3812, in Index.get_loc(self, key)

[2025-09-17T02:59:33.159Z]    3807     if isinstance(casted_key, slice) or (

[2025-09-17T02:59:33.159Z]    3808         isinstance(casted_key, abc.Iterable)

[2025-09-17T02:59:33.159Z]    3809         and any(isinstance(x, slice) for x in casted_key)

[2025-09-17T02:59:33.159Z]    3810     ):

[2025-09-17T02:59:33.159Z]    3811         raise InvalidIndexError(key)

[2025-09-17T02:59:33.159Z] -> 3812     raise KeyError(key) from err

[2025-09-17T02:59:33.159Z]    3813 except TypeError:

[2025-09-17T02:59:33.159Z]    3814     # If we have a listlike key, _check_indexing_error will raise

[2025-09-17T02:59:33.159Z]    3815     #  InvalidIndexError. Otherwise we fall through and re-raise

[2025-09-17T02:59:33.159Z]    3816     #  the TypeError.

[2025-09-17T02:59:33.159Z]    3817     self._check_indexing_error(key)

[2025-09-17T02:59:33.159Z] 

[2025-09-17T02:59:33.159Z] KeyError: 'Series UID'

Activity

  1. ericspod commented on Sep 18, 2025

    @ericspod
    Member

    I'm looking into this, but one issue I'm seeing is that pydicom-seg hasn't been updated in 2 years. This might be a dead project we shouldn't rely on as a dependency.

  2. ericspod commented on Sep 18, 2025

    @ericspod
    Member

    The table appears to be presenting the Series UID in the column "Series ID" now, I think changing the column selection in various places to that string will work.

  3. ericspod commented on Sep 18, 2025

    @ericspod
    Member

    We also need to add huggingface_hub as a new dependency to install, and itkwidgets might require a different version of zarr versus other dependencies and causing a conflict in some configurations.

  4. kirbyju commented on Sep 22, 2025

    @kirbyju
    Contributor

    I can't figure out how to fix the issues related to huggingface_hub or itkwidgets. Maybe @thewtex or @aylward can help with itkwidgets as I didn't write that part of the notebook. I think I can resolve the parts related to tcia_utils (changing to "Series ID" works) and get rid of the dependency on pydicom_seg.

  5. thewtex commented on Sep 23, 2025

    @thewtex
    Collaborator
  6. kirbyju commented on Sep 23, 2025

    @kirbyju
    Contributor

    I think the changes shown in https://colab.research.google.com/drive/1N7dFgTKqVAXmGtL2RXlvd05WkC648zBP?usp=sharing address the data download bug, eliminate the need for pydicom_seg (resulting nifti files seem to open fine in Slicer), and clean up other unnecessary complexity in the installations/imports. I'm still stuck on itkwidgets though. Nothing happens when I run that cell even after upgrading to v55. Also, it seems like the huggingface part may be more of a "nice to have" thing because as far as I could tell the model still downloads and runs properly?

  7. thewtex commented on Sep 23, 2025

    @thewtex
    Collaborator

    For the itkwidgets install line, does adding zarr<3 help?

  8. kirbyju commented on Sep 23, 2025

    @kirbyju
    Contributor

    @ericspod I just tried on Jupyter instead of Colab and ran into the huggingface issue. Didn't realize that was pre-installed by Colab.

    @thewtex adding zarr<3 seemed like it would help. At least in Colab it displayed the plugin icon, but it hung there indefinitely and never loaded the images/seg:

    Image

    But in Jupyter I'm just getting this:

    Image
  9. ericspod commented on Sep 26, 2025

    @ericspod
    Member

    Hi @kirbyju and @thewtex thanks for the help on this one. This notebook could be amended to force zarr-2 installation but the itkwidgets problem is possibly still there. I've copied over from the example Colab link any changes with slight updates. On Windows I ran everything (just about) with Jupyter (not Jupyterlab or through vscode) after running the install cell, installing the plugin, and restarting the notebook. The following raises an exception for me:

    interpolator = itk.NearestNeighborInterpolateImageFunction.New(seg_image)
    result_image_resampled = itk.resample_image_filter(
        Input=result_image, Interpolator=interpolator, reference_image=seg_image_prep, use_reference_image=True
    )

    This raises TypeError: in method 'itkResampleImageFilterIF3IF3_SetInterpolator', argument 2 of type 'itkInterpolateImageFunctionIF3D *', meaning it doesn't like the interpolator object. If I omit the Interpolator argument this works but will produce differing results I assume. Following cells run fine showing the itk viewers as expected. We still have a challenge that this doesn't render in Colab but does technically work.

    I also noticed that I do require Huggingface with MONAI 1.5.1, we don't correctly handle the fallback case when huggingface_hub is not installed so this will need addressing in the next release. I got it to work by just installing huggingface_hub which ended up working correctly for me.

    My full Python 3.12.11 environment

    Package                    Version
    -------------------------- --------------
    aiofiles                   24.1.0
    aiohappyeyeballs           2.6.1
    aiohttp                    3.12.15
    aiosignal                  1.4.0
    anyio                      4.11.0
    argon2-cffi                25.1.0
    argon2-cffi-bindings       25.1.0
    arrow                      1.3.0
    asciitree                  0.3.3
    asttokens                  3.0.0
    async-lru                  2.0.5
    attrs                      25.3.0
    babel                      2.17.0
    beautifulsoup4             4.13.5
    bleach                     6.2.0
    bs4                        0.0.2
    certifi                    2025.8.3
    cffi                       2.0.0
    charset-normalizer         3.4.3
    click                      8.3.0
    cloudpickle                3.1.1
    colorama                   0.4.6
    colorcet                   3.1.0
    comm                       0.2.3
    contourpy                  1.3.3
    crc32c                     2.7.1
    cycler                     0.12.1
    dask                       2025.9.1
    debugpy                    1.8.17
    decorator                  5.2.1
    defusedxml                 0.7.1
    Deprecated                 1.2.18
    donfig                     0.8.1.post1
    elfinder-client            2.1.62a3
    executing                  2.2.1
    fastapi                    0.117.1
    fasteners                  0.20
    fastjsonschema             2.21.2
    filelock                   3.19.1
    fonttools                  4.60.0
    fqdn                       1.5.1
    frozenlist                 1.7.0
    fsspec                     2025.9.0
    h11                        0.16.0
    httpcore                   1.0.9
    httptools                  0.6.4
    httpx                      0.28.1
    huggingface-hub            0.35.1
    idna                       3.10
    imageio                    2.37.0
    imjoy-elfinder             0.1.63
    imjoy_jupyterlab_extension 0.2.6
    imjoy-rpc                  0.5.59
    imjoy-utils                0.1.2
    importlib_metadata         8.7.0
    importlib_resources        6.5.2
    ipykernel                  6.30.1
    ipython                    8.21.0
    ipython-genutils           0.2.0
    ipython_pygments_lexers    1.1.1
    ipywidgets                 8.1.7
    isoduration                20.11.0
    itk                        5.4.4.post1
    itk-core                   5.4.4.post1
    itk-filtering              5.4.4.post1
    itk-io                     5.4.4.post1
    itk-meshtopolydata         0.11.1
    itk-numerics               5.4.4.post1
    itk-registration           5.4.4.post1
    itk-segmentation           5.4.4.post1
    itkwasm                    1.0b195
    itkwasm-downsample         1.7.1
    itkwasm-downsample-wasi    1.7.1
    itkwidgets                 1.0a55
    jedi                       0.19.2
    Jinja2                     3.1.6
    json5                      0.12.1
    jsonpointer                3.0.0
    jsonschema                 4.25.1
    jsonschema-specifications  2025.9.1
    jupyter                    1.1.1
    jupyter_client             8.6.3
    jupyter-console            6.6.3
    jupyter_core               5.8.1
    jupyter-events             0.12.0
    jupyter-lsp                2.3.0
    jupyter_server             2.17.0
    jupyter_server_proxy       4.4.0
    jupyter_server_terminals   0.5.3
    jupyterlab                 4.4.8
    jupyterlab_pygments        0.3.0
    jupyterlab_server          2.27.3
    jupyterlab_widgets         1.1.11
    kiwisolver                 1.4.9
    lark                       1.3.0
    lazy_loader                0.4
    locket                     1.0.0
    markdown-it-py             4.0.0
    MarkupSafe                 3.0.2
    matplotlib                 3.10.6
    matplotlib-inline          0.1.7
    mdurl                      0.1.2
    mistune                    3.1.4
    monai                      1.5.1
    mpmath                     1.3.0
    msgpack                    1.1.1
    multidict                  6.6.4
    narwhals                   2.5.0
    nbclient                   0.10.2
    nbconvert                  7.16.6
    nbformat                   5.10.4
    nest-asyncio               1.6.0
    networkx                   3.5
    ngff-zarr                  0.17.0
    nibabel                    5.3.2
    notebook_shim              0.2.4
    numcodecs                  0.15.1
    numpy                      2.2.6
    opencv-python-headless     4.12.0.88
    packaging                  25.0
    pandas                     2.3.2
    pandocfilters              1.5.1
    parso                      0.8.5
    partd                      1.4.2
    pathvalidate               3.3.1
    pillow                     11.3.0
    pip                        25.2
    platformdirs               4.4.0
    plotly                     6.3.0
    prometheus_client          0.23.1
    prompt_toolkit             3.0.52
    propcache                  0.3.2
    psutil                     7.1.0
    pure_eval                  0.2.3
    pycparser                  2.23
    pydantic                   1.10.24
    pydicom                    3.0.1
    Pygments                   2.19.2
    pyparsing                  3.2.5
    python-dateutil            2.9.0.post0
    python-dotenv              1.1.1
    python-json-logger         3.3.0
    python-multipart           0.0.20
    pytz                       2025.2
    pywin32                    311
    pywinpty                   3.0.0
    PyYAML                     6.0.3
    pyzmq                      27.1.0
    referencing                0.36.2
    requests                   2.32.5
    rfc3339-validator          0.1.4
    rfc3986-validator          0.1.1
    rfc3987-syntax             1.1.0
    rich                       14.1.0
    rich-argparse              1.7.1
    rpds-py                    0.27.1
    scikit-image               0.25.2
    scipy                      1.16.2
    Send2Trash                 1.8.3
    setuptools                 78.1.1
    shortuuid                  1.0.13
    simpervisor                1.0.0
    six                        1.17.0
    sniffio                    1.3.1
    soupsieve                  2.8
    stack-data                 0.6.3
    starlette                  0.48.0
    sympy                      1.14.0
    tcia_utils                 3.0.4
    terminado                  0.18.1
    tifffile                   2025.9.20
    tinycss2                   1.4.0
    toolz                      1.0.0
    torch                      2.8.0
    tornado                    6.5.2
    tqdm                       4.67.1
    traitlets                  5.6.0
    traittypes                 0.2.1
    types-python-dateutil      2.9.0.20250822
    typing_extensions          4.15.0
    tzdata                     2025.2
    Unidecode                  1.4.0
    uri-template               1.3.0
    urllib3                    2.5.0
    uvicorn                    0.37.0
    wasmtime                   36.0.0
    watchfiles                 1.1.0
    wcwidth                    0.2.14
    webcolors                  24.11.1
    webencodings               0.5.1
    websocket-client           1.8.0
    websockets                 15.0.1
    wheel                      0.45.1
    widgetsnbextension         4.0.14
    wrapt                      1.17.3
    yarl                       1.20.1
    zarr                       2.18.7
    zipp                       3.23.0
    zstandard                  0.25.0
    

  10. moved this to Todo in MONAI v1.6on Sep 26, 2025
  11. ericspod commented on Sep 26, 2025

    @ericspod
    Member

    I opened a PR on this issue if you could review, thanks.

  12. thewtex commented on Sep 26, 2025

    @thewtex
    Collaborator

    @ericspod awesome work! LGTM.

    This raises TypeError: in method 'itkResampleImageFilterIF3IF3_SetInterpolator', argument 2 of type 'itkInterpolateImageFunctionIF3D *', meaning it doesn't like the interpolator object. If I omit the Interpolator argument this works but will produce differing results I assume.

    interpolator = itk.NearestNeighborInterpolateImageFunction.New(seg_image)
    result_image_resampled = itk.resample_image_filter(
    Input=result_image, Interpolator=interpolator, reference_image=seg_image_prep, use_reference_image=True
    )

    We may be able to resolve the type issue with:

    interpolator = itk.NearestNeighborInterpolateImageFunction.New(seg_image.astype(result_image.dtype))
    

    or

    interpolator = itk.NearestNeighborInterpolateImageFunction.New(seg_image.astype(seg_image_prep.dtype))
    

    (untested)

  13. ericspod commented on Oct 29, 2025

    @ericspod
    Member

    Hi @thewtex sorry for the delay, I have this fix integrated into #2037 now. Thanks!

  14. added a commit that references this issue on Oct 30, 2025
    3cacee2
  15. kirbyju commented on Oct 30, 2025

    @kirbyju
    Contributor

    Hi all, I sincerely apologize for the back and forth on this Series UID thing, but after this issue was discovered the underlying NBIA API was recently changed in v4 to fix the inconsistencies in the fields returned and the newest release of tcia_utils was updated to match. It is now "SeriesInstanceUID" across the board for all queries that return series-level DICOM metadata. Unfortunately, we didn't have tcia_utils pinned to any particular version in the notebook so that update is breaking the notebook again due to using "Series UID" in 2 cells. I don't anticipate any more issues with this kind of thing moving forward, but it might still make sense to pin to the v3.2.1 of tcia_utils just in case?

    I also tested Eric's other changes just now. In Colab it renders the imjoy plugin logo as if it's going to work, but then never loads the actual image data for me. Despite that, it proceeds to the inference step and then hangs indefinitely (or at least for 13min so far). I'm using a free Colab account in case that matters. It doesn't seem to be running out of ram. I have it set to a t4 GPU runtime.

    Image

    On my local macbook Jupyter installation I'm having very similar problems (imjoy not working, hanging on inference):

    Image
  16. ericspod commented on Oct 30, 2025

    @ericspod
    Member

    Hi all, I sincerely apologize for the back and forth on this Series UID thing, but after this issue was discovered the underlying NBIA API was recently changed in v4 to fix the inconsistencies in the fields returned and the newest release of tcia_utils was updated to match. It is now "SeriesInstanceUID" across the board for all queries that return series-level DICOM metadata. Unfortunately, we didn't have tcia_utils pinned to any particular version in the notebook so that update is breaking the notebook again due to using "Series UID" in 2 cells. I don't anticipate any more issues with this kind of thing moving forward, but it might still make sense to pin to the v3.2.1 of tcia_utils just in case?

    Thanks for looking into this, is there a new fix we should do a PR for? If you wanted to propose that we can merge that before it causes CI issues.

    As for the plugin, it might be sensitive to what browser you use, platform, and other factors to determine if the plugin works. I managed to get things running as you see in the notebook updates using Firefox in Windows, perhaps trying a different browser or OS would be an idea if you can. You can also look at the Javascript console in your browser's developer panel to see if anything is printed there to indicate why the plugin fails.

  17. kirbyju commented on Oct 31, 2025

    @kirbyju
    Contributor

    I submitted the suggested fixes related to tcia_utils.

    Looking again at the itkwidgets issue, I'm still not having any luck with itkwidgets on Firefox or Chrome for Colab on my Macbook, but I got it working in my Jupyter Lab local system.

  18. ericspod commented on Nov 4, 2025

    @ericspod
    Member

    Looking again at the itkwidgets issue, I'm still not having any luck with itkwidgets on Firefox or Chrome for Colab on my Macbook, but I got it working in my Jupyter Lab local system.

    I hope this isn't a problem for colab in general but we'll have to do some more testing to see where the problem is coming from with the interaction of platforms and browsers. I see the PR for the notebook fix, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions