Hey Sandra,
I added a bug to double-check that issue. The bug ID is 8277! 

Best regards

Sven

-----Ursprüngliche Nachricht-----
Von: Scherer, Sandra [mailto:[email protected]] 
Gesendet: Montag, 30. Mai 2011 16:13
An: Mersmann, Sven
Betreff: vtkLookUpTable - without scalar Range

Hello Sven,

many thanks for your answer. I set the scalar visibility and color mode to true 
and did calling the mitk::RenderingManager::GetInstance()->RequestUpdateAll().

Unfortunately it doesn´t work.

See below the hole method:

void QmitksimstentView::updateFEresult(bool state, QString resultValues) {
        mitk::DataStorage::Pointer m_DataStorage = this->GetDataStorage();
        
                mitk::LookupTable::Pointer mitkLookupTable = 
mitk::LookupTable::New();
                mitkLookupTable->SetVtkLookupTable(resultVector.at(0)->lut);
                mitk::LookupTableProperty::Pointer LookupTableProp = 
mitk::LookupTableProperty::New( mitkLookupTable );

        if(state == true)
        {       
                if(resultValues == "force")
                {
                        
varResult->checkBox_SealingVessel->setCheckState(Qt::Unchecked);
                        
varResult->checkBox_SealingStent->setCheckState(Qt::Unchecked);

                        QString stentNode = 
m_Controls->comboBox_SingleVariant->currentText() + "_Stent";
                        mitk::UnstructuredGrid::Pointer gridStentF = 
mitk::UnstructuredGrid::New();

                        for (int i = 0; i < resultVariants.size(); i++)
                        {
                                
if(m_Controls->comboBox_SingleVariant->currentText() == 
resultVariants.at(i)->getVariantName())
                                {       
                                        
gridStentF->SetVtkUnstructuredGrid(resultVector.at(i)->setForceScalars());      
                                
                                }
                        }                                       

                        if(m_DataStorage->GetNamedNode(stentNode.toAscii()))
                        {
                                
m_DataStorage->GetNamedNode(stentNode.toAscii())->GetData()->Clear();
                                
m_DataStorage->GetNamedNode(stentNode.toAscii())->SetFloatProperty("opacity",1);
 //Unhiding Stent                               
                                
m_DataStorage->GetNamedNode(stentNode.toAscii())->Update();
                
                                
m_DataStorage->GetNamedNode(stentNode.toAscii())->SetData(gridStentF);  

                                
m_DataStorage->GetNamedNode(stentNode.toAscii())->SetBoolProperty("color mode", 
true);
                                
m_DataStorage->GetNamedNode(stentNode.toAscii())->SetBoolProperty("use color", 
false);
                                
m_DataStorage->GetNamedNode(stentNode.toAscii())->SetBoolProperty("scalar 
visibility", true);
                                
//m_DataStorage->GetNamedNode(stentNode.toAscii())->SetFloatProperty("ScalarsRangeMaximum",
 (float) 0.02)
                                
m_DataStorage->GetNamedNode(stentNode.toAscii())->SetProperty( "LookupTable", 
LookupTableProp );        
                                
                                
mitk::RenderingManager::GetInstance()->InitializeViews( 
m_DataStorage->ComputeBoundingGeometry3D(m_DataStorage->GetAll())); 
                        }
                        else
                        {
                                
addNodeToDataStorage(m_Controls->comboBox_SingleVariant->currentText(),makeFEresult(m_Controls->comboBox_SingleVariant->currentText(),
 "force"));
                        }
                }

                if(resultValues == "sealingStent")
                {
                        
varResult->checkBox_Fixation->setCheckState(Qt::Unchecked);
                        
varResult->checkBox_SealingVessel->setCheckState(Qt::Unchecked);

                        //Create Nodenames
                        QString intimaNode = 
m_Controls->comboBox_SingleVariant->currentText() + "_Intima";
                        QString plaqueNode = 
m_Controls->comboBox_SingleVariant->currentText() + "_Plaque";
                        QString stentNode = 
m_Controls->comboBox_SingleVariant->currentText() + "_Stent";
                        mitk::UnstructuredGrid::Pointer gridIntimaContact = 
mitk::UnstructuredGrid::New();
                        mitk::UnstructuredGrid::Pointer gridPlaqueContact = 
mitk::UnstructuredGrid::New();
                        mitk::UnstructuredGrid::Pointer gridStentF = 
mitk::UnstructuredGrid::New();

                        for (int i = 0; i < resultVariants.size(); i++)
                        {
                                
if(m_Controls->comboBox_SingleVariant->currentText() == 
resultVariants.at(i)->getVariantName())
                                {
                                        
if(m_DataStorage->GetNamedNode(stentNode.toAscii()))
                                        {                                       
                                                
resultVector.at(i)->uGridStent->GetPointData()->SetScalars(resultVector.at(i)->scalarsContactStent);
                                                
gridStentF->SetVtkUnstructuredGrid(resultVector.at(i)->uGridStent);     
                                                
m_DataStorage->GetNamedNode(stentNode.toAscii())->SetFloatProperty("opacity",1);
                                        }
                                }
                        }

                        if(m_DataStorage->GetNamedNode(intimaNode.toAscii()))
                        {
                                
m_DataStorage->GetNamedNode(intimaNode.toAscii())->SetFloatProperty("opacity",0.2);
 
                        }       
                        if(m_DataStorage->GetNamedNode(plaqueNode.toAscii()))
                        {
                                
m_DataStorage->GetNamedNode(plaqueNode.toAscii())->SetFloatProperty("opacity",0.2);
 
                        }       
                }

                if(resultValues == "sealingVessel")
                {
                        
varResult->checkBox_Fixation->setCheckState(Qt::Unchecked);
                        
varResult->checkBox_SealingStent->setCheckState(Qt::Unchecked);

                        //Create Nodenames
                        QString intimaNode = 
m_Controls->comboBox_SingleVariant->currentText() + "_Intima";
                        QString plaqueNode = 
m_Controls->comboBox_SingleVariant->currentText() + "_Plaque";
                        QString stentNode = 
m_Controls->comboBox_SingleVariant->currentText() + "_Stent";
                        mitk::UnstructuredGrid::Pointer gridIntimaContact = 
mitk::UnstructuredGrid::New();
                        mitk::UnstructuredGrid::Pointer gridPlaqueContact = 
mitk::UnstructuredGrid::New();

                        if(m_DataStorage->GetNamedNode(stentNode.toAscii()))
                        {                               
                                
m_DataStorage->GetNamedNode(stentNode.toAscii())->SetFloatProperty("opacity",0);
 //Hiding Stent 
                        }

                        for (int i = 0; i < resultVariants.size(); i++)
                        {
                                
if(m_Controls->comboBox_SingleVariant->currentText() == 
resultVariants.at(i)->getVariantName())
                                {
                                        
resultVector.at(i)->uGridIntima->GetPointData()->SetScalars(resultVector.at(i)->scalarsContactIntima);
                                        
resultVector.at(i)->uGridPlaque->GetPointData()->SetScalars(resultVector.at(i)->scalarsContactPlaque);
                                        
gridIntimaContact->SetVtkUnstructuredGrid(resultVector.at(i)->uGridIntima);
                                        
gridPlaqueContact->SetVtkUnstructuredGrid(resultVector.at(i)->uGridPlaque);
                                }
                        }

                        if(m_DataStorage->GetNamedNode(intimaNode.toAscii()))
                        {
                                
m_DataStorage->GetNamedNode(intimaNode.toAscii())->GetData()->Clear();
                                
m_DataStorage->GetNamedNode(plaqueNode.toAscii())->GetData()->Clear();          
                
                                
m_DataStorage->GetNamedNode(intimaNode.toAscii())->Update();
                
                                
m_DataStorage->GetNamedNode(intimaNode.toAscii())->SetData(gridIntimaContact);  
                                
m_DataStorage->GetNamedNode(plaqueNode.toAscii())->SetData(gridPlaqueContact);  
                        }
                        else
                        {
                                
addNodeToDataStorage(m_Controls->comboBox_SingleVariant->currentText(),makeFEresult(m_Controls->comboBox_SingleVariant->currentText(),
 "sealingVessel"));
                        }
                }
        }
        if(state == false)
        {
                mitk::DataStorage::Pointer m_DataStorage = 
this->GetDataStorage();
                m_DataStorage->Remove(m_DataStorage->GetAll());         
                
addNodeToDataStorage(m_Controls->comboBox_SingleVariant->currentText(),makeFEresult(m_Controls->comboBox_SingleVariant->currentText(),
 "singleVariant"));
        }
        

        mitk::RenderingManager::GetInstance()->InitializeViews( 
m_DataStorage->ComputeBoundingGeometry3D(m_DataStorage->GetAll())); 

        qDebug() <<"resultValueToShow " <<  resultToShow; }

Best regards,
Sandra 

Dipl.-Inf. (FH) Sandra Scherer, Master en Multimédia Fraunhofer Institut für 
Werkzeugmaschinen und Umformtechnik Gruppe Medizintechnik Hauptabteilung 
Mechatronik und Leichtbau Nöthnitzer Str. 44
01187 Dresden 

Telefon: +49 (0)351 / 4772 2340
Telefax: +49 (0)351 / 4772 2303
http://www.iwu.fraunhofer.de/ 


 


-----Ursprüngliche Nachricht-----
Von: Mersmann, Sven [mailto:[email protected]]
Gesendet: Montag, 30. Mai 2011 14:16
An: Scherer, Sandra; [email protected]
Betreff: AW: vtkLookUpTable - scalar Range?

Hey Sandra,
did you set the properties "scalar visibility" and "color mode" to true? 
Probably updating the node and calling 
mitk::RenderingManger::GetInstance()->RequestUpdateAll() from your plugin after 
changing could help to renew the mapping. 

Here is a problem in your code:
m_DataStorage->GetNamedNode(stentNode.toAscii())->SetFloatProperty("ScalarsRangeMaximum",
 (float)* resultVector.at(i)->uGridStent->GetScalarRange());

The SetFloatProperty method requests a single float value, the call to 
GetScalarRange returns a float* with min and max value of the range in this 
order. So it seems like you set the minimum scalar value to the property.

Hope this can help you!

Best regards
Sven


-----Ursprüngliche Nachricht-----
Von: Scherer, Sandra [mailto:[email protected]]
Gesendet: Donnerstag, 26. Mai 2011 15:22
An: [email protected]
Betreff: [mitk-users] vtkLookUpTable - scalar Range?

Hello Sven,

hhanks for your answer. My problem is, that I can display the scalars with the 
right coloring when I set the scalars immediately after reading the input file 
at the beginning. I have several result files which I want to save and later on 
want to success them.

void makeFEresult(QString variant, QString resultValues) {
        QString path = "./Resources/FEMResults/" + variant + ".s4s";
        std::string strPath = std::string(path.toAscii().data());
        const char * filePath = strPath.c_str();
        qDebug() <<"filePath = " << filePath;
        
        ifstream file (filePath);
        if (!file) {
                file.close();
                std::cout << "file not found" << std::endl;
                //return ;
        }

        FEresult* result = new FEresult(file); 
        result->uGridIntima->SetPoints(result->nodeCoordinatesIntima);  
        result->uGridPlaque->SetPoints(result->nodeCoordinatesPlaque);
        result->uGridStent->SetPoints(result->nodeCoordinatesStent);
        
result->uGridStent->GetPointData()->SetScalars(result->scalarsForceStent); 
//when the command is at this place everything is fine
        resultVector.push_back(result);
}

...When I want to access the result within anoter method from the resultVector 
it doesn´t work - even if the node properties are equal...:

updateFEresult(bool state, QString resultValues) {
        
resultVector.at(i)->uGridStent->GetPointData()->SetScalars(resultVector.at(i)->scalarsForceStent);
}

...there is a coloring of the scalar values...but with false coloring. Maybe 
there is something wrong with the scalar range?

But the following didn´t help:

m_DataStorage->GetNamedNode(stentNode.toAscii())->SetFloatProperty("ScalarsRangeMaximum",
 (float)* resultVector.at(i)->uGridStent->GetScalarRange());

The scalars are double values.

Would be great if you can help me.

Thanks.

Regards,
Sandra 

Dipl.-Inf. (FH) Sandra Scherer, Master en Multimédia Fraunhofer Institut für 
Werkzeugmaschinen und Umformtechnik Gruppe Medizintechnik Hauptabteilung 
Mechatronik und Leichtbau Nöthnitzer Str. 44
01187 Dresden 

Telefon: +49 (0)351 / 4772 2340
Telefax: +49 (0)351 / 4772 2303
http://www.iwu.fraunhofer.de/ 


 



------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, you get 
blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to