class_docstr: Benchmarks for registration.phase_cross_correlation in scikit-image
class_docstr_tok: ["Benchmarks","for","registration.phase_cross_correlation","in","scikit-image"]
code: def setup(self, ndims, image_size, upsample_factor, dtype, *args):
      if phase_cross_correlation is None:
          raise NotImplementedError(
              "phase_cross_correlation unavailable"
          )
      shifts = (-2.3, 1.7, 5.4, -3.2)[:ndims]
      phantom = img_as_float(
          data.binary_blobs(length=image_size, n_dim=ndims)
      )
      self.reference_image = np.fft.fftn(phantom).astype(
          dtype, copy=False
      )
      self.shifted_image = ndi.fourier_shift(
          self.reference_image, shifts
      )
      self.shifted_image = self.shifted_image.astype(dtype, copy=False)
  
file_path: scikit-image/benchmarks/benchmark_registration.py
imports: import numpy
  from scipy import ndimage
  from skimage.color import rgb2gray
  from skimage import data, img_as_float
label_desc: Use image node_id 1 for calling the PhaseCrossCorrelationRegistration obj's underlying member method code with example usage: obj.setup(ndims, image_size, upsample_factor, dtype) without return types