HEAD
computeCaptureArea.Rd
Computes and updates the capture area (field of view).
=======Computes the capture area for the specified spatial method within a the SpatialMethod
object,
updating the calculated capture area.
computeCaptureArea(object, ...)
# S4 method for class 'SPATA2'
computeCaptureArea(object, ...)
# S4 method for class 'SpatialData'
computeCaptureArea(object, ...)
An object of class SPATA2
or, in case of S4 generics,
objects of classes for which a method has been defined.
Used to absorb deprecated arguments or functions.
The updated input object, containing the added, removed or computed results.
The computeCaptureArea
function calculates the capture area for the spatial data based
on the specific method used. The process differs slightly depending on whether the
spatial method is a Visium platform or another type:
For Visium platforms:
The coordinates data frame is first ensured to be complete using complete_visium_coords_df
.
A buffer is added around the capture area to account for the physical spacing between capture areas, calculated using the center-to-center distance (CCD
).
The capture area is defined by the four corners (vertices) of the bounding box around the coordinates, adjusted by the buffer.
For non-Visium platforms:
The capture area is calculated as the range of the x and y coordinates, defining a simple bounding box.
After computing the capture area, it is stored in the @capture_area
slot of the SpatialData
.
The computeCaptureArea
function calculates the capture area for a given spatial method within a SpatialMethod
object.
The function follows these steps:
Retrieves the coordinates data frame from the SPATA2
object.
Completes the coordinates data frame based on the specified spatial method and resolution, if necessary.
For Visium platforms, it identifies the four corner points that define the capture area.
For non-Visium methods, it calculates the capture area based on the range of x_orig
and y_orig
.
Updates the capture_area
slot in the SpatialMethod
object with the computed capture area.
if (FALSE) { # \dontrun{
# Example usage:
object <- computeCaptureArea(object)
} # }