How deal with missing data in nipype

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,

@npann - we are hoping to address conditional logic in our next API

here are a few options we use at present:

  1. let branches fail and generate crashfiles.
  2. use a function node to guide things.
    • embed a workflow generator function inside a function node function
    • run the workflow or not depending on inputs.

Function Interfaces are quite powerful as they combine standard python control together with the ability to run workflows inside them.

Is there any update to this issue?

MANAGED BY INCF