03-24-2015 09:53 AM
There is one thing I need to achieve as part of a fienup interative routine, I need to be able to set all elements outside a specific circle in a 2d array to 0. Either by inserting the circle of elements from my array into an array of 0s. Or setting all the elements outside a 400 "pixel" - element - circle to 0. I've tried many ways of doing it but keep falling flat, I'm fairly new to labview. Any help appreicated.
03-24-2015 09:56 AM
03-30-2015 07:29 AM
This is what I'm confused about. The distance between two points is sqrt(i^2+j^2) And if the centre of the circle was 0,0 I could set if sqrt(i^2+j^2)>200 replace with 0. That would make a quarter circle from 0,0. But I need to set it as a 200 radius circle from the centre of a 600,600 array. I'm sure i'm just being dense but this is frustrating me to no end.
03-30-2015 08:05 AM
srt((600-x)^2 + (600-y)^2) > 200
03-30-2015 09:16 AM - edited 03-30-2015 09:19 AM
@Deccarrin wrote:
There is one thing I need to achieve as part of a fienup interative routine, I need to be able to set all elements outside a specific circle in a 2d array to 0. Either by inserting the circle of elements from my array into an array of 0s. Or setting all the elements outside a 400 "pixel" - element - circle to 0. I've tried many ways of doing it but keep falling flat, I'm fairly new to labview. Any help appreicated.
You can use Re/Im to polar to select inside/outside circle points. You need to do some offsetting to have the center at a different location than (0,0). Instead of a bool output you can use the bool to 0,1 function and multiply the resulting 0,1 array with the original array.
Ben64
EDIT: Probably more efficient to do the offset after the loop.