Closed manuegrx closed 1 year ago
However, the initialisation step in Mia is based on the use of "false inputs" (only the name is defined, but the corresponding data does not exist yet). We have already discussed a lot about this in the past (@denisri had rightly proposed the concept of "data coming from the future"!; moreover, there are still things to do on this subject in relation to the indexing in the database of these data "coming from the future", especially in the case of a deported calculation. I believe that at least one ticket is open on this subject).
The main problems of this way of doing things is precisely when nipype needs the data to exist at the time of initialisation, as you show exactly here.
This means that the current mia_processes.bricks.preprocess.spm.Realign.list_outputs() method needs to be improved. I will look at this.
I don't remember how nipype inputs are marked or forced to exist when they are files, and where it raises errors. I remember that in capsul pipelines, nodes inputs which are connected from outputs of upstream nodes are modified (Pipeline.add_link()
calls a function soma.controller.trait_utils.relax_exists_constraint()
on connected input trait for this). But I don't remember what is done on nipype traits, and what exactly causes problem in your situation.
I opened a ticket (related to this one) in the mia_processes part.
It is rather in mia_processes that the necessary change should be made. I think that everything works correctly on the side of capsul and populse_mia (the exception raised in nipype is well catched by capsul).
We just have to do the job that can't be done in nipype, in mia_processes. I will look at this.
This is an issue with mia_processess but I think it concerns how populse_mia works.
Problem when initializing the pipeline with the process
mia_processes.bricks.preprocess.spm.Realign
when thein_files
parameters are not existing images.When initializing the pipeline, in
list_outputs
function (inRealign
class ofmia_processes.bricks.preprocess.spm.Realign
), NipypeRealign
process is called in order to get outputs's path name (which is not the same depending on the input parameters). However, thefunc_is_3d
(nipype.interfaces.base
) function is called inRealign
class in Nipype (nipype.interfaces.spm.preprocess
):This function check the image dimension using
nibabel.load
, so the image must exist:--> if the
in_files
parameters are not existing images initialization is not correctly done, but it is the principle of populse_mia to do initialization without existing imagePotential solution : For the Nipype process that need existing images in input, do not call Nipype process during the initialization step and code in mia_processes output path name --> we will need to check in our side if the future image dimension so the issue is quite the same