How do we deal with missing data in nipype? (how can we disconnect a branch of a workflow is file is missing)
I tried to play with ignore_exception at the Node level but with no much success.
Let’s say you have:
- A study with multiple visit (t0, t1, …) and multiple modalities (mod0, mod1, …),
- A really simple workflow that consists in co-registering modi(ti) to mod0(t0)
- For some time points, m1 is missing.
Let’s assume that:
- folder structure is:
/{sub_id}/{visit_id}/{mod_id}
- each modalities has its own co-reg node.
- infosource in looping over visit_id
- select file is defined as:
selectfile = Node(SelectFiles({'mod0': '/sub_id/{visit_id}/mod0', 'mod1': '/sub_id/{visit_id}/mod1'}, ignore_exception=True)
What is the correct design so that the workflow is not failing when selectfile on mod2 does not match a file?
Currently I am creating a new workflow depending on what is in /{sub_id}/{visit_id}. Does not look ideal.
Optional question: Is there smart way of dealing with modo(t0) that would get co-register to himself in this worflow?
Thanks,