Skip to content

vlt.image.spatialPowerSpectralDensityNullShuffle

  SPATIALPOWERSPECTRALDENSITYNULLSHUFFLE - Generates a null distribution for a 1D power spectrum by shuffling pixels.

    [SF, POWER_DIST] = vlt.image.spatialPowerSpectralDensityNullShuffle(IMAGE, Name, Value, ...)

    Calculates a null distribution for a 1D radially-averaged power spectrum
    by shuffling the non-NaN pixels in the image. This method creates surrogate
    images that have the same pixel intensity distribution as the original image,
    but with the spatial structure destroyed. This function uses the Parallel
    Computing Toolbox.

    NaN values in the original image remain as NaN values in the surrogate images.

    Inputs:
      IMAGE          - A 2D matrix (e.g., an image) of double-precision values.

    Name-Value Pairs:
      'num_shuffles'  - The number of surrogate images to generate for the
                        null distribution. (Default: 1000)
      'meters_per_pixel' - The physical size of each pixel in meters. (Passed to
                        vlt.image.spatialPowerSpectralDensity). (Default: 1)
      'mask'          - A logical matrix of the same size as IMAGE. Pixels
                        where the mask is `false` are excluded (set to NaN).
      'window'        - Windowing function to apply. (Passed to
                        vlt.image.spatialPowerSpectralDensity). ('hanning' or 'none').
                        (Default: 'hanning')
      'fft_padding_factor' - Factor to increase FFT resolution. (Passed to
                        vlt.image.spatialPowerSpectralDensity). (Default: 1)
      'verbose'       - If true, prints progress every 10 simulations.
                        (Default: true)

    Outputs:
      spatialFrequency - A 1D vector of the spatial frequency axis (cycles/meter).
      power_distribution - A [num_freq_bins x num_shuffles] matrix where each
                           column is the 1D power spectrum of a single
                           pixel-shuffled surrogate image.