Estimate translation alignment between a cell/region pair based on the Cross-Correlation Theorem.

comparison_fft_ccf(cellHeightValues, regionHeightValues)

Arguments

cellHeightValues

list/tibble column of x3p objects containing a reference scan's cells (as returned by comparison_cellDivision)

regionHeightValues

list/tibble column of x3p objects containing a target scan's regions (as returned by comparison_getTargetRegions)

Value

A list of the same length as the input containing data frames of the translation (x,y) values at which each reference cell is estimated to align in its associated target region and the CCF value at this alignment.

a data frame containing the translation (x,y) at which the CCF was maximized in aligning a target scan region to its associated reference scan cell.

Note

The FFT is not defined for matrices containing missing values. The missing values in the cell and region need to be replaced before using this function. See the comparison_replaceMissing function to replace missing values after standardization.

See also

Examples

data(fadul1.1_processed,fadul1.2_processed) cellTibble <- fadul1.1_processed %>% comparison_cellDivision(numCells = 64) %>% dplyr::mutate(regionHeightValues = comparison_getTargetRegions(cellHeightValues = cellHeightValues, target = fadul1.2_processed)) %>% dplyr::mutate(cellPropMissing = comparison_calcPropMissing(heightValues = cellHeightValues), regionPropMissing = comparison_calcPropMissing(heightValues = regionHeightValues)) %>% dplyr::filter(cellPropMissing <= .85 & regionPropMissing <= .85) %>% dplyr::mutate(cellHeightValues = comparison_standardizeHeights(heightValues = cellHeightValues), regionHeightValues = comparison_standardizeHeights(heightValues = regionHeightValues)) %>% dplyr::mutate(cellHeightValues = comparison_replaceMissing(heightValues = cellHeightValues), regionHeightValues = comparison_replaceMissing(heightValues = regionHeightValues)) %>% dplyr::mutate(fft_ccf_df = comparison_fft_ccf(cellHeightValues, regionHeightValues)) cellTibble %>% tidyr::unnest(cols = fft_ccf_df) %>% head()
#> # A tibble: 6 x 8 #> cellIndex cellHeightValues regionHeightValues cellPropMissing regionPropMissi~ #> <chr> <named list> <named list> <dbl> <dbl> #> 1 8, 6 <x3p> <x3p> 0.833 0.808 #> 2 7, 7 <x3p> <x3p> 0.657 0.700 #> 3 7, 8 <x3p> <x3p> 0.834 0.757 #> 4 6, 8 <x3p> <x3p> 0.353 0.638 #> 5 5, 8 <x3p> <x3p> 0.153 0.576 #> 6 4, 1 <x3p> <x3p> 0.117 0.767 #> # ... with 3 more variables: fft_ccf <dbl>, x <dbl>, y <dbl>