nipype
nipype copied to clipboard
nipype issues with calling dcm2nii
nipype noob here thank you for developing this software packages its very help but I am running to into simply problem by reading in a source_dir PAT001 containing 201 dcm files convert into nii file for developing pipeline for a deeplearning model
OSError: [WinError 10038] An operation was attempted on something that is not a socket
Summary
# change these for your system
dcm_folder = 'D:\L_pipe\DataScienceDeck\DataScienceDeck\Data\Data_input\PAT001' ## our input is the number 201 dcm files
output_folder = 'D:\L_pipe\DataScienceDeck\DataScienceDeck\Data\Data_output\output_nifti'
def convert_dcm_2_nii_x(dcm_folder, output_folder):
converter = Dcm2niix()
print(len(dcm_folder))
converter.inputs.source_dir = dcm_folder
converter.inputs.output_dir = output_folder
converter.inputs.compress = 'i'
converter.run()
return print("done")
from nipype.interfaces.dcm2nii import Dcm2nii
Actual behavior
210216-11:28:56,30 nipype.interface INFO:
[WinError 10038] An operation was attempted on something that is not a socket
Traceback (most recent call last):
File ".\dcm2nifti.py", line 50, in <module>
convert_dcm_2_nii_x(dcm_folder, output_folder)
File ".\dcm2nifti.py", line 26, in convert_dcm_2_nii_x
converter.run()
File "D:\L_pipe\pipeline_env\lib\site-packages\nipype\interfaces\base\core.py", line 434, in run
runtime = self._run_interface(runtime)
File "D:\L_pipe\pipeline_env\lib\site-packages\nipype\interfaces\dcm2nii.py", line 445, in _run_interface
runtime, correct_return_codes=(0, 1,)
File "D:\L_pipe\pipeline_env\lib\site-packages\nipype\interfaces\base\core.py", line 827, in _run_interface
runtime = run_command(runtime, output=self.terminal_output)
File "D:\L_pipe\pipeline_env\lib\site-packages\nipype\utils\subprocess.py", line 137, in run_command
_process()
File "D:\L_pipe\pipeline_env\lib\site-packages\nipype\utils\subprocess.py", line 124, in _process
res = select.select(streams, [], [], timeout)
OSError: [WinError 10038] An operation was attempted on something that is not a socket
I am pretty sure dcm2nii code is running because it generates a bunch of .nii files

Expected behavior

Script/Workflow details
taking 200 DICOM files into a single nii file
Platform details:
Windows 10 VScode python 3.7
Execution environment
Choose one
- Container [Tag: ???]
- My python environment inside container [Base Tag: ???]
- My python environment outside container
I have the same issue and error,windows socket error. How to solve ?
Hi, the problem is that we don't support Windows (this is issue #3277). We'd be happy to accept a patch from someone with a Windows machine. You can also try using the Windows Subsystem for Linux (WSL), but I don't have any experience there.
it will be a weekend project for me when I get around to it after work.
Thank you for getting back on this issue. @Gresliebear That would be great. Please do keep me posted.
Hi. Is there any news on the compatibility of dcm2niix for windows? The socket error still persists for me. As I mentioned in this issue: https://github.com/rordenlab/dcm2niix/issues/609
I have recently come into possession of a Windows machine, so when I have the opportunity, I can try to debug this. Making nipype Windows compatible will be a major effort, though. Have you looked into Pydra? Or using the WSL?
any luck ? it seems there are more users hitting this: https://neurostars.org/t/dcm2niix-error-using-heudiconv/26759