diff --git a/v0.9.x/.buildinfo b/v0.9.x/.buildinfo index 28c41f729..30c493086 100644 --- a/v0.9.x/.buildinfo +++ b/v0.9.x/.buildinfo @@ -1,4 +1,4 @@ # Sphinx build info version 1 # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: 886491205fcdd95a3a51ff97d0f0d323 +config: a763c5b6b666bd71306fd0b0ab4cbfba tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/v0.9.x/.doctrees/community.doctree b/v0.9.x/.doctrees/community.doctree index 1a16f95c0..9ade604b2 100644 Binary files a/v0.9.x/.doctrees/community.doctree and b/v0.9.x/.doctrees/community.doctree differ diff --git a/v0.9.x/.doctrees/environment.pickle b/v0.9.x/.doctrees/environment.pickle index 73cb547c6..77e3b639d 100644 Binary files a/v0.9.x/.doctrees/environment.pickle and b/v0.9.x/.doctrees/environment.pickle differ diff --git a/v0.9.x/.doctrees/reference/fury.actor.doctree b/v0.9.x/.doctrees/reference/fury.actor.doctree index 91a7e382e..c8fb5767b 100644 Binary files a/v0.9.x/.doctrees/reference/fury.actor.doctree and b/v0.9.x/.doctrees/reference/fury.actor.doctree differ diff --git a/v0.9.x/.doctrees/reference/fury.actors.doctree b/v0.9.x/.doctrees/reference/fury.actors.doctree index 58b45da75..a2a40d02f 100644 Binary files a/v0.9.x/.doctrees/reference/fury.actors.doctree and b/v0.9.x/.doctrees/reference/fury.actors.doctree differ diff --git a/v0.9.x/.doctrees/reference/fury.deprecator.doctree b/v0.9.x/.doctrees/reference/fury.deprecator.doctree index e81b5c88c..73640cef8 100644 Binary files a/v0.9.x/.doctrees/reference/fury.deprecator.doctree and b/v0.9.x/.doctrees/reference/fury.deprecator.doctree differ diff --git a/v0.9.x/_modules/fury.html b/v0.9.x/_modules/fury.html index fa159a7f0..f4694040a 100644 --- a/v0.9.x/_modules/fury.html +++ b/v0.9.x/_modules/fury.html @@ -4,7 +4,7 @@
-
from fury import layout
from fury.actors.odf_slicer import OdfSlicerActor
from fury.actors.peak import PeakActor
-from fury.actors.tensor import tensor_ellipsoid
+from fury.actors.tensor import double_cone, main_dir_uncertainty, \
+ tensor_ellipsoid
from fury.colormap import colormap_lookup_table
from fury.deprecator import deprecate_with_version, deprecated_params
from fury.io import load_image
@@ -4362,6 +4363,65 @@ Source code for fury.actor
return tensor_ellipsoid(centers, axes, lengths, colors, scales, opacity)
+
+
+[docs]
+def uncertainty_cone(
+ evals,
+ evecs,
+ signal,
+ sigma,
+ b_matrix,
+ scales=.6,
+ opacity=1.0
+):
+ """
+ VTK actor for visualizing the cone of uncertainty representing the
+ variance of the main direction of diffusion.
+
+ Parameters
+ ----------
+ evals : ndarray (3, ) or (N, 3)
+ Eigenvalues.
+ evecs : ndarray (3, 3) or (N, 3, 3)
+ Eigenvectors.
+ signal : 3D or 4D ndarray
+ Predicted signal.
+ sigma : ndarray
+ Standard deviation of the noise.
+ b_matrix : array (N, 7)
+ Design matrix for DTI.
+ scales : float or ndarray (N, ), optional
+ Cones of uncertainty size.
+ opacity : float, optional
+ Takes values from 0 (fully transparent) to 1 (opaque), default(1.0).
+
+ Returns
+ -------
+ double_cone: Actor
+
+ """
+
+ valid_mask = np.abs(evecs).max(axis=(-2, -1)) > 0
+ indices = np.nonzero(valid_mask)
+
+ evecs = evecs[indices]
+ evals = evals[indices]
+ signal = signal[indices]
+
+ centers = np.asarray(indices).T
+ colors = np.array([107, 107, 107])
+
+ x, y, z = evecs.shape
+ if not isinstance(scales, np.ndarray):
+ scales = np.array(scales)
+ if scales.size == 1:
+ scales = np.repeat(scales, x)
+
+ angles = main_dir_uncertainty(evals, evecs, signal, sigma, b_matrix)
+
+ return double_cone(centers, evecs, angles, colors, scales, opacity)
+
Source code for fury.actors.tensor