docstr: Return the minimization function
docstr_tok: ["Return","the","minimization","function"]
code: def set_fmin(self, optimizer, stepsize, **kwargs):
      """
      Return the minimization function
      """
      self.stepsize = stepsize
      self.optimizer = optimizer
      self.optimizer_kwargs = kwargs
      self.optimizer_kwargs.setdefault("xtol", XTOL)
      self.optimizer_kwargs.setdefault("ftol", FTOL)
      self.optimizer_kwargs.setdefault("gtol", GTOL)
      self.optimizer_kwargs.setdefault("maxiter", MAXITER)
      self.optimizer_kwargs.setdefault("maxfun", MAXFUN)
      self.use_derivatives = use_derivatives(self.optimizer)
  
imports: import os
  import warnings
  import numpy
  from nibabel import io_orientation
  from nibabel.affines import apply_affine
  from ...core.image.image_spaces import as_xyz_image, make_xyz_image, xyz_affine
  from ...io.nibcompat import get_header
  from ..slicetiming import timefuncs
  from ._registration import _cspline_sample3d, _cspline_sample4d, _cspline_transform
  from .affine import Affine, Rigid
  from .optimizer import configure_optimizer, use_derivatives
  from .type_check import check_type, check_type_and_shape
label_desc: Use image node_id 4 for calling the Realign4dAlgorithm obj's underlying member method code with example usage: obj.set_fmin(optimizer, stepsize) without return types