Closed sebastientourbier closed 3 years ago
What do you mean by "specify which interface is enabled in the parameter file"? Isn't the workflow built accordingly, for instance when we chose to use manual/automatic masks?
Also which parameter file exactly?
@pdedumast @hamzake The current workflow consists of number of interfaces that one might want to skip especially in the preprocessing phase.
For instance Hélène might want to skip histogram normalization for quantitative imaging (not sure thought which steps were exactly skipped by her, please @HeleneMIAL could you clarify this point?) or in the case of simulated data free of motion to skip the slice-to-volume registration step in mialsrtkImageReconstruction.
Or any other interface that you might think it's good to have such a control.
The parameter file in question is the following: https://github.com/Medical-Image-Analysis-Laboratory/mialsuperresolutiontoolkit/blob/88f726d64c71aaedc17da401af3e97de7f51ac6f/data/code/participants_params.json#L1-L9
We could think of being able to process such a file:
{
"01": [
{ "sr-id":1,
"stacksOrder": [1, 3, 5],
"paramTV": {
"lambdaTV": 0.75,
"deltatTV": 0.01 } ,
"steps": {
"HistogramNormalization": False,
"S2VRegistration": False}
}]
}
Any step that would not be listed in the parameter file are considered to be True and performed in the workflow.
@sebastientourbier Ok, I understand the point now, thanks for clarifying!
This would be great indeed!!
As @sebastientourbier suggested:
De : Priscille de Dumast notifications@github.com Envoyé : mardi 10 novembre 2020 15:46:29 À : Medical-Image-Analysis-Laboratory/mialsuperresolutiontoolkit Cc : Hélène Lajous; Mention Objet : Re: [Medical-Image-Analysis-Laboratory/mialsuperresolutiontoolkit] Implement functionality to specify interfaces to be connected in the workflow in the parameter file (#27)
@sebastientourbierhttps://github.com/sebastientourbier Ok, I understand the point now, thanks for clarifying!
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/Medical-Image-Analysis-Laboratory/mialsuperresolutiontoolkit/issues/27#issuecomment-724747892, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AOB62IF2M336LP2FXVZAB6LSPFG4LANCNFSM4TLMMYWA.
@hamzake This would requires to:
To extract the steps from the json file as we do for paramTV
and pass them to the main()
function in the docker/bidsapp/run.py
:
https://github.com/Medical-Image-Analysis-Laboratory/mialsuperresolutiontoolkit/blob/fc711a3c53f4163dcbb176dd250bfd0b63d451c4/docker/bidsapp/run.py#L112-L133
with the addition of a new if 'steps' in sr_params.keys():
condition and addition of a new parameter steps
for the main()
function (to stay consistent with the example json).
Modify accordingly the main()
function and add a new parameter steps=
for the constructor of AnatomicalPipeline as we do with paramTV
Modify the constructor in pymialsrtk/pipelines/anatomical/srr.py
accordingly. I would suggest to add new attributes such as skip_histogram_normalization
and then in the constructor you can add:
if 'HistogramNormalization' in steps.keys():
self.skip_histogram_normalization = not steps['HistogramNormalization']
and so on for each similar step/attribute.
Finally, add in the create_workflow()
function conditions with these new attributes to connect a node or not as we do with the use_manual_masks. If a node is not connected, make sure that the inputs of the following interface are well connected to the one before the one skipped. You might need to redefine connections. For the registration option, it would be add an option that run miasrtkImageReconstruction with the flag '--no-reg' (or similar).
The idea would be to be able the specify which interface is enabled in the parameter file such that the workflow is build accordingly. This will allow to be more flexible and skip processing steps.