Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dcm2bids_helper issue in tutorial #146

Closed
andrew-yian-sun opened this issue Nov 24, 2021 · 4 comments
Closed

dcm2bids_helper issue in tutorial #146

andrew-yian-sun opened this issue Nov 24, 2021 · 4 comments
Labels

Comments

@andrew-yian-sun
Copy link

andrew-yian-sun commented Nov 24, 2021

I am going through the dcm2bids tutorial. Everything is going smoothly until the "Dicom to Nifti Conversion" section.
I run the follow code as shown: dcm2bids_helper -d sourcedata/dcm_qa_nih-master/In/, but I receive an "Output folder invalid" error message. The tmp_dcm2bids/helper directory is created but no nifti files are present.

Below is the code I ran, along with the full error message:
(dcm2bids) C:\Users\Andrew\BIDS_testing\dcm2bids_test>dcm2bids_helper -d sourcedata/dcm_qa_nih-master/In/

Traceback (most recent call last):
  File "C:\Users\Andrew\anaconda3\envs\dcm2bids\Scripts\dcm2bids_helper-script.py", line 9, in <module>
    sys.exit(main())
  File "C:\Users\Andrew\anaconda3\envs\dcm2bids\lib\site-packages\dcm2bids\helper.py", line 42, in main
    rsl = app.run()
  File "C:\Users\Andrew\anaconda3\envs\dcm2bids\lib\site-packages\dcm2bids\dcm2niix.py", line 90, in run
    self.execute()
  File "C:\Users\Andrew\anaconda3\envs\dcm2bids\lib\site-packages\dcm2bids\dcm2niix.py", line 100, in execute
    output = run_shell_command(cmd)
  File "C:\Users\Andrew\anaconda3\envs\dcm2bids\lib\site-packages\dcm2bids\utils.py", line 113, in run_shell_command
    return check_output(shlex.split(commandLine))
  File "C:\Users\Andrew\anaconda3\envs\dcm2bids\lib\subprocess.py", line 420, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "C:\Users\Andrew\anaconda3\envs\dcm2bids\lib\subprocess.py", line 524, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['dcm2niix', '-b', 'y', '-ba', 'y', '-z', 'y', '-f', '%3s_%f_%p_%t', '-o', 'C:UsersAndrewBIDS_testingdcm2bids_testtmp_dcm2bidshelper', 'sourcedata/dcm_qa_nih-master/In/']' returned non-zero exit status 6.```
@ysl16
Copy link

ysl16 commented Dec 17, 2021

I came across exactly the same thing. Not sure if this is the reason, but it seems that the program could not convert the "" in the path of the Windows system to "/"?

This was my error message:

(dcm2bids) c:\Users\yslin\Documents\dcm2bids-tutorial>dcm2bids_helper -d sourcedata/dcm_qa_nih-master/In
Error: Output folder invalid: c:UsersyslinDocumentsdcm2bids-tutorialtmp_dcm2bidshelper
Traceback (most recent call last):
  File "C:\Users\yslin\anaconda3\envs\dcm2bids\Scripts\dcm2bids_helper-script.py", line 9, in <module>
    sys.exit(main())
  File "C:\Users\yslin\anaconda3\envs\dcm2bids\lib\site-packages\dcm2bids\helper.py", line 42, in main
    rsl = app.run()
  File "C:\Users\yslin\anaconda3\envs\dcm2bids\lib\site-packages\dcm2bids\dcm2niix.py", line 90, in run
    self.execute()
  File "C:\Users\yslin\anaconda3\envs\dcm2bids\lib\site-packages\dcm2bids\dcm2niix.py", line 100, in execute
    output = run_shell_command(cmd)
  File "C:\Users\yslin\anaconda3\envs\dcm2bids\lib\site-packages\dcm2bids\utils.py", line 113, in run_shell_command
    return check_output(shlex.split(commandLine))
  File "C:\Users\yslin\anaconda3\envs\dcm2bids\lib\subprocess.py", line 420, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "C:\Users\yslin\anaconda3\envs\dcm2bids\lib\subprocess.py", line 524, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['dcm2niix', '-b', 'y', '-ba', 'y', '-z', 'y', '-f', '%3s_%f_%p_%t', '-o', 'c:UsersyslinDocumentsdcm2bids-tutorialtmp_dcm2bidshelper', 'sourcedata/dcm_qa_nih-master/In']' returned non-zero exit status 6.

@keiichiiownsu12
Copy link

Try appending -o .\ or -o ./ to your dcm2bids_helper call, e.g.:
(dcm2bids) C:\Users\Andrew\BIDS_testing\dcm2bids_test>dcm2bids_helper -d sourcedata/dcm_qa_nih-master/In/ -o ./

@andrew-yian-sun
Copy link
Author

Hi @keiichiiownsu12, unfortunately trying both -o .\ or -o ./ to your dcm2bids_helper call seemed to have resulted in the output folder being invalid:

(dcm2bids) C:\Users\Andrew\BIDS_testing\dcm2bids_test>dcm2bids_helper -d sourcedata/dcm_qa_nih-master/In/ -o ./
Error: Output folder invalid: ./tmp_dcm2bidshelper
Traceback (most recent call last):
  File "C:\Users\Andrew\anaconda3\envs\dcm2bids\Scripts\dcm2bids_helper-script.py", line 9, in <module>
    sys.exit(main())
  File "C:\Users\Andrew\anaconda3\envs\dcm2bids\lib\site-packages\dcm2bids\helper.py", line 42, in main
    rsl = app.run()
  File "C:\Users\Andrew\anaconda3\envs\dcm2bids\lib\site-packages\dcm2bids\dcm2niix.py", line 90, in run
    self.execute()
  File "C:\Users\Andrew\anaconda3\envs\dcm2bids\lib\site-packages\dcm2bids\dcm2niix.py", line 100, in execute
    output = run_shell_command(cmd)
  File "C:\Users\Andrew\anaconda3\envs\dcm2bids\lib\site-packages\dcm2bids\utils.py", line 113, in run_shell_command
    return check_output(shlex.split(commandLine))
  File "C:\Users\Andrew\anaconda3\envs\dcm2bids\lib\subprocess.py", line 420, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "C:\Users\Andrew\anaconda3\envs\dcm2bids\lib\subprocess.py", line 524, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['dcm2niix', '-b', 'y', '-ba', 'y', '-z', 'y', '-f', '%3s_%f_%p_%t', '-o', './tmp_dcm2bidshelper', 'sourcedata/dcm_qa_nih-master/In/']' returned non-zero exit status 6.
(dcm2bids) C:\Users\Andrew\BIDS_testing\dcm2bids_test>dcm2bids_helper -d sourcedata/dcm_qa_nih-master/In/ -o .\
Error: Output folder invalid: .tmp_dcm2bidshelper
Traceback (most recent call last):
  File "C:\Users\Andrew\anaconda3\envs\dcm2bids\Scripts\dcm2bids_helper-script.py", line 9, in <module>
    sys.exit(main())
  File "C:\Users\Andrew\anaconda3\envs\dcm2bids\lib\site-packages\dcm2bids\helper.py", line 42, in main
    rsl = app.run()
  File "C:\Users\Andrew\anaconda3\envs\dcm2bids\lib\site-packages\dcm2bids\dcm2niix.py", line 90, in run
    self.execute()
  File "C:\Users\Andrew\anaconda3\envs\dcm2bids\lib\site-packages\dcm2bids\dcm2niix.py", line 100, in execute
    output = run_shell_command(cmd)
  File "C:\Users\Andrew\anaconda3\envs\dcm2bids\lib\site-packages\dcm2bids\utils.py", line 113, in run_shell_command
    return check_output(shlex.split(commandLine))
  File "C:\Users\Andrew\anaconda3\envs\dcm2bids\lib\subprocess.py", line 420, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "C:\Users\Andrew\anaconda3\envs\dcm2bids\lib\subprocess.py", line 524, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['dcm2niix', '-b', 'y', '-ba', 'y', '-z', 'y', '-f', '%3s_%f_%p_%t', '-o', '.tmp_dcm2bidshelper', 'sourcedata/dcm_qa_nih-master/In/']' returned non-zero exit status 6.

@SamGuay SamGuay added the bug label Apr 19, 2022
@arnaudbore
Copy link
Contributor

@andrew-yian-sun @ysl16 @keiichiiownsu12 we updated the documentation and we have a PR (#158) that should fix your issue.
Can you give it a try ? Feedbacks will be also appreciated.
Thank you in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants