Difference between revisions of "Software2"

From Wiki
Jump to navigation Jump to search
 
(4 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 8: Line 10:
 
== Simulation ==
 
== Simulation ==
 
===  analyze_simulation.pl  ===
 
===  analyze_simulation.pl  ===
 +
<nowiki>
  
 
This program takes one or more outputs of a simulation (e.g. output of run1 or run2)
 
This program takes one or more outputs of a simulation (e.g. output of run1 or run2)
Line 34: Line 37:
 
analyze_simulation.pl -verbose run1_cafl.i2i run1_ca.i2i > & sim.out
 
analyze_simulation.pl -verbose run1_cafl.i2i run1_ca.i2i > & sim.out
 
   
 
   
 +
</nowiki>
 
===  calc_diffusion3.pl  ===
 
===  calc_diffusion3.pl  ===
 +
<nowiki>
 
     This program reads in a 2D diffusion tracks and calculates a D for each file (track_\d+.out)
 
     This program reads in a 2D diffusion tracks and calculates a D for each file (track_\d+.out)
 
     by fitting a line to the MeanSquaredDisplacement vs time:
 
     by fitting a line to the MeanSquaredDisplacement vs time:
Line 75: Line 80:
  
 
   
 
   
 +
</nowiki>
 
===  compare_volume_measurements.pl  ===
 
===  compare_volume_measurements.pl  ===
 +
<nowiki>
  
 
This program combines data produced by cross_sections_of_voronoi (-vfile) with
 
This program combines data produced by cross_sections_of_voronoi (-vfile) with
Line 126: Line 133:
  
 
   
 
   
 +
</nowiki>
 
===  filter_beads.pl  ===
 
===  filter_beads.pl  ===
 +
<nowiki>
  
 
Reads in a file produced by makebeads2 (bead.info) and one produced by print_pixel_coords (mask.info).
 
Reads in a file produced by makebeads2 (bead.info) and one produced by print_pixel_coords (mask.info).
Line 172: Line 181:
  
 
   
 
   
 +
</nowiki>
 
===  graph_xpp2.pl  ===
 
===  graph_xpp2.pl  ===
 +
<nowiki>
  
 
Reads specified columns of data from an xpp output file.
 
Reads specified columns of data from an xpp output file.
Line 200: Line 211:
  
 
   
 
   
 +
</nowiki>
 
===  oxygen_krogh.pl  ===
 
===  oxygen_krogh.pl  ===
 +
<nowiki>
 
     NOT DONE YET.
 
     NOT DONE YET.
  
Line 215: Line 228:
  
 
   
 
   
 +
</nowiki>
 
===  random_path.pl  ===
 
===  random_path.pl  ===
 +
<nowiki>
  
 
Generate a random path (ie, diffusion).
 
Generate a random path (ie, diffusion).
Line 243: Line 258:
  
 
   
 
   
 +
</nowiki>
 
===  readbeads.pl  ===
 
===  readbeads.pl  ===
 +
<nowiki>
  
 
Reads in file produced by makebeads to check to see if sizes and amplitudes
 
Reads in file produced by makebeads to check to see if sizes and amplitudes
Line 275: Line 292:
  
 
   
 
   
 +
</nowiki>
 
===  run_random_path.pl  ===
 
===  run_random_path.pl  ===
 +
<nowiki>
  
 
Generate lots of random paths files (ie, diffusion) by calling random_path.pl multiple times..
 
Generate lots of random paths files (ie, diffusion) by calling random_path.pl multiple times..
Line 300: Line 319:
  
 
   
 
   
 +
</nowiki>
 
===  run_voronoi2.pl  ===
 
===  run_voronoi2.pl  ===
 +
<nowiki>
  
 
  This script calls cross_sections_of_voronoi many times, and produces an image and output text file from each run.
 
  This script calls cross_sections_of_voronoi many times, and produces an image and output text file from each run.
Line 312: Line 333:
  
 
   
 
   
 +
</nowiki>
 
===  voronoi_vs_fiji.pl  ===
 
===  voronoi_vs_fiji.pl  ===
 +
<nowiki>
 
compare the true volumes of voronoi regions (as reported by cross_sections_of_voronoi, e.g.  
 
compare the true volumes of voronoi regions (as reported by cross_sections_of_voronoi, e.g.  
 
voronoi_D170_0001_g0_G250_volume.txt) to those calculated
 
voronoi_D170_0001_g0_G250_volume.txt) to those calculated
Line 363: Line 386:
  
 
   
 
   
 +
</nowiki>
 
===  ball  ===
 
===  ball  ===
 +
<nowiki>
  
 
This program creates an elliptical shell of brightness the specified brightness (-i option)
 
This program creates an elliptical shell of brightness the specified brightness (-i option)
Line 382: Line 407:
 
         code in /home/lml/krypton/facil/ball.c  
 
         code in /home/lml/krypton/facil/ball.c  
 
   
 
   
 +
</nowiki>
 
===  calc_ca3  ===
 
===  calc_ca3  ===
 +
<nowiki>
 
#/home/lml/krypton/bin/calc_ca3  
 
#/home/lml/krypton/bin/calc_ca3  
  
Line 424: Line 451:
 
source code in ~lml/krypton/Walsh directory.
 
source code in ~lml/krypton/Walsh directory.
 
   
 
   
 +
</nowiki>
 
===  cellsim  ===
 
===  cellsim  ===
 +
<nowiki>
 
  [0]: in main, before MPI_Init()
 
  [0]: in main, before MPI_Init()
 
[0]: in main, after MPI_Init()
 
[0]: in main, after MPI_Init()
Line 625: Line 654:
 
       ~lml/vision/JSinger/src/channel              (steady state based upon Neher paper)
 
       ~lml/vision/JSinger/src/channel              (steady state based upon Neher paper)
  
===  cellsimL ===
+
</nowiki>
  [0]: in main, before MPI_Init()
+
===  channel_current2 ===
[0]: in main, after MPI_Init()
+
  <nowiki>
[0]: /home/lml/krypton/bin/cellsimL -h
+
channel_current2: like channel_current, but looks at [ca] over time at each BK (not just max [ca]).
help:
+
From that, it calculates the max BK current. Channel_current adds the max [ca] that each BK voxel sees
unable to parse command: -h
+
from each voxel in a Ryr cluster, to get the max [ca] that BK pixel sees.  But the max [ca] could occur
    This program simulates Ca and Na in a cylindrical cell with
+
at different times since the Ryr cluster has a spatial extent.  Experimental.
    cylindrical symmetry.  
+
 
    Note: It is recommended that the stderr output be examined for
+
Calculates the current which would be produced when each object in Ryr_image.i2i releases calcium which
          lines with the words: warning, Warning, error, or Error on them.
+
activates nearby BK channels in BK_image.i2i. Produces a histogram of these output currents.
Usage
+
The input images should have each pixel in an object having the object id as its value. These images can be
    cellsim [options] >& output_datafile
+
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.
  
Options controlling the duration of the simulation:
+
Usage:
    -time #:       total time to simulate (in sec), default = 0.000000
+
channel_current [options] -f filename Ryr_image.i2i BK_image.i2i > im1_im2.hist
    -time_rate #:  slow down time, ie take smaller dt steps during simulation.
+
Options:
                    this may be necessary if you are creating a large ca gradient,
+
-f filename resting: file containing [ca], in nM, as a function of distance and time. Right now this is
                    for example, with -ca_ring or -ca_src options (.5 means 1/2 the dt).
+
assumed to have 20 nm spacing and entries every msec. See
                    The number of iterations needed for convergence is
+
/home/lml/krypton/Zhuge/STIC/simulations/run32.ca as an example
                    roughly: I= (T*diff)/(dr*dr), where T is time, dr is
+
"resting" is the resting [ca], in nM, for the cell. It will we subtracted from the other
                    annulus thickness and diff is diffusion constant.
+
[ca] values to produce a "delta" [ca] which gets scaled linearly by Ryr intensity.
                    This ignores ion influx,etc.  If you set diffusion rates very
+
The spark current used to produce this (see -C) should be roughly in the range expected
                    small, the iter # calculated will be too small if other stuff
+
for Ryr_image.i2i, since all delta [ca] is linearly extrapolated.
                    is happening, use -time_rate to compensate.
+
All distances > largest distance in filename will have their [ca] set to the [ca]
+
at the largest distance in filename.
Options controlling the geometry of the model:
+
note: Only the [ca] values at y == 1 are used. Is this what should be used?
    -radius #:     radius of the cell in microns, default = 6.000000
+
-u #: voltage (mV).  BK conductance is a function of voltage. default = -80.000000
    -rings #:     radius of the cell in rings, default = 60
+
-U low delta hi: voltages from low to hi by delta. Max is 20 voltages
                    Ring thickness = cell radius/ # of rings.
+
-r #:         resolution (binsize) for output histogram in femtoAmps, default = 1000.000000
    -length #:     length of the cell in disks, default = 300
+
-R #: reveral potential of BK channel in mV, default = -80.000000
                    Each disk will be the same thickness as a ring.
+
 
    -bc Rmax Lmin Lmax:     boundary conditions at maximum radius and minimum and
+
  distances:
                    maximum length coordinate (i.e., at the cell ends). These must
+
-w # # #: x,y, zweights for pixel distances (ie, pixel size), default = 1 for each.
                    be the letters I (for infinite) or S (for solid, i.e. no ions go
+
-p #: pixel size in nm (i.e., what 1 means in -w option), default = 80.000000
                    through the membrane). The I option is not always accurate. default: S
+
-m # :         maxdistance (in units used for -w, i.e., pixels) to look for the closest pixel, default = 10.000000
    -mask image.i2i: only voxels in image.i2i > 0 are part of the cell.  Use this
 
                    to specify an arbitrary shape for the cell.
 
                    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):
+
  which pixels or clusters to include:
    -ion name free_concentration D valence:  
+
-t # #: image1 and image2 thresholds, pixels > # are above threshold, default = 0.
                    concentration in mMolar, D in cm^2/sec, valence in absolute value.
+
-e lowx lowy lowz hix hiy hiz:  only look at voxels within this extent (subvolume), 1-indexed, inclusive.
                    valence is only used if -ion_src is also specified.
+
-s minsize maxsize:     only look at objects in Ryr_image.i2i within the size range (inclusive, in voxels)
                    concentration is the initial free concentration.
+
max size allowed = 100000
    -buffer name total_concentration D:  
+
-S minsize maxsize:     only look at objects in BK_image.i2i within the size range (inclusive, in voxels)
                    concentration in mMolar, D in cm^2/sec.
+
-i miniod maxiod:     only look at objects in Ryr_image.i2i within the iod range (inclusive. use -d also.)
                    concentration is the initial total concentration (sum of its free and all bound forms).
+
-I miniod maxiod:     only look at objects in BK_image.i2i within the iod range (inclusive. use -D also.)
    -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:
+
  scale factors:
    -ion_src name current dur lowdisk highdisk lowring highring:  
+
-d Ryrimage1d.i2i #: the original intensity image for Ryr_image (since Ryr_image has pixel values as id numbers)
                    have a current source of the specified ion coming in through the specified rings
+
# is the number of Ryrimage1d.i2i intensity units required to produce spark current
                    and numdisk (rings and disks are 0-indexed indices, inclusive).
+
used in the calcium simulation (which produced the -f filename data).
                    Current is in pA for the specified duration (sec).
+
This will scale the [ca] produced by each Ryr voxel. Default = 30000.000000
                    The current is uniformly divided within the entire specified input volume.
+
-D BKimage2d.i2i #: the original intensity image for BK_image (since BK_image has pixel values as id numbers)
                    All -buffer and -ion options must be specified prior to this.
+
# is the BKimage2d.i2i intensity from one BK channel.
                    See comments by the -time_rate option.
+
This will scale current produced. Default = 1000.000000
    -ion_src_file name imagename current duration:
+
If you want the intensity of each Ryr or BK object to affect the ca release (for Ryr)
                    Similar to -ion_src, but the specified floating point image is used to
+
or number of channels (for BK) , you need to provide the original data by using the
                    scale the input current at each voxel. The total current coming into the
+
-d and -D options. Otherwise all voxels in an object contribute equally (so large objects
                    cell is adjusted so that after this per pixel rescaling, it will = "current".
+
have more receptors or channels than small ones).
                    -ion_current_trace with op = S, will modify this.
+
-c #: BK single channel conductance in pS, default = 220.0
                    Typically do: int2float -M 1 psf.i2i imagename        prior to this.
+
-C #: peak current (in pAmps) used in the simulation to produce -f filename, default = 1.000000
    -ion_current_trace name filename dt op threshold:  modifies current specified with
+
This is just used for output produced by -v to estimate spark current produced per Ryr cluster.
                    the -ion_src or -ion_src_file options.
+
 
                    Times which the channel is open (i.e., current flows) is specified in a file.
+
  miscellaneous:
                    The file is a list of numbers (current or scale), 1 per line, at dt (in sec) intervals.
+
  -v: verbose. produces list of each Ryr cluster and K current produced to stderr. Other stuff too.
                    If op = T, currents greater than the specified threshold means channel open, otherwise closed.
+
To write this to a separate file do: (channel_current -v ... > stdout.channel) >& stderr.channel
                    If op = S, the current as specified with -ion_src is scaled by the number in the list.
+
  -V: very verbose
                    "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:
+
Examples:
    -save name filename type scale dt:
 
                    Save images of the specified substance (name) to specified file. By default
 
                    substances are saved in mM.  This will be multiplied by the scale
 
                    specified here. dt (in sec) is how often to save images.  Type is I
 
                    (short int, our normal format) or F (floating pt,2x space, more accurate).
 
                    The first image saved will be prior to any ion current. The last image
 
                    will always be the end of the simulation. "name" should be as
 
                    specified with the -ion, -buffer or -kin option.
 
                    If the image file already exists, new images will postpended to it.
 
    -save all tag type scale dt:
 
                    Equivalent to -save for all ions and buffers. Uses default file names,
 
                    but adds the tag on the end. ions in nM, all else in uM, then times scale.
 
    -save_flow name rfilename lfilename scale dt:
 
                    Save flow images of the specified substance (name) to specified files.
 
                    rfile is radial flow, lfile is lengthwise flow. Images saved in floating pt.
 
                    Flow is in pA (1 pA = 3 molecules/usec) times scale.
 
                    dt (in sec) is how often to save images. 
 
    -save_flow all ltag rtag scale dt:
 
                    Equivalent to -save_flow for all ions and buffers. Uses default file names,
 
                    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):
+
cellsim -spacing /home/lml/krypton/Zhuge/STIC/simulations/spacing2.txt ....     : produces ca.i2i
    invoke on the wolves as, for example,  mpirun -np 3 -machinefile file_of_machine_names cellsim ...
+
printvalsL -spacing2.txt -R -t -i ca.i2i > ca.vals    
    -print_proc #:  only print output from the specified process (0 indexed).
+
kate ca.vals     : delete fist comment line
                  Some output (eg, Total mmoles of ions, etc) are only valid for process 0.
+
      objs_via_ascent -s 5 100 Ryr.i2i Ryrid.i2i > tmp
    -overlap #:   overlap neighboring regions by the specified number of voxels (default = 50)
+
tail tmp  : the mean IOD gives an idea of brightness needed to produce current used in cellsim, say 30000
                  This will also be the number of iterations between necessary synchronization.
+
      objs_via_ascent -s 5 100 BK.i2i BKid.i2i > tmp
    -debug_mpi #:  print MPI info. Execute MPI dummy stubs if MPI NOT present (eg, under Windows,SGI).
+
tail tmp  : the mean IOD gives an idea of brightness of a BK cluster, eg mean= 10000, but assume that's 10 channels
                  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
+
channel_current -f ca.vals -w 1 1 3 -d Ryr.i2i 30000 -D BK.i2i 1000 Ryrid.i2i Bkid.i2i > ryr_bk.info
./cellsim -time .0010 -time_rate .5 -length 200 -rings 40 -radius 1 \
+
cull -s -c -1 -4 < ryr_bk.info |xmgrace -source stdin
        -ion Ca 100E-6 2.5E-6 2 -buffer Fluo3 .050 2.5E-7 -buffer Buf .230 1E-14 \
+
See also:
        -kin Fluo3 Ca CaFl 8E4 90 2.5E-7 -kin Buf Ca CaBuf 1E5 100 1E-14        \
+
closest_object closest_voxel objs_via_ascent /home/lml/krypton/Zhuge/BKandRyr/graph.pl,match.pl
        -ion_src Ca 1 .00105 99 102 0 3 \
+
graph_channel_current.pl, test_channel_current, /home/lml/krypton/Zhuge/STIC/simulations/run32  
        -save all _run1 I 1 .0001 >& cellsim_run1.out
+
/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
  
Simulate for 100msec saving images every msec. 1 pA comes in the the pattern as specified
+
</nowiki>
by psf_float.i2i for 10 msec.  The current is then modulated by values in current.txt which
+
===  cluster ===
are one value per line, dt of 1 msec between them. Cell shape in mask.i2i. Voxel sizes in
+
  <nowiki>
spacing.txt
+
Drops random Ryr receptors into a worldThen calculates how many clusters and their sizes get produced.
./cellsim -time .100 -time_rate .5 -spacing spacing.txt -mask mask.i2i \
+
Currently the "world" default size is  (2um)^3. (see -wsize)
        -ion Ca 100E-6 2.5E-6 2 -buffer Fluo3 .050 2.5E-7 -buffer Buf .230 1E-14  \
+
The origin of this world is in it's center (so it goes from -1um to +1 um in each direction by default).
        -kin Fluo3 Ca CaFl 8E4 90 2.5E-7 -kin Buf Ca CaBuf 1E5 100 1E-14        \
+
A histogram of cluster sizes is printed to stdout.
        -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)
 
 
 
===  channel_current2 ===
 
channel_current2: like channel_current, but looks at [ca] over time at each BK (not just max [ca]).
 
From that, it calculates the max BK current. Channel_current adds the max [ca] that each BK voxel sees
 
from each voxel in a Ryr cluster, to get the max [ca] that BK pixel sees. But the max [ca] could occur
 
at different times since the Ryr cluster has a spatial extentExperimental.
 
 
 
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
 +
 
 +
Examples:
  
  distances:
+
Source code in ~krypton/lml/Zhuge/Ryr_clusters 
-w # # #: x,y, zweights for pixel distances (ie, pixel size), default = 1 for each.
+
/home/lml/krypton/bin/cluster -h
-p #: pixel size in nm (i.e., what 1 means in -w option), default = 80.000000
 
-m # :         maxdistance (in units used for -w, i.e., pixels) to look for the closest pixel, default = 10.000000
 
  
  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.
 +
  -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
 +
  -L #: thickness of slab volume (um), default = 10.000000
 +
  -T #: number of samples in t, default = 10
 +
  -X #: number of samples in x, default = 1000
 +
  -h: print this help message.
 +
  -F: print out time (msec) and flux (particles/cm^2-msec) at x = 0
 +
(i.e., rate molecules binding to x=0 surface).
 +
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>
  
Examples:
+
This program creates an elliptical cell, cell length is in the y direction.
 +
It is used to model a squashed cell, and see how different it looks after
 +
blurring than a cylindrical cell
  
cellsim -spacing /home/lml/krypton/Zhuge/STIC/simulations/spacing2.txt ....     : produces ca.i2i  
+
Usage: ellipse [options] ellipse.i2i  
printvalsL -spacing2.txt -R -t -i ca.i2i > ca.vals    
+
options:
kate ca.vals     : delete fist comment line
+
  -d xdim ydim zdim:  dimensions of image, default = (50,100,50)
      objs_via_ascent -s 5 100 Ryr.i2i Ryrid.i2i > tmp
+
  -r xradius zradius:  radius (in pixels) in the x and z directions, default (20.000000,20.000000)
tail tmp  : the mean IOD gives an idea of brightness needed to produce current used in cellsim, say 30000
+
  -s samplerate: number of subsamples in x and z directions per pixel, default = 1
      objs_via_ascent -s 5 100 BK.i2i BKid.i2i > tmp
+
  -i intensity:  intensity inside the ellipse, default = 100.000000
tail tmp : the mean IOD gives an idea of brightness of a BK cluster, eg mean= 10000, but assume that's 10 channels
+
 +
</nowiki>
 +
===  em  ===
 +
  <nowiki>
 +
Creates (or reads in) a HMM and then generates random data from it
 +
(each model is a poisson process, with the j_th model having a lambda = 10*j).
 +
Then attempts to use an EM algorithm to estimate the original model.
 +
This is a way for me to learn how to implement the EM algorithm.
  
channel_current -f ca.vals -w 1 1 3 -d Ryr.i2i 30000 -D BK.i2i 1000 Ryrid.i2i Bkid.i2i > ryr_bk.info
+
Usage: em [options]
cull -s -c -1 -4 < ryr_bk.info |xmgrace -source stdin
+
options:
See also:
+
  -s #: number of states, default = 2. Must specify -t and -p after this.
closest_object closest_voxel objs_via_ascent /home/lml/krypton/Zhuge/BKandRyr/graph.pl,match.pl
+
  -t # # # ... #: state transition probabilities. If there are S states (e.g., -s #)
graph_channel_current.pl, test_channel_current, /home/lml/krypton/Zhuge/STIC/simulations/run32 
+
                        order: T[1][1], T[1][2], ... T[1][S], T[2][1] ... T[S][S] if there are S states),
/home/lml/krypton/Zhuge/BKandRyr/analysis6/cluster_distances.pl, plot_mean_sd_curve.pl
+
                        where T[i][j] is the probability of a transition from state i to state j.
/home/lml/krypton/Zhuge/xpp/ASM15.ode
+
  -p # # # ... #: prior probabilities of states (S entries if there are S states)
Bugs:
+
  -P #: which prior estimate to use for the pdf of the data (ie., estimate of Poisson process)
 +
        1 = uniform, 2 = delta, 3 = uniform+delta, 4 = peice of observed data histogram (default)
 +
        5 = true pdf (Poisson)
 +
  -n #: number of data points to simulate, default = 100
 +
  -m #: maximum number of iterations to perform, default = 20
 +
        -truetrans: use the true transition probabilities as the initial guess (default = uniform)
 +
        -trueprior: use the true prior probabilities as the initial prior guess (default = uniform)
 +
  -findstates:  also find (and print) the estimate of the states at each time point.
 +
  -v:  verbose. print more info to stderr.
 +
  -V:   print some more info. Some printouts only occur if # data pts is < 1000
  
Source code in ~krypton/lml/facil
+
Source code in /home/lml/krypton/facil/em.cc
  # Popen is monotonic as it should be.
+
See also: ~/krypton/facil/transpose.pl  to print out selected lines from the output file
must provide -f cafilename
+
          ~/krypton/matlab/netlab: has EM routines
 +
          ~/krypton/matlab/bayes/BNT/HMM: has HMM and EM routines
 +
/home/lml/krypton/bin/em -h
  
===  cluster ===
+
</nowiki>
Drops random Ryr receptors into a world. Then calculates how many clusters and their sizes get produced.
+
===  makebeads2 ===
Currently the "world" default size is  (2um)^3. (see -wsize)
+
  <nowiki>
The origin of this world is in it's center (so it goes from -1um to +1 um in each direction by default).
+
  /home/lml/krypton/bin/makebeads2
A histogram of cluster sizes is printed to stdout.
 
  
Usage:
+
randomly distributes beads within a volume.  created to let Jack simulate
cluster [options]
+
distribution of glut4 labels vesicles in the TIRF field of a microscope.
Options:
+
A bead has a constant value between its inner and outer diameters. This value
distance options:
+
falls to zero 3 standard deviations inside the inner diameter and 3 sd outside
-eucliddist:      calculate a Euclidean distance (same in x,y,z directions). This is the default.
+
the outer diameter. Beads are not allowed to intersect each other.
  (use -cdist option to set the nearby distance for this).
+
Writes info about beads created or moved to stdout (can be read back in with -b option).
-absdist:   rather than calculate a real distance, calculate max(ABS(dx),ABS(dy),ABS(dz)) - for speed
+
note: coords written out are zero indexed (not 1-indexed like addlines and play) in pixels.
  (use -cdist to set the nearby distance for this.)
+
usage:
-psfdist x y z:   distance (in um) a pt can be in the x, y, and z directions and be considered nearby.
+
makebeads2 [options] outimage.i2i
  Does not use -cdist. To approximate a psf you might specify .2 .2 .6
+
options:
      -cdist #:         how close (in um) two receptors must be to cluster, default = 0.500000
+
-d x y z: image dimensions in pixels, default = (256,256,64)
other options:
+
-D # #: bead inner and outer diameters in microns, default = 0.200000 and 0.200000
      -2D:   do a 2D simulation (x and y), not a 3D simulation
+
  -R #: inner rise standard deviation (in microns), default = 0.012500
-cylinder inner outer:  only place Ryr within a cylinder (e.g., plasma membrane) with specified
+
-F #: outer fall standard deviation (in microns), default = 0.012500
                        inner and outer radius (in um). The cylinder has its length the entire y dimension.
+
-S x y z: x, y, and z pixel dimensions (in microns), default = (0.040000,0.040000,0.010000)
  Only the parts of the cylinder which fit in the world (-wsize) are used.
+
-c x y z: x, y, and z pixel dimensions for new image size. If you are planning on taking the
-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)
+
image produced by makebeads2 and using chres to change pixel size, put the new
-psize x y z:   pixel width (in um) in the x, y, and z directions (default = 0.1,0.1,0.1)
+
pixel sizes here. This is used when calculating the intensity of the brightest pixel
      -numryr #:       number of Ryr receptors to drop, default = 1000
+
from each bead. This output info can be useful for signal to noise ratio tests.
-mindist #:   when placing Ryr receptors, keep this minimum distance (in um) between them.
+
-X #: number of subpixels per pixels, default = 10
-randstart #:   start the random number generator with # as the seed. So runs can be reproduced.
+
-p # val: set z plane # (0 indexed) to val (modelling diffuse fluorescence on the plasma membrane)
-image name.i2i   write out an image of the Ryr receptors. Can then use blur3d to create a realistic
+
If val is < 1 it is interpreted as a fraction of total light in the image.  
  microscope image, and countobjs to analyze it and compare to real data.
+
For example: val = .2 means set the z plane to the intensity necessary so that the total
diagnostics:
+
light in that plane is 2012f the total in the final image (i.e., after exponential if -e or -E)
      -debug:          turn on debugging
+
-e dist: apply an exponential scale factor exp(-z/dist) to each zslice; like a TIRF excitation intensity
      -verbose:        be a bit more verbose
+
dist is the 1/e distance in microns (.1 is a good value)
      -h:  print this help
+
This exponential also get applied to z plane value set via "-p # val" if val >= 1. It does
      -H:  print this help
+
NOT apply to that if val < 1.
      -help:  print this help
+
-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).
  
Examples:
+
options related to output:
 +
-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.
 +
-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
  
Source code in ~krypton/lml/Zhuge/Ryr_clusters  
+
options controlling randomization (of a uniform random distribution unless otherwise noted):
  /home/lml/krypton/bin/cluster -h
+
  -s min max: mininum and maximum range of allowed bead sizes. This number scales the
 
+
bead inner and outer diameters (does not change sd). default = 1.000000 and 1.000000
=== diffusion_limited_binding ===
+
  -G mean sd:  make bead sizes (scales) a Gaussian variable with specified mean and sd (instead of -s).
unknown option h
+
note: since beads can't intersect, if you place beads densely you will tend to get more
 
+
small beads (since the program generates a new random bead if one doesn't fit), and hence
Prints out distance (um) and concentration (particles/cm^3) at that distance
+
the size distribution will no longer match the parameters specified here.
a slab volume of initial uniform concentration (1 particle/cm^3)which has a ligand
+
  -g mean sd shell: like -G, but also specify bead shell thickness in microns. mean doesn't scale the shell thickness.
binding to a plane at x = 0. This is diffusion limited binding. See my notes of 10/20/98.
+
mean is the diameter to midway between the inner and outer diameters (so don't use -D option).
 +
-a min max: min and max amplitude (brightness) of bead, default = 1000.000000 and 1000.000000
 +
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.
 +
-P lambda scale:  make amplitude a Poisson variable with the specified mean (lambda) value (instead of -a option).
 +
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.
 +
-T: The amplitude specified with -a or -P option is the total light in the bead, not the light
 +
of one fully covered pixel.  Takes about double the time to run.
 +
note: if the amplitude isn't large compared to number of pixels in the bead's shell, then
 +
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
 +
unless -o option also specified.
 +
-y min max:  allowed position of beads, in pixels, zero indexed (default = anywhere within image)
 +
-z min max:  allowed position of beads, in pixels, zero indexed (default = anywhere within image)
 +
-o: allow bead centers to fall outside the image volume (except in low z direction, i.e. coverslip).
 +
This is a more accurate way to represent a small view of a large cell.
 +
This option is ignored if -b option used.
 +
-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
  
Usage: diffusion_limited_binding [options] 
+
Examples:
options:
+
#create 200 beads, with a 50 nm (5 z plane) gap before the pm, which has an
  -D #:  diffusion (cm^2/msec), default = 2.2E-09
+
#intensity of 50. Apply a TIRF exponential excitation scale to it.
  -t t1 t2:  start and stop time to simulate (msec), default = 0.000000 1000.000000
+
makebeads2 -e .1 -z 5 63 -p 5 50 -n 200 beads1.i2i > beads1.info
set both numbers equal if you only want one time point.
+
# apply microscope psf
  -x x1 x2: start and stop distances to print (um), default = 0.000000 10.000000
+
blur3d -P -N 256 256 128 beads1.i2i empiricalpsf_seg_40nm_seg.i2i beads1_blur3d.i2i
set both number equal if you only want one position
+
# bin (averge) to 100/160 nm resolution
  -L #: thickness of slab volume (um), default = 10.000000
+
reduceima -A -X 1 256 4 -Y 1 256 4 beads1_blur3d.i2i beads1_blur3d4x4.i2i
  -T #: number of samples in t, default = 10
+
# extract infocus plane
  -X #: number of samples in x, default = 1000
+
segment -Z 16 16 1 beads1_blur3d4x4.i2i beads1_blur2d4x4.i2i
  -h: print this help message.
+
# add ScratchNG camera noise
  -F: print out time (msec) and flux (particles/cm^2-msec) at x = 0
+
noise -e 1.4 -n 8 beads1_blur2d4x4.i2i beads1_blur2d4x4N.i2i
(i.e., rate molecules binding to x=0 surface).
+
histima -size 10 -bins 100 beads1_blur2d4x4N.i2i > beads1_blur2d4x4N.hist
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
+
#creates beads, move them, look at the results
(i.e., brightness of surface). Integral of flux from t1 = 0 regardless of -t option setting.
+
makebeads2 -z 5 63 beads1.i2i > beads1.info
  -s: don't print out concentration as a function of x (i.e, the entire slab)
+
#read those beads in and move them. but still must stay outside the first 50 nm.
   
+
makebeads2 -z 5 63 -b beads1.info .05 .05 beads2.i2i > beads2.info
=== ellipse ===
+
concateima beads1.i2i beads2.i2i beads.i2i
 +
imsets beads.i2i 2
 +
dave -tdim 2 -4 -I beads.i2i
 +
 
 +
#just create scripts (very fast) with positions of beads, and move them around.
 +
makebeads -z 5 63 -n 200 -A dummy.i2i > beads1.info
 +
makebeads -b beads1.info .05 .05 -z 5 63 -A dummy.i2i > beads2.info
 +
makebeads -b beads2.info .05 .05 -z 5 63 -A dummy.i2i > beads3.info
 +
#now create the images
 +
makebeads -b beads1.info 0 0 beads1.i2i > beads1.info2
 +
makebeads -b beads2.info 0 0 beads2.i2i > beads2.info2
 +
makebeads -b beads3.info 0 0 beads3.i2i > beads3.info2
  
This program creates an elliptical cell, cell length is in the y direction.
+
see also:  makebead, readbeads.pl, blur3d, project, /storage/big1/sh/simul
It is used to model a squashed cell, and see how different it looks after
 
blurring than a cylindrical cell
 
  
Usage: ellipse [options] ellipse.i2i
+
source code in ~lml/krypton/facil
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
 
 
   
 
   
===  em ===
+
</nowiki>
Creates (or reads in) a HMM and then generates random data from it
+
===  oxygen ===
(each model is a poisson process, with the j_th model having a lambda = 10*j).
+
<nowiki>
Then attempts to use an EM algorithm to estimate the original model.
+
Calculates steady state partial oxygen pressure (P) as a function of distance from a blood vessel (r).
This is a way for me to learn how to implement the EM algorithm.
+
The blood vessel has a radius of R1 (5.0 um) and Oxygen at the vessel is Ps (52.0 mm Hg).
 +
The default is to print partial Oxygen pressure (mm Hg) as a function of distance (um) as columns to stdout.
 +
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).
  
Usage: em [options]
+
The line source model (-m 1) implements equation 17 from KroghOxygenDiffusionModel1.pdf
options:
+
  Modeling pO2 Distributions in the Bone Marrow Hematopoietic Compartment.
  -s #: number of states, default = 2. Must specify -t and -p after this.
+
  I. Krogh's Model  by D.C.Chow, L. A. Wenning, W. M. Miller, and E.T. Papoutsakis
  -t # # # ... #: state transition probabilities. If there are S states (e.g., -s #)
+
  Biophysical Journal, vol. 81, August 2001, pp. 675-684.
                        order: T[1][1], T[1][2], ... T[1][S], T[2][1] ... T[S][S] if there are S states),
+
This models O2 assuming a constant oxygen consumption by the tissue and constant O2 (Ps) at the blood vessel.
                        where T[i][j] is the probability of a transition from state i to state j.
+
They claim results don't change by more than a few percent using proportional (or other) O2 consumption models.
  -p # # # ... #: prior probabilities of states (S entries if there are S states)
+
The value of dP/dr at R2 is forced to 0.
  -P #: which prior estimate to use for the pdf of the data (ie., estimate of Poisson process)
+
note: this is an implmentation of O2 from a line source (e.g., blood vessel), not a point source.
        1 = uniform, 2 = delta, 3 = uniform+delta, 4 = peice of observed data histogram (default)
+
So it is not appropriate to convolve (in 3D) this with a 3D image of blood vessels.
        5 = true pdf (Poisson)
+
But -p (or -m 2) will produce a point source image.
  -n #: number of data points to simulate, default = 100
 
  -m #: maximum number of iterations to perform, default = 20
 
        -truetrans: use the true transition probabilities as the initial guess (default = uniform)
 
        -trueprior: use the true prior probabilities as the initial prior guess (default = uniform)
 
  -findstates:  also find (and print) the estimate of the states at each time point.
 
  -v:  verbose. print more info to stderr.
 
  -V:  print some more info. Some printouts only occur if # data pts is < 1000
 
  
Source code in /home/lml/krypton/facil/em.cc
+
The point source model (-m 2) implements equation 14 from HeatConduction.pdf
See also:  ~/krypton/facil/transpose.pl  to print out selected lines from the output file
+
  Steady Heat Conduction in Layered Mediums: The Half-Space and Sphere, by Henry N. Pollack
          ~/krypton/matlab/netlab: has EM routines
+
  J. of Geophysical Research, vol. 70(22), Nov. 15, 1965, pp. 5645-5648
          ~/krypton/matlab/bayes/BNT/HMM: has HMM and EM routines
+
This models O2 assuming a constant oxygen consumption by the tissue and constant O2 (Ps) at the blood vessel.
/home/lml/krypton/bin/em -h
+
note: The value of dP/dr at R2 is forced to 0 unless -b # is specified.
 +
note: Since O2 consumption is constant, it might not make sense to use this in a convolution, since it isn't
 +
      linear.
  
===  makebeads2  ===
+
Model 3 is a point source model, but O2 consumption by the tissue is proportional to the O2 level in the tissue.
/home/lml/krypton/bin/makebeads2
+
  I derived it from Crank's equations 6.60 (infinite hollow sphere model) and 14.13 (see below).
 +
  It requires the specification of an initial O2 level in the tissue (P0, which is the same everywhere).
 +
  R2 is used only to determine how far out to plot the graph (and dP/dr at R2 is not used either).
 +
  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
 +
  it makes more sense to use in a convolution with a (binarized?) blood vessel image.
  
randomly distributes beads within a volume.  created to let Jack simulate
+
note: because R2 really should vary in an image, depending upon the distance between nearby blood vessels
distribution of glut4 labels vesicles in the TIRF field of a microscope.
+
        and because Ps is not just a scale factor (so, eg, brighter blood vessels in an image, if brightness is
A bead has a constant value between its inner and outer diameters. This value
+
        proportional to Ps, do NOT just cause a scale factor in the P(r) values), it may NOT be appropriate
falls to zero 3 standard deviations inside the inner diameter and 3 sd outside
+
to take the image produced by this program and convolve it with an image of blood vessels to get
the outer diameter. Beads are not allowed to intersect each other.
+
estimates of oxygenation of tissue. This comment may apply to all three models (definitely to -m 1)
Writes info about beads created or moved to stdout (can be read back in with -b option).
 
note: coords written out are zero indexed (not 1-indexed like addlines and play) in pixels.
 
usage:
 
makebeads2 [options] outimage.i2i
 
options:
 
-d x y z: image dimensions in pixels, default = (256,256,64)
 
-D # #: bead inner and outer diameters in microns, default = 0.200000 and 0.200000
 
-R #: inner rise standard deviation (in microns), default = 0.012500
 
-F #: outer fall standard deviation (in microns), default = 0.012500
 
-S x y z: x, y, and z pixel dimensions (in microns), default = (0.040000,0.040000,0.010000)
 
-c x y z: x, y, and z pixel dimensions for new image size.  If you are planning on taking the
 
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
 
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:
+
Usage: oxygen -m # [options]  
-i #: outimage.i2i should be scaled by # before writing it. Format is short int (our default format).
+
    required:
-f #: outimage.i2i should be scaled by # before writing it.  Format is float.
+
  -m # which model to use.  
-v: verbose.  
+
        -m 1 :line source model with constant O2 consumption
-A: don't create outimage.i2i (still need a dummy name on command line though).
+
-m 2: point source model with constant O2 consumption.
-B: don't even simulate voxels (just prints beads centers, amplitudes, sizes).  Automatically sets -A.
+
        -m 3 :point source model with O2 consumption proportional to O2 concentration.
-u file.objs: create file, which has a list of bead objects created, in the same format countobjs produces.
+
Use point source models if planning on convolving resulting image with a blood vessel image.
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
 
  
options controlling randomization (of a uniform random distribution unless otherwise noted):
+
    options for all models:
-s min max: mininum and maximum range of allowed bead sizes. This number scales the
+
Although these options can be used in all models, different models have different sensitivities to them.
bead inner and outer diameters (does not change sd). default = 1.000000 and 1.000000
+
  -R1 # vessel radius (um). Changes to this can change P a lot (if -m 1), and may require R2 to change (see -c).
-G mean sd:  make bead sizes (scales) a Gaussian variable with specified mean and sd (instead of -s).
+
default = 5.00
note: since beads can't intersect, if you place beads densely you will tend to get more
+
  -R2 # max distance any tissue is from a vessel (um). This changes the solution a lot for some models
small beads (since the program generates a new random bead if one doesn't fit), and hence
+
but for the -m 3 model it only affects how far out data is graphed, default = 2268.00
the size distribution will no longer match the parameters specified here.
+
More precisely, for -m 1 and -m 2 it is the distance at which dP/dr = 0 (ie, a b.c. on the pde).
-g mean sd shell: like -G, but also specify bead shell thickness in microns.  mean doesn't scale the shell thickness.
+
  -Ps # partial pressure of Oxygen at the blood vessel (mm Hg). Default = 52.00
mean is the diameter to midway between the inner and outer diameters (so don't use -D option).
+
40 is typical of veins, 95 of arteries. This is held constant over time in all the models right now.
-a min max: min and max amplitude (brightness) of bead, default = 1000.000000 and 1000.000000
+
For -m 1, this will affect the O2 value at R1, but how P changes RELATIVE to P(at R1) (as r increases)
a pixel which is entirely covered by the shell of the bead (between -D numbers) will have this value.
+
will not be affected (ie, it does NOT just scale everything).
So this is like specifying a fluorescent concentration.
+
    model 1 options:
-P lambda scale:  make amplitude a Poisson variable with the specified mean (lambda) value (instead of -a option).
+
  -c use with -R1 to automatically calculate R2 based on the specified R1 (since R2 affects the solution).
this value then gets multiplied by scale.  Amplitudes of 0 get ignored (a new amplitude is calculated).
+
(this also sets -m 1 as a convenience)
note: this is still just the amplitude of a covered pixel, not of the entire bead unless -T used too.
+
    model 2 options:
-T: The amplitude specified with -a or -P option is the total light in the bead, not the light
+
  -b # changes the 2nd boundary condition to be P at R2 = # mm Hg
of one fully covered pixel.  Takes about double the time to run.
+
instead of dP/dr = 0 at R2 (this also sets -m 2 as a convenience)
note: if the amplitude isn't large compared to number of pixels in the bead's shell, then
+
    model 3 options:
individual pixel intensities will be small and truncation may effect total intensity.
+
  -P0 # the initial oxygenation level of the tissue (mm Hg). Default = 0.000000
-x min max:  allowed position of beads, in pixels, zero indexed, inclusive. The entire bead must fit in this region
+
This will change the solution a lot, since it is also the level that O2, in steady state, approaches as r->infinity.
unless -o option also specified.
+
Therefore, nonzero P0 may also make convolution with a blood vessel image inappropriate.
-y min max:  allowed position of beads, in pixels, zero indexed (default = anywhere within image)
+
-P0 0 seems to produce the same results as -r. (-P0 also sets -m 3 as a convenience)
-z min max:  allowed position of beads, in pixels, zero indexed (default = anywhere within image)
 
-o: allow bead centers to fall outside the image volume (except in low z direction, i.e. coverslip).
 
This is a more accurate way to represent a small view of a large cell.
 
This option is ignored if -b option used.
 
-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:
+
    output graph options:
#create 200 beads, with a 50 nm (5 z plane) gap before the pm, which has an
+
  -n normalize output (doesn't affect -i image.i2i), ie, print r/R1  vs P/Ps  rather than r vs. P
#intensity of 50. Apply a TIRF exponential excitation scale to it.
+
  -r add a third reference column which is the "simple" diffusion solution (goes as 1/r)
makebeads2 -e .1 -z 5 63 -p 5 50 -n 200 beads1.i2i > beads1.info
+
This is for a point source in 3D (not a line source), and ignores O2 consumption.
# apply microscope psf
+
graph as: oxygen_krogh -r | xmgr -nxy stdin
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
+
    output image options:
makebeads2 -z 5 63 beads1.i2i > beads1.info
+
  -i image.i2i xdim ydim zdim:  create an image of the values, to use with blur3d to find
#read those beads in and move them. but still must stay outside the first 50 nm.
+
O2 everywhere in an image as a function of distance from blood vessels.
makebeads2 -z 5 63 -b beads1.info .05 .05 beads2.i2i > beads2.info
+
If you are planning on convolving you should probably specify -m 3 .
concateima beads1.i2i beads2.i2i beads.i2i
+
  -d x y z if -i is specified. pixel dimensions in um. default = 0.60 0.60 10.00
imsets beads.i2i 2
+
  -s # if -i is specified. scale output intensities by #. Otherwise max is 52.0 mm Hg
dave -tdim 2 -4 -I beads.i2i
+
  -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).
  
#just create scripts (very fast) with positions of beads, and move them around.
+
    other options:
makebeads -z 5 63 -n 200 -A dummy.i2i > beads1.info
+
  -v verbose. stuff to stderr.
makebeads -b beads1.info .05 .05 -z 5 63 -A dummy.i2i > beads2.info
+
  -V more verbose. stuff to stderr. debugging info.
makebeads -b beads2.info .05 .05 -z 5 63 -A dummy.i2i > beads3.info
+
  -h print this help
#now create the images
 
makebeads -b beads1.info 0 0  beads1.i2i > beads1.info2
 
makebeads -b beads2.info 0 0  beads2.i2i > beads2.info2
 
makebeads -b beads3.info 0 0  beads3.i2i > beads3.info2
 
  
see also: makebead, readbeads.pl, blur3d, project, /storage/big1/sh/simul
+
Examples:
 +
      # 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
  
source code in ~lml/krypton/facil
+
see also:  /home/lml/krypton/Corvera/Olga/README, SteadyStatePointDiffusion.pdf (my notes)
+
        Random Walks in Biology (New, expanded edition) by Berg p. 23 eq. 2.11;
===  oxygen  ===
+
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
Calculates steady state partial oxygen pressure (P) as a function of distance from a blood vessel (r).
+
source code in:  /home/lml/krypton/facil
The blood vessel has a radius of R1 (5.0 um) and Oxygen at the vessel is Ps (52.0 mm Hg).
+
error: A model must be specified, i.e., -m # must be specified.
The default is to print partial Oxygen pressure (mm Hg) as a function of distance (um) as columns to stdout.
 
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 line source model (-m 1) implements equation 17 from KroghOxygenDiffusionModel1.pdf
 
  Modeling pO2 Distributions in the Bone Marrow Hematopoietic Compartment.
 
  I. Krogh's Model  by D.C.Chow, L. A. Wenning, W. M. Miller, and E.T. Papoutsakis
 
  Biophysical Journal, vol. 81, August 2001, pp. 675-684.
 
This models O2 assuming a constant oxygen consumption by the tissue and constant O2 (Ps) at the blood vessel.
 
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
+
</nowiki>
  Steady Heat Conduction in Layered Mediums: The Half-Space and Sphere, by Henry N. Pollack
+
===  sparkspread  ===
  J. of Geophysical Research, vol. 70(22), Nov. 15, 1965, pp. 5645-5648
+
<nowiki>
This models O2 assuming a constant oxygen consumption by the tissue and constant O2 (Ps) at the blood vessel.
 
note: The value of dP/dr at R2 is forced to 0 unless -b # is specified.
 
note: Since O2 consumption is constant, it might not make sense to use this in a convolution, since it isn't
 
      linear.
 
  
Model 3 is a point source model, but O2 consumption by the tissue is proportional to the O2 level in the tissue.
+
Calculates the spread of spark event amplitudes given that two events occur at the same
  I derived it from Crank's equations 6.60 (infinite hollow sphere model) and 14.13 (see below).
+
spark site and compares it to the spread of amplitudes given that two events occur at
  It requires the specification of an initial O2 level in the tissue (P0, which is the same everywhere).
+
different spark sites. A spark site has a unique (x,y) position.
  R2 is used only to determine how far out to plot the graph (and dP/dr at R2 is not used either).
+
Prints mean and stddev to stdout. Also prints out histograms and cumulative distributions.
  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
 
  it makes more sense to use in a convolution with a (binarized?) blood vessel image.
 
  
note: because R2 really should vary in an image, depending upon the distance between nearby blood vessels
+
A valid datafile has either blank lines, comments (start with #) or a data line (spark event).
        and because Ps is not just a scale factor (so, eg, brighter blood vessels in an image, if brightness is
+
A data line has 8 or 11 fields. 11 if a stoc is associated with the spark event
        proportional to Ps, do NOT just cause a scale factor in the P(r) values), it may NOT be appropriate
+
A valid stoc (last 3 fields) must have a nonzero stoc amplitude (1st of 3 fields)
to take the image produced by this program and convolve it with an image of blood vessels to get
+
See /usr/people/lml/vision/Rhonghua/Sparks/singlesitev2 for a valid file format.
estimates of oxygenation of tissue. This comment may apply to all three models (definitely to -m 1)
 
  
Usage: oxygen -m # [options]
+
Usage: sparkspread [options] datafile
    required:
+
options:
  -m # which model to use.  
+
  -h: do NOT print histogram for intraspark data.
        -m 1 :line source model with constant O2 consumption
+
  -H: do NOT print histogram for interspark data.
-m 2: point source model with constant O2 consumption.
+
  -c: do NOT print cumulative distribution for intraspark data.
        -m 3 :point source model with O2 consumption proportional to O2 concentration.
+
  -C: do NOT print cumulative distribution for interspark data.
Use point source models if planning on convolving resulting image with a blood vessel image.
+
  -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
  
    options for all models:
+
Prints out time (secs) and concentration (nMolar) seen at a distance
Although these options can be used in all models, different models have different sensitivities to them.
+
from a channel with a constant current, open for specified time.
  -R1 # vessel radius (um). Changes to this can change P a lot (if -m 1), and may require R2 to change (see -c).
 
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:
+
Usage: spot_diffusion [options] 
  -n normalize output (doesn't affect -i image.i2i), ie, print r/R1  vs P/Ps  rather than r vs. P
+
options:
  -r add a third reference column which is the "simple" diffusion solution (goes as 1/r)
+
  -D #:  diffusion (cm^2/sec), default = 2.2E-06
This is for a point source in 3D (not a line source), and ignores O2 consumption.
+
  -c #:  current (pAmp), default = 1
graph as: oxygen_krogh -r | xmgr -nxy stdin
+
  -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
  
    output image options:
+
Reads in a floating point image or short int image as produced by simulation (i.e., cylindrical coords), calculates
  -i image.i2i xdim ydim zdim:  create an image of the values, to use with blur3d to find
+
the total calcium change (i.e., [ca](r)*pi*r*r - t(0)) as a function of distance from the calcium entry site.
O2 everywhere in an image as a function of distance from blood vessels.
+
Output is printed to stdout.
If you are planning on convolving you should probably specify -m 3 .
+
All input concentrations should be in nM
  -d x y z if -i is specified. pixel dimensions in um. default = 0.60 0.60 10.00
+
Each z slice is analyzed separately (i.e., z is assumed to be time) unless image is rectangular and 3D (-R).
  -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)
+
Usage: total_ca [options] ca.i2i
blur3d may care about this, depending upon options. default = (0.00,0.00,0.00)
+
      options for printing graphs of calcium (not concentration) vs. distance from ca entry location:
(maybe I should change this to define a line in the image when -m 1 is specified?)
+
the units for the graph are nM*um^3, but 1nM = .6ions/um^3 , so multiply be .6 to get ions
-p the output image should be for the simple 1/r point source (see -r explanation) rather
+
                      (and 1pA = 3,000 ions/msec if you want to convert to pA-msec).
for the line source (-m 1) or point source with O2 consumption (-m 2 or -m 3).
+
        -n: normalize calcium distance graph for each z slice (so sum of amplitudes = 1),
 +
                      (otherwise when graph spacing is changed, -g option, the height of the graph will change).
 +
  -a:    print absolute calcium, not delta calcium (the default).
 +
                      when this is applied to a uniform image it should produce a 4pi*r*r distribution.
 +
            The default, delta calcium, prints the delta (i.e., change) from slice 0 (regardless -z option)
 +
        (but delta calcium not calculated if 3D rectangular, i.e., -R specified).
  
    other options:
+
  -p # #: pixel size in microns in the radial (x) and lengthwise (y) directions,
  -v verbose. stuff to stderr.
+
default =  0.10 and  0.10
  -V more verbose. stuff to stderr. debugging info.
+
  -P # # #: pixel size in microns in x,y,z directions (rectangular not cylindrical coords),
  -h print this help
+
default = ( 0.10, 0.10, 0.10)
 +
  -r: data is rectangular, not cylindrical coords (-P sets this too)
 +
(e.g., already passed through cyl2cart).
 +
  -R: data is 3D rectangular (not 2D+time), not cylindrical coords.
 +
  -e x y:      0-indexed coords of calcium entry location (default: x= 0, y = ydim/2)
 +
  -E x y x:    0-indexed coords of calcium entry location for 3D rectangular data
 +
(i.e., z direction is not time). sets -R option.
 +
        -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.
  
Examples:
+
see also:
      # create a binary image of blood vessels (maybe use BestPath3D_ellipse instead? Maybe thin3D afterwards?):
+
    printvals, float2int, in matlab: readxmgr, acurves (see ~lml/krypton/JSinger for an example)
    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
 
  
see also:  /home/lml/krypton/Corvera/Olga/README, SteadyStatePointDiffusion.pdf (my notes)
+
source code in ~lml/krypton/Walsh directory.
        Random Walks in Biology (New, expanded edition) by Berg p. 23 eq. 2.11;
+
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
+
</nowiki>
source code in: /home/lml/krypton/facil
+
===  vcspat-models ===
  error: A model must be specified, i.e., -m # must be specified.
+
  <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).
  
===  sparkspread  ===
+
Usage:
 +
  vcspat-models [options] mask.i2i out.i2i
  
Calculates the spread of spark event amplitudes given that two events occur at the same
+
Options:
spark site and compares it to the spread of amplitudes given that two events occur at
+
  -m #    : model number (default 0).
different spark sites. A spark site has a unique (x,y) position.
+
            0 - grid pattern
Prints mean and stddev to stdout. Also prints out histograms and cumulative distributions.
+
            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
  
A valid datafile has either blank lines, comments (start with #) or a data line (spark event).
+
Options related to objects:
A data line has 8 or 11 fields. 11 if a stoc is associated with the spark event
+
  -O thresh name.i2i: threshold an image to use for objects. Extracts as an object each
A valid stoc (last 3 fields) must have a nonzero stoc amplitude (1st of 3 fields)
+
            connected set of voxels above thresholdPlaces these objects randomly
See /usr/people/lml/vision/Rhonghua/Sparks/singlesitev2 for a valid file format.
+
            into the output image (uses each object once). Use with the
 
+
            -m 1 option. Do not use the -r option
Usage: sparkspread [options] datafile
+
  -P name.i2i id.i2i: similar to -O option, extracts as an object each of the
options:
+
    the objects in name.i2i based upon their pixel values (object id) in id.i2i
  -h: do NOT print histogram for intraspark data.
+
(e.g., id.i2i was produced via objs_via_ascent). This option preserves the
  -H: do NOT print histogram for interspark data.
+
distinction between objects in name.i2i which may be touching - since simple thresholding is not used.
  -c: do NOT print cumulative distribution for intraspark data.
+
If only an id.i2i is available (no name.i2i), you can specify -P id.i2i id.i2i
  -C: do NOT print cumulative distribution for interspark data.
+
  -v: replace objects (after fitting them into the image) with just the single voxel
  -b #: number of bins for histogram, default = 20
+
at the brightest location in the objectOnly use with -O and -e options.
  -n: normalize the histograms so their maximum is 1
+
  -S # #:  minimum and maximum object sizes to allow (use with -O option).
  -k: also print ks statistic showing if two distributions are different.
+
  -e: do not allow (exclude) objects to be placed so that they overlap with each
+
other, go outside the image, or go outside the maskThe default is to allow
=== spot_diffusion ===
+
overlaps and to just zero out that part of an object which goes outside the
#/home/lml/krypton/bin/spot_diffusion
+
image volume or mask.
0.001  15918.5
+
  -n: number the objects in out.i2i (use with -O or -P options). Rather than all
0.002  16550.4
+
the pixels in an object being their original values, all the pixels in object 1
0.003  16831.4
+
will be labeled 1, all those in object 2 labeled 2, etcIf -e not specied and
0.004  16999.1
+
objects overlap the first object placed (usually the largest) will prevail.
0.005  17113.6
+
Can also be used with -v, then output will have the brightest voxel set to object id, others to 0.
0.006  17198.2
+
The output of this can be analyzed by object_overlap program.
0.007  17264
+
  -N out2.i2i: create a second output file, number the objects in out2.i2i (like -n).
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
 
0.749994  18006.4
 
0.750994  18006.4
 
0.751994  18006.5
 
0.752994  18006.5
 
0.753994  18006.6
 
0.754994  18006.6
 
0.755994  18006.7
 
0.756994  18006.7
 
0.757994  18006.8
 
0.758994  18006.8
 
0.759994  18006.9
 
0.760994  18006.9
 
0.761994  18007
 
0.762994  18007
 
0.763994  18007.1
 
0.764994  18007.1
 
0.765994  18007.2
 
0.766994  18007.2
 
0.767994  18007.3
 
0.768994  18007.3
 
0.769994  18007.4
 
0.770994  18007.4
 
0.771994  18007.5
 
0.772994  18007.5
 
0.773994  18007.6
 
0.774994  18007.6
 
0.775994  18007.7
 
0.776994  18007.7
 
0.777994  18007.8
 
0.778994  18007.8
 
0.779994  18007.9
 
0.780994  18007.9
 
0.781994  18008
 
0.782993  18008
 
0.783993  18008.1
 
0.784993  18008.1
 
0.785993  18008.2
 
0.786993  18008.2
 
0.787993  18008.3
 
0.788993  18008.3
 
0.789993  18008.4
 
0.790993  18008.4
 
0.791993  18008.5
 
0.792993  18008.5
 
0.793993  18008.6
 
0.794993  18008.6
 
0.795993  18008.7
 
0.796993  18008.7
 
0.797993  18008.8
 
0.798993  18008.8
 
0.799993  18008.9
 
0.800993  18008.9
 
0.801993  18009
 
0.802993  18009
 
0.803993  18009.1
 
0.804993  18009.1
 
0.805993  18009.2
 
0.806993  18009.2
 
0.807993  18009.3
 
0.808993  18009.3
 
0.809993  18009.4
 
0.810993  18009.4
 
0.811993  18009.4
 
0.812993  18009.5
 
0.813993  18009.5
 
0.814993  18009.6
 
0.815993  18009.6
 
0.816993  18009.7
 
0.817993  18009.7
 
0.818993  18009.8
 
0.819993  18009.8
 
0.820993  18009.9
 
0.821993  18009.9
 
0.822993  18010
 
0.823993  18010
 
0.824993  18010.1
 
0.825993  18010.1
 
0.826993  18010.1
 
0.827993  18010.2
 
0.828993  18010.2
 
0.829993  18010.3
 
0.830993  18010.3
 
0.831993  18010.4
 
0.832993  18010.4
 
0.833993  18010.5
 
0.834993  18010.5
 
0.835993  18010.6
 
0.836993  18010.6
 
0.837993  18010.6
 
0.838993  18010.7
 
0.839993  18010.7
 
0.840993  18010.8
 
0.841993  18010.8
 
0.842993  18010.9
 
0.843993  18010.9
 
0.844993  18011
 
0.845993  18011
 
0.846993  18011
 
0.847993  18011.1
 
0.848993  18011.1
 
0.849993  18011.2
 
0.850993  18011.2
 
0.851993  18011.3
 
0.852993  18011.3
 
0.853993  18011.3
 
0.854993  18011.4
 
0.855993  18011.4
 
0.856993  18011.5
 
0.857993  18011.5
 
0.858993  18011.6
 
0.859993  18011.6
 
0.860992  18011.7
 
0.861992  18011.7
 
0.862992  18011.7
 
0.863992  18011.8
 
0.864992  18011.8
 
0.865992  18011.9
 
0.866992  18011.9
 
0.867992  18012
 
0.868992  18012
 
0.869992  18012
 
0.870992  18012.1
 
0.871992  18012.1
 
0.872992  18012.2
 
0.873992  18012.2
 
0.874992  18012.2
 
0.875992  18012.3
 
0.876992  18012.3
 
0.877992  18012.4
 
0.878992  18012.4
 
0.879992  18012.5
 
0.880992  18012.5
 
0.881992  18012.5
 
0.882992  18012.6
 
0.883992  18012.6
 
0.884992  18012.7
 
0.885992  18012.7
 
0.886992  18012.7
 
0.887992  18012.8
 
0.888992  18012.8
 
0.889992  18012.9
 
0.890992  18012.9
 
0.891992  18013
 
0.892992  18013
 
0.893992  18013
 
0.894992  18013.1
 
0.895992  18013.1
 
0.896992  18013.2
 
0.897992  18013.2
 
0.898992  18013.2
 
0.899992  18013.3
 
0.900992  18013.3
 
0.901992  18013.4
 
0.902992  18013.4
 
0.903992  18013.4
 
0.904992  18013.5
 
0.905992  18013.5
 
0.906992  18013.6
 
0.907992  18013.6
 
0.908992  18013.6
 
0.909992  18013.7
 
0.910992  18013.7
 
0.911992  18013.8
 
0.912992  18013.8
 
0.913992  18013.8
 
0.914992  18013.9
 
0.915992  18013.9
 
0.916992  18014
 
0.917992  18014
 
0.918992  18014
 
0.919992  18014.1
 
0.920992  18014.1
 
0.921992  18014.1
 
0.922992  18014.2
 
0.923992  18014.2
 
0.924992  18014.3
 
0.925992  18014.3
 
0.926992  18014.3
 
0.927992  18014.4
 
0.928992  18014.4
 
0.929992  18014.5
 
0.930992  18014.5
 
0.931992  18014.5
 
0.932992  18014.6
 
0.933992  18014.6
 
0.934992  18014.6
 
0.935992  18014.7
 
0.936992  18014.7
 
0.937991  18014.8
 
0.938991  18014.8
 
0.939991  18014.8
 
0.940991  18014.9
 
0.941991  18014.9
 
0.942991  18014.9
 
0.943991  18015
 
0.944991  18015
 
0.945991  18015.1
 
0.946991  18015.1
 
0.947991  18015.1
 
0.948991  18015.2
 
0.949991  18015.2
 
0.950991  18015.2
 
0.951991  18015.3
 
0.952991  18015.3
 
0.953991  18015.4
 
0.954991  18015.4
 
0.955991  18015.4
 
0.956991  18015.5
 
0.957991  18015.5
 
0.958991  18015.5
 
0.959991  18015.6
 
0.960991  18015.6
 
0.961991  18015.7
 
0.962991  18015.7
 
0.963991  18015.7
 
0.964991  18015.8
 
0.965991  18015.8
 
0.966991  18015.8
 
0.967991  18015.9
 
0.968991  18015.9
 
0.969991  18015.9
 
0.970991  18016
 
0.971991  18016
 
0.972991  18016
 
0.973991  18016.1
 
0.974991  18016.1
 
0.975991  18016.2
 
0.976991  18016.2
 
0.977991  18016.2
 
0.978991  18016.3
 
0.979991  18016.3
 
0.980991  18016.3
 
0.981991  18016.4
 
0.982991  18016.4
 
0.983991  18016.4
 
0.984991  18016.5
 
0.985991  18016.5
 
0.986991  18016.5
 
0.987991  18016.6
 
0.988991  18016.6
 
0.989991  18016.7
 
0.990991  18016.7
 
0.991991  18016.7
 
0.992991  18016.8
 
0.993991  18016.8
 
0.994991  18016.8
 
0.995991  18016.9
 
0.996991  18016.9
 
0.997991  18016.9
 
0.998991  18017
 
0.999991  18017
 
%
 
 
===  total_ca  ===
 
#/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
+
OtherOptions
the total calcium change (i.e., [ca](r)*pi*r*r - t(0)) as a function of distance from the calcium entry site.
+
  -s #    : seed for random number generator (default pid)
Output is printed to stdout.
+
  -x #    : x increment for grid pattern (default 3)
All input concentrations should be in nM
+
  -y #    : y increment for grid pattern (default 3)
Each z slice is analyzed separately (i.e., z is assumed to be time) unless image is rectangular and 3D (-R).
+
  -z #    : z increment for grid pattern (default 3)
 +
  -V: verbose
  
Usage: total_ca [options] ca.i2i
+
note: entire image name (with extension) is required.
      options for printing graphs of calcium (not concentration) vs. distance from ca entry location:
+
note: a - in place of an image name means stdin or stdout.
the units for the graph are nM*um^3, but 1nM = .6ions/um^3 , so multiply be .6 to get ions
+
Examples:
                      (and 1pA = 3,000 ions/msec if you want to convert to pA-msec).
+
  objs_via_ascent in1.i2i inid1.i2i
        -n: normalize calcium distance graph for each z slice (so sum of amplitudes = 1),
+
  objs_via_ascent in2.i2i inid2.i2i
                      (otherwise when graph spacing is changed, -g option, the height of the graph will change).
+
  vcspat-models-new -m 1 -M 1 -P in1.i2i inid1.i2i -N outid1.i2i  mask.i2i out1.i2i
  -a:    print absolute calcium, not delta calcium (the default).
+
  vcspat-models-new -m 1 -M 1 -P in2.i2i inid2.i2i -N outid2.i2i  mask.i2i out2.i2i
                      when this is applied to a uniform image it should produce a 4pi*r*r distribution.
+
  object_overlap outid1.i2i outid2.i2i  > obj_overlap
            The default, delta calcium, prints the delta (i.e., change) from slice 0 (regardless -z option)
+
  overlapL out1.i2i out2.i2i > coloc
        (but delta calcium not calculated if 3D rectangular, i.e., -R specified).
+
 
 +
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]
  
  -p # #: pixel size in microns in the radial (x) and lengthwise (y) directions,
+
options:
default =  0.10 and 0.10
+
-interp interpolate missing z slices in boundary.pts before using it.
  -P # # #: pixel size in microns in x,y,z directions (rectangular not cylindrical coords),
+
zslices must be in ascending order in boundary.pts.
default = ( 0.10, 0.10, 0.10)
+
contours must all be drawn in the same direction (i.e., all clockwise or all counter-clockwise).
  -r: data is rectangular, not cylindrical coords (-P sets this too)  
+
The name of each object is changed to "nuke"A maximum of 1000 zslices is allowed.
(e.g., already passed through cyl2cart).
+
-shrink=# shrink boundary.pts by this number of pixels before using it
  -R: data is 3D rectangular (not 2D+time), not cylindrical coords.
+
-expand=#  expand boundary.pts by this number of pixels before using it
  -e x y:      0-indexed coords of calcium entry location (default: x= 0, y = ydim/2)
+
-zrange=#:#    only examine z slices (1-indexed in this range)
  -E x y x:    0-indexed coords of calcium entry location for 3D rectangular data
+
-dist=#: keep all voxels within this distance of the boundary, default = 2
(i.e., z direction is not time). sets -R option.
+
-dx=#          pixel size x size (default = 1. all that really matters is relative x,y, and z size)
        -g #: graph spacing. default is the pixel size.
+
-dy=#          pixel size y size (although if you change this then that may affect -dist)
        -s #:        subsample each voxel this number of times in the x (radial) and y (longitudinal) directions,
+
-dz=#         pixel size z size
                      (and z if 3D and not 2D+time) default = 3 (anything less tends to introduce errors).  
+
-dontcapends    first and last outline slices aren't capped (removes -c from the call to histogram2).
        -z low hi dz: only look at z slices low to hi (0-indexed, inclusive), stepping by dz.
+
        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 _)
  
see also:
+
example:
    printvals, float2int, in matlab: readxmgr, acurves (see ~lml/krypton/JSinger for an 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
  
source code in ~lml/krypton/Walsh directory.
+
see also: shrink_wrap (to apply prior to Corecell.pl to get a better starting surface)
 
   
 
   
===  vcspat-models ===
+
</nowiki>
  argc = 1
+
===  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
  
This program creates a volume image with objects randomly placed
+
count_2d_objs2.pl [options] image.i2i file.stats
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:
+
options:
   vcspat-models [options] mask.i2i out.i2i
+
   -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.
  
Options:
+
   -verbose
   -m #    : model number (default 0).
+
  -dummy
            0 - grid pattern
+
   -noclean
            1 - random pattern
+
 
   -M #    : value of mask pixels (default 1).
+
   
  -r #    : number of random points to use in random pattern (default 25000)
+
</nowiki>
  -o name : image to use at point in pattern (default just turns on a pixel)
+
===  distance2surface_overtime.pl  ===
(can use up to 256 images - image will be randomly chosen)
+
<nowiki>
  -a : if objects overlap, add their pixel values instead of just replacing
 
  
Options related to objects:
+
Finds the distance (in pixels) of a specified pt (over time) from the nearest pixel
  -O thresh name.i2i: threshold an image to use for objects. Extracts as an object each
+
greater than 0 in 3Dimage.i2i (or greater than -threshold). Alternatively, finds
            connected set of voxels above threshold.  Places these  objects randomly
+
the distance to the boundary surface specified with the -surface option.
            into the output image (uses each object once). Use with the
+
The coords is as produced by track_pts (x y z otherstuff).
            -m 1 option. Do not use the -r option
+
Written to let Andrea take a tracked gene in the nucleus and find its
  -P name.i2i id.i2i: similar to -O option, extracts as an object each of the
+
distance to the nuclear envelope over time.
    the objects in name.i2i based upon their pixel values (object id) in id.i2i
+
Note: touching voxels may have a distance of .5 voxels, and voxels at the same
(e.g., id.i2i was produced via objs_via_ascent). This option preserves the
+
      position may have a distance of -.5 (??)  
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
+
distance2surface.pl [options] 3Dimage.i2i specifiedpt.coords outfile.dist
  -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.
+
options:
note: a - in place of an image name means stdin or stdout.
+
-surface=boundary.pts find distance to the surface defined by boundary.pts
Examples:
+
  rather than the distance to nearest >0 voxel 3Dimage.i2i
  objs_via_ascent in1.i2i inid1.i2i
+
-shrink=#  shrink boundary.pts by this number of pixels before using it
  objs_via_ascent in2.i2i inid2.i2i
+
-expand=#  expand boundary.pts by this number of pixels before using it
  vcspat-models-new -m 1 -M 1 -P in1.i2i inid1.i2i -N outid1.i2i  mask.i2i out1.i2i
+
-zrange=#:#    only examine z slices (1-indexed in this range)
  vcspat-models-new -m 1 -M 1 -P in2.i2i inid2.i2i -N outid2.i2i  mask.i2i out2.i2i
+
-threshold=#    threshold 3Dimage.i2i (voxels <= threshold set to 0, > threshold set to boundary).
  object_overlap outid1.i2i outid2.i2i  > obj_overlap
+
-pixel=# pixel size (in x and y) in nm
  overlapL out1.i2i out2.i2i > coloc
+
-verbose print out extra into to stderr as it goes along
 +
-vverbose very verbose
 +
-keepfiles keep all intermediate files (all begin with _)
  
See also: krypton/Qiong/run1,  vcspat, randompuncs, spatial_stats2, objs_via_ascent, countobjs
+
   
 +
</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.
  
Source code in /storage/big1/lml/jac/was_invitro/Projects/cspat-volume
+
</nowiki>
 +
===  findpaths_exo4.pl  ===
 +
<nowiki>
  
== Statistics ==
+
this program takes output from exo4.
=== cluster_distances.pl ===
+
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 pathsThese options are mutually exclusive.
 +
  -zrange=minz:maxz     :  only print tracks which start within the z range specified (1-indexed, inclusive)  
  
  Takes output from channel_current2 (after 11/24/09) and pulls out statistics about
+
what to do with the paths:
  mean distance to each BK clusterThen produces average stats from all the files
+
  -saved_labels=filename    : implies -saved_paths. saves labels for each path into the specified filename. This
  analyzed. Output to stdout.
+
    :  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
  
usage:
+
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 -
  
  -files:file1:file2:...:filen       which files to analyze. Defaults are files named 2_*.currents in cwd.
+
see also: ~lml/krypton/Huang/TIRF4/graph_exo3.csh
  -numBKvsProb       also prints numBK vs prob data suitable for xmgrace
+
 +
</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.
  
example:
+
mask_and_coloc.pl -x=# -y=# -thresh=# -pts=file.rpts -vin=vin.i2i -trip=trip.i2i
  (channel_current2  .... > file.channel_current) >& file1.currents
 
  (channel_current2  .... > file2.channel_current) >& file2.currents
 
  cluster_distances.pl -numBKvsProb -files=file1.currents:file2.currents > avg_distances.txt
 
  fgrep -v clusters avg_distances.txt |xmgrace -pipe
 
  
note: mean distances to clusters are not always increasing (e.g., mean distance to 10th
+
options:
      cluster could be SMALLER than the mean distance to the 9th cluster).  I think this
+
  -tx=# translate by a max of -tx when calculating other colocalization numbers, default = 25
      has to do with limiting my maximum distance (see comments in this file).
+
  -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.
  
 
   
 
   
  see also:
+
</nowiki>
   channel_current2
+
===  mask_gedmat_images4.pl ===
  /home/lml/krypton/Zhuge/BKandRyr/analysis6/run12
+
<nowiki>
  /home/lml/krypton/Huang/Kth_pt.m
+
   mask_gedmat_images4.pl  -check_intersect  added.
  p. 637 of Cressie.  
+
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
===  coloc.pl  ===
+
  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.
  
calls coloc3way with a bunch of different thresholds. Creates an output file which can be
+
  This is done by finding all the *_Area.zip files in the current directory, pulling out the outlines in those files
graphed with VennDiagram.m.  
+
  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).  
  
coloc.pl im1.i2i im2.i2i im3.i2i > out.coloc3way
+
  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].
  
options:
+
  note: If only 2 areas (ie, two .roi files) are present in the zip file, they are assumed to be for
-time_vs_thresh just generate a file which shows which times correspond to which thresholds. images can be dummy names.
+
the explant and day7 (not day11).
  
-t1=#:#:# threshold one should go from # to # by #. default = 800:1200:50
+
  note: This program assumes the center of the combined image (usually 4 well images are combined into one) is the
-t2=#:#:# threshold two should go from # to # by #. default = 800:1200:50
+
center of the well. see combine_images.pl. It also assumes the combined image name ends in combined.i2i
-t3=#:#:# threshold three should go from # to # by #. default = 2000:4000:200
+
(see -combined).
-numthresh=#1:#2:#3  ignore the third number in the -t1, -t2, and -t3 options (or in the default) and instead calculate a
 
  threshold step size so that #1 thresholds are applied to im1.i2i (dat image)
 
  #2 thresholds are applied to im2.i2i (ctx image), #3 thresholds are applied to im3.i2i (rin image).
 
  e.g., -numthresh=5:10:10 will apply 5 different thresholds to im1.i2i, and 10 thresholds to im2.i2i and im3.i2i.
 
  Using this option lets me insure that each call to coloc.pl will produce exactly the same number of data points;
 
  this may make the statistical comparison between cells easier.
 
  
-Melikian=file in addition to creating output for VennDiagram, create text file with the coloc percentages
+
  note: some of the scripts I use to then analyze these results will multiply the area by 2, to get a "true" estimate
Dr. Melikian is interested in. Graph via xmgr -nxy. See header in file for coloc info.
+
  of growth; since the value produced by mask_gedmat_images3.pl will be (roughly) half of the real growth rates.
For this to work the three image files MUST be specified in the order 405  594  488 (i.e., rin.i2i ctx.i2i dat.i2i)
 
-Melikian2=file Same as -Melikian, but dat (488) is image 1, ctx (594) image 2, and rin (405) image 3
 
-area=file.xyr also print out Melikian data as xyr where r is proportional to the number of pixels involved
 
(i.e., the denominator used when calculating the percent colocalized).
 
prints to "file.xyr".  Must also specify either -Melikian or -Melikian2
 
xmgrace -graphtype fixed -settype xyr file.xyr
 
-matlab=file:#  like -area but as columns so easy to read into matlab: t p1 n1 p2 n2 p3 n3 p4 n4
 
# is the max n value (ie, all n values are scaled so the max over n1,n2,n3,n4 is #).
 
Since p1,p2,p3,p4 are percent, # is typically set to a small part of that, e.g. .05.
 
If # is negative then abs(#) is just used as a scale factor (so -1 would just keep the
 
n values as the number of voxels). Graph in matlab with line width of 2*n1:
 
matlab  # import data=(tdim,9)
 
>> lowy = data(:,2) - data(:,3); hiy = data(:,2) + data(:,3);  x = data(:,1);
 
>> area(x,hiy,'FaceColor',[1 0 0],'EdgeColor','r','LineWidth',1); hold on;
 
>> area(x,lowy,'FaceColor',[1 1 1],'EdgeColor','r','LineWidth',1);
 
Must also specify -Melikian or -Melikian2.
 
  
-debug
+
  usage:
-verbose
+
mask_gedmat_images3.pl  [options]
  
example:
+
  options:
 +
-tmpdir=fullpathname directory to use for temporary files which are created, eg: -tmpdir=/home/lml/krypton
  
coloc.pl im1.i2i im2.i2i im3.i2i > coloc.data
+
-zip_file=file.zip
coloc.pl -time_vs_thresh im1.i2i im2.i2i im3.i2i > coloc.times
+
-zip_file=file.zip:file2.zip:...:filen.zip
matlab
+
only examine the one specified zip file, not all those in the directory
>> VennDiagram('coloc.data','percent') # and manually look at coloc.times while doing this to convert times to thresholds.
+
(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.
  
see also:
+
-results_ending=stuff e.g., -results_ending=_results.txt  This is what the -zip_ending should be replaced by
~/krypton/packages/fiji/Fiji.app/plugins/jacob_.jar - more traditional colocalization measures
+
to get the name of the associated fiji results file.  note the _ should be included here
coloc_tseries2
+
if it was included in -zip_ending.
colocalizeL
 
  
   
+
-combined_ending=stuff e.g., -combined_ending=_combined_reduced_.i2i . default = combined.i2i.
==probcircle.pl  ===
+
This is any string which helps identify the last part of the combined image filename.
  given a sphere of diameter D, what is the prob of oberving a disk of radius r when a random plane intersects it?
+
-combined_scaling=#:# e.g., -combined_scaling=2:2 if reduceima -bin 2 2 was applied to get _combined_reduced_.i2i.
  prints to stdout: r  prob(r) 1/prob(r)
 
  
  usage:  
+
-scale=#:# distance and area (eg, -scale=2:4 if reduceima -bin 2 2 was used) scaling. This will multiply
      probcircle.pl [options]
+
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.  
  
  options:
+
-check_intersect check if outlines intersect with the explant's outline. If so, set an error flag on stdout printout
-D=# default = 1
+
and print info to stderr.  eventually will just use area numbers rather than masking area in this situation.
-just_prob don't print the third column
+
that is not done yet ...
  
  examples:
 
      probcircle.pl | xmgrace -free -pipe -nxy -
 
  
  see also: p. 249 stereology_book.pdf
+
-save_day[=directory]
    /home/lml/krypton/packages/fiji/stereology_lml.template
+
saves the final binary mask for each days growth (eg, day7 growth minus the explant and minus the part growing towards the wall)
    /home/lml/krypton/Corvera/Raz/stereology/plot_results.pl
+
into a 3d mask image (patientid_tissue_day#_mask.i2i).  This image will be reduced down in xdim and ydim from the
    /home/lml/krypton/facil/cross_sections_of_sphere
+
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.
===  compare2dist  ===
+
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
 +
  
This program calculates whether two amplitude distributions are the same.
 
It was written to examine Rhonghua's STOCS data to determine whether the increase
 
in observed STOC frequency could be explained by an increase in STOC amplitude
 
(since then more events above threshold would be observed). 
 
datafile2 should be the one with larger amplitudes (so we hypothesize it has fewer missing
 
events if it is just a version of datafile1 shifted higher).  It will get shifted down
 
by a range of shifts (-s option) and compared with datafile1.
 
This routine also compares the temporal interarrival time distribution of each datafile with
 
that predicted by a poisson process and with the other datafile; the temporal calculations
 
ignore all missing data issues and shifting issues for now.
 
  
This program reads data in the form:
+
   source code: in /home/lml/krypton/bin/mask_gedmat_images.pl
    time calcium prior_baseline post_baseline amplitude
 
      where the values are
 
      time:            time of STOC
 
      calcium:        SR calcium level
 
      prior_baseline:  amplitude just prior to STOC
 
      post_baseline:   amplitude just after STOC
 
      amplitude:       amplitude amplitude of STOC (not relative to baseline)
 
Data is expected to already be sorted by time (smallest to largest).
 
comment lines must begin with a #
 
  
Usage: compare2dist [options] datafile1 datafile2
+
options:
+
</nowiki>
    -t #: only include data with an amplitude > #. The default
+
===  mask_gedmat_images4_new.pl  ===
is to assume a 0 threshold. If you have acquired the data
+
<nowiki>
using some thresholding criterium (eg, only peaks above
+
  mask_gedmat_images4_new.pl
10picoamps are counted) then you should provide that number
+
The easiest way to call this is via analyze_gedmat9.pl, see its help.
here, even if all your data is above this (ie, you've applied
+
 
the threshold in your identification phase). This is because
+
This version has the following changes compared with mask_gedmat_images3.pl:
we need to know it when we shift amplitudes of the second
 
distribution to see if it could match the first distribution.
 
    -b: subtract average baseline from amplitude prior to use (ie, prior
 
to any thresholding or intensity shifting of data).
 
    -s delta max: shift datafile2 amplitudes down by a maximum of max, in
 
increments of delta, to see if it will then match datafile1.
 
  -p #: our guess of the percentage of data missing from datafile2 because it was
 
below our threshold/detection criteria (a # from 0 to 1).
 
This plus the amount of datafile2 shifted below threshold determines
 
our estimate of the amount of data missing from the shifted datafile2 and
 
the unshifted datafile1. The larger this number is, the more likely
 
the two curves will appear similar (since differences in actual data
 
examined will be proportionally smaller differences, and we are assuming
 
all missing data matches exactly, but see -m below). Default = 0.000000
 
    -m: assume all missing data maximally MISmatches, this would probably be
 
a worst case scenario, so that if the KS statistic says the distributions
 
could be the same even with the -m option, its probably true.  But I'm
 
not certain of this, since it really depends how this affects the
 
relative spacing between the cumulative distributions. I'd have to
 
think about it some more.
 
  
see also:test_distr, poisson
+
1. @stats = &outline_stats(@outline) was used to calculate explant center (for masking) but
This code is in ~lml/vision/Rhonghua/STOCS
+
        the meanx and meany are just the mean of the outline, it is NOT a center of mass. usually ok for a compact explant.
#/home/lml/krypton/bin/compare2dist
+
  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.
  
===  compare2gaussian  ===
+
2.  bounding box was used to calculate area for sorting the outlines temporally (from smaller to larger area).  
incorrect command line, need 1 data files.
+
      but when outlines intersect bounding box can at times NOT be a good surrogate for area.
This program calculates whether a given set of data could be samples from a known mixture of Gaussians.
+
  $roi_area[$r] = ($maxx-$minx)*($maxy-$miny); 
datafile should have one data point per line. comment lines begin with #.
+
  handled these two issues by writing sub calc_com().
Output statistics to stdout.
+
-use_bbox_area will cause the OLD method to be used instead.
  
Usage: compare2gaussian [options] datafile
 
options:
 
      -t #: only include data with an amplitude > #. The default is to include all data.
 
  -g # amp1 mean1 sd1 ... :
 
The Gaussian mixture model the data should be compared against (using a KS statistic).
 
# is the number of Gaussians, this is followed by the amplitude, mean, and sd of
 
each Gaussian. The default is one Gaussian with mean = 0 and sd = 1.
 
You can get these values using the fitgaussians2 program.
 
  -v: verbose. Also prints the observed (first) and theoretical (second) curves to stdout.
 
  -T: test. runs through x = 0 to 10 and prints out cumulative prob. exits.
 
  
See Also: fitgaussians2, fit2gaussians, fit3gaussians
+
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.
  
Source code is in ~lml/krypton/Lefkowitz
+
  mask_gedmat_images4.pl  -check_intersect  added.
#/home/lml/krypton/bin/compare2gaussian
+
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.
  
=== compare_dist2  ===
+
  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 program calculates whether two distributions are the same using chi-square test (unless -k).
+
  This is done by finding all the *_Area.zip files in the current directory, pulling out the outlines in those files
It was written to examine the distribution of sizes of Ryanodine Receptor objects
+
  and using that information to recalculate areas.  It also needs to find the associated "combined" image file
to determine if they are randomly distributed. datafile1 should be the reference
+
  (*_combined.i2i) to get image size and hence the position of the center of the well) and the fiji results file
data (gotten from many simulations or from a theoretical formula), datafile2
+
  (*_results.txt, so the numbers produced here can be easily compared with them).  
should be the real data (max number of data values = 100000).
 
  
This program reads data which is just a list of sizes of objects seen (one per line).
+
  note: The algorithm assumes that the area NEVER DECREASES with time, and that the explant region is always surrounded
Comment lines must begin with a #
+
by the day7 region which is surrounded by the day11 region. The latter assumption is sometimes invalid if
Floating pt numbers are truncated to integers for bin number (max bin number = 50000).
+
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].
  
Usage: compare_dist2 [options] datafile1 datafile2
+
  note: If only 2 areas (ie, two .roi files) are present in the zip file, they are assumed to be for
options:
+
the explant and day7 (not day11).
  -k perform K-S test instead (I'm not certain the numbins I use to calculate this is correct).
+
 
  -a also print the histograms produced
+
  note: This program assumes the center of the combined image (usually 4 well images are combined into one) is the
  -b also print the normalized histograms (total count datafile2 scaled to the same count as in datafile1,
+
center of the well. see combine_images.pl. It also assumes the combined image name ends in combined.i2i
  bins with 0 removed), this is only done if -k not specified (ie, only if performing chi-square test).
+
(see -combined).
  -c also print the cumulative prob distributions (only done if -k also specified)
+
 
  -r # #: only analyze sizes within the specified range (inclusive)
+
  note: some of the scripts I use to then analyze these results will multiply the area by 2, to get a "true" estimate
  -m #: cap the maximum number of counts for any size in datafile1 to #
+
  of growth; since the value produced by mask_gedmat_images3.pl will be (roughly) half of the real growth rates.
  -M #: cap the maximum number of counts for any size in datafile2 to #
+
 
  -z: for chi-square keep zero entry bins (chi square only correct if this option is NOT used)
+
  usage:
so why is this option here?  if you just really want to use this program to do
+
mask_gedmat_images3.pl [options]
histogram normalization (-b), and don't care about the stat.  xmgrace running avg
 
will produce strange results if you don't use -z, ie, if data not equally spaced.
 
  -v verbose
 
  -V very verbose
 
example:
 
      create a simulated distribution and compare it with real restored data (real_ryrr.i2i, run5 does this 100 times):
 
  cluster -wsize 10 43 25 -cylinder 0.001 3 -psize 0.08 0.08 0.25 -mindist 0.030 -numryr 500 -image ryr.i2i
 
  blur3d -S 40000 -P ryr.i2i psf.i2i ryr_b.i2i
 
  noise -c RCA ryr_b.i2i ryr_bn.i2i
 
  setenv myloc /home/lml/krypton/Zhuge/Ryr_clusters
 
  setenv eprloc /storage/big1/epr/queues
 
  echo " /storage/big1/epr/run_epr -V -log -NSC 4 -sm 1e-05 -it 5000 -sc 0.025 -co 0.001
 
-psf ${myloc}/psf.i2i ${myloc}/ryr_bn.i2i ${myloc}/ryr_bnr.i2i " > /storage/big1/epr/queues/standard/lml.0
 
  while (1==1)  if ( ( ! -e ${eprloc}/standard/lml.0 ) && ( ! -e ${eprloc}/running/lml.0 ) ) then break endif sleep 60s end
 
  countobjs -k -s 5 300 -t 4500 4500 sim_ryr.objs ryr_bnr.i2i
 
  cull -s -c -2 < sim_ryr.objs > sim_ryr.stats
 
  countobjs -k -s 5 300 -t 4500 4500 real_ryr.objs real_ryrr.i2i
 
  cull -s -c -2 < real_ryr.objs > real_ryr.stats
 
  compare_dist2 -b sim_ryr.stats real_ryr.stats >& chi_ryr
 
  compare_dist2 -k -b sim_ryr.stats real_ryr.stats  >& ks_ryr
 
  tail chi_ryr ks_ryr
 
  xmgrace chi_ryr; xmgrace ks_ryr
 
  
see also: cluster, run5
+
  options:
This code is in /home/lml/krypton/Zhuge/Ryr_clusters/
+
-tmpdir=fullpathname directory to use for temporary files which are created, eg: -tmpdir=/home/lml/krypton
#/home/lml/krypton/bin/compare_dist2
 
  
===  correlationL ===
+
-zip_file=file.zip
/home/lml/krypton/bin/correlationL
+
-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.
  
This program plots intensities from image1 vs intensities from
+
-results_ending=stuff e.g., -results_ending=_results.txt  This is what the -zip_ending should be replaced by
image2. image1 on the x axis, image 2 on the y axis. Intensities
+
to get the name of the associated fiji results filenote the _ should be included here
in both images are rescaled 0 to the size of the output image
+
if it was included in -zip_ending.
(default = 512)The intensity at each pixel in the output
 
image is the number of (image1,image2) voxels with that particular
 
intensity combination.
 
The intent is to be able to look at the output image and get a sense
 
for whether there is a correlation between intensities
 
in the two imagesIf so, perhaps a least squares line
 
fit should be done to see how well one images correlates with the
 
other, or -s option can be specified.
 
The minimum, maximum, and scale factors are printed to stdout.
 
Version 1.1
 
  
Usage: correlation [options] im1.i2i im2.i2i out.i2i
+
-combined_ending=stuff  e.g., -combined_ending=_combined_reduced_.i2i . default = combined.i2i.
options:
+
This is any string which helps identify the last part of the combined image filename.
  -d xdim ydim: output dimensions of new image
+
-combined_scaling=#:# e.g., -combined_scaling=2:2 if reduceima -bin 2 2 was applied to get _combined_reduced_.i2i.
(default = 512,512).
 
  -S im1scale im2scale: scale intensities with these scale factors. newval = (intens-min_intens)*scale
 
  -B b1 b2:    force min_intens (black level) to specified value. newval1 = (intens-b1)*scale1
 
  -i val1 val2: Ignore any voxels in image1 <= val1 and
 
any voxels in image2 <= val2.
 
  
  -h val1 val2: Ignore any voxels in image1 >= val1 and
+
-scale=#:# distance and area (eg, -scale=2:4 if reduceima -bin 2 2 was used) scaling. This will multiply
any voxels in image2 >= val2.
+
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.  
  
  -r: instead of intensities, use the rank
+
-check_intersect check if outlines intersect with the explant's outline. If so, set an error flag on stdout printout
order of the intensities.
+
and print info to stderr.  eventually will just use area numbers rather than masking area in this situation.  
  -a: automatically calculate the size of the
+
that is not done yet ...  
output image. attempts to make the scale
 
factor = 1.
 
  -b: keep the xdim and ydim scale factors the same.
 
  -s: calculate Spearman rank-order correlation
 
coefficients. print results to stdout.
 
  -z zslice:    only examine the specified z slice (the first
 
slice is considered slice 0).
 
note: entire image name is NOT required.
 
note: a - in place of an image name means stdin or stdout.
 
  
examples:
 
    # to apply this to a set of 3D images, using the same scales and size images for easy comparison
 
correlationL -S s1 s2 -d 512 512 -B 0 0 image1.i2i corr1.i2i    (and same for other images)
 
 
===  create_imagesL  ===
 
  
This program takes output from many runs of "overlap" and  
+
-save_day[=directory]
produces two images. One image is a percent colocalization image
+
saves the final binary mask for each days growth (eg, day7 growth minus the explant and minus the part growing towards the wall)
and the other is a probability image. The overlap program MUST be
+
into a 3d mask image (patientid_tissue_day#_mask.i2i). This image will be reduced down in xdim and ydim from the
run via the "many_overlaps" commandThe probability calculations
+
original.  patientid_tissue_day#_.play_labels will also be created (labels which well each z slice comes from).
are the same as those performed by "probcolocal", but only -n
+
This is mostly for quality control purposes.
needs to be specified since the other values are automatically
+
In addition, patientid_tissue_day#.rpts will be created (similarly reduced down in size) (coords may be off by 1?).
extracted from the file produced by "many_overlaps".
+
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
  
The percent image is the percent of voxels above threshold in image1
+
-patient5 patient5 files have some odd naming. use this option if analyzing them.
(as originally specified to "many_overlaps") which overlap with
 
voxels above threshold in image2. A 100 in the output image = 100 percent.
 
The probability of observing as much (or more) overlap as we did due to
 
random chance is the prob.i2i image.  Probabilities are mulitplied by 100.
 
  
Position along the y-axis (vertical axis) of the image, corresponds to
+
-use_explant_outline legacy. specify this if you want the center of the explant to be based on the average of the pixel positions
thresholds for image2. The x-axis represents image1 thresholds. The
+
of just the pixels along the boundary (rather than the center of mass).
lowest threshold is the bottom left cornerSee the first line in
+
-use_bbox_area legacy. specify this if you want to order the outlines based on their bounding box area rather than their true area.
your datafile for the range of thresholds this represents.
+
You should probably specify both options (if you want either one), I'm not sure about consistency if only one is specified.
Overlap produces statistics for a range of allowed overlaps.
+
 
Create_images, by default, chooses an overlap within 1 voxel.
+
-just_check just check whether each zip roi outline has the correct number of associated image files.
If you want to use a different overlap distance use the -o option.
+
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
  
See also: overlap, probcolocal, many_overlaps
+
# 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
  
Usage:
+
# look at the masks produced:
create_images [options] datafile percent.i2i prob.i2i
+
cd /home/lml/krypton/Corvera/Raz/output
options:
+
      play_results3.pl 006_JTH_OM_day7
  -o distance:    voxels within this distance count as overlapped.
+
or:
  -n number:    number of voxels (1000000 default), see probcolocal.
+
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
  
Examples:
+
# compare the full areas produced which what fiji did (as a check). only pull out the good data. they should be very similar:
  many_overlaps -t 100 1000 100 -T 100 1000 100 alpha_T.i2i beta_T.i2i tmp_output
+
cd /home/lml/krypton/Corvera/Raz
  create_images -n 363264 tmp_output percent.i2i prob.i2i
+
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
=== makeGmixtures  ===
 
This program creates a set of data which is sampled from a known mixture of Gaussians.
 
Output statistics to stdout. This can be used to test the compare2gaussian program.
 
  
Usage: makeGmixtures [options]
+
# 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:
options:
+
gedmat_to_xy.pl -cond='if (($date eq "date_sure")&&($perr==0)&&($aerr==0)) {1;} else {0;}' 
  -n #: number of data points to calculate, default = 100
+
-xcoord='$area_mex' -ycoord='$area_mex_border' 006_JTH_OM.areas | xmgrace -free -pipe
  -g # amp1 mean1 sd1 ... :
 
The Gaussian mixture model the data drawn from.
 
# is the number of Gaussians, this is followed by the amplitude, mean, and sd of
 
each Gaussian. The default is one Gaussian with mean = 0 and sd = 1.
 
Really only the relative amplitudes matter, not their absolute value since they
 
determine the relative probability of drawing from each distribution.
 
  -v: verbose. prints extra info to stdout, each point is labeled with which Gaussian
 
it is from. Use,e.g.,: fgrep G1 output|cull -2 > tmp.dat    to then graph it.
 
  
See Also: compare2gaussian, fitgaussians2, fit2gaussians, fit3gaussians
+
# 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 -
  
Source code is in ~lml/krypton/Lefkowitz
 
#/home/lml/krypton/bin/makeGmixtures -h
 
  
=== mpoisson  ===
+
# run with some diagnostics:
Generate the inter-arrival distribution seen from 10 independent poisson processes
+
cd /storage/big1/raz/GEDMAT/006_JTH/OM
(eg, spark sites), to check that it is equivalent to 1 process whose lambda is the
+
/home/lml/krypton/bin/mask_gedmat_images.pl -tmpdir=/home/lml/krypton/Corvera/Raz -zip_ending=_Area.zip
sum of the independent processes
+
        -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 -
  
Usage: mpoisson
 
options:
 
  -t #:  total time (in seconds) to count number of arrivals, default = 1000.000000
 
  -l #:  lambda of each poisson process (mean number of events per second), default = 10.000000
 
  -p #:  number of processed, default = 10
 
  -d dur sep:  drop intervals of specified duration, sep seconds between the start of one dropped
 
                  interval and the next. This is to test if the resulting process is still Poisson.
 
                  It mimics how Rhongua acquired the data (a series of disconnected 2 second intervals).
 
  -i dt:  print histogram of inter-arrival times instead.  bin width is dt (in seconds)
 
 
===  probcolocalL  ===
 
  
This program calculates the probability of an event occurring
+
# do a bunch of stuff
k or more times in n trials if the probability of an event is
+
analyze_gedmat3.pl # apply this perl script to lots of data
p and events are independent (see p.182 of Numerical Recipies)
+
cd output
 +
      play_results3.pl 006_JTH_OM_day7  # look at some of it
 +
raz_rates.pl # generate stats
 +
 +
 
  
It is intended as one way to determine if an observed level of
+
  source code: in /home/lml/krypton/bin/mask_gedmat_images.pl
volume colocalization is due to random chance or not. To use it
 
in this manner, first find the fraction of voxels in each image
 
which are used to calculate colocalization (e.g., those above
 
threshold). Call these fractions f1 and f2.  Then, if these
 
voxels were randomly placed, the probability that identical voxels
 
are turned on in both images is f1*f2. An "event" is just such
 
a coincidence, so p = f1*f2. n = number of voxels in one image.
 
k= number of voxels which are observed to colocalize.
 
This program then returns the probability that this amount of
 
colocalization or more would have occurred merely due to chance.
 
Note: if only an annulus (i.e., a subset of the total image volume)
 
    is really being analyzed, then f1 and f2 and n should probably be
 
    derived based on the volume subset, not the entire image.
 
  
Usage: probcolocal [options]
 
Output (to standard out): the probability of this or greater occuring randomly.
 
options:
 
  -n number:    number of trials (100 default)
 
  -k occurrences: number of occurrences (50 default).
 
  -p probability: prob of an event (0.500000 default).
 
  -h:   print this help message.
 
 
   
 
   
===  roc ===
+
</nowiki>
/home/lml/krypton/bin/roc
+
===  membrane3D.pl ===
This program reads two images. It attempts to use voxel values in
+
<nowiki>
image1 as a predictor of voxel values in image2; ie, as a type of
+
 
measure of colocalization. Both images are first rescaled to be
+
A script to run the routines necessary to perform 3D membrane segmentation.
between 0 and max (100).Then image2 is thresholded. Image1
+
note: it needs write permission in the directory where inputimage.i2i resides since all output images go there too.
is then set,sequentially, to all integer thresholds between 0 and
+
It will run the following programs, in order:
and max (unless -r is used to restrict the range).  If a voxel
+
  1. /home/lml/krypton/facil/i2i2mhd (convert to mhd format)
in image1 is above threshold then we guess
+
  2. /home/lml/krypton/segmentation/MR-Source/ACME/ACME-Binary/bin/cellPreprocess (median filter, fill holes)
that the same voxel is above threshold in image2.
+
  3. /home/lml/krypton/segmentation/MR-Source/ACME/ACME-Binary/bin/resample (resample pixel sizes)
It also does the reverse, ie, use image2 to predict image1.
+
  4. /home/lml/krypton/segmentation/MR-Source/ACME/ACME-Binary/bin/multiscalePlateMeasureImageFilter  (determine the planarity of each region)
The default cost function is:  1- 255*prob(detection)*(1-prob(false alarm)).
+
  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).
  
OUTPUT: 
 
TO STDOUT:
 
  The best thresholds, lowest cost and probability of detection,
 
  prob of failure, prob of miss and prob of saying nothing when
 
  there is nothing.
 
TO A FILE:
 
  6 images get created, they are the costs and probability of
 
  detection and false alarm (3 separate images) when im1 is ussed
 
  to predict im2, and another 3 for when im2 is used to predict im1.
 
  By default these will be named:
 
    im1predictingim2_c.i2i, im1predictingim2_pd.i2i, im1predictingim2_pf.i2i
 
    im2predictingim1_c.i2i, im2predictingim1_pd.i2i, im2predictingim1_pf.i2i
 
  The -p option changes the prefix (eg,the "im1predictingim2").
 
  The images all have thresh1 on x axis, thresh2 on y axis.
 
  The cost images are always scaled 0-255.
 
  The pd and pf images are scaled 0-100.
 
  Additional output files can be created with the -c option.
 
SEE ALSO: playims . This program quickly puts up all 6 images
 
  created by roc.  It can take arguments.
 
  
Usage: roc [options] image1 image2
+
usage:
      options:
+
  membrane3D.pl [options] inputimage.[i2i|mhd|mha] outimage.mhd
-m max:   max of intensity range to rescale data to
+
 
    the default is 0 to 100.
+
output files:
-b val1 val2: ignore all background voxels. A voxel will be
+
  inputimage.mhd produced by i2i2mhd  - short ints
  ignored in both images if the voxel in image1
+
  inputimage_med.mhd produced by cellPreprocess
  is <= val1 and the voxel in image2<= val2.
+
  inputimage_med_resamp.mhd produced by resample, unsigned char
-r low hi: range of intensity threshold values to check
+
  inputimage_med_resamp_planar.mhd produced by multiscalePlateMeasureImageFilter, floating pt (doubles) between 0 and 1, how "planar" a pt is.
          in image1 (in original image intensity units),
+
  inputimage_med_resamp_eigen.mhd produced by multiscalePlateMeasureImageFilter, an eigenmatrix at each pt
  default is entire intensity range.
+
  inputimage_med_resamp_eigen_voting.mhd produced by membraneVotingField3D, result of voting, unsigned char
-R low hi: range of intensity threshold values to check
+
  outimage.mhd produced by membraneSegmentation,  result of watershed, each region labeled with an id (short integer).
          in image2 (in original image intensity units),
+
 
  default is entire intensity range.
+
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
-t thresh: only examine this threshold value for image1.
+
      of 2 is specified, that is a one pixel radius.  
-T thresh: only examine this threshold value for image2.
 
  I am not sure -t and -T work completely correctly.
 
-c file1 file2:
 
  Creates 2 roc curve data files for graph and plot.
 
    The probability of false alarm (x coord) and
 
  detection (y coord) and cost (intensity) for all
 
  thresholds in image1 for a threshold in image2
 
  is written file1. A text string
 
    indicating the image2 threshold level is written out.
 
  This is then repeated for other image2 threshold levels.
 
  
  file2 is the same, but for image2 predicting im1.
+
step 1. options for converting i2i to mhd:
  Use: graph -f 1 -b <file1 |plot  to display these roc curves.
+
  -convert=dx:dy:dz  The first step is converting our i2i format to mhd format.  This specifies the pixel spacing
-C d f m n: d is the "cost" of a correct detection, ie
+
in x y and z directions for that. default assumes 1:1:1. The "conversion" really just creates inputimage.mhd which
  a voxel in image1 is above threshold the same time
+
is a text header which points to the original i2i image and gives some info about it.  
  that the equivalent voxel is above thresh2 in
+
If the input image has a .mhd or .mha extension already (instead of .i2i) then no conversion is done.
  image2.
+
Olga's images acquired with a 10x objective have a pixel size of .645 um/pixel (and z spacing of 10 um).
  f is the cost of a false alarm (voxel in
+
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.
  image1 > thresh1 but voxel in image2 is < thresh2).
+
 
  m is cost of a miss (im 1 <t1, im 2 > t2) and
+
step 2. options for cellPreproces:
  n is cost of nothing present ( both im 1 and im 2
+
this may produce an unsigned char image (?)
  less than threshold, ie correctly predicting that
+
  -median=# radius of median filtering preprocessing (and hole filling). If this is not specified it isn't done.
  nothing is there).
 
  Given these costs the program will print to stderr
 
  the thresh1 and thresh2 values which minimize the
 
  total cost. It will also print the total cost.
 
  Total cost = d*pd + m*pm + f*pf + n*pn 
 
  where pd = probability of detection, etc.
 
  Typically, d = n = 0 and f = m = 1.
 
-p pre1 pre2: prefixes for the names of the saved images
 
  which show the sensitivity analysis. 6 images
 
  get created (regardless of whether the p option
 
  is specified), they are the costs and prob. of
 
  detection and false alarm (3 separate images)
 
  when im1 is used to predict im2, and another 3
 
  for when im2 is used to predict im1.
 
  By default these will be named:
 
  im1predictingim2c.i2i, im1predictingim2pd.i2i,
 
  im1predictingim2pf.i2i, im2predictingim1c.i2i, etc.
 
  This option changes the prefix (ie, what comes
 
  before the "c","pd",and "pf") for the
 
  images saved. pre1 will be for im1 predicting im2,
 
  and pre2 will be vis versa.
 
-s file:   save roc data as an array of floats to "file".
 
  Once this file is saved, any particular values
 
  of costs can be examined very
 
  quickly. In other words, this is the data that
 
  the roc program is really taking a long time to
 
  calculate. So if you want to examine the same
 
  pair of images under different cost
 
  scenarios, save the data file during the 1st
 
  scenario, and run the others using the saved data.
 
  NOT IMPLEMENTED YET.
 
-f file:  read in a saved array (see -s above). When this
 
  option is specified the args image1 and image2 are
 
  not specified on the command line.
 
  NOT IMPLEMENTED YET.
 
note: entire image name is NOT required.
 
note: a - in place of an image name means stdin.
 
  
 +
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.
  
Typical examples:
+
  note: it may be necessary to do the above operations, which also convert the image into unsigned char, which is required for
1). roc  im1.i2i im2.i2i > roc.info
+
step 4, multiscalePlateMeasureImageFilter?
    playims dummy
+
  note: step 6 (watershed) may also work best if the pixel sizes are the same in all directions.
2). roc -p 1to2 2to1 -b 0 0 im1.i2i im2.i2i > roc.info
+
 
3). roc -C 0 1 1 0 -b 0 0 im1.i2i im2.i2i > roc.info
+
step 4. options relating to planarity:
4). roc -r 20 80 -R 50 200 im1.i2i im2.i2i > roc.info
+
the planarity image produced will be doubles from 0-1.
5). roc -b 5 5 -c roc1to2.dat roc2to1.dat im1.i2i im2.i2i > roc.info
+
  -planar=# the sigma of the Gaussian used when classifying pixels as planar or not. default = 1
    graph -f 1 -b <roc1to2.dat |plot
+
  -alpha=# see the help for /home/lml/krypton/segmentation/MR-Source/ACME/ACME-Binary/bin/multiscalePlateMeasureImageFilter
    graph -f 1 -b <roc2to1.dat |plot
+
  -beta=# ditto
    playims dummy
+
  -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
  
===  sparkstats5  ===
+
see also: /home/lml/krypton/segmentation/MR-Source/ACME/lmltest/README
#/home/lml/krypton/bin/sparkstats5
+
  /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
  
sparkstats5 is similar to sparkstats3 (only examines the first 10 seconds of data from any cell
+
and ignores cells which don't have 10 seconds of data).
+
</nowiki>
 +
===  Norio_stats.pl  ===
 +
<nowiki>
  
It eliminates from any 2 second interval multiple events at the same site, since we guess that is
+
This programs takes each pts file in the current directory, thresholds the associated vinculin image,
due to a second "bursting" process which we want to ignore.
+
applies that mask to the trip6 image, and produces a .coloc file from the masked trip6 image (using mask_and_coloc.pl);
All events in the same cell, at the same x,y are considered events from the same spark
+
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).
  
Usage: sparkstats5 [options] datafile
+
stats.pl [options] > stats.out
options:
+
  -nothing : do nothing, just echo what would be done
  -N #: spark events considered the same site if <= # pixels in x and y from first event and
+
  -h : print this help
also in the same cell and 2 second interval (note: histogram produced does not compensate for  
+
  -thresh=#     : threshold for the vinculin image. default = 20
the longer time some cells were under observation).
+
  -regions=#:# : only allow mask regions within the specified min:max size (in pixels, inclusive).
  -O #: like -N. in addition, sparks with 0 events in a 2 second interval are added for
+
: Also creates *_count.i2i  and *.countobjs (* = root of vinculin image name) intermediate files.
each spark that exists in an interval but does not exhibit spark events
+
: note: these counts are for the vinculin image after the mask (pts file) is applied.
in some other interval in the same cell.
+
  -clean:       : clean up (ie, remove) *_count.i2i and *.countobjs images (if -regions specified)
  -i: spark events condidered the same "site" if in same cell and same 2 second interval
 
this is the default.
 
  -I: an extra spark id field does NOT precede the spark data (ie, test.data, not bestdata.data).
 
  -J: datafile is just one cell; data format: x y amp; just calculate spark sites (use specify -N)
 
  
[source code in /usr/people/lml/vision/Rhonghua/Sparks/sparkstats5.c]
 
 
   
 
   
== Analysis of Points ==
+
</nowiki>
===  components.pl  ===
+
===  run2_Ronghua.pl  ===
 +
<nowiki>
  
Calculates the number of connected components resolved over a range of point densities.
+
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).
  
components.pl [options]
+
usage:
 +
  run.pl [options]  
  
 
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
  
-numpts=low:hi:delta
+
  -bkthresh=# : threshold for bk (594) images, default =
-repeat=# number of times to repeat at each point density
+
  -min_bksize=# : minimum allowed object size in pixels, default = 5
-res=# in microns
+
  -max_bksize=# : max allowed object size in pixels, default = 50
-outfile=name name of output file. otherwise to _tmp. always need write permission in current directory.
+
  -min_bkiod=# : minimum allowed object iod, default = 4686
 +
  -max_bkiod=# : maximum allowed object iod, default = 10000000
  
+
  -dx=# : relative distance in x, default = 1
=== convex_hull.pl  ===
+
  -dy=# : relative distance in y, default = 3
 +
  -dz=# : relative distance in z, default = 1
  
This program takes an object outputfile (unless -rptsin or -tripletsin) produced by countobjs (or maskobjs) and finds the minimal
+
  -noclean
spanning tree connecting the center of mass of the objects, and the convex hull. Writes out connections as an rpts file to stdout.
+
  -debug
It also loops through 20 thresholds  for the pts, and prints to stderr some stats about the minimal spanning tree and
+
  -verbose
convex hull of the points above each of these thresholds.
+
 
 +
 +
</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
  
Options can be used to only selected a subset of the objects and to constrain the maximum distance (-maxdist).
 
  
It was written with the hope that triplets (maxima in an image which has a cell in the center) will show a pattern in their
+
</nowiki>
convex hull area, so that when the threshold rises high enough, only maxima inside the cell will still be present and hence
+
===  countobjsmax3d  ===
the convex hull will be stable and of much smaller area.
+
<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.
  
This program requires perl modules Graph::Kruskal and Math::Geometry::Planar, use cpanp to install these:
+
  Count objects in co-localized images. If only one image given
    yum install perl-CPANPLUS-0.91.3-202.fc16.noarch   - for cpanp
+
  the objects will be counted in that one image. Copious amounts
    cpanp -i Graph::Kruskal
+
  of information will be written to the output file.
    cpanp i Math::Geometry::Planar
+
   A - for outputfile will write to stdout.
 +
  outpufile can be analyzed with objs2bb.pl and objs2dist.pl
  
usage:
+
Options:
   convex_hull.pl -tripletsin file1.triplets  > file1_mst.rpts
+
   -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.
  
  input options:
+
Notes:
    -dx=#   spacing in the x direction, default = 1
+
  A - in place of an image name means stdin or stdout.
    -dy=#   spacing in the y direction, default = 1
+
  Source code in /storage/big1/lml/jac/was_invitro/Projects/countobjs
    -dz=#   spacing in the z direction, default = 1
 
    -rptsin     instead of file1.objs, read file1.rpts where file1.rpts was produced by max2d.
 
      -size1 and -iod1 are ignored when this option is specified.
 
    -tripletsin   instead of file1.objs read in file1.xyi,  triplets of x y and intensity.
 
  
  analysis options:
 
    -size1=min:max     min and max object size allowed for file1.objs in pixels (inclusive)
 
    -iod1=min:max   min and max object iod allowed for file1.objs (inclusive), or intensity if -tripletsin was specified.
 
    -maxdist=#: :  don't allow connections between pts further apart than this distance (after applying dx, dy, dz spacing factors).
 
  warning: if the distance is too small, then all the pts will not be connected to begin with;
 
    this may cause the minimal spanning tree algorithm to fail.
 
    default maxdist is  3000
 
  
  output options:
+
</nowiki>
    -addlines : output rpts format which addlines is more likely to be happy with (may not work in dave?)
+
=== threshold.pl ===
    -hist : calculate histogram of distances (hist[int(dist)]++, where int just truncates to integer). obsolete.
+
  <nowiki>
    -sizehist : calculate histogram of object sizes (in voxels) in file1.out. (hist[int(size)]++, where int just
+
threshold.pl -numvox=# [-produce=newimage.i2i] image.i2i
        truncates to integer). If you don't care about distances between two files (ie, only want -sizehist)
+
 
        put the same file name for both files on the command line. obsolete.
+
calculate the largest threshold for image.i2i which has at least # voxels
    -rpts=file.rpts :  put bounding boxes around objects found and lines between closest objects (similar to objs2bb.pl)
+
equal or above itPrints the threshold and the number above threshold to stdout.
  display this in dave eg:  dave -n 0 -u -I file.i2i file.rpts (use the -n 0 and -u options)
+
 
  note: may not show up in dave until you click on "scale" to force a rescale (or draw?).
+
options:
    -jack=max.rpts:# : create an rpts file with the maxima in each object displayed as a small jack.
+
 
    # controls the size of the jack. 1=1 pixel in size, 2 = 2 pixels, etc.
+
  -produce=newimage.i2i    : take the calculated threshold, apply it to image.i2i to produce newimage.i2i
-twod   add this (in addition to -jack) if you want 2D jacks rather than 3D jacks.
 
    -strlim=# : limit length of names of objects in rpts files to # characters.  dave sometimes crashes if the
 
        names are too long.
 
    -tyz :  transpose coords in yz before writing them to the rpts (must specify -rpts option)
 
    -color=# : for the w value (color) use the specified value (use -P in play to see this as a color). default = none.
 
        if you have no color (no w value), addlines can put one in (-P option in addlines).
 
  
  diagnostics:
+
    -silent :  suppress warning messages.
+
</nowiki>
    -verbose
+
===  thresholdz.pl  ===
-debug
+
<nowiki>
 +
thresholdz.pl -numvox=#  [-produce=newimage.i2i] image.i2i
  
example:
+
calculate the largest threshold for image.i2i which has at least # voxels
  convex_hull2.pl -tripletsin -jack=jack.rpts:5 -addlines -twod -maxdist=100 file1.triplets  > file1_mst.rpts
+
equal or above it. Prints the threshold and the number above threshold to stdout.
  addlines2 -P -1 image.i2i file1_mst.rpts - | addlines2 -P -2 - jack.rpts - | reduceima -bin 3 3 -L - -| play -P -1 R  -P -1 G -
 
  
 +
options:
  
see also:
+
   -produce=newimage.i2i    : take the calculated threshold, apply it to image.i2i to produce newimage.i2i
   convex_hull, objs2mst.pl
 
  objs2bb.pl, objs2dist.pl, objs2dist121.pl, closest_object, closest_voxel, countobjs, maskobjs, objs_via_ascent
 
  resolve_pts
 
  
 
   
 
   
===  objs2alldists.pl ===
+
</nowiki>
Like obs2disp.pl but calculates the distance to ALL the objects (within -maxdist), not just the closest.
+
===  2Ddistances ===
See ~/krypton/Zhuge/grants/AsthmaRO1/README for 5/27/11 and /home/lml/krypton/Zhuge/BKandRyr/analysis6/run18
+
<nowiki>
  (which did NOT use this).
+
 
 +
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.
  
This program takes 2 object outputfiles produced by countobjs (or maskobjs) and finds the shortest distance
+
Usage:
from the center of mass of objects in file1.out to the center of mass of objects in file2.out.
+
2Dhistogram [options] inimage.i2i inmask.i2i
 +
Options:
 +
  -v: verbose
  
If both file arguments are the same (e.g., objs2dist.pl file1.out file1.out >file.dist), you can use this
+
Source code in ~krypton/lml/facil 
routine to find the distances between objects within an image (an object match with the same id is automatically
+
  -d dimage.i2i : save the distance image as dimage.i2i (converted to ints by casting)
ignored in this case so objects don't match to themselves). See also the option -skipsame.
+
  -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
  
(modified from /storage/big1/lml/was_voxel/Corvera/track/objs2bb.pl)
+
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
  
usage:
+
Analyzes the output histogram image produced by histogram2 via the -f option.
  objs2alldists.pl file1.out file2.out >file.dist 
+
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).
  
options:
+
Usage: analyze_histo [options] aimage_H.i2i
  -dx=# :  spacing in the x direction ,default = 1
+
options:
  -dy=# :  spacing in the y direction ,default = 1
+
-v: calculate cutoff based on percentage of voxels instead of percentage of light
  -dz=# :  spacing in the z direction ,default = 1
+
-f #: fractional cutoff (e.g., .80 = 80%), default = 0.950000
  -size1=min:max :  min and max object size allowed for file 1 in pixels (inclusive)
+
-w #: number of bins for running average (default = 5), should be odd.
  -size2=min:max :  min and max object size allowed for file 2 in pixels (inclusive)
+
-t #: only look at voxels >= intensity (must be >= 0), default = 1
  -iod1=min:max :  min and max object iod allowed for file 1 (inclusive)
 
  -iod2=min:max : min and max object iod allowed for file 2 (inclusive)
 
  -maxdist=#: :  don't allow matches further away than this distance (after applying dx, dy, dz spacing factors).
 
  default maxdist is ~  3000.
 
  -hist : calculate histogram of distances (hist[int(dist)]++, where int just truncates to integer).
 
  -sizehist : calculate histogram of object sizes (in voxels) in file1.out. (hist[int(size)]++, where int just
 
  truncates to integer). If you don't care about distances between two files (ie, only want -sizehist)
 
  put the same file name for both files on the command line.
 
  -rpts=file.rpts :  put bounding boxes around objects found and lines between closest objects (similar to objs2bb.pl)
 
  display this in dave eg:  dave -n 0 -u -I file.i2i file.rpts (use the -n 0 and -u options)
 
  note: may not show up in dave until you click on "scale" to force a rescale (or draw?).
 
  -jack=max.rpts:# :  create an rpts file with the maxima in each object displayed as a small jack.
 
  # controls the size of the jack. 1=1 pixel in size, 2 = 2 pixels, etc.
 
  -strlim=# : limit length of names of objects in rpts files to # characters.  dave sometimes crashes if the
 
  names are too long.
 
  -tyz :  transpose coords in yz before writing them to the rpts (must specify -rpts option)
 
  -skipsame :  don't match an object in file1.out to an object with the same id in file2.out
 
  This is set automatically if file1.out = file2.out.
 
  -silent :  don't print the distances (sets -hist)
 
  -simpleprint :  when printing distances, just print distance, one per line, nothing else. to be read in
 
  by ~/Zhuge/grants/AsthmaRO1/distance_distribution.m. note: that program assumes distances
 
  are in pixels and pixels are 80 nm, unless you specify pixelsize=somethingelse.
 
  -simpleprint2 :  like simpleprint, but the first column is id of the Ryr to which this BK is closest.
 
  -onelineprint : like objs2alldists.pl  but prints the distance to ALL the objects (within -maxdist),  
 
  not just the closest on one line, so we can keep track of which BK are near which Ryr.
 
  see comdists3.pl (which uses this option).
 
  -verbose
 
  
example:
+
Examples:
  countobjs -k -t 2000 2000 wave1.objs wave1.i2i
+
histogram2 -f a_H.i2i -O a_H.histo -o -p 0 0 0 -d 40 -z 3 mask.i2i a.i2i b.i2i
  countobjs -k -t 2000 2000 wave2.objs wave2.i2i
+
analyze_histo -f .95 a_H.i2i > a_H.cutoffs
  objs2dist.pl wave1.objs wave2.objs > wave1and2.dist
 
  
see also:
+
See also: histogram, histogram2, threshold
  objs2dist121.pl, closest_object, closest_voxel, countobjs, maskobjs, objs_via_ascent, pt_distances
 
  
 +
source code in /storage/big1/lml/jac/was_invitro/Projects/boundary/boundary
 
   
 
   
===  objs2dist2.pl ===
+
</nowiki>
objs2dist2.pl: like objs2dist.pl but when -rpts specified prints out lines to ALL objects
+
===  analyze_yaodl ===
      within -maxdist (which now defaults to 20), rather than just the closest.  
+
  <nowiki>
      So we can see all the BK clusters which are close enough
 
      to a Ryr to be activated. see /home/lml/krypton/Zhuge/paper2010/README for 5/20/10.
 
  
This program takes 2 object outputfiles produced by countobjs (or maskobjs) and finds the shortest distance
+
This program reads in a yaodl file as produced by DAVE (volume widget menu: volume to surface ...)
from the center of mass of objects in file1.out to the center of mass of objects in file2.out.
+
(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.
  
If both file arguments are the same (e.g., objs2dist.pl file1.out file1.out >file.dist), you can use this
+
Usage: analyze_yaodl [options] infile.ydl
routine to find the distances between objects within an image (an object match with the same id is automatically
+
options:
ignored in this case so objects don't match to themselves). See also the option -skipsame.
+
  -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
  
(modified from /storage/big1/lml/was_voxel/Corvera/track/objs2bb.pl)
+
note: source code in /storage/big1/lml/Fischer/src directory.
 +
 +
</nowiki>
 +
===  BestPath  ===
 +
<nowiki>
  
usage:
+
Finds the brightest path from a start pixel to a stop pixel (1-indexed).
  objs2dist2.pl file1.out file2.out >file.dist 
 
  
options:
+
Usage:
  -dx=# : spacing in the x direction ,default = 1
+
BestPath [options] image.i2i
  -dy=# :  spacing in the y direction ,default = 1
+
Options:
  -dz=# :  spacing in the z direction ,default = 1
+
-t #: threshold. Only pixels with values > # are allowed in the path, default = 0.000000
  -size1=min:max : min and max object size allowed for file 1 in pixels (inclusive)
+
-s x y z: start coordinate (1-indexed). default = (1,1,1)
  -size2=min:max :  min and max object size allowed for file 2 in pixels (inclusive)
+
-S x y z: stop coordinate (1-indexed). default = (1,1,1)
  -iod1=min:max :  min and max object iod allowed for file 1 (inclusive)
+
-v: verbose
  -iod2=min:max :  min and max object iod allowed for file 2 (inclusive)
 
  -maxdist=#: :  don't allow matches further away than this distance (after applying dx, dy, dz spacing factors).
 
  default maxdist is 20.
 
  -hist : calculate histogram of distances (hist[int(dist)]++, where int just truncates to integer).
 
  -sizehist :  calculate histogram of object sizes (in voxels) in file1.out. (hist[int(size)]++, where int just
 
  truncates to integer). If you don't care about distances between two files (ie, only want -sizehist)
 
  put the same file name for both files on the command line.
 
  -rpts=file.rpts :  put bounding boxes around objects found and lines from objects in file1.out to all objects
 
  in file2.out that are <= maxdist away (these lines will become an object named "near_to_file1.out").
 
  display this in dave eg:  dave -n 0 -u -I file.i2i file.rpts (use the -n 0 and -u options)
 
  note: may not show up in dave until you click on "scale" to force a rescale (or draw?).
 
  -jack=max.rpts:# :  create an rpts file with the maxima in each object displayed as a small jack.
 
  # controls the size of the jack. 1=1 pixel in size, 2 = 2 pixels, etc.
 
  -strlim=# :  limit length of names of objects in rpts files to # characters.  dave sometimes crashes if the
 
  names are too long.
 
  -tyz : transpose coords in yz before writing them to the rpts (must specify -rpts option)
 
  -skipsame :  don't match an object in file1.out to an object with the same id in file2.out
 
  This is set automatically if file1.out = file2.out.
 
  -silent :  don't print the shortest distances (sets -hist)
 
  -verbose
 
  
example:
+
Source code in ~krypton/lml/facil 
  countobjs -k -t 2000 2000 wave1.objs wave1.i2i
+
  countobjs -k -t 2000 2000 wave2.objs wave2.i2i
+
</nowiki>
  objs2dist2.pl wave1.objs wave2.objs > wave1and2.dist
+
===  BestPath3D  ===
 +
<nowiki>
  
see also:
+
Finds the brightest path from a start pixel to a stop pixel (1-indexed).
  objs2dist121.pl, objs2dist.pl, closest_object, closest_voxel, countobjs, maskobjs, objs_via_ascent, pt_distances
+
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:
=== objs2mst.pl  ===
+
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.
  
This program takes an object outputfiles (unless -rptsin) produced by countobjs (or maskobjs) and finds the minimal
+
See also: make_spiralim, BestPath, BestPath2, make_ellipsoid, DAVE -> Stuff -> Best Path ...
spanning tree connecting the center of mass of the objects. Writes out connections as an rpts file to stdout.
 
Options can be used to only selected a subset of the objects and to constrain max distance (so multiple
 
trees can be produced).
 
  
usage:
+
Source code in ~krypton/lml/facil 
  objs2mst.pl file1.objs > file1_mst.rpts
+
 +
</nowiki>
 +
===  BestPath3D_ellipse  ===
 +
  <nowiki>
  
options:
+
Finds the brightest path from a start pixel to a stop pixel (1-indexed).
  -dx=# :  spacing in the x direction, default = 1
+
Converts voxels into nodes in a graph and finds the lowest cost path from the start node to the stop node.
  -dy=# :  spacing in the y direction, default = 1
+
The cost of each node is (maxval-imval), so bright nodes have less cost. Output in rpts format to stdout.
  -dz=# :  spacing in the z direction, default = 1
+
BestPath3D always turns all (above threshold) voxels in the image into graph nodes. BestPath3D_ellipse only
  -size1=min:max :  min and max object size allowed for file1.objs in pixels (inclusive)
+
looks at voxels within an ellipse with a major axis connecting the start and endpts.
  -iod1=min:max :  min and max object iod allowed for file1.objs (inclusive)
+
Usage:
  -rptsin : instead of file1.objs, read file1.rpts where file1.rpts was produced by max2d.
+
BestPath3D [options] image.i2i > image.rpts  
  -size1 and -iod1 are ignored when this option is specified.
+
BestPath3D_ellipse [options] image.i2i > image.rpts  
  -addlines :  output rpts format which addlines is more likely to be happy with (may not work in dave?)
+
Options:
  -maxdist=#: :  don't allow matches further away than this distance (after applying dx, dy, dz spacing factors).
+
-t #: threshold. Only pixels with values > # are allowed in the path, default = 0.000000
  default maxdist is ~  3000.
+
-s x y z: start coordinate (1-indexed).  
  -hist : calculate histogram of distances (hist[int(dist)]++, where int just truncates to integer).
+
-S x y z: stop coordinate (1-indexed).  
  -sizehist : calculate histogram of object sizes (in voxels) in file1.out. (hist[int(size)]++, where int just
+
Up to 1000  pairs of start/stop pixels can be specified. At least one pair must be specified.
  truncates to integer). If you don't care about distances between two files (ie, only want -sizehist)
+
-r scale black  rescale image values so new = (old-black)/scale prior to being used
  put the same file name for both files on the command line.  
+
-n name name of object that is placed into the rpts file.
  -rpts=file.rpts :  put bounding boxes around objects found and lines between closest objects (similar to objs2bb.pl)
+
-f exfac perpfacOnly used if you are running BestPath3D_ellipse
  display this in dave eg:  dave -n 0 -u -I file.i2i file.rpts (use the -n 0 and -u options)
+
        sets principal axis a to have the specified endpts (from -s and -S), then expands it by factor exfac,
  note: may not show up in dave until you click on "scale" to force a rescale (or draw?).
+
                        and sets the length of the perpendicular b and c axes to be perpfac times the original axis a length
  -jack=max.rpts:# :  create an rpts file with the maxima in each object displayed as a small jack.  
+
defaults: exfac = 1.000000, perpfac = 1.000000
  # controls the size of the jack. 1=1 pixel in size, 2 = 2 pixels, etc.
+
-v: verbose
  -strlim=# limit length of names of objects in rpts files to # characters.  dave sometimes crashes if the
+
-d: debug
  names are too long.
+
-D debug.i2i: debug. also write out image with 50 added to all voxels within the ellipsoid.
  -tyz :  transpose coords in yz before writing them to the rpts (must specify -rpts option)
 
  -color=# :  for the w value (color) use the specified value (use -P in play to see this as a color). default = none.
 
  if you have no color (no w value), addlines can put one in (-P option in addlines).
 
  -silent : don't print the shortest distances (sets -hist)
 
  -verbose
 
  
example:
+
Examples:
  countobjs -k -t 2000 2000 wave1.objs wave1.i2i
+
make_spiralim -d 200 200 30 -r 70 -p spiral_small.i2i # create a test image
  objs2mst.pl wave1.objs  > wave1mst.rpts
+
                -s 171 101 1  -S 170 99 30            # written out by make_spiralim
  dave -I wave1.i2i -n 0 -u wave1mst.rpts
+
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:
+
See also: make_spiralim, BestPath, BestPath2, make_ellipsoid, DAVE -> Stuff -> Best Path ...
  objs2bb.pl, objs2dist.pl, objs2dist121.pl, closest_object, closest_voxel, countobjs, maskobjs, objs_via_ascent
 
  resolve_pts
 
  
 +
Source code in ~krypton/lml/facil 
 
   
 
   
===  objs_within_dist.pl ===
+
</nowiki>
 +
===  boundaryL ===
 +
<nowiki>
 +
Usage:
 +
  boundary [options] original.i2i
  
This program takes 2 object outputfiles produced by countobjs (or maskobjs) and finds the number of objects
+
Description:
in the second file which are within a given distance of each object in the first file. A histogram is
+
  Boundary takes an image, applys a threshold to the image,
printed out.
+
  rolls a ball outside then inside the object. This defines
Distances are from the center of mass of objects in file1.out to the center of mass of objects in file2.out.
+
  what pixels are considered inside, outside, and boundary.
(modified from objs2dist.pl)
 
  
usage:
+
  Expects:  Input image and optionally some given options
   objs_within_dist.pl file1.out file2.out >file.dist 
+
  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:
+
Options:
  -dx=# : spacing in the x direction ,default = 1
+
-I        : Do not roll ball inside of the cell.
  -dy=# :  spacing in the y direction ,default = 1
+
              (rolling the ball inside the cell results
  -dz=# : spacing in the z direction ,default = 1
+
              in a smoother surface)
  -size1=min:max :  min and max object size allowed for file 1 in pixels (inclusive)
+
-r #       : Set radius to # for sphere exterior to cell.
  -size2=min:max :  min and max object size allowed for file 2 in pixels (inclusive)
+
              (default = 3)
  -iod1=min:max :  min and max object iod allowed for file 1 (inclusive)
+
-R #      : Set radius to # for sphere interior to cell.
  -iod2=min:max :  min and max object iod allowed for file 2 (inclusive)
+
              (default = 3)
  -maxdist=#: :  don't allow matches further away than this distance (after applying dx, dy, dz spacing factors).
+
-t #      : Set threshold for all z slices to > #.
  default maxdist is ~ 3000.
+
              (default is 10)
  -rpts : read in file in rpts format
+
-T filename: Use file filename for thresholds for each z slice.
  -verbose : extra info written to stderr
+
              (one threshold for each zslice - one threshold on a line)
  -vverbose print other info. can be combined with -verbose.
+
-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.
  
example:
+
Caveats:
   countobjs -k -t 2000 2000 wave1.objs wave1.i2i
+
   Requires lots of memory and time to run (megabytes+minutes).
  countobjs -k -t 2000 2000 wave2.objs wave2.i2i
 
  objs_within_dist.pl wave1.objs wave2.objs > wave1and2.dist
 
  
see also:
+
Notes:  
   objs2dist121.pl, closest_object, closest_voxel, countobjs, maskobjs, objs_via_ascent, pt_distances
+
   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:
===  connected_random_pts  ===
+
  surface location, boundary, boundaries, border
Generates random pts in a planar region, calculates how many connected components are created
 
if a pt is connected to all other pts within a given radius.
 
  
Usage:
+
Additional programs:
connected_random_pts [options]
+
  histogram, shrink_wrap, createBoundary, analysis
Options:
 
-x lowx hix:         pts have xcoords within this range, default = (0.0,100.0)
 
-y lowy hiy:         pts have ycoords within this range, default = (0.0,100.0)
 
-r #: radius (in pixels), default = 5.0
 
-s #: long int starting seed for random number generator. default = process id.
 
-n #: number of pts to create, default = 1000
 
  -h: help
 
  -v: verbose
 
  
 +
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:
 
See also:
krypton/Huang/README, components.pl, Kth_pt.m, num_observed.m, mean_minimum_distance.m,objs2mst.pl
+
closest_voxel objs_via_ascent /home/lml/krypton/Zhuge/BKandRyr/graph.pl,match.pl  
 +
Bugs:
  
 
Source code in ~krypton/lml/facil   
 
Source code in ~krypton/lml/facil   
 
   
 
   
===  pt_distances ===
+
</nowiki>
#/home/lml/krypton/bin/pt_distances
+
===  closest_voxel ===
 +
<nowiki>
  
Takes output from 2 runs of max2d_simple -p file.rpts  and calculates minimum distance between pts.  
+
Calculates the closest distance from an above threshold voxel in image1 to an above threshold voxel in image2.
See comments printed to stdout when the program runs to explain the fields in the output data.
+
Histogram of these distances is printed to stdout.
  
 
Usage:
 
Usage:
pt_distances [options] file1.rpts file2.rpts
+
closest_voxel [options] image1.i2i image2.i2i > im1_im2.hist
 
Options:
 
Options:
-h: print histograms of distances. entry for pt at dist d:  histogram[int((d+tiny)/binsize)]++
+
-t # #: image1 and image2 thresholds, pixels > # are above threshold, default = 0.
-t #: set tiny to #, default = 0.000010 . Points at exactly 1 pixel seem to be put into the .9 bin
+
-w # # #: x,y, zweights for pixel distances (ie, pixel size), default = 1 for each.
perhaps due to slight roundoff error. By adding tiny, they go into the next bin.
+
-m # :         maxdistance (in units used for -w) to look for the closest pixel, default = 10.000000
      -b #: set binsize to # pixels, default = 0.100000
+
-r #:         resolution for output histogram, ie, binsize, default = 0.100000
      -m #: set maximum distance histogram will go out to (distances > this get put in last bin)
+
-s lowx lowy lowz hix hiy hiz: only look at voxels within this subvolume, 1-indexed, inclusive.
default = 50.000000 pixels
+
-Q: only the voxel in each image1 object closest to an image2 voxel should count.
-a #: the area (in pixels) of the region used to generate file1.rpts and file2.rpts
+
Use this if image1.i2i was created via the -Q option from countobjs.
this is used to compare observed rates with theoretical rates if randomly distributed.
+
-o minsize maxsize:     only look at objects in image1.i2i within the size range (inclusive, in voxels)
NOTE: the theoretical calculations for image1 vs. image2 (and vice versa) are probably WRONG.
+
must use -Q option along with this.
default = 10000.000000
+
-p: also print the detailed info of which voxel matched to which other voxel
-M #: the minimum distance allowed between maxima, for theoretical calculations. This might be
+
  -v: verbose
1 (pixel) since maxima normally can't be next to each other. Or it might be the
+
  -V: very verbose
resolution of the microscope (since objects closer than that will appear as one maxima).
+
Examples:
by default M from 0.0 to 3.0 by 1.0 is calculated. if you want an additional value use this option.
+
    Find the distance from the closest Ryr voxel in each object to a BK object. Record the iod
  -v: verbose
+
    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>
 +
 
  
See also: max2d_simple read_hist.pl
+
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.
  
Example:
+
Usage: coloc3ims [options] image1.i2i image2.i2i image3.i2i newimage3.i2i
  max2d_simple -t 10 -d .5 clathrin.i2i > clathrin.pts
+
options:
  max2d_simple -t 10 -d .5 glut.i2i > glut.pts
+
  -t thresh1 thresh2:  thresholds for image1 and image2, defaults = 0 and 0
  pt_distances -h -a 26443 -M 1.5 clathrin.pts glut.pts > both.dat
+
  -n newval: instead of setting newimage3 to 0, set it to newval
  fgrep "image1 only" both.dat | fgrep mean_min | cull -n -15 -21 -24 -30 > clathrin_mindist.xy
+
  -m: instead of setting newimage3 to 0, set it to the max value in image3.i2i
  xmgrace -nxy clathrin_mindist.xy &
 
  read_hist.pl -im1 -norm=1 -nummax=26443 -avg=5 -nozero < clathrin_mindist.dat > clathrin_histo.xy
 
  xmgrace clathrin_histo.xy &
 
  
Source code in ~krypton/lml/facil 
+
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.
 
   
 
   
===  resolve_pts ===
+
</nowiki>
 +
===  coloc_tseries2 ===
 +
<nowiki>
  
Takes minimimal spanning tree rpts file (just an rpts file with each pair of pts which are to be compared specified
+
Similar to coloc_tseries, but compares a 2D time series to itself.
as a line segment, i.e., two pts and a "break") as produced by objs2mst.pl and finds which connected
+
Prints xmgr formatted graphs to stdout.
pts are resolved and which are not.  Resolved pts are those which have at least the specified
 
intensity dip along the minimum cost (roughly: brightest) path connecting those pts. note: if there is no path between the two
 
pts such that all voxels are greater than the threshold, the pts are also considered to be resolved.
 
If a pair of pts is resolved, both are written to out.rpts (but not more than once). If a pair of pts is not resolved
 
then the brighter of the two (voxel intensity) is written to out.rpts.
 
The intensity dip is the max amount the intensity goes below the dimmer of the two endpts (anywhere along the minimum cost path).
 
Each pair of lines (i.e., pair of coordinates) in mst.rpts defines ends of a minimum cost path
 
along which an intensity dip will be searched for.
 
  
Usage: resolve_pts [options] image.i2i mst.rpts out.rpts
+
Usage: coloc_tseries2  image1 outfile
 
options:
 
options:
  -t #: threshold, default = 0.000000
+
-t thresh:    only count voxels > thresh. default = 0
  -f : normally a pt is discarded if it does not resolve against at least one other pt it is connected to in the input rpts file.
+
-z start stop: only look at these z planes (inclusive, 1-indexed). default = all z planes.
Thus, AXXXXBXXXXC if A and B resolve, but B doesn't resolve against C, and B is smaller than C
+
-n: don't include a legend in the stdout.
B will normally be discarded (even though it resolves against A, it fails against C). If you specify -f
+
        -v:          verbose
then maxima which fail will be kept as long as they resolve against some other pt.
+
 
  -d #: intensity dip required to be resolved. default = 10.000000
+
source code in: /home/lml/krypton/facil
  -p #: the percentage dip required relative to the dimmer endpt (e.g. 26 is 26 percent dip)
+
 
  -l: instead of dip being the maximum amount below the dimmer of the two pts, dip
+
see also: /home/lml/krypton/Corvera/paper2010/Dynamics_in_Dave/README
is the max amount below a linearly interpolated intensity between the two endpoints.
+
  -i: truncate coords written to out.rpts to integers (addlines prefers this I think).
+
</nowiki>
  -v: verbose.
+
===  com_2d_objs  ===
  -V: very verbose.
+
<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:
 
Examples:
countobs image.i2i > image.objs
+
  planimeter3.20081007 -I 110215ligand_0_491.i2i -R 110215ligand_0_491_cell1.rpts
obs2mst.pl -maxdist=10 image.objs > image_mst.rpts
+
  interp -S -p -1 -o cell1 110215ligand_0_491_cell1.rpts 110215ligand_0_491_cell1_interpS.rpts
resolve_pts -d 100 -i image.i2i image_mst.rpts image_maxima.rpts
+
  create_dcimL -d 1 -s 502 501 1440 one.i2i
See also:  BestPath, objs2mst.pl, krypton/Huang/TIRF4/README
+
  addlines one.i2i 110215ligand_0_491_cell1_interpS.rpts - | maskedsmul -O 0 one.i2i - cell1_binary.i2i
Source code in krypton/facil
+
    # 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
 
   
 
   
== Image Manipulation ==
+
</nowiki>
===  align_quadrants.pl ===
+
=== exo4  ===
This program displays the four quadrant images of a wellThe user then saves 3 pairs of points
+
  <nowiki>
(s when middle mouse is pressed). Each pair of points should be points that match in two
+
Phase 1: Associates each voxel in inimage.i2i which is > threshold with a maxima in the imageIt finds
neighboring quadrants.  When done, each quadrant must have one (or two) points specified.
+
        the maxima by doing a steepest ascent walk in the imageWrites summary info about regions found to
Points must be in pair order (see recalc_quadrant2.pl).  When done, the use must write them out
+
        stdout in the same format as countobjs.  Only the location of the maxima found in phase 1 are passed to phase 2.
via z (when middle mouse is also pressed, no confimation is given in play).   
+
        All vesicles must start out as maxima. (see also -readmax option)
The quadrant images are then aligned based on these points and newimage.i2i is created.
+
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 -------------                      ------------------
  
It will also create a file with the output from play, for future reference.
+
          0  t1      t2                  t3
It will be named, eg, G02_combined_play.pts. It can be passed manually to recalc_quadrant2.pl to redo
+
          0  t1      |prise|              |ffall|
the alignment if necessary.
 
  
usage:
+
t1: time of tethering (should stop moving)
  align_quadrants.pl [options] well newimage.i2i
+
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 ha