Hi Sandra, i just fixed the visibility issue (rev 26506), it should show up in the public repository soon.
Concerning scalar values, it used to work in the past but could be broken now... I did not try it recently. Your code looks fine, however. I opened bug http://bugs.mitk.org/show_bug.cgi?id=5597 for issues with unstructured grid rendering. Could you comment on your problems there, and maybe attach a sample dataset with which you are having problems? I could than have a look at it. Best, Sascha On 09/28/2010 11:32 AM, Scherer, Sandra wrote: > Hello MITK community, > > I want to show a vtkUnstructuredGrid with scalars in the MITK application and > have problems with showing the color coded scalars and to make the data node > again visible after make it unvisible using the check box of the data manager > to show and hide nodes. > > Here is the code: > > void QmitkStentBundleView::makeFEresult(QString filename, QString nodename) > { > > /******************************************************** > * create a mitk::DataNode > * the data is a unstructured Grid of the class FEresult > * the FEresult is called with "filename" > * the name of the node is "nodename" > * at the end a global reinit ist called to show the new node > *********************************************************/ > > //FEresult builds a vtkUnstructuredGrid with scalar values out of an external > data file > > FEresult* result = new FEresult(file); //NR Übergabe ifstream > > result->uGrid->SetPoints(result->nodeCoordinates); > result->uGrid->GetPointData()->SetScalars(result->scalars); > result->buildScalars(); > result->nodeCoordinates->Delete(); > > mitk::UnstructuredGrid::Pointer grid = mitk::UnstructuredGrid::New(); > grid->SetVtkUnstructuredGrid(result->uGrid); > > //Generate data node > mitk::DataNode::Pointer node = mitk::DataNode::New(); > > node->SetName(nodename.toStdString().c_str()); > node->SetOpacity(1.0f); > > //Node properties > mitk::LookupTable::Pointer lookupTable = mitk::LookupTable::New(); > lookupTable->SetVtkLookupTable(result->lut); > > node->SetBoolProperty("scalar visibility", true); > //scalarBar??? > node->SetBoolProperty("color mode", true); > node->SetFloatProperty("ScalarsRangeMaximum", > (float)*result->uGrid->GetScalarRange()); > node->SetProperty("outline polygons", mitk::BoolProperty::New(false)); > node->SetBoolProperty("show points", true); > node->SetBoolProperty("show contour", false); > > node->Update(); > > //Attach grid + mapper to data node > node->SetData(grid); > > //data storage > mitk::DataStorage::Pointer m_DataStorage = this->GetDataStorage(); > m_DataStorage->Add(node); > > //global reinit: > mitk::RenderingManager::GetInstance()->InitializeViews( > m_DataStorage->ComputeBoundingGeometry3D(m_DataStorage->GetAll())); > > return; > } > > Thanks in advance. > > Best regards, > Sandra > > > > > ------------------------------------------------------------------------------ > Start uncovering the many advantages of virtual appliances > and start using them to simplify application deployment and > accelerate your shift to cloud computing. > http://p.sf.net/sfu/novell-sfdev2dev > _______________________________________________ > mitk-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/mitk-users > ------------------------------------------------------------------------------ Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev _______________________________________________ mitk-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mitk-users
