AFNI Message Board

Dear AFNI users-

We are very pleased to announce that the new AFNI Message Board framework is up! Please join us at:

https://discuss.afni.nimh.nih.gov

Existing user accounts have been migrated, so returning users can login by requesting a password reset. New users can create accounts, as well, through a standard account creation process. Please note that these setup emails might initially go to spam folders (esp. for NIH users!), so please check those locations in the beginning.

The current Message Board discussion threads have been migrated to the new framework. The current Message Board will remain visible, but read-only, for a little while.

Sincerely, AFNI HQ

History of AFNI updates  

|
November 28, 2022 02:42PM
Thank you so much for working on this, Paul, I truly appreciate your support!
I was able to run your code and get some results. I noted that the final mask output varies based on the order of the coordinates.
Specifically, I tested it on a case where my points were laying on a Z plane (so the Z coordinate is fixed for all the points).
I tried three different scenarios:
1) CASE 1: the coordinates in the input file were exactly as I was given (i.e., in the order that the drawer traced them on ImageJ, in this case it was clockwise. In my project, the tracer will trace the coordinates either clockwise or counterclockwise). I just copied the coordinates of the first point at the end of the file as you suggested for your code.
292 297 80
294 298 80
296 297 80
298 294 80
297 292 80
297 292 80
294 292 80
292 292 80
292 294 80
292 297 80
2) CASE 2: the X coordinates were sorted from low to high, and for each X, the Y coordinates were sorted from low to high.
292 297 80
292 292 80
292 294 80
294 292 80
294 298 80
297 292 80
297 292 80
296 297 80
298 294 80
292 297 80
3) CASE 3: the Y coordinates were sorted from low to high, and for each Y, the X coordinates were sorted from low to high.
292 292 80
294 292 80
297 292 80
297 292 80
292 294 80
298 294 80
292 297 80
296 297 80
294 298 80
292 292 80

The results from the 3 cases are attached. To "fill" a convex polygon your program should have the X coordinates sorted from low to high, and, for each X coordinate, the Y coordinates should also be sorted.
The result from case n.2 was indeed the one that fitted my goal the best, although not exactly. As you can see in the attached file "goal", I would like to have segmented also the voxels reported in green.
Anyway, thank you so much for making this program. I will try to work on it to achieve my final goal. Thank you for your help on this, really appreciate it.
Please let me know if you further update your program or if you have any suggestion. Thank you!

Giuseppe
Attachments:
open | download - all_cases.png (164.8 KB)
open | download - goal.png (31.4 KB)
Subject Author Posted

Filling a closed curve ROI from coordinates of the vertices Attachments

gbarisano November 21, 2022 11:15PM

Re: Filling a closed curve ROI from coordinates of the vertices

ptaylor November 22, 2022 06:21AM

Re: Filling a closed curve ROI from coordinates of the vertices

gbarisano November 23, 2022 11:13PM

Re: Filling a closed curve ROI from coordinates of the vertices Attachments

ptaylor November 26, 2022 07:14PM

Re: Filling a closed curve ROI from coordinates of the vertices

ptaylor November 26, 2022 07:16PM

Re: Filling a closed curve ROI from coordinates of the vertices Attachments

gbarisano November 28, 2022 02:42PM

Re: Filling a closed curve ROI from coordinates of the vertices

ptaylor November 28, 2022 03:08PM

Re: Filling a closed curve ROI from coordinates of the vertices

gbarisano November 29, 2022 02:44PM

Re: Filling a closed curve ROI from coordinates of the vertices

ptaylor November 29, 2022 07:29PM

Re: Filling a closed curve ROI from coordinates of the vertices

Daniel Glen December 05, 2022 04:35PM