Hi, I solved the problems mentioned in my last post. The tubes are now colored and the color legend tick labels are displayed correctly. The reason was that the scalar values associated to my point data were too small. I guess, there is an internal double->float conversion problem. I had scalar double values in the range 0...0.08. If I multiply the values with a constant factor, i.e. 100, the coloring works. However, I use the scalars for modifying the tube radius as well. Now, the tubes are colored but way too big. Setting them to a constant radius works fine for me at the moment, but for the future, I will have to think of something else.
Cheers, Steffen Seitel Mathias schrieb: > Hello Steffen, > > What version of MITK are you using? There have been some significant > changes in the way rendering is handled in MITK recently. Particularly, > mitk::RenderWindow doesn't exist any more (instead vtkRenderWindow and > the Qt-VTK interface provided by Kitware are used directly now). > > I tried your code on my system and it seems to work fine; the tubes are > displayed both in the 2D and 3D windows. I'm attaching the code to make > sure that we're talking on the same basis... > > Before the changes in MITK, as a way to make sure that the 3D actors are > updated properly, the method RenderingManager::RequestUpdateAll() > provided a bool flag "includingVtkActors". Please try setting this flag > to "true" to see if it solves your problem. (Note that the flag still > exists in the SVN version of MITK, but is no longer evaluated > internally.) > > Alternatively, you may want to use the current SVN version of MITK > > (see http://www.mitk.org/download/download.html) > > > With regards, > Mathias > > > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Steffen > Oeltze > Sent: Thursday, February 21, 2008 6:13 PM > To: [email protected] > Subject: [mitk-users] vtkTubeFilter > > Hi, > > I'm new to MITK and I would like to use it to display tubes around a > polyline that I have generated using "vtkTubeFilter". The code works > fine when using VTK only but I would like to integrate it into some > application that uses MITK. > > I have successfully visualized data from other sources with MITK > already, however, there seems to be a problem with the output of > "vtkTubeFilter". Below you find my code, which works fine for other > data, but not in this particular case. In the 2D-views of the > QmitkStdMultiWidget, I can see the cross-sections of the tubes, but > nothing is visualized in the 3d-view. My original vtkPolyData which > serves as an input to vtkTubeFilter consists only of points and the > connecting polyline. > > Any help is deeply appreciated. > > Thanks in advance, > Steffen > > > > mitk::DataTree::Pointer tree=mitk::DataTree::New(); > mitk::DataTreePreOrderIterator it(tree); > mitk::DataStorage::CreateInstance(tree); > ... > > vtkPolyData *pointEvolution = vtkPolyData::New(); > ... > > pointEvolution->SetPoints(samplePts); > pointEvolution->SetLines(polyLine); > ... > > vtkTubeFilter *profileTubes = vtkTubeFilter::New(); > profileTubes->SetNumberOfSides(20); > profileTubes->SetInput(pointEvolution); > profileTubes->SetRadius(10); > profileTubes->Update(); > ... > mitk::Surface::Pointer tubes = mitk::Surface::New(); > tubes->SetVtkPolyData(profileTubes->GetOutput()); > > mitk::DataTreeNode::Pointer node = mitk::DataTreeNode::New(); > node->SetData(tubes); > node->SetProperty( "visible", new mitk::BoolProperty( true ) ); > > it.Add(node); > > QmitkStdMultiWidget* renderWindow = new QmitkStdMultiWidget(NULL, ""); > renderWindow->SetData(&it); > renderWindow->InitializeStandardViews(&it); > > qtapplication.setMainWidget(renderWindow); > renderWindow->show(); > renderWindow->Fit(); > mitk::RenderingManager::GetInstance()->RequestUpdateAll(); > qtapplication.exec(); > > > > ------------------------------------------------------------------------ > - > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > mitk-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/mitk-users > > ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ mitk-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mitk-users
