Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
a2bec28
enable 3d option of cellwise vec
Sichao25 Aug 1, 2023
3ed4061
debug streamtube basis
Sichao25 Aug 2, 2023
a0af0d1
update 3D cell vector color map
Sichao25 Aug 9, 2023
ad0bcc3
add missing params docstr
Sichao25 Aug 9, 2023
2130c6f
create 3D vf class
Sichao25 Aug 16, 2023
d5349a9
3d nullcline WIP
Sichao25 Aug 17, 2023
a33f5a0
add edge case exception
Sichao25 Aug 21, 2023
3425947
add if statement to read grid data direclt
Sichao25 Aug 21, 2023
a21e5e4
add 3D option to vf topography
Sichao25 Aug 30, 2023
828fd12
save zlim in 3d topography
Sichao25 Aug 30, 2023
9aef5e1
create 3d topography graph
Sichao25 Aug 30, 2023
8ae9808
update docstring for the vf topography
Sichao25 Aug 30, 2023
194c0b8
add 3D option to remove_particles
Sichao25 Aug 31, 2023
7f44475
crete StreamFuncAnim
Sichao25 Aug 31, 2023
c1e40fc
add 3D option when initializing StreamFuncAnim
Sichao25 Aug 31, 2023
ecf12f4
create docstring for remove_particles
Sichao25 Aug 31, 2023
b504968
update typing of remove_particles
Sichao25 Aug 31, 2023
466a643
create docstr for StreamFuncAnim3D
Sichao25 Aug 31, 2023
347b8ac
delete compute_nullclines_3d
Sichao25 Sep 1, 2023
da4eb75
create docstr and update typing for VectorField3D
Sichao25 Sep 1, 2023
5af50f7
pass compute_nullclines in VectorField3D
Sichao25 Sep 1, 2023
1a6e72a
debug 3d scatters
Sichao25 Sep 20, 2023
d2a221b
create pyvista 3d scatters
Sichao25 Sep 20, 2023
c057c18
enable colors selection in pv
Sichao25 Sep 20, 2023
03e3142
debug colors selection
Sichao25 Sep 20, 2023
199b058
optimize pyvista saving
Sichao25 Sep 20, 2023
3cc392f
implement multiple input options for x, y, z
Sichao25 Sep 21, 2023
4e08d76
add pv scatters legend, title, axes
Sichao25 Sep 21, 2023
6c029c8
add docstr and typing for scatters_pv
Sichao25 Sep 21, 2023
ffdadd5
implement subplots
Sichao25 Sep 21, 2023
0a0d1ad
debug title for integer axes input
Sichao25 Sep 21, 2023
62adedf
create pv 3d vectors plot
Sichao25 Sep 21, 2023
1df5adb
color the pyvista 3d vector
Sichao25 Sep 21, 2023
dbcaf0e
debug scatters_pv color with multiple colors
Sichao25 Sep 21, 2023
389435d
implement multiple plots in 3d pv vecters
Sichao25 Sep 21, 2023
aaa1612
optimize scatters pv color
Sichao25 Sep 22, 2023
610b7c9
create todo
Sichao25 Sep 22, 2023
3a63363
create pyvista option in 3d topography
Sichao25 Sep 22, 2023
8519c3e
implement pyvista fixed points plot in topography
Sichao25 Sep 22, 2023
5a7264d
update docstr
Sichao25 Sep 22, 2023
3260a35
create helper class for saving pyvista plotter
Sichao25 Sep 22, 2023
b7c3b29
create BaseAnim class
Sichao25 Sep 25, 2023
ac48efe
create PyvistaAnim class
Sichao25 Sep 25, 2023
f94d70f
pyvista animate WIP
Sichao25 Sep 26, 2023
6043082
debug streamtube 3d
Sichao25 Sep 26, 2023
3d8badb
tune streamtube parameters
Sichao25 Sep 26, 2023
c030fd6
create plotly saving function
Sichao25 Sep 27, 2023
382e3e6
add plotly 3d scatters options
Sichao25 Sep 27, 2023
0e0337b
rename scatters_pv to scatters_interactive
Sichao25 Sep 27, 2023
7a6d4ea
add plotly cone option
Sichao25 Sep 27, 2023
4dbba0b
implement plotly option in 3d topography
Sichao25 Sep 28, 2023
79be07a
reorganize import statements
Sichao25 Sep 28, 2023
4407a3d
create plotly animation
Sichao25 Sep 28, 2023
dfdbaa0
debug pyvista 3D animation
Sichao25 Oct 16, 2023
c7119dc
distinguish fps color for pyvista
Sichao25 Oct 16, 2023
587a73b
support cone color input and add todo
Sichao25 Oct 16, 2023
bd1492c
debug plotly topogrgphy
Sichao25 Oct 16, 2023
4114af7
debug zorder in matplotlib 3d
Sichao25 Oct 18, 2023
2c263d5
debug 2D anmation and add docstr
Sichao25 Oct 20, 2023
e570597
remove unnecessary code
Sichao25 Oct 20, 2023
4efeff0
update docstr
Sichao25 Oct 20, 2023
07afdb4
debug and remove not implemented function from init
Sichao25 Oct 31, 2023
926bf54
Merge branch 'master' into pl
Sichao25 Oct 31, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dynamo/movie/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Mapping Vector Field of Single Cells
"""

from .fate import StreamFuncAnim, animate_fates
from .fate import PyvistaAnim, StreamFuncAnim, StreamFuncAnim3D, animate_fates
599 changes: 458 additions & 141 deletions dynamo/movie/fate.py

Large diffs are not rendered by default.

26 changes: 23 additions & 3 deletions dynamo/movie/utils.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,30 @@
from typing import Union
from typing import Optional, Union

import numpy as np

def remove_particles(pts: list, xlim: Union[tuple, list], ylim: Union[tuple, list]):

def remove_particles(
pts: np.ndarray,
xlim: Union[tuple, list],
ylim: Union[tuple, list],
zlim: Optional[Union[tuple, list]] = None,
) -> np.ndarray:
"""Remove particles that fall outside specified coordinate ranges.

Args:
pts: an array of points.
xlim: X-coordinate limits specified as a tuple or list of two values: (min_x, max_x).
ylim: Y-coordinate limits specified as a tuple or list of two values: (min_y, max_y).
zlim: Z-coordinate limits specified as a tuple or list of two values: (min_z, max_z). If not provided (default),
only 2D filtering based on xlim and ylim is performed.

Returns:
An array of points that fall within the specified coordinate ranges.
"""
if len(pts) == 0:
return []
outside_xlim = (pts[:, 0] < xlim[0]) | (pts[:, 0] > xlim[1])
outside_ylim = (pts[:, 1] < ylim[0]) | (pts[:, 1] > ylim[1])
keep = ~(outside_xlim | outside_ylim)
outside_zlim = np.full(outside_xlim.shape, False) if zlim is None else (pts[:, 2] < ylim[0]) | (pts[:, 2] > ylim[1])
keep = ~(outside_xlim | outside_ylim | outside_zlim)
return pts[keep]
5 changes: 4 additions & 1 deletion dynamo/plot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
variance_explained,
)
from .pseudotime import plot_dim_reduced_direct_graph
from .scatters import scatters
from .scatters import scatters, scatters_interactive
from .scPotential import show_landscape
from .sctransform import sctransform_plot_fit, plot_residual_var
from .scVectorField import ( # , plot_LIC_gray
Expand Down Expand Up @@ -61,6 +61,7 @@
plot_separatrix,
plot_traj,
topography,
topography_3D,
)

# from .theme import points
Expand All @@ -81,6 +82,7 @@
"quiver_autoscaler",
"save_fig",
"scatters",
"scatters_interactive",
"basic_stats",
"show_fraction",
"feature_genes",
Expand Down Expand Up @@ -116,6 +118,7 @@
"plot_separatrix",
"plot_traj",
"topography",
"topography_3D",
"speed",
"acceleration",
"curl",
Expand Down
Loading