• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ datanode::Pointer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1:

mitk::TestDICOMLoading::ImageList mitk::TestDICOMLoading::LoadFiles( const StringContainer& files )
{
  for (StringContainer::const_iterator iter = files.begin();
       iter != files.end();
       ++iter)
  {
    MITK_DEBUG << "File " << *iter;
  }

  ImageList result;

  DicomSeriesReader::FileNamesGrouping seriesInFiles = DicomSeriesReader::GetSeries( files, true );

  // TODO sort series UIDs, implementation of map iterator might differ on different platforms (or verify this is a standard topic??)
  for (DicomSeriesReader::FileNamesGrouping::const_iterator seriesIter = seriesInFiles.begin();
       seriesIter != seriesInFiles.end();
       ++seriesIter)
  {
    StringContainer files = seriesIter->second.GetFilenames();

    DataNode::Pointer node = DicomSeriesReader::LoadDicomSeries( files );

    if (node.IsNotNull())
    {
      Image::Pointer image = dynamic_cast<mitk::Image*>( node->GetData() );

      result.push_back( image );
    }
    else
    {
    }
  }

  return result;
}
开发者ID:beneon,项目名称:MITK,代码行数:35,代码来源:mitkTestDICOMLoading.cpp


示例2: GetPointerParameter

  DataNode *SegmentationSink::GetGroupNode()
  {
    DataNode::Pointer groupNode;
    GetPointerParameter("Group node", groupNode);

    return groupNode.GetPointer();
  }
开发者ID:junaidnaseer,项目名称:MITK,代码行数:7,代码来源:mitkSegmentationSink.cpp


示例3: GetTargetSegmentationNode

void mitk::BinaryThresholdULTool::CreateNewSegmentationFromThreshold(DataNode* node)
{
  if (node)
  {
    Image::Pointer feedBackImage = dynamic_cast<Image*>( m_ThresholdFeedbackNode->GetData() );
    if (feedBackImage.IsNotNull())
    {
      // create a new image of the same dimensions and smallest possible pixel type
      DataNode::Pointer emptySegmentation = GetTargetSegmentationNode();

      if (emptySegmentation)
      {
        // actually perform a thresholding and ask for an organ type
        for (unsigned int timeStep = 0; timeStep < feedBackImage->GetTimeSteps(); ++timeStep)
        {
          try
          {
            ImageTimeSelector::Pointer timeSelector = ImageTimeSelector::New();
            timeSelector->SetInput( feedBackImage );
            timeSelector->SetTimeNr( timeStep );
            timeSelector->UpdateLargestPossibleRegion();
            Image::Pointer feedBackImage3D = timeSelector->GetOutput();

            if (feedBackImage3D->GetDimension() == 2)
            {
              AccessFixedDimensionByItk_2( feedBackImage3D, ITKSetVolume, 2, dynamic_cast<Image*>(emptySegmentation->GetData()), timeStep );
            }
            else
            {
              AccessFixedDimensionByItk_2( feedBackImage3D, ITKSetVolume, 3, dynamic_cast<Image*>(emptySegmentation->GetData()), timeStep );
            }

          }
          catch(...)
          {
            Tool::ErrorMessage("Error accessing single time steps of the original image. Cannot create segmentation.");
          }
        }

        //since we are maybe working on a smaller image, pad it to the size of the original image
        if (m_OriginalImageNode.GetPointer() != m_NodeForThresholding.GetPointer())
        {
          mitk::PadImageFilter::Pointer padFilter = mitk::PadImageFilter::New();

          padFilter->SetInput(0, dynamic_cast<mitk::Image*> (emptySegmentation->GetData()));
          padFilter->SetInput(1, dynamic_cast<mitk::Image*> (m_OriginalImageNode->GetData()));
          padFilter->SetBinaryFilter(true);
          padFilter->SetUpperThreshold(1);
          padFilter->SetLowerThreshold(1);
          padFilter->Update();

          emptySegmentation->SetData(padFilter->GetOutput());
        }

        m_ToolManager->SetWorkingData( emptySegmentation );
        m_ToolManager->GetWorkingData(0)->Modified();
      }
    }
  }
}
开发者ID:151706061,项目名称:MITK,代码行数:60,代码来源:mitkBinaryThresholdULTool.cpp


示例4: DecorateNodeWithProperties

void mitk::SceneReaderV1::GetLayerOrder(TiXmlDocument& document, const std::string& workingDirectory, std::vector<mitk::DataNode::Pointer> DataNodes, OrderedLayers& order)
{
  typedef std::vector<mitk::DataNode::Pointer> DataNodeVector;
  DataNodeVector::iterator nit = DataNodes.begin();
  for( TiXmlElement* element = document.FirstChildElement("node"); element != NULL || nit != DataNodes.end(); element = element->NextSiblingElement("node"), ++nit )
  {
    DataNode::Pointer node = *nit;
    DecorateNodeWithProperties(node, element, workingDirectory);

    int layer;
    node->GetIntProperty("layer", layer);
    std::string uid = element->Attribute("UID");
    this->m_UnorderedLayers.insert( std::make_pair( layer, uid ) );
  }

  int lastLayer = itk::NumericTraits<int>::min();
  UnorderedLayers::iterator it;
  for (it = m_UnorderedLayers.begin(); it != m_UnorderedLayers.end(); it++)
  {
    int currentLayer = (*it).first;
    if (currentLayer == lastLayer)
    {
      ++currentLayer;
    }
    order.insert( std::make_pair( (*it).second, currentLayer ) );
    lastLayer = currentLayer;
  }
}
开发者ID:DiagnosisMultisystems,项目名称:MITK,代码行数:28,代码来源:mitkSceneReaderV1.cpp


示例5: if

/*!
\brief PrepareMapperQueue iterates the datatree

PrepareMapperQueue iterates the datatree in order to find mappers which shall be rendered. Also, it sortes the mappers
wrt to their layer.
*/
void mitk::VtkPropRenderer::PrepareMapperQueue()
{
  // variable for counting LOD-enabled mappers
  m_NumberOfVisibleLODEnabledMappers = 0;

  // Do we have to update the mappers ?
  if (m_LastUpdateTime < GetMTime() || m_LastUpdateTime < this->GetCurrentWorldPlaneGeometry()->GetMTime())
  {
    Update();
  }
  else if (m_MapperID >= 1 && m_MapperID < 6)
    Update();

  // remove all text properties before mappers will add new ones
  m_TextRenderer->RemoveAllViewProps();

  for (unsigned int i = 0; i < m_TextCollection.size(); i++)
  {
    m_TextCollection[i]->Delete();
  }
  m_TextCollection.clear();

  // clear priority_queue
  m_MappersMap.clear();

  int mapperNo = 0;

  // DataStorage
  if (m_DataStorage.IsNull())
    return;

  DataStorage::SetOfObjects::ConstPointer allObjects = m_DataStorage->GetAll();

  for (DataStorage::SetOfObjects::ConstIterator it = allObjects->Begin(); it != allObjects->End(); ++it)
  {
    const DataNode::Pointer node = it->Value();
    if (node.IsNull())
      continue;
    const mitk::Mapper::Pointer mapper = node->GetMapper(m_MapperID);

    if (mapper.IsNull())
      continue;

    bool visible = true;
    node->GetVisibility(visible, this, "visible");

    // The information about LOD-enabled mappers is required by RenderingManager
    if (mapper->IsLODEnabled(this) && visible)
    {
      ++m_NumberOfVisibleLODEnabledMappers;
    }
    // mapper without a layer property get layer number 1
    int layer = 1;
    node->GetIntProperty("layer", layer, this);
    int nr = (layer << 16) + mapperNo;
    m_MappersMap.insert(std::pair<int, Mapper *>(nr, mapper));
    mapperNo++;
  }
}
开发者ID:Cdebus,项目名称:MITK,代码行数:65,代码来源:mitkVtkPropRenderer.cpp


示例6:

mitk::IFileWriter::ConfidenceLevel mitk::LegacyFileWriterService::GetConfidenceLevel() const
{
  if (mitk::AbstractFileWriter::GetConfidenceLevel() == Unsupported)
    return Unsupported;
  DataNode::Pointer node = DataNode::New();
  node->SetData(const_cast<BaseData *>(this->GetInput()));
  return m_LegacyWriter->CanWriteDataType(node) ? Supported : Unsupported;
}
开发者ID:Cdebus,项目名称:MITK,代码行数:8,代码来源:mitkLegacyFileWriterService.cpp


示例7: catch

void mitk::BinaryThresholdULTool::CreateNewSegmentationFromThreshold(DataNode* node, const std::string& organName, const Color& color)
{
  if (node)
  {
    Image::Pointer image = dynamic_cast<Image*>( m_NodeForThresholding->GetData() );
    if (image.IsNotNull())
    {
      // create a new image of the same dimensions and smallest possible pixel type
      DataNode::Pointer emptySegmentation = Tool::CreateEmptySegmentationNode( image, organName, color );

      if (emptySegmentation)
      {
        // actually perform a thresholding and ask for an organ type
        for (unsigned int timeStep = 0; timeStep < image->GetTimeSteps(); ++timeStep)
        {
          try
          {
            ImageTimeSelector::Pointer timeSelector = ImageTimeSelector::New();
            timeSelector->SetInput( image );
            timeSelector->SetTimeNr( timeStep );
            timeSelector->UpdateLargestPossibleRegion();
            Image::Pointer image3D = timeSelector->GetOutput();

            AccessFixedDimensionByItk_2( image3D, ITKThresholding, 3, dynamic_cast<Image*>(emptySegmentation->GetData()), timeStep );
          }
          catch(...)
          {
            Tool::ErrorMessage("Error accessing single time steps of the original image. Cannot create segmentation.");
          }
        }

        //since we are maybe working on a smaller image, pad it to the size of the original image
        if (m_OriginalImageNode.GetPointer() != m_NodeForThresholding.GetPointer())
        {
          mitk::PadImageFilter::Pointer padFilter = mitk::PadImageFilter::New();

          padFilter->SetInput(0, dynamic_cast<mitk::Image*> (emptySegmentation->GetData()));
          padFilter->SetInput(1, dynamic_cast<mitk::Image*> (m_OriginalImageNode->GetData()));
          padFilter->SetBinaryFilter(true);
          padFilter->SetUpperThreshold(1);
          padFilter->SetLowerThreshold(1);
          padFilter->Update();

          emptySegmentation->SetData(padFilter->GetOutput());
        }

        if (DataStorage* ds = m_ToolManager->GetDataStorage())
        {
          ds->Add( emptySegmentation, m_OriginalImageNode );
        }

        m_ToolManager->SetWorkingData( emptySegmentation );
      }
    }
  }
}
开发者ID:beneon,项目名称:MITK,代码行数:56,代码来源:mitkBinaryThresholdULTool.cpp


示例8: ReadyToRun

  bool SegmentationSink::ReadyToRun()
  {
    Image::Pointer image;
    GetPointerParameter("Input", image);

    DataNode::Pointer groupNode;
    GetPointerParameter("Group node", groupNode);

    return image.IsNotNull() && groupNode.IsNotNull();
  }
开发者ID:junaidnaseer,项目名称:MITK,代码行数:10,代码来源:mitkSegmentationSink.cpp


示例9:

void mitk::ClippingPlaneInteractor3D::DeselectObject(StateMachineAction*, InteractionEvent* interactionEvent)
{
    DataNode::Pointer node = this->GetDataNode();

    if (node.IsNull())
        return;

    node->SetColor( 1.0, 1.0, 1.0 );

    // Colorize surface / wireframe as inactive
    this->ColorizeSurface(interactionEvent->GetSender(), -1.0);

    interactionEvent->GetSender()->GetRenderingManager()->RequestUpdateAll();
}
开发者ID:araex,项目名称:MITK,代码行数:14,代码来源:mitkClippingPlaneInteractor3D.cpp


示例10: ConvertPeaksFromMrtrix

void QmitkOdfMaximaExtractionView::ConvertPeaksFromMrtrix()
{
    if (m_ImageNodes.empty())
        return;

    typedef itk::Image< float, 4 > ItkImageType;
    typedef itk::MrtrixPeakImageConverter< float > FilterType;
    FilterType::Pointer filter = FilterType::New();

    // cast to itk
    mitk::Image::Pointer mitkImg = dynamic_cast<mitk::Image*>(m_ImageNodes.at(0)->GetData());
    mitk::Geometry3D::Pointer geom = mitkImg->GetGeometry();
    typedef mitk::ImageToItk< FilterType::InputImageType > CasterType;
    CasterType::Pointer caster = CasterType::New();
    caster->SetInput(mitkImg);
    caster->Update();
    FilterType::InputImageType::Pointer itkImg = caster->GetOutput();

    filter->SetInputImage(itkImg);
    filter->GenerateData();

    mitk::Vector3D outImageSpacing = geom->GetSpacing();
    float maxSpacing = 1;
    if(outImageSpacing[0]>outImageSpacing[1] && outImageSpacing[0]>outImageSpacing[2])
        maxSpacing = outImageSpacing[0];
    else if (outImageSpacing[1] > outImageSpacing[2])
        maxSpacing = outImageSpacing[1];
    else
        maxSpacing = outImageSpacing[2];

    mitk::FiberBundleX::Pointer directions = filter->GetOutputFiberBundle();
    directions->SetGeometry(geom);
    DataNode::Pointer node = DataNode::New();
    node->SetData(directions);
    QString name(m_ImageNodes.at(0)->GetName().c_str());
    name += "_VectorField";
    node->SetName(name.toStdString().c_str());
    node->SetProperty("Fiber2DSliceThickness", mitk::FloatProperty::New(maxSpacing));
    node->SetProperty("Fiber2DfadeEFX", mitk::BoolProperty::New(false));
    GetDataStorage()->Add(node);

    typedef FilterType::DirectionImageContainerType DirectionImageContainerType;
    DirectionImageContainerType::Pointer container = filter->GetDirectionImageContainer();
    for (int i=0; i<container->Size(); i++)
    {
        ItkDirectionImage3DType::Pointer itkImg = container->GetElement(i);
        mitk::Image::Pointer img = mitk::Image::New();
        img->InitializeByItk( itkImg.GetPointer() );
        img->SetVolume( itkImg->GetBufferPointer() );
        DataNode::Pointer node = DataNode::New();
        node->SetData(img);
        QString name(m_ImageNodes.at(0)->GetName().c_str());
        name += "_Direction";
        name += QString::number(i+1);
        node->SetName(name.toStdString().c_str());
        GetDataStorage()->Add(node);
    }
}
开发者ID:,项目名称:,代码行数:58,代码来源:


示例11:

void mitk::AffineBaseDataInteractor3D::SelectObject(StateMachineAction*, InteractionEvent* interactionEvent)
{
  DataNode::Pointer node = this->GetDataNode();

  if (node.IsNull())
    return;

  mitk::ColorProperty::Pointer selectedColor = dynamic_cast<mitk::ColorProperty*>(node->GetProperty(selectedColorPropertyName));
  if ( selectedColor.IsNotNull() )
  {
    node->GetPropertyList()->SetProperty("color", selectedColor);
  }
  interactionEvent->GetSender()->GetRenderingManager()->RequestUpdateAll();

  return;
}
开发者ID:0r,项目名称:MITK,代码行数:16,代码来源:mitkAffineBaseDataInteractor3D.cpp


示例12: FindTopmostVisibleNode

mitk::StdFunctionCommand::ActionFunction mitk::DisplayActionEventFunctions::SetLevelWindowAction()
{
  auto actionFunction = [](const itk::EventObject& displayInteractorEvent)
  {
    if (DisplaySetLevelWindowEvent().CheckEvent(&displayInteractorEvent))
    {
      const DisplaySetLevelWindowEvent* displayActionEvent = dynamic_cast<const DisplaySetLevelWindowEvent*>(&displayInteractorEvent);
      const BaseRenderer::Pointer sendingRenderer = displayActionEvent->GetSender();
      if (nullptr == sendingRenderer)
      {
        return;
      }

      // get the the topmost visible image of the sending renderer
      DataStorage::Pointer storage = sendingRenderer->GetDataStorage();
      DataStorage::SetOfObjects::ConstPointer allImageNodes = storage->GetSubset(NodePredicateDataType::New("Image"));
      Point3D worldposition;
      const auto* positionEvent = dynamic_cast<const InteractionPositionEvent*>(displayActionEvent->GetInteractionEvent());
      sendingRenderer->DisplayToWorld(positionEvent->GetPointerPositionOnScreen(), worldposition);
      auto globalCurrentTimePoint = sendingRenderer->GetTime();
      DataNode::Pointer node = FindTopmostVisibleNode(allImageNodes, worldposition, globalCurrentTimePoint, sendingRenderer);
      if (node.IsNull())
      {
        return;
      }

      LevelWindow levelWindow = LevelWindow();
      node->GetLevelWindow(levelWindow);
      ScalarType level = levelWindow.GetLevel();
      ScalarType window = levelWindow.GetWindow();

      level += displayActionEvent->GetLevel();
      window += displayActionEvent->GetWindow();

      levelWindow.SetLevelWindow(level, window);
      auto* levelWindowProperty = dynamic_cast<LevelWindowProperty*>(node->GetProperty("levelwindow"));
      if (nullptr != levelWindowProperty)
      {
        levelWindowProperty->SetLevelWindow(levelWindow);
        sendingRenderer->GetRenderingManager()->RequestUpdateAll();
      }
    }
  };

  return actionFunction;
}
开发者ID:Cdebus,项目名称:MITK,代码行数:46,代码来源:mitkDisplayActionEventFunctions.cpp


示例13: GetDataNode

void mitk::FiberBundleMapper2D::Update(mitk::BaseRenderer * renderer)
{
  bool visible = true;
  GetDataNode()->GetVisibility(visible, renderer, "visible");
  if ( !visible )
    return;

  // Calculate time step of the input data for the specified renderer (integer value)
  // this method is implemented in mitkMapper
  this->CalculateTimeStep( renderer );

  //check if updates occured in the node or on the display
  FBXLocalStorage *localStorage = m_LocalStorageHandler.GetLocalStorage(renderer);

  //set renderer independent shader properties
  const DataNode::Pointer node = this->GetDataNode();
  float thickness = 2.0;
  if(!this->GetDataNode()->GetPropertyValue("Fiber2DSliceThickness",thickness))
    MITK_INFO << "FIBER2D SLICE THICKNESS PROPERTY ERROR";

  bool fiberfading = false;
  if(!this->GetDataNode()->GetPropertyValue("Fiber2DfadeEFX",fiberfading))
    MITK_INFO << "FIBER2D SLICE FADE EFX PROPERTY ERROR";

  mitk::FiberBundle* fiberBundle = this->GetInput();
  if (fiberBundle==nullptr)
    return;

  int lineWidth = 0;
  node->GetIntProperty("LineWidth", lineWidth);
  if (m_LineWidth!=lineWidth)
  {
    m_LineWidth = lineWidth;
    fiberBundle->RequestUpdate2D();
  }

  if ( localStorage->m_LastUpdateTime<renderer->GetCurrentWorldPlaneGeometryUpdateTime() || localStorage->m_LastUpdateTime<fiberBundle->GetUpdateTime2D() )
  {
    this->UpdateShaderParameter(renderer);
    this->GenerateDataForRenderer( renderer );
  }
}
开发者ID:liu3xing3long,项目名称:MITK,代码行数:42,代码来源:mitkFiberBundleMapper2D.cpp


示例14: catch

mitk::DataNode::Pointer mitk::SceneReaderV1::LoadBaseDataFromDataTag( TiXmlElement* dataElement, const std::string& workingDirectory, bool& error )
{
  DataNode::Pointer node;

  if (dataElement)
  {
    const char* filename = dataElement->Attribute("file");
    if ( filename )
    {
      try
      {
        std::vector<BaseData::Pointer> baseData = IOUtil::Load( workingDirectory + Poco::Path::separator() + filename );
        if (baseData.size() > 1)
        {
          MITK_WARN << "Discarding multiple base data results from " << filename << " except the first one.";
        }
        node = DataNode::New();
        node->SetData(baseData.front());
      }
      catch (std::exception& e)
      {
        MITK_ERROR << "Error during attempt to read '" << filename << "'. Exception says: " << e.what();
        error = true;
      }

      if (node.IsNull())
      {
        MITK_ERROR << "Error during attempt to read '" << filename << "'. Factory returned NULL object.";
        error = true;
      }
    }
  }

  // in case there was no <data> element we create a new empty node (for appending a propertylist later)
  if (node.IsNull())
  {
    node = DataNode::New();
  }

  return node;
}
开发者ID:AndreasFetzer,项目名称:MITK,代码行数:41,代码来源:mitkSceneReaderV1.cpp


示例15: TemplatedConvertShCoeffsFromFsl

void QmitkOdfMaximaExtractionView::TemplatedConvertShCoeffsFromFsl(mitk::Image* mitkImg)
{
    typedef itk::FslShCoefficientImageConverter< float, shOrder > FilterType;
    typedef mitk::ImageToItk< itk::Image< float, 4 > > CasterType;
    CasterType::Pointer caster = CasterType::New();
    caster->SetInput(mitkImg);
    caster->Update();

    typename FilterType::Pointer filter = FilterType::New();
    filter->SetInputImage(caster->GetOutput());
    filter->GenerateData();
    typename FilterType::QballImageType::Pointer itkQbi = filter->GetQballImage();
    typename FilterType::CoefficientImageType::Pointer itkCi = filter->GetCoefficientImage();

    {
        mitk::Image::Pointer img = mitk::Image::New();
        img->InitializeByItk( itkCi.GetPointer() );
        img->SetVolume( itkCi->GetBufferPointer() );
        DataNode::Pointer node = DataNode::New();
        node->SetData(img);
        node->SetName("FSL_ShCoefficientImage");
        GetDataStorage()->Add(node);
    }

    {
        mitk::QBallImage::Pointer img = mitk::QBallImage::New();
        img->InitializeByItk( itkQbi.GetPointer() );
        img->SetVolume( itkQbi->GetBufferPointer() );
        DataNode::Pointer node = DataNode::New();
        node->SetData(img);
        node->SetName("FSL_QballImage");
        GetDataStorage()->Add(node);
    }
}
开发者ID:,项目名称:,代码行数:34,代码来源:


示例16: filename

mitk::DataNode::Pointer mitk::SceneReaderV1::LoadBaseDataFromDataTag( TiXmlElement* dataElement, const std::string& workingDirectory, bool& error )
{
  DataNode::Pointer node;

  if (dataElement) 
  {
    const char* filename( dataElement->Attribute("file") );
    if ( filename )
    {
      DataNodeFactory::Pointer factory = DataNodeFactory::New();
      factory->SetFileName( workingDirectory + Poco::Path::separator() + filename );
      
      try
      {
        factory->Update();
        node = factory->GetOutput();
      }
      catch (std::exception& e)
      {
        MITK_ERROR << "Error during attempt to read '" << filename << "'. Exception says: " << e.what();
        error = true;
      }

      if (node.IsNull())
      {
        MITK_ERROR << "Error during attempt to read '" << filename << "'. Factory returned NULL object.";
        error = true;
      }
    }
  }

  // in case there was no <data> element we create a new empty node (for appending a propertylist later)
  if (node.IsNull())
  {
    node = DataNode::New();
  }

  return node;
}
开发者ID:david-guerrero,项目名称:MITK,代码行数:39,代码来源:mitkSceneReaderV1.cpp


示例17:

/*
 * Checks if DataNodes associated with DataInteractors point back to them.
 * If not remove the DataInteractors. (This can happen when s.o. tries to set DataNodes to multiple DataInteractors)
 */
void mitk::Dispatcher::RemoveOrphanedInteractors()
{
  for (ListInteractorType::iterator it = m_Interactors.begin(); it != m_Interactors.end();)
  {
    DataNode::Pointer dn = (*it)->GetDataNode();
    if (dn.IsNull())
    {
      it = m_Interactors.erase(it);
    }
    else
    {
      DataInteractor::Pointer interactor = dn->GetDataInteractor();
      if (interactor != it->GetPointer())
      {
        it = m_Interactors.erase(it);
      }
      else
      {
        ++it;
      }
    }
  }
}
开发者ID:fmorency,项目名称:MITK,代码行数:27,代码来源:mitkDispatcher.cpp


示例18:

void mitk::VtkPropRenderer::ReleaseGraphicsResources(vtkWindow* /*renWin*/)
{
  if( m_DataStorage.IsNull() )
    return;

  DataStorage::SetOfObjects::ConstPointer allObjects = m_DataStorage->GetAll();
  for (DataStorage::SetOfObjects::const_iterator iter = allObjects->begin(); iter != allObjects->end(); ++iter)
  {
    DataNode::Pointer node = *iter;
    if ( node.IsNull() )
      continue;

      Mapper * mapper = node->GetMapper(m_MapperID);

      if (mapper)
      {
        VtkMapper* vtkmapper = dynamic_cast<VtkMapper*>( mapper );

       if(vtkmapper)
         vtkmapper->ReleaseGraphicsResources(this);
      }
   }
}
开发者ID:GHfangxin,项目名称:MITK,代码行数:23,代码来源:mitkVtkPropRenderer.cpp


示例19:

void mitk::FiberBundleXMapper2D::UpdateShaderParameter(mitk::BaseRenderer * renderer)
{
    //get information about current position of views
    mitk::SliceNavigationController::Pointer sliceContr = renderer->GetSliceNavigationController();
    mitk::PlaneGeometry::ConstPointer planeGeo = sliceContr->GetCurrentPlaneGeometry();

    //generate according cutting planes based on the view position
    float sliceN[3], planeOrigin[3];


    // since shader uses camera coordinates, transform origin and normal from worldcoordinates to cameracoordinates

    planeOrigin[0] = (float) planeGeo->GetOrigin()[0];
    planeOrigin[1] = (float) planeGeo->GetOrigin()[1];
    planeOrigin[2] = (float) planeGeo->GetOrigin()[2];

    sliceN[0] = planeGeo->GetNormal()[0];
    sliceN[1] = planeGeo->GetNormal()[1];
    sliceN[2] = planeGeo->GetNormal()[2];


    float tmp1 = planeOrigin[0] * sliceN[0];
    float tmp2 = planeOrigin[1] * sliceN[1];
    float tmp3 = planeOrigin[2] * sliceN[2];
    float d1 = tmp1 + tmp2 + tmp3; //attention, correct normalvector


    float plane1[4];
    plane1[0] = sliceN[0];
    plane1[1] = sliceN[1];
    plane1[2] = sliceN[2];
    plane1[3] = d1;

    float thickness = 2.0;
    if(!this->GetDataNode()->GetPropertyValue("Fiber2DSliceThickness",thickness))
        MITK_INFO << "FIBER2D SLICE THICKNESS PROPERTY ERROR";


    bool fiberfading = false;
    if(!this->GetDataNode()->GetPropertyValue("Fiber2DfadeEFX",fiberfading))
        MITK_INFO << "FIBER2D SLICE FADE EFX PROPERTY ERROR";

    // set Opacity
    float fiberOpacity;
    this->GetDataNode()->GetOpacity(fiberOpacity, NULL);

    DataNode::Pointer node = this->GetDataNode();
    node->SetFloatProperty("shader.mitkShaderFiberClipping.slicingPlane.w",plane1[3],renderer);
    node->SetFloatProperty("shader.mitkShaderFiberClipping.slicingPlane.x",plane1[0],renderer);
    node->SetFloatProperty("shader.mitkShaderFiberClipping.slicingPlane.y",plane1[1],renderer);
    node->SetFloatProperty("shader.mitkShaderFiberClipping.slicingPlane.z",plane1[2],renderer);
    node->SetFloatProperty("shader.mitkShaderFiberClipping.fiberThickness",thickness,renderer);
    node->SetIntProperty("shader.mitkShaderFiberClipping.fiberFadingON",fiberfading,renderer);
    node->SetFloatProperty("shader.mitkShaderFiberClipping.fiberOpacity",fiberOpacity,renderer);


}
开发者ID:SaschaD-DKFZ,项目名称:MITK,代码行数:57,代码来源:mitkFiberBundleXMapper2D.cpp


示例20: StartProcessingAllData

void mitk::SegmentationsProcessingTool::ProcessAllObjects()
{
  m_FailedNodes.clear();
  StartProcessingAllData();

  ToolManager::DataVectorType nodes = m_ToolManager->GetWorkingData();
  ProgressBar::GetInstance()->AddStepsToDo(nodes.size() + 2);

  // for all selected nodes
  for ( ToolManager::DataVectorType::iterator nodeiter = nodes.begin();
        nodeiter != nodes.end();
        ++nodeiter )
  {
    DataNode::Pointer node = *nodeiter;

    if ( !ProcessOneWorkingData(node) )
    {
      std::string nodeName;
      m_FailedNodes += " '";
      if ( node->GetName( nodeName ) )
      {
        m_FailedNodes += nodeName.c_str();
      }
      else
      {
        m_FailedNodes += "(no name)";
      }
      m_FailedNodes += "'";
    }

    ProgressBar::GetInstance()->Progress();
  }

  FinishProcessingAllData();
  ProgressBar::GetInstance()->Progress(2);

}
开发者ID:151706061,项目名称:MITK,代码行数:37,代码来源:mitkSegmentationsProcessingTool.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ dataobjects::EventList类代码示例发布时间:2022-05-31
下一篇:
C++ datalog::context类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap