docstr: Assign the methods to be called according to the image dimension
  
  Assigns the appropriate functions to be called for image quantization,
  statistics computation and multi-resolution iterations according to the
  dimension of the input images
docstr_tok: ["Assign","the","methods","to","be","called","according","to","the","image","dimension","Assigns","the","appropriate","functions","to","be","called","for","image","quantization",",","statistics","computation","and","multi-resolution","iterations","according","to","the","dimension","of","the","input","images"]
code: def _connect_functions(self):
      r"""Assign the methods to be called according to the image dimension
  
      Assigns the appropriate functions to be called for image quantization,
      statistics computation and multi-resolution iterations according to the
      dimension of the input images
      """
      if self.dim == 2:
          self.quantize = em.quantize_positive_2d
          self.compute_stats = em.compute_masked_class_stats_2d
          self.reorient_vector_field = vfu.reorient_vector_field_2d
      elif self.dim == 3:
          self.quantize = em.quantize_positive_3d
          self.compute_stats = em.compute_masked_class_stats_3d
          self.reorient_vector_field = vfu.reorient_vector_field_3d
      else:
          raise ValueError(
              "EM Metric not defined for dim. %d" % self.dim
          )
  
      if self.step_type == "demons":
          self.compute_step = self.compute_demons_step
      elif self.step_type == "gauss_newton":
          self.compute_step = self.compute_gauss_newton_step
      else:
          raise ValueError("Opt. step %s not defined" % self.step_type)
  
imports: import abc
  import numpy
  from numpy import gradient
  from scipy import ndimage
  from dipy.align import vector_fields
  from dipy.align import sumsqdiff
  from dipy.align import crosscorr
  from dipy.align import expectmax
  from dipy.align import floating
label_desc: Use image node_id 2 for calling the EMMetric obj's underlying member method code with example usage: obj._connect_functions() without return types