docstr: Workflow for Local Fiber Tracking.
  
  This workflow use a saved peaks and metrics (PAM) file as input.
  
  Parameters
  ----------
  pam_files : string
     Path to the peaks and metrics files. This path may contain
      wildcards to use multiple masks at once.
  stopping_files : string
      Path to images (e.g. FA) used for stopping criterion for tracking.
  seeding_files : string
      A binary image showing where we need to seed for tracking.
  use_binary_mask : bool, optional
      If True, uses a binary stopping criterion. If the provided
      `stopping_files` are not binary, `stopping_thr` will be used to
      binarize the images.
  stopping_thr : float, optional
      Threshold applied to stopping volume's data to identify where
      tracking has to stop.
  seed_density : int, optional
      Number of seeds per dimension inside voxel.
       For example, seed_density of 2 means 8 regularly distributed
       points in the voxel. And seed density of 1 means 1 point at the
       center of the voxel.
  step_size : float, optional
      Step size (in mm) used for tracking.
  tracking_method : string, optional
      Select direction getter strategy :
       - "eudx" (Uses the peaks saved in the pam_files)
       - "deterministic" or "det" for a deterministic tracking
         (Uses the sh saved in the pam_files, default)
       - "probabilistic" or "prob" for a Probabilistic tracking
         (Uses the sh saved in the pam_files)
       - "closestpeaks" or "cp" for a ClosestPeaks tracking
         (Uses the sh saved in the pam_files)
  pmf_threshold : float, optional
      Threshold for ODF functions.
  max_angle : float, optional
      Maximum angle between streamline segments (range [0, 90]).
  out_dir : string, optional
     Output directory. (default current directory)
  out_tractogram : string, optional
     Name of the tractogram file to be saved.
  save_seeds : bool, optional
      If true, save the seeds associated to their streamline
      in the 'data_per_streamline' Tractogram dictionary using
      'seeds' as the key.
  
  References
  ----------
  Garyfallidis, University of Cambridge, PhD thesis 2012.
  Amirbekian, University of California San Francisco, PhD thesis 2017.
docstr_tok: ["Workflow","for","Local","Fiber","Tracking",".","This","workflow","use","a","saved","peaks","and","metrics","(","PAM",")","file","as","input",".","Parameters","--","--","--","--","--","pam_files",":","string","Path","to","the","peaks","and","metrics","files",".","This","path","may","contain","wildcards","to","use","multiple","masks","at","once",".","stopping_files",":","string","Path","to","images","(","e.g",".","FA",")","used","for","stopping","criterion","for","tracking",".","seeding_files",":","string","A","binary","image","showing","where","we","need","to","seed","for","tracking",".","use_binary_mask",":","bool",",","optional","If","True",",","uses","a","binary","stopping","criterion",".","If","the","provided","`","stopping_files","`","are","not","binary",",","`","stopping_thr","`","will","be","used","to","binarize","the","images",".","stopping_thr",":","float",",","optional","Threshold","applied","to","stopping","volume","'s","data","to","identify","where","tracking","has","to","stop",".","seed_density",":","int",",","optional","Number","of","seeds","per","dimension","inside","voxel",".","For","example",",","seed_density","of","2","means","8","regularly","distributed","points","in","the","voxel",".","And","seed","density","of","1","means","1","point","at","the","center","of","the","voxel",".","step_size",":","float",",","optional","Step","size","(","in","mm",")","used","for","tracking",".","tracking_method",":","string",",","optional","Select","direction","getter","strategy",":","-","``","eudx","''","(","Uses","the","peaks","saved","in","the","pam_files",")","-","``","deterministic","''","or","``","det","''","for","a","deterministic","tracking","(","Uses","the","sh","saved","in","the","pam_files",",","default",")","-","``","probabilistic","''","or","``","prob","''","for","a","Probabilistic","tracking","(","Uses","the","sh","saved","in","the","pam_files",")","-","``","closestpeaks","''","or","``","cp","''","for","a","ClosestPeaks","tracking","(","Uses","the","sh","saved","in","the","pam_files",")","pmf_threshold",":","float",",","optional","Threshold","for","ODF","functions",".","max_angle",":","float",",","optional","Maximum","angle","between","streamline","segments","(","range","[","0",",","90","]",")",".","out_dir",":","string",",","optional","Output","directory",".","(","default","current","directory",")","out_tractogram",":","string",",","optional","Name","of","the","tractogram","file","to","be","saved",".","save_seeds",":","bool",",","optional","If","true",",","save","the","seeds","associated","to","their","streamline","in","the","'data_per_streamline","'","Tractogram","dictionary","using","'seeds","'","as","the","key",".","References","--","--","--","--","--","Garyfallidis",",","University","of","Cambridge",",","PhD","thesis","2012",".","Amirbekian",",","University","of","California","San","Francisco",",","PhD","thesis","2017","."]
code: def run(
      self,
      pam_files,
      stopping_files,
      seeding_files,
      use_binary_mask=False,
      stopping_thr=0.2,
      seed_density=1,
      step_size=0.5,
      tracking_method="eudx",
      pmf_threshold=0.1,
      max_angle=30.0,
      out_dir="",
      out_tractogram="tractogram.trk",
      save_seeds=False,
  ):
      """Workflow for Local Fiber Tracking.
  
      This workflow use a saved peaks and metrics (PAM) file as input.
  
      Parameters
      ----------
      pam_files : string
         Path to the peaks and metrics files. This path may contain
          wildcards to use multiple masks at once.
      stopping_files : string
          Path to images (e.g. FA) used for stopping criterion for tracking.
      seeding_files : string
          A binary image showing where we need to seed for tracking.
      use_binary_mask : bool, optional
          If True, uses a binary stopping criterion. If the provided
          `stopping_files` are not binary, `stopping_thr` will be used to
          binarize the images.
      stopping_thr : float, optional
          Threshold applied to stopping volume's data to identify where
          tracking has to stop.
      seed_density : int, optional
          Number of seeds per dimension inside voxel.
           For example, seed_density of 2 means 8 regularly distributed
           points in the voxel. And seed density of 1 means 1 point at the
           center of the voxel.
      step_size : float, optional
          Step size (in mm) used for tracking.
      tracking_method : string, optional
          Select direction getter strategy :
           - "eudx" (Uses the peaks saved in the pam_files)
           - "deterministic" or "det" for a deterministic tracking
             (Uses the sh saved in the pam_files, default)
           - "probabilistic" or "prob" for a Probabilistic tracking
             (Uses the sh saved in the pam_files)
           - "closestpeaks" or "cp" for a ClosestPeaks tracking
             (Uses the sh saved in the pam_files)
      pmf_threshold : float, optional
          Threshold for ODF functions.
      max_angle : float, optional
          Maximum angle between streamline segments (range [0, 90]).
      out_dir : string, optional
         Output directory. (default current directory)
      out_tractogram : string, optional
         Name of the tractogram file to be saved.
      save_seeds : bool, optional
          If true, save the seeds associated to their streamline
          in the 'data_per_streamline' Tractogram dictionary using
          'seeds' as the key.
  
      References
      ----------
      Garyfallidis, University of Cambridge, PhD thesis 2012.
      Amirbekian, University of California San Francisco, PhD thesis 2017.
  
      """
      io_it = self.get_io_iterator()
  
      for pams_path, stopping_path, seeding_path, out_tract in io_it:
          logging.info("Local tracking on {0}".format(pams_path))
  
          pam = load_peaks(pams_path, verbose=False)
          dg = self._get_direction_getter(
              tracking_method,
              pam,
              pmf_threshold=pmf_threshold,
              max_angle=max_angle,
          )
  
          self._core_run(
              stopping_path,
              use_binary_mask,
              stopping_thr,
              seeding_path,
              seed_density,
              step_size,
              dg,
              out_tract,
              save_seeds,
          )
  
file_path: dipy/dipy/workflows/tracking.py
imports: import logging
  from dipy.direction import DeterministicMaximumDirectionGetter, ProbabilisticDirectionGetter, ClosestPeakDirectionGetter
  from dipy.io.image import load_nifti
  from dipy.io.peaks import load_peaks
  from dipy.io.stateful_tractogram import Space, StatefulTractogram
  from dipy.io.streamline import save_tractogram
  from dipy.tracking import utils
  from dipy.tracking.local_tracking import LocalTracking, ParticleFilteringTracking
  from dipy.tracking.stopping_criterion import BinaryStoppingCriterion, CmcStoppingCriterion, ThresholdStoppingCriterion
  from dipy.workflows.workflow import Workflow
label_desc: Use image node_id 4 for calling the LocalFiberTrackingPAMFlow obj's underlying member method code with example usage: obj.run(pam_files, stopping_files, seeding_files, use_binary_mask, stopping_thr, seed_density, step_size, tracking_method, pmf_threshold, max_angle, out_dir, out_tractogram, save_seeds) without return types