Donders-Institute / bidscoin

BIDScoin converts your source-level neuroimaging data to BIDS
https://bidscoin.readthedocs.io
GNU General Public License v3.0
129 stars 35 forks source link

Update targets if run-1 added in increment_runindex within dcm2niixfiles loop #227

Closed dzemanov closed 8 months ago

dzemanov commented 8 months ago

It can happen that run_2 is added within dcm2niixfiles loop in dcm2niix2bids.py when dealing with postfixes. Function increment_runindex renames runless file to run1 file but targets in dcm2niix2bids are not updated, and file stays runless.

marcelzwiers commented 8 months ago

So there are still issues, I thought we tackled them all by now :-). I somehow have the feeling your fix is not the optimal place for fixing this problem. But then again, I don't see what kind of data can lead up to this situation. I'll think about it a bit more

marcelzwiers commented 8 months ago

Did check_runindices() warn about this?

marcelzwiers commented 8 months ago

Does this work for you? (sorry, I shelved and unshelved and then things didn't commit properly)

marcelzwiers commented 8 months ago

I merged it and will go ahead with the new release, but would like to be reassured that it works for your data :-)

marcelzwiers commented 8 months ago

Ok, it's more complicated then I thought, I'll get back to you on this (after I finished the scans.tsv problem)

dzemanov commented 8 months ago

Yes, its never ending story :D.

This is working for the issue I found, amazing! What is problem with scans.tsv?

marcelzwiers commented 8 months ago

That needed the same update as targets, all seems to work fine now, I'm releasing a new version now :-)

(the bids-validator still gives an error but it seems that's because it doesn't support BIDS 1.9 yet (not fully at least, the echo entity for my T1w image was falsely classified as invalid)

marcelzwiers commented 8 months ago

FYI, I added a troubleshooting item to help others when dealing with the complex interaction between using a dynamic run-index and dcm2niix adding all sorts of post-fixes:

https://bidscoin.readthedocs.io/en/latest/troubleshooting.html#i-use-dynamic-run-indices-and-now-have-orphan-run-indices-in-my-bids-directory