[vtkusers] [Insight-users] Problem in obtaining world position with vtkSeedWidget
Xiaopeng Yang
yxp233 at postech.ac.kr
Tue Jan 11 18:10:25 EST 2011
Sorry, I mean pos[2] in the code, not pos[3].
发件人: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] 代表 Xiaopeng Yang
发送时间: 2011년 1월 12일 수요일 오전 8:07
收件人: 'vtk'; insight-users at itk.org
主题: Re: [vtkusers] [Insight-users] Problem in obtaining world position with vtkSeedWidget
The problem is still there. I am very confused why just pos[3] is not correct. If anyone of you have experienced the similar problem, please share your idea with me. I would appreciate a lot!
Thanks
发件人: insight-users-bounces at itk.org [mailto:insight-users-bounces at itk.org] 代表 Xiaopeng Yang
发送时间: 2011년 1월 11일 화요일 오후 6:44
收件人: 'vtk'; insight-users at itk.org
主题: [Insight-users] Problem in obtaining world position with vtkSeedWidget
Dear Users,
I am trying to get world position by SeedRepresentation->GetSeedWorldPosition(I, pos). But comparing with other software, I got the wrong value in z coordinate. The values of x and y coordinates are correct. I would appreciate if anyone can point me in the right direction.
Thanks,
Yang
class vtkSeedCallback : public vtkCommand
{
public:
static vtkSeedCallback *New()
{
return new vtkSeedCallback;
}
vtkSeedCallback() {}
virtual void Execute(vtkObject*, unsigned long event, void *calldata)
{
if(event == vtkCommand::PlacePointEvent)
{
std::cout << "Point placed, total of: "
<< this->SeedRepresentation->GetNumberOfSeeds() << std::endl;
}
if(event == vtkCommand::InteractionEvent)
{
if(calldata)
{
std::cout << "Interacting with seed : "
<< *(static_cast< int * >(calldata)) << std::endl;
}
}
std::cout << "List of seeds (Display coordinates):" << std::endl;
for(vtkIdType i = 0; i < this->SeedRepresentation->GetNumberOfSeeds(); i++)
{
double pos[3];
this->SeedRepresentation->GetSeedWorldPosition(i, pos);
std::cout << "(" << pos[0] << " " << pos[1] << " " << pos[2] << ")" << std::endl;
}
}
void SetRepresentation(vtkSmartPointer<vtkSeedRepresentation> rep) {this->SeedRepresentation = rep;}
private:
vtkSmartPointer<vtkSeedRepresentation> SeedRepresentation;
};
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110112/7d87f66a/attachment.htm>
More information about the vtkusers
mailing list