docs: def get_default_params(type='BSPLINE'):
      """ get_default_params(type='BSPLINE')
      
      Get `Parameters` struct with parameters that users may want to tweak.
      The given `type` specifies the type of allowed transform, and can
      be 'RIGID', 'AFFINE', 'BSPLINE'.
      
      For detail on what parameters are available and how they should be used,
      we refer to the Elastix documentation. Here is a description of the
      most common parameters:
      
      * Transform (str):
          Can be 'BSplineTransform', 'EulerTransform', or
          'AffineTransform'. The transformation to apply. Chosen based on `type`.
      * FinalGridSpacingInPhysicalUnits (int):
          When using the BSplineTransform, the final spacing of the grid.
          This controls the smoothness of the final deformation.
      * AutomaticScalesEstimation (bool):
          When using a rigid or affine transform. Scales the affine matrix
          elements compared to the translations, to make sure they are in
          the same range. In general, it's best to use automatic scales
          estimation.
      * AutomaticTransformInitialization (bool):
          When using a rigid or affine transform. Automatically guess an
          initial translation by aligning the geometric centers of the 
          fixed and moving.
      * NumberOfResolutions (int):
          Most registration algorithms adopt a multiresolution approach
          to direct the solution towards a global optimum and to speed
          up the process. This parameter specifies the number of scales
          to apply the registration at. (default 4)
      * MaximumNumberOfIterations (int):
          Maximum number of iterations in each resolution level.
          200-2000 works usually fine for nonrigid registration.
          The more, the better, but the longer computation time.
          This is an important parameter! (default 500).
      """
      
      # Init
      p = Parameters()
      type = type.upper()
      
      
      # ===== Metric to use =====
      p.Metric = 'AdvancedMattesMutualInformation'
      
      # Number of grey level bins in each resolution level,
      # for the mutual information. 16 or 32 usually works fine.
      # sets default value for NumberOf[Fixed/Moving]HistogramBins
      p.NumberOfHistogramBins = 32
      
      # Taking samples for mutual information
      p.ImageSampler = 'RandomCoordinate'
      p.NumberOfSpatialSamples = 2048
      p.NewSamplesEveryIteration = True
      
      
      # ====== Transform to use ======
      
      # The number of levels in the image pyramid
      p.NumberOfResolutions = 4
      
      if type in ['B', 'BSPLINE', 'B-SPLINE']:
          
          # Bspline transform
          p.Transform = 'BSplineTransform'
          
          # The final grid spacing (at the smallest level)
          p.FinalGridSpacingInPhysicalUnits = 16
      
      if type in ['RIGID', 'EULER', 'AFFINE']:
          
          # Affine or Euler transform
          if type in ['RIGID', 'EULER']:
              p.Transform = 'EulerTransform'
          else:
              p.Transform = 'AffineTransform'
          
          # Scales the affine matrix elements compared to the translations, 
          # to make sure they are in the same range. In general, it's best to
          # use automatic scales estimation.
          p.AutomaticScalesEstimation = True
          
          # Automatically guess an initial translation by aligning the
          # geometric centers of the fixed and moving.
          p.AutomaticTransformInitialization = True
      
      
      # ===== Optimizer to use =====
      p.Optimizer = 'AdaptiveStochasticGradientDescent'
      
      # Maximum number of iterations in each resolution level:
      # 200-2000 works usually fine for nonrigid registration.
      # The more, the better, but the longer computation time.
      # This is an important parameter!
      p.MaximumNumberOfIterations = 500
      
      # The step size of the optimizer, in mm. By default the voxel size is used.
      # which usually works well. In case of unusual high-resolution images
      # (eg histology) it is necessary to increase this value a bit, to the size
      # of the "smallest visible structure" in the image:
      #p.MaximumStepLength = 1.0 Default uses voxel spaceing
      
      # Another optional parameter for the AdaptiveStochasticGradientDescent
      #p.SigmoidInitialTime = 4.0
      
      
      # ===== Also interesting parameters =====
      
      #p.FinalGridSpacingInVoxels = 16
      #p.GridSpacingSchedule = [4.0, 4.0, 2.0, 1.0]
      #p.ImagePyramidSchedule = [8 8  4 4  2 2  1 1]
      #p.ErodeMask = "false"
      
      # Done
      return p