cylindra.components
CylSpline
Bases: Spline
A spline object with cylindrical structure.
Source code in cylindra/components/spline/_cyl_spline.py
16 17 18 19 20 21 22 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 |
|
orientation: Ori
property
writable
Orientation of the spline.
radius: nm | None
property
writable
Average radius of the cylinder.
clip(start, stop)
Clip spline and generate a new one.
This method does not convert spline bases. _lims
is updated instead.
For instance, if you want to clip spline at 20% to 80% position, call
spl.clip(0.2, 0.8)
. If stop < start
, the orientation of spline
will be inverted, thus the orientation
attribute will also be inverted.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
start
|
float
|
New starting position. |
required |
stop
|
float
|
New stopping position. |
required |
Returns:
Type | Description |
---|---|
CylSpline
|
Clipped spline. |
Source code in cylindra/components/spline/_cyl_spline.py
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 |
|
cylinder_model(offsets=(0.0, 0.0), **kwargs)
Return the cylinder model of the spline.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
offsets
|
tuple of float
|
Offset of the model. See :meth: |
(0.0, 0.0)
|
Returns:
Type | Description |
---|---|
CylinderModel
|
The cylinder model. |
Source code in cylindra/components/spline/_cyl_spline.py
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 |
|
cylinder_params(**kwargs)
Get the cylinder parameters of the spline.
Source code in cylindra/components/spline/_cyl_spline.py
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 |
|
invert()
Invert the direction of spline. Also invert orientation if exists.
Returns:
Type | Description |
---|---|
CylSpline
|
Inverted object |
Source code in cylindra/components/spline/_cyl_spline.py
61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
|
nrise(**kwargs)
Raw start number (minus for microtubule)
Source code in cylindra/components/spline/_cyl_spline.py
124 125 126 127 128 129 130 131 132 |
|
radius_range(rc=None)
Return the range of the radius used for the cylindric coordinate.
Source code in cylindra/components/spline/_cyl_spline.py
38 39 40 41 42 43 44 45 |
|
restore()
Restore the original, not-clipped spline.
Returns:
Type | Description |
---|---|
Spline
|
Copy of the original spline. |
Source code in cylindra/components/spline/_cyl_spline.py
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
|
update_glob_by_cylinder_params(cparams)
Update the global properties using a CylinderParameters object.
Source code in cylindra/components/spline/_cyl_spline.py
218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 |
|
update_props(*, npf=None, start=None, orientation=None)
Update the npf or orientation parameters in place.
Source code in cylindra/components/spline/_cyl_spline.py
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 |
|
Spline
Bases: BaseComponent
3D spline curve model with coordinate system.
Anchor points can be set via anchor
property. A spline object is semi-immutable.
Different spline curves are always of different objects, but the anchors and
properties can be dynamically changed.
References
- Scipy document https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.splprep.html
Source code in cylindra/components/spline/_spline_base.py
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 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 629 630 631 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 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 866 867 868 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 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 |
|
anchors: NDArray[np.float32]
deletable
property
writable
Local anchors along spline.
coeff: list[np.ndarray]
property
Spline coefficient.
config: SplineConfig
property
Return the spline configuration
extrapolate: ExtrapolationMode
property
Extrapolation mode of the spline.
has_anchors: bool
property
True if there are any anchors.
knots: np.ndarray
property
Spline knots.
lims: tuple[float, float]
property
Return spline limit positions.
order: int
property
Spline order.
params: np.ndarray
property
Spline parameters.
props: SplineProps
property
Return the spline properties
__repr__()
Use start/end points to describe a spline.
Source code in cylindra/components/spline/_spline_base.py
282 283 284 285 286 287 |
|
anchors_to_molecules(positions=None, rotation=None)
Convert coordinates of anchors to Molecules
instance.
Coordinates of anchors must be in range from 0 to 1. The y-direction of
Molecules
always points at the direction of spline and the z- direction always
in the plane orthogonal to YX-plane.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
positions
|
iterable of float
|
Positions. Between 0 and 1. If not given, anchors are used instead. |
None
|
Returns:
Type | Description |
---|---|
Molecules
|
Molecules object of points. |
Source code in cylindra/components/spline/_spline_base.py
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 |
|
cartesian(shape, s_range=(0, 1), scale=1.0)
Generate a Cartesian coordinate system along spline that can be used for
ndi.map_coordinate
. Note that this coordinate system is distorted, thus
does not reflect real geometry (such as distance and derivatives).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
shape
|
(float, float)
|
The ZX-shape of output coordinate system. Center of the array will be spline curve itself after coodinate transformation. |
required |
s_range
|
tuple[float, float]
|
Range of spline. Spline coordinate system will be built between
|
(0, 1)
|
scale
|
nm
|
Scale of coordinates, i.e. spacing of the grid. |
1.0
|
Returns:
Type | Description |
---|---|
ndarray
|
(V, S, H, D) shape. Each cooresponds to vertical, longitudinal, horizontal and dimensional axis. |
Source code in cylindra/components/spline/_spline_base.py
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 |
|
cartesian_to_world(coords, nknots=512)
Inverse Cartesian coordinate mapping, (z', y', x') to world coordinate.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
coords
|
ndarray
|
Spline Cartesian coordinates. All the coordinates must be in nm unit. |
required |
Returns:
Type | Description |
---|---|
ndarray
|
World coordinates. |
Source code in cylindra/components/spline/_spline_base.py
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 |
|
clip(start, stop)
Clip spline and generate a new one.
This method does not convert spline bases. _lims
is updated instead.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
start
|
float
|
New starting position. |
required |
stop
|
float
|
New stopping position. |
required |
Returns:
Type | Description |
---|---|
Spline
|
Clipped spline. |
Source code in cylindra/components/spline/_spline_base.py
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 |
|
close_to(other)
True if two objects draws the same curve.
Source code in cylindra/components/spline/_spline_base.py
289 290 291 292 293 294 295 296 297 298 299 300 301 |
|
copy(copy_props=True, copy_config=True)
Copy Spline object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
copy_props
|
bool
|
Also copy local/global properties if true. |
True
|
Returns:
Type | Description |
---|---|
Spline
|
Copied object. |
Source code in cylindra/components/spline/_spline_base.py
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 |
|
curvature(positions=None)
Calculate curvature of spline curve.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
positions
|
sequence of float
|
Positions. Between 0 and 1. If not given, anchors are used instead. |
None
|
Returns:
Type | Description |
---|---|
ndarray
|
Array of curvature. |
References
- https://en.wikipedia.org/wiki/Curvature#Space_curves
Source code in cylindra/components/spline/_spline_base.py
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 |
|
curvature_radii(positions=None)
Inverse of curvature.
Source code in cylindra/components/spline/_spline_base.py
705 706 707 |
|
cylindrical(r_range, s_range=(0, 1), scale=1.0)
Generate a cylindrical coordinate system along spline that can be used for
ndi.map_coordinate
. Note that this coordinate system is distorted, thus
does not reflect real geometry (such as distance and derivatives).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
r_range
|
(nm, nm)
|
Range of radius in nm. r=0 will be spline curve itself after coodinate transformation. |
required |
s_range
|
tuple[float, float]
|
Range of spline. Spline coordinate system will be built between
|
(0, 1)
|
scale
|
nm
|
Scale of coordinates, i.e. spacing of the grid. |
1.0
|
Returns:
Type | Description |
---|---|
ndarray
|
(V, S, H, D) shape. Each cooresponds to radius, longitudinal, angle and dimensional axis. |
Source code in cylindra/components/spline/_spline_base.py
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 |
|
cylindrical_to_molecules(coords)
Convert coordinates of points near the spline to Molecules
instance.
Coordinates of points must be those in spline cylindrical coordinate system.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
coords
|
(N, 3) array
|
Spline cylindrical coordinates of points. |
required |
Returns:
Type | Description |
---|---|
Molecules
|
Molecules object of points. |
Source code in cylindra/components/spline/_spline_base.py
1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 |
|
cylindrical_to_world(coords)
Inverse cylindrical coordinate mapping, (r, y, angle) to world coordinate.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
coords
|
ndarray
|
Cylindrical coordinates. "r" and "y" must be in scale of "nm", while angle must be in radian. |
required |
Returns:
Type | Description |
---|---|
ndarray
|
World coordinates. |
Source code in cylindra/components/spline/_spline_base.py
987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 |
|
distances(positions=None, nknots=512)
Get the distances from u=0.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
positions
|
sequence of float
|
Positions. Between 0 and 1. If not given, anchors are used instead. |
None
|
Returns:
Type | Description |
---|---|
ndarray
|
Distances for each |
Source code in cylindra/components/spline/_spline_base.py
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 |
|
fit(coords, *, err_max=1.0)
Fit spline model to coordinates.
This method uses scipy.interpolate.splprep
to fit given coordinates to a
spline.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
coords
|
ndarray
|
Coordinates. Must be (N, 3). |
required |
err_max
|
float
|
Error allowed for fitting. Several upper limit of residual values will be used and the fit that results in error lower than this value and minimize the maximum curvature will be chosen. |
1.0
|
Returns:
Type | Description |
---|---|
Spline
|
New spline fit to given coordinates. |
Source code in cylindra/components/spline/_spline_base.py
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 |
|
from_dict(d)
classmethod
Construct a spline model from a dictionary.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
d
|
SplineInfo
|
Dictionary with keys "t", "c", "k", "u" and "lims". |
required |
Returns:
Type | Description |
---|---|
Spline
|
Spline object constructed from the dictionary. |
Source code in cylindra/components/spline/_spline_base.py
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 |
|
get_rotator(positions=None, inverse=False)
Calculate list of Affine transformation matrix along spline, which correspond to the orientation of spline curve.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
positions
|
(array - like, (N))
|
Positions. Between 0 and 1. |
None
|
inverse
|
bool
|
If True, rotation matrix will be inversed. |
False
|
Returns:
Type | Description |
---|---|
Rotation
|
Rotation object at each anchor. |
Source code in cylindra/components/spline/_spline_base.py
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 |
|
has_props()
True if there are any properties.
Source code in cylindra/components/spline/_spline_base.py
81 82 83 |
|
invert()
Invert the direction of spline.
Returns:
Type | Description |
---|---|
Spline
|
Inverted object |
Source code in cylindra/components/spline/_spline_base.py
627 628 629 630 631 632 633 634 635 636 637 638 639 640 |
|
is_inverted()
Return true if spline is inverted.
Source code in cylindra/components/spline/_spline_base.py
224 225 226 |
|
length(start=0, stop=1, nknots=512)
Approximate the length of B-spline between [start, stop] by partitioning the spline with 'nknots' knots. nknots=256 is large enough for most cases.
Source code in cylindra/components/spline/_spline_base.py
616 617 618 619 620 621 622 623 624 625 |
|
line(start, end)
classmethod
Create a line spline.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
start
|
array_like
|
Start point of the line. |
required |
end
|
array_like
|
End point of the line. |
required |
Returns:
Type | Description |
---|---|
Spline
|
Line spline. |
Source code in cylindra/components/spline/_spline_base.py
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 |
|
local_cartesian(shape, depth, u=None, scale=1.0)
Generate local Cartesian coordinate systems.
The generated array can be used for ndi.map_coordinates
. The result coordinate
systems are flat, i.e., not distorted by the curvature of spline.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
shape
|
(float, float)
|
Vertical and horizontal length of Cartesian coordinates. Corresponds to zx axes. |
required |
depth
|
float
|
Length of y axis in nm. |
required |
u
|
float
|
Position on the spline at which local Cartesian coordinates will be built. |
None
|
scale
|
nm
|
Scale of coordinates, i.e. spacing of the grid. |
1.0
|
Returns:
Type | Description |
---|---|
ndarray
|
(D, V, S, H) shape. Each cooresponds to dimensional vertical, longitudinal
and horizontal axis, which is ready to be used in |
Source code in cylindra/components/spline/_spline_base.py
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 |
|
local_cylindrical(r_range, depth, u=None, scale=1.0)
Generate local cylindrical coordinate systems.
The generated array can be used for ndi.map_coordinates
. The result coordinate
systems are flat, i.e., not distorted by the curvature of spline.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
r_range
|
(float, float)
|
Lower and upper bound of radius in nm. |
required |
depth
|
nm
|
Length of y axis in nm. |
required |
u
|
float
|
Position on the spline at which local cylindrical coordinates will be built. |
None
|
scale
|
nm
|
Scale of coordinates, i.e. spacing of the grid. |
1.0
|
Returns:
Type | Description |
---|---|
ndarray
|
(D, V, S, H) shape. Each cooresponds to dimensional, radius, longitudinal
and angle axis, which is ready to be used in |
Source code in cylindra/components/spline/_spline_base.py
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 866 867 868 869 870 |
|
make_anchors(interval=None, n=None, max_interval=None)
Make anchor points at constant intervals. Either interval, number of anchor or the maximum interval between anchors can be specified.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
interval
|
nm
|
Interval between anchor points. |
None
|
n
|
int
|
Number of anchor points, including both ends. |
None
|
max_interval
|
nm | None
|
Spline will be split by as little anchors as possible but interval between anchors will not be larger than this. The number of anchors are also guaranteed to be larger than spline order. |
None
|
Source code in cylindra/components/spline/_spline_base.py
258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 |
|
map(positions=None, der=0)
Calculate coordinates (or n-th derivative) at points on the spline.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
positions
|
ndarray or float
|
Positions. Between 0 and 1. If not given, anchors are used instead. |
None
|
der
|
int
|
|
0
|
Returns:
Type | Description |
---|---|
ndarray
|
Positions or vectors in (3,) or (N, 3) shape. |
Source code in cylindra/components/spline/_spline_base.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 603 604 605 606 607 |
|
partition(n, der=0)
Return the n-partitioning coordinates of the spline.
Source code in cylindra/components/spline/_spline_base.py
611 612 613 614 |
|
resample(max_interval=1.0, err_max=0.1)
Resample a new spline along the original spline.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
max_interval
|
nm
|
Maximum interval between resampling points. |
1.0
|
err_max
|
float
|
Spline fitting maximum error. |
0.1
|
Returns:
Type | Description |
---|---|
Spline
|
Resampled spline object. |
Source code in cylindra/components/spline/_spline_base.py
346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 |
|
restore()
Restore the original, not-clipped spline.
Returns:
Type | Description |
---|---|
Spline
|
Copy of the original spline. |
Source code in cylindra/components/spline/_spline_base.py
330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 |
|
shift(positions=None, shifts=None, *, err_max=1.0)
Fit spline model using a list of shifts in XZ-plane.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
positions
|
sequence of float
|
Positions. Between 0 and 1. If not given, anchors are used instead. |
None
|
shifts
|
ndarray
|
Shift from center in nm. Must be (N, 2). |
None
|
err_max
|
float
|
Error allowed for fitting. See |
1.0
|
Returns:
Type | Description |
---|---|
Spline
|
Spline shifted by fitting to given coordinates. |
Source code in cylindra/components/spline/_spline_base.py
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 |
|
to_dict()
Convert spline info into a dict.
Source code in cylindra/components/spline/_spline_base.py
709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 |
|
translate(shift)
Translate the spline by given shift vectors.
Source code in cylindra/components/spline/_spline_base.py
178 179 180 181 182 183 |
|
with_config(config, copy_props=False)
Return a copy of the spline with a new config.
Source code in cylindra/components/spline/_spline_base.py
120 121 122 123 124 125 126 127 128 129 130 |
|
with_extrapolation(extrapolate)
Return a copy of the spline with a new extrapolation mode.
Source code in cylindra/components/spline/_spline_base.py
114 115 116 117 118 |
|
y_to_position(y, nknots=512)
Convert y-coordinate to spline position parameter.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
y
|
array - like
|
Y coordinates. |
required |
nknots
|
int
|
Number of knots. Increasing the number of knots will increase the accuracy. |
512
|
Source code in cylindra/components/spline/_spline_base.py
936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 |
|
SplineConfig
dataclass
Class for spline configuration.
Source code in cylindra/components/spline/_config.py
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 |
|
construct(**kwargs)
classmethod
Construct a SplineConfig with argument check.
Source code in cylindra/components/spline/_config.py
120 121 122 123 |
|
CylTomogram
Bases: Tomogram
Tomogram with cylindrical splines.
Source code in cylindra/components/tomogram/_cyl_tomo.py
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 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 629 630 631 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 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 866 867 868 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 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 |
|
splines: SplineList
property
List of splines.
add_spline(coords, *, order=3, err_max=0.5, extrapolate=ExtrapolationMode.linear, config={})
Add spline path to tomogram.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
coords
|
array - like
|
(N, 3) array of coordinates. A spline curve that fit it well is added. |
required |
order
|
int
|
Order of spline curve. |
3
|
extrapolate
|
str
|
Extrapolation mode of the spline. |
linear
|
config
|
SplineConfig or dict
|
Configuration for spline fitting. |
{}
|
Source code in cylindra/components/tomogram/_cyl_tomo.py
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 |
|
align_to_polarity(orientation=Ori.MinusToPlus)
Align all the splines in the direction parallel to the given polarity.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
orientation
|
Ori or str
|
To which direction splines will be aligned. |
Ori.MinusToPlus
|
Returns:
Type | Description |
---|---|
Tomogram object
|
Same object with updated splines. |
Source code in cylindra/components/tomogram/_cyl_tomo.py
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 |
|
fit(i=None, *, max_interval=30.0, degree_precision=0.5, binsize=1, err_max=1.0, edge_sigma=2.0, max_shift=5.0, n_rotations=5)
Roughly fit splines to cylindrical structures.
Subtomograms will be sampled at every max_interval
nm. In dense mode,
Subtomograms will be masked relative to XY-plane, using sigmoid function.
Sharpness of the sigmoid function is determined by dense_mode_sigma
(dense_mode_sigma=0
corresponds to a step function).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
i
|
int or iterable of int
|
Spline ID that you want to fit. |
None
|
max_interval
|
nm
|
Maximum interval of sampling points in nm unit. |
30.0
|
degree_precision
|
float
|
Precision of xy-tilt degree in angular correlation. |
0.5
|
binsize
|
int
|
Multiscale bin size used for fitting. |
1
|
edge_sigma
|
nm
|
Sharpness of mask at the edges. If not None, fitting will be executed after regions outside the cylinder are masked. Soft mask is important for precision because sharp changes in intensity cause strong correlation at the edges. |
2.0
|
max_shift
|
nm
|
Maximum shift from the true center of the cylinder. This parameter is used in phase cross correlation. |
5.0
|
n_rotations
|
int
|
Number of rotations to be tested during finding the cylinder center. |
5
|
Returns:
Type | Description |
---|---|
FitResult
|
Result of fitting. |
Source code in cylindra/components/tomogram/_cyl_tomo.py
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 |
|
get_cylinder_model(i, offsets=(0.0, 0.0), **kwargs)
Return the cylinder model at the given spline ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
i
|
int
|
Spline ID from which model will be created. |
required |
offsets
|
tuple of float
|
Offset of the model. See :meth: |
(0.0, 0.0)
|
Returns:
Type | Description |
---|---|
CylinderModel
|
The cylinder model. |
Source code in cylindra/components/tomogram/_cyl_tomo.py
1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 |
|
global_cft(i=None, binsize=1)
Calculate global cylindrical fast Fourier tranformation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
i
|
int or iterable of int
|
Spline ID that you want to analyze. |
None
|
binsize
|
int
|
Multiscale bin size used for calculation. |
1
|
Returns:
Type | Description |
---|---|
ImgArray
|
Complex image. |
Source code in cylindra/components/tomogram/_cyl_tomo.py
864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 |
|
global_cft_params(*, i=None, binsize=1, nsamples=8, update=True)
Calculate global lattice parameters.
This function transforms tomogram using cylindrical coordinate system along
spline. This function calls straighten
beforehand, so that Fourier space is
distorted if the cylindrical structure is curved.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
i
|
int or iterable of int
|
Spline ID that you want to analyze. |
None
|
binsize
|
int
|
Multiscale bin size used for calculation. |
1
|
nsamples
|
int
|
Number of cylindrical coordinate samplings for Fourier transformation.
Multiple samplings are needed because up-sampled discrete Fourier
transformation does not return exactly the same power spectra with shifted
inputs, unlike FFT. Larger |
8
|
update
|
bool
|
If True, spline properties will be updated. |
True
|
Returns:
Type | Description |
---|---|
DataFrame
|
Global properties. |
Source code in cylindra/components/tomogram/_cyl_tomo.py
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 |
|
global_cps(*, i=None, binsize=1)
Calculate global cylindrical power spectra.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
i
|
int or iterable of int
|
Spline ID that you want to analyze. |
None
|
binsize
|
int
|
Multiscale bin size used for calculation. |
1
|
Returns:
Type | Description |
---|---|
ImgArray
|
Complex image. |
Source code in cylindra/components/tomogram/_cyl_tomo.py
765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 |
|
infer_polarity(i=None, *, binsize=1, depth=40, mask_freq=True, update=True)
Infer spline polarities using polar 2D image.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
i
|
int or iterable of int
|
Spline ID that you want to analyze. |
None
|
binsize
|
int
|
Multiscale bin size used for calculation. |
1
|
depth
|
nm
|
Depth of images used to infer polarities. |
40.0
|
Returns:
Type | Description |
---|---|
Ori
|
Orientation of corresponding splines. |
Source code in cylindra/components/tomogram/_cyl_tomo.py
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 |
|
local_cft(*, i=None, depth=50.0, pos=None, binsize=1)
Calculate non-upsampled local cylindric Fourier transormation along spline.
This function does not up-sample.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
i
|
int or iterable of int
|
Spline ID that you want to analyze. |
None
|
depth
|
nm
|
Length of subtomogram for calculation of local parameters. |
50.0
|
pos
|
int
|
Only calculate at |
None
|
binsize
|
int
|
Multiscale bin size used for calculation. |
1
|
Returns:
Type | Description |
---|---|
ImgArray
|
FT images stacked along "p" axis. |
Source code in cylindra/components/tomogram/_cyl_tomo.py
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 |
|
local_cft_params(*, i=None, depth=50.0, binsize=1, radius='global', nsamples=8, update=True, update_glob=False)
Calculate local lattice parameters from cylindrical Fourier space.
To determine the peaks upsampled discrete Fourier transformation is used for every subtomogram.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
i
|
int or iterable of int
|
Spline ID that you want to analyze. |
None
|
depth
|
nm
|
Length of subtomogram for calculation of local parameters. |
50.0
|
binsize
|
int
|
Multiscale bin size used for calculation. |
1
|
radius
|
str
|
If "local", use the local radius for the analysis. If "global", use the global radius. If a float, use the given radius. |
"global"
|
nsamples
|
int
|
Number of cylindrical coordinate samplings for Fourier transformation. Multiple
samplings are needed because up-sampled discrete Fourier transformation does not
return exactly the same power spectra with shifted inputs, unlike FFT. Larger
|
8
|
update
|
bool
|
If True, spline properties will be updated. |
True
|
update_glob
|
bool
|
If True, global properties will be updated using the mean or mode of the local properties. |
False
|
Returns:
Type | Description |
---|---|
DataFrame
|
Local properties. |
Source code in cylindra/components/tomogram/_cyl_tomo.py
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 640 |
|
local_cps(*, i=None, depth=50.0, pos=None, binsize=1)
Calculate non-upsampled local cylindric power spectra along spline.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
i
|
int or iterable of int
|
Spline ID that you want to analyze. |
None
|
depth
|
nm
|
Length of subtomogram for calculation of local parameters. |
50.0
|
pos
|
int
|
Only calculate at |
None
|
binsize
|
int
|
Multiscale bin size used for calculation. |
1
|
Returns:
Type | Description |
---|---|
ImgArray
|
FT images stacked along "p" axis. |
Source code in cylindra/components/tomogram/_cyl_tomo.py
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 |
|
local_radii(*, i=None, depth=50.0, binsize=1, min_radius=1.0, max_radius=100.0, update=True, update_glob=True)
Measure the local radii along the splines.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
i
|
int or iterable of int
|
Spline ID that you want to analyze. |
None
|
depth
|
nm
|
Longitudinal length of subtomograms for calculation. |
50.0
|
binsize
|
int
|
Multiscale binsize to be used. |
1
|
min_radius
|
nm
|
Minimum radius of the cylinder. |
1.0
|
max_radius
|
nm
|
Maximum radius of the cylinder. |
100.0
|
update
|
bool
|
If True, spline properties will be updated. |
True
|
update_glob
|
bool
|
If True, global properties will be updated using the mean of the local radii. |
True
|
Returns:
Type | Description |
---|---|
Series
|
Radii along the spline. |
Source code in cylindra/components/tomogram/_cyl_tomo.py
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 |
|
make_anchors(i=None, *, interval=None, n=None, max_interval=None)
Make anchors on spline object(s).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
interval
|
nm
|
Anchor intervals. |
None
|
n
|
int
|
Number of anchors |
None
|
max_interval
|
nm
|
Maximum interval between anchors. |
None
|
Source code in cylindra/components/tomogram/_cyl_tomo.py
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
|
map_centers(i=None, *, interval=1.0, orientation=None, rotate_molecules=True)
Mapping molecules along the center of a cylinder.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
i
|
int or iterable of int
|
Spline ID that mapping will be calculated. |
None
|
interval
|
float(nm)
|
Interval of molecules. |
1.0
|
rotate_molecules
|
bool
|
If True, twist the molecule orientations according to the spline twist. |
True
|
Returns:
Type | Description |
---|---|
Molecules
|
Molecules object with mapped coordinates and angles. |
Source code in cylindra/components/tomogram/_cyl_tomo.py
1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 |
|
map_monomers(i=None, *, offsets=None, orientation=None, extensions=(0, 0), **kwargs)
Map monomers in a regular cylinder shape.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
i
|
int or iterable of int
|
Spline ID that mapping will be calculated. |
None
|
offsets
|
tuple of float
|
The offset of origin of oblique coordinate system to map monomers. |
None
|
orientation
|
Ori or str
|
Orientation of the y-axis of each molecule. |
None
|
Returns:
Type | Description |
---|---|
Molecules
|
Object that represents monomer positions and angles. |
Source code in cylindra/components/tomogram/_cyl_tomo.py
1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 |
|
map_on_grid(i=None, coords=(), *, offsets=None, orientation=None, **kwargs)
Map monomers in a regular cylinder shape.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
i
|
int or iterable of int
|
Spline ID that mapping will be calculated. |
None
|
coords
|
ndarray
|
Integer coordinates on the cylinder surface. |
()
|
offsets
|
tuple of float
|
The offset of origin of oblique coordinate system to map monomers. |
None
|
orientation
|
Ori or str
|
Orientation of the y-axis of each molecule. |
None
|
Returns:
Type | Description |
---|---|
Molecules
|
Object that represents monomer positions and angles. |
Source code in cylindra/components/tomogram/_cyl_tomo.py
1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 |
|
map_pf_line(i=None, *, interval=1.0, offsets=(0.0, 0.0), orientation=None)
Mapping molecules along a protofilament line.
This method is useful when you want to visualize seam or protofilament, or assign molecules for subtomogram averaging of seam binding protein or doublet microtubule.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
i
|
int or iterable of int
|
Spline ID that mapping will be calculated. |
None
|
offsets
|
(float, float)
|
Axial offset in nm and angular offset in degree. |
(0.0, 0.0)
|
Returns:
Type | Description |
---|---|
Molecules
|
Object that represents protofilament positions and angles. |
Source code in cylindra/components/tomogram/_cyl_tomo.py
1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 |
|
measure_radius(i=None, *, binsize=1, positions='auto', min_radius=1.0, max_radius=100.0, update=True)
Measure radius using radial profile from the center.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
i
|
int or iterable of int
|
Spline ID that you want to measure. |
None
|
binsize
|
int
|
Multiscale bin size used for radius calculation. |
1
|
positions
|
array - like or 'auto' or 'anchor'
|
Sampling positions (between 0 and 1) to calculate radius. If "anchor" is given, anchors of the spline will be used. If "auto" is given, three positions along the spline will be used. |
"auto"
|
min_radius
|
nm
|
Minimum radius of the cylinder. |
1.0
|
max_radius
|
nm
|
Maximum radius of the cylinder. |
100.0
|
update
|
bool
|
If True, global radius property will be updated. |
True
|
Returns:
Type | Description |
---|---|
float(nm)
|
Cylinder radius. |
Source code in cylindra/components/tomogram/_cyl_tomo.py
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 |
|
refine(i=None, *, max_interval=30.0, binsize=1, err_max=1.0, corr_allowed=0.9, max_shift=2.0, n_rotations=3)
Spline refinement using global lattice structural parameters.
Refine spline using the result of previous fit and the global structural parameters. During refinement, Y-projection of XZ cross section of cylinder is rotated with the twist angles, thus is much more precise than the coarse fitting.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
i
|
int or iterable of int
|
Spline ID that you want to fit. |
None
|
max_interval
|
nm
|
Maximum interval of sampling points in nm unit. |
24.0
|
binsize
|
int
|
Multiscale bin size used for refining. |
1
|
corr_allowed
|
(float, defaul is 0.9)
|
How many images will be used to make template for alignment. If 0.9, then top 90% will be used. |
0.9
|
max_shift
|
nm
|
Maximum shift from the true center of the cylinder. This parameter is used in phase cross correlation. |
2.0
|
n_rotations
|
int
|
Number of rotations to be tested during finding the cylinder center. |
3
|
Returns:
Type | Description |
---|---|
FitResult
|
Result of fitting. |
Source code in cylindra/components/tomogram/_cyl_tomo.py
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 |
|
straighten(i=None, *, size=None, range_=(0.0, 1.0), chunk_length=None, binsize=1)
Straightening by building curved coordinate system around splines. Currently Cartesian coordinate system and cylindrical coordinate system are supported.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
i
|
int or iterable of int
|
Spline ID that you want to straighten. |
None
|
size
|
float(nm)
|
Vertical/horizontal box size. |
None
|
range_
|
tuple[float, float]
|
Range of spline domain. |
(0.0, 1.0)
|
chunk_length
|
nm
|
If spline is longer than this, it will be first split into chunks, straightened respectively and all the straightened images are concatenated afterward, to avoid loading entire image into memory. |
None
|
binsize
|
int
|
Multiscale bin size used for calculation. |
1
|
Returns:
Type | Description |
---|---|
ImgArray
|
Straightened image. If Cartesian coordinate system is used, it will have "zyx". |
Source code in cylindra/components/tomogram/_cyl_tomo.py
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 |
|
straighten_cylindric(i=None, *, radii=None, range_=(0.0, 1.0), chunk_length=None, binsize=1)
Straightening by building curved coordinate system around splines. Currently Cartesian coordinate system and cylindrical coordinate system are supported.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
i
|
int or iterable of int
|
Spline ID that you want to straighten. |
None
|
radii
|
tuple of float (nm)
|
Lower/upper limit of radius. |
None
|
range_
|
tuple[float, float]
|
Range of spline domain. |
(0.0, 1.0)
|
chunk_length
|
nm
|
If spline is longer than this, it will be first split into chunks, straightened respectively and all the straightened images are concatenated afterward, to avoid loading entire image into memory. |
None
|
binsize
|
int
|
Multiscale bin size used for calculation. |
1
|
Returns:
Type | Description |
---|---|
ImgArray
|
Straightened image. If Cartesian coordinate system is used, it will have "zyx". |
Source code in cylindra/components/tomogram/_cyl_tomo.py
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 |
|
Tomogram
Lazy-loading/multi-scale tomogram object.
It is always connected to a 3D image but processed lazily. Thus you can create a lot of Tomogram objects without MemoryError. Subtomograms are temporarily loaded into memory via cache map. Once memory usage exceed certain amount, the subtomogram cache will automatically deleted from the old ones.
Source code in cylindra/components/tomogram/_tomo_base.py
21 22 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 |
|
image: ip.ImgArray | ip.LazyImgArray
property
Tomogram image data.
is_dummy: bool
property
True if this tomogram object does not have a real image.
is_inverted: bool
property
True if this image is inverted
metadata: dict[str, Any]
property
writable
Metadata relevant to the tomogram.
multiscaled: list[tuple[int, ip.ImgArray]]
property
Get all multi-scale factor and the corresponding multiscaled images.
scale: nm
property
Scale of the tomogram.
source: Path
property
Path to the source file.
tilt: dict[str, Any]
property
Tilt model as a dictionary.
tilt_model
property
Tilt model of the tomogram.
__hash__()
Use unsafe hash.
Source code in cylindra/components/tomogram/_tomo_base.py
38 39 40 |
|
add_multiscale(binsize, compute=True)
Add new multiscaled image of given binsize.
Source code in cylindra/components/tomogram/_tomo_base.py
310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 |
|
dummy(*, scale=1.0, tilt=None, binsize=(), source=None, shape=(24, 24, 24), name=None)
classmethod
Create a dummy tomogram.
Source code in cylindra/components/tomogram/_tomo_base.py
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 |
|
from_image(img, *, scale=None, tilt=None, binsize=(), compute=True)
classmethod
Construct a Tomogram object from a image array.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
img
|
array - like
|
Input image. |
required |
scale
|
float
|
Pixel size in nm. If not given, will try to read from image header. |
None
|
tilt
|
tuple of float
|
Tilt model. |
None
|
binsize
|
int or iterable of int
|
Binsize to generate multiscale images. If not given, will not generate. |
()
|
compute
|
bool
|
Whether to compute the binned images. |
True
|
Returns:
Type | Description |
---|---|
Tomogram
|
Tomogram object with the image that has just been read and multi-scales. |
Source code in cylindra/components/tomogram/_tomo_base.py
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 |
|
get_multiscale(binsize, add=False)
Get multiscaled image of given binsize.
Source code in cylindra/components/tomogram/_tomo_base.py
333 334 335 336 337 338 339 340 |
|
get_subtomogram_loader(mole, output_shape=None, binsize=1, order=1)
Create a subtomogram loader from molecules.
Source code in cylindra/components/tomogram/_tomo_base.py
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 |
|
imread(path, *, scale=None, tilt=None, binsize=(), eager=False, compute=True)
classmethod
Read a image as a dask array.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
path - like
|
Path to the image file. |
required |
scale
|
float
|
Pixel size in nm. If not given, will try to read from image header. |
None
|
tilt
|
tuple of float
|
Tilt model. |
None
|
binsize
|
int or iterable of int
|
Binsize to generate multiscale images. If not given, will not generate. |
()
|
eager
|
bool
|
Whether to read the image lazily. If True, the entire image will be read into the memory. |
False
|
Returns:
Type | Description |
---|---|
Tomogram
|
Tomogram object with the image that has just been read and multi-scales. |
Source code in cylindra/components/tomogram/_tomo_base.py
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 |
|
invert(cache=False)
Invert tomogram intensities in-place.
Source code in cylindra/components/tomogram/_tomo_base.py
359 360 361 362 363 364 365 366 367 368 |
|
multiscale_translation(binsize)
Get lateral translation of binned image in nm.
Source code in cylindra/components/tomogram/_tomo_base.py
355 356 357 |
|
nm2pixel(value, binsize=1)
nm2pixel(value: nm, binsize: int = 1) -> int
nm2pixel(value: Iterable[nm] | NDArray[np.number], binsize: int = 1) -> NDArray[np.intp]
Convert nm float value into pixel value. Useful for conversion from coordinate to pixel position.
Returns:
Type | Description |
---|---|
ndarray or int
|
Pixel position. |
Source code in cylindra/components/tomogram/_tomo_base.py
295 296 297 298 299 300 301 302 303 304 305 306 307 308 |
|
BaseComponent
Base class for all tomographic components.
Source code in cylindra/components/_base.py
12 13 14 15 16 17 18 19 20 21 22 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 |
|
from_dict(js)
Construct a component from a dictionary.
Source code in cylindra/components/_base.py
15 16 17 18 |
|
from_json(file_path)
classmethod
Construct a spline model from a json file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_path
|
str
|
Path to json file. |
required |
Returns:
Type | Description |
---|---|
BaseComponent
|
Object constructed from the json file. |
Source code in cylindra/components/_base.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
|
to_dict()
abstractmethod
Convert a component to a dictionary.
Source code in cylindra/components/_base.py
20 21 22 23 |
|
to_json(file_path, *, cls=None)
Save the model in a json format.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_path
|
str
|
Path to the file. |
required |
cls
|
JSONEncoder
|
Custom JSON encoder, by default None |
None
|
Source code in cylindra/components/_base.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
|
AnnealingResult
dataclass
Dataclass for storing the annealing results.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
energies
|
ndarray
|
History of energies of the annealing process. |
required |
batch_size
|
int
|
Batch size used in the annealing process. |
required |
time_const
|
float
|
Time constant used for cooling. |
required |
indices
|
ndarray
|
The optimized indices of the molecules. |
required |
niter
|
int
|
Number of iterations. |
required |
state
|
str
|
Optimization state. |
required |
Source code in cylindra/components/landscape.py
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 |
|
Landscape
dataclass
Energy landscape array.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
energies
|
NDArray[float32]
|
4D array of energy values. |
required |
molecules
|
Molecules
|
Molecules object. |
required |
argmax
|
NDArray[int32]
|
Argmax indices to track which rotation resulted in the best alignment. |
required |
quaternions
|
NDArray[float32]
|
Quaternions used for template rotation. |
required |
scale_factor
|
float
|
Scale factor to convert from pixels to nanometers (upsampling considered).
|
required |
Source code in cylindra/components/landscape.py
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 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 629 630 631 632 633 634 635 636 |
|
offset: NDArray[np.int32]
property
Shift from the corner (0, 0, 0) to the center.
offset_nm: NDArray[np.float32]
property
Offset in nm.
__getitem__(key)
Subset of the landscape.
Source code in cylindra/components/landscape.py
72 73 74 75 76 77 78 79 80 81 |
|
annealing_model(spl, distance_range_long, distance_range_lat, angle_max=None, temperature_time_const=1.0, temperature=None, cooling_rate=None, reject_limit=None)
Get an annealing model using the landscape.
Source code in cylindra/components/landscape.py
358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 |
|
create_surface(level=None, resolution=None, show_min=True)
Create a isosurface data from the landscape
Source code in cylindra/components/landscape.py
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 |
|
from_dir(path)
classmethod
Load a landscape from a directory.
Source code in cylindra/components/landscape.py
539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 |
|
from_loader(loader, template, mask=None, max_shifts=(0.8, 0.8, 0.8), upsample_factor=5, alignment_model=alignment.ZNCCAlignment)
classmethod
Construct a landscape from a loader object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
loader
|
LoaderBase
|
Any loader object from |
required |
template
|
template input type
|
Template image or a list of template images to be used. |
required |
mask
|
mask input type
|
Mask image to be used, by default None |
None
|
max_shifts
|
(float, float, float)
|
Maximum shifts in nm, in (Z, Y, X) order. |
(0.8, 0.8, 0.8)
|
upsample_factor
|
int
|
Upsampling factor for landscape construction. |
5
|
alignment_model
|
alignment model object
|
Alignment model to be used to evaluate correlation score. |
ZNCCAlignment
|
Source code in cylindra/components/landscape.py
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 |
|
normed(sd=True)
Return a landscape with normalized mean energy.
Source code in cylindra/components/landscape.py
453 454 455 456 457 458 459 460 461 462 463 464 465 |
|
run_annealing(spl, distance_range_long, distance_range_lat, angle_max=None, temperature_time_const=1.0, temperature=None, cooling_rate=None, reject_limit=None, random_seeds=[0])
Run simulated mesh annealing.
Source code in cylindra/components/landscape.py
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 |
|
run_min_energy(spl=None)
Minimize energy for each local landscape independently.
Source code in cylindra/components/landscape.py
224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 |
|
run_viterbi(dist_range, angle_max=None)
Run Viterbi alignment.
Source code in cylindra/components/landscape.py
247 248 249 250 251 252 253 254 255 |
|
run_viterbi_fixed_start(first, range_long=(4.0, 4.28), angle_max=5.0)
Run Viterbi alignment with a fixed start edge.
Source code in cylindra/components/landscape.py
287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 |
|
save(path)
Save the landscape to a directory.
Source code in cylindra/components/landscape.py
556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 |
|
transform_molecules(molecules, indices, detect_peak=False)
Transform the input molecules based on the landscape.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
molecules
|
Molecules
|
Molecules object to be transformed. |
required |
indices
|
integer array
|
Indices in the landscape to be used for transformation. |
required |
detect_peak
|
bool
|
If True, landscape will be sub-sampled to detect the peak in higher precision. This should be false for constrained alignment, as the detected peak usually does not represent the optimal result. |
False
|
Returns:
Type | Description |
---|---|
Molecules
|
Transformed molecules. |
Source code in cylindra/components/landscape.py
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 |
|
SurfaceData
Tuple for storing isosurface data for landscapes.
Source code in cylindra/components/landscape.py
715 716 717 718 719 720 |
|
ViterbiResult
dataclass
Dataclass for storing the Viterbi alignment results.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
indices
|
ndarray
|
The optimized indices of the molecules. |
required |
score
|
float
|
The score of the optimal alignment. |
required |
Source code in cylindra/components/landscape.py
800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 |
|
delayed_isosurface(arr, level, spacing, step_size=1)
Create an isosurface from a 3D array using marching cubes algorithm.
Source code in cylindra/components/landscape.py
723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 |
|
CorrelationSeamSearcher
Seam searcher based on correlation with the template.
Source code in cylindra/components/seam_search.py
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 |
|
SeamSearcher
Source code in cylindra/components/seam_search.py
16 17 18 19 20 21 22 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 |
|
search(*args, **kwargs)
abstractmethod
Search for the seam position.
Source code in cylindra/components/seam_search.py
24 25 26 |
|