-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Questions about a custom bundle #1162
Comments
Hi! That is indeed a challenge. One option I can think of is to use one subject as a "template" subject, using their bundles for the clustering and then using their centroids as the streamline according to which all the other subjects streamlines get oriented. You might want to play around with this a bit, for example to make sure that the bundles are oriented the same way in both hemispheres. Depending on the length of the bundle and its location in the brain, that might work well for all subjects. You'd probably want to check this, e.g., by plotting the node indices along the length of the bundle. See also this neurostars post for a couple of examples, and some code to do this: https://neurostars.org/t/putting-mrtrix-tractography-into-pyafq/26780/7?u=ariel_rokem. |
This function could be useful: pyAFQ/AFQ/recognition/utils.py Line 91 in fe30b28
|
Sorry I am re-reading this now and I think I misunderstood at first. If the bundle is not included in these widely studied bundles, you could orient according to either (1) either a start or end ROI or (2) two inclusion ROIs. In the first case, simply flip the streamline so it starts/ends in the right place. In the second case, flip the streamline such that it goes from one ROI to the other. If you do this through pyAFQ's interface, all of this should be handled for you automatically. This is what I recommend. Here is an example of how to do it for the acoustic radiations: But the code above is using DIPY, which is also OK. In this case, you can reference the pyAFQ code for ideas on how to do this, however this part of the code is a little complicated. Here is where we flip depending on inclusion ROIs: |
@36000 Thank you very much for your instruction! I should revisit it sometime in the next year since we are approaching the holiday season. Have a happy holiday! |
Hello @arokem
I follow your suggestions to read the tutorial below to calculate the tract profile for custom bundles.
https://github.com/dipy/dipy/blob/master/doc/examples/afq_tract_profiles.py
It looks like the following part of the code handle orientation of fiber tract consistent across subjects, based on comparison with known fiber tract orientation.
model_arc_l_file, model_cst_l_file = get_two_hcp842_bundles()
model_arc_l = load_trk(
model_arc_l_file, reference="same", bbox_valid_check=False
).streamlines
model_cst_l = load_trk(
model_cst_l_file, reference="same", bbox_valid_check=False
).streamlines
feature = ResampleFeature(nb_points=100)
metric = AveragePointwiseEuclideanMetric(feature)
qb = QuickBundles(threshold=np.inf, metric=metric)
cluster_cst_l = qb.cluster(model_cst_l)
standard_cst_l = cluster_cst_l.centroids[0]
cluster_af_l = qb.cluster(model_arc_l)
standard_af_l = cluster_af_l.centroids[0]
oriented_cst_l = dts.orient_by_streamline(cst_l, standard_cst_l)
oriented_arc_l = dts.orient_by_streamline(arc_l, standard_af_l)
However, if the bundle is not included in these widely studied bundles, do you have any suggestions on how to ensure the consistency of orientation of fiber tracts across subjects (to avoid that tract profile direction is not flipped across subjects)?
The text was updated successfully, but these errors were encountered: