[Insight-users] [vtkusers] Problem in obtaining world position with vtkSeedWidget

Navneeth Subramanian navneeth.s at gmail.com
Wed Jan 12 00:34:54 EST 2011


Is the image you are displaying a 2D image or a 3D image ?

On Wed, Jan 12, 2011 at 4:40 AM, Xiaopeng Yang <yxp233 at postech.ac.kr> wrote:

> 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;
>
> };
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20110112/1a10dfa1/attachment.htm>


More information about the Insight-users mailing list