TissueClassifierHMRF
Hello everyone,
I am presenting Bundle Analytics (BUAN), a computational framework for investigating the shapes and profiles of brain pathways across populations paper recently published in Nature Scientific Reports on 18th-Nov-2020 at 12:00 pm EST. There will be a demo of the BUAN framework in DIPY too. You can attend the DIPY meeting (dipy/dipy#2229) for the talk.
Read the paper here: https://www.nature.com/articles/s41598-020-74054-4
Thank You,
Bramsh
Hello,
Thank you all for joining the DIPY open meeting for the BUAN talk.
In case you missed it, here's the link to the recorded BUAN presentation: https://youtu.be/9Ay1rhRTaKU
Best,
Bramsh
from dipy.viz import window, actor
scene = window.Scene()
scene.SetBackground(1, 1, 1)
colors = [np.random.rand(3) for streamline in bundle1]
stream_actor = actor.line(bundle1, colors, linewidth=0.5)
scene.add(stream_actor)
window.show(scene)
`
from dipy.viz import window, actor
import numpy as np
from dipy.io.streamline import load_trk, save_trk
bundle1 = load_trk("yourfile.trk", reference="yourfile.trk", bbox_valid_check=False).streamlines
from dipy.data import two_cingulum_bundles
bundle1, _ = two_cingulum_bundles()
scene = window.Scene()
scene.SetBackground(1, 1, 1)
colors = [np.random.rand(3) for streamline in bundle1]
stream_actor = actor.line(bundle1, colors, linewidth=0.5)
scene.add(stream_actor)
window.show(scene)
`
`# Hitogram plot for the length of streamlines in a bundle/tractogram
import matplotlib.pyplot as plt
from dipy.tracking.streamline import length
lengths = [length(s) for s in bundle1] #Euclidean length of streamlines
plt.hist(lengths, bins='auto')
plt.xlabel('Length')
plt.ylabel('count')
plt.show()`
`# Hitogram plot for the length of streamlines in a bundle/tractogram
import matplotlib.pyplot as plt
from dipy.tracking.streamline import length
lengths = [length(s) for s in bundle1] #Euclidean length of streamlines
plt.hist(lengths, bins='auto')
plt.xlabel('Length')
plt.ylabel('count')
plt.show()`
# You can give color to streamlines based on their lengths
scene = window.Scene()
scene.SetBackground(1, 1, 1)
#create random colors for streamlines
colors = [np.random.rand(3) for sl in range(int(max(lengths)))]
all_colors = []
for i in range(len(bundle1)):
all_colors.append(colors[int(lengths[i])-1]) #assign color to streamlines based on their length
#streamlines with same color have same length
stream_actor = actor.line(bundle1, all_colors, linewidth=1)
scene.add(stream_actor)
#Visualize it
window.show(scene)