本文整理汇总了C++中MultidimArray::interpolatedElementBSpline3D方法的典型用法代码示例。如果您正苦于以下问题:C++ MultidimArray::interpolatedElementBSpline3D方法的具体用法?C++ MultidimArray::interpolatedElementBSpline3D怎么用?C++ MultidimArray::interpolatedElementBSpline3D使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MultidimArray
的用法示例。
在下文中一共展示了MultidimArray::interpolatedElementBSpline3D方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: edgeWidth
void ProgResolutionIBW::edgeWidth(const MultidimArray<double> &volCoeffs,
const MultidimArray<double> &edges,
MultidimArray <double>& widths, const Matrix1D<double> &dir,
double step) const
{
double forward_count, backward_count, slope;
Matrix1D<double> pos_aux_fw(3), pos_aux_bw(3), pos(3), pos_aux(3), next_pos(3), Kdir;
Kdir=step*dir;
//Visit all elements in volume
FOR_ALL_ELEMENTS_IN_ARRAY3D(edges)
{
//Check for border pixels
if (A3D_ELEM(edges,k,i,j)!=0)
{
//reset all counters
forward_count=0;
backward_count=0;
VECTOR_R3(pos_aux_fw,j,i,k);
pos_aux_bw=pos=pos_aux_fw;
//find out if pixel magnitude grows or decreases
pos_aux=pos;
pos_aux+=dir;
double value_plus_dir=volCoeffs.interpolatedElementBSpline3D(XX(pos_aux),YY(pos_aux),ZZ(pos_aux));
pos_aux=pos;
pos_aux-=dir;
double value_minus_dir=volCoeffs.interpolatedElementBSpline3D(XX(pos_aux),YY(pos_aux),ZZ(pos_aux));
slope=value_plus_dir-value_minus_dir;
double sign;
if (slope>0)
sign=1;
else
sign=-1;
//current_pixel is multiplied by the sign, so only one condition is enough to detect an
//extremum no matter if the pixel values increase or decrease
double current_pixel=sign*volCoeffs.interpolatedElementBSpline3D
(XX(pos_aux_fw),YY(pos_aux_fw),ZZ(pos_aux_fw));
double next_pixel;
bool not_found;
//Search for local extremum ahead of the edge in the given direction
do
{
not_found=true;
next_pos=pos_aux_fw+Kdir;
next_pixel=sign*volCoeffs.interpolatedElementBSpline3D
(XX(next_pos),YY(next_pos),ZZ(next_pos));
if(next_pixel>current_pixel)
{
current_pixel=next_pixel;
pos_aux_fw=next_pos;
forward_count++;
}
else
{
not_found=false;
}
}
while(not_found);
current_pixel=sign*volCoeffs.interpolatedElementBSpline3D
(XX(pos_aux_bw),YY(pos_aux_bw),ZZ(pos_aux_bw));
//Search for local extremum behind of the edge in the given direction
do
{
not_found=true;
next_pos=pos_aux_bw-Kdir;
next_pixel=sign*volCoeffs.interpolatedElementBSpline3D
(XX(next_pos),YY(next_pos),ZZ(next_pos));
if(next_pixel<current_pixel)
{
current_pixel=next_pixel;
pos_aux_bw=next_pos;
backward_count++;
}
else
{
not_found=false;
}
}
while(not_found);
//If the width found for this position is smaller than the one stores in edges volume
//before it is overwritten
if ((forward_count+backward_count)<A3D_ELEM(widths,k,i,j))
{
A3D_ELEM(widths,k,i,j)=forward_count+backward_count;
}
}
}
//.........这里部分代码省略.........