docstr: Converts SH basis representation between DIPY and MRtrix3 formats.
  Because this conversion is equal to its own inverse, it can be used to
  convert in either direction: DIPY to MRtrix3 or vice versa.
  
  Parameters
  ----------
  input_files : string
      Path to the input files. This path may contain wildcards to
      process multiple inputs at once.
  
  out_dir : string, optional
      Where the resulting file will be saved. (default '')
  
  out_file : string, optional
      Name of the result file to be saved.
      (default 'sh_convert_dipy_mrtrix_out.nii.gz')
docstr_tok: ["Converts","SH","basis","representation","between","DIPY","and","MRtrix3","formats",".","Because","this","conversion","is","equal","to","its","own","inverse",",","it","can","be","used","to","convert","in","either","direction",":","DIPY","to","MRtrix3","or","vice","versa",".","Parameters","--","--","--","--","--","input_files",":","string","Path","to","the","input","files",".","This","path","may","contain","wildcards","to","process","multiple","inputs","at","once",".","out_dir",":","string",",","optional","Where","the","resulting","file","will","be","saved",".","(","default","``",")","out_file",":","string",",","optional","Name","of","the","result","file","to","be","saved",".","(","default","'sh_convert_dipy_mrtrix_out.nii.gz","'",")"]
code: def run(
      self,
      input_files,
      out_dir="",
      out_file="sh_convert_dipy_mrtrix_out.nii.gz",
  ):
      """Converts SH basis representation between DIPY and MRtrix3 formats.
      Because this conversion is equal to its own inverse, it can be used to
      convert in either direction: DIPY to MRtrix3 or vice versa.
  
      Parameters
      ----------
      input_files : string
          Path to the input files. This path may contain wildcards to
          process multiple inputs at once.
  
      out_dir : string, optional
          Where the resulting file will be saved. (default '')
  
      out_file : string, optional
          Name of the result file to be saved.
          (default 'sh_convert_dipy_mrtrix_out.nii.gz')
      """
  
      io_it = self.get_io_iterator()
  
      for in_file, out_file in io_it:
          data, affine, image = load_nifti(in_file, return_img=True)
          data = convert_sh_descoteaux_tournier(data)
          save_nifti(out_file, data, affine, image.header)
  
imports: import importlib
  import os
  import sys
  import logging
  from inspect import getmembers, isfunction
  import warnings
  import trx.trx_file_memmap
  import numpy
  from dipy.io.image import load_nifti, save_nifti
  from dipy.io.streamline import load_tractogram, save_tractogram
  from dipy.reconst.shm import convert_sh_descoteaux_tournier
  from dipy.tracking.streamlinespeed import length
  from dipy.utils.tractogram import concatenate_tractogram
  from dipy.workflows.workflow import Workflow
label_desc: Use image node_id 2 for calling the ConvertSHFlow obj's underlying member method code with example usage: obj.run(input_files, out_dir, out_file) without return types