当前位置: 首页>>代码示例>>C++>>正文


C++ ToolPtr::get_prMt方法代码示例

本文整理汇总了C++中ToolPtr::get_prMt方法的典型用法代码示例。如果您正苦于以下问题:C++ ToolPtr::get_prMt方法的具体用法?C++ ToolPtr::get_prMt怎么用?C++ ToolPtr::get_prMt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ToolPtr的用法示例。


在下文中一共展示了ToolPtr::get_prMt方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: tool_t

/**Move the tool pos / axis pos to a new position given
 * by the input click position in vp space.
 */
void ViewWrapper2D::setAxisPos(Vector3D click_vp)
{
	ToolPtr tool = mServices->getToolManager()->getManualTool();

	Transform3D sMr = mSliceProxy->get_sMr();
	Transform3D rMpr = mServices->getPatientService()->get_rMpr();
	Transform3D prMt = tool->get_prMt();

	// find tool position in s
	Vector3D tool_t(0, 0, tool->getTooltipOffset());
	Vector3D tool_s = (sMr * rMpr * prMt).coord(tool_t);

	// find click position in s.
	Transform3D vpMs = mView->get_vpMs();
	Vector3D click_s = vpMs.inv().coord(click_vp);

	// compute the new tool position in slice space as a synthesis of the plane part of click and the z part of original.
	Vector3D cross_s(click_s[0], click_s[1], tool_s[2]);
	// compute the position change and transform to patient.
	Vector3D delta_s = cross_s - tool_s;
	Vector3D delta_pr = (rMpr.inv() * sMr.inv()).vector(delta_s);

	// MD is the actual tool movement in patient space, matrix form
	Transform3D MD = createTransformTranslate(delta_pr);
	// set new tool position to old modified by MD:
	tool->set_prMt(MD * prMt);
}
开发者ID:normit-nav,项目名称:CustusX,代码行数:30,代码来源:cxViewWrapper2D.cpp

示例2: setManualToolPosition

void LandmarkRegistrationWidget::setManualToolPosition(Vector3D p_r)
{
	Transform3D rMpr = mServices->patient()->get_rMpr();
	Vector3D p_pr = rMpr.inv().coord(p_r);

	// set the picked point as offset tip
	ToolPtr tool = mServices->tracking()->getManualTool();
	Vector3D offset = tool->get_prMt().vector(Vector3D(0, 0, tool->getTooltipOffset()));
	p_pr -= offset;
	p_r = rMpr.coord(p_pr);

	// TODO set center here will not do: must handle
	mServices->patient()->setCenter(p_r);
	Vector3D p0_pr = tool->get_prMt().coord(Vector3D(0, 0, 0));
	tool->set_prMt(createTransformTranslate(p_pr - p0_pr) * tool->get_prMt());
}
开发者ID:c0ns0le,项目名称:CustusX,代码行数:16,代码来源:cxLandmarkRegistrationWidget.cpp

示例3: findVirtualTooltip_s

Vector3D ViewFollower::findVirtualTooltip_s()
{
	ToolPtr tool = mSliceProxy->getTool();
	Transform3D sMr = mSliceProxy->get_sMr();
	Transform3D rMpr = mDataManager->get_rMpr();
	Transform3D prMt = tool->get_prMt();
	Vector3D pt_s = sMr * rMpr * prMt.coord(Vector3D(0,0,tool->getTooltipOffset()));
	pt_s[2] = 0; // project into plane
	return pt_s;
}
开发者ID:SINTEFMedtek,项目名称:CustusX,代码行数:10,代码来源:cxViewFollower.cpp

示例4: createTransformTranslate

/**Move the tool pos / axis pos to a new position given
 * by delta movement in vp space.
 */
void ViewWrapper2D::shiftAxisPos(Vector3D delta_vp)
{
	delta_vp = -delta_vp;
	ToolPtr tool = mServices->getToolManager()->getManualTool();

	Transform3D sMr = mSliceProxy->get_sMr();
	Transform3D rMpr = mServices->getPatientService()->get_rMpr();
	Transform3D prMt = tool->get_prMt();
	Transform3D vpMs = mView->get_vpMs();
	Vector3D delta_s = vpMs.inv().vector(delta_vp);

	Vector3D delta_pr = (rMpr.inv() * sMr.inv()).vector(delta_s);

	// MD is the actual tool movement in patient space, matrix form
	Transform3D MD = createTransformTranslate(delta_pr);
	// set new tool position to old modified by MD:
	tool->set_prMt(MD * prMt);
}
开发者ID:normit-nav,项目名称:CustusX,代码行数:21,代码来源:cxViewWrapper2D.cpp

示例5: toolSampleButtonClickedSlot

void PatientLandMarksWidget::toolSampleButtonClickedSlot()
{
	ToolPtr tool = mServices->tracking()->getActiveTool();

	if (!tool)
	{
		reportError("mToolToSample is NULL!");
		return;
	}
	//TODO What if the reference frame isnt visible?
	Transform3D lastTransform_prMt = tool->get_prMt();
	Vector3D p_pr = lastTransform_prMt.coord(Vector3D(0, 0, tool->getTooltipOffset()));

	// TODO: do we want to allow sampling points not defined in image??
	if (mActiveLandmark.isEmpty() && !mServices->patient()->getLandmarkProperties().empty())
		mActiveLandmark = mServices->patient()->getLandmarkProperties().begin()->first;

	mServices->patient()->getPatientLandmarks()->setLandmark(Landmark(mActiveLandmark, p_pr));
	reporter()->playSampleSound();

	this->activateLandmark(this->getNextLandmark());

	this->performRegistration(); // automatic when sampling in physical patient space (Mantis #0000674)s
}
开发者ID:c0ns0le,项目名称:CustusX,代码行数:24,代码来源:cxPatientLandMarksWidget.cpp


注:本文中的ToolPtr::get_prMt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。