I successfully ran pyAFQ with the default tracts. However, I was unsuccessful in creating my own novel tract (the fornix) through pyAFQ. I ended up tracking the fornix in mrtrix instead. I now want to feed my fornix mrtrix tractography back into pyAFQ to get the 100 nodewise FA and MD values along the tract. I tried doing this through the “import_tract” function in the configuration file and also through API methods with no luck.
Has anyone ever been successful doing something similar to this? Is it possible for pyAFQ to re-segment a tract that I’m feeding it into 100 nodes? If so, I would love any insight or advice on how to do this.
Thanks for asking about this. I think that at the stage that you are in, you may be better off “dropping one level down”, and using the functionality for tract profile extraction that is implemented in DIPY directly, along the lines of this example: DIPY : Docs 1.7.0 - Extracting AFQ tract profiles from segmented bundles. Would that address your issue? I think that it is possible to make pyAFQ recognize your mrtrix-generated bundles as its own, but it might require some complicated definition work. So, if going directly to DIPY to get the tract profiles does the job for you, that might be a simpler route.
Hi Dr. Rokem,
Thank you so much for getting back to me! Dropping down to doing this directly through DIPY seems like it would work for what I need.
I just looked at the script, and I will try running it that way tomorrow! I just had 2 questions. Would this output a .csv file of the fa values along the tract like pyAFQ does? Secondly, would there be a way to visualize the tract in the same way as pyAFQ where I can visualize the tract and the tract profile plot on the same screen (im assuming probably not to this question but thought I’d check). If it doesnt automatically output it (specifically the .csv file) would there be a way to request that seperately?
Sorry for the slowness… Unfortunately, this will not create the CSV file for you. The DIPY version returns a numpy array that you will then need to save into a CSV file yourself. One option is to use Pandas in order to generate the structure that pyAFQ creates and then save the Pandas DataFrame object that you created into a CSV file for further analysis.
Hi Dr. Rokem,
I was able to successfully convert my .tck files to .trk and the use the DIPY script you sent to get the FA along the 100 nodes, it worked! I was also able to save it as a .csv like you mentioned.
Thank you so much for your help and for sending that DIPY resource.
I truly appreciate it so much!