# Select point (user input) on 3D surface for 2000 surfaces automatically opening after user selects a point

**URL:** <https://discourse.slicer.org/t/select-point-user-input-on-3d-surface-for-2000-surfaces-automatically-opening-after-user-selects-a-point/29164>\
**Category:** Development\
**Tags:** python, automation\
**Created:** [April 27, 2023, 3:45am UTC](https://discourse.slicer.org/t/select-point-user-input-on-3d-surface-for-2000-surfaces-automatically-opening-after-user-selects-a-point/29164 "2023-04-27T03:45:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Saima](https://avatars.discourse-cdn.com/v4/letter/s/9d8465/32.png) [@Saima](https://discourse.slicer.org/u/Saima)\
**Post date:** [April 27, 2023, 3:45am UTC](https://discourse.slicer.org/t/select-point-user-input-on-3d-surface-for-2000-surfaces-automatically-opening-after-user-selects-a-point/29164/1 "2023-04-27T03:45:39Z")

</div>

Hi Andras,  
Would it be possible to select the point (x,y,z) location in a ply file, for all the ply files opening up one by one and closing once the point is selected.  
The point needed to be selected by the user on the model and then the next model file opens up automatically and the user selects a point on that model and will do until points in all the ply files are selected. can this process be automated.

Thank you

regards,  
Saima

---

<div class="post-metadata">

**Author:** ![RafaelPalomar](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rafaelpalomar/32/1436_2.png) [@RafaelPalomar](https://discourse.slicer.org/u/RafaelPalomar)\
**Post date:** [May 2, 2023, 10:52am UTC](https://discourse.slicer.org/t/select-point-user-input-on-3d-surface-for-2000-surfaces-automatically-opening-after-user-selects-a-point/29164/2 "2023-05-02T10:52:34Z")

</div>

This could be easily done through a scripted module ([Module Overview — 3D Slicer documentation](https://slicer.readthedocs.io/en/latest/developer_guide/module_overview.html#scripted-modules)). You could have a a user interface featuring (1) a directory selector to point to where your `.ply` files lie and (2) a “Next” button that will save the recorded data and load the next model in the dataset. In addition, you will probably want to add some other widgets to select the output file for the results, etc.

You can use [GitHub - RafaelPalomar/BulkLabelStatistics: Module to compute labelmap statistics in bulk](https://github.com/RafaelPalomar/BulkLabelStatistics) as inspiration for batch loading data from a folder.

When it comes to the selection of one point, you could use callbacks to control the workflow for placing one (and only one) point. This topic might be helpful for that: [How to access Node in Scene?](https://discourse.slicer.org/t/how-to-access-node-in-scene/27197). Alternatively, I would suggest to use the Template Markups ([Markups — 3D Slicer documentation](https://slicer.readthedocs.io/en/latest/user_guide/modules/markups.html#creating-template-landmarks)) to control the workflow and limit the point acquisition to 1.

---

<div class="post-metadata">

**Author:** ![Saima](https://avatars.discourse-cdn.com/v4/letter/s/9d8465/32.png) [@Saima](https://discourse.slicer.org/u/Saima)\
**Post date:** [May 9, 2023, 1:45am UTC](https://discourse.slicer.org/t/select-point-user-input-on-3d-surface-for-2000-surfaces-automatically-opening-after-user-selects-a-point/29164/3 "2023-05-09T01:45:32Z")

</div>

Hi,  
I would not want a next button but I would want the .ply files to open one by one once the point in the .ply file is selected.  
is it possible?

regards,  
saima

---

<div class="post-metadata">

**Author:** ![RafaelPalomar](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rafaelpalomar/32/1436_2.png) [@RafaelPalomar](https://discourse.slicer.org/u/RafaelPalomar)\
**Post date:** [May 9, 2023, 8:39am UTC](https://discourse.slicer.org/t/select-point-user-input-on-3d-surface-for-2000-surfaces-automatically-opening-after-user-selects-a-point/29164/4 "2023-05-09T08:39:38Z")

</div>

Yes, I think that is possible. You just need to observe the right events from the markups and manage the creation/deletion of new added markups. I believe all the links above are still relevant to make this happen.
