How to set points in gui?

I have a set of 3D coordinate points.

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?

Hello @debapriya,

Which GUI component are you referring to? If you are referring to the RegistrationPointDataAquisition, 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. To convert from physical points to continuous indexes you will need to use the TransformPhysicalPointToContinuousIndex for each of the two images.

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.

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

How can I resolve this?

Hello @debapriya,

Just iterate over the lists:

fixed_continous_indexes = [fixed_image.TransformPhysicalPointToContinuousIndex(pnt) for pnt in fixed_image_points]
1 Like

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

1 Like