[vtkusers] The value of ESP was not properly saved????
yaolu at engineering.uiowa.edu
yaolu at engineering.uiowa.edu
Mon Feb 27 14:22:41 EST 2006
Dear all,
Thanks for Beau's reply. But unfortunately, it doesn't work for me.
Jenny
Quoting Beau Sapach <beau.sapach at ualberta.ca>:
> I've had this happen at times and simply cleaning then re-compiling the
> entire program would fix it.
>
> Beau
>
> -----Original Message-----
> From: vtkusers-bounces+beau.sapach=ualberta.ca at vtk.org
> [mailto:vtkusers-bounces+beau.sapach=ualberta.ca at vtk.org] On Behalf Of
> yaolu at engineering.uiowa.edu
> Sent: Monday, February 27, 2006 9:26 AM
> To: vtkusers at vtk.org
> Subject: [vtkusers] The value of ESP was not properly saved????
>
> Dear All,
>
> When I run my program, I got a Error: "The value of ESP was not properly
> saved
> across a function call. This is usually a result of calling a function
> declared
> with one calling convention with a function pointer declared with a
> different
> calling convention."
>
> First time call "AddLabelContour()", it's fine. Failed when it is called
> second
> time.
>
> I didn't use compile option "/Gz" in the compiler.
>
> Any suggestion is absolutely welcome! Thanks a lot!
>
> Here is my code:
> int m_NumberOfLabel;
> struct Label{
> int LabelIndex;
> std::string LabelName;
> vtkActor * LabelContour;
> };
> std::vector<Label> m_LabelList;
>
> void BrainCSIGUIImplementation::AddLabelContour(){
>
> m_NumberOfLabel++;
>
> Label *LatestLabel = new Label; //memory allocation
> (*LatestLabel).LabelIndex = m_NumberOfLabel;
> (*LatestLabel).LabelName = LabelNameInput->value();
> (*LatestLabel).LabelContour = GenerateContour();
>
> m_LabelList.push_back( *LatestLabel );
>
> for (int i=0; i<m_NumberOfLabel; i++){
> std::cout<<"m_LabelList[i]: "<<std::endl;
> std::cout<<m_LabelList[i].LabelIndex<<std::endl;
> std::cout<<(m_LabelList[i].LabelName).c_str()<<std::endl;
> std::cout<<m_LabelList[i].LabelContour<<std::endl;
> }//end of for
>
> //Visualization
> m_Renderer->AddActor(m_LabelList[m_NumberOfLabel-1].LabelContour);
> fltkRenderWindowInteractor->show();
> fltkRenderWindowInteractor->redraw();
>
> }//end of AddLabelContour
>
> vtkActor* BrainCSIGUIImplementation::GenerateContour(){
>
> m_itkLabel2vtkFilter = itk2vtkFilterType::New();
> m_itkLabel2vtkFilter->SetInput(m_ResampledLabel);
>
> vtkContourFilter *labelcontour = vtkContourFilter::New();
> labelcontour->SetInput(m_itkLabel2vtkFilter->GetOutput());
> labelcontour->SetValue(0,0.5);
>
> vtkPolyDataNormals *labelnormals = vtkPolyDataNormals::New();
> labelnormals->SetInput(labelcontour->GetOutput());
> labelnormals->SetFeatureAngle(60.0);
>
> vtkStripper *labelstripper = vtkStripper::New();
> labelstripper->SetInput(labelnormals->GetOutput());
>
> vtkPolyDataMapper *labelmapper = vtkPolyDataMapper::New();
> labelmapper->SetInput(labelstripper->GetOutput());
> labelmapper->ScalarVisibilityOff();
>
> vtkActor *labelactor = vtkActor::New();
> labelactor->SetMapper(labelmapper);
> labelactor->PickableOff();
> labelactor->GetProperty()->SetOpacity(0.5);
> labelactor->GetProperty()->SetSpecular(0.3);
> labelactor->GetProperty()->SetSpecularPower(20);
> std::cout<<labelactor<<std::endl;
>
> return labelactor;
>
> }//end of GenerateContour
>
> Jenny
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
>
More information about the vtkusers
mailing list