vedo.applications

slicing
RayCastPlotter
Bases: Plotter
Generate Volume rendering using ray casting.
Source code in vedo/applications/slicing.py
869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 | |
Slicer2DPlotter
Bases: Plotter
A single slice of a Volume which always faces the camera, but at the same time can be oriented arbitrarily in space.
Source code in vedo/applications/slicing.py
643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 | |
alpha(value)
Set opacity to the slice
Source code in vedo/applications/slicing.py
801 802 803 804 | |
auto_adjust_quality(value=True)
Automatically reduce the rendering quality for greater speed when interacting
Source code in vedo/applications/slicing.py
806 807 808 809 | |
cmap(lut=None, fix_scalar_range=False)
Assign a LUT (Look Up Table) to colorize the slice, leave it None
to reuse an existing Volume color map.
Use "bw" for automatic black and white.
Source code in vedo/applications/slicing.py
786 787 788 789 790 791 792 793 794 795 796 797 798 799 | |
face_camera(value=True)
Make the slice always face the camera or not.
Source code in vedo/applications/slicing.py
834 835 836 837 | |
fill_background(value=True)
Instead of rendering only to the image border, render out to the viewport boundary with the background color. The background color will be the lowest color on the lookup table that is being used for the image.
Source code in vedo/applications/slicing.py
849 850 851 852 853 854 855 856 857 | |
jump_to_nearest_slice(value=True)
This causes the slicing to occur at the closest slice to the focal point, instead of the default behavior where a new slice is interpolated between the original slices. Nothing happens if the plane is oblique to the original slices.
Source code in vedo/applications/slicing.py
839 840 841 842 843 844 845 846 847 | |
lighting(window, level, ambient=1.0, diffuse=0.0)
Assign the values for window and color level.
Source code in vedo/applications/slicing.py
859 860 861 862 863 864 865 | |
on_key_press(evt)
Handle keyboard events
Source code in vedo/applications/slicing.py
774 775 776 777 778 779 780 781 782 783 784 | |
slab(thickness=0, mode=0, sample_factor=2)
Make a thick slice (slab).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
thickness
|
float
|
set the slab thickness, for thick slicing |
0
|
mode
|
int
|
The slab type: 0 = min 1 = max 2 = mean 3 = sum |
0
|
sample_factor
|
float
|
Set the number of slab samples to use as a factor of the number of input slices within the slab thickness. The default value is 2, but 1 will increase speed with very little loss of quality. |
2
|
Source code in vedo/applications/slicing.py
811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 | |
Slicer3DPlotter
Bases: Plotter
Generate a rendering window with slicing planes for the input Volume.
Source code in vedo/applications/slicing.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 | |
set_volume(volume, reset_slices=True, reset_camera=False, render=True)
Replace the input volume while preserving the existing plotter window.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
volume
|
Volume
|
the new input volume to visualize. |
required |
reset_slices
|
bool
|
if True reset slices to their default positions, otherwise preserve them when possible. |
True
|
reset_camera
|
bool
|
if True reset the camera after swapping the volume. |
False
|
render
|
bool
|
if True render the scene after the update. |
True
|
Source code in vedo/applications/slicing.py
421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 | |
Slicer3DTwinPlotter
Bases: Plotter
Create a window with two side-by-side 3D slicers for two Volumes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vol1
|
Volume
|
the first Volume object to be isosurfaced. |
required |
vol2
|
Volume
|
the second Volume object to be isosurfaced. |
required |
clamp
|
bool
|
clamp scalar range to reduce the effect of tails in color mapping |
True
|
**kwargs
|
dict
|
keyword arguments to pass to a |
{}
|
Examples:
from vedo import *
from vedo.applications import Slicer3DTwinPlotter
vol1 = Volume(dataurl + "embryo.slc")
vol2 = Volume(dataurl + "embryo.slc")
plt = Slicer3DTwinPlotter(
vol1, vol2,
shape=(1, 2),
sharecam=True,
bg="white",
bg2="lightblue",
)
plt.at(0).add(Text2D("Volume 1", pos="top-center"))
plt.at(1).add(Text2D("Volume 2", pos="top-center"))
plt.show(viewup='z')
plt.at(0).reset_camera()
plt.interactive().close()

Source code in vedo/applications/slicing.py
493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 | |
morphing
MorphByLandmarkPlotter
Bases: Plotter
Source code in vedo/applications/morphing.py
329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 | |
do_morph()
Perform the morphing operation on the mesh. This method morphs the mesh using the provided source and target points.
Source code in vedo/applications/morphing.py
438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 | |
MorphBySplinesPlotter
Bases: Plotter
Source code in vedo/applications/morphing.py
632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 | |
MorphPlotter
Bases: Plotter
A Plotter with 3 renderers to show the source, target and warped meshes.
Examples:
Source code in vedo/applications/morphing.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 | |
on_click(evt)
Handle mouse click events
Source code in vedo/applications/morphing.py
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 | |
on_keypress(evt)
Handle keyboard events
Source code in vedo/applications/morphing.py
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 | |
update()
Update the rendering window
Source code in vedo/applications/morphing.py
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 | |
browsers
Browser
Bases: Plotter
Browse a series of vedo objects by using a simple slider.
Source code in vedo/applications/browsers.py
211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 | |
play(dt=100)
Start playing the slides at a given speed.
Source code in vedo/applications/browsers.py
338 339 340 341 342 | |
IsosurfaceBrowser
Bases: Plotter
Generate a Volume isosurfacing controlled by a slider.
Source code in vedo/applications/browsers.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 | |
editing
FreeHandCutPlotter
Bases: Plotter
A tool to edit meshes interactively.
Source code in vedo/applications/editing.py
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 | |
init(init_points)
Set an initial number of points to define a region
Source code in vedo/applications/editing.py
127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 | |
start(*args, **kwargs)
Start window interaction (with mouse and keyboard)
Source code in vedo/applications/editing.py
281 282 283 284 285 | |
write(filename='mesh_edited.vtk')
Save the resulting mesh to file
Source code in vedo/applications/editing.py
275 276 277 278 279 | |
ImageEditor
Bases: Plotter
A simple image editor for applying various filters to images.
Source code in vedo/applications/editing.py
433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 | |
key_func(evt)
Handle key events for image editing.
Source code in vedo/applications/editing.py
509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 | |
start()
Start the interactive image editor.
Source code in vedo/applications/editing.py
604 605 606 607 | |
SplinePlotter
Bases: Plotter
Interactive drawing of splined curves on meshes.
Source code in vedo/applications/editing.py
289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 | |
points(newpts=None)
Retrieve the 3D coordinates of the clicked points
Source code in vedo/applications/editing.py
362 363 364 365 366 367 368 | |
start()
Start the interaction
Source code in vedo/applications/editing.py
425 426 427 428 429 | |
update()
Update the plot with the new points
Source code in vedo/applications/editing.py
392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 | |
animation
Animation
Bases: Plotter
A Plotter derived class that allows to animate simultaneously various objects
by specifying event times and durations of different visual effects.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
total_duration
|
float
|
expand or shrink the total duration of video to this value |
None
|
time_resolution
|
float
|
in seconds, save a frame at this rate |
0.02
|
show_progressbar
|
bool
|
whether to show a progress bar or not |
True
|
video_filename
|
str
|
output file name of the video |
'animation.mp4'
|
video_fps
|
int
|
desired value of the nr of frames per second |
12
|
.. warning:: this is still very experimental at the moment.
Source code in vedo/applications/animation.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 | |
change_alpha_between(alpha1, alpha2, acts=None, t=None, duration=None)
Gradually change transparency for the input list of meshes.
Source code in vedo/applications/animation.py
147 148 149 150 151 152 153 154 155 156 157 | |
change_backcolor(c, acts=None, t=None, duration=None)
Gradually change backface color for the input list of meshes. An initial backface color should be set in advance.
Source code in vedo/applications/animation.py
179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 | |
change_color(c, acts=None, t=None, duration=None)
Gradually change color for the input list of meshes.
Source code in vedo/applications/animation.py
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 | |
change_lighting(style, acts=None, t=None, duration=None)
Gradually change the lighting style for the input list of meshes.
Allowed styles are: [metallic, plastic, shiny, glossy, default].
Source code in vedo/applications/animation.py
257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 | |
change_line_color(c, acts=None, t=None, duration=None)
Gradually change line color of the mesh edges for the input list of meshes.
Source code in vedo/applications/animation.py
238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 | |
change_line_width(lw, acts=None, t=None, duration=None)
Gradually change line width of the mesh edges for the input list of meshes.
Source code in vedo/applications/animation.py
223 224 225 226 227 228 229 230 231 232 233 234 235 236 | |
change_to_surface(acts=None, t=None)
Switch representation to surface for the input list of meshes at time t.
Source code in vedo/applications/animation.py
213 214 215 216 217 218 219 220 221 | |
change_to_wireframe(acts=None, t=None)
Switch representation to wireframe for the input list of meshes at time t.
Source code in vedo/applications/animation.py
203 204 205 206 207 208 209 210 211 | |
fade_in(acts=None, t=None, duration=None)
Gradually switch on the input list of meshes by increasing opacity.
Source code in vedo/applications/animation.py
118 119 120 121 122 123 124 125 126 127 128 129 130 131 | |
fade_out(acts=None, t=None, duration=None)
Gradually switch off the input list of meshes by increasing transparency.
Source code in vedo/applications/animation.py
133 134 135 136 137 138 139 140 141 142 143 144 145 | |
mesh_erode(act=None, corner=6, t=None, duration=None)
Erode a mesh by removing cells that are close to one of the 8 corners of the bounding box.
Source code in vedo/applications/animation.py
355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 | |
move(act=None, pt=(0, 0, 0), t=None, duration=None, style='linear')
Smoothly change the position of a specific object to a new point in space.
Source code in vedo/applications/animation.py
303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 | |
play()
Play the internal list of events and save a video.
Source code in vedo/applications/animation.py
387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 | |
rotate(act=None, axis=(1, 0, 0), angle=0, t=None, duration=None)
Smoothly rotate a specific object by a specified angle and axis.
Source code in vedo/applications/animation.py
324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 | |
scale(acts=None, factor=1, t=None, duration=None)
Smoothly scale a specific object to a specified scale factor.
Source code in vedo/applications/animation.py
343 344 345 346 347 348 349 350 351 352 353 | |
switch_off(acts=None, t=None)
Switch off the input list of meshes.
Source code in vedo/applications/animation.py
114 115 116 | |
switch_on(acts=None, t=None)
Switch on the input list of meshes.
Source code in vedo/applications/animation.py
110 111 112 | |
AnimationPlayer
Bases: Plotter
A Plotter with play/pause, step forward/backward and slider functionalties. Useful for inspecting time series.
The user has the responsibility to update all actors in the callback function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
func
|
Callable
|
a function that passes an integer as input and updates the scene |
required |
irange
|
tuple
|
the range of the integer input representing the time series index |
required |
dt
|
float
|
the time interval between two calls to |
1.0
|
loop
|
bool
|
whether to loop the animation |
True
|
c
|
(list, str)
|
the color of the play/pause button |
('white', 'white')
|
bc
|
list
|
the background color of the play/pause button and the slider |
('green3', 'red4')
|
button_size
|
int
|
the size of the play/pause buttons |
25
|
button_pos
|
(float, float)
|
the position of the play/pause buttons as a fraction of the window size |
(0.5, 0.04)
|
button_gap
|
float
|
the gap between the buttons |
0.055
|
slider_length
|
float
|
the length of the slider as a fraction of the window size |
0.5
|
slider_pos
|
(float, float)
|
the position of the slider as a fraction of the window size |
(0.5, 0.055)
|
kwargs
|
dict
|
keyword arguments to be passed to |
{}
|
Examples:
Source code in vedo/applications/animation.py
434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 | |
onebackward(_obj, _evt)
Go back one frame in the animation.
Source code in vedo/applications/animation.py
578 579 580 581 | |
oneforward(_obj, _evt)
Advance the animation by one frame.
Source code in vedo/applications/animation.py
573 574 575 576 | |
pause()
Pause the animation.
Source code in vedo/applications/animation.py
550 551 552 553 554 555 556 | |
resume()
Resume the animation.
Source code in vedo/applications/animation.py
558 559 560 561 562 563 564 | |
set_frame(value)
Set the current value of the animation.
Source code in vedo/applications/animation.py
583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 | |
stop()
Stop the animation timers, remove buttons and slider.
Behave like a normal Plotter after this.
Source code in vedo/applications/animation.py
610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 | |
toggle(_obj, _evt)
Toggle between play and pause.
Source code in vedo/applications/animation.py
566 567 568 569 570 571 | |
Clock
Bases: Assembly
Create a clock with current time or user provided time.
Source code in vedo/applications/animation.py
632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 | |
update(h=None, m=None, s=None)
Update clock with current or user time.
Source code in vedo/applications/animation.py
717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 | |
