class_docstr: A class to represent a generic intensity-based image registration
  algorithm.
class_docstr_tok: ["A","class","to","represent","a","generic","intensity-based","image","registration","algorithm","."]
code: def _set_similarity(self, similarity, renormalize=False, dist=None):
      if similarity in _sms:
          if similarity == "slr":
              if dist is None:
                  raise ValueError(
                      "slr measure requires a joint intensity distribution model, "
                      "see `dist` argument of HistogramRegistration"
                  )
              if dist.shape != self._joint_hist.shape:
                  raise ValueError(
                      "Wrong shape for the `dist` argument"
                  )
          self._similarity = similarity
          self._similarity_call = _sms[similarity](
              self._joint_hist.shape, renormalize, dist
          )
      else:
          if not hasattr(similarity, "__call__"):
              raise ValueError("similarity should be callable")
          self._similarity = "custom"
          self._similarity_call = similarity
  
imports: import numpy
  import scipy.ndimage
  from ...core.image.image_spaces import as_xyz_image, make_xyz_image, xyz_affine
  from ._registration import _joint_histogram
  from .affine import affine_transforms, inverse_affine, subgrid_affine
  from .chain_transform import ChainTransform
  from .optimizer import configure_optimizer
  from .similarity_measures import similarity_measures
label_desc: Use image node_id 7 for calling the HistogramRegistration obj's underlying member method code with example usage: obj._set_similarity(similarity, renormalize, dist) without return types