I have tracked some white matter tracts in two groups of subjects, and I want to draw a curve graph of to show the diffusion properties (such as MD, FA) of each group with mean +/- SD. The x axis represents the position of the tract and the y axis represents the MD value.
Up to now, I have only found the way to show the curve of only graph by DIPY or AFQ. But how to do it for a group?
If you used AFQ you should also have a csv with tract profile values. You’ll need to aggregate them to a dataframe like this:
node tract sub value
0 Left_AF sub-001 0.2 (or whatever the value was)
1 Left_AF sub-001 0.3 (or whatever the value was)
....
n Left_AF sub-001 X
0 Left_AF sub-002 X
.... (REPEAT FOR ALL SUBS AND TRACTS)
Name that dataframe something like df_tract you can do
import seaborn as sns
tract_vals = df_tract.query("tract == 'Left_AF'") # or whatever tract you want
sns.lineplot(data=tract_vals, x="node", y="value", orient="y")
Thanks for your reply, My tracts were generated by mrtrix3, so I don’t have the css file with the node information. Is there some functions to generate this file manually?
Thank you all.
I have solved this problem with the following method.
extract the profile of each tract (.tck) generated from mrtrix3 before (thanks @Steven )
instead of illustrating the single profile directly as examples in DIPY, I saved the profile into a data frame and used seaborn to show it in group level. (thanks @Steven again!)