I have a large raster object which was imported from a .tif image file. I want to analyze pixels of this raster, at a given radial distance from the center, in order to identify certain axisymmetric phenomenon that I can notice in the image (below). To do this I want to extract the values of pixels that intersect with circular strips of a given radii (and width) from the center of the image (indicated in the figure below).
I have explored several options to do this including the extract function and the imager package. In the imager package, you can easily extract values along rows or columns but I couldn't find functions to extract values with customized shapes like I require.
I might use the extract function with SpatialPolygons argument, however for this I will have to input the locations of all the points in a polygon object, and this would require very high density location of points (since the points, I think, are joined by line elements). Moreover, I want to vary the number density of the strips over which I extract pixel values (and later average) therefore this method would be both tedious and inflexible. I was thus wondering if any of you have any suggestions to tackle this issue.
> str(imRaster)
Formal class 'RasterLayer' [package "raster"] with 12 slots
..@ file :Formal class '.RasterFile' [package "raster"] with 13 slots
.. .. ..@ name : chr "C:\\Users\\Nandu\\input_images\\All\\101_1A_1000ms.tif"
.. .. ..@ datanotation: chr "INT2U"
.. .. ..@ byteorder : chr "little"
.. .. ..@ nodatavalue : num -Inf
.. .. ..@ NAchanged : logi FALSE
.. .. ..@ nbands : int 1
.. .. ..@ blockrows : int 1
.. .. ..@ blockcols : int 1392
.. .. ..@ driver : chr "gdal"
.. .. ..@ open : logi FALSE
..@ data :Formal class '.SingleLayerData' [package "raster"] with 13 slots
.
.
.
Alternately, if there are other methods (other than by importing a .tif image to raster) that would allow such an operation, that might also be useful. Please let me know.
Thanks in advance!
EDIT: In order to make the problem reproducible, I have further added here the link to the image that I want to use. It is a tiff image, and can be downloaded from here
Link to the tiff image that I am trying to process in R
library(tiff)
library(raster)
imRaster = raster(file_path to the image)
plot(imRaster)
xy = cbind(684.4228, 599.0458) # Gives a rough location of the center in the image coordinates
This code can be run in order to obtain the raster described above and visualize it. Hope it helps!