Hi, that solved it, the VTK Mesh is displayed properly. Thanks a lot!
Best Regards, Simon --- Simon Eck Biomedical Computer Vision Group Im Neuenheimer Feld 267 69120 Heidelberg [email protected] On 04/28/2010 10:57 AM, Neuhaus Jochen wrote: > Hi, > > It is probably a geometry initialization problem. > > If you do not have any other objects in the datastorage, the initial view > geometries are quite small. Your 200mm radius sphere is probably just too big > to get displayed. > Try: > mitk::RenderingManager::GetInstance()->InitializeViews(myDataStorage->ComputeBoundingGeometry3D(myDataStorage->GetAll())); > > to update the view geometries to include everything in the datastorage. > > Regards, > Jochen > >> -----Ursprüngliche Nachricht----- >> Von: Simon Eck [mailto:[email protected]] >> Gesendet: Mittwoch, 28. April 2010 10:38 >> An: Neuhaus Jochen >> Cc: [email protected] >> Betreff: Re: [mitk-users] Add VTK Mesh Objects to DataStorage >> >> Thank you Jochen, >> >> Update() does not do the trick, there is still nothing displayed in the >> multiwidget.. >> >> It seems to be a vtk issue rather than a problem with the Surface. I >> copied the implementation of the iso surface functionality (which also >> uses a Surface, but aquired from a filter via GetOutput() ) for testing >> and it works without any problems. >> >> Anyone have other suggestions? >> >> >> Thanks in advance, >> Simon >> >> >> >> On 04/27/2010 05:46 PM, Neuhaus Jochen wrote: >>> Hi Simon, >>> >>> Try >>> sphere->Update(); >>> before >>> sphere->Getoutput(); >>> >>> Regards, >>> Jochen >>> >>>> -----Ursprüngliche Nachricht----- >>>> Von: Simon Eck [mailto:[email protected]] >>>> Gesendet: Dienstag, 27. April 2010 16:53 >>>> An: [email protected] >>>> Betreff: Re: [mitk-users] Add VTK Mesh Objects to DataStorage >>>> >>>> Hi Alex, >>>> >>>> thank you for the fast answer! Using a surface seems to work fine in >>>> general. When calling my method a new surface is created in the data >>>> manager. However i there is nothing displayed inside the >> multiwidget. I >>>> experimented with some parameters of the vtkSphereSource object, but >> no >>>> success. >>>> >>>> >>>> This is how it looks right now: >>>> >>>> void Experimental::createVtkObjects() { >>>> mitk::DataTreeNode::Pointer node = getSelectedNode(); >>>> if( node.IsNull() ) { >>>> return; >>>> } >>>> >>>> vtkSphereSource* sphere = vtkSphereSource::New(); >>>> sphere->SetCenter(0.0, 0.0, 0.0); >>>> sphere->SetRadius(200); >>>> sphere->SetThetaResolution(18); >>>> sphere->SetPhiResolution(18); >>>> vtkPolyData* sphereData = sphere->GetOutput(); >>>> >>>> mitk::Surface::Pointer sphereSurface = mitk::Surface::New(); >>>> sphereSurface->SetVtkPolyData(sphereData); >>>> >>>> mitk::DataTreeNode::Pointer sphereNode = >>>> mitk::DataTreeNode::New(); >>>> sphereNode->SetData(sphereSurface); >>>> int layer = 0; >>>> node->GetIntProperty("layer", layer); >>>> sphereNode->SetIntProperty("layer", layer+1); >>>> sphereNode->SetProperty("Surface", >>>> mitk::BoolProperty::New(true)); >>>> sphereNode->SetName("my VTK Mesh"); >>>> sphereNode->SetVisibility(true); >>>> >>>> DataStorage->Add(sphereNode, node); >>>> >>>> mitk::RenderingManager::GetInstance()->RequestUpdateAll(); >>>> } >>>> >>>> >>>> Maybe i am missing something...any ideas are appreciated. >>>> >>>> >>>> Regards, >>>> Simon >>>> >> >> ----------------------------------------------------------------------- >> ------- >> _______________________________________________ >> mitk-users mailing list >> [email protected] >> https://lists.sourceforge.net/lists/listinfo/mitk-users > ------------------------------------------------------------------------------ _______________________________________________ mitk-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mitk-users
