Difference between revisions of "Software2"

From Wiki
Jump to navigation Jump to search
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
This subset of programs was primarily written by Dr. Lifshitz.  It is really better to examine the full list of BIG software [[Software | here]].
 +
 
== Visualization ==
 
== Visualization ==
  
Line 653: Line 655:
  
 
</nowiki>
 
</nowiki>
===  cellsimL ===
+
===  channel_current2 ===
 
  <nowiki>
 
  <nowiki>
[0]: in main, before MPI_Init()
+
channel_current2: like channel_current, but looks at [ca] over time at each BK (not just max [ca]).
[0]: in main, after MPI_Init()
+
From that, it calculates the max BK current. Channel_current adds the max [ca] that each BK voxel sees
[0]: /home/lml/krypton/bin/cellsimL -h
+
from each voxel in a Ryr cluster, to get the max [ca] that BK pixel sees. But the max [ca] could occur
help:
+
at different times since the Ryr cluster has a spatial extent.  Experimental.
unable to parse command: -h
 
    This program simulates Ca and Na in a cylindrical cell with
 
    cylindrical symmetry.  
 
    Note: It is recommended that the stderr output be examined for
 
          lines with the words: warning, Warning, error, or Error on them.
 
Usage
 
    cellsim [options] >& output_datafile
 
  
Options controlling the duration of the simulation:
+
Calculates the current which would be produced when each object in Ryr_image.i2i releases calcium which
    -time #:      total time to simulate (in sec), default = 0.000000
+
activates nearby BK channels in BK_image.i2i. Produces a histogram of these output currents.
    -time_rate #:  slow down time, ie take smaller dt steps during simulation.
+
The input images should have each pixel in an object having the object id as its value. These images can be
                    this may be necessary if you are creating a large ca gradient,
+
produced with "countobjs -Q" or "objs_via_ascent" 
                    for example, with -ca_ring or -ca_src options (.5 means 1/2 the dt).
+
note:  a one pixel border around the image is ignored (added 12/8/09).
                    The number of iterations needed for convergence is
+
This may take about one-half hour to run.
                    roughly: I= (T*diff)/(dr*dr), where T is time, dr is
+
 
                    annulus thickness and diff is diffusion constant.
+
Usage:
                    This ignores ion influx,etc.  If you set diffusion rates very
+
channel_current [options] -f filename Ryr_image.i2i BK_image.i2i > im1_im2.hist
                    small, the iter # calculated will be too small if other stuff
+
Options:
                    is happening, use -time_rate to compensate.
+
-f filename resting: file containing [ca], in nM, as a function of distance and time. Right now this is
+
assumed to have 20 nm spacing and entries every msec. See
Options controlling the geometry of the model:
+
/home/lml/krypton/Zhuge/STIC/simulations/run32.ca as an example
    -radius #:    radius of the cell in microns, default = 6.000000
+
"resting" is the resting [ca], in nM, for the cell. It will we subtracted from the other
    -rings #:     radius of the cell in rings, default = 60
+
[ca] values to produce a "delta" [ca] which gets scaled linearly by Ryr intensity.
                    Ring thickness = cell radius/ # of rings.
+
The spark current used to produce this (see -C) should be roughly in the range expected
    -length #:     length of the cell in disks, default = 300
+
for Ryr_image.i2i, since all delta [ca] is linearly extrapolated.
                    Each disk will be the same thickness as a ring.
+
All distances > largest distance in filename will have their [ca] set to the [ca]
    -bc Rmax Lmin Lmax:    boundary conditions at maximum radius and minimum and
+
at the largest distance in filename.
                    maximum length coordinate (i.e., at the cell ends). These must
+
note: Only the [ca] values at y == 1 are used. Is this what should be used?
                    be the letters I (for infinite) or S (for solid, i.e. no ions go
+
-u #: voltage (mV).  BK conductance is a function of voltage. default = -80.000000
                    through the membrane). The I option is not always accurate. default: S
+
-U low delta hi: voltages from low to hi by delta. Max is 20 voltages
    -mask image.i2i: only voxels in image.i2i > 0 are part of the cell.  Use this
+
-r #:         resolution (binsize) for output histogram in femtoAmps, default = 1000.000000
                    to specify an arbitrary shape for the cell.
+
-R #: reveral potential of BK channel in mV, default = -80.000000
                    Not extensively tested.
 
    -spacing file: file specifies the spacing along each axis (i.e, size of each voxel).
 
                    spacing is in nm, one entry per voxel, comment lines ignored (#).
 
                    The cell direction (X,Y, or Z) must be the first letter on the line.
 
                    Other characters on the line will be ignored.
 
                    The number of entries must be < 2000 each direction.
 
                    Do not specify -rings,-radius,and -length if you use this option.
 
                    NOTE: the simulation time step goes as (length)^2, where length is
 
                          the length of the shortest side of all the voxels specified.
 
                    Any number of entries per line. First R, then D (length). Example:
 
                    # R direction (10 pixels in this direction, high res at low R)
 
                    X
 
                    25 50 75 100 200 300 400 500 600 1000
 
                    Y (lengthwise) direction (9 pixels in D, very high res in the middle)
 
                    100 200 300 400 500 540 550 560 1000
 
                    Use cyl2cart with -spacing option to convert output images to
 
                    a uniform spacing. (I haven't added that option yet)
 
                    Not extensively tested.
 
  
Options specifying substances (ions, buffers, compounds) present in the model (10 max):
+
  distances:
    -ion name free_concentration D valence:  
+
-w # # #: x,y, zweights for pixel distances (ie, pixel size), default = 1 for each.
                    concentration in mMolar, D in cm^2/sec, valence in absolute value.
+
-p #: pixel size in nm (i.e., what 1 means in -w option), default = 80.000000
                    valence is only used if -ion_src is also specified.
+
-m # :         maxdistance (in units used for -w, i.e., pixels) to look for the closest pixel, default = 10.000000
                    concentration is the initial free concentration.
 
    -buffer name total_concentration D:  
 
                    concentration in mMolar, D in cm^2/sec.
 
                    concentration is the initial total concentration (sum of its free and all bound forms).
 
    -kin bufname ionname boundname onrate offrate D:
 
                    kinetics for interaction between bufname and ionname. Boundname is the
 
                    name to give the bound pair.  bufname and ionname must have been
 
                    specified (with -ion -buffer or -kin options) prior to this option.
 
                    onrate:in 1/(mMolar*seconds), offrate: in 1/seconds, D: in cm^2/sec 
 
    -equil_error relerr iter: maximum relative equilibrium error allowed during the
 
                    initial calculation of concentrations from the user specified
 
                    free ion concentrations and total buffer concentrations.
 
                    rel_error = ABS((true_kd - calculated_kd)/true_kd). Default = 1e-05
 
                    This should be small enough unless you have huge buffer
 
                    concentrations (>100 mM?). iter (an int) is maximum number of iterations
 
                    to allow during equilibration, max =1 billion, default = 10000000
 
  
Options controlling changing conditions:
+
  which pixels or clusters to include:
    -ion_src name current dur lowdisk highdisk lowring highring:  
+
-t # #: image1 and image2 thresholds, pixels > # are above threshold, default = 0.
                    have a current source of the specified ion coming in through the specified rings
+
-e lowx lowy lowz hix hiy hiz:  only look at voxels within this extent (subvolume), 1-indexed, inclusive.
                    and numdisk (rings and disks are 0-indexed indices, inclusive).
+
-s minsize maxsize:     only look at objects in Ryr_image.i2i within the size range (inclusive, in voxels)
                    Current is in pA for the specified duration (sec).
+
max size allowed = 100000
                    The current is uniformly divided within the entire specified input volume.
+
-S minsize maxsize:     only look at objects in BK_image.i2i within the size range (inclusive, in voxels)
                    All -buffer and -ion options must be specified prior to this.
+
-i miniod maxiod:    only look at objects in Ryr_image.i2i within the iod range (inclusive. use -d also.)
                    See comments by the -time_rate option.
+
-I miniod maxiod:     only look at objects in BK_image.i2i within the iod range (inclusive. use -D also.)
    -ion_src_file name imagename current duration:
 
                    Similar to -ion_src, but the specified floating point image is used to
 
                    scale the input current at each voxel. The total current coming into the  
 
                    cell is adjusted so that after this per pixel rescaling, it will = "current".
 
                    -ion_current_trace with op = S, will modify this.
 
                    Typically do: int2float -M 1 psf.i2i imagename        prior to this.
 
    -ion_current_trace name filename dt op threshold:  modifies current specified with
 
                    the -ion_src or -ion_src_file options.
 
                    Times which the channel is open (i.e., current flows) is specified in a file.
 
                    The file is a list of numbers (current or scale), 1 per line, at dt (in sec) intervals.
 
                    If op = T, currents greater than the specified threshold means channel open, otherwise closed.
 
                    If op = S, the current as specified with -ion_src is scaled by the number in the list.
 
                    "threshold" is required but ignored when op = S.  Not extensively tested.  
 
    -zap_sub name time:
 
                    At the specified time (in seconds) set the named substance concentration
 
                    to 0. This does not prevent it from being produced from other reactions.
 
                    This is useful if an injected "ion" was photons (e.g., photon+caged -> uncaged)
 
                    and the laser is turned off at the specified time.
 
  
Options related to output:
+
  scale factors:
    -save name filename type scale dt:
+
-d Ryrimage1d.i2i #: the original intensity image for Ryr_image (since Ryr_image has pixel values as id numbers)
                    Save images of the specified substance (name) to specified file. By default
+
# is the number of Ryrimage1d.i2i intensity units required to produce spark current
                    substances are saved in mM.  This will be multiplied by the scale
+
used in the calcium simulation (which produced the -f filename data).
                    specified here. dt (in sec) is how often to save images. Type is I
+
This will scale the [ca] produced by each Ryr voxel. Default = 30000.000000
                    (short int, our normal format) or F (floating pt,2x space, more accurate).
+
-D BKimage2d.i2i #: the original intensity image for BK_image (since BK_image has pixel values as id numbers)
                    The first image saved will be prior to any ion current. The last image
+
# is the BKimage2d.i2i intensity from one BK channel.
                    will always be the end of the simulation. "name" should be as
+
This will scale current produced. Default = 1000.000000
                    specified with the -ion, -buffer or -kin option.
+
If you want the intensity of each Ryr or BK object to affect the ca release (for Ryr)
                    If the image file already exists, new images will postpended to it.
+
or number of channels (for BK) , you need to provide the original data by using the
    -save all tag type scale dt:
+
-d and -D options. Otherwise all voxels in an object contribute equally (so large objects
                    Equivalent to -save for all ions and buffers. Uses default file names,
+
have more receptors or channels than small ones).
                    but adds the tag on the end. ions in nM, all else in uM, then times scale.
+
-c #: BK single channel conductance in pS, default = 220.0
    -save_flow name rfilename lfilename scale dt:
+
-C #: peak current (in pAmps) used in the simulation to produce -f filename, default = 1.000000
                    Save flow images of the specified substance (name) to specified files.
+
This is just used for output produced by -v to estimate spark current produced per Ryr cluster.
                    rfile is radial flow, lfile is lengthwise flow. Images saved in floating pt.
+
 
                    Flow is in pA (1 pA = 3 molecules/usec) times scale.
+
  miscellaneous:
                    dt (in sec) is how often to save images. 
+
  -v: verbose. produces list of each Ryr cluster and K current produced to stderr. Other stuff too.
    -save_flow all ltag rtag scale dt:
+
To write this to a separate file do: (channel_current -v ... > stdout.channel) >& stderr.channel
                    Equivalent to -save_flow for all ions and buffers. Uses default file names,
+
  -V: very verbose
                    but adds the tag on the end. Output same scale as above.
 
                    NOTE: flow for EACH substance takes 8*(number of voxels) of space.
 
    -debug #:      set debug level to #. May substantially slow down the simulation.
 
                    1: extra print statements at init. 2: more testing while running. 3:
 
    -debug_subvolume #: Normally the total mmoles (in the entire cell) of each saved substance is
 
                    printed to stderr. Setting this option will also cause the printing of the
 
                    total over a subvolume. Subvolume is all y >= # (0-indexed).
 
                    Example: if a cell has patch region at y=[1,10], setting # to the neck (11) of the
 
                    patch will let you see how much actually gets out into the main part of the cell.
 
  
Options related to MPI (multiprocessor stuff):
+
Examples:
    invoke on the wolves as, for example,  mpirun -np 3 -machinefile file_of_machine_names cellsim ...
 
    -print_proc #:  only print output from the specified process (0 indexed).
 
                  Some output (eg, Total mmoles of ions, etc) are only valid for process 0.
 
    -overlap #:  overlap neighboring regions by the specified number of voxels (default = 50)
 
                  This will also be the number of iterations between necessary synchronization.
 
    -debug_mpi #:  print MPI info. Execute MPI dummy stubs if MPI NOT present (eg, under Windows,SGI).
 
                  This version of the executable does NOT use MPI.
 
    -debug_mpi_proc rank numproc:  set dummy rank and number of processes. use only if MPI NOT present!
 
  
EXAMPLES
+
cellsim -spacing /home/lml/krypton/Zhuge/STIC/simulations/spacing2.txt ....     : produces ca.i2i
./cellsim -time .0010 -time_rate .5 -length 200 -rings 40 -radius 1 \
+
printvalsL -spacing2.txt -R -t -i ca.i2i > ca.vals    
        -ion Ca 100E-6 2.5E-6 2 -buffer Fluo3 .050 2.5E-7 -buffer Buf .230 1E-14  \
+
kate ca.vals     : delete fist comment line
        -kin Fluo3 Ca CaFl 8E4 90 2.5E-7 -kin Buf Ca CaBuf 1E5 100 1E-14       \
+
       objs_via_ascent -s 5 100 Ryr.i2i Ryrid.i2i > tmp
        -ion_src Ca 1 .00105 99 102 0 3 \
+
tail tmp  : the mean IOD gives an idea of brightness needed to produce current used in cellsim, say 30000
        -save all _run1 I 1 .0001 >& cellsim_run1.out
+
      objs_via_ascent -s 5 100 BK.i2i BKid.i2i > tmp
 +
tail tmp  : the mean IOD gives an idea of brightness of a BK cluster, eg mean= 10000, but assume that's 10 channels
  
 +
channel_current -f ca.vals -w 1 1 3 -d Ryr.i2i 30000 -D BK.i2i 1000 Ryrid.i2i Bkid.i2i > ryr_bk.info
 +
cull -s -c -1 -4 < ryr_bk.info |xmgrace -source stdin
 +
See also:
 +
closest_object closest_voxel objs_via_ascent /home/lml/krypton/Zhuge/BKandRyr/graph.pl,match.pl
 +
graph_channel_current.pl, test_channel_current, /home/lml/krypton/Zhuge/STIC/simulations/run32 
 +
/home/lml/krypton/Zhuge/BKandRyr/analysis6/cluster_distances.pl, plot_mean_sd_curve.pl
 +
/home/lml/krypton/Zhuge/xpp/ASM15.ode
 +
Bugs:
  
Simulate for 100msec saving images every msec. 1 pA comes in the the pattern as specified
+
Source code in ~krypton/lml/facil 
by psf_float.i2i for 10 msec.  The current is then modulated by values in current.txt which
+
# Popen is monotonic as it should be.
are one value per line, dt of 1 msec between them. Cell shape in mask.i2i. Voxel sizes in
+
must provide -f cafilename
spacing.txt
 
./cellsim -time .100 -time_rate .5 -spacing spacing.txt -mask mask.i2i \
 
        -ion Ca 100E-6 2.5E-6 2 -buffer Fluo3 .050 2.5E-7 -buffer Buf .230 1E-14  \
 
        -kin Fluo3 Ca CaFl 8E4 90 2.5E-7 -kin Buf Ca CaBuf 1E5 100 1E-14        \
 
        -ion_src_file Ca psf_float.i2i 1 .010 \
 
        -ion_current_trace Ca current.txt .001 S 999 \
 
        -save CaFl cafl.i2i I 1000 .001 -save Ca ca.i2i I 1E6 .001 \
 
        -save_flow Ca ca_radial_float.i2i ca_long_float.i2i 1 .001 >& cellsim.out
 
 
 
SEE ALSO
 
      ~lml/vision/bin/float2int                    (convert a floating point image to standard SHORT INT format)
 
      ~lml/vision/bin/int2float       (convert normal image to floating point)
 
      ~lml/vision/bin/playexact                    (to display a floating point image)
 
      ~lml/invitro/Kargacin/changeheader          (change header of floating point image)
 
      ~lml/vision/bin/cyl2cart                    (convert from cylindrical to cartesian coords)
 
      ~lml/vision/bin/nadiffl7                    (many more options, but only 1 ion and 2 buffers)
 
      ~lml/vision/bin/diffuse2                    (simple Gaussian spot diffusion program)
 
      ~lml/invitro/Kargacin/iplot                  (3D graph of a 2D image, intensity -> height)
 
      ~lml/invitro/Kargacin/blur4D_dFoverF        (blur with psf, calculate dFoverF)
 
      ~lml/invitro/Kargacin/diffusion_limited_binding  (simulate diffusion limited binding)
 
      ~lml/invitro/Kargacin/spot_diffusion        (simulate diffusion from a spot)
 
      ~lml/vision/facil/printvals                  (print image values, calculate dFoverF)
 
      ~lml/vision/JSinger/src/channel              (steady state based upon Neher paper)
 
  
 
</nowiki>
 
</nowiki>
===  channel_current2 ===
+
===  cluster ===
 
  <nowiki>
 
  <nowiki>
channel_current2: like channel_current, but looks at [ca] over time at each BK (not just max [ca]).
+
Drops random Ryr receptors into a worldThen calculates how many clusters and their sizes get produced.
From that, it calculates the max BK current. Channel_current adds the max [ca] that each BK voxel sees
+
Currently the "world" default size is  (2um)^3. (see -wsize)
from each voxel in a Ryr cluster, to get the max [ca] that BK pixel sees.  But the max [ca] could occur
+
The origin of this world is in it's center (so it goes from -1um to +1 um in each direction by default).
at different times since the Ryr cluster has a spatial extentExperimental.
+
A histogram of cluster sizes is printed to stdout.
 
 
Calculates the current which would be produced when each object in Ryr_image.i2i releases calcium which
 
activates nearby BK channels in BK_image.i2i. Produces a histogram of these output currents.
 
The input images should have each pixel in an object having the object id as its value. These images can be
 
produced with "countobjs -Q" or "objs_via_ascent"   
 
note:  a one pixel border around the image is ignored (added 12/8/09).
 
This may take about one-half hour to run.
 
  
 
Usage:
 
Usage:
channel_current [options] -f filename Ryr_image.i2i BK_image.i2i > im1_im2.hist
+
cluster [options]  
 
Options:
 
Options:
-f filename resting: file containing [ca], in nM, as a function of distance and time. Right now this is
+
distance options:
assumed to have 20 nm spacing and entries every msec. See
+
-eucliddist:     calculate a Euclidean distance (same in x,y,z directions). This is the default.
/home/lml/krypton/Zhuge/STIC/simulations/run32.ca as an example
+
  (use -cdist option to set the nearby distance for this).
"resting" is the resting [ca], in nM, for the cell. It will we subtracted from the other
+
-absdist:   rather than calculate a real distance, calculate max(ABS(dx),ABS(dy),ABS(dz)) - for speed
[ca] values to produce a "delta" [ca] which gets scaled linearly by Ryr intensity.
+
  (use -cdist to set the nearby distance for this.)
The spark current used to produce this (see -C) should be roughly in the range expected
+
-psfdist x y z:  distance (in um) a pt can be in the x, y, and z directions and be considered nearby.
for Ryr_image.i2i, since all delta [ca] is linearly extrapolated.
+
  Does not use -cdist.  To approximate a psf you might specify .2 .2 .6
All distances > largest distance in filename will have their [ca] set to the [ca]
+
      -cdist #:        how close (in um) two receptors must be to cluster, default = 0.500000
at the largest distance in filename.
+
other options:
note: Only the [ca] values at y == 1 are used. Is this what should be used?
+
      -2D:   do a 2D simulation (x and y), not a 3D simulation
-u #: voltage (mV). BK conductance is a function of voltage. default = -80.000000
+
-cylinder inner outer:  only place Ryr within a cylinder (e.g., plasma membrane) with specified
-U low delta hi: voltages from low to hi by delta. Max is 20 voltages
+
                        inner and outer radius (in um). The cylinder has its length the entire y dimension.
-r #:         resolution (binsize) for output histogram in femtoAmps, default = 1000.000000
+
  Only the parts of the cylinder which fit in the world (-wsize) are used.
-R #: reveral potential of BK channel in mV, default = -80.000000
+
-wsize x y z:   the width of the world (in um) in the x, y, and z directions (default = 2.0,2.0,2.0)
 +
-psize x y z:   pixel width (in um) in the x, y, and z directions (default = 0.1,0.1,0.1)
 +
      -numryr #:       number of Ryr receptors to drop, default = 1000
 +
-mindist #:   when placing Ryr receptors, keep this minimum distance (in um) between them.
 +
-randstart #:   start the random number generator with # as the seed. So runs can be reproduced.
 +
-image name.i2i   write out an image of the Ryr receptors.  Can then use blur3d to create a realistic
 +
  microscope image, and countobjs to analyze it and compare to real data.
 +
diagnostics:
 +
      -debug:          turn on debugging
 +
      -verbose:        be a bit more verbose
 +
      -h:  print this help
 +
      -H:  print this help
 +
      -help:  print this help
  
  distances:
+
Examples:
-w # # #: x,y, zweights for pixel distances (ie, pixel size), default = 1 for each.
+
 
-p #: pixel size in nm (i.e., what 1 means in -w option), default = 80.000000
+
Source code in ~krypton/lml/Zhuge/Ryr_clusters 
-m # :         maxdistance (in units used for -w, i.e., pixels) to look for the closest pixel, default = 10.000000
+
/home/lml/krypton/bin/cluster -h
  
  which pixels or clusters to include:
+
</nowiki>
-t # #: image1 and image2 thresholds, pixels > # are above threshold, default = 0.
+
===  diffusion_limited_binding ===
-e lowx lowy lowz hix hiy hiz: only look at voxels within this extent (subvolume), 1-indexed, inclusive.
+
<nowiki>
-s minsize maxsize:    only look at objects in Ryr_image.i2i within the size range (inclusive, in voxels)
+
unknown option h
max size allowed = 100000
 
-S minsize maxsize:    only look at objects in BK_image.i2i within the size range (inclusive, in voxels)
 
-i miniod maxiod:    only look at objects in Ryr_image.i2i within the iod range (inclusive. use -d also.)
 
-I miniod maxiod:    only look at objects in BK_image.i2i within the iod range (inclusive. use -D also.)
 
  
  scale factors:
+
Prints out distance (um) and concentration (particles/cm^3) at that distance
-d Ryrimage1d.i2i #: the original intensity image for Ryr_image (since Ryr_image has pixel values as id numbers)
+
a slab volume of initial uniform concentration (1 particle/cm^3)which has a ligand
# is the number of Ryrimage1d.i2i intensity units required to produce spark current
+
binding to a plane at x = 0. This is diffusion limited binding. See my notes of 10/20/98.
used in the calcium simulation (which produced the -f filename data).
 
This will scale the [ca] produced by each Ryr voxel. Default = 30000.000000
 
-D BKimage2d.i2i #: the original intensity image for BK_image (since BK_image has pixel values as id numbers)
 
# is the BKimage2d.i2i intensity from one BK channel.
 
This will scale current produced. Default = 1000.000000
 
If you want the intensity of each Ryr or BK object to affect the ca release (for Ryr)
 
or number of channels (for BK) , you need to provide the original data by using the
 
-d and -D options. Otherwise all voxels in an object contribute equally (so large objects
 
have more receptors or channels than small ones).
 
-c #: BK single channel conductance in pS, default = 220.0
 
-C #: peak current (in pAmps) used in the simulation to produce -f filename, default = 1.000000
 
This is just used for output produced by -v to estimate spark current produced per Ryr cluster.
 
  
  miscellaneous:
+
Usage: diffusion_limited_binding [options] 
   -v: verbose. produces list of each Ryr cluster and K current produced to stderr. Other stuff too.
+
options:
To write this to a separate file do: (channel_current -v ... > stdout.channel) >& stderr.channel
+
  -D #:   diffusion (cm^2/msec), default = 2.2E-09
  -V: very verbose
+
  -t t1 t2:   start and stop time to simulate (msec), default = 0.000000 1000.000000
 
+
set both numbers equal if you only want one time point.
Examples:
+
  -x x1 x2: start and stop distances to print (um), default = 0.000000 10.000000
 
+
set both number equal if you only want one position
cellsim -spacing /home/lml/krypton/Zhuge/STIC/simulations/spacing2.txt ....     : produces ca.i2i
+
  -L #: thickness of slab volume (um), default = 10.000000
printvalsL -spacing2.txt -R -t -i ca.i2i > ca.vals    
+
  -T #: number of samples in t, default = 10
kate ca.vals     : delete fist comment line
+
  -X #: number of samples in x, default = 1000
      objs_via_ascent -s 5 100 Ryr.i2i Ryrid.i2i > tmp
+
  -h: print this help message.
tail tmp  : the mean IOD gives an idea of brightness needed to produce current used in cellsim, say 30000
+
  -F: print out time (msec) and flux (particles/cm^2-msec) at x = 0
      objs_via_ascent -s 5 100 BK.i2i BKid.i2i > tmp
+
(i.e., rate molecules binding to x=0 surface).
tail tmp : the mean IOD gives an idea of brightness of a BK cluster, eg mean= 10000, but assume that's 10 channels
+
I've made flux towards lower x positive (normally it would be negative).
 +
  -B: print out time (msec) and total # of particles/cm^2 bound at x = 0
 +
(i.e., brightness of surface). Integral of flux from t1 = 0 regardless of -t option setting.
 +
  -s: don't print out concentration as a function of x (i.e, the entire slab)
 +
 +
</nowiki>
 +
===  ellipse ===
 +
<nowiki>
  
channel_current -f ca.vals -w 1 1 3 -d Ryr.i2i 30000 -D BK.i2i 1000 Ryrid.i2i Bkid.i2i > ryr_bk.info
+
This program creates an elliptical cell, cell length is in the y direction.
cull -s -c -1 -4 < ryr_bk.info |xmgrace -source stdin
+
It is used to model a squashed cell, and see how different it looks after
See also:
+
blurring than a cylindrical cell
closest_object closest_voxel objs_via_ascent /home/lml/krypton/Zhuge/BKandRyr/graph.pl,match.pl
 
graph_channel_current.pl, test_channel_current, /home/lml/krypton/Zhuge/STIC/simulations/run32 
 
/home/lml/krypton/Zhuge/BKandRyr/analysis6/cluster_distances.pl, plot_mean_sd_curve.pl
 
/home/lml/krypton/Zhuge/xpp/ASM15.ode
 
Bugs:
 
 
 
Source code in ~krypton/lml/facil 
 
# Popen is monotonic as it should be.
 
must provide -f cafilename
 
  
 +
Usage: ellipse [options] ellipse.i2i
 +
options:
 +
  -d xdim ydim zdim:  dimensions of image, default = (50,100,50)
 +
  -r xradius zradius:  radius (in pixels) in the x and z directions, default (20.000000,20.000000)
 +
  -s samplerate:  number of subsamples in x and z directions per pixel, default = 1
 +
  -i intensity:  intensity inside the ellipse, default = 100.000000
 +
 
</nowiki>
 
</nowiki>
===  cluster ===
+
===  em ===
 
  <nowiki>
 
  <nowiki>
Drops random Ryr receptors into a world.  Then calculates how many clusters and their sizes get produced.
+
Creates (or reads in) a HMM and then generates random data from it
Currently the "world" default size is  (2um)^3. (see -wsize)
+
(each model is a poisson process, with the j_th model having a lambda = 10*j).
The origin of this world is in it's center (so it goes from -1um to +1 um in each direction by default).
+
Then attempts to use an EM algorithm to estimate the original model.
A histogram of cluster sizes is printed to stdout.
+
This is a way for me to learn how to implement the EM algorithm.
  
Usage:
+
Usage: em [options]  
cluster [options]  
+
options:
Options:
+
  -s #: number of states, default = 2. Must specify -t and -p after this.
distance options:
+
  -t # # # ... #: state transition probabilities. If there are S states (e.g., -s #)
-eucliddist:     calculate a Euclidean distance (same in x,y,z directions). This is the default.
+
                        order: T[1][1], T[1][2], ... T[1][S], T[2][1] ... T[S][S] if there are S states),
  (use -cdist option to set the nearby distance for this).
+
                        where T[i][j] is the probability of a transition from state i to state j.
-absdist:   rather than calculate a real distance, calculate max(ABS(dx),ABS(dy),ABS(dz)) - for speed
+
  -p # # # ... #: prior probabilities of states (S entries if there are S states)
  (use -cdist to set the nearby distance for this.)
+
  -P #: which prior estimate to use for the pdf of the data (ie., estimate of Poisson process)
-psfdist x y z:   distance (in um) a pt can be in the x, y, and z directions and be considered nearby.
+
        1 = uniform, 2 = delta, 3 = uniform+delta, 4 = peice of observed data histogram (default)
  Does not use -cdist. To approximate a psf you might specify .2 .2 .6
+
        5 = true pdf (Poisson)
      -cdist #:        how close (in um) two receptors must be to cluster, default = 0.500000
+
  -n #: number of data points to simulate, default = 100
other options:
+
  -m #: maximum number of iterations to perform, default = 20
      -2D:   do a 2D simulation (x and y), not a 3D simulation
+
        -truetrans: use the true transition probabilities as the initial guess (default = uniform)
-cylinder inner outer:  only place Ryr within a cylinder (e.g., plasma membrane) with specified
+
        -trueprior: use the true prior probabilities as the initial prior guess (default = uniform)
                        inner and outer radius (in um). The cylinder has its length the entire y dimension.
+
  -findstates:  also find (and print) the estimate of the states at each time point.
  Only the parts of the cylinder which fit in the world (-wsize) are used.
+
  -v:   verbose. print more info to stderr.
-wsize x y z:   the width of the world (in um) in the x, y, and z directions (default = 2.0,2.0,2.0)
+
  -V:  print some more info. Some printouts only occur if # data pts is < 1000
-psize x y z:   pixel width (in um) in the x, y, and z directions (default = 0.1,0.1,0.1)
+
 
      -numryr #:       number of Ryr receptors to drop, default = 1000
+
Source code in /home/lml/krypton/facil/em.cc
-mindist #:   when placing Ryr receptors, keep this minimum distance (in um) between them.
+
See also: ~/krypton/facil/transpose.pl  to print out selected lines from the output file
-randstart #:   start the random number generator with # as the seed. So runs can be reproduced.
+
          ~/krypton/matlab/netlab: has EM routines
-image name.i2i   write out an image of the Ryr receptors. Can then use blur3d to create a realistic
+
          ~/krypton/matlab/bayes/BNT/HMM: has HMM and EM routines
  microscope image, and countobjs to analyze it and compare to real data.
+
  /home/lml/krypton/bin/em -h  
diagnostics:
 
      -debug:           turn on debugging
 
      -verbose:        be a bit more verbose
 
      -h:  print this help
 
      -H:  print this help
 
      -help:   print this help
 
 
 
Examples:
 
 
 
Source code in ~krypton/lml/Zhuge/Ryr_clusters 
 
  /home/lml/krypton/bin/cluster -h  
 
  
 
</nowiki>
 
</nowiki>
===  diffusion_limited_binding ===
+
===  makebeads2 ===
 
  <nowiki>
 
  <nowiki>
unknown option h
+
/home/lml/krypton/bin/makebeads2
  
Prints out distance (um) and concentration (particles/cm^3) at that distance
+
randomly distributes beads within a volume.  created to let Jack simulate
a slab volume of initial uniform concentration (1 particle/cm^3)which has a ligand
+
distribution of glut4 labels vesicles in the TIRF field of a microscope.
binding to a plane at x = 0. This is diffusion limited binding. See my notes of 10/20/98.
+
A bead has a constant value between its inner and outer diameters. This value
 
+
falls to zero 3 standard deviations inside the inner diameter and 3 sd outside
Usage: diffusion_limited_binding [options]
+
the outer diameter. Beads are not allowed to intersect each other.
options:
+
Writes info about beads created or moved to stdout (can be read back in with -b option).
  -D #:   diffusion (cm^2/msec), default = 2.2E-09
+
note: coords written out are zero indexed (not 1-indexed like addlines and play) in pixels.
  -t t1 t2:   start and stop time to simulate (msec), default = 0.000000 1000.000000
+
usage:
set both numbers equal if you only want one time point.
+
makebeads2 [options] outimage.i2i
  -x x1 x2: start and stop distances to print (um), default = 0.000000 10.000000
+
options:
set both number equal if you only want one position
+
-d x y z: image dimensions in pixels, default = (256,256,64)
  -L #: thickness of slab volume (um), default = 10.000000
+
-D # #: bead inner and outer diameters in microns, default = 0.200000 and 0.200000
  -T #: number of samples in t, default = 10
+
-R #: inner rise standard deviation (in microns), default = 0.012500
  -X #: number of samples in x, default = 1000
+
-F #: outer fall standard deviation (in microns), default = 0.012500
  -h: print this help message.
+
-S x y z: x, y, and z pixel dimensions (in microns), default = (0.040000,0.040000,0.010000)
  -F: print out time (msec) and flux (particles/cm^2-msec) at x = 0
+
-c x y z: x, y, and z pixel dimensions for new image size.  If you are planning on taking the
(i.e., rate molecules binding to x=0 surface).
+
image produced by makebeads2 and using chres to change pixel size, put the new
I've made flux towards lower x positive (normally it would be negative).
+
pixel sizes here. This is used when calculating the intensity of the brightest pixel
  -B: print out time (msec) and total # of particles/cm^2 bound at x = 0
+
from each bead. This output info can be useful for signal to noise ratio tests.
(i.e., brightness of surface). Integral of flux from t1 = 0 regardless of -t option setting.
+
-X #: number of subpixels per pixels, default = 10
  -s: don't print out concentration as a function of x (i.e, the entire slab)
+
-p # val: set z plane # (0 indexed) to val (modelling diffuse fluorescence on the plasma membrane)
   
+
If val is < 1 it is interpreted as a fraction of total light in the image.
</nowiki>
+
For example: val = .2 means set the z plane to the intensity necessary so that the total
===  ellipse  ===
+
light in that plane is 2012f the total in the final image (i.e., after exponential if -e or -E)
<nowiki>
+
-e dist: apply an exponential scale factor exp(-z/dist) to each zslice; like a TIRF excitation intensity
 +
dist is the 1/e distance in microns (.1 is a good value)
 +
This exponential also get applied to z plane value set via "-p # val" if val >= 1. It does
 +
NOT apply to that if val < 1.
 +
-E amp2 dist2:apply a second an exponential scale factor amp2*exp(-z/dist2) to each zslice
 +
must also use -e option. Each intensity will be scaled by (amp1*exp(-z/dist)+amp2*exp(-z/dist2)).
 +
amp1 + amp2 = 1 and is automatically set when -E is used (amp1 = 1-amp2).
  
This program creates an elliptical cell, cell length is in the y direction.
+
options related to output:
It is used to model a squashed cell, and see how different it looks after
+
-i #: outimage.i2i should be scaled by # before writing it.  Format is short int (our default format).
blurring than a cylindrical cell
+
-f #: outimage.i2i should be scaled by # before writing it.  Format is float.
 +
-v: verbose.
 +
-A: don't create outimage.i2i (still need a dummy name on command line though).
 +
-B: don't even simulate voxels (just prints beads centers, amplitudes, sizes).  Automatically sets -A.
 +
-u file.objs: create file, which has a list of bead objects created, in the same format countobjs produces.
 +
this lets utilities written to analyze files in that format to then be used
 +
(e.g., objs2dist.pl, objs2bb.pl). COM field is the bead center even if part of it is outside
 +
the image. Size field is in pixels (only counting what is within the image).
 +
IOD is the total bead light in the image after exponential weighting (if -e or -E) and scaling (-i, -f).
 +
AVG = IOD/size.  MAX is the max pixel (after -e,-E,-i,-f) . Some file header info may be wrong.
 +
-U file.objs: like -u, but all z coords are replaced by 1, and coordinates are for the new resolution specified
 +
by -c option. MAX value and max coord come from a sum projection in z at the new resolution.
 +
(after -e,-E,-i,-f).
 +
-W: print some warning messages to stderr if appropriate.  note: This will mess up the output in the file
 +
if you are running it as:  makebeads2 -W .... >& file.out
  
Usage: ellipse [options] ellipse.i2i
+
options controlling randomization (of a uniform random distribution unless otherwise noted):
options:
+
-s min max: mininum and maximum range of allowed bead sizes. This number scales the
  -d xdim ydim zdim:   dimensions of image, default = (50,100,50)
+
bead inner and outer diameters (does not change sd). default = 1.000000 and 1.000000
  -r xradius zradius: radius (in pixels) in the x and z directions, default (20.000000,20.000000)
+
-G mean sd:   make bead sizes (scales) a Gaussian variable with specified mean and sd (instead of -s).
  -s samplerate: number of subsamples in x and z directions per pixel, default = 1
+
note: since beads can't intersect, if you place beads densely you will tend to get more
  -i intensity: intensity inside the ellipse, default = 100.000000
+
small beads (since the program generates a new random bead if one doesn't fit), and hence
+
the size distribution will no longer match the parameters specified here.
</nowiki>
+
-g mean sd shell: like -G, but also specify bead shell thickness in microns.  mean doesn't scale the shell thickness.
=== em ===
+
mean is the diameter to midway between the inner and outer diameters (so don't use -D option).
  <nowiki>
+
-a min max: min and max amplitude (brightness) of bead, default = 1000.000000 and 1000.000000
Creates (or reads in) a HMM and then generates random data from it
+
a pixel which is entirely covered by the shell of the bead (between -D numbers) will have this value.
(each model is a poisson process, with the j_th model having a lambda = 10*j).
+
So this is like specifying a fluorescent concentration.
Then attempts to use an EM algorithm to estimate the original model.
+
  -P lambda scale: make amplitude a Poisson variable with the specified mean (lambda) value (instead of -a option).
This is a way for me to learn how to implement the EM algorithm.
+
this value then gets multiplied by scale. Amplitudes of 0 get ignored (a new amplitude is calculated).
 
+
note: this is still just the amplitude of a covered pixel, not of the entire bead unless -T used too.
Usage: em [options]
+
-T: The amplitude specified with -a or -P option is the total light in the bead, not the light
options:
+
of one fully covered pixel. Takes about double the time to run.
  -s #: number of states, default = 2. Must specify -t and -p after this.
+
note: if the amplitude isn't large compared to number of pixels in the bead's shell, then
  -t # # # ... #: state transition probabilities. If there are S states (e.g., -s #)
+
individual pixel intensities will be small and truncation may effect total intensity.
                        order: T[1][1], T[1][2], ... T[1][S], T[2][1] ... T[S][S] if there are S states),
+
-x min max:   allowed position of beads, in pixels, zero indexed, inclusive. The entire bead must fit in this region
                        where T[i][j] is the probability of a transition from state i to state j.
+
unless -o option also specified.
  -p # # # ... #: prior probabilities of states (S entries if there are S states)
+
-y min max:   allowed position of beads, in pixels, zero indexed (default = anywhere within image)
  -P #: which prior estimate to use for the pdf of the data (ie., estimate of Poisson process)
+
-z min max:   allowed position of beads, in pixels, zero indexed (default = anywhere within image)
        1 = uniform, 2 = delta, 3 = uniform+delta, 4 = peice of observed data histogram (default)
+
-o: allow bead centers to fall outside the image volume (except in low z direction, i.e. coverslip).
        5 = true pdf (Poisson)
+
This is a more accurate way to represent a small view of a large cell.
  -n #: number of data points to simulate, default = 100
+
This option is ignored if -b option used.
  -m #: maximum number of iterations to perform, default = 20
+
-O: like -o, but beads in low z direction outside the volume reflect back inside the volume (i.e. get
        -truetrans: use the true transition probabilities as the initial guess (default = uniform)
+
moved back inside volume instead of thrown away).
        -trueprior: use the true prior probabilities as the initial prior guess (default = uniform)
+
note: if bead density is too high, reflecting a bead inside may cause it to intersect with a previous
  -findstates:  also find (and print) the estimate of the states at each time point.
+
bead, in which case the reflecting bead will be thrown away and a new randomly placed bead created.
  -v:  verbose. print more info to stderr.
+
-w #: use # as the seed for random number generator, so can reproduce exact runs. must be negative.
  -V:  print some more info. Some printouts only occur if # data pts is < 1000
+
-b file xyspeed zspeed: read initial bead params (e.g., size, position) from file, just add random position to this.
 
+
the random position uses the speeds (in microns) as the max the vesicle can move in each direction
Source code in /home/lml/krypton/facil/em.cc
+
in this time period (i.e., dx = ran(0 to 1)*xyspeed, etc).
See also: ~/krypton/facil/transpose.pl  to print out selected lines from the output file
+
Set xyspeed and zspeed = 0 if you don't want to move the beads.
          ~/krypton/matlab/netlab: has EM routines
+
  -j #: long int starting seed for random number generator. specify the same number (not 0) each time you run this
          ~/krypton/matlab/bayes/BNT/HMM: has HMM and EM routines
+
program if you want to exactly repeat the random numbers generated. The default is to use a different
  /home/lml/krypton/bin/em -h
+
starting seed each time based upon the process id when you run the program.
 +
  -n #: number of beads to make, default = 100, max = 10000
  
</nowiki>
+
Examples:
===  makebeads2  ===
+
#create 200 beads, with a 50 nm (5 z plane) gap before the pm, which has an
<nowiki>
+
#intensity of 50. Apply a TIRF exponential excitation scale to it.
/home/lml/krypton/bin/makebeads2
+
makebeads2 -e .1 -z 5 63 -p 5 50 -n 200 beads1.i2i > beads1.info
 +
# apply microscope psf
 +
blur3d -P -N 256 256 128 beads1.i2i empiricalpsf_seg_40nm_seg.i2i beads1_blur3d.i2i
 +
# bin (averge) to 100/160 nm resolution
 +
reduceima -A -X 1 256 4 -Y 1 256 4 beads1_blur3d.i2i beads1_blur3d4x4.i2i
 +
# extract infocus plane
 +
segment -Z 16 16 1 beads1_blur3d4x4.i2i beads1_blur2d4x4.i2i
 +
# add ScratchNG camera noise
 +
noise -e 1.4 -n 8 beads1_blur2d4x4.i2i beads1_blur2d4x4N.i2i
 +
histima -size 10 -bins 100 beads1_blur2d4x4N.i2i > beads1_blur2d4x4N.hist
  
randomly distributes beads within a volume. created to let Jack simulate
+
#creates beads, move them, look at the results
distribution of glut4 labels vesicles in the TIRF field of a microscope.
+
makebeads2 -z 5 63 beads1.i2i > beads1.info
A bead has a constant value between its inner and outer diameters. This value
+
#read those beads in and move them. but still must stay outside the first 50 nm.
falls to zero 3 standard deviations inside the inner diameter and 3 sd outside
+
makebeads2 -z 5 63 -b beads1.info .05 .05 beads2.i2i > beads2.info
the outer diameter. Beads are not allowed to intersect each other.
+
concateima beads1.i2i beads2.i2i beads.i2i
Writes info about beads created or moved to stdout (can be read back in with -b option).
+
imsets beads.i2i 2
note: coords written out are zero indexed (not 1-indexed like addlines and play) in pixels.
+
dave -tdim 2 -4 -I beads.i2i
usage:
+
 
makebeads2 [options] outimage.i2i
+
#just create scripts (very fast) with positions of beads, and move them around.
options:
+
makebeads -z 5 63 -n 200 -A dummy.i2i > beads1.info
-d x y z: image dimensions in pixels, default = (256,256,64)
+
makebeads -b beads1.info .05 .05 -z 5 63 -A dummy.i2i > beads2.info
-D # #: bead inner and outer diameters in microns, default = 0.200000 and 0.200000
+
makebeads -b beads2.info .05 .05 -z 5 63 -A dummy.i2i > beads3.info
-R #: inner rise standard deviation (in microns), default = 0.012500
+
#now create the images
-F #: outer fall standard deviation (in microns), default = 0.012500
+
makebeads -b beads1.info 0 0  beads1.i2i > beads1.info2
-S x y z: x, y, and z pixel dimensions (in microns), default = (0.040000,0.040000,0.010000)
+
makebeads -b beads2.info 0 0 beads2.i2i > beads2.info2
-c x y z: x, y, and z pixel dimensions for new image size. If you are planning on taking the
+
makebeads -b beads3.info 0 0  beads3.i2i > beads3.info2
image produced by makebeads2 and using chres to change pixel size, put the new
+
 
pixel sizes here. This is used when calculating the intensity of the brightest pixel
+
see also: makebead, readbeads.pl, blur3d, project, /storage/big1/sh/simul
from each bead. This output info can be useful for signal to noise ratio tests.
 
-X #: number of subpixels per pixels, default = 10
 
-p # val: set z plane # (0 indexed) to val (modelling diffuse fluorescence on the plasma membrane)
 
If val is < 1 it is interpreted as a fraction of total light in the image.
 
For example: val = .2 means set the z plane to the intensity necessary so that the total
 
light in that plane is 2012f the total in the final image (i.e., after exponential if -e or -E)
 
  -e dist: apply an exponential scale factor exp(-z/dist) to each zslice; like a TIRF excitation intensity
 
dist is the 1/e distance in microns (.1 is a good value)
 
This exponential also get applied to z plane value set via "-p # val" if val >= 1. It does
 
NOT apply to that if val < 1.
 
  -E amp2 dist2:apply a second an exponential scale factor amp2*exp(-z/dist2) to each zslice
 
must also use -e option.  Each intensity will be scaled by (amp1*exp(-z/dist)+amp2*exp(-z/dist2)).
 
amp1 + amp2 = 1 and is automatically set when -E is used (amp1 = 1-amp2).
 
  
options related to output:
+
source code in ~lml/krypton/facil
  -i #: outimage.i2i should be scaled by # before writing it.  Format is short int (our default format).
+
   
  -f #: outimage.i2i should be scaled by # before writing it. Format is float.
+
</nowiki>
  -v: verbose.
+
=== oxygen ===
-A: don't create outimage.i2i (still need a dummy name on command line though).
+
  <nowiki>
-B: don't even simulate voxels (just prints beads centers, amplitudes, sizes).  Automatically sets -A.
+
Calculates steady state partial oxygen pressure (P) as a function of distance from a blood vessel (r).
-u file.objs: create file, which has a list of bead objects created, in the same format countobjs produces.
+
The blood vessel has a radius of R1 (5.0 um) and Oxygen at the vessel is Ps (52.0 mm Hg).
this lets utilities written to analyze files in that format to then be used
+
The default is to print partial Oxygen pressure (mm Hg) as a function of distance (um) as columns to stdout.
(e.g., objs2dist.pl, objs2bb.pl). COM field is the bead center even if part of it is outside
+
All models set P at R1 (and r<R1) to Ps. All models clamp P at R1 to be Ps for all time (vessels stay oxygenated).
the image. Size field is in pixels (only counting what is within the image).
 
IOD is the total bead light in the image after exponential weighting (if -e or -E) and scaling (-i, -f).
 
AVG = IOD/size.  MAX is the max pixel (after -e,-E,-i,-f) . Some file header info may be wrong.
 
-U file.objs: like -u, but all z coords are replaced by 1, and coordinates are for the new resolution specified
 
by -c option. MAX value and max coord come from a sum projection in z at the new resolution.
 
(after -e,-E,-i,-f).
 
-W: print some warning messages to stderr if appropriate.  note: This will mess up the output in the file
 
if you are running it as:  makebeads2 -W .... >& file.out
 
  
options controlling randomization (of a uniform random distribution unless otherwise noted):
+
The line source model (-m 1) implements equation 17 from KroghOxygenDiffusionModel1.pdf
-s min max: mininum and maximum range of allowed bead sizes. This number scales the
+
  Modeling pO2 Distributions in the Bone Marrow Hematopoietic Compartment.
bead inner and outer diameters (does not change sd). default = 1.000000 and 1.000000
+
  I. Krogh's Model  by D.C.Chow, L. A. Wenning, W. M. Miller, and E.T. Papoutsakis
-G mean sd:  make bead sizes (scales) a Gaussian variable with specified mean and sd (instead of -s).
+
  Biophysical Journal, vol. 81, August 2001, pp. 675-684.
note: since beads can't intersect, if you place beads densely you will tend to get more
+
This models O2 assuming a constant oxygen consumption by the tissue and constant O2 (Ps) at the blood vessel.
small beads (since the program generates a new random bead if one doesn't fit), and hence
+
They claim results don't change by more than a few percent using proportional (or other) O2 consumption models.
the size distribution will no longer match the parameters specified here.
+
The value of dP/dr at R2 is forced to 0.
-g mean sd shell: like -G, but also specify bead shell thickness in microns. mean doesn't scale the shell thickness.
+
note: this is an implmentation of O2 from a line source (e.g., blood vessel), not a point source.
mean is the diameter to midway between the inner and outer diameters (so don't use -D option).
+
So it is not appropriate to convolve (in 3D) this with a 3D image of blood vessels.
-a min max: min and max amplitude (brightness) of bead, default = 1000.000000 and 1000.000000
+
But -p (or -m 2) will produce a point source image.
a pixel which is entirely covered by the shell of the bead (between -D numbers) will have this value.
+
 
So this is like specifying a fluorescent concentration.
+
The point source model (-m 2) implements equation 14 from HeatConduction.pdf
-P lambda scale: make amplitude a Poisson variable with the specified mean (lambda) value (instead of -a option).
+
  Steady Heat Conduction in Layered Mediums: The Half-Space and Sphere, by Henry N. Pollack
this value then gets multiplied by scale.  Amplitudes of 0 get ignored (a new amplitude is calculated).
+
  J. of Geophysical Research, vol. 70(22), Nov. 15, 1965, pp. 5645-5648
note: this is still just the amplitude of a covered pixel, not of the entire bead unless -T used too.
+
This models O2 assuming a constant oxygen consumption by the tissue and constant O2 (Ps) at the blood vessel.
-T: The amplitude specified with -a or -P option is the total light in the bead, not the light
+
note: The value of dP/dr at R2 is forced to 0 unless -b # is specified.
of one fully covered pixel.  Takes about double the time to run.
+
note: Since O2 consumption is constant, it might not make sense to use this in a convolution, since it isn't
note: if the amplitude isn't large compared to number of pixels in the bead's shell, then
+
      linear.
individual pixel intensities will be small and truncation may effect total intensity.
+
 
-x min max:  allowed position of beads, in pixels, zero indexed, inclusive. The entire bead must fit in this region
+
Model 3 is a point source model, but O2 consumption by the tissue is proportional to the O2 level in the tissue.
unless -o option also specified.
+
  I derived it from Crank's equations 6.60 (infinite hollow sphere model) and 14.13 (see below).
-y min max:  allowed position of beads, in pixels, zero indexed (default = anywhere within image)
+
  It requires the specification of an initial O2 level in the tissue (P0, which is the same everywhere).
-z min max:  allowed position of beads, in pixels, zero indexed (default = anywhere within image)
+
  R2 is used only to determine how far out to plot the graph (and dP/dr at R2 is not used either).
-o: allow bead centers to fall outside the image volume (except in low z direction, i.e. coverslip).
+
   See my paper notes or ~/krypton/Corvera/Olga/SteadyStatePointDiffusion.pdf
This is a more accurate way to represent a small view of a large cell.
+
  Not only is proportional O2 consumption more biological, but I think this should be linear and therefore
This option is ignored if -b option used.
+
  it makes more sense to use in a convolution with a (binarized?) blood vessel image.
-O: like -o, but beads in low z direction outside the volume reflect back inside the volume (i.e. get
 
moved back inside volume instead of thrown away).
 
note: if bead density is too high, reflecting a bead inside may cause it to intersect with a previous
 
bead, in which case the reflecting bead will be thrown away and a new randomly placed bead created.
 
-w #: use # as the seed for random number generator, so can reproduce exact runs. must be negative.
 
-b file xyspeed zspeed:  read initial bead params (e.g., size, position) from file, just add random position to this.
 
the random position uses the speeds (in microns) as the max the vesicle can move in each direction
 
in this time period (i.e., dx = ran(0 to 1)*xyspeed, etc).
 
Set xyspeed and zspeed = 0 if you don't want to move the beads.
 
   -j #: long int starting seed for random number generator. specify the same number (not 0) each time you run this
 
program if you want to exactly repeat the random numbers generated. The default is to use a different
 
starting seed each time based upon the process id when you run the program.
 
-n #: number of beads to make, default = 100, max = 10000
 
  
Examples:
+
note: because R2 really should vary in an image, depending upon the distance between nearby blood vessels
#create 200 beads, with a 50 nm (5 z plane) gap before the pm, which has an
+
        and because Ps is not just a scale factor (so, eg, brighter blood vessels in an image, if brightness is
#intensity of 50. Apply a TIRF exponential excitation scale to it.
+
        proportional to Ps, do NOT just cause a scale factor in the P(r) values), it may NOT be appropriate
makebeads2 -e .1 -z 5 63 -p 5 50 -n 200 beads1.i2i > beads1.info
+
to take the image produced by this program and convolve it with an image of blood vessels to get
# apply microscope psf
+
estimates of oxygenation of tissue. This comment may apply to all three models (definitely to -m 1)
blur3d -P -N 256 256 128 beads1.i2i empiricalpsf_seg_40nm_seg.i2i beads1_blur3d.i2i
 
# bin (averge) to 100/160 nm resolution
 
reduceima -A -X 1 256 4 -Y 1 256 4 beads1_blur3d.i2i beads1_blur3d4x4.i2i
 
# extract infocus plane
 
segment -Z 16 16 1 beads1_blur3d4x4.i2i beads1_blur2d4x4.i2i
 
# add ScratchNG camera noise
 
noise -e 1.4 -n 8 beads1_blur2d4x4.i2i beads1_blur2d4x4N.i2i
 
histima -size 10 -bins 100 beads1_blur2d4x4N.i2i > beads1_blur2d4x4N.hist
 
  
#creates beads, move them, look at the results
+
Usage: oxygen -m # [options] 
makebeads2 -z 5 63 beads1.i2i > beads1.info
+
    required:
#read those beads in and move them. but still must stay outside the first 50 nm.
+
  -m # which model to use.  
makebeads2 -z 5 63 -b beads1.info .05 .05 beads2.i2i > beads2.info
+
        -m 1 :line source model with constant O2 consumption
concateima beads1.i2i beads2.i2i beads.i2i
+
-m 2: point source model with constant O2 consumption.
imsets beads.i2i 2
+
        -m 3 :point source model with O2 consumption proportional to O2 concentration.
dave -tdim 2 -4 -I beads.i2i
+
Use point source models if planning on convolving resulting image with a blood vessel image.
  
#just create scripts (very fast) with positions of beads, and move them around.
+
    options for all models:
makebeads -z 5 63 -n 200 -A dummy.i2i > beads1.info
+
Although these options can be used in all models, different models have different sensitivities to them.
makebeads -b beads1.info .05 .05 -z 5 63 -A dummy.i2i > beads2.info
+
  -R1 # vessel radius (um). Changes to this can change P a lot (if -m 1), and may require R2 to change (see -c).  
makebeads -b beads2.info .05 .05 -z 5 63 -A dummy.i2i > beads3.info
+
default = 5.00
#now create the images
+
  -R2 # max distance any tissue is from a vessel (um). This changes the solution a lot for some models
makebeads -b beads1.info 0 0  beads1.i2i > beads1.info2
+
but for the -m 3 model it only affects how far out data is graphed, default = 2268.00
makebeads -b beads2.info 0 0  beads2.i2i > beads2.info2
+
More precisely, for -m 1 and -m 2 it is the distance at which dP/dr = 0 (ie, a b.c. on the pde).
makebeads -b beads3.info 0 0  beads3.i2i > beads3.info2
+
  -Ps # partial pressure of Oxygen at the blood vessel (mm Hg). Default = 52.00
 
+
40 is typical of veins, 95 of arteries. This is held constant over time in all the models right now.
see also:  makebead, readbeads.pl, blur3d, project, /storage/big1/sh/simul
+
For -m 1, this will affect the O2 value at R1, but how P changes RELATIVE to P(at R1) (as r increases)
 
+
will not be affected (ie, it does NOT just scale everything).
source code in ~lml/krypton/facil
+
    model 1 options:
+
  -c use with -R1 to automatically calculate R2 based on the specified R1 (since R2 affects the solution).
</nowiki>
+
(this also sets -m 1 as a convenience)
===  oxygen  ===
+
    model 2 options:
<nowiki>
+
  -b # changes the 2nd boundary condition to be P at R2 = # mm Hg
Calculates steady state partial oxygen pressure (P) as a function of distance from a blood vessel (r).
+
instead of dP/dr = 0 at R2 (this also sets -m 2 as a convenience)
The blood vessel has a radius of R1 (5.0 um) and Oxygen at the vessel is Ps (52.0 mm Hg).
+
    model 3 options:
The default is to print partial Oxygen pressure (mm Hg) as a function of distance (um) as columns to stdout.
+
  -P0 # the initial oxygenation level of the tissue (mm Hg). Default = 0.000000
All models set P at R1 (and r<R1) to Ps. All models clamp P at R1 to be Ps for all time (vessels stay oxygenated).
+
This will change the solution a lot, since it is also the level that O2, in steady state, approaches as r->infinity.
 +
Therefore, nonzero P0 may also make convolution with a blood vessel image inappropriate.
 +
-P0 0 seems to produce the same results as -r. (-P0 also sets -m 3 as a convenience)
  
The line source model (-m 1) implements equation 17 from KroghOxygenDiffusionModel1.pdf
+
    output graph options:
  Modeling pO2 Distributions in the Bone Marrow Hematopoietic Compartment.
+
  -n normalize output (doesn't affect -i image.i2i), ie, print r/R1  vs P/Ps  rather than r vs. P
  I. Krogh's Model  by D.C.Chow, L. A. Wenning, W. M. Miller, and E.T. Papoutsakis
+
  -r add a third reference column which is the "simple" diffusion solution (goes as 1/r)
  Biophysical Journal, vol. 81, August 2001, pp. 675-684.
+
This is for a point source in 3D (not a line source), and ignores O2 consumption.
This models O2 assuming a constant oxygen consumption by the tissue and constant O2 (Ps) at the blood vessel.
+
graph as: oxygen_krogh -r | xmgr -nxy stdin
They claim results don't change by more than a few percent using proportional (or other) O2 consumption models.
 
The value of dP/dr at R2 is forced to 0.
 
note: this is an implmentation of O2 from a line source (e.g., blood vessel), not a point source.
 
So it is not appropriate to convolve (in 3D) this with a 3D image of blood vessels.
 
But -p (or -m 2) will produce a point source image.
 
  
The point source model (-m 2) implements equation 14 from HeatConduction.pdf
+
    output image options:
  Steady Heat Conduction in Layered Mediums: The Half-Space and Sphere, by Henry N. Pollack
+
  -i image.i2i xdim ydim zdim:  create an image of the values, to use with blur3d to find
  J. of Geophysical Research, vol. 70(22), Nov. 15, 1965, pp. 5645-5648
+
O2 everywhere in an image as a function of distance from blood vessels.
This models O2 assuming a constant oxygen consumption by the tissue and constant O2 (Ps) at the blood vessel.
+
If you are planning on convolving you should probably specify -m 3 .
note: The value of dP/dr at R2 is forced to 0 unless -b # is specified.
+
  -d x y z if -i is specified. pixel dimensions in um. default = 0.60 0.60 10.00
note: Since O2 consumption is constant, it might not make sense to use this in a convolution, since it isn't
+
  -s # if -i is specified. scale output intensities by #. Otherwise max is 52.0 mm Hg
      linear.
+
  -o xorig yorig zorig: location of the blood vessel in the image (zero indexed, floating point)
 +
blur3d may care about this, depending upon options. default = (0.00,0.00,0.00)
 +
(maybe I should change this to define a line in the image when -m 1 is specified?)
 +
-p the output image should be for the simple 1/r point source (see -r explanation) rather
 +
for the line source (-m 1) or point source with O2 consumption (-m 2 or -m 3).
  
Model 3 is a point source model, but O2 consumption by the tissue is proportional to the O2 level in the tissue.
+
    other options:
  I derived it from Crank's equations 6.60 (infinite hollow sphere model) and 14.13 (see below).
+
  -v verbose. stuff to stderr.
  It requires the specification of an initial O2 level in the tissue (P0, which is the same everywhere).
+
  -V more verbose. stuff to stderr. debugging info.
  R2 is used only to determine how far out to plot the graph (and dP/dr at R2 is not used either).
+
  -h print this help
  See my paper notes or ~/krypton/Corvera/Olga/SteadyStatePointDiffusion.pdf
+
 
  Not only is proportional O2 consumption more biological, but I think this should be linear and therefore
+
Examples:
  it makes more sense to use in a convolution with a (binarized?) blood vessel image.
+
      # create a binary image of blood vessels (maybe use BestPath3D_ellipse instead? Maybe thin3D afterwards?):
 +
    mask_image -m 2700 -r 1 G03_x_1_2_r4.i2i G03_x_1_2_r4.i2i G03_x_1_2_r4_binaryvessels.i2i
 +
      # create a psf of blood oxygenation:
 +
    oxygen -s 500 -i O2ptsource.i2i 50 50 21 -d 2.58 2.58 10 -o 25 25 10 -m 3 -r > O2ptsource.xy
 +
    blur3d -S .002 -Z -d -v G03_x_1_2_r4_binaryvessels.i2i O2ptsource.i2i G03_x_1_2_r4_O2.i2i
  
note: because R2 really should vary in an image, depending upon the distance between nearby blood vessels
+
see also: /home/lml/krypton/Corvera/Olga/README, SteadyStatePointDiffusion.pdf (my notes)
        and because Ps is not just a scale factor (so, eg, brighter blood vessels in an image, if brightness is
+
         Random Walks in Biology (New, expanded edition) by Berg p. 23 eq. 2.11;
         proportional to Ps, do NOT just cause a scale factor in the P(r) values), it may NOT be appropriate
+
The Mathematics of Diffusion (2nd Ed) by Crank p. 32 eq  3.5b; p. 89 eq 6.5; p. 102 eq 6.60; p. 330 eq 14.13
to take the image produced by this program and convolve it with an image of blood vessels to get
+
source code in:  /home/lml/krypton/facil
estimates of oxygenation of tissue. This comment may apply to all three models (definitely to -m 1)
+
error: A model must be specified, i.e., -m # must be specified.
  
Usage: oxygen -m # [options] 
 
    required:
 
  -m # which model to use.
 
        -m 1 :line source model with constant O2 consumption
 
-m 2: point source model with constant O2 consumption.
 
        -m 3 :point source model with O2 consumption proportional to O2 concentration.
 
Use point source models if planning on convolving resulting image with a blood vessel image.
 
  
    options for all models:
+
</nowiki>
Although these options can be used in all models, different models have different sensitivities to them.
+
=== sparkspread  ===
  -R1 # vessel radius (um). Changes to this can change P a lot (if -m 1), and may require R2 to change (see -c).
+
<nowiki>
default = 5.00
 
  -R2 # max distance any tissue is from a vessel (um). This changes the solution a lot for some models
 
but for the -m 3 model it only affects how far out data is graphed, default = 2268.00
 
More precisely, for -m 1 and -m 2 it is the distance at which dP/dr = 0 (ie, a b.c. on the pde).
 
  -Ps # partial pressure of Oxygen at the blood vessel (mm Hg). Default = 52.00
 
40 is typical of veins, 95 of arteries. This is held constant over time in all the models right now.
 
For -m 1, this will affect the O2 value at R1, but how P changes RELATIVE to P(at R1) (as r increases)
 
will not be affected (ie, it does NOT just scale everything).
 
    model 1 options:
 
  -c use with -R1 to automatically calculate R2 based on the specified R1 (since R2 affects the solution).
 
(this also sets -m 1 as a convenience)
 
    model 2 options:
 
  -b # changes the 2nd boundary condition to be P at R2 = # mm Hg
 
instead of dP/dr = 0 at R2 (this also sets -m 2 as a convenience)
 
    model 3 options:
 
  -P0 # the initial oxygenation level of the tissue (mm Hg). Default = 0.000000
 
This will change the solution a lot, since it is also the level that O2, in steady state, approaches as r->infinity.
 
Therefore, nonzero P0 may also make convolution with a blood vessel image inappropriate.
 
-P0 0 seems to produce the same results as -r. (-P0 also sets -m 3 as a convenience)
 
  
    output graph options:
+
Calculates the spread of spark event amplitudes given that two events occur at the same
  -n normalize output (doesn't affect -i image.i2i), ie, print r/R1  vs P/Ps  rather than r vs. P
+
spark site and compares it to the spread of amplitudes given that two events occur at
  -r add a third reference column which is the "simple" diffusion solution (goes as 1/r)
+
different spark sites. A spark site has a unique (x,y) position.
This is for a point source in 3D (not a line source), and ignores O2 consumption.
+
Prints mean and stddev to stdout. Also prints out histograms and cumulative distributions.
graph as: oxygen_krogh -r | xmgr -nxy stdin
 
  
    output image options:
+
A valid datafile has either blank lines, comments (start with #) or a data line (spark event).
  -i image.i2i xdim ydim zdim:  create an image of the values, to use with blur3d to find
+
A data line has 8 or 11 fields. 11 if a stoc is associated with the spark event
O2 everywhere in an image as a function of distance from blood vessels.
+
A valid stoc (last 3 fields) must have a nonzero stoc amplitude (1st of 3 fields)
If you are planning on convolving you should probably specify -m 3 .
+
See /usr/people/lml/vision/Rhonghua/Sparks/singlesitev2 for a valid file format.
  -d x y z if -i is specified. pixel dimensions in um. default = 0.60 0.60 10.00
 
  -s # if -i is specified. scale output intensities by #. Otherwise max is 52.0 mm Hg
 
  -o xorig yorig zorig: location of the blood vessel in the image (zero indexed, floating point)
 
blur3d may care about this, depending upon options. default = (0.00,0.00,0.00)
 
(maybe I should change this to define a line in the image when -m 1 is specified?)
 
-p the output image should be for the simple 1/r point source (see -r explanation) rather
 
for the line source (-m 1) or point source with O2 consumption (-m 2 or -m 3).
 
  
    other options:
+
Usage: sparkspread [options] datafile
  -v verbose. stuff to stderr.
+
options:
  -V more verbose. stuff to stderr. debugging info.
+
  -h: do NOT print histogram for intraspark data.
  -h print this help
+
  -H: do NOT print histogram for interspark data.
 +
  -c: do NOT print cumulative distribution for intraspark data.
 +
  -C: do NOT print cumulative distribution for interspark data.
 +
  -b #: number of bins for histogram, default = 20
 +
  -n: normalize the histograms so their maximum is 1
 +
  -k: also print ks statistic showing if two distributions are different.
 +
 +
</nowiki>
 +
===  spot_diffusion  ===
 +
<nowiki>
 +
unknown option h
 +
 
 +
Prints out time (secs) and concentration (nMolar) seen at a distance
 +
from a channel with a constant current, open for specified time.
 +
 
 +
Usage: spot_diffusion [options] 
 +
options:
 +
  -D #:  diffusion (cm^2/sec), default = 2.2E-06
 +
  -c #:  current (pAmp), default = 1
 +
  -s #:  starting concentration (resting level, in nM), default = 0
 +
  -T #:  total time to simulate (seconds), default = 1.000000
 +
  -t #: length of time current is on (seconds), default = 1.000000
 +
  -r #: distance from channel opening (um), default = 0.100000
 +
  -R r0 r1 dr: average over a range of distances (crude psf), from r0 to r1 by dr (in um)
 +
  -n #: number of time points to sample, default = 1000.000000
 +
 +
</nowiki>
 +
===  total_ca  ===
 +
<nowiki>
 +
#/home/lml/krypton/bin/total_ca
 +
 
 +
Reads in a floating point image or short int image as produced by simulation (i.e., cylindrical coords), calculates
 +
the total calcium change (i.e., [ca](r)*pi*r*r - t(0)) as a function of distance from the calcium entry site.
 +
Output is printed to stdout.
 +
All input concentrations should be in nM
 +
Each z slice is analyzed separately (i.e., z is assumed to be time) unless image is rectangular and 3D (-R).
  
Examples:
+
Usage: total_ca [options] ca.i2i
       # create a binary image of blood vessels (maybe use BestPath3D_ellipse instead? Maybe thin3D afterwards?):  
+
       options for printing graphs of calcium (not concentration) vs. distance from ca entry location:
    mask_image -m 2700 -r 1 G03_x_1_2_r4.i2i G03_x_1_2_r4.i2i G03_x_1_2_r4_binaryvessels.i2i
+
the units for the graph are nM*um^3, but 1nM = .6ions/um^3 , so multiply be .6 to get ions
      # create a psf of blood oxygenation:
+
                      (and 1pA = 3,000 ions/msec if you want to convert to pA-msec).
    oxygen -s 500 -i O2ptsource.i2i 50 50 21 -d 2.58 2.58 10 -o 25 25 10 -m 3 -r > O2ptsource.xy
+
        -n: normalize calcium distance graph for each z slice (so sum of amplitudes = 1),
    blur3d -S .002 -Z -d -v G03_x_1_2_r4_binaryvessels.i2i O2ptsource.i2i G03_x_1_2_r4_O2.i2i
+
                      (otherwise when graph spacing is changed, -g option, the height of the graph will change).
 
+
  -a:    print absolute calcium, not delta calcium (the default).
see also: /home/lml/krypton/Corvera/Olga/README, SteadyStatePointDiffusion.pdf (my notes)
+
                      when this is applied to a uniform image it should produce a 4pi*r*r distribution.
        Random Walks in Biology (New, expanded edition) by Berg p. 23 eq. 2.11;
+
            The default, delta calcium, prints the delta (i.e., change) from slice 0 (regardless -z option)
The Mathematics of Diffusion (2nd Ed) by Crank p. 32 eq  3.5b; p. 89 eq 6.5; p. 102 eq 6.60; p. 330 eq 14.13
+
        (but delta calcium not calculated if 3D rectangular, i.e., -R specified).
source code in: /home/lml/krypton/facil
+
 
error: A model must be specified, i.e., -m # must be specified.
+
  -p # #: pixel size in microns in the radial (x) and lengthwise (y) directions,
 
+
default =  0.10 and  0.10
 
+
  -P # # #: pixel size in microns in x,y,z directions (rectangular not cylindrical coords),
</nowiki>
+
default = ( 0.10, 0.10, 0.10)
===  sparkspread ===
+
  -r: data is rectangular, not cylindrical coords (-P sets this too)  
  <nowiki>
+
(e.g., already passed through cyl2cart).
 
+
  -R: data is 3D rectangular (not 2D+time), not cylindrical coords.
Calculates the spread of spark event amplitudes given that two events occur at the same
+
  -e x y:      0-indexed coords of calcium entry location (default: x= 0, y = ydim/2)
spark site and compares it to the spread of amplitudes given that two events occur at
+
  -E x y x:    0-indexed coords of calcium entry location for 3D rectangular data
different spark sites. A spark site has a unique (x,y) position.
+
(i.e., z direction is not time). sets -R option.
Prints mean and stddev to stdout. Also prints out histograms and cumulative distributions.
+
        -g #: graph spacing. default is the pixel size.
 +
        -s #:        subsample each voxel this number of times in the x (radial) and y (longitudinal) directions,
 +
                      (and z if 3D and not 2D+time) default = 3 (anything less tends to introduce errors).
 +
        -z low hi dz: only look at z slices low to hi (0-indexed, inclusive), stepping by dz.
 +
 
 +
see also:
 +
    printvals, float2int, in matlab: readxmgr, acurves (see ~lml/krypton/JSinger for an example)
 +
 
 +
source code in ~lml/krypton/Walsh directory.
 +
 +
</nowiki>
 +
===  vcspat-models ===
 +
  <nowiki>
 +
argc = 1
 +
 
 +
This program creates a volume image with objects randomly placed
 +
within it.  The mask image defines where an object is allowed to be placed.
 +
The mask value can be changed with the -M option.  Objects can either be individual
 +
voxels (the default) or tiny images (-o option) or connected voxels in an image (-O).
 +
 
 +
Usage:
 +
  vcspat-models [options] mask.i2i out.i2i
 +
 
 +
Options:
 +
  -m #    : model number (default 0).
 +
            0 - grid pattern
 +
            1 - random pattern
 +
  -M #    : value of mask pixels (default 1).
 +
  -r #    : number of random points to use in random pattern (default 25000)
 +
  -o name  : image to use at point in pattern (default just turns on a pixel)
 +
(can use up to 256 images - image will be randomly chosen)
 +
  -a : if objects overlap, add their pixel values instead of just replacing
 +
 
 +
Options related to objects:
 +
  -O thresh name.i2i: threshold an image to use for objects. Extracts as an object each
 +
            connected set of voxels above threshold.  Places these  objects randomly
 +
            into the output image (uses each object once). Use with the
 +
            -m 1 option. Do not use the -r option
 +
  -P name.i2i id.i2i: similar to -O option, extracts as an object each of the
 +
    the objects in name.i2i based upon their pixel values (object id) in id.i2i
 +
(e.g., id.i2i was produced via objs_via_ascent). This option preserves the
 +
distinction between objects in name.i2i which may be touching - since simple thresholding is not used.
 +
If only an id.i2i is available (no name.i2i), you can specify -P id.i2i id.i2i
 +
  -v: replace objects (after fitting them into the image) with just the single voxel
 +
at the brightest location in the object.  Only use with -O and -e options.
 +
  -S # #:  minimum and maximum object sizes to allow (use with -O option).
 +
  -e: do not allow (exclude) objects to be placed so that they overlap with each
 +
other, go outside the image, or go outside the mask.  The default is to allow
 +
overlaps and to just zero out that part of an object which goes outside the
 +
image volume or mask.
 +
  -n: number the objects in out.i2i (use with -O or -P options). Rather than all
 +
the pixels in an object being their original values, all the pixels in object 1
 +
will be labeled 1, all those in object 2 labeled 2, etc.  If -e not specied and
 +
objects overlap the first object placed (usually the largest) will prevail.
 +
Can also be used with -v, then output will have the brightest voxel set to object id, others to 0.
 +
The output of this can be analyzed by object_overlap program.
 +
  -N out2.i2i:  create a second output file, number the objects in out2.i2i (like -n).
 +
 
 +
OtherOptions
 +
  -s #    : seed for random number generator (default pid)
 +
  -x #    : x increment for grid pattern (default 3)
 +
  -y #    : y increment for grid pattern (default 3)
 +
  -z #    : z increment for grid pattern (default 3)
 +
  -V: verbose
 +
 
 +
note: entire image name (with extension) is required.
 +
note: a - in place of an image name means stdin or stdout.
 +
Examples:
 +
  objs_via_ascent in1.i2i inid1.i2i
 +
  objs_via_ascent in2.i2i inid2.i2i
 +
  vcspat-models-new -m 1 -M 1 -P in1.i2i inid1.i2i -N outid1.i2i  mask.i2i out1.i2i
 +
  vcspat-models-new -m 1 -M 1 -P in2.i2i inid2.i2i -N outid2.i2i  mask.i2i out2.i2i
 +
  object_overlap outid1.i2i outid2.i2i  > obj_overlap
 +
  overlapL out1.i2i out2.i2i > coloc
 +
 
 +
See also:  krypton/Qiong/run1,  vcspat, randompuncs, spatial_stats2, objs_via_ascent, countobjs
 +
 
 +
Source code in /storage/big1/lml/jac/was_invitro/Projects/cspat-volume
 +
 
 +
</nowiki>
 +
== Image Analysis ==
 +
===  Corecell.pl  ===
 +
<nowiki>
 +
 
 +
Takes a 3d image and an outline and keeps all data pts within the specified distance
 +
of the outline (removes the "core" of the cell). 
 +
Also produces a file named in_image_H.histo. See help for histogram2 about that.
 +
If in_image2.i2i out_image2.i2i are specied, in_image2.i2i is also cored
 +
(and histogram2 is applied to the pair in_image.i2i and in_image2.i2i when producing in_image_H.histo).
 +
 
 +
Written to let Ronghua only keep BK and Ryanodine label near the plasma membrane.
 +
Note: touching voxels may have a distance of .5 voxels, and voxels at the same
 +
      position may have a distance of -.5 (??)
 +
Note: pixels may be kept near the end of the cell, since they have close distance to the end
 +
      (rather than to the plasma membrane. Might -Z # # option to histogram2 fix this?).
 +
Note: there might be problems if boundary.pts touches the edge of the image.
 +
 
 +
 
 +
Corecell.pl [options] in_image.i2i boundary.pts out_image.i2i [in_image2.i2i out_image2.i2i]
 +
 
 +
options:
 +
-interp interpolate missing z slices in boundary.pts before using it.
 +
zslices must be in ascending order in boundary.pts.
 +
contours must all be drawn in the same direction (i.e., all clockwise or all counter-clockwise).
 +
The name of each object is changed to "nuke".  A maximum of 1000 zslices is allowed.
 +
-shrink=#  shrink boundary.pts by this number of pixels before using it
 +
-expand=#  expand boundary.pts by this number of pixels before using it
 +
-zrange=#:#    only examine z slices (1-indexed in this range)
 +
-dist=#: keep all voxels within this distance of the boundary, default = 2
 +
-dx=#          pixel size x size (default = 1. all that really matters is relative x,y, and z size)
 +
-dy=#          pixel size y size (although if you change this then that may affect -dist)
 +
-dz=#          pixel size z size
 +
-dontcapends    first and last outline slices aren't capped (removes -c from the call to histogram2).
 +
        typically you'd use this if the outlines are circular cross-sections of a cylindrical
 +
cell (ie, z is along the length of the cell).  If the outlines are along the length
 +
of the cell (ie, cell is in the xy plane, as Jeff likes to do), then you wouldn't use this option.
 +
-verbose print out extra info to stderr as it goes along
 +
-vverbose very verbose
 +
-keepfiles keep all intermediate files (all begin with _)
 +
 
 +
example:
 +
  #cell's length is in the xy plane, need to flip it to get cross sections to outline with planimeter3
 +
  transp -YZ im.i2i im_YZ.i2i
 +
planimeter3 -I im_YZ.i2i -R im_YZ.pts
 +
  transp -YZ im2.i2i im2_YZ.i2i
 +
  #cell's original zspacing = 250 nm, but x and y are 80, so relative spacing is about 3:1, after transp
 +
  #it is the y direction that has the 250 nm spacing.
 +
Corecell.pl -dy=3 -dist=3 -interp im_YZ.i2i im_YZ.pts im_YZ_near_pm.i2i im2_YZ.i2i im2_YZ_near_pm.i2i
 +
dave -T 1 YZ -T 2 YZ -z 3 -I im_YZ_near_pm.i2i -I im2_YZ_near_pm.i2i
 +
 
 +
see also: shrink_wrap (to apply prior to Corecell.pl to get a better starting surface)
 +
 +
</nowiki>
 +
===  count_2d_objs2.pl  ===
 +
<nowiki>
 +
run countobjs on a 2D time series
 +
creates temporary files _temp.i2i and _temp.stats in the current directory.
 +
note: scale and black level forces each time point to be rescaled the same and
 +
      therefore to be thresholded the same.
 +
file.stats will have data ordered as:
 +
time number_of_objects mean_iod sd_iod mean_size sd_size
 +
 
 +
count_2d_objs2.pl [options] image.i2i file.stats
 +
 
 +
options:
 +
  -tstart=# first time point to examine, default = 1
 +
  -tstop=# last time point to examine, default = last z slice.
 +
  -min=# minimum size object to allow, default = 1
 +
  -max=# maximum size object to allow, default = 100000
 +
  -thresh=# threshold, default = 0
 +
  -scale=# scale, default = 1
 +
  -black=# black, default = 0
 +
  -allstats=filename print info about each object to _temp.stats (otherwise just summary stats from each t printed)
 +
and rename it "filename"
 +
  -outimage=image.i2i see -o option in countobjs.
 +
  -Outimage=image.i2i see -O  option in countobjs
 +
  -Qimage=image.i2i see -Q option in countobjs, note: id numbers will restart from 1 on each slice.
 +
 
 +
  -verbose
 +
  -dummy
 +
  -noclean
 +
 
 +
 +
</nowiki>
 +
===  distance2surface_overtime.pl  ===
 +
<nowiki>
 +
 
 +
Finds the distance (in pixels) of a specified pt (over time) from the nearest pixel
 +
greater than 0 in 3Dimage.i2i (or greater than -threshold).  Alternatively, finds
 +
the distance to the boundary surface specified with the -surface option.
 +
The coords is as produced by track_pts (x y z otherstuff).
 +
Written to let Andrea take a tracked gene in the nucleus and find its
 +
distance to the nuclear envelope over time.
 +
Note: touching voxels may have a distance of .5 voxels, and voxels at the same
 +
      position may have a distance of -.5 (??)
 +
 
 +
distance2surface.pl [options] 3Dimage.i2i specifiedpt.coords outfile.dist
 +
 
 +
options:
 +
-surface=boundary.pts find distance to the surface defined by boundary.pts
 +
  rather than the distance to nearest >0 voxel 3Dimage.i2i
 +
-shrink=#  shrink boundary.pts by this number of pixels before using it
 +
-expand=#  expand boundary.pts by this number of pixels before using it
 +
-zrange=#:#    only examine z slices (1-indexed in this range)
 +
-threshold=#    threshold 3Dimage.i2i (voxels <= threshold set to 0, > threshold set to boundary).
 +
-pixel=# pixel size (in x and y) in nm
 +
-verbose print out extra into to stderr as it goes along
 +
-vverbose very verbose
 +
-keepfiles keep all intermediate files (all begin with _)
 +
 
 +
 +
</nowiki>
 +
===  extract_area2.pl  ===
 +
<nowiki>
 +
Can't use 'defined(@array)' (Maybe you should just omit the defined()?) at /home/lml/krypton/bin/extract_area2.pl line 85.
 +
 
 +
</nowiki>
 +
===  findpaths_exo4.pl  ===
 +
<nowiki>
 +
 
 +
this program takes output from exo4.
 +
similar to findpaths_exo3.pl, but parses exo4 output rather than exo3 output.
 +
 
 +
usage:
 +
  findpaths_exo4.pl file1.out
 +
 
 +
options:
 +
 
 +
which paths:
 +
  -prestring="# debugpath 3 (102,156,-1):"  pull out paths that begin with this. default is the null string.
 +
    : null string paths should also be saved_paths later.
 +
    : "# debugpath .*:"  will pull out all the debugpaths (. matches any char and * means
 +
    : number of them)
 +
  -saved_paths     :  all the saved paths (within -zrange if that is also specifed)
 +
  -debugpaths     :  all the debug paths.  These options are mutually exclusive.
 +
  -zrange=minz:maxz     :  only print tracks which start within the z range specified (1-indexed, inclusive)  
 +
 
 +
what to do with the paths:
 +
  -saved_labels=filename    :  implies -saved_paths. saves labels for each path into the specified filename. This
 +
    :  file can be read into play so that labels are visible at a location.
 +
for rpts file:
 +
  -rptsfile=track.rpts      :  create an rpts file (initially empty). use -rptstracks and -printfusion to put stuff in it.
 +
  -rptstracks     :  put paths (tracks) into the rpts file specified with -rptsfile    
 +
  -printfusion=#     :  print box (of width #) around fusion events to rptsfile. must us -rptsfile option with this.
 +
    :  note: -debugpaths do not have valid fusion times.
 +
  -pathcolor=#     :  instead of -1
 +
  -boxcolor=#     :  color of fusion box. instead of -2
 +
 
 +
for xmgr file:
 +
  -trackxmgr=track.xmgr    :  create an xmgr file of the tracks produced by the program "exo".
 +
  -truetime     :  rather than use z value as "time" calculate time based on the "burst protocol"
 +
    :  of 60 seconds acquisition at 1Hz followed by 3 seconds at 20HZ, repeatedly.
 +
  -peak     :  rather than print avg (iod/size), print the peak pixel value (ie, value of maxima).
 +
  -finalfit     :  rather than print avg, print the best fit curve (based on final fit parameters).
 +
  -initfit     :  rather than print avg, print the init fit curve (based on initial fit parameters - for debugging).
 +
  -distance     :  rather than print avg, print the distance from the first pt on the curve.
 +
  -maxtracks=#     :  for -trackxmgr, only print out this many tracks.
 +
  -tracks=start:skip     :  for -trackxmgr, only print tracks starting at track "start" (1-indexed) and
 +
    :  skip "skip" paths beforing printing another one (e.g., print every skip paths).
 +
    :  this lets you print a subset of paths which are still spread over the entire z range
 +
    :  to make visualization easier. skip = 0 means don't skip any. 
 +
misc:
 +
  -verbose
 +
  -stationary_time=filename : print time each path is stationary prior to fusion to specified file
 +
 
 +
example:
 +
  exo4 -d 120 -o adp12273_ids.i2i -V -w 10 -b 2 adp12273_c1_z1201_1320_masked.i2i > & adp12273_c1_z1201_1320_masked.out
 +
  play -min 0 adp12273_ids.i2i    # maxima of each region should be blue
 +
  findpaths_exo4.pl -trackxmgr=adp12273.xmgr -truetime adp12273_c1_z1201_1320_masked.out
 +
  xmgr adp12273.xmgr    #clicking on each set brings up its legend info which has its
 +
        #starting coord (1-indexed I think) and value.
 +
  findpaths_exo4.pl -rptsfile=adp12273.rpts -rptstracks -printfusion=4 adp12273_c1_z1201_1320_masked.out
 +
  addlines adp12273_c1_z1201_1320_masked.i2i adp12273.rpts - | play -P -1 R -P -3 G -
 +
 
 +
see also:  ~lml/krypton/Huang/TIRF4/graph_exo3.csh
 +
 +
</nowiki>
 +
===  get_find_vesselness_results.pl  ===
 +
<nowiki>
 +
Can't use 'defined(@array)' (Maybe you should just omit the defined()?) at /home/lml/krypton/bin/get_find_vesselness_results.pl line 115.
 +
 
 +
</nowiki>
 +
===  mask_and_coloc.pl  ===
 +
<nowiki>
 +
Takes a threshold, x and y translation for vinculin image, a pts file, and two images, and creates a mask
 +
and then calculates colocalization. See README.
 +
 
 +
mask_and_coloc.pl -x=# -y=# -thresh=# -pts=file.rpts -vin=vin.i2i -trip=trip.i2i
 +
 
 +
options:
 +
  -tx=# translate by a max of -tx when calculating other colocalization numbers, default = 25
 +
  -ty=#
 +
  -step=# step size for other translations, default = 5
 +
  -noclean don't clean up (ie, don't remove) intermediate files created during this analysis
 +
  -overlap=file   just calculate overlap3, reusing the other files, put result into file.
 +
 
 +
 +
</nowiki>
 +
===  mask_gedmat_images4.pl  ===
 +
<nowiki>
 +
  mask_gedmat_images4.pl  -check_intersect  added.
 +
determines when outlines intersect and sets the aerr (area error flag) in the
 +
output file. eventually it will calculate areas a different way when that happens
 +
rather than combining masked images (see ~/krypton/Corvera/Raz/README for 10/18/13). not done yet ...
 +
 
 +
  Examines all the zip files (produced within fiji when outlining regions) in the current directory. These have
 +
  the boundary of the explant, day7 growth, and day11 growth.
 +
  note: this program assumes that all the data in the directory is from the same patient and the same tissue type.
 +
 
 +
  It recalculates the area measures by only including that part of the day7 and day11 growth which is between the explant
 +
  center and going towards the center of the well; area from the explant center going away from the center of the
 +
  well (ie, growing towards the well wall) is excluded. By doing this, we hope to minimize the
 +
  effect of growth (as measured by area) being stopped by the well wall when the explant is near the well wall. 
 +
  Output is written to stdout. The comments there explain the fields. area_mex is the old value, area_mex_border is the new.
 +
 
 +
  This is done by finding all the *_Area.zip files in the current directory, pulling out the outlines in those files
 +
  and using that information to recalculate areas.  It also needs to find the associated "combined" image file
 +
  (*_combined.i2i) to get image size and hence the position of the center of the well) and the fiji results file
 +
  (*_results.txt, so the numbers produced here can be easily compared with them).
 +
 
 +
  note: The algorithm assumes that the area NEVER DECREASES with time, and that the explant region is always surrounded
 +
by the day7 region which is surrounded by the day11 region. The latter assumption is sometimes invalid if
 +
the day 11 images were shifted relative to day 7 images; but that is usually ok.
 +
(if necessary, you can manually change the "bad_data" field in the output file to 1 and then use
 +
-cond in gedmat_to_xy.pl to eliminate those stats from further analysis.)
 +
It also assumes the smallest area in each zip file is the original explant area, the next largest area is
 +
called day7 area and the largest area (if 3 are present) is assumed to be day 11 area.
 +
Sometimes when growth is about 0, the outlines on, eg, day7, may have slightly less area than the original
 +
explant, so the outlines might be mis-ordered then. [actually it may read the correct day off the name of
 +
the i2i image now].
 +
 
 +
  note: If only 2 areas (ie, two .roi files) are present in the zip file, they are assumed to be for
 +
the explant and day7 (not day11).
 +
 
 +
  note: This program assumes the center of the combined image (usually 4 well images are combined into one) is the
 +
center of the well. see combine_images.pl. It also assumes the combined image name ends in combined.i2i
 +
(see -combined).
 +
 
 +
  note: some of the scripts I use to then analyze these results will multiply the area by 2, to get a "true" estimate
 +
  of growth; since the value produced by mask_gedmat_images3.pl will be (roughly) half of the real growth rates.
 +
 
 +
  usage:
 +
mask_gedmat_images3.pl  [options]
 +
 
 +
  options:
 +
-tmpdir=fullpathname directory to use for temporary files which are created, eg: -tmpdir=/home/lml/krypton
 +
 
 +
-zip_file=file.zip
 +
-zip_file=file.zip:file2.zip:...:filen.zip
 +
only examine the one specified zip file, not all those in the directory
 +
(If the second form is used, you can specify as many as you want.)
 +
note: you may still need to specify -zip_ending so that the ending of this file can be stripped
 +
      off correctly (so the -combined_ending and -results_ending can then be added correctly).
 +
-zip_ending=stuff e.g., -zipending=_area.zip  .  All files which end in this will be analyzed; default = _Area.zip
 +
-skip=file.zip[:file2.zip...]  list of zip files (without the full path) to skip.
 +
 
 +
-results_ending=stuff e.g., -results_ending=_results.txt  .  This is what the -zip_ending should be replaced by
 +
to get the name of the associated fiji results file.  note the _ should be included here
 +
if it was included in -zip_ending.
 +
 
 +
-combined_ending=stuff  e.g., -combined_ending=_combined_reduced_.i2i  . default = combined.i2i.
 +
This is any string which helps identify the last part of the combined image filename.
 +
-combined_scaling=#:# e.g., -combined_scaling=2:2 if reduceima -bin 2 2 was applied to get _combined_reduced_.i2i.
 +
 
 +
-scale=#:# distance and area (eg, -scale=2:4 if reduceima -bin 2 2 was used) scaling. This will multiply
 +
the area stored in the fiji file and the area calculated via my mask by the second number.
 +
The first number will multiply the distance of the explant from the center of the image.
 +
This option is just here to handle 001_BAP and 002_PRO datasets. They were analyzed in fiji
 +
with the images reduced by a factor of 2 in x and y. So the fiji areas produced will be low
 +
by 4x, as will my areas.  This option compensates for that.  See ~/Corvera/Raz/README for 10/11/13.
 +
 
 +
-check_intersect check if outlines intersect with the explant's outline. If so, set an error flag on stdout printout
 +
and print info to stderr.  eventually will just use area numbers rather than masking area in this situation.
 +
that is not done yet ...
 +
 
 +
 
 +
-save_day[=directory]
 +
saves the final binary mask for each days growth (eg, day7 growth minus the explant and minus the part growing towards the wall)
 +
into a 3d mask image (patientid_tissue_day#_mask.i2i).  This image will be reduced down in xdim and ydim from the
 +
original.  patientid_tissue_day#_.play_labels will also be created (labels which well each z slice comes from).
 +
This is mostly for quality control purposes.
 +
In addition, patientid_tissue_day#.rpts will be created (similarly reduced down in size) (coords may be off by 1?).
 +
View the file via: addlines maskim.i2i maskim.rpts -  |play.FC14 -P -1 R -labels maskim.play_labels -
 +
  or via: play_results3.pl
 +
patientid_tissue_day#_orig.i2i will be the original images (also reduced in xdim and ydim, and only one 2d slice
 +
from each original 3d image).
 +
note: older versions of play may need the comment line at the top of maskim.play_labels removed.
 +
note: if you want images to be in another directory, specify a full pathname, eg -save_day=/home/lml/krypton (without last /).
 +
note: any existing file with these names will be OVER-WRITTEN.
 +
note: this option creates lots of temporary files (in tmpdir) of the form __*.i2i, any existing
 +
      files that match this will be DELETED.
 +
see also: montage
 +
 
 +
-just_check just check whether each zip roi outline has the correct number of associated image files.
 +
eg, if the zip file has 3 outlines (explant, firstday, secondday) there should be two i2i files with DAY# in their name.
 +
prints to stderr info about those which don't have the correct number. does nothing else.
 +
-verbose some extra info to stdout
 +
-debug prints some tracing info to stderr
 +
-print_fname print name of each zip file as it is being analyzed, to stderr.
 +
-dlevel=# extra debugging. the bigger the number the more the printout. # is an integer starting at 1.
 +
-dlevel=1 will print a trace of commands to execute to mimic (parts of) this perl script.
 +
-noclean don't remove the temporary files which were created
 +
the files are: _ones.i2i _explant.rpts _day11.rpts _day7.rpts _excluded_region.rpts
 +
      _explant.i2i  _day11.i2i  _day7.i2i _day7_noex.i2i _day11_noex.i2i _day7_noex_halfex.i2i _day11_noex_halfex.i2i
 +
  (if multiple zip files were analyzed, only the files from the last one will be left, since they get reused)
 +
-dont_recalc only for diagnostics. does NOT restrict the analysis to just the growth away from the wall.
 +
with this specified this entire program should just reproduce the numbers we already
 +
have in *Results.txt since that uses the entire area. ie, this make the program a no-op.
 +
 
 +
  see also:
 +
/home/lml/krypton/Corvera/Raz/README
 +
analyze_gedmat3.pl a script which calls mask_gedmat_images3.pl for all of Raz's data. Also versions 4,5,6, and 7.
 +
play_results3.pl
 +
raz_rates.pl
 +
mask_gedmat_images.pl
 +
mask_gedmat_images2.pl
 +
/storage/big1/raz/GEDMAT/
 +
ReadROI.pl
 +
extract_area.pl
 +
combine_images.pl
 +
gedmat_to_xy.pl
 +
/home/lml/krypton/Corvera/Raz/analyze_gedmat.pl
 +
chres_rpts.pl
 +
  filter_rptsinz.pl
 +
 
 +
  examples:
 +
cd /storage/big1/raz/GEDMAT/006_JTH/OM
 +
 
 +
# generate 006_JTH_OM.areas with all the data (area_mex_border is the number which should replace farea)
 +
# also produce 006_JTH_OM_7masks.i2i and 006_JTH_OM_11masks.i2i so I can check on the validity of the algorithm.
 +
# place diagnostic mask images in /home/lml/krypton/Corvera/Raz/output and the output data file in
 +
# /home/lml/krypton/Corvera/Raz (note: all directories must already exist).
 +
mask_gedmat_images.pl -tmpdir=/home/lml/krypton/Corvera/Raz/output  -zip_ending=_Area.zip -results_ending=_Results.txt
 +
-combined_ending=combined.i2i -days=7:11
 +
-save_day=/home/lml/krypton/Corvera/Raz/output
 +
>& /home/lml/krypton/Corvera/Raz/006_JTH_OM.areas
 +
 
 +
# look at the masks produced:
 +
cd /home/lml/krypton/Corvera/Raz/output
 +
      play_results3.pl 006_JTH_OM_day7
 +
or:
 +
fgrep -v # 006_JTH_OM_11masks.play_labels > tmp.play_labels  # eliminate the comment line, play doesn't like those.
 +
play -labels tmp.play_labels 006_JTH_OM_7masks.i2i
 +
 
 +
# compare the full areas produced which what fiji did (as a check). only pull out the good data. they should be very similar:
 +
cd /home/lml/krypton/Corvera/Raz
 +
gedmat_to_xy.pl -cond='if (($date eq "date_sure")&&($perr==0)&&($aerr==0)) {1;} else {0;}'
 +
-xcoord='$area' -ycoord='$farea' 006_JTH_OM.areas | xmgrace -free -pipe
 +
 
 +
# now grab the data we really want. compare the old way, with the area when the growth half near the well border is masked off:
 +
gedmat_to_xy.pl -cond='if (($date eq "date_sure")&&($perr==0)&&($aerr==0)) {1;} else {0;}' 
 +
-xcoord='$area_mex' -ycoord='$area_mex_border' 006_JTH_OM.areas | xmgrace -free -pipe
 +
 
 +
# it may be hard to see some of these images as they are very large, do it this way (note the -L to keep the -1 boundary values):
 +
addlines _ones.i2i _excluded_region.rpts - | reduceima -bin 3 3 -L - -|play -P -1 R -P -2 G -P -3 B -P -4 C -P -5 Y -
 +
 
 +
 
 +
# run with some diagnostics:
 +
cd /storage/big1/raz/GEDMAT/006_JTH/OM
 +
/home/lml/krypton/bin/mask_gedmat_images.pl -tmpdir=/home/lml/krypton/Corvera/Raz -zip_ending=_Area.zip
 +
        -results_ending=_Results.txt -combined_ending=combined.i2i -days=7:11
 +
        -save_day=/home/lml/krypton/Corvera/Raz/006_JTH_OM_7masks.i2i    > /home/lml/krypton/Corvera/Raz/006_JTH_OM.areas
 +
# play.FC14 allows labels to have comment lines (first character of line is a #)
 +
cd home/lml/krypton/Corvera/Raz
 +
play.FC14 -labels 006_JTH_OM_11masks.play_labels 006_JTH_OM_11masks.i2i
 +
chres_rpts.pl -sx=.33 -sy=.33 -truncate -min=1:1 output/_day11.rpts > _day11_bin3.rpts
 +
chres_rpts.pl -sx=.33 -sy=.33 -truncate -min=1:1 output/_day7.rpts > _day7_bin3.rpts
 +
chres_rpts.pl -sx=.33 -sy=.33 -truncate -min=1:1 output/_explant.rpts > _explant_bin3.rpts
 +
reduceima -bin 3 3 output/_day11_noex_halfex.i2i - | addlines - _day11_bin3.rpts - | addlines - _day7_bin3.rpts - |
 +
addlines - _explant_bin3.rpts - | play -P -1 R -
 +
addlines /storage/big1/raz/GEDMAT/006_JTH/OM/D07_20130524_GEDMAT_006_JTH_OM_DAY7_combined.i2i output/_day11.rpts - |
 +
addlines - output/_day7.rpts - | addlines - output/_explant.rpts - | reduceima -bin 3 3 -L - - | play -P -1 R -
 +
 
 +
 
 +
# do a bunch of stuff
 +
analyze_gedmat3.pl # apply this perl script to lots of data
 +
cd output
 +
      play_results3.pl 006_JTH_OM_day7  # look at some of it
 +
raz_rates.pl # generate stats
 +
 +
 
 +
 
 +
  source code: in /home/lml/krypton/bin/mask_gedmat_images.pl
 +
 
 +
 +
</nowiki>
 +
===  mask_gedmat_images4_new.pl  ===
 +
<nowiki>
 +
  mask_gedmat_images4_new.pl
 +
The easiest way to call this is via analyze_gedmat9.pl, see its help.
 +
 
 +
This version has the following changes compared with mask_gedmat_images3.pl:
 +
 
 +
1. @stats = &outline_stats(@outline) was used to calculate explant center (for masking) but
 +
        the meanx and meany are just the mean of the outline, it is NOT a center of mass. usually ok for a compact explant.
 +
  sub calc_com() is now used instead to calculate the true center of mass.
 +
-use_explant_outline will cause the OLD method to be used instead.
 +
 
 +
2.  bounding box was used to calculate area for sorting the outlines temporally (from smaller to larger area).
 +
      but when outlines intersect bounding box can at times NOT be a good surrogate for area.
 +
  $roi_area[$r] = ($maxx-$minx)*($maxy-$miny); 
 +
  handled these two issues by writing sub calc_com().
 +
-use_bbox_area will cause the OLD method to be used instead.
 +
 
 +
 
 +
note: fiji areas are already sorted smallest to largest when I first bring them in (extract_area2.pl does that):
 +
  $prev_results = `extract_area2.pl -justfiles=$resultsfile`
 +
  so I should do not need to use the sorted roi indices on them (so I've been doing this correctly). but the rpts are
 +
  being sorted based on bounding box, and fiji areas based on the true area in the Results.txt file. So the ordering
 +
  may be different at times. No change was made to this.
 +
 
 +
  mask_gedmat_images4.pl  -check_intersect  added.
 +
determines when outlines intersect and sets the aerr (area error flag) in the
 +
output file. eventually it will calculate areas a different way when that happens
 +
rather than combining masked images (see ~/krypton/Corvera/Raz/README for 10/18/13). right now only sets the error flag.
 +
 
 +
  Examines all the zip files (produced within fiji when outlining regions) in the current directory. These have
 +
  the boundary of the explant, day7 growth, and day11 growth.
 +
  note: this program assumes that all the data in the directory is from the same patient and the same tissue type.
 +
 
 +
  It recalculates the area measures by only including that part of the day7 and day11 growth which is between the explant
 +
  center and going towards the center of the well; area from the explant center going away from the center of the
 +
  well (ie, growing towards the well wall) is excluded. By doing this, we hope to minimize the
 +
  effect of growth (as measured by area) being stopped by the well wall when the explant is near the well wall. 
 +
  Output is written to stdout. The comments there explain the fields. area_mex is the old value, area_mex_border is the new.
 +
 
 +
  This is done by finding all the *_Area.zip files in the current directory, pulling out the outlines in those files
 +
  and using that information to recalculate areas.  It also needs to find the associated "combined" image file
 +
  (*_combined.i2i) to get image size and hence the position of the center of the well) and the fiji results file
 +
  (*_results.txt, so the numbers produced here can be easily compared with them).
 +
 
 +
  note: The algorithm assumes that the area NEVER DECREASES with time, and that the explant region is always surrounded
 +
by the day7 region which is surrounded by the day11 region. The latter assumption is sometimes invalid if
 +
the day 11 images were shifted relative to day 7 images; but that is usually ok.
 +
(if necessary, you can manually change the "bad_data" field in the output file to 1 and then use
 +
-cond in gedmat_to_xy.pl to eliminate those stats from further analysis.)
 +
It also assumes the smallest area in each zip file is the original explant area, the next largest area is
 +
called day7 area and the largest area (if 3 are present) is assumed to be day 11 area.
 +
Sometimes when growth is about 0, the outlines on, eg, day7, may have slightly less area than the original
 +
explant, so the outlines might be mis-ordered then. [actually it may read the correct day off the name of
 +
the i2i image now].
 +
 
 +
  note: If only 2 areas (ie, two .roi files) are present in the zip file, they are assumed to be for
 +
the explant and day7 (not day11).
 +
 
 +
  note: This program assumes the center of the combined image (usually 4 well images are combined into one) is the
 +
center of the well. see combine_images.pl. It also assumes the combined image name ends in combined.i2i
 +
(see -combined).
 +
 
 +
  note: some of the scripts I use to then analyze these results will multiply the area by 2, to get a "true" estimate
 +
  of growth; since the value produced by mask_gedmat_images3.pl will be (roughly) half of the real growth rates.
 +
 
 +
  usage:
 +
mask_gedmat_images3.pl  [options]
 +
 
 +
  options:
 +
-tmpdir=fullpathname directory to use for temporary files which are created, eg: -tmpdir=/home/lml/krypton
 +
 
 +
-zip_file=file.zip
 +
-zip_file=file.zip:file2.zip:...:filen.zip
 +
only examine the one specified zip file, not all those in the directory
 +
(If the second form is used, you can specify as many as you want.)
 +
note: you may still need to specify -zip_ending so that the ending of this file can be stripped
 +
      off correctly (so the -combined_ending and -results_ending can then be added correctly).
 +
-zip_ending=stuff e.g., -zipending=_area.zip  .  All files which end in this will be analyzed; default = _Area.zip
 +
-skip=file.zip[:file2.zip...]  list of zip files (without the full path) to skip.
 +
 
 +
-results_ending=stuff e.g., -results_ending=_results.txt  .  This is what the -zip_ending should be replaced by
 +
to get the name of the associated fiji results file.  note the _ should be included here
 +
if it was included in -zip_ending.
 +
 
 +
-combined_ending=stuff  e.g., -combined_ending=_combined_reduced_.i2i  . default = combined.i2i.
 +
This is any string which helps identify the last part of the combined image filename.
 +
-combined_scaling=#:# e.g., -combined_scaling=2:2 if reduceima -bin 2 2 was applied to get _combined_reduced_.i2i.
 +
 
 +
-scale=#:# distance and area (eg, -scale=2:4 if reduceima -bin 2 2 was used) scaling. This will multiply
 +
the area stored in the fiji file and the area calculated via my mask by the second number.
 +
The first number will multiply the distance of the explant from the center of the image.
 +
This option is just here to handle 001_BAP and 002_PRO datasets. They were analyzed in fiji
 +
with the images reduced by a factor of 2 in x and y. So the fiji areas produced will be low
 +
by 4x, as will my areas.  This option compensates for that.  See ~/Corvera/Raz/README for 10/11/13.
 +
 
 +
-check_intersect check if outlines intersect with the explant's outline. If so, set an error flag on stdout printout
 +
and print info to stderr.  eventually will just use area numbers rather than masking area in this situation.
 +
that is not done yet ...
 +
 
 +
 
 +
-save_day[=directory]
 +
saves the final binary mask for each days growth (eg, day7 growth minus the explant and minus the part growing towards the wall)
 +
into a 3d mask image (patientid_tissue_day#_mask.i2i).  This image will be reduced down in xdim and ydim from the
 +
original.  patientid_tissue_day#_.play_labels will also be created (labels which well each z slice comes from).
 +
This is mostly for quality control purposes.
 +
In addition, patientid_tissue_day#.rpts will be created (similarly reduced down in size) (coords may be off by 1?).
 +
View the file via: addlines maskim.i2i maskim.rpts -  |play.FC14 -P -1 R -labels maskim.play_labels -
 +
  or via: play_results3.pl
 +
patientid_tissue_day#_orig.i2i will be the original images (also reduced in xdim and ydim, and only one 2d slice
 +
from each original 3d image).
 +
note: older versions of play may need the comment line at the top of maskim.play_labels removed.
 +
note: if you want images to be in another directory, specify a full pathname, eg -save_day=/home/lml/krypton (without last /).
 +
note: any existing file with these names will be OVER-WRITTEN.
 +
note: this option creates lots of temporary files (in tmpdir) of the form __*.i2i, any existing
 +
      files that match this will be DELETED.
 +
see also: montage
 +
 
 +
-patient5 patient5 files have some odd naming. use this option if analyzing them.
 +
 
 +
-use_explant_outline legacy. specify this if you want the center of the explant to be based on the average of the pixel positions
 +
of just the pixels along the boundary (rather than the center of mass).
 +
-use_bbox_area legacy. specify this if you want to order the outlines based on their bounding box area rather than their true area.
 +
You should probably specify both options (if you want either one), I'm not sure about consistency if only one is specified.
 +
 
 +
-just_check just check whether each zip roi outline has the correct number of associated image files.
 +
eg, if the zip file has 3 outlines (explant, firstday, secondday) there should be two i2i files with DAY# in their name.
 +
prints to stderr info about those which don't have the correct number. does nothing else.
 +
-just_stats goes a bit further than -just_check (does that too), sets -verbose and prints out stats about each outline. then exits.
 +
-verbose some extra info to stdout
 +
-debug prints some tracing info to stderr
 +
-print_fname print name of each zip file as it is being analyzed, to stderr.
 +
-dlevel=# extra debugging. the bigger the number the more the printout. # is an integer starting at 1.
 +
-dlevel=1 will print a trace of commands to execute to mimic (parts of) this perl script.
 +
-noclean don't remove the temporary files which were created
 +
the files are: _ones.i2i _explant.rpts _day11.rpts _day7.rpts _excluded_region.rpts
 +
      _explant.i2i  _day11.i2i  _day7.i2i _day7_noex.i2i _day11_noex.i2i _day7_noex_halfex.i2i _day11_noex_halfex.i2i
 +
  (if multiple zip files were analyzed, only the files from the last one will be left, since they get reused)
 +
-dont_recalc only for diagnostics. does NOT restrict the analysis to just the growth away from the wall.
 +
with this specified this entire program should just reproduce the numbers we already
 +
have in *Results.txt since that uses the entire area. ie, this make the program a no-op.
 +
 
 +
  see also:
 +
/home/lml/krypton/Corvera/Raz/README
 +
analyze_gedmat3.pl a script which calls mask_gedmat_images3.pl for all of Raz's data. Also versions 4,5,6, and 7.
 +
play_results3.pl
 +
raz_rates.pl
 +
mask_gedmat_images.pl
 +
mask_gedmat_images2.pl
 +
/storage/big1/raz/GEDMAT/
 +
ReadROI.pl
 +
extract_area.pl
 +
combine_images.pl
 +
gedmat_to_xy.pl
 +
/home/lml/krypton/Corvera/Raz/analyze_gedmat.pl
 +
chres_rpts.pl
 +
  filter_rptsinz.pl
 +
 
 +
  examples:
 +
cd /storage/big1/raz/GEDMAT/006_JTH/OM
 +
 
 +
# generate 006_JTH_OM.areas with all the data (area_mex_border is the number which should replace farea)
 +
# also produce 006_JTH_OM_7masks.i2i and 006_JTH_OM_11masks.i2i so I can check on the validity of the algorithm.
 +
# place diagnostic mask images in /home/lml/krypton/Corvera/Raz/output and the output data file in
 +
# /home/lml/krypton/Corvera/Raz (note: all directories must already exist).
 +
mask_gedmat_images.pl -tmpdir=/home/lml/krypton/Corvera/Raz/output  -zip_ending=_Area.zip -results_ending=_Results.txt
 +
-combined_ending=combined.i2i -days=7:11
 +
-save_day=/home/lml/krypton/Corvera/Raz/output
 +
>& /home/lml/krypton/Corvera/Raz/006_JTH_OM.areas
 +
 
 +
# look at the masks produced:
 +
cd /home/lml/krypton/Corvera/Raz/output
 +
      play_results3.pl 006_JTH_OM_day7
 +
or:
 +
fgrep -v # 006_JTH_OM_11masks.play_labels > tmp.play_labels  # eliminate the comment line, play doesn't like those.
 +
play -labels tmp.play_labels 006_JTH_OM_7masks.i2i
 +
 
 +
# compare the full areas produced which what fiji did (as a check). only pull out the good data. they should be very similar:
 +
cd /home/lml/krypton/Corvera/Raz
 +
gedmat_to_xy.pl -cond='if (($date eq "date_sure")&&($perr==0)&&($aerr==0)) {1;} else {0;}'
 +
-xcoord='$area' -ycoord='$farea' 006_JTH_OM.areas | xmgrace -free -pipe
 +
 
 +
# now grab the data we really want. compare the old way, with the area when the growth half near the well border is masked off:
 +
gedmat_to_xy.pl -cond='if (($date eq "date_sure")&&($perr==0)&&($aerr==0)) {1;} else {0;}' 
 +
-xcoord='$area_mex' -ycoord='$area_mex_border' 006_JTH_OM.areas | xmgrace -free -pipe
 +
 
 +
# it may be hard to see some of these images as they are very large, do it this way (note the -L to keep the -1 boundary values):
 +
addlines _ones.i2i _excluded_region.rpts - | reduceima -bin 3 3 -L - -|play -P -1 R -P -2 G -P -3 B -P -4 C -P -5 Y -
 +
 
 +
 
 +
# run with some diagnostics:
 +
cd /storage/big1/raz/GEDMAT/006_JTH/OM
 +
/home/lml/krypton/bin/mask_gedmat_images.pl -tmpdir=/home/lml/krypton/Corvera/Raz -zip_ending=_Area.zip
 +
        -results_ending=_Results.txt -combined_ending=combined.i2i -days=7:11
 +
        -save_day=/home/lml/krypton/Corvera/Raz/006_JTH_OM_7masks.i2i    > /home/lml/krypton/Corvera/Raz/006_JTH_OM.areas
 +
# play.FC14 allows labels to have comment lines (first character of line is a #)
 +
cd home/lml/krypton/Corvera/Raz
 +
play.FC14 -labels 006_JTH_OM_11masks.play_labels 006_JTH_OM_11masks.i2i
 +
chres_rpts.pl -sx=.33 -sy=.33 -truncate -min=1:1 output/_day11.rpts > _day11_bin3.rpts
 +
chres_rpts.pl -sx=.33 -sy=.33 -truncate -min=1:1 output/_day7.rpts > _day7_bin3.rpts
 +
chres_rpts.pl -sx=.33 -sy=.33 -truncate -min=1:1 output/_explant.rpts > _explant_bin3.rpts
 +
reduceima -bin 3 3 output/_day11_noex_halfex.i2i - | addlines - _day11_bin3.rpts - | addlines - _day7_bin3.rpts - |
 +
addlines - _explant_bin3.rpts - | play -P -1 R -
 +
addlines /storage/big1/raz/GEDMAT/006_JTH/OM/D07_20130524_GEDMAT_006_JTH_OM_DAY7_combined.i2i output/_day11.rpts - |
 +
addlines - output/_day7.rpts - | addlines - output/_explant.rpts - | reduceima -bin 3 3 -L - - | play -P -1 R -
 +
 
 +
 
 +
# do a bunch of stuff
 +
analyze_gedmat3.pl # apply this perl script to lots of data
 +
cd output
 +
      play_results3.pl 006_JTH_OM_day7  # look at some of it
 +
raz_rates.pl # generate stats
 +
 +
 
 +
 
 +
  source code: in /home/lml/krypton/bin/mask_gedmat_images.pl
 +
 
 +
 +
</nowiki>
 +
===  membrane3D.pl  ===
 +
<nowiki>
 +
 
 +
A script to run the routines necessary to perform 3D membrane segmentation.
 +
note: it needs write permission in the directory where inputimage.i2i resides since all output images go there too.
 +
It will run the following programs, in order:
 +
  1. /home/lml/krypton/facil/i2i2mhd (convert to mhd format)
 +
  2. /home/lml/krypton/segmentation/MR-Source/ACME/ACME-Binary/bin/cellPreprocess (median filter, fill holes)
 +
  3. /home/lml/krypton/segmentation/MR-Source/ACME/ACME-Binary/bin/resample (resample pixel sizes)
 +
  4. /home/lml/krypton/segmentation/MR-Source/ACME/ACME-Binary/bin/multiscalePlateMeasureImageFilter  (determine the planarity of each region)
 +
  5. /home/lml/krypton/segmentation/MR-Source/ACME/ACME-Binary/bin/membraneVotingField3D (update planarity based on neighbors voting)
 +
  6. /home/lml/krypton/segmentation/MR-Source/ACME/ACME-Binary/bin/membraneSegmentation  (produce segmented regions via a watershed algorithm)
 +
Each program expects input files of a certain type (e.g. unsigned char).
 +
 
 +
 
 +
usage:
 +
  membrane3D.pl [options] inputimage.[i2i|mhd|mha] outimage.mhd
 +
 
 +
output files:
 +
  inputimage.mhd produced by i2i2mhd  - short ints
 +
  inputimage_med.mhd produced by cellPreprocess
 +
  inputimage_med_resamp.mhd produced by resample, unsigned char
 +
  inputimage_med_resamp_planar.mhd produced by multiscalePlateMeasureImageFilter, floating pt (doubles) between 0 and 1, how "planar" a pt is.
 +
  inputimage_med_resamp_eigen.mhd produced by multiscalePlateMeasureImageFilter, an eigenmatrix at each pt
 +
  inputimage_med_resamp_eigen_voting.mhd produced by membraneVotingField3D, result of voting, unsigned char
 +
  outimage.mhd produced by membraneSegmentation,  result of watershed, each region labeled with an id (short integer).
 +
 
 +
note: all units below are in the same units as the pixel units (I think). So if pixel spacing is 2 (um) in x, and a radius
 +
      of 2 is specified, that is a one pixel radius.
 +
 
 +
step 1. options for converting i2i to mhd:
 +
  -convert=dx:dy:dz  The first step is converting our i2i format to mhd format.  This specifies the pixel spacing
 +
in x y and z directions for that. default assumes 1:1:1. The "conversion" really just creates inputimage.mhd which
 +
is a text header which points to the original i2i image and gives some info about it. 
 +
If the input image has a .mhd or .mha extension already (instead of .i2i) then no conversion is done.
 +
Olga's images acquired with a 10x objective have a pixel size of .645 um/pixel (and z spacing of 10 um).
 +
Example: G03_x_1_1_binned.i2i has a pixel size of 2.5x2.5x10.  So -convert=2.5:2.5:10 specifies this in the mhd header.
 +
 
 +
step 2. options for cellPreproces:
 +
this may produce an unsigned char image (?)
 +
  -median=# radius of median filtering preprocessing (and hole filling). If this is not specified it isn't done.
 +
 
 +
step 3. options for resampling:
 +
this may produce an unsigned char image (?)
 +
  -resample=x:y:z  resample in the x y and z directions, eg. -resample=2:2:1 will halve the x and y dimensions and leave z unchanged.
 +
note: this will change the spacing between the pixels; but the routines which follow will understand that.
 +
For example: if after resampling, the pixels are spaced 10 um apart, then -planar=10 will use a sigma of 1 pixel.
 +
If this is not specified it isn't done.
 +
 
 +
  note: it may be necessary to do the above operations, which also convert the image into unsigned char, which is required for
 +
step 4, multiscalePlateMeasureImageFilter?
 +
  note: step 6 (watershed) may also work best if the pixel sizes are the same in all directions.
 +
 
 +
step 4. options relating to planarity:
 +
the planarity image produced will be doubles from 0-1.
 +
  -planar=# the sigma of the Gaussian used when classifying pixels as planar or not. default = 1
 +
  -alpha=# see the help for /home/lml/krypton/segmentation/MR-Source/ACME/ACME-Binary/bin/multiscalePlateMeasureImageFilter
 +
  -beta=# ditto
 +
  -gamma=# ditto
 +
  -c=# ditto
 +
  -planaropts="options for multiscalePlateMeasureImageFilter here" 
 +
available options (so far, but anything specified here will be passed), : -a # -b # -g # -c # -d -s -B -T
 +
options which go here should be specified in the format that multiscalePlateMeasureImageFilter wants them,
 +
for example: -planaropts="-c 5 -d -B"
 +
not in the alternative format that Membrane3D.pl desires (e.g. -planaropts="-a 5" is correct, -planaropts="-alpha=5" is wrong).
 +
    -stop_after_planar don't do anything after this step (e.g. voting for planar patches may not make sense if -B or -T specified)
 +
 
 +
step 5. options relating to voting:
 +
the resulting tensor vote image will be unsigned chars from 0-255.
 +
  -region=# the sigma which defines the region within which a pixel influences other pixels. default = 10
 +
 
 +
step 6. options relating to watershed segmentation:
 +
The resulting image will be long ints (id numbers) of regions. 
 +
                See the help for /home/lml/krypton/segmentation/MR-Source/ACME/ACME-Binary/bin/membraneSegmentation
 +
  -thresh=# threshold value. this is applied to the tensor voting image to turn it into a binary image. then a  distance
 +
transform and watershed are applied. default = 128
 +
  -segopts="options for membraneSegmentation here"   
 +
for example:  -segopts="-S -l 20 -a 5 -c -D" will use this exact string as options.
 +
options so far: -S -l # -a # -s # -n -i # -w # -m # -c -v -d -D
 +
 
 +
other options:
 +
  -verbose echo what is being done to stderr
 +
  -dummy don't really do anything; echo what would have been done to stderr.
 +
 
 +
example:
 +
reduceima -bin 4 4 G03_x_1_1.i2i G03_x_1_1_binned.i2i    - go from .645um/pixel, 10um in z -> 2.5um/pixel, 10um in z
 +
# -convert: just put correct pixel size info into an mhd header
 +
# -median:  smooth with a filter 10 um (4 pixels, since they are now 2.5um/pixel) in radius (diameter?)
 +
# -resample: change to a square pixel (10 um in x y and z). Change image format to unsigned char (needed by MultiscalePlateMeasureImageFilter)
 +
# -planaropts: options for planarity filter
 +
# -region:  width (in um) of neighbors for voting on planarity and updating it.
 +
# -segopts:
 +
# -thresh:  threshold for watershed segmentation
 +
membrane3D.pl -convert=2.5:2.5:10 -median=10 -resample=2:2:1 -planaropts="  " -region=50 -segopts="  "  -thresh
 +
G03_x_1_1_binned.i2i G03_x_1_1_results.mhd
 +
 
 +
see also: /home/lml/krypton/segmentation/MR-Source/ACME/lmltest/README
 +
  /home/lml/krypton/segmentation/FindingCellMembranesIn3D.pdf
 +
          i2i2mhd - convert i2i into mhd format
 +
  mhd2i2i - convert an mhd image (but not an eigenimage)
 +
  RegionId2Mesh - will convert the ID image produced into a mesh image or rpts file
 +
  mayavi2  - to visualize *.mha and *.mhd files.
 +
  Fiji - my version has a File-> Import metaimage  plugin
 +
 
 +
 +
</nowiki>
 +
===  Norio_stats.pl  ===
 +
<nowiki>
 +
 
 +
This programs takes each pts file in the current directory, thresholds the associated vinculin image,
 +
applies that mask to the trip6 image, and produces a .coloc file from the masked trip6 image (using mask_and_coloc.pl);
 +
overlap statistics are then calculated (and put into a file name *_masked.coloc where * is the root of the trip6 image name)
 +
and finally the highest ratio data from each image pair is printed to stdout (using sort_overlap3.pl).
 +
 
 +
stats.pl [options]  > stats.out
 +
  -nothing : do nothing, just echo what would be done
 +
  -h : print this help
 +
  -thresh=#    : threshold for the vinculin image. default = 20
 +
  -regions=#:#  : only allow mask regions within the specified min:max size (in pixels, inclusive).
 +
: Also creates *_count.i2i  and *.countobjs  (* = root of vinculin image name) intermediate files.
 +
: note: these counts are for the vinculin image after the mask (pts file) is applied.
 +
  -clean:      : clean up (ie, remove) *_count.i2i and *.countobjs images (if -regions specified)
 +
 
 +
 +
</nowiki>
 +
===  run2_Ronghua.pl  ===
 +
<nowiki>
 +
 
 +
this program goes through Ronghua's directory (see -dir option)
 +
analyzing files.  output is put into the current working directory (ie, the directiory
 +
run.pl is run from).
 +
A tag in the name of the form Ryr_thresh_minsize_maxsize_Bk_thresh_minsize_maxsize
 +
is added to the output name  of name.patchdist  (nearest voxel distance between whole
 +
patches) and name.comdist (distances between nearest center of mass of the patches).
 +
 
 +
usage:
 +
  run.pl [options]
 +
 
 +
options:
 +
  -dir=directorypath    : without the final slash. directory to analyze. default = /mnt/big3/rzg/mtc/immunocytochemistry/july05/imcc/70105/epr
 +
  -ryrthresh=# : threshold for ryr (488) images, default =
 +
  -min_ryrsize=# : minimum allowed object size in pixels, default = 5
 +
  -max_ryrsize=# : max allowed object size in pixels, default = 150
 +
  -min_ryriod=# : minimum allowed object iod, default = 354
 +
  -max_ryriod=# : maximum allowed object iod, default = 10000000
 +
 
 +
  -bkthresh=# : threshold for bk (594) images, default =
 +
  -min_bksize=# : minimum allowed object size in pixels, default = 5
 +
  -max_bksize=# : max allowed object size in pixels, default = 50
 +
  -min_bkiod=# : minimum allowed object iod, default = 4686
 +
  -max_bkiod=# : maximum allowed object iod, default = 10000000
 +
 
 +
  -dx=# : relative distance in x, default = 1
 +
  -dy=# : relative distance in y, default = 3
 +
  -dz=# : relative distance in z, default = 1
 +
 
 +
  -noclean
 +
  -debug
 +
  -verbose
 +
 
 +
 +
</nowiki>
 +
===  countobjs  ===
 +
<nowiki>
 +
Usage:
 +
  countobjs [options] outputfile image1.i2i [image2.i2i]
 +
Description:
 +
  Count objects in co-localized images. If only one image given
 +
  the objects will be counted in that one image.  Copious amounts
 +
  of information will be written to the output file.
 +
  A - for outputfile will write to stdout.
 +
  outpufile can be analyzed with objs2bb.pl and objs2dist.pl
 +
 
 +
Options:
 +
  -C # #        : set opacity and brightness level to these values (0-255 only)
 +
  -k            : use original images for data analysis (so scale and black level not important and
 +
      -t option can be in same units as original, unscaled, image values)
 +
  -S # # #      : image # scale and black level (default autoscale image)
 +
  -r # # # # # # : region of image to count
 +
                  (-r x0 y0 z0    x1 y1 z1)
 +
                  (  ^lower left  ^upper right)
 +
                  (zero indexed coordinates)
 +
                  (default whole image)
 +
  -s # #        : size of smallest and largest objects to count
 +
                  (default 1-100000)
 +
  -m # #        : min and max iod of allowable objects (applied to image1 only).
 +
  -t thresh1 thresh2    : thresholds (applied after -S or default scaling, unless -k specified).
 +
                  Like left brightness slider in DAVE.
 +
                  if only one image, second number still required, but ignored.
 +
  -o <image.i2i> : output image with all objects represented by the voxel
 +
                  with the maximum intensity in the object
 +
                  the intensity of the voxel will be the IOD of the object.
 +
  -O <image.i2i> : output image with all pixels in each object having
 +
                  the intensity of the original objects IOD.
 +
                  NOTE: this image will be in floating point format.
 +
                        use float2int to convert it back to "normal" format.
 +
  -Q <image.i2i> : output image with all pixels in each object having
 +
                  a unique id # (1-# of objects). Must be < 32766 objects.
 +
                  NOTE: this image will be in standard signed short int format.
 +
  -M #          : When countobjs is given 2 images, this flag will
 +
                  turn of some subset of the voxels for colcalization.
 +
                  calculations.
 +
                  0: turn off colcalized voxels (default on)
 +
                  1: turn off image 1 voxels (default on)
 +
                  2: turn off image 2 voxels (default on)
 +
  -q     : quiet. don't print out all objects, but just summary statistics
 +
  -Z            : simple analysis, no sliders, opacity,etc. can use with -t option.
 +
  -h            : show this message.
 +
  -H            : show even more help.
 +
 
 +
Notes:
 +
  A - in place of an image name means stdin or stdout.
 +
  Source code in /storage/big1/lml/jac/was_invitro/Projects/countobjs
 +
 
 +
 
 +
</nowiki>
 +
===  countobjsmax3d  ===
 +
<nowiki>
 +
Usage:
 +
  countobjsmax3d [options] -Q imageid.i2i outputfile image1.i2i
 +
Description:
 +
  This version of countobjs finds 3d maxima in image1.i2i, then finds all pixels connected
 +
  to each maxima and downhill from it.  These are labelled with a unique id number and stored
 +
  in imageid.i2i (specified with the -Q option, which is REQUIRED for this version)
 +
  You may want to display imageid.i2i after using colorize_image on it.
 +
  Not tested yet.
 +
 
 +
  Count objects in co-localized images. If only one image given
 +
  the objects will be counted in that one image.  Copious amounts
 +
  of information will be written to the output file.
 +
  A - for outputfile will write to stdout.
 +
  outpufile can be analyzed with objs2bb.pl and objs2dist.pl
 +
 
 +
Options:
 +
  -r # # # # # # : region of image to count
 +
                  (-r x0 y0 z0    x1 y1 z1)
 +
                  (  ^lower left  ^upper right)
 +
                  (zero indexed coordinates)
 +
                  (default whole image)
 +
  -s # #        : size of smallest and largest objects to count
 +
                  (default 1-100000)
 +
  -m # #        : min and max iod of allowable objects (applied to image1 only).
 +
  -t thresh1 thresh2    : thresholds (applied after -S). Like left brightness slider in DAVE.
 +
                  if only one image, second number still required, but ignored.
 +
  -o <image.i2i> : output image with all objects represented by the voxel
 +
                  with the maximum intensity in the object
 +
                  the intensity of the voxel will be the IOD of the object.
 +
  -O <image.i2i> : output image with all pixels in each object having
 +
                  the intensity of the original objects IOD.
 +
                  NOTE: this image will be in floating point format.
 +
                        use float2int to convert it back to "normal" format.
 +
  -Q <image.i2i> : output image with all pixels in each object having
 +
                  a unique id # (1-# of objects). Must be < 32766 objects.
 +
                  NOTE: this image will be in standard signed short int format.
 +
  -M #          : When countobjs is given 2 images, this flag will
 +
                  turn of some subset of the voxels for colcalization.
 +
                  calculations.
 +
                  0: turn off colcalized voxels (default on)
 +
                  1: turn off image 1 voxels (default on)
 +
                  2: turn off image 2 voxels (default on)
 +
  -q     : quiet. don't print out all objects, but just summary statistics
 +
  -Z            : simple analysis, no sliders, opacity,etc. can use with -t option.
 +
  -h            : show this message.
 +
  -H            : show even more help.
 +
 
 +
Notes:
 +
  A - in place of an image name means stdin or stdout.
 +
  Source code in /storage/big1/lml/jac/was_invitro/Projects/countobjs
 +
 
 +
 
 +
</nowiki>
 +
===  threshold.pl  ===
 +
<nowiki>
 +
threshold.pl -numvox=#  [-produce=newimage.i2i] image.i2i
 +
 
 +
calculate the largest threshold for image.i2i which has at least # voxels
 +
equal or above it.  Prints the threshold and the number above threshold to stdout.
 +
 
 +
options:
 +
 
 +
  -produce=newimage.i2i    : take the calculated threshold, apply it to image.i2i to produce newimage.i2i
 +
 
 +
 +
</nowiki>
 +
===  thresholdz.pl  ===
 +
<nowiki>
 +
thresholdz.pl -numvox=#  [-produce=newimage.i2i] image.i2i
 +
 
 +
calculate the largest threshold for image.i2i which has at least # voxels
 +
equal or above it.  Prints the threshold and the number above threshold to stdout.
 +
 
 +
options:
 +
 
 +
  -produce=newimage.i2i    : take the calculated threshold, apply it to image.i2i to produce newimage.i2i
 +
 
 +
 +
</nowiki>
 +
===  2Ddistances  ===
 +
<nowiki>
 +
 
 +
Calculates a histogram of the amount of light as a function of distance from boundary (0 valued) voxels as specified in the mask.
 +
Applies a 2D mask to a 2D time series.
 +
 
 +
Usage:
 +
2Dhistogram [options] inimage.i2i inmask.i2i
 +
Options:
 +
  -v: verbose
 +
 
 +
Source code in ~krypton/lml/facil 
 +
  -d dimage.i2i : save the distance image as dimage.i2i (converted to ints by casting)
 +
  -n: don't normalize the histogram by the number of voxels in the mask at that distance
 +
  -a #:  average together this many time pts for output histogram. default = 20
 +
see also: histogramL, histogram2
 +
 
 +
Copyright 2010 University of Massachusetts Medical School and the Biomedical Imaging Group
 +
All rights reserved. Explicit permission to use this program must be received prior to use.
 +
 +
</nowiki>
 +
===  analyze_histo  ===
 +
<nowiki>
 +
# /home/lml/krypton/bin/analyze_histo
 +
 
 +
Analyzes the output histogram image produced by histogram2 via the -f option.
 +
Prints out 2 columns: first column is bin number, second column is value at the cutoff.
 +
This is similar to the program "threshold" but instead of one threshold value for the
 +
entire image, it gives one at each distance (from a membrane).
 +
 
 +
Usage: analyze_histo [options] aimage_H.i2i
 +
options:
 +
-v: calculate cutoff based on percentage of voxels instead of percentage of light
 +
-f #: fractional cutoff (e.g., .80 = 80%), default = 0.950000
 +
-w #: number of bins for running average (default = 5), should be odd.
 +
-t #: only look at voxels >= intensity (must be >= 0), default = 1
 +
 
 +
Examples:
 +
histogram2 -f a_H.i2i -O a_H.histo -o -p 0 0 0 -d 40 -z 3 mask.i2i a.i2i b.i2i
 +
analyze_histo -f .95 a_H.i2i > a_H.cutoffs
 +
 
 +
See also: histogram, histogram2, threshold
 +
 
 +
source code in /storage/big1/lml/jac/was_invitro/Projects/boundary/boundary
 +
 +
</nowiki>
 +
===  analyze_yaodl  ===
 +
<nowiki>
 +
 
 +
This program reads in a yaodl file as produced by DAVE (volume widget menu: volume to surface ...)
 +
(hmc produces an ascii format which analyze_yaodl can't handle).
 +
It identifies connected surfaces (since DAVE considers all surfaces from one pass as one object).
 +
It then calculates and prints the volume and surface area of each connected surface.  Optionally
 +
it will write out a yaodl files (-y) for the largest surface found for each object, with better normals.
 +
This surface can be read back into DAVE with -y option.
 +
 
 +
Usage: analyze_yaodl [options] infile.ydl
 +
options:
 +
  -y largest.ydl:  write out largest surface of eac object to largest.ydl
 +
  -i image.i2i:  read in the image file associated with infile.ydl (not needed for anything yet).
 +
        -n: recalculate "better" normals (use this with the -y option)
 +
(dave used to produce terrible normals, now they are ok, so this isn't needed anymore)
 +
  -v: verbose
 +
 
 +
note: source code in /storage/big1/lml/Fischer/src directory.
 +
 +
</nowiki>
 +
===  BestPath  ===
 +
<nowiki>
 +
 
 +
Finds the brightest path from a start pixel to a stop pixel (1-indexed).
 +
 
 +
Usage:
 +
BestPath [options] image.i2i
 +
Options:
 +
-t #: threshold. Only pixels with values > # are allowed in the path, default = 0.000000
 +
-s x y z: start coordinate (1-indexed). default = (1,1,1)
 +
-S x y z: stop coordinate (1-indexed). default = (1,1,1)
 +
-v: verbose
 +
 
 +
Source code in ~krypton/lml/facil 
 +
 +
</nowiki>
 +
===  BestPath3D  ===
 +
<nowiki>
 +
 
 +
Finds the brightest path from a start pixel to a stop pixel (1-indexed).
 +
Converts voxels into nodes in a graph and finds the lowest cost path from the start node to the stop node.
 +
The cost of each node is (maxval-imval), so bright nodes have less cost. Output in rpts format to stdout.
 +
BestPath3D always turns all (above threshold) voxels in the image into graph nodes. BestPath3D_ellipse only
 +
looks at voxels within an ellipse with a major axis connecting the start and endpts.
 +
Usage:
 +
BestPath3D [options] image.i2i > image.rpts
 +
BestPath3D_ellipse [options] image.i2i > image.rpts
 +
Options:
 +
-t #: threshold. Only pixels with values > # are allowed in the path, default = 0.000000
 +
-s x y z: start coordinate (1-indexed).
 +
-S x y z: stop coordinate (1-indexed).
 +
Up to 1000  pairs of start/stop pixels can be specified. At least one pair must be specified.
 +
-r scale black  rescale image values so new = (old-black)/scale prior to being used
 +
-n name name of object that is placed into the rpts file.
 +
-f exfac perpfac:  Only used if you are running BestPath3D_ellipse
 +
        sets principal axis a to have the specified endpts (from -s and -S), then expands it by factor exfac,
 +
                        and sets the length of the perpendicular b and c axes to be perpfac times the original axis a length
 +
defaults: exfac = 1.000000, perpfac = 1.000000
 +
-v: verbose
 +
-d: debug
 +
-D debug.i2i: debug. also write out image with 50 added to all voxels within the ellipsoid.
 +
 
 +
Examples:
 +
make_spiralim -d 200 200 30 -r 70 -p spiral_small.i2i  # create a test image
 +
                -s 171 101 1  -S 170 99 30            # written out by make_spiralim
 +
BestPath3D_ellipse -v -t -1 -s 171 101 1 -S 170 99 30 -f 3 13 spiral_small.i2i > spiral.rpts
 +
note: spiral_small.i2i is a tough case, since the spiral goes very far from the start/stop points
 +
This requires a -f 3 to expand out the endpts and then a 13 to expand out perpendicularly.
 +
If you just expand out perpendicularly (e.g. -f 1 13) the ellipsoid doesn't grow faster enough
 +
near the endpts so some of the spiral data is not included in the ellipsoid. See -D option.
 +
 
 +
See also: make_spiralim, BestPath, BestPath2, make_ellipsoid, DAVE -> Stuff -> Best Path ...
 +
 
 +
Source code in ~krypton/lml/facil 
 +
 +
</nowiki>
 +
===  BestPath3D_ellipse  ===
 +
<nowiki>
 +
 
 +
Finds the brightest path from a start pixel to a stop pixel (1-indexed).
 +
Converts voxels into nodes in a graph and finds the lowest cost path from the start node to the stop node.
 +
The cost of each node is (maxval-imval), so bright nodes have less cost. Output in rpts format to stdout.
 +
BestPath3D always turns all (above threshold) voxels in the image into graph nodes. BestPath3D_ellipse only
 +
looks at voxels within an ellipse with a major axis connecting the start and endpts.
 +
Usage:
 +
BestPath3D [options] image.i2i > image.rpts
 +
BestPath3D_ellipse [options] image.i2i > image.rpts
 +
Options:
 +
-t #: threshold. Only pixels with values > # are allowed in the path, default = 0.000000
 +
-s x y z: start coordinate (1-indexed).
 +
-S x y z: stop coordinate (1-indexed).
 +
Up to 1000  pairs of start/stop pixels can be specified. At least one pair must be specified.
 +
-r scale black  rescale image values so new = (old-black)/scale prior to being used
 +
-n name name of object that is placed into the rpts file.
 +
-f exfac perpfac:  Only used if you are running BestPath3D_ellipse
 +
        sets principal axis a to have the specified endpts (from -s and -S), then expands it by factor exfac,
 +
                        and sets the length of the perpendicular b and c axes to be perpfac times the original axis a length
 +
defaults: exfac = 1.000000, perpfac = 1.000000
 +
-v: verbose
 +
-d: debug
 +
-D debug.i2i: debug. also write out image with 50 added to all voxels within the ellipsoid.
 +
 
 +
Examples:
 +
make_spiralim -d 200 200 30 -r 70 -p spiral_small.i2i  # create a test image
 +
                -s 171 101 1  -S 170 99 30            # written out by make_spiralim
 +
BestPath3D_ellipse -v -t -1 -s 171 101 1 -S 170 99 30 -f 3 13 spiral_small.i2i > spiral.rpts
 +
note: spiral_small.i2i is a tough case, since the spiral goes very far from the start/stop points
 +
This requires a -f 3 to expand out the endpts and then a 13 to expand out perpendicularly.
 +
If you just expand out perpendicularly (e.g. -f 1 13) the ellipsoid doesn't grow faster enough
 +
near the endpts so some of the spiral data is not included in the ellipsoid. See -D option.
 +
 
 +
See also: make_spiralim, BestPath, BestPath2, make_ellipsoid, DAVE -> Stuff -> Best Path ...
 +
 
 +
Source code in ~krypton/lml/facil 
 +
 +
</nowiki>
 +
===  boundaryL  ===
 +
<nowiki>
 +
Usage:
 +
  boundary [options] original.i2i
 +
 
 +
Description:
 +
  Boundary takes an image, applys a threshold to the image,
 +
  rolls a ball outside then inside the object. This defines
 +
  what pixels are considered inside, outside, and boundary.
 +
 
 +
  Expects:  Input image and optionally some given options
 +
  Modifies: Nothing
 +
  Returns:  Output image with the name of image with _B added.
 +
            (if input.i2i was original image input_B.i2i
 +
            is output image)
 +
 
 +
Options:
 +
-I        : Do not roll ball inside of the cell.
 +
              (rolling the ball inside the cell results
 +
              in a smoother surface)
 +
-r #      : Set radius to # for sphere exterior to cell.
 +
              (default = 3)
 +
-R #      : Set radius to # for sphere interior to cell.
 +
              (default = 3)
 +
-t #      : Set threshold for all z slices to > #.
 +
              (default is 10)
 +
-T filename: Use file filename for thresholds for each z slice.
 +
              (one threshold for each zslice - one threshold on a line)
 +
-X        : Restrict search in X direction.
 +
              (can be used to cap a cylinder whose long axis
 +
              is along the x axis)
 +
-Y        : Restrict search in Y direction.
 +
              (can be used to cap a cylinder whose long axis
 +
              is along the y axis)
 +
-i string  : Add string to history of output image.
 +
-h        : Print this message.
 +
-H        : Print this message and then some.
 +
 
 +
Caveats:
 +
  Requires lots of memory and time to run (megabytes+minutes).
 +
 
 +
Notes:
 +
  Entire image name (with extension) is required.
 +
  Pixel values: boundary = 2, outside = 4, inside = 6.
 +
  Output image is padded on all sides by 2*radius+1 of
 +
  sphere rolled on the outside of the object.
 +
 
 +
Keywords:
 +
  surface location, boundary, boundaries, border
 +
 
 +
Additional programs:
 +
  histogram, shrink_wrap, createBoundary, analysis
 +
 
 +
Last Changed: Wed Feb 10, 1993
 +
 
 +
 
 +
</nowiki>
 +
===  calc_area  ===
 +
<nowiki>
 +
 
 +
This program takes in a surface image and a data image and calculates:
 +
1). the area of the surface (number of nonzero voxels)
 +
2). the number of data voxels (nonzero voxels in image2)
 +
3). the number of surface voxels (area) within a specified distance of a data voxel.
 +
This information is printed to stderr.
 +
 
 +
Typically one might apply a shrink_wrap to, say, a Vinculin image of a dual
 +
labelled image pair.  Then make_surface would convert this to a surface.
 +
After this, map_to_surface would be applied to the 2 dual labelled images.
 +
Then overlap would be used to calculate the overlap of the two data sets
 +
(given some overlap range, which defaults to 1).
 +
Then this program (calc_area) is used to get the area of the surface and the
 +
amount of it which is examined using the range specified to the overlap program.
 +
This is important since to calculate the probability that the overlap was
 +
due to chance you want to know what percentage of the area was included in
 +
the overlap calculation.
 +
 
 +
Usage: calc_area [options] surface.i2i data.i2i
 +
options:
 +
  -r range: range in voxels (default = 1).
 +
  -i image.i2i: also produce an output image
 +
  this image will have bit 2 set for original data voxels
 +
  and bit 1 set for surface voxels near (or on) data voxels
 +
  (so it would be a voxel with a value of 1 or 3).
 +
 
 +
note: entire image name (with extension) is NOT required.
 +
note: a - in place of an image name means stdin or stdout.
 +
note: a compressed image will be automatically be uncompressed.
 +
 
 +
Source code in /storage/big1/lml/was_invitro/Moore/pkc
 +
 +
</nowiki>
 +
===  closest_object  ===
 +
<nowiki>
 +
 
 +
Calculates the closest distance from an object in image1 to an object in image2.  Also calculates closest distance
 +
between objects within each image separately.  Prints out info about matches.  If no other object is within the
 +
maximum distance (see -m option), the object is printed matching to object -1 at a huge distance.
 +
Histogram of these distances is printed to stdout.
 +
The input images should have each pixel in an object having the object id as its value. These images can be
 +
produced with "countobjs -Q" or "objs_via_ascent" 
 +
 
 +
Usage:
 +
closest_object [options] image1.i2i image2.i2i > im1_im2.hist
 +
Options:
 +
-t # #: image1 and image2 thresholds, pixels > # are above threshold, default = 0.
 +
-w # # #: x,y, zweights for pixel distances (ie, pixel size), default = 1 for each.
 +
-m # :         maxdistance (in units used for -w) to look for the closest pixel, default = 10.000000
 +
-r #:         resolution for output histogram, ie, binsize, default = 0.100000
 +
-e lowx lowy lowz hix hiy hiz:  only look at voxels within this extent (subvolume), 1-indexed, inclusive.
 +
-s minsize maxsize:    only look at objects in image1.i2i within the size range (inclusive, in voxels)
 +
-S minsize maxsize:    only look at objects in image2.i2i within the size range (inclusive, in voxels)
 +
-i miniod maxiod:    only look at objects in image1.i2i within the iod range (inclusive)
 +
-I miniod maxiod:    only look at objects in image2.i2i within the iod range (inclusive)
 +
-d image1d.i2i: the original intensity image for image1 (since image1 has pixel values as id numbers)
 +
-D image2d.i2i: the original intensity image for image2 (since image2 has pixel values as id numbers)
 +
if you want the iod or pixel intensity stats to be meaningful, you need to provide
 +
the original data by using the -d and -D options.
 +
  -v: verbose
 +
  -V: very verbose
 +
Examples:
 +
    Find the distance from the closest Ryr voxel in each object to a BK object. Record the iod
 +
    of the BK object in the histogram:
 +
countobjs -t 5 10 -Q ryr_id.i2i ryr.countobjs ryr.i2i      : this finds Ryr connected objects and labels them with id
 +
countobjs -t 10 10 -O bk_iodR.i2i bk.countobjs bk.i2i     : this calculates the iod of BK objects
 +
float2intL -M 30000 bk_iodR.i2i bk_iod.i2i     : rescale BK iod to integer format
 +
closest_object -w 1 1 3 -o 5 100  ryr_id.i2i bk_iod.i2i > ryr_bk.info
 +
cull -s -c -1 -4 < ryr_bk.info |xmgrace -source stdin
 +
        note: you may want to take a 10 pt running avg inside xmgrace to compensate for
 +
issues related to discretization of distances
 +
See also:
 +
closest_voxel objs_via_ascent /home/lml/krypton/Zhuge/BKandRyr/graph.pl,match.pl
 +
Bugs:
 +
 
 +
Source code in ~krypton/lml/facil 
 +
 +
</nowiki>
 +
===  closest_voxel  ===
 +
<nowiki>
 +
 
 +
Calculates the closest distance from an above threshold voxel in image1 to an above threshold voxel in image2.
 +
Histogram of these distances is printed to stdout.
 +
 
 +
Usage:
 +
closest_voxel [options] image1.i2i image2.i2i > im1_im2.hist
 +
Options:
 +
-t # #: image1 and image2 thresholds, pixels > # are above threshold, default = 0.
 +
-w # # #: x,y, zweights for pixel distances (ie, pixel size), default = 1 for each.
 +
-m # :         maxdistance (in units used for -w) to look for the closest pixel, default = 10.000000
 +
-r #:         resolution for output histogram, ie, binsize, default = 0.100000
 +
-s lowx lowy lowz hix hiy hiz:  only look at voxels within this subvolume, 1-indexed, inclusive.
 +
-Q: only the voxel in each image1 object closest to an image2 voxel should count.
 +
Use this if image1.i2i was created via the -Q option from countobjs.
 +
-o minsize maxsize:    only look at objects in image1.i2i within the size range (inclusive, in voxels)
 +
must use -Q option along with this.
 +
-p: also print the detailed info of which voxel matched to which other voxel
 +
  -v: verbose
 +
  -V: very verbose
 +
Examples:
 +
    Find the distance from the closest Ryr voxel in each object to a BK object. Record the iod
 +
    of the BK object in the histogram:
 +
countobjs -t 5 10 -Q ryr_id.i2i ryr.countobjs ryr.i2i      : this finds Ryr connected objects and labels them with id
 +
countobjs -t 10 10 -O bk_iodR.i2i bk.countobjs bk.i2i     : this calculates the iod of BK objects
 +
float2intL -M 30000 bk_iodR.i2i bk_iod.i2i     : rescale BK iod to integer format
 +
closest_voxel -w 1 1 3 -o 5 100 -Q ryr_id.i2i bk_iod.i2i > ryr_bk.info
 +
cull -s -c -1 -4 < ryr_bk.info |xmgrace -source stdin
 +
        note: you may want to take a 10 pt running avg inside xmgrace to compensate for
 +
issues related to discretization of distances
 +
See also:
 +
graph.pl
 +
Bugs:
 +
 
 +
Source code in ~krypton/lml/facil 
 +
 +
</nowiki>
 +
===  coloc  ===
 +
<nowiki>
 +
 
 +
This program reads in 2 or 3 images, and writes out an image in which
 +
colocalized voxels (voxels > threshold in all images) are kept, others
 +
set to 0.  By default colocalized voxels are set to image1 values.
 +
Usage: coloc [options] image1 image2 [image3] outimage
 +
options:
 +
-a #:        threshold for image 1 (default = 0)
 +
-b #:        threshold for image 2 (default = 0)
 +
-c #:        threshold for image 3 (default = 0)
 +
-va:          make outimage pixel value be value of image 1
 +
-vb:          make outimage pixel value be value of image 2
 +
-vc:          make outimage pixel value be value of image 3
 +
-vu #:        make outimage pixel value be user specified, #
 +
note: source code in /storage/big1/lml/Laxman/src/coloc.c
 +
 
 +
</nowiki>
 +
===  coloc3ims  ===
 +
<nowiki>
 +
 
 +
 
 +
This programs reads in three images and produces a new version of image3.
 +
Each voxel which is colocalized (has image1 > thresh1
 +
and image2 > thresh2) has the value in image3 set to 32000 (-n 32000). Otherwise the value in image3 is not
 +
changed.  Once these modifications are made, image1.i2i image2.i2i and newimage3.i2i can be read
 +
into DAVE (in that order) and voxels which are colocalized in the first two channels
 +
will be guaranteed to be colocalized in the third channel.
 +
 
 +
Usage: coloc3ims [options] image1.i2i image2.i2i image3.i2i newimage3.i2i
 +
options:
 +
  -t thresh1 thresh2:  thresholds for image1 and image2, defaults = 0 and 0
 +
  -n newval: instead of setting newimage3 to 0, set it to newval
 +
  -m: instead of setting newimage3 to 0, set it to the max value in image3.i2i
 +
 
 +
note: entire image name (with extension) is NOT required.
 +
note: a - in place of an image name means stdin or stdout.
 +
note: a compressed image will be automatically be uncompressed.
 +
 +
</nowiki>
 +
===  coloc_tseries2  ===
 +
<nowiki>
 +
 
 +
Similar to coloc_tseries, but compares a 2D time series to itself.
 +
Prints xmgr formatted graphs to stdout.
 +
 
 +
Usage: coloc_tseries2  image1 outfile
 +
options:
 +
-t thresh:    only count voxels > thresh. default = 0
 +
-z start stop: only look at these z planes (inclusive, 1-indexed). default = all z planes.
 +
-n: don't include a legend in the stdout.
 +
        -v:          verbose
 +
 
 +
source code in:  /home/lml/krypton/facil
 +
 
 +
see also: /home/lml/krypton/Corvera/paper2010/Dynamics_in_Dave/README
 +
 +
</nowiki>
 +
===  com_2d_objs  ===
 +
<nowiki>
 +
 
 +
This program takes an image and finds the intensity weighted center of mass of each 2d object.
 +
Object 1 is all pixels with value = 1, object 2 is pixels with value 2, etc. Max objects = 10
 +
Statistics are written to stdout
 +
 
 +
Usage: com_2d_objs [options] image.i2i
 +
options:
 +
  -z start stop: zplanes to analyze. 0-indexed inclusive. default is all z planes
 +
  -r #: put data out rpts format (integer coords, only center of mass info). Only use if only one object.
 +
# is the pixel value (!= 0), usually -1 through -7.
 +
  -o: coords should be one-indexed (ie, min x = 1). default = 0. -r sets this automatically.
 +
  -v: verbose
 +
 
 +
Source in /home/lml/krypton/facil
 +
See Also: /home/lml/krypton/Lawson/Jacques/README
 +
 
 +
Examples:
 +
  planimeter3.20081007 -I 110215ligand_0_491.i2i -R 110215ligand_0_491_cell1.rpts
 +
  interp -S -p -1 -o cell1 110215ligand_0_491_cell1.rpts 110215ligand_0_491_cell1_interpS.rpts
 +
  create_dcimL -d 1 -s 502 501 1440 one.i2i
 +
  addlines one.i2i 110215ligand_0_491_cell1_interpS.rpts - | maskedsmul -O 0 one.i2i - cell1_binary.i2i
 +
    # could do the same for a second object (etc), with create_dcimL -d 2, then use mathi2i
 +
    # to add the images before analysis
 +
  com_2d_objs cell1_binary.i2i > cell1_binary.stats
 +
 +
</nowiki>
 +
===  exo4  ===
 +
<nowiki>
 +
Phase 1: Associates each voxel in inimage.i2i which is > threshold with a maxima in the image.  It finds
 +
        the maxima by doing a steepest ascent walk in the image.  Writes summary info about regions found to
 +
        stdout in the same format as countobjs.  Only the location of the maxima found in phase 1 are passed to phase 2.
 +
        All vesicles must start out as maxima. (see also -readmax option)
 +
Phase 2: In each rolling window of time points (see -w), examines the intensity over time of each maxima
 +
        (found in previous step) to see if it
 +
        meets certain criteria (i.e., looks like a vesicle fusing with the plasma membrane - undergoing
 +
        exocytosis).  If it matches this criteria it prints out the "path" of the maxima and its
 +
        pixel value and iod value.  These paths can be converted to rpts format for
 +
        addlines or xmgr format
 +
        using found4.pl. 
 +
The fusion model: think of intensity as shown below. once the vesicle primes its intensity jumps. when it fuses
 +
it drops back down.
 +
 
 +
peak intensity profile:
 +
  pintens                  ----------------
 +
                          |                |
 +
                        |                  |
 +
                        |                    |
 +
  tintens -------------                      ------------------
 +
 
 +
          0  t1      t2                  t3
 +
          0  t1      |prise|              |ffall|
 +
 
 +
t1: time of tethering (should stop moving)
 +
t2: time of priming (peak intensity increases from tintens to pintens)
 +
t3: time of fusing (peak intensity drops back down, but iod should stay high and possibly even increase a bit)
 +
prise is the time it takes to rise froom tintens to pintens during priming (docking)
 +
ffall is the time it takes to fall from pintens to tintens during fusion.
 +
 +
exo4 is similar to exo3 but has slightly different options and checks all possible fusion times
 +
simultaneously. exo3 only picked the latest (in time) possible fusion event based only upon intensity
 +
changes during the falltime. exo4 considers what is happening elsewhen in the window before deciding
 +
on a fusion time. It picks the fusion candidate (iod rise and intensity fall) which is closest in time to
 +
the maxima disappearing (-check_max) and which has a stationary period (-primedtime) within the
 +
specified time range. Hopefully this makes it less likely to make mistakes.
 +
 
 +
Should work in 2d or 3d.  Only reads in a window of time points at once
 +
so should be able to handle large images.
 +
 
 +
Usage:
 +
  exo4 [options] inimage.i2i  > inimage.count
 +
 
 +
Options:
 +
 
 +
options related to input:
 +
  -T startt stopt : only examine these time points (0-indexed, inclusive)
 +
  -p numskip numuse : patterned read.  skip numskip z planes, then analyze numuse zplanes, then repeat.
 +
  This is useful if the acquisition protocol was, e.g., 1 fps for 1 min, 20 fps for 3 seconds
 +
  repeated over and over, and you only want to look at the 20 fps data.
 +
  numuse must be >= window size (see -w option). Pattern starts at t=0 even if -T is
 +
  specified (but startt time points are still skipped).
 +
  -w #         : number of time pts in a window, default = 100
 +
                        a negative number means read in entire dataset at once (one big window)
 +
  -jump # : jump # time pts before examining next window of time pts. This doesn't skip data, just
 +
  analyzes a "window" less often (so more has changed). Default = 0
 +
                        which means the very next time pt is added to window (and oldest dropped) and then
 +
                        the window of data is re-evaluated. May not work with -p option.
 +
  -r rptsfile : read in rptsfile.  should have one closed object in it. Uses this as a mask for all the planes.
 +
  -d tdim : the time dimension of the image (over-rides anything stored in the header)
 +
  -b #: : blur (smooth) image before looking for objects (maxima), using a window of the specified
 +
: halfwidth (in pixels) in x,y, and z (z width will be set to 0 if 2*width > zdim).
 +
 
 +
Phase 1: options related object finding via ascent (see objs_via_ascent2d), info printed out.
 +
          If an object doesn't satisfy these criteria, its maxima is not kept, so it is not considered a maxima
 +
          for the next stage of processing which tracks maxima into paths and checks if they are fusion events.
 +
          The iod and size specified here are also used later, but the next phase just looks with the square iod region.
 +
  -t threshold : any voxel > threshold in inimage.i2i is tracked to a 3d maxima (default = 0.0).
 +
  -i miniod maxiod : erase all objects whose iod doesn't fall in the specified range (default: 1-1000000000)
 +
  -s minsize maxsize : erase all objects whose size (in voxels, inclusive) doesn't fall in the specified range
 +
  (default = 1-1000000). note: object size and iod might be large since all voxels which
 +
  connect up via steepest ascent algorithm to the maximum count in this first phase.
 +
  -strict_max : ignore "maxima" which are really on a plateau (option might cause
 +
                        saturated maxima to be missed)
 +
  -readmax file : skip phase 1, instead just reading maxima in from the specified file
 +
 
 +
Phase 1b: noptions related to fitting Gaussians (not used for anything yet):
 +
  -g # : fit Gaussians (+ dc term) to each object found (eventually I will use this for something).
 +
  only includes pixels in object within # pixels from the brightest point.
 +
  -G # : same as -g, but uses gradient info of fuction during fit (i.e., a different fit routine).
 +
  The -G version seems a bit buggy.
 +
  -n : normalize the Gaussian fom (shouldn't affect individual fits, just allow comparison between fits
 +
 
 +
Phase 2: options related to "paths" over time:
 +
  Maxima must exist for 0 time pts, be stationary for 0 time pts prior to disappearing
 +
  While a maxima is present, a pixel within range only counts as part of object
 +
  if above threshold (-t option).  While a maxima is present,
 +
  a region will only be considered if size (pixels > thresh and within range) is within size (-s)
 +
  and iod is within iod (-i option).
 +
  -iodsize #           check iod within +/- range pixels., default = 3
 +
  -maxspeed #   max distance a maxima can move (in pixels) between time points, default = 5
 +
  -diststill #          how far (in x or y) in pixels a maxima can move and still be considered "still",
 +
  (this is the location compared to last position of maxima) default = 0
 +
  -fall time frac   maximum # of time pts peak intensity can take to show the specified fractional decrease
 +
  when vesicle is fusing. default = 10 and 0.300000
 +
  -iodrise frac   the fractional increase in iod which must be seen
 +
  when vesicle is fusing (see -fall). default = 0
 +
  -check_max #   vesicle must also change from max to not a max within # timepts after fusing
 +
  -minpeakval #          peak intensity value must exceed this when vesicle is fusing (-fall time  parameter)
 +
  -primedtime # #   minimum and max # of time pts vesicle must be primed before fusing.
 +
 
 +
options related to output:
 +
  -debugpath x y z      print out debug info about the path that passes near (within 5 pixels) here
 +
                        (fgrep output for the word: debugpath). can be used 10 times. 1-indexed.
 +
  A -1 for z, means debug any path near x and y, regardless of z value (only if -L used).
 +
  -neardebug #        for -debugpath, definition of near, in pixels, default = 5
 +
  -onlydebug      : only print out info for debug paths. ignore all other paths.
 +
  -a : print all info about each object found (like countobjs does) rather than just summary stats
 +
                      : for each time point.
 +
  -o outimage : create an ouput image of marked objects (object ids reused each time point). Max of each
 +
: object will be marked with the negative of the object id.
 +
  -fit_model : fit a square wave to intensity profile of each vesicle found to be fusing (and to debugpaths)
 +
                        not used for anything yet.
 +
  -v : verbose
 +
  -V : very verbose. may produce huge files. put this as first option to get option parsing info out.
 +
 
 +
Examples:
 +
max2d_simple -t 50 inputimage.i2i -p max.pts
 +
exo4 -v -r mask.rpts -d 600 -b 1 -w 100 -jump 20
 +
  -strict_max -readmax max.pts  -s 10 1000 -i 10 1000000 -t 1
 +
      -duration 20 -timestill 20 -maxspeed 5 -iodsize 5 -diststill 2
 +
      -rise 25 .3 -fall 15 .3 -iodrise .1 -minpeakval 60 primedtime 30 90
 +
      -neardebug 2 -debugpath 152 161 237 -debugpath 134 124 -1 
 +
      inputimage.i2i >& inputimage.out
 +
graph_exo3.csh inputimage.out,  which does the following:
 +
    findpaths_exo3.pl -trackxmgr=tmpavg.xmgr inputimage.out
 +
    findpaths_exo3.pl -trackxmgr=tmppeak.xmgr -peak inputimage.out
 +
    findpaths_exo3.pl -trackxmgr=tmpfit.xmgr -finalfit inputimage.out
 +
    findpaths_exo3.pl -trackxmgr=tmpdist.xmgr -distance inputimage.out
 +
    xmgr -graph 0 tmppeak.xmgr tmpfit.xmgr -graph 1 tmpavg.xmgr -graph 2 tmpdist.xmgr &
 +
in xmgr: Edit->Arrange Graphs, select all the graphs, then set rows to 3,
 +
        Edit-Preferences set Crosshair cursor, linked scrolling.
 +
findpaths_exo3.pl -trackrpts=tmp.rpts -printfusion=4 inputimage.out
 +
addlines inputimage.i2i tmp.rpts - | play -P -1 R -P -2 G -
 +
dave -n 0 -u -K -I inputimage.i2i tmp.rpts
 +
 
 +
source code in /home/lml/krypton/facil
 +
see also:
 +
  objs_via_ascent,  ~lml/krypton/Huang/TIRF4/found4.pl, run7
 +
#/home/lml/krypton/bin/exo4
 +
 
 +
 
 +
</nowiki>
 +
===  exo6  ===
 +
<nowiki>
 +
This programs find vesicle fusion events in a 2D time series.
 +
 
 +
Each maxima (-readmax) gets a size and iod associated with it.  Only pixels > threshold (-t)
 +
within the iod region (-iodsize) count toward the iod and size.  Once the maximum disappears
 +
(-nomax_length) the region centered around the previous location of the maximum is used.
 +
Maxima are tracked from one time pt to the next by finding the closest maxima (within -maxspeed)
 +
to its previous location.  Tracks continue after the maximum disappears for -nomax_length time pts.
 +
 
 +
At the end of this time, the path is then analyzed to see if it meets criteria for a fusing vesicle.
 +
All time pts during which the maxima exists must have an iod within the correct range (-i) and
 +
and correct size (-s). The fusion time is identified by the intensity of the maxima falling
 +
fast enough and far enough (-fall); while within the same interval the iod rises enough (-iodrise).
 +
Fusion time is then further refined to be the time of largest iod increase (between adjacent time pts)
 +
within this interval.
 +
 
 +
A fusion event may also need to be the correct time interval from when the maxima disappears (-check_max).
 +
It may also need to be significantly brighter than the background (-minpeakratio).
 +
It may be required to have a minimum peak value during fusion (-minpeakval).
 +
 
 +
Once the fusion time is found, the program finds the stationary (-diststill) time interval prior to fusion.
 +
This (priming) time interval must be within certain constraints (-primedtime) for the path to be considered
 +
representing a valid fusion event.
 +
 +
exo6 is similar to exo4 but reads in one time point at a time, there is no concept of a "window"
 +
It only works on a 2D time series
 +
 
 +
Usage:
 +
  exo6 [options] -readmax max.rpts inimage.i2i  > inimage.count
 +
 
 +
Options:
 +
 
 +
options related to input:
 +
  -T startt stopt : only examine these time points (0-indexed, inclusive)
 +
  -r rptsfile : read in rptsfile.  should have one closed object in it. Uses this as a mask for all the planes.
 +
  -d tdim : the time dimension of the image (over-rides anything stored in the header)
 +
  -b #: : blur (smooth) image before looking for objects (maxima), using a window of the specified
 +
: halfwidth (in pixels) in x,y, and z (z width will be set to 0 if 2*width > zdim).
 +
  -readmax file : read maxima in from the specified file (this is REQUIRED)
 +
 
 +
options related to finding fusion events:
 +
  -t threshold : any voxel > threshold in inimage.i2i is tracked to a 3d maxima (default = 0.0).
 +
  -i miniod maxiod : erase all objects whose iod doesn't fall in the specified range (default: 1-1000000000)
 +
  -s minsize maxsize : erase all objects whose size (in voxels, inclusive) doesn't fall in the specified range
 +
  (default = 1-1000000). note: object size and iod might be large since all voxels which
 +
  connect up via steepest ascent algorithm to the maximum count in this first phase.
 +
  -iodsize #           check iod within +/- range pixels., default = 3
 +
  -maxspeed #   max distance a maxima can move (in pixels) between time points, default = 5
 +
  -diststill #          how far (in x or y) in pixels a maxima can move and still be considered "still",
 +
  (this is the location compared to last position of maxima) default = 0
 +
  -fall time frac   maximum # of time pts peak intensity can take to show the specified fractional decrease
 +
  when vesicle is fusing. default = 10 and 0.300000
 +
  -startfall time   how close (in timepts) in time the peak intensity must start to fall in relation
 +
  to the fusion time (biggest jump in iod between two consecutive time pts). default = 1
 +
  -iodrise frac   the fractional increase in iod which must be seen
 +
  when vesicle is fusing (see -fall). default = 0
 +
  -check_max min# max#   vesicle must also change from max to not a max >= min# timepts and <= max# timepts after fusing
 +
  -nomax_length #        only analyze a path # time pts after max first disappears
 +
                        the default (which is also the minimum allowed value) = 1
 +
  -minpeakval #          peak intensity value must exceed this sometime while vesicle is fusing (-fall time  parameter)
 +
  default value = 0
 +
  -minpeakratio ratio# time# dist#:    the ratio of maxval/(median bkgnd value) must >= ratio# within
 +
  time# time steps of fusion.
 +
  bkgnd values are those pixels whose distance from max is >= dist# and <= iodsize
 +
  defaults: not to check this at all
 +
  -primedtime # #   minimum and max # of time pts vesicle must be primed before fusing.
 +
 
 +
options related to speed:
 +
  -nomedian   if -minpeakratio is defined, this causes the avg bkgnd value to be used instead
 +
  of the median value (calculation of median can be expensive).
 +
  -buffered_read #   read # z planes at a time to speed up disk I/O. Default is 1 z plane at a time
 +
 
 +
options related to output:
 +
  -debugpath x y z      print out debug info about the path that passes near (within 5 pixels) here
 +
                        (fgrep output for the word: debugpath). can be used 10 times. 1-indexed.
 +
  A -1 for z, means debug any path near x and y, regardless of z value (only if -L used).
 +
  -neardebug #        for -debugpath, definition of near, in pixels, default = 5
 +
  -onlydebug      : only print out info for debug paths. ignore all other paths.
 +
  -a : print all info about each object found (like countobjs does) rather than just summary stats
 +
                      : for each time point.
 +
  -o outimage : create an ouput image of marked objects (object ids reused each time point). Max of each
 +
: object will be marked with the negative of the object id.
 +
  -v : verbose
 +
  -V : very verbose. may produce huge files. put this as first option to get option parsing info out.
 +
 
 +
Examples:
 +
max2d_simple -t 50 inputimage.i2i -p max.pts
 +
exo6 -v -r mask.rpts -d 600 
 +
  -readmax max.pts  -s 10 1000 -i 10 1000000 -t 1
 +
      -timestill 20 -maxspeed 5 -iodsize 5 -diststill 2
 +
      -fall 15 .3 -iodrise .1 -minpeakval 60 primedtime 30 90
 +
      -neardebug 2 -debugpath 152 161 237 -debugpath 134 124 -1 
 +
      inputimage.i2i >& inputimage.out
 +
graph_exo3.csh inputimage.out,  which does the following:
 +
    findpaths_exo3.pl -trackxmgr=tmpavg.xmgr inputimage.out
 +
    findpaths_exo3.pl -trackxmgr=tmppeak.xmgr -peak inputimage.out
 +
    findpaths_exo3.pl -trackxmgr=tmpfit.xmgr -finalfit inputimage.out
 +
    findpaths_exo3.pl -trackxmgr=tmpdist.xmgr -distance inputimage.out
 +
    xmgr -graph 0 tmppeak.xmgr tmpfit.xmgr -graph 1 tmpavg.xmgr -graph 2 tmpdist.xmgr &
 +
in xmgr: Edit->Arrange Graphs, select all the graphs, then set rows to 3,
 +
        Edit-Preferences set Crosshair cursor, linked scrolling.
 +
findpaths_exo5.pl -rptsfile=tmp.rpts -rptstracks -printfusion=4 inputimage.out
 +
addlines inputimage.i2i tmp.rpts - | play -P -1 R -P -2 G -
 +
dave -n 0 -u -K -I inputimage.i2i tmp.rpts
 +
 
 +
source code in /home/lml/krypton/facil
 +
see also:
 +
  objs_via_ascent,  track_back2, ~lml/krypton/Huang/TIRF4/findpaths_exo5.pl, run7, graph_exo3.pl
 +
#/home/lml/krypton/bin/exo6
 +
 
 +
 
 +
</nowiki>
 +
===  find_2d_objs  ===
 +
<nowiki>
 +
 
 +
For each z slice (time point) in the image, find 8-connected objects.  Print info to stdout.
 +
Only voxels > threshold can be part of an object (default = 0.000000). Doesn't use much memory (reads in a slice at a time).
 +
Should handle our regular (short int) image format and floating point images.
 +
 
 +
Usage:
 +
find_2d_objs [options] image1.i2i
 +
Options:
 +
-s min max: object must be within this size in pixels (inclusive), default = 1 100000
 +
-b min max: object IOD must be within this range (inclusive), default = 1.000000 1000000000.000000
 +
-t #: threshold for image1.i2i default = 0.000000
 +
-T #: adaptive threshold. # = pixel intensity/mean intensity for each time pt. must be > # to be in object.
 +
If -o specified, only pixels under the mask counted calculating mean intensity.
 +
-i thresh.i2i: use with -T option if desired. thresh.i2i is used to calculate the threshold intead of image1.i2i
 +
If -o specified, then that mask will also be applied to thresh.i2i.
 +
-n image.i2i: write out new image with all voxels not part of an object set to 0
 +
-z low high: only analyze z slices from low to high (1-indexed, inclusive).
 +
      -o mask.i2i:    apply mask image to before analyzing it. only keep pixels in image1.i2i under mask pixels > 0.
 +
mask.i2i must be in our standard image format (short int). If 3d, only first 2d image used.
 +
  -v: verbose
 +
 
 +
See also: pt_distances, max2d, max3dL, maxima, maxL, maxzL, float2intL, int2float, playexact
 +
            track, max2d_simple, countobjs
 +
 
 +
Example:
 +
        # find all objects between 5 and 30 pixels, minimum iod of 200, above a threshold of 100, write out new image:
 +
    find_2d_objs -t 100 -s 5 30 -b 200 1e9 -n newimage.i2i image.i2i > image.objs 
 +
 
 +
Source code in ~krypton/lml/facil 
 +
 +
</nowiki>
 +
===  find_blobs  ===
 +
<nowiki>
 +
/home/lml/krypton/bin/find_blobs
 +
insufficient number of arguments
 +
This program pads an image in z, then calls "invariant" (with -F 10) to produce multiple resolutions
 +
of the original image along with its 2nd derivative in the gradient direction.
 +
The blurred originals are used to find the location of the maxima. The derivative images should
 +
have a zero crossing at the inflection points (eg, "edges"). The maxima should be in regions with
 +
negative second derivative. This program then calls flood2zero to find the spatial extent of each
 +
"blob" (bright region surrounding the maxima). Ideally this should just be a flood fill until
 +
the zero crossing is found, but noise, etc. means that a lower threshold works better.
 +
 
 +
USAGE: find_blobs [options] inputimage.i2i outputroot
 +
 
 +
output extensions of files produced (in same directory as inputimage.i2i):
 +
      .ppts          padded points coords (location of maxima in blurred, but not deriv, image).
 +
      .pts            unpadded points, with z value transformed back to unpadded coordinates
 +
      .bpts          unpadded points after filtering to keep bright points (\>= min_intensity)
 +
      .dpts          bpts with "unordered" -> "ordered" and "break" -> "#moveto", for display in DAVE
 +
      _bres#.i2i      blurred, but no derivatives, at resolution level = # (bigger # = lower res.)
 +
      _dres#.i2i      blurred & derivatives taken, at resolution level = #
 +
      _dres#_obj.i2i  objects found in *_dres#.i2i by floodfilling from points in *.bpts
 +
      _dres#.obj      statistics on *_dres#_obj.i2i
 +
      _flood.out      output from flood2zero
 +
      .out            output from invariant
 +
 
 +
 
 +
options: 
 +
    -m #:   any maxima less than this will get filtered out, default = 1
 +
    -d #:   any derivative voxel with a value >= # will stop the flood fill
 +
                  this is in the original, floating point coord system (prior to 
 +
                  rescaling to write out deriv. image). default = -5
 +
    -p #:   pad data in z so that we don't have wrap around problems, default = 10
 +
    -z #:   number of z planes (in original image) to skip in front and back when
 +
                finding blob voxels - the derivative calculation tends to create negatives
 +
                  in the first and last few planes. default = 2 
 +
    -r #:   number of resolutions to calculate, default = 1
 +
    -e #:   maximum spatial extent of object in pixels (ie, radius), default = 5
 +
                    this is needed since the floodfill can otherwise escape and fill huge
 +
                    volumes (the first and last z slices tend to be all negative, along with
 +
                    negative values in the background regions).
 +
    -s #:    maximum number of voxels in object, default = 300
 +
    -N #:   normalize image prior to use so its max = #, default = 10000
 +
    -b sigx sigy sigz:  standard deviation,in pixels, of Gaussian used in blurring
 +
                    (passed as args for -s option of invariant), default = 2 2 1
 +
 
 +
examples:
 +
 
 +
    find_blobs control3cluster4r_r_cell.i2i c3c4F10
 +
    dave -n 0 -u -z 1 -I control3cluster4r_r_cell.i2i -I c3c4F10_dres0_obj.i2i -S 2 1 0 c3c4F10.dpts
 +
 
 +
source for this cshell script is in /storage/big1/lml/was_invitro/unc/curvature
 +
 +
</nowiki>
 +
===  find_vessels  ===
 +
<nowiki>
 +
 
 +
This program takes an image and scans it vertically in y at dx intervals.  It counts the number of
 +
times a vessel of at least the specified width is entered.  A vessel is any pixel with the specified
 +
intensity value.  Each z slice in analyzed separately (and read in sequentially).  A count of vessels vs time and dx displacement is
 +
written to stdout.
 +
See /home/lml/krypton/Corvera/grant2010.
 +
 
 +
Usage: find_vessels [options] image.i2i
 +
options:
 +
  -z start stop: zplanes to analyze. 0-indexed inclusive. default is all z planes
 +
  -i #: intensity of a pixel in the vessel. default = 32767
 +
  -w #: minimum vertical width of vessel in pixels, default = 2
 +
  -d #: dx step size, default = 100
 +
  -v: verbose
 +
 
 +
Source in /home/lml/krypton/facil
 +
See Also:
 +
Examples:
 +
 +
</nowiki>
 +
===  fit3gaussians  ===
 +
<nowiki>
 +
# /home/lml/krypton/bin/fit3gaussians -h
 +
This fits a 3 component (Gaussian diffusion) model to Joan Politz's data.
 +
 
 +
Usage:
 +
  fit3gaussians [options]
 +
 
 +
Description:
 +
  Fits a three component Gaussian model to time series data.
 +
 
 +
Options:
 +
  -a      : rather than having data fit a 3D diffusion model, have it fit a 2D model.
 +
  -d # #  : only look at data sets from # to # (inclusive, first data set = 0).
 +
            timings for the available data sets are (in seconds after uncaging):
 +
before_uncaging  0.050000  0.550000  1.050000  1.550000  11.550000  21.549999 
 +
31.549999  0.000000  0.000000  0.000000  0.000000  0.000000 
 +
0.000000 
 +
            default data sets to look at are 1 to 4
 +
  -e # #  : change the time in dataset # (0-indexed) to # (in seconds)
 +
  -f file : file name for test data (as produced by "distances" program).
 +
  -F file : file name for times for all the datasets from file, one time per line.
 +
            this also changes the default range to be all the sets
 +
            (use -d after this on the command line if you want to change the sets used).
 +
      note: there must be less than 1000 datasets.
 +
  -n # #  : number of function parameters and variances used for
 +
            each parameter (default 10 paramters and  5 variances)
 +
  -p # #  : set function parameter number to some value (first # can be 0 to
 +
            the maximum number of parameters)
 +
  -s # #  : set function paramter # start value to some value (first # can be 0 to
 +
            the maximum number of parameters)
 +
  -S # #  : set function paramter # variance value to some initial value (first # can be 0 to
 +
            the maximum number of parameters)
 +
  -r # # #: set function paramter # range values to some initial values (first # can be 0 to
 +
            the maximum number of parameters)
 +
  -t #    : maximum number of random trials to search for parameters (default=100).
 +
  -T #    : search terminates when # successive times the smallest variance search is best. (default=5)
 +
  -m #    : maximum number of times to perform search, regardless of best variance (default=1000).
 +
  -M #    : maximum number of times try (for each parameter) to find a point within allowed range
 +
            default = 100
 +
  -D func #: print debug info. for specified function at level #
 +
              func 1: ars, levels: 1-4 with 4 being most info.
 +
              func 2: radial search, levels: 1-2
 +
              func 3: finding a test point, levels: 1-2
 +
  -P      :  just print out the data and theoretical curves for the start point and terminate.
 +
 
 +
example (see ~lml/vision/Politz/run)
 +
default settings are:
 +
  t1 in seconds                  : range: -4.900E-02 to  5.500E+00, start: -2.500E-02
 +
  D1 in microns^2/sec            : range:  1.000E-02 to  1.000E+02, start:  5.000E+00
 +
  mag1 in intensity/micron^3      : range:  5.000E+01 to  3.000E+04, start:  3.000E+03
 +
  dc value                        : range:  0.000E+00 to  2.000E+03, start:  2.000E+02
 +
  D2                              : range:  1.000E-01 to  1.000E+03, start:  1.000E+02
 +
  mag2                            : range:  5.000E+00 to  3.000E+04, start:  3.000E+02
 +
  t2                              : range: -4.900E-02 to  5.000E+03, start:  5.000E+02
 +
  D3                              : range:  1.000E-01 to  1.000E+03, start:  1.000E+02
 +
  mag3                            : range:  5.000E+00 to  3.000E+04, start:  3.000E+02
 +
  t3                              : range: -4.900E-02 to  5.000E+03, start:  5.000E+02
 +
 
 +
</nowiki>
 +
===  flood2zero  ===
 +
<nowiki>
 +
 
 +
This program takes an original 3D image, a 2nd derivative image
 +
as produced by invariant -F 9 -b, and a list of 3d maxima and produces
 +
a new image which is just those voxels from orig.i2i that are negative
 +
(the 2nd derivative of a bright spot is < 0) in the derivative image
 +
and connected to a 3D maxima.  So it is used in conjuction with invariant
 +
to identifiy bright blobs (eg, synapses) in a 3D image.
 +
 
 +
Usage: flood2zero [options] orig.i2i deriv.i2i image.pts newimage.i2i
 +
options:
 +
  -b # : which resolution of maxima to use (object=noderiv_maxima# in pts file)
 +
  -v #  : instead of using 0 as the object boundary cutoff, use #
 +
        -z low hi: zrange to examine, zero-indexed, inclusive.
 +
  -d dist: max chessboard distance (in voxels) from each point to flood fill.
 +
  -s size: maximum size in voxels of an object (will truncate to this size), default= 10000
 +
  -o file: save object (blob) statistics to specified file. This is very similar to
 +
what countobjs would produce when applied to newimage.i2i except newimage.i2i
 +
can have blobs which touch (due to the size contraints here) and hence show
 +
up as one large blob instead of two smaller blobs. Also, if the header for the
 +
image has a scale factor in it (which invariant writes) this scale factor will
 +
be used to convert all statistics back into original unscaled values.
 +
 
 +
note: entire image name (with extension) is NOT required.
 +
note: a - in place of an image name means stdin or stdout.
 +
note: a compressed image will be automatically be uncompressed.
 +
[source in /usr/people/lml/invitro/unc/curvature/flood2zero.c]
 +
 +
</nowiki>
 +
===  gsearch  ===
 +
<nowiki>
 +
program to do graph search on a slice of edge image
 +
USAGE:
 +
example gsearch -d name -x # -y # -a # -b # edge.i2i text.gpts
 +
    edge.i2i : magnitude input image
 +
    text.gpts: output is a graph points (gpts) text
 +
file having the same format as rpts file
 +
new boundary is stored under z=slice # (default: 1)
 +
 
 +
Options:
 +
-d  option specifies name of image containing direction of each edge
 +
    pixel of edge.i2i
 +
-k  option specifies constant of proportionality
 +
    to be used with filgra (default: 1.0)
 +
-x  start x coordinate.
 +
-y  start y coordinate.
 +
-a  stop x coordinate.
 +
-b  stop y coordinate.
 +
-h  prints this message.
 +
 
 +
 
 +
Source code in /storage/big1/lml/jac/was_invitro/graph
 +
 +
</nowiki>
 +
===  histogram2  ===
 +
<nowiki>
 +
Usage:
 +
  histogram2 [options] boundary.i2i aimage.i2i bimage.i2i
 +
Description:
 +
  This program creates a number of histograms of intensity or volume as a function of
 +
  distance of the object voxels from the nearest background voxel.
 +
  Requires:
 +
    boundary.i2i - boundary image created with boundary or createBoundary.
 +
object voxels are those with a value of 6
 +
background voxels are those with a value of 4
 +
border voxels are those with a value of 2
 +
all other voxels are ignored.
 +
            NOTE: by default this is assumed to be padded by 7 pixels all around.
 +
                  ie, IT IS LARGER THAN aimage.i2i and bimage.i2i
 +
                  createBoundary does this. see -p if you don't want this default.
 +
    aimage.i2i  - data image a.
 +
    bimage.i2i  - data image b.
 +
  Returns:
 +
    aimage_H.histo - output file with histogram info (-H can change this).
 +
  Output file format (10 columns):
 +
  1. bin number (i.e., distance from background) (each bin = 0.1 pixels)
 +
      note:a pixel touching the boundary is a distance of .5 (center is .5 from edge)
 +
  2. histogram of intensities in image a.
 +
  3. number of pixels in this bin (i.e., volume at this distance).
 +
  4. histogram of intensities in image b.
 +
  5. histogram of intensities in image a > athreshold (intens-thresh if -s option used).
 +
  6. histogram of intensities in image b > bthreshold (intens-thresh if -s option used).
 +
  7. histogram of intensities in image a, where values in a are such that
 +
      if (image a > athreshold)  and (image b > bthreshold), a=a (a-athresh if -s option) else a=0.
 +
  8. histogram of intensities in image b, where values in b are such that
 +
      if (image a > athreshold)  and (image b > bthreshold), b=b (b-bthresh if -s option) else b=0.
 +
  9. # of pixels in image a > image a threshold (at this distance), like 3 but only
 +
      counting voxels > threshold.
 +
  10.# of pixels in image b > image b threshold (at this distance), like 3 but only
 +
      counting voxels > threshold.
 +
 
 +
Input Options:
 +
  -o    :  border pixels are background voxels (default is object voxel)
 +
  -p x y z  :padding in x,y,z included in the boundary image  (default 7 in all directions).
 +
          (boundary image found in the programs boundary and
 +
            createBoundary are by default padded by 7 pixels
 +
            on all sides of the image.
 +
 
 +
Distance Options:
 +
  -P x y z : don't find histogram of all pixels to boundary, just the distance
 +
            of this pixel from the boundary. Can be used multiple times on command line.
 +
            (x,y,z) is 1-indexed (like play) aimage.i2i coordinate values.
 +
  -d #:    maximum distance (in pixels) to check, default = .5*(min dim)
 +
          Any pixel further than the maximum distance is considered to be at the maximum distance.
 +
          This apply also for the -ta and -tb distance based thresholds.
 +
  -x #  :  set x weight to # (default 1.0).
 +
  -y #  :  set y weight to # (default 1.0).
 +
  -z #  :  set z weight to # (default 1.0).
 +
  -F    :  Fast histogram - voxel level (default fast).
 +
  -S    :  Sub-voxel resolution histogram(default fast).
 +
  -Y # #:  limit Y direction from # to # (default off).
 +
          If the long axis of the cell is in the in the y direction,
 +
          and the cell is cut off, using the -Y option will limit searching
 +
          for the boundary in that direction, i.e. the ends past these values will
 +
          not be considered part of the boundary.
 +
          (similarly true for -X and -Z options)
 +
  -X # #:  limit X direction from # to # (default off), inclusive, 1-indexed.
 +
  -Z # #:  limit Z direction from # to # (default off).
 +
  -c:    pixels outside the image are considered border pixels.  For example, if the outlines
 +
          used to create boundary.i2i were in z=1, but you want pixels inside the z=1 boundary
 +
          to be counted as being 1 pixel away from the boundary (eg, from the phantom z=0 slice)
 +
          use this option.
 +
 
 +
Threshold Options:
 +
  -a #  :  set aimage threshold to # (default 0.000000).
 +
  -b #  :  set bimage threshold to # (default 0.000000).
 +
  -s :    subtract thresholds (and then clamp to >=0) rather than simply keeping intensities > threshold.
 +
          This is more like what you might want to do to subtract off background or nonspecific flourescence.
 +
  -ta athresh.txt  :  apply different thresholds at different distances to aimage.i2i.
 +
                    athresh.txt as produced by analyze_histo (applied to -f aimage_H.i2i output)
 +
  (i.e., 2 columns: bin # (tenths of a pixel) and threshold).
 +
  -tb bthresh.txt  :  like -ta, but for bimage.i2i
 +
  -ra # :  rescale athresh.txt prior to use, multiply values in file by #.
 +
  -rb # :  rescale bthresh.txt prior to use, multiply values in file by #.
 +
 
 +
Ouput Options:
 +
  -f aimage_H.i2i xdim ydim:  print out a full histogram of aimage. This is a
 +
          2D image (eg, aimage_H.i2i) with the specified x and y dimensions.
 +
          The x direction is pixel intensity, and the y direction bin number (tenths of a pixel) and
 +
          the pixel value wll be set to the number of voxels at that distance and that intensity.
 +
          Specify -1 for xdim or ydim if you want that dimension calculated automatically
 +
          (xdim will be approx. max intensity in image and ydim about 10*max dist, see -d option).
 +
          Explicitly set the dimensions if you will want to add this image with others (since they must all
 +
          be the same dimensions), e.g., to average data from a set of control files.
 +
          note: -S option will cause the "number of voxels" to appear to change.
 +
          Use the analyze_histo program to produce a distance dependent threshold file from this (e.g. to read
 +
          back into histogram2 on another pass via the -ta or -tb option).  This image can be large (25MB).
 +
  -H file: Output filename for histogram (instead of aimage_H.histo).
 +
  -A aimage_thresh.i2i  :  write out aimage.i2i after threshold is applied (for visualization purposes)
 +
                          these are the pixel values used to produce column 5 of aimage_H.histo
 +
  -B bimage_thresh.i2i  :  write out bimage.i2i after threshold is applied (for visualization purposes)
 +
                          these are the pixel values used to produce column 6 of aimage_H.histo
 +
 
 +
Miscellaneous Options:
 +
  -D distimage.i2i  :  print the distance image (for debugging). Each voxel is 100 times its distance
 +
    from the membrane (a pixel neighboring the background has a distance of .5 pixels).
 +
                      This can also be used by mask_image to then mask desired pixels.
 +
  -h    :  print this message.
 +
 
 +
Notes:
 +
  All the images should be oriented in the same direction.
 +
  Entire image name (with extension) is required.
 +
  A - in place of an image name means stdin or stdout.
 +
 
 +
 
 +
Example:
 +
  create_dcim -d 4 -s 234 294 24 -| addlines -P -1 - rob15_nucleus.rpts -|
 +
            flood -e -1 -E 2 -I 6 -b 4 - mask.i2i
 +
  histogram2 -p 0 0 0 -Z 2 23 -d 40 -a 3552 -b 7767 -z 1.34 mask.i2i rob15f_rtm.i2i rob15r_rtm.i2i
 +
 
 +
Example: use a variable distance threshold to subtract background flourescence from dual labeled images:
 +
    addlines -P -1 control_aimage.i2i control_membrane.rpts -| flood -e -1 -E 2 -I 6 -b 4 - mask.i2i
 +
        # create a full histogram so we can use a variable threshold based upon distance from membrane:
 +
    histogram2 -p 0 0 0 -d 40 -z 1.34 -f controla_H.i2i mask.i2i control_aimage.i2i control_aimage.i2i
 +
        # create the variable threshold file:
 +
    analyze_histo controla_H.i2i > controla_H.thresholds
 +
        # repeat for control bimage (e.g., second wavelength):
 +
    histogram2 -p 0 0 0 -d 40 -z 1.34 -f controlb_H.i2i mask.i2i control_bimage.i2i control_bimage.i2i
 +
    analyze_histo controlb_H.i2i > controlb_H.thresholds
 +
        # now apply these thresholds to the real dual labeled (not the control) data:
 +
    addlines -P -1 real_aimage.i2i real_membrane.rpts -| flood -e -1 -E 2 -I 6 -b 4 - real_mask.i2i
 +
    histogram2 -p 0 0 0 -d 40 -z 1.34 -s -ta controla_H.thresholds -tb controlb_H.thresholds \
 +
                    real_mask.i2i real_aimage.i2i real_bimage.i2i
 +
See Also:
 +
  boundary, createBoundary, analysis, analyze_histo, threshold, nucleus_overlaps, mask_image, Corecell.pl.
 +
 
 +
Source code in /storage/big1/lml/jac/was_invitro/Projects/boundary/boundary
 +
 
 +
 
 +
</nowiki>
 +
===  image2ptsL  ===
 +
<nowiki>
 +
 
 +
This program takes an image, and identifies boundary pixels of objects.
 +
Boundary pixels are foreground pixels which have at least one
 +
backgound pixel among their 8 neighbors.
 +
In addition, any foreground pixel which is on the edge of a 2D
 +
slice is also considered a boundary pixel.
 +
These boundary pixels are written out in "addlines" format.
 +
Each zslice is analyzed sequentially.
 +
Points are unordered, and they are all considered part of one object.
 +
Points in the pts file have their value set to -1
 +
 
 +
Usage: image2pts [options] image.i2i pointfile.pts
 +
options:
 +
  -t #: threshold, above which is foreground. Default = 0
 +
note: entire image name (with extension) is NOT required.
 +
note: a - in place of an image name means stdin or stdout.
 +
note: a compressed image will be automatically be uncompressed.
 +
 +
</nowiki>
 +
===  invariant  ===
 +
<nowiki>
 +
 
 +
This program takes an image, blurs it with a Gaussian of
 +
specified standard deviation and then takes derivatives of the image
 +
It does all of this in the frequency domain.
 +
 
 +
outfile is the root name for derivative of blurred images (outfile_dres#.i2i, unless -M),  plain blurred
 +
images (-b option, outfile_bres#.i2i) and/or pts files (-m or -M options, outfile.pts).
 +
 
 +
Any function which is a ratio of sum of products of derivatives (eg, (LxxLy + LyzLx)/(LyLy+LzLz))
 +
can be calculated.  Edit file init_invariant.c in
 +
/usr/people/lml/invitro/unc/curvature and recompile on molmed if you want a function which
 +
is not listed here.
 +
 
 +
Usage: invariant [options] infile.i2i outfile
 +
options:
 +
  -F #:  function to calculate.  Default = 1. Available functions are:
 +
  -F 1: LxLx+LyLy+LzLz : 3D gradient squared
 +
  -F 2: .5(Lxx+Lyy+Lzz)/sqrt(LxLx+LyLy+LzLz) : normalized 3D Laplacian
 +
  -F 3: LxLx+LyLy : 2D gradient squared
 +
  -F 4: sqrt(LxLx+LyLy) : 2D gradient
 +
  -F 5: 2(LxxLyy-Lxy^2)/(Lxx^2 + Lyy^2 + 2Lxy^2): 2D light or dark blobs (p. 252 IPMI '91)
 +
  -F 6: 2(LxxLyy-Lxy^2), same a -F 5, no normalization (so noise isn't magnified).
 +
  -F 7: mean curvature of 3D isointensity surface normalized by gradient squared
 +
  -F 8: mean curvature of 3D isointensity surface, no normalization.
 +
  -F 9: 2nd der. in the grad. direction times gradient squared.
 +
  -F 10: 2nd der. in the grad. direction (should = 0 at locations of edges)(use -u option).
 +
  -F 11 XYZ    e.g., -F 11 021  take zero derivatives in X direction, 2 in Y, 1 in Z (Lyyz).
 +
by calling invariant multiple times with various XYZ and using the -g option you
 +
can create a bunch of derivative images which you can then read in and combine
 +
however you like (e.g., my curvature_eigenvectors program)
 +
  -N #: normalize image intensities prior to use to be between 0 and #
 +
this performs: newval = #*(val-minval)/(maxval-minval)
 +
  -u #: during division (-F 2,5,7,10) set divide by 0 to this integer, default=0.
 +
        note: this is the final output pixel value, after any scale factors (-r or -R).
 +
        a good value is -32768, the minimum possible output pixel value.
 +
  -s sigx sigy sigz:  standard deviation in spatial domain of Gaussian.
 +
  -S sigx sigy sigz:  standard deviation in frequency domain of Gaussian.
 +
default = 3.402823E+38  3.402823E+38  3.402823E+38
 +
  -l # res2 res3 ... :  # = number of different resolution levels to calculate.
 +
res2 ... res# are the relative sigmas for each resolution level after
 +
the first one. eg, -l 3 .9 .7  means that 3 blurred levels should
 +
be calculated and the sigma (in the freq domain) of the second
 +
level should be .9 of the first level (ie, more blurred), and the 3rd
 +
level should be .7 of the first level (as specified with -S).
 +
  -L # factor:  # = number of resolution levels. factor is the relative sigmas in
 +
the spatial domain for each level relative to the previous level.
 +
  -e epsilon:  cutoff for Gaussian intensity calculation.
 +
default = 0.040000
 +
  -r: apply scalefactor to output so min= -32766 or max= 32766. This is useful
 +
especially when all the values would otherwise be < 1.
 +
This also prints to stderr the min and max values before rescaling.
 +
  -R #: rescale output by multiplying all values by #.
 +
  -m: calculate coords of 3D maxima after blurring and taking derivatives.
 +
Creates an outfile.pts file.
 +
  -M: same as -m, but also prevents writing out blurred images.
 +
        -b:         calculate coords of 3D maxima after blurring (but before derivatives). This
 +
        can be used with the -m option.  Objects associated with this option will
 +
        be named "noderiv_maxima#", where # is the resolution number.
 +
        This is useful for passing to flood2zero to find the extent of the bright spots.
 +
Also writes out blurred images (outfile_bres#.i2i).
 +
  -B: same as -b, but prevents writing out the blurred images.
 +
  -n #: maxima must have an intensity > # (must use -m, -M, or -b with this)
 +
  -f #: max pixel must be > all neighbors by at least # to be a maxima. default = 0.000100
 +
  -g: output a floating point image (no rescaling done). This output can be used
 +
by my curvature_eigenvectors program. -u option still applies.
 +
 
 +
note: image dimensions which factor to 2, 3, or 5 go fastest with the FFT.
 +
note: the entire image name is NOT required.
 +
note: compressed images will be uncompressed.
 +
note: a - in place of an image name means stdin or stdout.
 +
see also: max3d, multi_gauss_deriv, flood2zero, find_blobs, blur_spatial, canny, zerosu.
 +
source in /storage/big1/lml/was_invitro/unc/curvature
 +
/home/lml/krypton/bin/invariant
 +
 
 +
</nowiki>
 +
===  linux_epr_x86_64-7-12-2012  ===
 +
<nowiki>
 +
 +
 
 +
epr                              UMMC/BIG                          Jul 12 2012
 +
 
 +
NAME
 +
    epr - Exhaustive Photon Replacement (EPR) restores contrast by removing
 +
    residual out-of-focus light and improves resolution while maintaining
 +
    numerical accuracy of 3-D images of specimens obtained with serial
 +
    optical sectioning from wide-field or confocal light microscopy.
 +
 
 +
SYNOPSIS
 +
    epr [options] before-image[.tif] after-image[.tif]
 +
 
 +
DESCRIPTION
 +
    epr performs regularized, iterative image restoration with a non-
 +
    negativity constraint.  The before-image is a three dimensional (3-D)
 +
    TIFF image composed of rectangular, regularly spaced, optical sections.
 +
    Large images are decomposed into smaller, overlapping (in x and y only)
 +
    image segments for restoration, and the restored segments are recomposed.
 +
    The after-image is the restored 3-D image. All options must appear
 +
    before the image file names, but the order of options is not important.
 +
 
 +
    epr has the following options:
 +
 
 +
    -h                Prints basic help on syntax and available options.
 +
 
 +
                              Required Parameters
 +
 
 +
    -psf file[.tif]  The 3-D point spread function image file. The psf must
 +
                      match the optical configuration used for the before-
 +
                      image.  The psf depth (number of z-planes) need only be
 +
                      less-than or equal-to twice that of the before-image.
 +
                      Extra z-planes are symmetrically discarded.
 +
 
 +
    -smoothness alpha The alpha value where alpha is typically 0 < alpha < RNL.
 +
    -sm alpha        RNL is the residuals noise limit as reported by prepdata
 +
                      (see also). Smaller values of a correspond to less
 +
                      smoothing.  (RNL)^2 is usually a good starting choice for
 +
                      alpha.
 +
 
 +
    -iterations n    Maximum number of iterations to perform.  Iterating may
 +
    -it n            terminate earlier if convergence is detected. (see
 +
                      -convergence)
 +
 
 +
                              Control Parameters
 +
 
 +
    -scaling n        where n is after image scaling factor. Used to prevent
 +
    -sc n            integer overflow when saving after image to file.
 +
                      Default=1.0
 +
 
 +
    -convergence n    Criteria for terminating iteration, where n is << 1.
 +
    -co n            0.00001 represents true convergence. 0.001 usually
 +
                      achieves 90-95% convergence in about half the number
 +
                      of iterations.  Values of n larger than 0.001 are not
 +
                      generally recommended. Default=0.001
 +
 
 +
    -axial n1 n2      The z-axis object extrapolation beyond the sectioned
 +
    -ax n1 n2        image data where n1 is before first plane and n2 is
 +
                      after last plane. n is in planes.  By default,
 +
                      extrapolation extends +-1/2 the z-axis extent of the point
 +
                      spread function image and should be sufficient. Smaller
 +
                      values of n1 or n2 have the effect of spatially
 +
                      constraining the restored object and should be applied
 +
                      carefully.
 +
 
 +
    -time n1          The timepoint where you want the restoration to occur (0 indexed)
 +
    -t n1
 +
 
 +
    -threads n        The number of threads FFTW should use. Default=1
 +
    -th n
 +
 
 +
    -transverse n    The x-axis and y-axis object extrapolation in pixels.
 +
    -tr n            The epr process extrapolates the restoration beyond the
 +
                      bounds of each image segment in order to account for
 +
                      exterior out-of-focus contributions. Default = 1/4 of X or Y
 +
                      dimsenion PSF width, which ever is larger.
 +
 
 +
EXAMPLES
 +
    To see the command line syntax
 +
 
 +
      % epr
 +
    or
 +
      % epr -h
 +
 
 +
    Given specimen image mycell_.i2i and point spread function image mypsf_.i2i
 +
      let smoothness equal 0.0005, maximum number of iteration equal 250
 +
      and convergence equal 0.001. Perform single-resoltion(default) EPR:
 +
 
 +
      % epr -psf mypsf_ -smoothness 0.0005 -iterations 250 mycell_ mycell_r
 +
 
 +
FAQ (Frequently Asked Questions)
 +
 
 +
      see  http://...
 +
FILES
 +
        xcomp:/home/epr/epr
 +
        xcomp:/home/epr/cs_epr.lo
 +
 
 +
SEE ALSO
 +
        prepdata
 +
        preppsf
 +
 
 +
 
 +
</nowiki>
 +
===  many_overlapsL  ===
 +
<nowiki>
 +
insufficient number of arguments
 +
 
 +
This shell script calls overlap many times for a range of thresholds
 +
in both images.
 +
Unknown options are passed to overlap.
 +
Output is put into the specified output file
 +
This should then be processed by the program: create_images
 +
Note: a temporary file is created in the current directory.
 +
See also: create_images, overlap, probcolocal
 +
 +
USAGE: many_overlaps [options] image1.i2i image2.i2i output
 +
options:
 +
  -t low hi step :range of thresholds for image1.i2i
 +
default = 1, 101, 10
 +
  -T low hi step :range of thresholds for image2.i2i
 +
default = 1, 101, 10
 +
 +
</nowiki>
 +
===  map_to_surface  ===
 +
<nowiki>
 +
error: 
 +
There should be 3 or 5 main arguments (exluding options).
 +
Arguments seen:
 +
This program takes a surface (which are those voxels which are nonzero)
 +
and one (or two) data images.  It then maps (moves) the data voxels (nonzero
 +
voxels) to the position of the nearest surface voxel.  When done, one (or two) new
 +
image is produced which has the data values at these new positions.
 +
In addition, some statistics about the mapping are printed to stderr.
 +
 
 +
NOTE:A surface can be generated by Simple_2D_wrap or shrink_wrap.  This "mesh"
 +
representation of the surface (which DAVE can display using the -i option)
 +
can be converted into a surface .i2i image for map_to_surface using
 +
/usr/people/jac/cell/bin/make_surface -I surface.i2i -c 1 mesh.i2i surface.rpts
 +
The resulting surface is made up of voxels.  Voxels which are just below the
 +
surface will be considered to be a distance of 1 voxel from the surface
 +
(the distance between the centers of the two voxels).
 +
 
 +
Usage:
 +
  map_to_surface [options] surface.i2i image.i2i out_image.i2i [image1.i2i out_image1.i2i]
 +
Options:
 +
 
 +
a second input image and output image can be specified on the command line.
 +
 
 +
-c: rather than mapping data values to the nearest surface voxel, map
 +
a count of the number of data values which mapped to the
 +
surface voxel. I.e., if 2 data voxels mapped to a surface voxel, a
 +
2 is stored there (rather than the max of the 2 data values-the default).
 +
-b: rather than mapping data values to the nearest surface voxel, or
 +
a count, just map a 1 (ie, binary) onto the surface where ever a data
 +
voxel maps (regardless of how many map there or their intensity).
 +
-m: surface.i2i is actually a mesh file, not an image file
 +
produced from a mesh file.  In this case, only map data
 +
values to surface vertices (since map_to_surface doesn't
 +
yet know how to convert mesh files to complete surfaces
 +
like make_surface).
 +
      -d #:  minimum distance (in voxels) which data must be from the surface and
 +
still be mapped onto it.  Data closer than this is ignored.
 +
By default all data is examined (ie, min_distance = 0)
 +
      -D #:  maximum distance (in voxels) which data can be from the surface and
 +
still be mapped onto it.  Data further than this is ignored.
 +
By default all data is examined (ie, max_distance = 1/2 the minimum
 +
image dimension, this should include all of the data).
 +
      -x:    exclude data voxels which are already on the surface (they will be zeroed).
 +
(note: setting the minimum distance > 0 will not achieve the same effect since
 +
that would still allow a data voxel on the surface to match to a surface
 +
voxel at a neighboring position).
 +
 
 +
Source code in /storage/big1/lml/was_invitro/Moore/pkc
 +
 
 +
</nowiki>
 +
===  min_cylinder  ===
 +
<nowiki>
 +
MIN_CYLINDER program - Version 1.0
 +
 
 +
This program takes an initial cylindrical mesh surface
 +
and allows it to deform to minimize a function of
 +
surface curvature and stretch and image intensity
 +
 
 +
Usage: min_cylinder [options] insurface infile outsurface
 +
 
 +
OPTIONS CONTROLLING TERMINATION CRITERIA:
 +
[-n #] Maximum iterations
 +
[-c #] Minimum pixel changes per iteration
 +
 
 +
OPTIONS CONTROLLING SURFACE SHAPE:
 +
[-w # # # # # #] Weights for Su Sv Suu Suv Svv E
 +
default = 0.20, 0.20, 0.10, 0.20, 0.10, -0.10
 +
NOTE: for a 2D time series, the u
 +
direction is usually in the xy plane
 +
and v is the time direction.
 +
-b:  use bilinear interpolation along the u coordinate
 +
      direction to calculate the energy component due to
 +
      the data. This option only works in conjunction with
 +
      the -D option. This causes all data along the boundary
 +
      in each xy plane to contribute to the energy of the
 +
      surface, instead of just voxels at the locations of the
 +
      vertices of the surface.
 +
      NOTE: does not use weights specified by -W option yet.
 +
-a:  same as -b but the average energy along the boundary is
 +
      calculated instead of total, so long lines are not preferred.
 +
-p:  same as -a but the average energy along each boundary segment
 +
      is weighted by the percentage of total boundary length which
 +
that segment contributes. So long bad lines count more than
 +
short bad lines.
 +
-g:  weight the data along the boundary by the dot product with the
 +
unit length vector normal to the gradient. Thus boundary segments which
 +
are parallel to the data gradient direction will count less than
 +
they otherwise would. Use with -b, -a, or -p option.
 +
-z #: the cost of a zero length line (before applying w6)
 +
      default = 0, only valid with -a or -b option.
 +
-N: use "normal" curvature instead of parameterization
 +
dependent curvature calculation.  This option should produce
 +
a more correct curvature calculation, so the program does not
 +
get fooled into thinking that small objects have smaller
 +
curvature.
 +
 
 +
OPTIONS CONTROLLING ALLOWABLE SURFACE MOVEMENT:
 +
[-D]  Restrict movement to 2 dimensions (x & y)
 +
[-s]  Skip first and last planes of cylinder
 +
      (so they won't move at all).
 +
[-S filename] filename of z planes to skip (do not use with -s).
 +
[-f]  Fix first and last planes of cylinder to move only in x&y
 +
[-F filename] filename of z planes to fix to move only in x&y
 +
(do not use with the -f option).
 +
[-A]  when the -F or -S flag specified, normally if two adjacent
 +
      slices are specified in the rpts file then the surfaces on
 +
      either side of these become independent of the each other.
 +
      If -A is specified then they will still affect each other.
 +
 
 +
OPTIONS CONTROLLING INPUT, OUTPUT, AND DEBUGGING INFO:
 +
[-W # # #] Weights for scaling x y z dimensions.
 +
[-r rescale]  rescale image data from 0 to rescale
 +
before using. default = 1000.000000
 +
    If rescale <0 then no rescaling will be done.
 +
[-u]  expect input image to be i2i - output also i2i.
 +
[-I #] write out vertex coords every # images
 +
      written in unc image format. can be read
 +
      in and displayed by wire. If SAVE_ENERGY is
 +
  defined then energy of each vertex also saved.
 +
      Currently SAVE_ENERGY is defined.
 +
[-i]  Copy information fields flag
 +
[-t "title"]  New image title
 +
[-d #]  Debugging level, 1 (least) to 2 (most)
 +
 
 +
See also: Simple_2D_Wrap, 2D_wrap, shrink_wrap
 +
 
 +
</nowiki>
 +
===  morph3d  ===
 +
<nowiki>
 +
 
 +
This program does morphological processing on greyscale images. Currently the
 +
default intensity it filters with is a constant, although different shapes and
 +
intensity profiles are allowed.  Think of a 2d image as a 3d binary array of voxels
 +
where the height dimension is the intensity of the image at this x,y position.
 +
All those pixels which are less than or equal to the height are 1, others are zero.
 +
This object (made up of voxels which are 1) is the UMBRA of the image.
 +
 
 +
Dilation: Take the umbra of
 +
the image and the umbra of the filter. Then the image dilated by the filter is
 +
those voxels which get "reached" by the filter voxels when the filter umbra
 +
is translated through the image umbra (i.e., move the origin of the filter umbra
 +
everywhere inside the image umbra, all those voxels ever reached by the filter are
 +
part of the dilated umbra).
 +
For a constant intensity filter this reduces to just taking the
 +
maximum of the image intensities at the filter's locations.
 +
 
 +
Erosion: similar to dilation, but now as you move the filter around, only keep
 +
those voxels which, when the filter umbra is centered on them, permit all the
 +
filter voxels to lie on top of image voxels (i.e., the filter umbra fits inside
 +
the image umbra when centered on that voxel).Erosion is dilation of the background.
 +
This reduces to a minimum for a constant intensity filter.
 +
 
 +
Opening: erosion followed by dilation, can be visualized by taking the filter umbra
 +
surface and pushing it hard up under the image umbra surface. The highest voxels
 +
reached by the filter surface represent the new filtered image surface.
 +
(e.g. the "solvent or probe accessible surface" from below.
 +
 
 +
Closing: dilation followed by erosion.  Dilation can be visualized as
 +
flipping the filter umbra and rolling it along the top (outside) of
 +
the image umbra and recording the lowest voxels reached. (e.g.,the solvent
 +
accessible surface from above.).
 +
 
 +
If a 3D image is input, and a 3D filter shape is specified, then all analysis
 +
is done using 3D morphological filtering.  If a 2D filter is specified, then each
 +
zplane is analyzed separately.
 +
 
 +
Usage: morph3d [options] inimage.i2i outimage.i2i
 +
options:
 +
  -v: verbose, prints out which z slice is being analyzed to stderr.
 +
  -b #: any pixels <= # are background, ignore them. default = -32766
 +
  -h #: the maximum height (intensity) of the filter center relative to other
 +
                      entries in the filter. The default =0, ie all entries in the
 +
                      filter are at the same height.  If a nonzero value is specified
 +
                      a linear falloff in height to zero at the edges of the filter is
 +
                      assumed.
 +
  -m: when -m is specified the filter's intensities must fit under the
 +
image intensities without any intensities going negative. If this
 +
not the case, then a zero value is put in that center pixel location.
 +
For example, if we specify a filter which is 100 brighter in the
 +
center than at the edge, and the filter is over a region that is 50
 +
brighter in the center, then (if -m is not specified) that pixel value
 +
might stay 50 (since the template can fit under the image intensity by
 +
lowering itself so its edges have negative values).  If -m
 +
is specified, the filter will not fit and the pixel will get set to 0.
 +
  -f #:  morphological filter shape. 6 = jack (ie, 3D cross, default)
 +
7= 3D asterisk, 4 = 2D plus
 +
1= 2D filled square, 8 = 3D cube, 2= 2D filled circle,
 +
3= 2D asterisk, 5= 2D cross.
 +
2D shapes are done one zslice at a time.
 +
  -l #: just use a single LINE, of specified orientation .
 +
1 = LL-UR, 2 = UL-LR, 3 = Left-Right, 4 = Up-Down.
 +
5 = In-Out in z, 6 = ULIn-LROut (a diagonal in 3D).
 +
  -s # # #:  size of x,y, and z "radius"  in pixels (4 4 2 default).
 +
  [-e|-d|-o|-c]:      erosion (min), dilation (max), opening (e then d), or
 +
closing (d then e). default is closing.
 +
 
 +
note: entire image name is NOT required.
 +
note: a - in place of an image name means stdin or stdout.
 +
note: the origin of the filter element is at its center.
 +
 
 +
see also: morph  - this is an older, one z-slice at a time version.
 +
 +
</nowiki>
 +
===  multi_gauss_deriv  ===
 +
<nowiki>
 +
 
 +
This program takes an image, blurs it with a Gaussian of
 +
specified standard deviation and then takes derivatives of the image
 +
It does all of this in the frequency domain.  The FFT will be done in parallel
 +
unless the environment variable NPROCS is set to 1.
 +
FFT_MAXMEM variable defines the maximum memory the FFT will use.
 +
outfile is the root name for images and/or pts (-m or -M) files.
 +
 
 +
Usage: multi_gauss_deriv [options] infile.i2i outfile
 +
options:
 +
  -x order:  number of derivatives in the x direction.
 +
default = 0
 +
  -y order:  number of derivatives in the y direction.
 +
default = 0
 +
  -z order:  number of derivatives in the z direction.
 +
default = 0
 +
  -s sigx sigy sigz:  standard deviation in spatial domain of Gaussian.
 +
  -S sigx sigy sigz:  standard deviation in frequency domain of Gaussian.
 +
default = 3.402823E+38  3.402823E+38  3.402823E+38
 +
  -l # res2 res3 ... :  # = number of different resolution levels to calculate.
 +
res2 ... res# are the relative sigmas for each resolution level after
 +
the first one. eg, -l 3 .9 .7  means that 3 blurred levels should
 +
be calculated and the sigma (in the freq domain) of the second
 +
level should be .9 of the first level (ie, more blurred), and the 3rd
 +
level should be .7 of the first level (as specified with -S).
 +
  -L # factor:  # = number of resolution levels. factor is the relative sigmas in
 +
the spatial domain for each level relative to the previous level.
 +
  -e epsilon:  cutoff for Gaussian intensity calculation.
 +
default = 0.040000
 +
  -r: apply scalefactor to output so min= -32766 or max= 32766. This is useful
 +
especially when all the values would otherwise be < 1.
 +
This also prints to stderr the min and max values before rescaling.
 +
  -R #: rescale output by multiplying all values by #.
 +
  -m: calculate coords of 3D maxima after blurring.
 +
  -M: same as -m, but also prevents writing out blurred images.
 +
  -n #: maxima must have an intensity > # (must use -m or -M with this)
 +
  -f #: max pixel must be > all neighbors by at least # to be a maxima. default = 0.000100
 +
note: image dimensions which factor to 2, 3, or 5 go fastest with the FFT.
 +
note: the entire image name is NOT required.
 +
note: compressed images will be uncompressed.
 +
note: a - in place of an image name means stdin or stdout.
 +
see also: max3d, gauss_deriv_unc, blur_spatial, canny, zerosu.
 +
 +
</nowiki>
 +
===  objs_via_ascent  ===
 +
<nowiki>
 +
 
 +
Associates each voxel in inimage.i2i which is > threshold with a 3d maxima in the image.  It finds
 +
the 3d maxima by doing a steepest ascent walk in the image.  Writes info about regions found to
 +
stdout in the same format as countobjs.  Writes an image with each pixel labeled with its region
 +
id to outimage.i2i.
 +
 
 +
Usage:
 +
  objs_via_ascent [options] inimage.i2i outimage.i2i > inimage.count
 +
 
 +
Options:
 +
  -t threshold:any voxel > threshold in inimage.i2i is tracked to a 3d maxima (default = 0.000000).
 +
  -i miniod maxiod : erase all objects whose iod doesn't fall in the specified range
 +
  -s minsize maxsize : erase all objects whose size (in voxels, inclusive) doesn't fall in the specified range
 +
 
 +
Examples:
 +
objs_via_ascent -t 100 in.i2i in_id.i2i > in.count
 +
objs2dist.pl -dz=3 -jack=in_max.rpts -rpts=in_bb.rpts in.count in.count > in.comdist
 +
  (don't really care about comdist here, just want rpts files)
 +
colorize_image -c in_id.i2i in.i2i inr.i2i ing.i2i inb.i2i  (autoscales so max will be 255)
 +
dave -S all 1 0 -nocomp -I ing.i2i -I inr.i2i -Iinb.i2i -n 0 -u in_max.rpts in_bb.rpts
 +
(then turn blue channel on in dave)
 +
 
 +
objs_via_ascent -t 100 in1.i2i in1_id.i2i > in1.count
 +
objs_via_ascent -t 100 in2.i2i in2_id.i2i > in2.count
 +
objs2dist.pl in1.count in2.count > in1and2.comdist
 +
closest_voxel -Q -t 0 0 -p -r 1 -w 1 1 3 in1_id.i2i in2_id.i2i > in1and2.patchdist
 +
/home/lml/krypton/Zhuge/BKandRyr/analysis3/graph.pl -showmatch in1and2.patchdist  > in1and2_match.rpts
 +
 
 +
source code in /home/lml/krypton/facil
 +
see also:
 +
  countobjs countobjsmax3d objs2dist.pl colorize_image closest_voxel ~lml/krypton/Zhuge/BKandRyr/analysis3/run.pl
 +
  channel_current ~lml/krypton/Zhuge/BKandRyr/graph.pl
 +
 +
</nowiki>
 +
===  overlap3  ===
 +
<nowiki>
 +
 
 +
*******  /home/lml/krypton/bin/overlap3
 +
This program calculates the overlap (colocalization)
 +
of two images. It is very similar to the overlap
 +
program, but produces a whole set of numbers with
 +
colocalization for each of many OFFSET DIRECTIONS at which
 +
voxels are considered to be "in the same place"
 +
In other words, suppose
 +
two data voxels are not exactly at the same location in the 2
 +
images, but are offset by 1 voxel in a specific direction. This
 +
program would count that
 +
as an overlap for, say, distance dx = -1, dy = 0, dz = 1.
 +
Output is text written to stdout. The OFFSET displacement is the displacement for
 +
image2. so OFFSET (-1,2,0) means image2 should be translated -1 in x (to the left), +2 in
 +
y (up 2) and not at all in z to align it with image1, e.g.,  tranima -T -1 2 0 image2.i2i image2T.i2i.
 +
 
 +
Usage: overlap3 [options] image1.i2i image2.i2i [maskimage.i2i]
 +
options:
 +
-m maxdist: maximum translational distance that should
 +
be checked (default = 1)
 +
-x maxdist: maximum x translational distance that should
 +
be checked (default = 1)
 +
-y maxdist: maximum y translational distance that should
 +
be checked (default = 1)
 +
-z maxdist: maximum z translational distance that should
 +
be checked (default = 1)
 +
-s step  : step size for translations
 +
(default = 1)
 +
-t thresh1 thresh2: only voxels in image1 > thresh1
 +
and voxels in image2 > thresh2 are
 +
considered for the overlap calculation.
 +
default = 0 and 0.
 +
-l:            keep things less than or equal to the threshold in image1
 +
                (default is greater than the threshold)
 +
-L:            keep things less than or equal to the threshold in image2
 +
                (default is greater than the threshold)
 +
      -v threshold:  all values greater than this value
 +
                    are part of the mask (default 0)
 +
      -V maskvalue:  this value is part of the mask
 +
                    can be used up to 100 times
 +
 
 +
note: entire image name is NOT required.
 +
note: a - in place of an image name means stdin or stdout.
 +
source code in /storage/big1/lml/jac/was_invitro/Projects/overlap3
 +
 +
</nowiki>
 +
===  prune  ===
 +
<nowiki>
 +
 
 +
This program takes an input image and prunes "dangling" paths from
 +
the image.  The input image is assumed to have already been thinned
 +
to a 1 pixel-wide center line using thin3Ds.  The output image can be
 +
converted to a pts file via im2pts.  Which paths get pruned depends upon
 +
the options specified.  By default, every end point is found and the
 +
path from the endpoint to first intersection point is deleted.
 +
The idea behind this program is to get rid of extraneous parts of the
 +
path produced by thin3Ds, to aid visualization.
 +
 
 +
Usage: prune [options] image1.i2i image2.i2i
 +
options:
 +
  -l #: only delete paths which are shorter than # pixels in length.
 +
  -s x y z:  x,y,z coords of a single path to keep.
 +
  -S x y z:  x,y,z coords of other end of the path to keep.
 +
(this should be used with -s).
 +
  -d datafile:  a file with lists of end points (start and stop) of
 +
paths to keep. Each line has a start and stop pt: (x1,y1,z1) (x2,y2,z2)
 +
  -X lx hix:    keep all paths whose endpts are within this x range (inclusive)
 +
If you specify any of X,Y,or Z, you must specify all 3.
 +
  -Y ly hiy:    keep all paths whose endpts are within this y range
 +
  -Z lz hiz:    keep all paths whose endpts are within this z range
 +
these 3 options are ANDed together.
 +
 
 +
note: all coords are zero indexed (ie, first pixel is numbered 0, not 1)
 +
note: entire image name (with extension) is NOT required.
 +
note: a - in place of an image name means stdin or stdout.
 +
note: a compressed image will be automatically be uncompressed.
 +
/home/lml/krypton/bin/prune
 +
 
 +
</nowiki>
 +
===  shrink_wrap  ===
 +
<nowiki>
 +
/home/lml/krypton/bin/shrink_wrap
 +
 
 +
Usage:
 +
 
 +
shrink_wrap -R input.rpts input_image output_root [options]
 +
 
 +
input_image  Image file for blurring - WITHOUT the .i2i ending
 +
output_root  Root name of output file (no .tail ending). will produce output_root.rpts
 +
 
 +
Options:
 +
 
 +
-B  use sphere as initial surface (default cylinder)
 +
-P name of file contaning point spread function
 +
    By default is a gausian psf
 +
-r set blur3d to write output image as real
 +
-R name of file containing rpts file
 +
    Must be used in the command line 
 +
-M name of file containing mesh
 +
-U file:  file is a pre-blurred attractant image in i2i image format
 +
so input_image is not used for anything except
 +
for image dimensions. see OUTPUT below.
 +
-S Value for scaling blurred image
 +
    By default equals 1.0
 +
-o value of overlapping in pixels along X and Y axes
 +
    By default equals 10.             
 +
-p value of zero padding in pixels along X and Y axes
 +
    By default equals 10.             
 +
-z value of zero padding in pixels along Z
 +
    By default equals 10.             
 +
-a memory allocation coefficient
 +
    By default equals             
 +
-w  # # # # # #:  Weights for Su Sv Suu Suv Svv E
 +
    u are pts in the plane and v are points in z or time
 +
    By default .4 .4 .2 .2 .2 -1.0
 +
-W # # #  Weights for x y z
 +
    By default 1.0 1.0 1.0
 +
-D  for two dimentional images in a time series
 +
-d #  dilate rpts file slices by #
 +
    By default 0
 +
-F do not allow slices from rpts file to move
 +
    NOTE: These points will NOT change in the shrink wrap
 +
    NOTE: They will not be dilated or moved in min_cylinder
 +
-v: verbose
 +
-I #: save vertex files and (if SAVE_ENERGY defined in min_cylinder)
 +
    files of the energy of the vertices every # iterations.
 +
      These can be read in and displayed by ~jac/bin/wire
 +
 
 +
ACTIONS:
 +
shrink_wrap takes a mesh of points and fits it to some
 +
surface.  To initialize the mesh, use planimeter to outline
 +
the cell in a few key z slices, include at least the first and
 +
last z slices, as well as any key features (bulges, bends, etc).
 +
To create an attractant function, a default Gaussian psf is used.
 +
This psf is located at /storage/big1/lml/Linux/bin/psf8.i2i.
 +
If this is compressed, make a copy in your favorite dir, uncompress
 +
and tell shrink_wrap where it is whith the -P option.
 +
 
 +
NOTES:
 +
Input:  this shell script expects the length of the cell to be
 +
        in the Y direction.  An rpts file should be created from a copy
 +
        of the image created with transp -YZ file.i2i file_T.i2i.
 +
        (where file.i2i is your image file, and file_T.i2i is your
 +
        image file transposed in Y and Z).
 +
Output: three intermediate files will be created (and deleted), one called output_root.i2i
 +
        which contains the coordinates of the final deformed mesh,
 +
        output.rpts which will contain an rpts file with a surface
 +
        drawn from output.i2i, and output__root_B.i2i which is the blurred input image
 +
source code is in /storage/big1/lml/jac/was_invitro/Projects/shrink_wrap
 +
 
 +
EXAMPLE:
 +
    suppose you have a cell cell.i2i that has its length in the Y direction.
 +
    and you want to save the cell output as cell_YZ_shrink.rpts:
 +
transp -YZ cell.i2i cell_YZ.i2i
 +
planimeter3 -I cell_YZ.i2i -R cell_YZ.rpts
 +
shrink_wrap -R cell_YZ.rpts cell cell_YZ_shrink >& cell.log
 +
  cell_YZ_shrink.rpts will be created (along with intermediate files cell_YZ_shrink* which get deleted).
 +
  The messages which result will be located in cell.log
 +
dave -I cell.i2i -T 1 YZ cell_YZ.rpts cell_YZ_shrink.rpts
 +
  (due to a bug you may have to zoom out of the image a bit for the rpts data to show up on dave)
 +
addlines cell_YZ.i2i cell_YZ_shrink.rpts - | play -P -1 R -
 +
 
 +
SEE ALSO:  Corecell.pl (to apply after shrink_wrap)
 +
 
 +
 
 +
Correct Orientation of the cell
 +
______________________________      _____________________________
 +
|    .                .      |    |    . . ......            |
 +
|  .                  .      |    |    .          . .        |
 +
|  .                  .    |    |  .              .      |
 +
|  .                  .    |    |  .                  .    |
 +
|  .                  .      |    |    .                  .  |
 +
|  .                  .    |    |    . .                .  |
 +
|  .                  .      |    |      .              .    |
 +
|  .                  .    |    |      .            .    |
 +
|    .                  .    |    |        ............      |
 +
|_____________________________|    |___________________________|
 +
length of cell in Y direction      cell after transp -YZ
 +
correct orientation for input      correct orientation for drawing
 +
file                                outlines with planimeter
 +
 
 +
main_memory: Command not found.
 +
Eval: Command not found.
 +
 
 +
</nowiki>
 +
===  snakeTrack  ===
 +
<nowiki>
 +
 
 +
Tracking a 2D time series using snakes.
 +
The program takes as input an image (a 2D timeseries)
 +
and a starting contour for the first slice of the image
 +
in .rpts or .con format.
 +
The program will attempt to track the moving contour
 +
from one slice to the next.
 +
 
 +
It does this by mimimizing
 +
F = I - E where I is the internal energy of the snake and
 +
E is the external energy as represented by the input image
 +
The internal energy is defined as the similarity to the original
 +
shape of the starting contour.  If a con file is specified as
 +
input (instead of rpts file) it is recognized as such automatically
 +
by the magic number at its top (see ~dal/synapse/projects/snakeTrack for an example).
 +
Con files are 5-tuples: x y alpha beta lambda where alpha and
 +
beta are shape descriptors (which can be generated automatically
 +
by rpts2con).  Lambda is a weight on the local internal energy of deformation
 +
and 1-lambda is the weight on the local external energy.
 +
 
 +
The program will produce as output a
 +
.rpts file, which will contain an object for each slice.
 +
The objects can then be superimposed on the original image
 +
using addlines.
 +
A contour in .rpts format can be converted into the native
 +
GSNAKE .con format using rpts2con.
 +
For more information on snakes refer to
 +
http://www.cs.wisc.edu/computer-vision/projects/gsnake.html
 +
 
 +
Usage    :snakeTrack <image> <input rpts|con> <output rpts> [option]
 +
[ option ]
 +
-V          :verbose - show the multiresolution pyramid.
 +
-L#          :Number of levels of resolution, default 2
 +
-S#          :Stratified search segment spacing, default 2
 +
-N#          :The size of the neighbourhood around
 +
              a snaxel to be searched, default 2
 +
-D#          :Desired spacing between snaxels.
 +
              Default 5.  The program will try to keep
 +
              the spacing constant by inserting new snaxels.
 +
              It doesn't seem to do a good job deleting extra snaxels.
 +
-E/i/e/m    :External energy input type, default e
 +
              i - Use intensity as external energy value
 +
              e - Use edge magnitude and direction calculated
 +
                  automatically from the input image.
 +
              m - Use edge magnitude only, calculated automatically
 +
-slice # # :specify 0-based index of the first and
 +
              the last slice of the sequence
 +
 
 +
Note: options (L, S, N, D) must not have a space before arg.
 +
 
 +
Keywords: deformable model, active contour.
 +
 +
</nowiki>
 +
===  thin3Ds  ===
 +
<nowiki>
 +
 
 +
This program is for thinning (i.e., finding the skeleton or medial axis)  3D
 +
objects.  It is modified from Lee, Kashyap, and Chu (a parallel algorithm).
 +
The program attempts to thin the object, leaving only "center" voxels.
 +
It peels off outer layers until just the "medial" axis is left.
 +
Then the program converts the thinned image into a set of vectors in rpts format.
 +
The motivation behind this program is for creating thin lines (vectors)
 +
from an image data set.  These lines stay thin even when zoomed way up in DAVE.
 +
 
 +
This program is similar to thin3Dp but uses a sequential implementation rather
 +
than the parallel implementation of thin3Dp.  This version has no known bugs.
 +
Diagnostics (logfile info) are printed to stderr.
 +
 
 +
Usage: thin3Ds [options] image.i2i vectors.pts
 +
  -t #:  pixels above this are foreground (default = 0)
 +
  -n name: name of vectors put into vectors.pts.  The default = pixel_vectors
 +
DAVE requires objects in each pts file to have a different name.
 +
  -r: only keep rings.  all side_spurs should be removed.
 +
  -X low hi: only examine the image from low to hi in x (0 indexed)
 +
  -Y low hi: only examine the image from low to hi in y (0 indexed)
 +
  -Z low hi: only examine the image from low to hi in z (0 indexed)
 +
  -i filename:  create an i2i image of the center voxels.
 +
use this if you want to do further pruning (via "prune" command)
 +
 
 +
options for debugging:
 +
  -s rootname freq: save intermediate images to the specified file (rootname).
 +
    save them with a frequency of freq (1=save every, 2= every other, etc.
 +
  -p pass: save all the subpasses of this pass.filnames will be:
 +
"pass#_subpass#.i2i" unless -s is also specified in which case
 +
they will be "rootname#_subpass#.i2i"
 +
note: if you also want the -s option, you must specify it AFTER
 +
      this option on the command line.
 +
 
 +
example:
 +
    thin3Ds -i data_center.i2i data.i2i data_thinned.pts
 +
    prune data_center.i2i data_pruned.i2i
 +
    im2pts -n data_pruned data_pruned.i2i data_pruned.pts
 +
    DAVE -n 0 -I data.i2i data_pruned.pts
 +
 
 +
note: The only program which will correctly read in the pts file produced is DAVE.
 +
        This is because many vertices in the file should not be connected to their
 +
        previous vertex, and only DAVE correctly recognizes this.
 +
You MUST use the -n 0 option with DAVE when reading in the pts file produced.
 +
 
 +
See also: distance_transform followed by max_planes and im2pts
 +
  see also: thin (a distance based thinning algorithm)
 +
            lee94-3dskeleton.pdf (the algorithm which thin3Ds implements).
 +
            ImageJ (Fiji -> Plugins -> skeletonize 2D/3D which is an implementation of the same algorithm
 +
http://imagejdocu.tudor.lu/doku.php?id=plugin:morphology:skeletonize3d:start
 +
http://imagejdocu.tudor.lu/doku.php?id=plugin:analysis:analyzeskeleton:start
 +
  see also: prune
 +
 
 +
Source code in /home/lml/krypton/was_big1/was_invitro/Doxsey
 +
/home/lml/krypton/bin/thin3Ds
 +
 
 +
</nowiki>
 +
===  track  ===
 +
<nowiki>
 +
#/home/lml/krypton/bin/track
 +
 
 +
Thresholds inimage.i2i. Connected voxels define regions.
 +
Tracks regions over time (if -n specified). Tracks written to stdout in rpts format.
 +
A 1-pixel border around the image is set to background.
 +
 
 +
Usage: track [options] inimage.i2i
 +
options:
 +
  -a #: which match algorithm to use. 1: simple. 2: greedy (better)
 +
        3: min cost (best). default = 1.
 +
  -C #: what cost algorithm to use for track terminations (merges) and starts (splits).
 +
The default is 1, constant high cost. 2 means smaller regions
 +
incur less cost.
 +
  -p: add a penalty for a match which displaces a great match (only with -a 3)
 +
  -n #:  number of sets (ie, time points in a 4D data set)
 +
  -m # #: allow paths to merge (or split) if manhattan distance between bboxes of
 +
the regions is less than # and iod change is less than # (5.000000 and 0.200000 good values?)
 +
  -s # #:  which sets to analyze (0 indexed, inclusive). must specify -n with this.
 +
default is all sets.
 +
  -t #:  an object has voxels > #. default = 0
 +
  -S: autoscale each time point to be between 0 and 255. threshold is applied after this.
 +
this lets one compensate, eg, for bleaching over time and makes the slider value shown
 +
by DAVE when it autoscales directly applicable to track.
 +
  -v # #: an object has between # and # voxels in it, inclusive, ie, object size. default = 1 10000
 +
  -c #:  connectivity. #: 4 (2d), 8 (2d), 6, 18, 26 (3d). default = 26
 +
 
 +
  -o # # outimage.i2i:  write out time points # through # (0-indexed,inclusive) with voxels numbered
 +
                      according to their track. note: should not need to use imsets program afterwards
 +
on outimage.i2i.  You can give numbers outside zdim (ie, -o -1 1000 would insure all
 +
time pts save regards of numsets)
 +
  -O # # outimage.i2i:  same as -o, but writes out original voxel values (voxels not in objects set to 0).
 +
  -r: print extra info (to stdout) about each region found.
 +
  -d # #: maximum delta x (or y) (in voxels), max delta z for an allowed match along a track
 +
default=any.
 +
  -u # # # #: units for velocity measurements. x y z voxel size (um) and delta t (in sec).
 +
  -h # file: bin width (um/sec) and file name for velocity histogram (must specify -u). defaults =
 +
                0.010000 (um/sec) and vel_hist.xy
 +
  -M :         also print cube outlines of the maxima in the regions (in rpts format) to stdout.
 +
  -i image.i2i: write out costs used as an image (max truncated to 32767). For diagnostic purposes.
 +
x axis in region at time t, y axis is region at time t+1.
 +
  -V :         verbose
 +
 
 +
examples:
 +
    track -t 660 -n 100 -s 0 5 wt1_r.i2i > tracks.rpts
 +
    dave -4 -I wt1_r.i2i -kptcolor -n 0 -u tracks.rpts
 +
 
 +
    track -t 660 -n 100 -o -1 1000 wt1_obj.i2i -s 0 5 wt1_r.i2i > tracks.rpts
 +
    dave -4 -I wt1_obj.i2i -kptcolor -loadmap random.map -n 0 -u tracks.rpts
 +
 
 +
source code in ~lml/voxel/Corvera/track
 +
 +
</nowiki>
 +
===  track3d  ===
 +
<nowiki>
 +
#/home/lml/krypton/bin/track3d
 +
 
 +
Reads in mulitiple 4D images. Thresholds the images. Connected voxels define regions.
 +
Tracks regions over time (if -n specified). Tracks written to stdout in rpts format.
 +
A 1-pixel border around the image is set to background.
 +
All images must be the same xdim, ydim, and zdim (after divison by tdim). tdim can vary from image file to image file.
 +
Image files must have their tdim set correctly (see imsets program).
 +
 
 +
Usage: track [options] inimage.i2i [inimage2.i2] ... [inimageN.i2i]
 +
options:
 +
  -a #: which match algorithm to use. 1: simple. 2: greedy (better)
 +
        3: min cost (best). default = 1.
 +
  -C #: what cost algorithm to use for track terminations (merges) and starts (splits).
 +
The default is 1, constant high cost. 2 means smaller regions
 +
incur less cost.
 +
  -p: add a penalty for a match which displaces a great match (only with -a 3)
 +
  -n #:  number of sets (ie, time points in a 4D data set). Use if only 1 input file and it has a bad tdim.
 +
  -m # #: allow paths to merge (or split) if manhattan distance between bboxes of
 +
the regions is less than # and iod change is less than # (5.000000 and 0.200000 good values?)
 +
  -s # #:  which sets (time points) to analyze (0 indexed, inclusive, concatenated across all input files).
 +
default is all sets. Note, currently all sets before start set are read and then
 +
discarded, so it might be slow to skip many sets (time points).
 +
  -t #:  an object has voxels > #. default = 0
 +
  -e numbkgnd hwidth delta ptsfile:  rather than find regions by just thresholding, find regions by finding maxima.
 +
A maxima still has to be above the threshold (-t) in intensity, and must be at least
 +
"delta" greater in intensity than its neighbors (e.g, .5).  The halfwidth of the
 +
neighborhood is "hwidth" (ie, 1 means +/- 1 pixel).  A pixel is also not allowed to
 +
be a maxima if more than "numbkgnd" neighboring pixels are background pixels (ie, <= threshold).
 +
If "ptsfile" is not "none" a pts file of the specified name will be written of the maxima.
 +
zdim should be >> hwidth if it isn't = 1 (i.e., if it isn't a 2D time series).
 +
  -S: autoscale each time point to be between 0 and 255. threshold is applied after this.
 +
this lets one compensate, eg, for bleaching over time and makes the slider value shown
 +
by DAVE when it autoscales directly applicable to track.
 +
  -v # #: an object has between # and # voxels in it, inclusive, ie, object size. default = 1 10000
 +
  -c #:  connectivity. #: 4 (2d), 8 (2d), 6, 18, 26 (3d). default = 26
 +
 
 +
  -o # # outimage.i2i:  write out time points # through # (0-indexed,inclusive) with voxels numbered
 +
                      according to their track. note: should not need to use imsets program afterwards
 +
on outimage.i2i.  You can give numbers outside zdim (ie, -o -1 1000 would insure all
 +
time points are saved regardless of numsets)
 +
  -O # # outimage.i2i:  same as -o, but writes out original voxel values (voxels not in objects set to 0).
 +
  -r: print extra info (to stdout) about each region found.
 +
  -d # #: maximum delta x (or y) (in voxels), max delta z for an allowed match along a track
 +
default=any.
 +
  -u # # # #: units for velocity measurements. x y z voxel size (um) and delta t (in sec).
 +
  -h # file: bin width (um/sec) and file name for velocity histogram (must specify -u). defaults =
 +
                0.010000 (um/sec) and vel_hist.xy
 +
  -M :         also print cube outlines of the maxima in the regions (in rpts format) to stdout.
 +
  -i image.i2i: write out costs used as an image (max truncated to 32767). For diagnostic purposes.
 +
x axis in region at time t, y axis is region at time t+1.
 +
  -V :         verbose
 +
 
 +
examples:
 +
    track -t 660 -n 100 -s 0 5 wt1_r.i2i > tracks.rpts
 +
    dave -4 -I wt1_r.i2i -kptcolor -n 0 -u tracks.rpts
 +
 
 +
    track -t 660 -n 100 -o -1 1000 wt1_obj.i2i -s 0 5 wt1_r.i2i > tracks.rpts
 +
    dave -4 -I wt1_obj.i2i -kptcolor -loadmap random.map -n 0 -u tracks.rpts
 +
 
 +
see also:
 +
trackinfo.pl, modtracks.pl, ~lml/krypton/Arndt/test/run1
 +
 
 +
old source code in ~lml/voxel/Corvera/track
 +
 
 +
source code in ~lml/krypton/track
 +
 +
</nowiki>
 +
===  track_back2  ===
 +
<nowiki>
 +
#/home/lml/krypton/bin/track_back2
 +
error: -readmax MUST be specified on the command line
 +
Takes paths produced by exo4 or exo5 and findpaths_exo4.pl (or 5) and tracks back from the fusion
 +
event as far as possible. It ignores the positions of the path found, just looks backwards for maxima
 +
within the -diststill distance of the fusion event.  A maximum being gone for at least -nomaxtime
 +
time pts defines the start of the path (as when the maximum first disappeared going backwards in time)
 +
Prints info about how long these paths are stationary to stdout.
 +
This would normally be run with the same options as exo4 when it created oldpath.txt
 +
(excluding options which aren't relevant since the fusion time is already found).
 +
 
 +
usage:
 +
track_back2 [options] image.i2i oldpath.txt
 +
options:
 +
-readmax filename: read maxima from filename. This is  a REQUIRED "option"
 +
-diststill # :how far (in x or y) in pixels a maxima can move and still be considered "still", default = 2
 +
-nomaxtime #  :maximum number of consecutive time pts a maximum can be missing along the path, default = 3
 +
-iodsize # :check iod within +/- range pixels., default = 6
 +
-iod min max :object iod (sum of voxels > threshold within iodsize region) must be within these numbers
 +
(inclusive) while a maximum is present. defaults: min = 1, max = 1000000
 +
-size min max :object size (number of voxels > threshold within iodsize region) must be within these numbers
 +
(inclusive) while a maximum is present. defaults: min = 1, max = 100000
 +
-t # :voxels must be > # to be counted as part of object. default = 0
 +
-r filename    :rpts file which specifies a mask outline.
 +
-paths filename : list of which paths in oldpath.txt to examine (as produced by findpaths_exo4
 +
                -stationary_time option). The default is to examine all "saved_paths" in oldpath.txt
 +
-T startt stopt      : only examine these time points (0-indexed, inclusive). may not work.
 +
-debugpath #:   number of path to debug. can only be set once.
 +
-verbose
 +
example:
 +
exo4 -v -r mask.rpts -d 2400 -w 100 -jump 20 -readmax max.rpts
 +
        -iodsize 6 -maxspeed 1 -diststill 1 -fall 11 0.5 -iodrise 0.1 -minpeakval 50
 +
        -minpeakratio 2 2 3 -primedtime 10 100 -check_max 50 image.i2i >& file.out
 +
findpaths_exo4.pl -saved_paths -stationary_time=file.stat -rptsfile=file.rpts -printfusion=5 file.out
 +
addlines file.rpts image.i2i -|play -      examine events, edit file.stat to just keep good events.
 +
track_back2 -r mask.rpts -readmax max.rpts -iodsize 6 -diststill 1 -verbose
 +
          -paths file.stat image.i2i file.out  > file2.stat
 +
 
 +
</nowiki>
 +
===  track_pts  ===
 +
<nowiki>
 +
 
 +
This programs takes a list of initial pts in a 3D image and tracks
 +
them over time.  It writes out the new list.  The image.i2i file should
 +
be a 3D time series.  The format for input.coords is coordinate triplets, one
 +
triplet per line, e.g.:
 +
x1 y1 z1
 +
x2 y2 z2
 +
Output is in a similar format but each point has all its time points printed
 +
in order, along with the pixel value at each location and the average of the 3 by 3 by 3
 +
neighborhood around the point.  Points are separated
 +
by a comment line (# at the beginning of the line)
 +
Tracking is performed by finding the brightest point in the neighborhood of the point's
 +
previous location in the time series.
 +
By default, pixel locations are assumed zero-indexed (first pixel is 0,0,0).
 +
The maximum # of pts allowed is 1000, the time series must be less than 400 in length.
 +
 
 +
Usage: track_pts [options] image.i2i input.coords output.coords
 +
options:
 +
  -x width:  change the default neighborhood halfwidth to search in x (default = 3)
 +
  -y width:  same for y
 +
  -z width:  same for z
 +
  -o: pixel coords in input.pts are one-indexed (like "play").
 +
coords in output.pts should also be one-indexed.
 +
  -m: Use this when the initial coords in input.pts are not exact.
 +
The program will move them to be the location of the brightest nearby voxel.
 +
  -c: perform hill climbing.  Instead of just going to the brightest point
 +
in the neighborhood, go to the brightest point in the neighborhood
 +
which can be gotten to by CONTINUOUSLY going uphill.  Without the -c
 +
small intensity dips (eg, between mitochondria) could be skipped over.
 +
  -i: do not allow a tracked point to move outside the neighborhood of
 +
it's INITIAL position (the default is the neighborhood of it's position
 +
in the previous time frame). note: the -m option is applied
 +
prior to this option (ie, results of -m define the "initial" position).
 +
-b x y z: also include, as the last "point" printed out, the average background
 +
around the point (x,y,z).  The halfwidth of the region can be set with -X,Y,or Z
 +
The coords are 0 indexed unless the -o option is also on the command line.
 +
-X hwidth: change the default halfwidth of the background region around (x,y,z)
 +
default = 5
 +
-Y hwidth: same for y.
 +
-Z hwidth: same for z.
 +
-v: verbose. prints extra info to stderr.
 +
-t tdim: don't read tdim from image header, just use this value.
 +
 
 +
note: entire image name (with extension) is NOT required.
 +
note: a - in place of an image name means stdin or stdout.
 +
note: a compressed image will be automatically be uncompressed.
  
A valid datafile has either blank lines, comments (start with #) or a data line (spark event).
+
see also: coords2pts.awk and coords2xmgr.awk to convert the output.coords into
A data line has 8 or 11 fields. 11 if a stoc is associated with the spark event
+
          either pts format (for addlines or DAVE) or xy format for xmgr.
A valid stoc (last 3 fields) must have a nonzero stoc amplitude (1st of 3 fields)
+
    coords2pts.awk will be high by 1 if you use the -o option in track_pts.
See /usr/people/lml/vision/Rhonghua/Sparks/singlesitev2 for a valid file format.
+
          trackspots: performs cross-correlation before calling track_pts.
 +
          display_tracks: displays output.coords in DAVE showing intensity of tracks.
  
Usage: sparkspread [options] datafile
+
Souce code in:   /storage/big1/lml/was_invitro/Drummond   
options:
 
  -h: do NOT print histogram for intraspark data.
 
  -H: do NOT print histogram for interspark data.
 
  -c: do NOT print cumulative distribution for intraspark data.
 
  -C: do NOT print cumulative distribution for interspark data.
 
  -b #: number of bins for histogram, default = 20
 
  -n: normalize the histograms so their maximum is 1
 
  -k: also print ks statistic showing if two distributions are different.
 
 
   
 
   
 
</nowiki>
 
</nowiki>
===  spot_diffusion ===
+
===  vcspat ===
 
  <nowiki>
 
  <nowiki>
#/home/lml/krypton/bin/spot_diffusion
 
0.001  15918.5
 
0.002  16550.4
 
0.003  16831.4
 
0.004  16999.1
 
0.005  17113.6
 
0.006  17198.2
 
0.007  17264
 
0.008  17317
 
0.009  17360.9
 
0.01  17398.1
 
0.011  17430.1
 
0.012  17458
 
0.013  17482.6
 
0.014  17504.5
 
0.015  17524.2
 
0.016  17542.1
 
0.017  17558.3
 
0.018  17573.1
 
0.019  17586.8
 
0.02  17599.4
 
0.021  17611.2
 
0.022  17622.1
 
0.023  17632.3
 
0.024  17641.8
 
0.025  17650.8
 
0.026  17659.2
 
0.027  17667.2
 
0.028  17674.7
 
0.029  17681.9
 
0.03  17688.7
 
0.031  17695.1
 
0.032  17701.3
 
0.033  17707.1
 
0.034  17712.7
 
0.035  17718.1
 
0.036  17723.3
 
0.037  17728.2
 
0.038  17732.9
 
0.039  17737.5
 
0.04  17741.9
 
0.041  17746.1
 
0.042  17750.1
 
0.043  17754.1
 
0.044  17757.9
 
0.045  17761.5
 
0.046  17765.1
 
0.047  17768.5
 
0.048  17771.8
 
0.049  17775
 
0.05  17778.2
 
0.051  17781.2
 
0.052  17784.1
 
0.053  17787
 
0.054  17789.8
 
0.055  17792.5
 
0.056  17795.1
 
0.057  17797.7
 
0.058  17800.2
 
0.059  17802.6
 
0.06  17805
 
0.061  17807.3
 
0.062  17809.5
 
0.0629999  17811.7
 
0.064  17813.9
 
0.065  17816
 
0.066  17818
 
0.067  17820
 
0.068  17822
 
0.069  17823.9
 
0.07  17825.8
 
0.071  17827.6
 
0.072  17829.4
 
0.073  17831.2
 
0.074  17832.9
 
0.075  17834.6
 
0.076  17836.3
 
0.077  17837.9
 
0.078  17839.5
 
0.079  17841
 
0.08  17842.6
 
0.081  17844.1
 
0.082  17845.6
 
0.083  17847
 
0.084  17848.4
 
0.085  17849.8
 
0.086  17851.2
 
0.087  17852.6
 
0.088  17853.9
 
0.089  17855.2
 
0.09  17856.5
 
0.091  17857.8
 
0.092  17859
 
0.093  17860.2
 
0.094  17861.4
 
0.095  17862.6
 
0.096  17863.8
 
0.097  17864.9
 
0.098  17866
 
0.099  17867.2
 
0.1  17868.3
 
0.101  17869.3
 
0.102  17870.4
 
0.103  17871.4
 
0.104  17872.5
 
0.105  17873.5
 
0.106  17874.5
 
0.107  17875.5
 
0.108  17876.5
 
0.109  17877.4
 
0.11  17878.4
 
0.111  17879.3
 
0.112  17880.2
 
0.113  17881.1
 
0.114  17882
 
0.115  17882.9
 
0.116  17883.8
 
0.117  17884.7
 
0.118  17885.5
 
0.119  17886.4
 
0.12  17887.2
 
0.121  17888
 
0.122  17888.8
 
0.123  17889.6
 
0.124  17890.4
 
0.125  17891.2
 
0.126  17892
 
0.127  17892.8
 
0.128  17893.5
 
0.129  17894.3
 
0.13  17895
 
0.131  17895.7
 
0.132  17896.4
 
0.133  17897.2
 
0.134  17897.9
 
0.135  17898.6
 
0.136  17899.3
 
0.137  17899.9
 
0.138  17900.6
 
0.139  17901.3
 
0.14  17901.9
 
0.141  17902.6
 
0.142  17903.2
 
0.143  17903.9
 
0.144  17904.5
 
0.145  17905.1
 
0.146  17905.8
 
0.147  17906.4
 
0.148  17907
 
0.149  17907.6
 
0.15  17908.2
 
0.151  17908.8
 
0.152  17909.3
 
0.153  17909.9
 
0.154  17910.5
 
0.155  17911.1
 
0.156  17911.6
 
0.157  17912.2
 
0.158  17912.7
 
0.159  17913.3
 
0.16  17913.8
 
0.161  17914.3
 
0.162  17914.9
 
0.163  17915.4
 
0.164  17915.9
 
0.165  17916.4
 
0.166  17916.9
 
0.167  17917.5
 
0.168  17918
 
0.169  17918.5
 
0.17  17918.9
 
0.171  17919.4
 
0.172  17919.9
 
0.173  17920.4
 
0.174  17920.9
 
0.175  17921.3
 
0.176  17921.8
 
0.177  17922.3
 
0.178  17922.7
 
0.179  17923.2
 
0.18  17923.6
 
0.181  17924.1
 
0.182  17924.5
 
0.183  17925
 
0.184  17925.4
 
0.185  17925.9
 
0.186  17926.3
 
0.187  17926.7
 
0.188  17927.1
 
0.189  17927.6
 
0.19  17928
 
0.191  17928.4
 
0.192  17928.8
 
0.193  17929.2
 
0.194  17929.6
 
0.195  17930
 
0.196  17930.4
 
0.197  17930.8
 
0.198  17931.2
 
0.199  17931.6
 
0.2  17932
 
0.201  17932.3
 
0.202  17932.7
 
0.203  17933.1
 
0.204  17933.5
 
0.205  17933.9
 
0.206  17934.2
 
0.207  17934.6
 
0.208  17935
 
0.209  17935.3
 
0.21  17935.7
 
0.211  17936
 
0.212  17936.4
 
0.213  17936.7
 
0.214  17937.1
 
0.215  17937.4
 
0.216  17937.8
 
0.217  17938.1
 
0.218  17938.5
 
0.219  17938.8
 
0.22  17939.1
 
0.221  17939.5
 
0.222  17939.8
 
0.223  17940.1
 
0.224  17940.4
 
0.225  17940.8
 
0.226  17941.1
 
0.227  17941.4
 
0.228  17941.7
 
0.229  17942
 
0.23  17942.3
 
0.231  17942.7
 
0.232  17943
 
0.233  17943.3
 
0.234  17943.6
 
0.235  17943.9
 
0.236  17944.2
 
0.237  17944.5
 
0.238  17944.8
 
0.239  17945.1
 
0.24  17945.4
 
0.241  17945.7
 
0.242  17945.9
 
0.243  17946.2
 
0.244  17946.5
 
0.245  17946.8
 
0.246  17947.1
 
0.247  17947.4
 
0.248  17947.7
 
0.249  17947.9
 
0.25  17948.2
 
0.251  17948.5
 
0.252  17948.8
 
0.253  17949
 
0.254  17949.3
 
0.255  17949.6
 
0.256  17949.8
 
0.257  17950.1
 
0.258  17950.4
 
0.259  17950.6
 
0.26  17950.9
 
0.261  17951.1
 
0.262  17951.4
 
0.263  17951.6
 
0.264  17951.9
 
0.265  17952.2
 
0.266  17952.4
 
0.267  17952.7
 
0.268  17952.9
 
0.269  17953.2
 
0.27  17953.4
 
0.271  17953.6
 
0.272  17953.9
 
0.273  17954.1
 
0.274  17954.4
 
0.275  17954.6
 
0.276  17954.8
 
0.277  17955.1
 
0.278  17955.3
 
0.279  17955.6
 
0.28  17955.8
 
0.281  17956
 
0.282  17956.2
 
0.283  17956.5
 
0.284  17956.7
 
0.285  17956.9
 
0.286  17957.2
 
0.287  17957.4
 
0.288  17957.6
 
0.289  17957.8
 
0.29  17958
 
0.291  17958.3
 
0.292  17958.5
 
0.293  17958.7
 
0.294  17958.9
 
0.295  17959.1
 
0.296  17959.3
 
0.297  17959.6
 
0.298  17959.8
 
0.299  17960
 
0.3  17960.2
 
0.301  17960.4
 
0.302  17960.6
 
0.303  17960.8
 
0.304  17961
 
0.305  17961.2
 
0.306  17961.4
 
0.307  17961.6
 
0.308  17961.8
 
0.309  17962
 
0.31  17962.2
 
0.311  17962.4
 
0.312  17962.6
 
0.313  17962.8
 
0.314  17963
 
0.314999  17963.2
 
0.315999  17963.4
 
0.316999  17963.6
 
0.317999  17963.8
 
0.318999  17964
 
0.319999  17964.2
 
0.320999  17964.4
 
0.321999  17964.6
 
0.322999  17964.7
 
0.323999  17964.9
 
0.324999  17965.1
 
0.325999  17965.3
 
0.326999  17965.5
 
0.327999  17965.7
 
0.328999  17965.9
 
0.329999  17966
 
0.330999  17966.2
 
0.331999  17966.4
 
0.332999  17966.6
 
0.333999  17966.8
 
0.334999  17966.9
 
0.335999  17967.1
 
0.336999  17967.3
 
0.337999  17967.5
 
0.338999  17967.6
 
0.339999  17967.8
 
0.340999  17968
 
0.341999  17968.2
 
0.342999  17968.3
 
0.343999  17968.5
 
0.344999  17968.7
 
0.345999  17968.8
 
0.346999  17969
 
0.347999  17969.2
 
0.348999  17969.3
 
0.349999  17969.5
 
0.350999  17969.7
 
0.351999  17969.8
 
0.352999  17970
 
0.353999  17970.2
 
0.354999  17970.3
 
0.355999  17970.5
 
0.356999  17970.7
 
0.357999  17970.8
 
0.358999  17971
 
0.359999  17971.1
 
0.360999  17971.3
 
0.361999  17971.5
 
0.362999  17971.6
 
0.363999  17971.8
 
0.364999  17971.9
 
0.365999  17972.1
 
0.366999  17972.2
 
0.367999  17972.4
 
0.368999  17972.5
 
0.369999  17972.7
 
0.370999  17972.8
 
0.371999  17973
 
0.372999  17973.2
 
0.373999  17973.3
 
0.374999  17973.5
 
0.375999  17973.6
 
0.376999  17973.8
 
0.377999  17973.9
 
0.378999  17974
 
0.379999  17974.2
 
0.380999  17974.3
 
0.381999  17974.5
 
0.382999  17974.6
 
0.383999  17974.8
 
0.384999  17974.9
 
0.385999  17975.1
 
0.386999  17975.2
 
0.387999  17975.3
 
0.388999  17975.5
 
0.389999  17975.6
 
0.390999  17975.8
 
0.391998  17975.9
 
0.392998  17976.1
 
0.393998  17976.2
 
0.394998  17976.3
 
0.395998  17976.5
 
0.396998  17976.6
 
0.397998  17976.7
 
0.398998  17976.9
 
0.399998  17977
 
0.400998  17977.2
 
0.401998  17977.3
 
0.402998  17977.4
 
0.403998  17977.6
 
0.404998  17977.7
 
0.405998  17977.8
 
0.406998  17978
 
0.407998  17978.1
 
0.408998  17978.2
 
0.409998  17978.4
 
0.410998  17978.5
 
0.411998  17978.6
 
0.412998  17978.7
 
0.413998  17978.9
 
0.414998  17979
 
0.415998  17979.1
 
0.416998  17979.3
 
0.417998  17979.4
 
0.418998  17979.5
 
0.419998  17979.6
 
0.420998  17979.8
 
0.421998  17979.9
 
0.422998  17980
 
0.423998  17980.1
 
0.424998  17980.3
 
0.425998  17980.4
 
0.426998  17980.5
 
0.427998  17980.6
 
0.428998  17980.8
 
0.429998  17980.9
 
0.430998  17981
 
0.431998  17981.1
 
0.432998  17981.2
 
0.433998  17981.4
 
0.434998  17981.5
 
0.435998  17981.6
 
0.436998  17981.7
 
0.437998  17981.8
 
0.438998  17982
 
0.439998  17982.1
 
0.440998  17982.2
 
0.441998  17982.3
 
0.442998  17982.4
 
0.443998  17982.5
 
0.444998  17982.7
 
0.445998  17982.8
 
0.446998  17982.9
 
0.447998  17983
 
0.448998  17983.1
 
0.449998  17983.2
 
0.450998  17983.4
 
0.451998  17983.5
 
0.452998  17983.6
 
0.453998  17983.7
 
0.454998  17983.8
 
0.455998  17983.9
 
0.456998  17984
 
0.457998  17984.1
 
0.458998  17984.2
 
0.459998  17984.4
 
0.460998  17984.5
 
0.461998  17984.6
 
0.462998  17984.7
 
0.463998  17984.8
 
0.464998  17984.9
 
0.465998  17985
 
0.466998  17985.1
 
0.467998  17985.2
 
0.468998  17985.3
 
0.469997  17985.4
 
0.470997  17985.6
 
0.471997  17985.7
 
0.472997  17985.8
 
0.473997  17985.9
 
0.474997  17986
 
0.475997  17986.1
 
0.476997  17986.2
 
0.477997  17986.3
 
0.478997  17986.4
 
0.479997  17986.5
 
0.480997  17986.6
 
0.481997  17986.7
 
0.482997  17986.8
 
0.483997  17986.9
 
0.484997  17987
 
0.485997  17987.1
 
0.486997  17987.2
 
0.487997  17987.3
 
0.488997  17987.4
 
0.489997  17987.5
 
0.490997  17987.6
 
0.491997  17987.7
 
0.492997  17987.8
 
0.493997  17987.9
 
0.494997  17988
 
0.495997  17988.1
 
0.496997  17988.2
 
0.497997  17988.3
 
0.498997  17988.4
 
0.499997  17988.5
 
0.500997  17988.6
 
0.501997  17988.7
 
0.502997  17988.8
 
0.503997  17988.9
 
0.504997  17989
 
0.505997  17989.1
 
0.506997  17989.2
 
0.507997  17989.3
 
0.508997  17989.4
 
0.509997  17989.5
 
0.510997  17989.6
 
0.511997  17989.6
 
0.512997  17989.7
 
0.513997  17989.8
 
0.514997  17989.9
 
0.515997  17990
 
0.516997  17990.1
 
0.517997  17990.2
 
0.518997  17990.3
 
0.519997  17990.4
 
0.520997  17990.5
 
0.521997  17990.6
 
0.522997  17990.7
 
0.523997  17990.8
 
0.524997  17990.8
 
0.525997  17990.9
 
0.526997  17991
 
0.527997  17991.1
 
0.528997  17991.2
 
0.529997  17991.3
 
0.530997  17991.4
 
0.531997  17991.5
 
0.532997  17991.6
 
0.533997  17991.7
 
0.534997  17991.7
 
0.535997  17991.8
 
0.536997  17991.9
 
0.537997  17992
 
0.538997  17992.1
 
0.539997  17992.2
 
0.540997  17992.3
 
0.541997  17992.3
 
0.542997  17992.4
 
0.543997  17992.5
 
0.544997  17992.6
 
0.545997  17992.7
 
0.546997  17992.8
 
0.547997  17992.9
 
0.548997  17992.9
 
0.549996  17993
 
0.550996  17993.1
 
0.551996  17993.2
 
0.552996  17993.3
 
0.553996  17993.4
 
0.554996  17993.4
 
0.555996  17993.5
 
0.556996  17993.6
 
0.557996  17993.7
 
0.558996  17993.8
 
0.559996  17993.9
 
0.560996  17993.9
 
0.561996  17994
 
0.562996  17994.1
 
0.563996  17994.2
 
0.564996  17994.3
 
0.565996  17994.3
 
0.566996  17994.4
 
0.567996  17994.5
 
0.568996  17994.6
 
0.569996  17994.7
 
0.570996  17994.8
 
0.571996  17994.8
 
0.572996  17994.9
 
0.573996  17995
 
0.574996  17995.1
 
0.575996  17995.1
 
0.576996  17995.2
 
0.577996  17995.3
 
0.578996  17995.4
 
0.579996  17995.5
 
0.580996  17995.5
 
0.581996  17995.6
 
0.582996  17995.7
 
0.583996  17995.8
 
0.584996  17995.8
 
0.585996  17995.9
 
0.586996  17996
 
0.587996  17996.1
 
0.588996  17996.2
 
0.589996  17996.2
 
0.590996  17996.3
 
0.591996  17996.4
 
0.592996  17996.5
 
0.593996  17996.5
 
0.594996  17996.6
 
0.595996  17996.7
 
0.596996  17996.8
 
0.597996  17996.8
 
0.598996  17996.9
 
0.599996  17997
 
0.600996  17997.1
 
0.601996  17997.1
 
0.602996  17997.2
 
0.603996  17997.3
 
0.604996  17997.3
 
0.605996  17997.4
 
0.606996  17997.5
 
0.607996  17997.6
 
0.608996  17997.6
 
0.609996  17997.7
 
0.610996  17997.8
 
0.611996  17997.9
 
0.612996  17997.9
 
0.613996  17998
 
0.614996  17998.1
 
0.615996  17998.1
 
0.616996  17998.2
 
0.617996  17998.3
 
0.618996  17998.4
 
0.619996  17998.4
 
0.620996  17998.5
 
0.621996  17998.6
 
0.622996  17998.6
 
0.623996  17998.7
 
0.624996  17998.8
 
0.625996  17998.8
 
0.626996  17998.9
 
0.627995  17999
 
0.628995  17999.1
 
0.629995  17999.1
 
0.630995  17999.2
 
0.631995  17999.3
 
0.632995  17999.3
 
0.633995  17999.4
 
0.634995  17999.5
 
0.635995  17999.5
 
0.636995  17999.6
 
0.637995  17999.7
 
0.638995  17999.7
 
0.639995  17999.8
 
0.640995  17999.9
 
0.641995  17999.9
 
0.642995  18000
 
0.643995  18000.1
 
0.644995  18000.1
 
0.645995  18000.2
 
0.646995  18000.3
 
0.647995  18000.3
 
0.648995  18000.4
 
0.649995  18000.5
 
0.650995  18000.5
 
0.651995  18000.6
 
0.652995  18000.7
 
0.653995  18000.7
 
0.654995  18000.8
 
0.655995  18000.9
 
0.656995  18000.9
 
0.657995  18001
 
0.658995  18001
 
0.659995  18001.1
 
0.660995  18001.2
 
0.661995  18001.2
 
0.662995  18001.3
 
0.663995  18001.4
 
0.664995  18001.4
 
0.665995  18001.5
 
0.666995  18001.6
 
0.667995  18001.6
 
0.668995  18001.7
 
0.669995  18001.7
 
0.670995  18001.8
 
0.671995  18001.9
 
0.672995  18001.9
 
0.673995  18002
 
0.674995  18002.1
 
0.675995  18002.1
 
0.676995  18002.2
 
0.677995  18002.2
 
0.678995  18002.3
 
0.679995  18002.4
 
0.680995  18002.4
 
0.681995  18002.5
 
0.682995  18002.6
 
0.683995  18002.6
 
0.684995  18002.7
 
0.685995  18002.7
 
0.686995  18002.8
 
0.687995  18002.9
 
0.688995  18002.9
 
0.689995  18003
 
0.690995  18003
 
0.691995  18003.1
 
0.692995  18003.2
 
0.693995  18003.2
 
0.694995  18003.3
 
0.695995  18003.3
 
0.696995  18003.4
 
0.697995  18003.4
 
0.698995  18003.5
 
0.699995  18003.6
 
0.700995  18003.6
 
0.701995  18003.7
 
0.702995  18003.7
 
0.703995  18003.8
 
0.704994  18003.9
 
0.705994  18003.9
 
0.706994  18004
 
0.707994  18004
 
0.708994  18004.1
 
0.709994  18004.1
 
0.710994  18004.2
 
0.711994  18004.3
 
0.712994  18004.3
 
0.713994  18004.4
 
0.714994  18004.4
 
0.715994  18004.5
 
0.716994  18004.5
 
0.717994  18004.6
 
0.718994  18004.7
 
0.719994  18004.7
 
0.720994  18004.8
 
0.721994  18004.8
 
0.722994  18004.9
 
0.723994  18004.9
 
0.724994  18005
 
0.725994  18005.1
 
0.726994  18005.1
 
0.727994  18005.2
 
0.728994  18005.2
 
0.729994  18005.3
 
0.730994  18005.3
 
0.731994  18005.4
 
0.732994  18005.4
 
0.733994  18005.5
 
0.734994  18005.5
 
0.735994  18005.6
 
0.736994  18005.7
 
0.737994  18005.7
 
0.738994  18005.8
 
0.739994  18005.8
 
0.740994  18005.9
 
0.741994  18005.9
 
0.742994  18006
 
0.743994  18006
 
0.744994  18006.1
 
0.745994  18006.1
 
0.746994  18006.2
 
0.747994  18006.2
 
0.748994  18006.3