LungCTAnalyzer input file error

CUDA available: True
3Dslicer5.0.3

Error occurs when I use my patient data
RuntimeError: unexpected EOF, expected 10008318 more bytes. The file might be corrupted.

How con I slove this problem?
thanks

Please update your 3D Slicer version to version 5.2.2 stable. Does the error persist?

Please describe in more detail how you load your data. Is this DICOM, a *.nrrd file, or a *.mrb file?
Have you run Lung CT Segmenter before Lung CT Analyzer?

It would be helpful if you could provide a screenshot of the error message and/or a log file. It could also help if you would provide the Lung CT Analyzer version number.

I have updated the version to 5.2.2 stable version, pythoch1.13.1+cu117, Chest_ Imaging_ Platform version: fccea26 (2023-02-22), LungCTAnalyzer version: 3ae8061 (2023-03-10), but the error still exists.
I want to use the Lung CT Segmenter plug-in, which is available when using lungmask R231, and use lungmask LTRCLobes_ R231 reported an error
The imported patient file is in. dcm format, and the screenshot of Python Console is as follows:

Thank you. In this case, the AI tool “lungmask LTRCLobes_R231” generates this exception.

Is it correct to assume that you imported your DCM data via the DICOM database → “Import DICOM data”?

image

Could you please do an additional test:
Close 3D Slicer, reopen it and load the CTChest sample dataset

image

Process Lung CT Segmenter with lungmask AI just to make sure the basic installation works.

Yes, but there are also problems when using the test lung CT
Unfortunately, I was wondering if there was something wrong with my installation?

Please provide system information:
Processor, memory, GPU brand and model, dedicated video RAM

OK, I reinstalled 3dslicer and used CTChest sample dataset for testing. The first error is shown in the following screenshot
My system CPU: 11th Gen Intel (R) Core ™ i5-11400H @ 2.70GHz 2.69 GHz
Graphics card: NVIDIA GeForce RTX 3050 Laptop
Dedicated video RAM: only 4GB, I know it may not meet the minimum requirement of 6GB, but I still want to try this plug-in. Is there any way?
Could there be an error updating my pip?
ImportError: DLL load failed while importing _ Ufuncs: The specified module cannot be found.
Thank you very much for answering my questions


Please restart 3D Slicer (“run as Administrator”), type

slicer.util.pip_install("lungmask")

into the Python Console and post the output.

Thank you. It seems that “lungmask” has been installed, but the same error may be reported after that:



RuntimeError: unexpected EOF, expected 10008318 more bytes. The file might be corrupted.
Everything goes back to the previous question
I’m going to crash. Thank you very much for answering my questions all the time
What should I do next?

Try running “lungmask R231”. Same result?

“Lungmask R231” can always operate normally

@rbumm Your code specifies to install the latest of the lungmask python module.

The lungmask python module appears to require a specific version of Simple ITK (1.2.4)?

However uninstalling Slicer’s SimpleITK version and replacing it with an older version is not supported currently.

If “lungmask R231” runs normally it indicates that hardware limitations, most probable the limited dedicated video RAM that you have available on your system, could cause the error when using “lungmask LCTRLobes_R231”.

Indeed, it seems that this is the key point of the problem. Is there any other solution for me to use “lungmask LCTRLobes_R231”?

1 Like

I thought so at the beginning, but under the existing hardware conditions, is it possible for me to try and experience “lungmask LTRCLobes_R231”?
As [jamesobutler]said, it may be the reason for the Simple ITK version? Will it help me switch to the old version of 3dslicer?

Thank you @jamesobutler

When I create a fresh 3D Slicer install and just do:

slicer.util.pip_install("https://github.com/JoHof/lungmask/archive/master.zip")

the SimpleITK requirement seems to be “already satisfied” and not getting downgraded?

Collecting https://github.com/JoHof/lungmask/archive/master.zip
  Using cached https://github.com/JoHof/lungmask/archive/master.zip
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Requirement already satisfied: pydicom in c:\users\rudol\appdata\local\na-mic\slicer 5.2.2_2\lib\python\lib\site-packages (from lungmask==0.2.13) (2.3.1)
Requirement already satisfied: numpy in c:\users\rudol\appdata\local\na-mic\slicer 5.2.2_2\lib\python\lib\site-packages (from lungmask==0.2.13) (1.23.4)
Collecting torch
  Using cached torch-1.13.1-cp39-cp39-win_amd64.whl (162.5 MB)
Requirement already satisfied: scipy in c:\users\rudol\appdata\local\na-mic\slicer 5.2.2_2\lib\python\lib\site-packages (from lungmask==0.2.13) (1.9.2)
Requirement already satisfied: SimpleITK in c:\users\rudol\appdata\local\na-mic\slicer 5.2.2_2\lib\python\lib\site-packages (from lungmask==0.2.13) (2.2.0rc2.dev368)
Collecting tqdm
  Using cached tqdm-4.65.0-py3-none-any.whl (77 kB)
Collecting scikit-image
  Using cached scikit_image-0.20.0-cp39-cp39-win_amd64.whl (23.9 MB)
Collecting fill_voids
  Using cached fill_voids-2.0.3-cp39-cp39-win_amd64.whl (178 kB)
Collecting fastremap
  Using cached fastremap-1.13.4-cp39-cp39-win_amd64.whl (507 kB)
Collecting networkx>=2.8
  Using cached networkx-3.0-py3-none-any.whl (2.0 MB)
Collecting imageio>=2.4.1
  Using cached imageio-2.26.0-py3-none-any.whl (3.4 MB)
Requirement already satisfied: packaging>=20.0 in c:\users\rudol\appdata\local\na-mic\slicer 5.2.2_2\lib\python\lib\site-packages (from scikit-image->lungmask==0.2.13) (23.0)
Collecting PyWavelets>=1.1.1
  Using cached PyWavelets-1.4.1-cp39-cp39-win_amd64.whl (4.2 MB)
Collecting tifffile>=2019.7.26
  Using cached tifffile-2023.2.28-py3-none-any.whl (216 kB)
Collecting lazy_loader>=0.1
  Using cached lazy_loader-0.1-py3-none-any.whl (8.6 kB)
Collecting scipy
  Using cached scipy-1.9.1-cp39-cp39-win_amd64.whl (38.6 MB)
Requirement already satisfied: pillow>=9.0.1 in c:\users\rudol\appdata\local\na-mic\slicer 5.2.2_2\lib\python\lib\site-packages (from scikit-image->lungmask==0.2.13) (9.4.0)
Collecting typing-extensions
  Using cached typing_extensions-4.5.0-py3-none-any.whl (27 kB)
Collecting colorama
  Using cached colorama-0.4.6-py2.py3-none-any.whl (25 kB)
Building wheels for collected packages: lungmask
  Building wheel for lungmask (setup.py): started
  Building wheel for lungmask (setup.py): finished with status 'done'
  Created wheel for lungmask: filename=lungmask-0.2.13-py3-none-any.whl size=17476 sha256=b49b8d28794a12f0b903dbbe61639249da51ff2b93cab977ee251d4187200a8c
  Stored in directory: C:\Users\rudol\AppData\Local\Temp\pip-ephem-wheel-cache-fhpk5mbp\wheels\83\9e\4b\d1090037a85238e9974cad92f6ed6755ab08e7227327dbfc6b
Successfully built lungmask
Installing collected packages: typing-extensions, tifffile, scipy, PyWavelets, networkx, lazy_loader, imageio, fastremap, colorama, tqdm, torch, scikit-image, fill_voids, lungmask
  WARNING: The scripts lsm2bin.exe, tiff2fsspec.exe, tiffcomment.exe and tifffile.exe are installed in 'C:\Users\rudol\AppData\Local\NA-MIC\Slicer 5.2.2_2\lib\Python\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  Attempting uninstall: scipy
    Found existing installation: scipy 1.9.2
    Uninstalling scipy-1.9.2:
      Successfully uninstalled scipy-1.9.2
ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied: 'C:\\Users\\rudol\\AppData\\Local\\NA-MIC\\Slicer 5.2.2_2\\lib\\Python\\Lib\\site-packages\\~cipy\\_lib\\_ccallback_c.cp39-win_amd64.pyd'
Consider using the `--user` option or check the permissions.


[notice] A new release of pip is available: 23.0 -> 23.0.1
[notice] To update, run: python-real.exe -m pip install --upgrade pip
1 Like

It will not help to switch to an old version of Slicer. “lungmask LCTRLobe R231” works fine on two test systems (one with 6 GB video RAM, one with 8 GB dedicated video RAM) - even that is the low limit for the AI tools. You will probably need to upgrade the hardware or switch to a different computer.

Unfortunately, I will try another device
Thank you very much for answering my questions
Have a good day.

Thanks for checking that. Yes, it appears setup.py specifies a versionless SimpleITK which is good. It is just that the requirements.txt in that repo appears outdated.

1 Like

I made a new attempt
I tried a 1660ti graphics card with 6GB of independent graphics memory, running on version 5.2.2 of 3DSlicer, and was unable to call CUDA. However, CUDA is available on version 5.0.3 of 3DSlicer, and it seems that the graphics memory has exploded.