world coordinates do not give the correct dicom coordinate

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

world coordinates do not give the correct dicom coordinate

zandarina
Dear all,

I want to do segmentation with itk and i would like to select a seed using
vtk with the mouse. I get the coordinates in world coordinates

                        int x = this->Interactor->GetEventPosition()[0];
                        int y = this->Interactor->GetEventPosition()[1];
                        std::cout << "(x,y) = (" << x << "," << y << ")" << std::endl;

                        seeds[0] = x;
                        seeds[1] = y;

but when i want to use it as a seed for itk i see it is the wrong place. I
tried the transformphysicalpointoindex but the result is even worst

                bool isInside =
                        extractFilter->GetOutput()->TransformPhysicalPointToIndex(coordinate_vtk,
coordinate_itk);
                if (isInside) {


                        ImageType::PixelType pixelValue =
extractFilter->GetOutput()->GetPixel(coordinate_itk);
                }

Any help about the coordinates in vtk?

Thanks





--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: world coordinates do not give the correct dicom coordinate

VTK - Users mailing list
Hello,

Would you mind posting your question to https://discourse.vtk.org? Community support for VTK is transitioning to that forum, and you are more likely to get an answer there.

Thanks,
Cory

On Mon, Mar 11, 2019 at 9:48 AM zandarina <[hidden email]> wrote:
Dear all,

I want to do segmentation with itk and i would like to select a seed using
vtk with the mouse. I get the coordinates in world coordinates

                        int x = this->Interactor->GetEventPosition()[0];
                        int y = this->Interactor->GetEventPosition()[1];
                        std::cout << "(x,y) = (" << x << "," << y << ")" << std::endl;

                        seeds[0] = x;
                        seeds[1] = y;

but when i want to use it as a seed for itk i see it is the wrong place. I
tried the transformphysicalpointoindex but the result is even worst

                bool isInside =
                        extractFilter->GetOutput()->TransformPhysicalPointToIndex(coordinate_vtk,
coordinate_itk);
                if (isInside) {


                        ImageType::PixelType pixelValue =
extractFilter->GetOutput()->GetPixel(coordinate_itk);
                }

Any help about the coordinates in vtk?

Thanks





--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtkusers


--
Cory Quammen
Staff R&D Engineer
Kitware, Inc.

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtkusers