From 82fffac8cae3c7bf34551e3c49890543145fc32d Mon Sep 17 00:00:00 2001 From: araikes Date: Tue, 9 Jul 2024 10:31:57 -0700 Subject: [PATCH] Save SIFT2 mu parameter Currently the SIFT2 mu parameter is connected to mu in the outputnode, but is never written. Given that this is a necessary correction factor when using sum of streamlines connectomes after SIFT2, this will write the mu parameter to the derivatives folder. --- qsiprep/workflows/recon/mrtrix.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/qsiprep/workflows/recon/mrtrix.py b/qsiprep/workflows/recon/mrtrix.py index 9ccde5c0..e427ca00 100644 --- a/qsiprep/workflows/recon/mrtrix.py +++ b/qsiprep/workflows/recon/mrtrix.py @@ -530,7 +530,7 @@ def init_mrtrix_tractography_wf( name="inputnode", ) outputnode = pe.Node( - niu.IdentityInterface(fields=["tck_file", "sift_weights", "recon_scalars"]), + niu.IdentityInterface(fields=["tck_file", "sift_weights", "mu", "recon_scalars"]), name="outputnode", ) @@ -588,6 +588,18 @@ def init_mrtrix_tractography_wf( run_without_submitting=True, ) workflow.connect(outputnode, 'sift_weights', ds_sift_weights, 'in_file') # fmt:skip + if qsirecon_suffix: + ds_mu_file = pe.Node( + ReconDerivativesDataSink( + extension=".txt", + model="sift2", + suffix="mu", + qsirecon_suffix=qsirecon_suffix, + ), + name="ds_mu_file", + run_without_submitting=True, + ) + workflow.connect(outputnode, 'mu', ds_mu_file, 'in_file') # fmt:skip if use_5tt: workflow.connect(inputnode, connect_5tt, tck_sift2, "act_file") # fmt:skip