code
stringlengths
3
6.57k
item.boundingRect()
rect.center()
np.einsum('ij,ij->i', np.expand_dims(self.plane.normal, axis=0)
np.where(np.abs(d)
zip(index, rotated_points)
QtCore.QPointF(p[0], p[1])
self.view.scene_transform.map(point)
GraphicsPointItem(point, size=self.scene.point_size)
item.setToolTip(f'Point {i + 1}')
item.makeControllable(self.scene.mode == GraphicsScene.Mode.Select)
item.setPen(self.point_pen)
self.scene.addItem(item)
rect.united(item.boundingRect()
translated(point)
rect.united(rect.translated(anchor - rect.center()
self.view.setSceneRect(rect)
self.view.fitInView(rect, QtCore.Qt.KeepAspectRatio)
__lookAt(forward)
Matrix33.identity()
Vector3([0., -1., 0.])
Vector3([0., 0., 1.])
left.normalize()
addPoints(self)
len(self.scene.items()
self.view.scene_transform.inverted()
self.scene.items()
isinstance(item, GraphicsPointItem)
transform.map(item.pos()
points_2d.append([pos.x()
pos.y()
self.scene.removeItem(item)
self.matrix.transpose()
self.parent.presenter.addPoints(list(zip(points, enabled)
AlignSample(QtWidgets.QWidget)
__init__(self, parent)
super()
__init__(parent)
self.parent.scenes.switchToInstrumentScene()
self.setMinimumWidth(450)
QtWidgets.QVBoxLayout()
self.setLayout(self.main_layout)
self.main_layout.addSpacing(20)
self.main_layout.addWidget(FormTitle('Create Transformation for Alignment')
self.main_layout.addSpacing(10)
self.main_layout.addWidget(QtWidgets.QLabel('Translation along the X, Y, and Z axis (mm)
FormGroup(FormGroup.Layout.Horizontal)
FormControl('X', 0.0, required=True, number=True)
FormControl('Y', 0.0, required=True, number=True)
FormControl('Z', 0.0, required=True, number=True)
self.position_form_group.addControl(self.x_position)
self.position_form_group.addControl(self.y_position)
self.position_form_group.addControl(self.z_position)
self.position_form_group.groupValidation.connect(self.formValidation)
self.main_layout.addWidget(self.position_form_group)
self.main_layout.addWidget(QtWidgets.QLabel('Rotation around the X, Y, and Z axis (degrees)
FormGroup(FormGroup.Layout.Horizontal)
FormControl('X', 0.0, required=True, number=True)
self.x_rotation.range(-360.0, 360.0)
FormControl('Y', 0.0, required=True, number=True)
self.y_rotation.range(-360.0, 360.0)
FormControl('Z', 0.0, required=True, number=True)
self.z_rotation.range(-360.0, 360.0)
self.orientation_form_group.addControl(self.x_rotation)
self.orientation_form_group.addControl(self.y_rotation)
self.orientation_form_group.addControl(self.z_rotation)
self.orientation_form_group.groupValidation.connect(self.formValidation)
self.main_layout.addWidget(self.orientation_form_group)
QtWidgets.QHBoxLayout()
QtWidgets.QPushButton('Align Sample')
self.execute_button.clicked.connect(self.executeButtonClicked)
button_layout.addWidget(self.execute_button)
button_layout.addStretch(1)
self.main_layout.addLayout(button_layout)
self.main_layout.addStretch(1)
formValidation(self)
self.execute_button.setEnabled(True)
self.execute_button.setDisabled(True)
executeButtonClicked(self)
self.parent.presenter.alignSampleWithPose(pose)
get_logger(__name__)
Quart(__name__)
set_quart_logger_formatter()
response(func: Callable)
wraps(func)
inner(*args, **kwargs)
func(*args, **kwargs)
asdict(state)
datetime.now()
error(code: int, status: str)
wrapper(func: Callable)
wraps(func)
inner(*args, **kwargs)
func(*args, **kwargs)
datetime.now()
app.route("/healthz", methods=["GET"])
healthz()
app.route("/status", methods=["GET"])
status()
app.route("/start", methods=["POST"])
start()