Update handling of external dwi_dir
#86
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed changes
Resolves #84 - previously when
dwi_dir
was provided, the originalbids_dir
is still used to search for dwi data, resulting in a message regarding the inability to find files. This PR changes this behaviour, by splitting off the search for dwi data into a separategenerate_inputs
call, falling back tobids_dir
ifdwi_dir
is not provided. By doing this, the message will only appear if there actually is no data that can be found. To that end, also added in thepybidsdb
functionality, for bothbids_dir
anddwi_dir
(if provided).Additionally, there were many wildcards in the config previously, allowing potential expansion over a number of different entities (e.g. res, run, acquisition, etc). Instead this PR falls back to only allowing subject, session, and runs as wildcards, which I think makes a little more sense. In doing so, it allows for flexibility in the naming schemes to be picked up (e.g. prepdwi vs snakedwi) and in the event multiple inputs are found, an error is raised, suggesting to the end-user to make use of the
--filter
flag to constrain their selection. This also eliminates the need to hardcode the naming scheme of dwi that was done previously (e.g.desc=preproc
ordesc='eddy', res='orig'
.Types of changes
What types of changes does your code introduce? Put an
x
in the boxes that applyChecklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you are unsure about any of the choices, don't hesitate to ask!poe quality
taskNotes
All PRs will undergo the unit testing before being reviewed. You may be requested to explain or make additional changes before the PR is accepted.