本文整理汇总了C++中eigen::MatrixXd::log方法的典型用法代码示例。如果您正苦于以下问题:C++ MatrixXd::log方法的具体用法?C++ MatrixXd::log怎么用?C++ MatrixXd::log使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eigen::MatrixXd
的用法示例。
在下文中一共展示了MatrixXd::log方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: halfTransform
RcppExport SEXP halfTransform (SEXP _transform)
{
BEGIN_RCPP
RObject transform(_transform);
RObject result;
if (transform.inherits("affine"))
{
Eigen::MatrixXd matrix = as<Eigen::MatrixXd>(_transform);
matrix = (matrix.log() * 0.5).exp();
result = AffineMatrix(matrix);
}
else
{
NiftiImage transformationImage(_transform);
switch (reg_round(transformationImage->intent_p1))
{
case SPLINE_GRID:
reg_getDisplacementFromDeformation(transformationImage);
reg_tools_multiplyValueToImage(transformationImage,transformationImage,0.5f);
reg_getDeformationFromDisplacement(transformationImage);
break;
case DEF_FIELD:
reg_getDisplacementFromDeformation(transformationImage);
reg_tools_multiplyValueToImage(transformationImage,transformationImage,0.5f);
reg_getDeformationFromDisplacement(transformationImage);
break;
case DISP_FIELD:
reg_tools_multiplyValueToImage(transformationImage,transformationImage,0.5f);
break;
case SPLINE_VEL_GRID:
reg_getDisplacementFromDeformation(transformationImage);
reg_tools_multiplyValueToImage(transformationImage,transformationImage,0.5f);
reg_getDeformationFromDisplacement(transformationImage);
--transformationImage->intent_p2;
if (transformationImage->num_ext>1)
--transformationImage->num_ext;
break;
case DEF_VEL_FIELD:
reg_getDisplacementFromDeformation(transformationImage);
reg_tools_multiplyValueToImage(transformationImage,transformationImage,0.5f);
reg_getDeformationFromDisplacement(transformationImage);
--transformationImage->intent_p2;
break;
case DISP_VEL_FIELD:
reg_tools_multiplyValueToImage(transformationImage,transformationImage,0.5f);
--transformationImage->intent_p2;
break;
default:
throw std::runtime_error("The specified transformation image is not valid or not supported");
}
result = transformationImage.toPointer("F3D transformation");
}
result.attr("source") = transform.attr("source");
result.attr("target") = transform.attr("target");
return result;
END_RCPP
}