# How to set points in gui?

**URL:** <https://discourse.itk.org/t/how-to-set-points-in-gui/5386>\
**Category:** Beginner Questions\
**Tags:** dicom, simpleitk, registration, python\
**Created:** [October 2, 2022, 12:08am UTC](https://discourse.itk.org/t/how-to-set-points-in-gui/5386 "2022-10-02T00:08:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![debapriya](https://discourse.itk.org/letter_avatar_proxy/v4/letter/d/bc79bd/32.png) [@debapriya](https://discourse.itk.org/u/debapriya)\
**Post date:** [October 2, 2022, 12:08am UTC](https://discourse.itk.org/t/how-to-set-points-in-gui/5386/1 "2022-10-02T00:08:15Z")

</div>

I have a set of 3D coordinate points.

```auto
fixed_image_points = [
    (156.48434676356158, 201.92274575468412, 68.0),
    (194.25413436597393, 98.55771047484492, 32.0),
    (128.94523819661913, 96.18284152323203, 32.0),
]
moving_image_points = [
    (141.46826904042848, 156.97653126727528, 48.0),
    (113.70102381552435, 251.76553994455645, 8.0),
    (180.69457220262115, 251.76553994455645, 8.0),
]

```

I want to mark these points, on the fixed and moving images, in the gui.  
What is the command?

---

<div class="post-metadata">

**Author:** ![zivy](https://discourse.itk.org/user_avatar/discourse.itk.org/zivy/32/1726_2.png) [@zivy](https://discourse.itk.org/u/zivy)\
**Post date:** [October 3, 2022, 12:39am UTC](https://discourse.itk.org/t/how-to-set-points-in-gui/5386/2 "2022-10-03T00:39:50Z")

</div>

Hello @debapriya,

Which GUI component are you referring to? If you are referring to the [RegistrationPointDataAquisition](https://github.com/InsightSoftwareConsortium/SimpleITK-Notebooks/blob/bf9489b00ec99c17f38ba546824c5de6d176ca0b/Python/gui.py#L13), it does not have functionality to set points.

You can obviously modify it to support this functionality. Possibly something like the PointDataAquisition’s [set\_point\_indexes](https://github.com/InsightSoftwareConsortium/SimpleITK-Notebooks/blob/bf9489b00ec99c17f38ba546824c5de6d176ca0b/Python/gui.py#L500). To convert from physical points to continuous indexes you will need to use the `TransformPhysicalPointToContinuousIndex` for each of the two images.

---

<div class="post-metadata">

**Author:** ![debapriya](https://discourse.itk.org/letter_avatar_proxy/v4/letter/d/bc79bd/32.png) [@debapriya](https://discourse.itk.org/u/debapriya)\
**Post date:** [October 4, 2022, 9:47am UTC](https://discourse.itk.org/t/how-to-set-points-in-gui/5386/3 "2022-10-04T09:47:00Z")

</div>

Thank you @zivy .

I am trying to write a method `set_point_indexes`, in `RegistrationPointDataAquisition`. However, I am getting the following error while calling `TransformPhysicalPointToContinuousIndex`.

```auto
TypeError: in method 'Image_TransformPhysicalPointToContinuousIndex', argument 2 of type 'std::vector< double,std::allocator< double > > const &'

```

How can I resolve this?

---

<div class="post-metadata">

**Author:** ![zivy](https://discourse.itk.org/user_avatar/discourse.itk.org/zivy/32/1726_2.png) [@zivy](https://discourse.itk.org/u/zivy)\
**Post date:** [October 4, 2022, 1:46pm UTC](https://discourse.itk.org/t/how-to-set-points-in-gui/5386/4 "2022-10-04T13:46:23Z")

</div>

Hello @debapriya,

Just iterate over the lists:

```auto
fixed_continous_indexes = [fixed_image.TransformPhysicalPointToContinuousIndex(pnt) for pnt in fixed_image_points]

```

---

<div class="post-metadata">

**Author:** ![debapriya](https://discourse.itk.org/letter_avatar_proxy/v4/letter/d/bc79bd/32.png) [@debapriya](https://discourse.itk.org/u/debapriya)\
**Post date:** [October 7, 2022, 8:58am UTC](https://discourse.itk.org/t/how-to-set-points-in-gui/5386/5 "2022-10-07T08:58:16Z")

</div>

Thank you @zivy . I could set points in the gui.
