npxpy.nodes.aligners.CoarseAligner
Bases: Node
Class for coarse alignment nodes.
Attributes:
Name | Type | Description |
---|---|---|
residual_threshold |
Union[float, int]
|
The residual threshold for alignment. |
alignment_anchors |
List[Dict]
|
List of alignment anchors with label and position. |
Source code in npxpy/nodes/aligners.py
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 |
|
alignment_anchors
property
Get the list of alignment anchors.
residual_threshold
property
writable
Get the residual threshold.
__init__(name='Coarse aligner', residual_threshold=10.0)
Initialize the coarse aligner with a name and a residual threshold.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
The name of the coarse aligner node. |
'Coarse aligner'
|
residual_threshold
|
Union[float, int]
|
The residual threshold for alignment. Must be greater than 0. |
10.0
|
Raises:
Type | Description |
---|---|
ValueError
|
If residual_threshold is not greater than 0. |
Source code in npxpy/nodes/aligners.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
|
add_coarse_anchor(position, label)
Add a single coarse anchor with a label and position.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
label
|
str
|
The label for the anchor. |
required |
position
|
List[Union[float, int]]
|
The position [x, y, z] for the anchor. |
required |
Raises:
Type | Description |
---|---|
ValueError
|
If position does not contain exactly three elements. |
TypeError
|
If any element in position is not a number. |
Source code in npxpy/nodes/aligners.py
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 |
|
set_coarse_anchors_at(positions, labels=None)
Create multiple coarse anchors at specified positions.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
labels
|
List[str]
|
List of labels for the anchors. |
None
|
positions
|
List[List[Union[float, int]]]
|
List of positions for the anchors, each position is [x, y, z]. |
required |
Returns:
Name | Type | Description |
---|---|---|
self |
The instance of the CoarseAligner class. |
Raises:
Type | Description |
---|---|
ValueError
|
If the number of labels does not match the number of positions. |
TypeError
|
If any label is not a string or any position is not a list of numbers. |
Source code in npxpy/nodes/aligners.py
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 |
|
to_dict()
Convert the CoarseAligner object into a dictionary.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
Dict[str, Any]: Dictionary representation of the object. |
Source code in npxpy/nodes/aligners.py
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 |
|