[vtkusers] The value of ESP was not properly saved????

John Platt jcplatt at dsl.pipex.com
Mon Feb 27 18:21:51 EST 2006


Have you made any modifications to a vtk header file locally in your
project and not recompiled other vtk classes dependent on the same
header?

John. 

-----Original Message-----
From: vtkusers-bounces+jcplatt=dsl.pipex.com at vtk.org
[mailto:vtkusers-bounces+jcplatt=dsl.pipex.com at vtk.org] On Behalf Of
yaolu at engineering.uiowa.edu
Sent: 27 February 2006 16:26
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