[Insight-users] Saving seed points in ImagePlaneWidget

Luis Ibanez luis.ibanez at kitware.com
Sun Oct 31 10:08:32 EDT 2010


Hi Xiaopen,

Capture the "EndPickEvent" with an Observer,
and in the execute method of the observer,
extract the coordinates of the point with code
similar to:

  double data[3];
  picker->GetPickPosition( data );

  itk::Point< double, 3 > pickedPoint;
  pickedPoint[0] = data[0];
  pickedPoint[1] = data[1];
  pickedPoint[2] = data[2];


---

See the example:

VTK/Examples/Annotation/Python/annotatePick.py


   Regards,


         Luis

----------------------------------------------------------------
On Mon, Oct 25, 2010 at 2:15 AM, Xiaopeng Yang <yxp233 at postech.ac.kr> wrote:

>  Hello everyone,
>
>
>
> I am working on developing a simple medical image segmentation program,
> which provide interactive selection and automatic saving function of
> multiple seed points. That means when left-clicking on one of the CT slices,
> the 3D position of that point will be automatically saved to the code.
>
>
>
> I applied ImagePlaneWidget to pick the position of certain clicked point.
> The position and intensity value can be shown on the screen. But I have no
> idea how to program to save the position to the code. Could you give me a
> hand about how to solve this problem?
>
>
>
> Here is the code of ImagePlaneWidget:
>
>
>
>   vtkImagePlaneWidget * zImagePlaneWidget =  vtkImagePlaneWidget::New();
>
>
>
>   zImagePlaneWidget->DisplayTextOn();
>
>   zImagePlaneWidget->SetInput(vtkImporter->GetOutput());
>
>   zImagePlaneWidget->SetPlaneOrientationToZAxes();
>
>   zImagePlaneWidget->SetSliceIndex(size[0]/2);
>
>   zImagePlaneWidget->SetPicker(picker);
>
>   zImagePlaneWidget->RestrictPlaneToVolumeOn();
>
>   zImagePlaneWidget->SetKeyPressActivationValue('y');
>
>   zImagePlaneWidget->GetPlaneProperty()->SetColor(1, 0, 0);
>
>   zImagePlaneWidget->SetTexturePlaneProperty(ipwProp);
>
>   zImagePlaneWidget->SetResliceInterpolateToNearestNeighbour();
>
>
>
>   zImagePlaneWidget->SetInteractor( iren );
>
> zImagePlaneWidget->On();
>
>
>
> Thanks very much.
>
>
>
> Best regards,
>
> Yang
>
> _____________________________________
> 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/20101031/8cfd1f47/attachment-0001.htm>


More information about the Insight-users mailing list