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

Error when changing datatype with bidseditor GUI on a bidsmap produced with the -s flag #252

Closed
samuelholly opened this issue Dec 10, 2024 · 2 comments

Comments

@samuelholly
Copy link

samuelholly commented Dec 10, 2024

Describe the bug
Hello, as I got the same error as this one #236, I tried to use the -s option with bidsmapper. When I tried to change the datatype in the bidseditor GUI, I got the following error (user name is redacted):

Traceback (most recent call last):
  File "C:\Users\XXX\Anaconda3\envs\qsiprep\Lib\site-packages\bidscoin\bidseditor.py", line 1561, in accept_run
    self.output_bidsmap.update(self.source_run.datatype, self.target_run)
  File "C:\Users\XXX\Anaconda3\envs\qsiprep\Lib\site-packages\bidscoin\bids.py", line 1513, in update
    self.insert_run(runitem)
  File "C:\Users\XXX\Anaconda3\envs\qsiprep\Lib\site-packages\bidscoin\bids.py", line 1475, in insert_run
    targetfile = self.store['target']/sourcefile.relative_to(self.store['source'])
                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\XXX\Anaconda3\envs\qsiprep\Lib\pathlib.py", line 682, in relative_to
    raise ValueError(f"{str(self)!r} is not in the subpath of {str(other)!r}")
ValueError: 'D:\\DBS_bidsfolder\\code\\bidscoin\\provenance\\tmpbfrlkihe\\DBS_DCM_files\\sub-002\\ses-01\\016-t2_space_da-fl_sag_p3_iso_0.9\\sub-002_t2_space_da-fl_sag_p3_iso_0.9_262.dcm' is not in the subpath of 'C:\\Users\\XXX\\AppData\\Local\\Temp'

To reproduce
Steps to reproduce the behavior:

  1. run bidsmapper with -s flag
  2. Go to bidseditor GUI → click on "Edit" a particular row
  3. Click on Datatype → select "anat"
  4. Click "OK"
  5. bidseditor GUI closes and the above error appears in the cmd window

Expected behavior
That BIDS editor will change the datatype

Screenshots
NA

Software version

  • BIDScoin version: 4.4.0
  • OS: Win10 Pro

Additional context
Thank you in advance.

marcelzwiers added a commit that referenced this issue Dec 10, 2024
…i.e. when using `bidsmapper -s` (GitHub issue #252)
@marcelzwiers
Copy link
Collaborator

marcelzwiers commented Dec 10, 2024

I was able to reproduce and fix (d5997bd) your error, thanks for reporting! It was caused by bidsmapper accidentally passing the -s provenance store option to the bidseditor. A workaround is to save and close the (automatically opened) bidseditor (or use the -a option) and open the bidseditor yourself (by running bidseditor DBS_bidsfolder).

@samuelholly
Copy link
Author

Thank you.

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

No branches or pull requests

2 participants