Closed t-sanchez closed 1 year ago
That's actually a good point. I don't think that it's currently handled. I'd need to check this case specifically.
Actually, rather than having the checks scattered throughout the input stage, I refactored FilteringByRunId
into CheckAndFilterInputStacks
. The class takes as input input_images
(T2w images), and optionally stacks, masks and labels.
It either uses the given stacks or extracts them from the T2w images and then checks that masks and labels have the requested stacks. It raises an exception when it is not the case. It also checks that at least ~one stack is~ two stacks are requested/found.
I think that this simplifies the workflow in the input_stage, removing the need for individual filtering. Rather, we filter immediately the files based on the stacks or the input_images found. The stack ordering then works on already filtered data, and there is no need to re-filter them afterwards.
As the black refactoring makes the reading of relevant changes quite difficult, I've put some comments around the important changes.
Fix the issue https://github.com/Medical-Image-Analysis-Laboratory/mialsuperresolutiontoolkit/issues/177 -> Cleaned up inputs to workflows. Fix https://github.com/Medical-Image-Analysis-Laboratory/mialsuperresolutiontoolkit/issues/183 -> Make the pipeline crash explicitly when
A single stack is run A stack isn't found in filterbyrunid