6ea94ab139681914fa165403a283c3b0d08b783b,doc/examples/segment_extending_clustering_framework.py,,,#,216

Before Change



fname = get_fnames("fornix")
streams, hdr = tv.read(fname)
streamlines = [i[0] for i in streams]


Perform QuickBundles clustering using our metric ``CosineMetric``.


from dipy.segment.clustering import QuickBundles

metric = CosineMetric()
qb = QuickBundles(threshold=0.1, metric=metric)
clusters = qb.cluster(streamlines)


We will now visualize the clustering result.


// Color each streamline according to the cluster they belong to.
colormap = actor.create_colormap(np.arange(len(clusters)))
colormap_full = np.ones((len(streamlines), 3))
for cluster, color in zip(clusters, colormap):
    colormap_full[cluster.indices] = color

ren = window.Renderer()
ren.SetBackground(1, 1, 1)

After Change


from dipy.viz import window, actor

fname = get_fnames("fornix")
fornix = load_tractogram(fname, "same",
                         bbox_valid_check=False).streamlines

streamlines = Streamlines(fornix)


Perform QuickBundles clustering using our metric ``CosineMetric``.


from dipy.segment.clustering import QuickBundles

metric = CosineMetric()
qb = QuickBundles(threshold=0.1, metric=metric)
clusters = qb.cluster(streamlines)


We will now visualize the clustering result.


// Color each streamline according to the cluster they belong to.
colormap = actor.create_colormap(np.arange(len(clusters)))
colormap_full = np.ones((len(streamlines), 3))
for cluster, color in zip(clusters, colormap):
    colormap_full[cluster.indices] = color

ren = window.Renderer()
ren.SetBackground(1, 1, 1)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 12

Instances


Project Name: nipy/dipy
Commit Name: 6ea94ab139681914fa165403a283c3b0d08b783b
Time: 2019-07-30
Author: skab12@gmail.com
File Name: doc/examples/segment_extending_clustering_framework.py
Class Name:
Method Name:


Project Name: nipy/dipy
Commit Name: 6ea94ab139681914fa165403a283c3b0d08b783b
Time: 2019-07-30
Author: skab12@gmail.com
File Name: doc/examples/segment_extending_clustering_framework.py
Class Name:
Method Name:


Project Name: nipy/dipy
Commit Name: 6ea94ab139681914fa165403a283c3b0d08b783b
Time: 2019-07-30
Author: skab12@gmail.com
File Name: doc/examples/segment_quickbundles.py
Class Name:
Method Name: