I have ~5000 datasets, that's why I am trying to use a script.
I just found out that in order to have the shape got closed by your program, the first line should be repeated as the last not once, but twice.
By doing this, the shape gets closed and the mask that I obtain matches exactly what I need. I used the original list of coordinates, which are reported following either a clockwise or an anti-clockwise direction around the polygon.
Thank you SO much! Maybe it would be useful to implement this program in AFNI, as other people might need to do a similar task, maybe!
Giuseppe
Edited 1 time(s). Last edit at 11/29/2022 02:46PM by gbarisano.