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


C++ Pointer::GetMatrix方法代码示例

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


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

示例1: 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();
}
开发者ID:beneon,项目名称:MITK,代码行数:59,代码来源:mitkSurfaceInterpolationController.cpp

示例2: 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();
}
开发者ID:Cdebus,项目名称:MITK,代码行数:49,代码来源:mitkSurfaceBasedInterpolationController.cpp


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