Skip to content

Commit 03a5148

Browse files
committed
calculate RD
1 parent 39b0712 commit 03a5148

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

dmriprep/workflows/dwi/tensor.py

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,18 @@ def init_tensor_wf():
1616
)
1717

1818
outputnode = pe.Node(
19-
niu.IdentityInterface(fields=[
20-
"FA_file",
21-
"L1_file",
22-
"L2_file",
23-
"L3_file",
24-
"MD_file",
25-
"sse_file",
26-
"V1_file"]),
19+
niu.IdentityInterface(
20+
fields=["FA_file", "MD_file", "AD_file", "RD_file", "sse_file", "V1_file"]
21+
),
2722
name="outputnode",
2823
)
2924

3025
dtifit = pe.Node(fsl.DTIFit(save_tensor=True, sse=True), name="dtifit")
3126

27+
add_l2_l3 = pe.Node(fsl.BinaryMaths(operation="add"), name="add_l2_l3")
28+
29+
calc_rd = pe.Node(fsl.BinaryMaths(operand_value=2, operation="div"), name="calc_rd")
30+
3231
wf.connect(
3332
[
3433
(
@@ -41,16 +40,19 @@ def init_tensor_wf():
4140
("mask_file", "mask"),
4241
],
4342
),
43+
(dtifit, add_l2_l3, [("L2", "in_file"), ("L3", "operand_file")]),
44+
(add_l2_l3, calc_rd, [("out_file", "in_file")]),
45+
(calc_rd, outputnode, [("out_file", "RD_file")]),
4446
(
4547
dtifit,
4648
outputnode,
47-
[("FA", "FA_file"),
48-
("L1", "L1_file"),
49-
("L2", "L2_file"),
50-
("L3", "L3_file"),
51-
("MD", "MD_file"),
52-
("sse", "sse_file"),
53-
("V1", "V1_file")],
49+
[
50+
("FA", "FA_file"),
51+
("MD", "MD_file"),
52+
("L1", "AD_file"),
53+
("sse", "sse_file"),
54+
("V1", "V1_file"),
55+
],
5456
),
5557
]
5658
)

0 commit comments

Comments
 (0)