code: def main():
      args = parser.parse_args()
  
      if args.save_path == "none":
          save_path = op.split(args.input)[0]
      else:
          save_path = args.save_path
  
      xform = reg.space_time_realign(
          args.input,
          float(args.TR),
          slice_order=args.slice_order,
          slice_dim=int(args.slice_dim),
          slice_dir=int(args.slice_dir),
          # We always apply the xform in the cli
          apply=True,
          make_figure=args.make_figure,
          out_name=save_path,
      )
  
      if args.save_params:
          f = open(op.join(save_path, "mc.par"), "w")
          for x in xform:
              euler_rot = reg.aff2euler(x.as_affine())
              for r in euler_rot:
                  f.write(f"{r}\t")
              for t in x.translation[:-1]:
                  f.write(f"{t}\t")
              f.write(f"{x.translation[-1]}\n")
          f.close()
  
imports: import argparse
  import os.path
  import nipy.algorithms.registration
label_desc: Use image node_id 1 for calling a global function with example usage: main() without return types