OSError: [WinError 193] %1 n’est pas une application Win32 valide
oscarramirezs opened this issue · 1 comments
Hello
Thanks, I have a problem with a type of dicom. Normally when all the files in my series are larger than 500ko, dicom2nifti works fine,
But, when I have series where the files vary between 150ko and 200ko, it doesn't work.
i think is a heakder problem
when use this code to read the first file, i have this, but other software such as MIMICS (materialise) or 3D Slicer works fine with this data..
`dicom_headers = read_file('patient_dicom/1')
dicom_headers
OSError Traceback (most recent call last)
in
----> 1 dicom_headers = read_file('patient_dicom/1')
2 dicom_headers
C:\ProgramData\Anaconda3\lib\site-packages\dicom2nifti\compressed_dicom.py in read_file(dicom_file, defer_size, stop_before_pixels, force)
18 with tempfile.NamedTemporaryFile(delete=False) as fp:
19 fp.close()
---> 20 _decompress_dicom(dicom_file, output_file=fp.name)
21
22 return pydicom.read_file(fp.name,
C:\ProgramData\Anaconda3\lib\site-packages\dicom2nifti\compressed_dicom.py in _decompress_dicom(dicom_file, output_file)
131 gdcmconv_executable = _get_gdcmconv()
132
--> 133 subprocess.check_output([gdcmconv_executable, '-w', dicom_file, output_file])
134
135
C:\ProgramData\Anaconda3\lib\subprocess.py in check_output(timeout, *popenargs, **kwargs)
413 kwargs['input'] = empty
414
--> 415 return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
416 **kwargs).stdout
417
C:\ProgramData\Anaconda3\lib\subprocess.py in run(input, capture_output, timeout, check, *popenargs, **kwargs)
491 kwargs['stderr'] = PIPE
492
--> 493 with Popen(*popenargs, **kwargs) as process:
494 try:
495 stdout, stderr = process.communicate(input, timeout=timeout)
C:\ProgramData\Anaconda3\lib\subprocess.py in init(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, encoding, errors, text)
856 encoding=encoding, errors=errors)
857
--> 858 self._execute_child(args, executable, preexec_fn, close_fds,
859 pass_fds, cwd, env,
860 startupinfo, creationflags, shell,
C:\ProgramData\Anaconda3\lib\subprocess.py in _execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, unused_restore_signals, unused_start_new_session)
1309 # Start the process
1310 try:
-> 1311 hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
1312 # no special security
1313 None, None,
OSError: [WinError 193] %1 n’est pas une application Win32 valide`
some can help me please
Thanks
Oscar
The problem lies with the fact that it is compressed dicoms.
Before release 2.4.2 we used the command line tool gdcmconv to decompress the dicoms and then convert.
The support for this way of working on windows was a little unstable or not even working.
However when installing gdcm lib through python or pip it does work pydicom can read compressed dicoms directly.
For this reason from release 2.4.2 onwards we no longer need gdcmconv and you should no longer encounter this issue.