本文整理汇总了C++中affinetransform3d::Pointer::GetOffset方法的典型用法代码示例。如果您正苦于以下问题:C++ Pointer::GetOffset方法的具体用法?C++ Pointer::GetOffset怎么用?C++ Pointer::GetOffset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类affinetransform3d::Pointer
的用法示例。
在下文中一共展示了Pointer::GetOffset方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: pos
void mitk::SurfaceBasedInterpolationController::AddNewContour(mitk::ContourModel::Pointer newContour,
RestorePlanePositionOperation *op)
{
if (m_ActiveLabel == 0)
return;
AffineTransform3D::Pointer transform = AffineTransform3D::New();
transform = op->GetTransform();
mitk::Vector3D direction = op->GetDirectionVector();
int pos(-1);
for (unsigned int i = 0; i < m_MapOfContourLists[m_ActiveLabel].size(); i++)
{
itk::Matrix<ScalarType> diffM =
transform->GetMatrix() - m_MapOfContourLists[m_ActiveLabel].at(i).second->GetTransform()->GetMatrix();
bool isSameMatrix(true);
for (unsigned int j = 0; j < 3; j++)
{
if (fabs(diffM[j][0]) > 0.0001 && fabs(diffM[j][1]) > 0.0001 && fabs(diffM[j][2]) > 0.0001)
{
isSameMatrix = false;
break;
}
}
itk::Vector<float> diffV =
m_MapOfContourLists[m_ActiveLabel].at(i).second->GetTransform()->GetOffset() - transform->GetOffset();
if (isSameMatrix && m_MapOfContourLists[m_ActiveLabel].at(i).second->GetPos() == op->GetPos() &&
(fabs(diffV[0]) < 0.0001 && fabs(diffV[1]) < 0.0001 && fabs(diffV[2]) < 0.0001))
{
pos = i;
break;
}
}
if (pos == -1 && newContour->GetNumberOfVertices() > 0) // add a new contour
{
mitk::RestorePlanePositionOperation *newOp = new mitk::RestorePlanePositionOperation(
OpRESTOREPLANEPOSITION, op->GetWidth(), op->GetHeight(), op->GetSpacing(), op->GetPos(), direction, transform);
ContourPositionPair newData = std::make_pair(newContour, newOp);
m_MapOfContourLists[m_ActiveLabel].push_back(newData);
}
else if (pos != -1) // replace existing contour
{
m_MapOfContourLists[m_ActiveLabel].at(pos).first = newContour;
}
this->Modified();
}
示例2: pos
void mitk::SurfaceInterpolationController::AddNewContour (mitk::Surface::Pointer newContour ,RestorePlanePositionOperation* op)
{
AffineTransform3D::Pointer transform = AffineTransform3D::New();
transform = op->GetTransform();
mitk::Vector3D direction = op->GetDirectionVector();
int pos (-1);
for (unsigned int i = 0; i < m_MapOfContourLists[m_SelectedSegmentation].size(); i++)
{
itk::Matrix<float> diffM = transform->GetMatrix()-m_MapOfContourLists[m_SelectedSegmentation].at(i).position->GetTransform()->GetMatrix();
bool isSameMatrix(true);
for (unsigned int j = 0; j < 3; j++)
{
if (fabs(diffM[j][0]) > 0.0001 && fabs(diffM[j][1]) > 0.0001 && fabs(diffM[j][2]) > 0.0001)
{
isSameMatrix = false;
break;
}
}
itk::Vector<float> diffV = m_MapOfContourLists[m_SelectedSegmentation].at(i).position->GetTransform()->GetOffset()-transform->GetOffset();
if ( isSameMatrix && m_MapOfContourLists[m_SelectedSegmentation].at(i).position->GetPos() == op->GetPos() && (fabs(diffV[0]) < 0.0001 && fabs(diffV[1]) < 0.0001 && fabs(diffV[2]) < 0.0001) )
{
pos = i;
break;
}
}
if (pos == -1)
{
//MITK_INFO<<"New Contour";
mitk::RestorePlanePositionOperation* newOp = new mitk::RestorePlanePositionOperation (OpRESTOREPLANEPOSITION, op->GetWidth(),
op->GetHeight(), op->GetSpacing(), op->GetPos(), direction, transform);
ContourPositionPair newData;
newData.contour = newContour;
newData.position = newOp;
m_ReduceFilter->SetInput(m_MapOfContourLists[m_SelectedSegmentation].size(), newContour);
m_MapOfContourLists[m_SelectedSegmentation].push_back(newData);
}
else
{
//MITK_INFO<<"Modified Contour";
m_MapOfContourLists[m_SelectedSegmentation].at(pos).contour = newContour;
m_ReduceFilter->SetInput(pos, newContour);
}
m_ReduceFilter->Update();
m_CurrentNumberOfReducedContours = m_ReduceFilter->GetNumberOfOutputs();
for (unsigned int i = 0; i < m_CurrentNumberOfReducedContours; i++)
{
m_NormalsFilter->SetInput(i, m_ReduceFilter->GetOutput(i));
m_InterpolateSurfaceFilter->SetInput(i, m_NormalsFilter->GetOutput(i));
}
this->Modified();
}