# LungCTAnalyzer input file error

**URL:** <https://discourse.slicer.org/t/lungctanalyzer-input-file-error/28301>\
**Category:** Support\
**Tags:** lungctanalyzer\
**Created:** [March 10, 2023, 8:19pm UTC](https://discourse.slicer.org/t/lungctanalyzer-input-file-error/28301 "2023-03-10T20:19:35Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![JasonYangchen](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jasonyangchen/32/18703_2.png) [@JasonYangchen](https://discourse.slicer.org/u/JasonYangchen)\
**Post date:** [March 10, 2023, 8:19pm UTC](https://discourse.slicer.org/t/lungctanalyzer-input-file-error/28301/1 "2023-03-10T20:19:35Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![rbumm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rbumm/32/9404_2.png) [@rbumm](https://discourse.slicer.org/u/rbumm)\
**Post date:** [March 11, 2023, 1:38am UTC](https://discourse.slicer.org/t/lungctanalyzer-input-file-error/28301/2 "2023-03-11T01:38:05Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![JasonYangchen](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jasonyangchen/32/18703_2.png) [@JasonYangchen](https://discourse.slicer.org/u/JasonYangchen)\
**Post date:** [March 11, 2023, 9:00am UTC](https://discourse.slicer.org/t/lungctanalyzer-input-file-error/28301/3 "2023-03-11T09:00:50Z")

</div>

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:

 ![屏幕截图 2023-03-11 170013](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/0/8/08ce747c506c7579c502264f48e4500356b60959.png)

---

<div class="post-metadata">

**Author:** ![rbumm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rbumm/32/9404_2.png) [@rbumm](https://discourse.slicer.org/u/rbumm)\
**Post date:** [March 11, 2023, 9:53am UTC](https://discourse.slicer.org/t/lungctanalyzer-input-file-error/28301/4 "2023-03-11T09:53:02Z")

</div>

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](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/f/9/f97c875a64a56c79ca85ba1130047f08ff7f839c.png)

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

![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/f/c/fcace536938d7aac037fe5fa427c462010a0fdde.png)

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

---

<div class="post-metadata">

**Author:** ![JasonYangchen](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jasonyangchen/32/18703_2.png) [@JasonYangchen](https://discourse.slicer.org/u/JasonYangchen)\
**Post date:** [March 11, 2023, 10:01am UTC](https://discourse.slicer.org/t/lungctanalyzer-input-file-error/28301/5 "2023-03-11T10:01:30Z")

</div>

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

 ![屏幕截图 2023-03-11 175910](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/f/0/f00d7d94701772777511241ede27d3bf29814a95.png)

---

<div class="post-metadata">

**Author:** ![rbumm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rbumm/32/9404_2.png) [@rbumm](https://discourse.slicer.org/u/rbumm)\
**Post date:** [March 11, 2023, 11:39am UTC](https://discourse.slicer.org/t/lungctanalyzer-input-file-error/28301/6 "2023-03-11T11:39:52Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![JasonYangchen](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jasonyangchen/32/18703_2.png) [@JasonYangchen](https://discourse.slicer.org/u/JasonYangchen)\
**Post date:** [March 11, 2023, 11:54am UTC](https://discourse.slicer.org/t/lungctanalyzer-input-file-error/28301/7 "2023-03-11T11:54:50Z")

</div>

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

 ![屏幕截图 2023-03-11 193838](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/b/c/bca19dcb3ee3885681e76c4b03a9969870798ae4.png)  
 ![屏幕截图 2023-03-11 195847](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/5/5/55254da054196fa30ead22831fb8da87b54db878.png)

---

<div class="post-metadata">

**Author:** ![rbumm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rbumm/32/9404_2.png) [@rbumm](https://discourse.slicer.org/u/rbumm)\
**Post date:** [March 11, 2023, 12:29pm UTC](https://discourse.slicer.org/t/lungctanalyzer-input-file-error/28301/8 "2023-03-11T12:29:15Z")

</div>

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

```auto
slicer.util.pip_install("lungmask")

```

into the Python Console and post the output.

---

<div class="post-metadata">

**Author:** ![JasonYangchen](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jasonyangchen/32/18703_2.png) [@JasonYangchen](https://discourse.slicer.org/u/JasonYangchen)\
**Post date:** [March 11, 2023, 12:42pm UTC](https://discourse.slicer.org/t/lungctanalyzer-input-file-error/28301/9 "2023-03-11T12:42:35Z")

</div>

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

 ![屏幕截图 2023-03-11 203937](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/3/b/3b5536e6507526f48ab43eb80fe871984b27c6ef.png)  
 ![屏幕截图 2023-03-11 204022](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/f/0/f0aa2b6cb0fd41517c91c415f01e5f98cb02c4df.png)  
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？

---

<div class="post-metadata">

**Author:** ![rbumm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rbumm/32/9404_2.png) [@rbumm](https://discourse.slicer.org/u/rbumm)\
**Post date:** [March 11, 2023, 12:45pm UTC](https://discourse.slicer.org/t/lungctanalyzer-input-file-error/28301/10 "2023-03-11T12:45:46Z")

</div>

Try running “lungmask R231”. Same result?

---

<div class="post-metadata">

**Author:** ![JasonYangchen](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jasonyangchen/32/18703_2.png) [@JasonYangchen](https://discourse.slicer.org/u/JasonYangchen)\
**Post date:** [March 11, 2023, 12:50pm UTC](https://discourse.slicer.org/t/lungctanalyzer-input-file-error/28301/11 "2023-03-11T12:50:17Z")

</div>

“Lungmask R231” can always operate normally

 ![屏幕截图 2023-03-11 204912](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/e/4/e497fed221a3303b187ee2e72938abb38c9748d4.png)

---

<div class="post-metadata">

**Author:** ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)\
**Post date:** [March 11, 2023, 12:52pm UTC](https://discourse.slicer.org/t/lungctanalyzer-input-file-error/28301/12 "2023-03-11T12:52:53Z")

</div>

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

> <https://github.com/rbumm/SlicerLungCTAnalyzer/blob/d613598f8b97015dbb78b3d2dc06294292074247/LungCTSegmenter/LungCTSegmenter.py#L2135>

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

> <https://github.com/JoHof/lungmask/blob/0fe26b940aeff52196e34909d265c1d15488867c/requirements.txt#L7>

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

> <https://github.com/Slicer/Slicer/issues/6711>
>
> \## Summary
> 
> When installing a package that requires a specific SimpleITK versi…on (e.g., TotalSegmentator requires SimpleITK==2.0.2) then installation of that package may replace Slicer's SimpleITK.
> 
> The new SimpleITK package mostly works, but the ITK IO plugins that Slicer provides (e.g., for in-memory file transfer between Slicer and ITK) don't work anymore.
> 
> \## Steps to reproduce
> 
> Run \`pip\_install('TotalSegmentator')\`.
> Slicer's SimpleITK is uninstalled and SimpleITK-2.0.2 is installed.
> 
> \## Expected behavior
> 
> Slicer's SimpleITK should not be uninstalled.
> 
> \## Environment
> \- Slicer version: Slicer-5.2.1
> \- Operating system: Windows 11

---

<div class="post-metadata">

**Author:** ![rbumm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rbumm/32/9404_2.png) [@rbumm](https://discourse.slicer.org/u/rbumm)\
**Post date:** [March 11, 2023, 12:55pm UTC](https://discourse.slicer.org/t/lungctanalyzer-input-file-error/28301/13 "2023-03-11T12:55:12Z")

</div>

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”.

---

<div class="post-metadata">

**Author:** ![JasonYangchen](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jasonyangchen/32/18703_2.png) [@JasonYangchen](https://discourse.slicer.org/u/JasonYangchen)\
**Post date:** [March 11, 2023, 1:15pm UTC](https://discourse.slicer.org/t/lungctanalyzer-input-file-error/28301/15 "2023-03-11T13:15:47Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![JasonYangchen](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jasonyangchen/32/18703_2.png) [@JasonYangchen](https://discourse.slicer.org/u/JasonYangchen)\
**Post date:** [March 11, 2023, 1:16pm UTC](https://discourse.slicer.org/t/lungctanalyzer-input-file-error/28301/16 "2023-03-11T13:16:17Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![rbumm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rbumm/32/9404_2.png) [@rbumm](https://discourse.slicer.org/u/rbumm)\
**Post date:** [March 11, 2023, 1:22pm UTC](https://discourse.slicer.org/t/lungctanalyzer-input-file-error/28301/17 "2023-03-11T13:22:53Z")

</div>

Thank you @jamesobutler

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

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

```

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

```auto
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

```

---

<div class="post-metadata">

**Author:** ![rbumm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rbumm/32/9404_2.png) [@rbumm](https://discourse.slicer.org/u/rbumm)\
**Post date:** [March 11, 2023, 1:31pm UTC](https://discourse.slicer.org/t/lungctanalyzer-input-file-error/28301/18 "2023-03-11T13:31:41Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![JasonYangchen](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jasonyangchen/32/18703_2.png) [@JasonYangchen](https://discourse.slicer.org/u/JasonYangchen)\
**Post date:** [March 11, 2023, 1:38pm UTC](https://discourse.slicer.org/t/lungctanalyzer-input-file-error/28301/19 "2023-03-11T13:38:25Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)\
**Post date:** [March 11, 2023, 3:00pm UTC](https://discourse.slicer.org/t/lungctanalyzer-input-file-error/28301/20 "2023-03-11T15:00:50Z")

</div>

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.

> <https://github.com/JoHof/lungmask/blob/0fe26b940aeff52196e34909d265c1d15488867c/setup.py#L26>

---

<div class="post-metadata">

**Author:** ![JasonYangchen](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jasonyangchen/32/18703_2.png) [@JasonYangchen](https://discourse.slicer.org/u/JasonYangchen)\
**Post date:** [March 18, 2023, 9:34am UTC](https://discourse.slicer.org/t/lungctanalyzer-input-file-error/28301/21 "2023-03-18T09:34:49Z")

</div>

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.
