
Jacobian : bool Include `r` intensity scaling in the coordinate transform. If ``None``, the geometric center of the image is used. Parameters - data : 2D np.array the image array origin : tuple or None (row, column) coordinates of the image origin. The resulting array has rows corresponding to the radial grid, and columns corresponding to the angular grid. Someone also pointed out that may be in looping over b and s I am overwriting f 360*1024 times and only the last one is used.Def reproject_image_into_polar ( data, origin = None, Jacobian = False, dr = 1, dt = None ): """ Reprojects a 2D numpy array (**data**) into a polar coordinate system, with the pole placed at **origin** and the angle measured clockwise from the upward direction. Im = Image.open("Fanbeamreconstruction.png") Z = scipy.io.loadmat('/home/prakriti/Project/C.mat')į = np.zeros((1024,90)) #In polar co-ordinate Y = scipy.io.loadmat('/home/prakriti/Project/B.mat') X = scipy.io.loadmat('/home/prakriti/Project/A.mat')

Is there any other way to avoid these loops? I haven't been able to display the image until now. I am new to Python and I guess my algorithm seems to slow down the execution.

And after that I am converting the image to grayscale. But when I had it as (0,725) earlier, it showed me error "dividing with zero" as I use atany(y/x). I have set the range of x and y as (1,726). The image in the Cartesian coordinate is of dimension 725*725.

In the second I am converting the image from polar coordinate to Cartesian coordinate. h is a filter that I have used in the first loop. f where r varies from 0 to 1024 and phi varies from 0 to 90. The first loop gives me f in the polar-coordinate. This is the value of the projection data given to me. I am first making a matrix of dimension 1024*360. This code is actually for image processing. I have the following code which has too many loops inside it (almost 13 billion).
