original_docstring: Performs particle tracking on input video.
  
      Particle tracking is performed with the ImageJ plugin Trackmate. Outputs
      a csv file containing analysis settings and particle trajectories.
  
      Parameters
      ----------
      target : str
          Full path to a tif file to do tracking on. Can also be a URL
          (e.g., 'http://fiji.sc/samples/FakeTracks.tif')
      out_file : str
          Full path to a csv file to store the results.
      template : str, optional
          The full path of a template for tracking. Defaults to use
          `data/trackmate_template.py` stored in the diff_classifier source-code.
      fiji_bin : str
          The full path to ImageJ executable file. Includes default search
          locations for Mac and Linux systems.
      radius : float
          Estimated radius of particles in image.
      threshold : float
          Threshold value for particle detection step.
      do_median_filtering : bool
          If True, performs a median filter on video prior to tracking.
      quality : float
          Lower quality cutoff value for particle filtering.
      xdims : tuple of int
          Upper and lower x limits for particle filtering.
      ydims : tuple of int
          Upper and lower y limits for particle filtering.
      median_intensity : float
          Lower median intensity cutoff value for particle filtering.
      snr : float
          Lower signal to noise ratio cutoff value for particle filtering.
      limking_max_distance : float
          Maximum allowable distance in pixels between two frames to join
          particles in track.
      gap_closing_max_distance : float
          Maximum allowable distance in pixels between more than two frames to
          join particles in track.
      max_frame_gap : int
          Maximum allowable number of frames a particle is allowed to leave video
          and be counted as same trajectory.
      track_duration : float
          Lower duration cutoff in frames for trajectory filtering.
  
      
docstring: Performs particle tracking on input video.
  Particle tracking is performed with the ImageJ plugin Trackmate. Outputs
  a csv file containing analysis settings and particle trajectories.
  
  Parameters
  
  target : str
  Full path to a tif file to do tracking on. Can also be a URL
  
  out_file : str
  Full path to a csv file to store the results.
  template : str, optional
  The full path of a template for tracking. Defaults to use
  `data/trackmate_template.py` stored in the diff_classifier source-code.
  fiji_bin : str
  The full path to ImageJ executable file. Includes default search
  locations for Mac and Linux systems.
  radius : float
  Estimated radius of particles in image.
  threshold : float
  Threshold value for particle detection step.
  do_median_filtering : bool
  If True, performs a median filter on video prior to tracking.
  quality : float
  Lower quality cutoff value for particle filtering.
  xdims : tuple of int
  Upper and lower x limits for particle filtering.
  ydims : tuple of int
  Upper and lower y limits for particle filtering.
  median_intensity : float
  Lower median intensity cutoff value for particle filtering.
  snr : float
  Lower signal to noise ratio cutoff value for particle filtering.
  limking_max_distance : float
  Maximum allowable distance in pixels between two frames to join
  particles in track.
  gap_closing_max_distance : float
  Maximum allowable distance in pixels between more than two frames to
  join particles in track.
  max_frame_gap : int
  Maximum allowable number of frames a particle is allowed to leave video
  and be counted as same trajectory.
  track_duration : float
  Lower duration cutoff in frames for trajectory filtering.
docstring_tokens: Performs particle tracking on input video . Particle tracking is performed with the ImageJ plugin Trackmate . Outputs a csv file containing analysis settings and particle trajectories . Parameters target : str Full path to a tif file to do tracking on . Can also be a URL out_file : str Full path to a csv file to store the results . template : str optional The full path of a template for tracking . Defaults to use ` data / trackmate_template . py ` stored in the diff_classifier source - code . fiji_bin : str The full path to ImageJ executable file . Includes default search locations for Mac and Linux systems . radius : float Estimated radius of particles in image . threshold : float Threshold value for particle detection step . do_median_filtering : bool If True performs a median filter on video prior to tracking . quality : float Lower quality cutoff value for particle filtering . xdims : tuple of int Upper and lower x limits for particle filtering . ydims : tuple of int Upper and lower y limits for particle filtering . median_intensity : float Lower median intensity cutoff value for particle filtering . snr : float Lower signal to noise ratio cutoff value for particle filtering . limking_max_distance : float Maximum allowable distance in pixels between two frames to join particles in track . gap_closing_max_distance : float Maximum allowable distance in pixels between more than two frames to join particles in track . max_frame_gap : int Maximum allowable number of frames a particle is allowed to leave video and be counted as same trajectory . track_duration : float Lower duration cutoff in frames for trajectory filtering .
code: def track(target, out_file, template=None, fiji_bin=None,
            tparams=None):
      """Performs particle tracking on input video.
  
      Particle tracking is performed with the ImageJ plugin Trackmate. Outputs
      a csv file containing analysis settings and particle trajectories.
  
      Parameters
      ----------
      target : str
          Full path to a tif file to do tracking on. Can also be a URL
          (e.g., 'http://fiji.sc/samples/FakeTracks.tif')
      out_file : str
          Full path to a csv file to store the results.
      template : str, optional
          The full path of a template for tracking. Defaults to use
          `data/trackmate_template.py` stored in the diff_classifier source-code.
      fiji_bin : str
          The full path to ImageJ executable file. Includes default search
          locations for Mac and Linux systems.
      radius : float
          Estimated radius of particles in image.
      threshold : float
          Threshold value for particle detection step.
      do_median_filtering : bool
          If True, performs a median filter on video prior to tracking.
      quality : float
          Lower quality cutoff value for particle filtering.
      xdims : tuple of int
          Upper and lower x limits for particle filtering.
      ydims : tuple of int
          Upper and lower y limits for particle filtering.
      median_intensity : float
          Lower median intensity cutoff value for particle filtering.
      snr : float
          Lower signal to noise ratio cutoff value for particle filtering.
      limking_max_distance : float
          Maximum allowable distance in pixels between two frames to join
          particles in track.
      gap_closing_max_distance : float
          Maximum allowable distance in pixels between more than two frames to
          join particles in track.
      max_frame_gap : int
          Maximum allowable number of frames a particle is allowed to leave video
          and be counted as same trajectory.
      track_duration : float
          Lower duration cutoff in frames for trajectory filtering.
  
      """
  
      tdefault = {'frames': 651, 'radius': 3.0, 'threshold': 0.0,
                  'do_median_filtering': False, 'quality': 15.0,
                  'xdims': (0, 511), 'ydims': (1, 511),
                  'median_intensity': 300.0,
                  'snr': 0.0, 'linking_max_distance': 6.0,
                  'gap_closing_max_distance': 10.0,
                  'max_frame_gap': 3, 'track_duration': 20.0,
                  'detector': 'Dog'}
  
      if tparams is None:
          tparams = {}
  
      for key, value in tdefault.items():
          if key not in tparams:
              tparams[key] = value
  
      if template is None:
          template = op.join(op.split(dc.__file__)[0],
                             'data',
                             'trackmate_template3.py')
  
      fiji_bin = _get_fiji()
  
      script = ''.join(open(template).readlines())
      tpfile = tempfile.NamedTemporaryFile(suffix=".py")
      fid = open(tpfile.name, 'w')
      fid.write(script.format(target_file=target, frames=str(tparams['frames']),
                              radius=str(tparams['radius']),
                              threshold=str(tparams['threshold']),
                              do_median_filtering=str(tparams['do_median_filtering']),
                              quality=str(tparams['quality']),
                              xd=str(tparams['xdims'][1]),
                              yd=str(tparams['ydims'][1]),
                              ylo=str(tparams['ydims'][0]),
                              median_intensity=str(tparams['median_intensity']),
                              snr=str(tparams['snr']),
                              linking_max_distance=str(tparams['linking_max_distance']),
                              gap_closing_max_distance=str(tparams['gap_closing_max_distance']),
                              max_frame_gap=str(tparams['max_frame_gap']),
                              track_duration=str(tparams['track_duration']),
                              set_detector=str(tparams['detector'])))
      fid.close()
  
      cmd = "%s --ij2 --headless --run %s" % (fiji_bin, tpfile.name)
      print(cmd)
      subp = subprocess.run(cmd, stdout=subprocess.PIPE, shell=True)
      fid = open(out_file, 'w')
      fid.write(subp.stdout.decode())
      #print(subp.stdout.decode())
      fid.close()
code_tokens: def track ( target , out_file , template = None , fiji_bin = None , tparams = None ) : tdefault = { 'frames' : 651 , 'radius' : 3.0 , 'threshold' : 0.0 , 'do_median_filtering' : False , 'quality' : 15.0 , 'xdims' : ( 0 , 511 ) , 'ydims' : ( 1 , 511 ) , 'median_intensity' : 300.0 , 'snr' : 0.0 , 'linking_max_distance' : 6.0 , 'gap_closing_max_distance' : 10.0 , 'max_frame_gap' : 3 , 'track_duration' : 20.0 , 'detector' : 'Dog' } if tparams is None : tparams = { } for key , value in tdefault . items ( ) : if key not in tparams : tparams [ key ] = value if template is None : template = op . join ( op . split ( dc . __file__ ) [ 0 ] , 'data' , 'trackmate_template3.py' ) fiji_bin = _get_fiji ( ) script = '' . join ( open ( template ) . readlines ( ) ) tpfile = tempfile . NamedTemporaryFile ( suffix = ".py" ) fid = open ( tpfile . name , 'w' ) fid . write ( script . format ( target_file = target , frames = str ( tparams [ 'frames' ] ) , radius = str ( tparams [ 'radius' ] ) , threshold = str ( tparams [ 'threshold' ] ) , do_median_filtering = str ( tparams [ 'do_median_filtering' ] ) , quality = str ( tparams [ 'quality' ] ) , xd = str ( tparams [ 'xdims' ] [ 1 ] ) , yd = str ( tparams [ 'ydims' ] [ 1 ] ) , ylo = str ( tparams [ 'ydims' ] [ 0 ] ) , median_intensity = str ( tparams [ 'median_intensity' ] ) , snr = str ( tparams [ 'snr' ] ) , linking_max_distance = str ( tparams [ 'linking_max_distance' ] ) , gap_closing_max_distance = str ( tparams [ 'gap_closing_max_distance' ] ) , max_frame_gap = str ( tparams [ 'max_frame_gap' ] ) , track_duration = str ( tparams [ 'track_duration' ] ) , set_detector = str ( tparams [ 'detector' ] ) ) ) fid . close ( ) cmd = "%s --ij2 --headless --run %s" % ( fiji_bin , tpfile . name ) print ( cmd ) subp = subprocess . run ( cmd , stdout = subprocess . PIPE , shell = True ) fid = open ( out_file , 'w' ) fid . write ( subp . stdout . decode ( ) ) fid . close ( )
short_docstring: Performs particle tracking on input video.
short_docstring_tokens: Performs particle tracking on input video .
comment: """Performs particle tracking on input video.
  
      Particle tracking is performed with the ImageJ plugin Trackmate. Outputs
      a csv file containing analysis settings and particle trajectories.
  
      Parameters
      ----------
      target : str
          Full path to a tif file to do tracking on. Can also be a URL
          (e.g., 'http://fiji.sc/samples/FakeTracks.tif')
      out_file : str
          Full path to a csv file to store the results.
      template : str, optional
          The full path of a template for tracking. Defaults to use
          `data/trackmate_template.py` stored in the diff_classifier source-code.
      fiji_bin : str
          The full path to ImageJ executable file. Includes default search
          locations for Mac and Linux systems.
      radius : float
          Estimated radius of particles in image.
      threshold : float
          Threshold value for particle detection step.
      do_median_filtering : bool
          If True, performs a median filter on video prior to tracking.
      quality : float
          Lower quality cutoff value for particle filtering.
      xdims : tuple of int
          Upper and lower x limits for particle filtering.
      ydims : tuple of int
          Upper and lower y limits for particle filtering.
      median_intensity : float
          Lower median intensity cutoff value for particle filtering.
      snr : float
          Lower signal to noise ratio cutoff value for particle filtering.
      limking_max_distance : float
          Maximum allowable distance in pixels between two frames to join
          particles in track.
      gap_closing_max_distance : float
          Maximum allowable distance in pixels between more than two frames to
          join particles in track.
      max_frame_gap : int
          Maximum allowable number of frames a particle is allowed to leave video
          and be counted as same trajectory.
      track_duration : float
          Lower duration cutoff in frames for trajectory filtering.
  
      """$SEP$#print(subp.stdout.decode())