Difference between revisions of "Software2"

From Wiki
Jump to navigation Jump to search
 
(5 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
 
                    maximum length coordinate (i.e., at the cell ends). These must
 
                    be the letters I (for infinite) or S (for solid, i.e. no ions go
 
                    through the membrane). The I option is not always accurate. default: S
 
    -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):
+
  distances:
    -ion name free_concentration D valence:  
+
-w # # #: x,y, zweights for pixel distances (ie, pixel size), default = 1 for each.
                    concentration in mMolar, D in cm^2/sec, valence in absolute value.
+
-p #: pixel size in nm (i.e., what 1 means in -w option), default = 80.000000
                    valence is only used if -ion_src is also specified.
+
-m # :         maxdistance (in units used for -w, i.e., pixels) to look for the closest pixel, default = 10.000000
                    concentration is the initial free concentration.
+
 
    -buffer name total_concentration D:  
+
  which pixels or clusters to include:
                    concentration in mMolar, D in cm^2/sec.
+
-t # #: image1 and image2 thresholds, pixels > # are above threshold, default = 0.
                    concentration is the initial total concentration (sum of its free and all bound forms).
+
-e lowx lowy lowz hix hiy hiz:  only look at voxels within this extent (subvolume), 1-indexed, inclusive.
    -kin bufname ionname boundname onrate offrate D:  
+
-s minsize maxsize:     only look at objects in Ryr_image.i2i within the size range (inclusive, in voxels)
                    kinetics for interaction between bufname and ionname. Boundname is the
+
max size allowed = 100000
                    name to give the bound pair.  bufname and ionname must have been
+
-S minsize maxsize:     only look at objects in BK_image.i2i within the size range (inclusive, in voxels)
                    specified (with -ion -buffer or -kin options) prior to this option.
+
-i miniod maxiod:     only look at objects in Ryr_image.i2i within the iod range (inclusive. use -d also.)
                    onrate:in 1/(mMolar*seconds), offrate: in 1/seconds, D: in cm^2/sec 
+
-I miniod maxiod:     only look at objects in BK_image.i2i within the iod range (inclusive. use -D also.)
    -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.
 
                    The file is a list of numbers (current or scale), 1 per line, at dt (in sec) intervals.
 
                    If op = T, currents greater than the specified threshold means channel open, otherwise closed.
 
                    If op = S, the current as specified with -ion_src is scaled by the number in the list.
 
                    "threshold" is required but ignored when op = S.  Not extensively tested.  
 
    -zap_sub name time:
 
                    At the specified time (in seconds) set the named substance concentration
 
                    to 0. This does not prevent it from being produced from other reactions.
 
                    This is useful if an injected "ion" was photons (e.g., photon+caged -> uncaged)
 
                    and the laser is turned off at the specified time.
 
  
Options related to output:
+
  miscellaneous:
    -save name filename type scale dt:
+
  -v: verbose. produces list of each Ryr cluster and K current produced to stderr. Other stuff too.
                    Save images of the specified substance (name) to specified file. By default
+
To write this to a separate file do: (channel_current -v ... > stdout.channel) >& stderr.channel
                    substances are saved in mM.  This will be multiplied by the scale
+
  -V: very verbose
                    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):
+
Examples:
    invoke on the wolves as, for example,  mpirun -np 3 -machinefile file_of_machine_names cellsim ...
 
    -print_proc #:  only print output from the specified process (0 indexed).
 
                  Some output (eg, Total mmoles of ions, etc) are only valid for process 0.
 
    -overlap #:  overlap neighboring regions by the specified number of voxels (default = 50)
 
                  This will also be the number of iterations between necessary synchronization.
 
    -debug_mpi #:  print MPI info. Execute MPI dummy stubs if MPI NOT present (eg, under Windows,SGI).
 
                  This version of the executable does NOT use MPI.
 
    -debug_mpi_proc rank numproc:  set dummy rank and number of processes. use only if MPI NOT present!
 
  
EXAMPLES
+
cellsim -spacing /home/lml/krypton/Zhuge/STIC/simulations/spacing2.txt ....     : produces ca.i2i
./cellsim -time .0010 -time_rate .5 -length 200 -rings 40 -radius 1 \
+
printvalsL -spacing2.txt -R -t -i ca.i2i > ca.vals    
        -ion Ca 100E-6 2.5E-6 2 -buffer Fluo3 .050 2.5E-7 -buffer Buf .230 1E-14 \
+
kate ca.vals     : delete fist comment line
        -kin Fluo3 Ca CaFl 8E4 90 2.5E-7 -kin Buf Ca CaBuf 1E5 100 1E-14        \
+
      objs_via_ascent -s 5 100 Ryr.i2i Ryrid.i2i > tmp
        -ion_src Ca 1 .00105 99 102 0 3 \
+
tail tmp  : the mean IOD gives an idea of brightness needed to produce current used in cellsim, say 30000
        -save all _run1 I 1 .0001 >& cellsim_run1.out
+
      objs_via_ascent -s 5 100 BK.i2i BKid.i2i > tmp
 +
tail tmp : the mean IOD gives an idea of brightness of a BK cluster, eg mean= 10000, but assume that's 10 channels
 +
 
 +
channel_current -f ca.vals -w 1 1 3 -d Ryr.i2i 30000 -D BK.i2i 1000 Ryrid.i2i Bkid.i2i > ryr_bk.info
 +
cull -s -c -1 -4 < ryr_bk.info |xmgrace -source stdin
 +
See also:
 +
closest_object closest_voxel objs_via_ascent /home/lml/krypton/Zhuge/BKandRyr/graph.pl,match.pl
 +
graph_channel_current.pl, test_channel_current, /home/lml/krypton/Zhuge/STIC/simulations/run32 
 +
/home/lml/krypton/Zhuge/BKandRyr/analysis6/cluster_distances.pl, plot_mean_sd_curve.pl
 +
/home/lml/krypton/Zhuge/xpp/ASM15.ode
 +
Bugs:
  
 +
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
  
  distances:
+
Examples:
-w # # #: x,y, zweights for pixel distances (ie, pixel size), default = 1 for each.
 
-p #: pixel size in nm (i.e., what 1 means in -w option), default = 80.000000
 
-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:
+
Source code in ~krypton/lml/Zhuge/Ryr_clusters 
-t # #: image1 and image2 thresholds, pixels > # are above threshold, default = 0.
+
  /home/lml/krypton/bin/cluster -h
-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 Ryr_image.i2i within the size range (inclusive, in voxels)
 
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:
+
</nowiki>
-d Ryrimage1d.i2i #: the original intensity image for Ryr_image (since Ryr_image has pixel values as id numbers)
+
=== diffusion_limited_binding  ===
# is the number of Ryrimage1d.i2i intensity units required to produce spark current
+
<nowiki>
used in the calcium simulation (which produced the -f filename data).
+
unknown option h
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:
+
Prints out distance (um) and concentration (particles/cm^3) at that distance
  -v: verbose. produces list of each Ryr cluster and K current produced to stderr. Other stuff too.
+
a slab volume of initial uniform concentration (1 particle/cm^3)which has a ligand
To write this to a separate file do: (channel_current -v ... > stdout.channel) >& stderr.channel
+
binding to a plane at x = 0. This is diffusion limited binding. See my notes of 10/20/98.
  -V: very verbose
 
  
Examples:
+
Usage: diffusion_limited_binding [options] 
 +
options:
 +
  -D #:  diffusion (cm^2/msec), default = 2.2E-09
 +
  -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>
  
cellsim -spacing /home/lml/krypton/Zhuge/STIC/simulations/spacing2.txt ....     : produces ca.i2i
+
This program creates an elliptical cell, cell length is in the y direction.
printvalsL -spacing2.txt -R -t -i ca.i2i > ca.vals    
+
It is used to model a squashed cell, and see how different it looks after
kate ca.vals     : delete fist comment line
+
blurring than a cylindrical cell
      objs_via_ascent -s 5 100 Ryr.i2i Ryrid.i2i > tmp
 
tail tmp  : the mean IOD gives an idea of brightness needed to produce current used in cellsim, say 30000
 
      objs_via_ascent -s 5 100 BK.i2i BKid.i2i > tmp
 
tail tmp  : the mean IOD gives an idea of brightness of a BK cluster, eg mean= 10000, but assume that's 10 channels
 
  
channel_current -f ca.vals -w 1 1 3 -d Ryr.i2i 30000 -D BK.i2i 1000 Ryrid.i2i Bkid.i2i > ryr_bk.info
+
Usage: ellipse [options] ellipse.i2i
cull -s -c -1 -4 < ryr_bk.info |xmgrace -source stdin
+
options:
See also:
+
  -d xdim ydim zdim:  dimensions of image, default = (50,100,50)
closest_object closest_voxel objs_via_ascent /home/lml/krypton/Zhuge/BKandRyr/graph.pl,match.pl
+
  -r xradius zradius:  radius (in pixels) in the x and z directions, default (20.000000,20.000000)
graph_channel_current.pl, test_channel_current, /home/lml/krypton/Zhuge/STIC/simulations/run32  
+
  -s samplerate:  number of subsamples in x and z directions per pixel, default = 1
/home/lml/krypton/Zhuge/BKandRyr/analysis6/cluster_distances.pl, plot_mean_sd_curve.pl
+
  -i intensity:  intensity inside the ellipse, default = 100.000000
/home/lml/krypton/Zhuge/xpp/ASM15.ode
+
Bugs:
+
</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.
  
Source code in ~krypton/lml/facil  
+
Usage: em [options]
  # Popen is monotonic as it should be.
+
options:
must provide -f cafilename
+
  -s #: number of states, default = 2. Must specify -t and -p after this.
 
+
  -t # # # ... #: state transition probabilities. If there are S states (e.g., -s #)
=== cluster ===
+
                        order: T[1][1], T[1][2], ... T[1][S], T[2][1] ... T[S][S] if there are S states),
Drops random Ryr receptors into a worldThen calculates how many clusters and their sizes get produced.
+
                        where T[i][j] is the probability of a transition from state i to state j.
Currently the "world" default size is (2um)^3.  (see -wsize)
+
  -p # # # ... #: prior probabilities of states (S entries if there are S states)
The origin of this world is in it's center (so it goes from -1um to +1 um in each direction by default).
+
  -P #: which prior estimate to use for the pdf of the data (ie., estimate of Poisson process)
A histogram of cluster sizes is printed to stdout.
+
        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 /home/lml/krypton/facil/em.cc
 +
See also:  ~/krypton/facil/transpose.pl  to print out selected lines from the output file
 +
          ~/krypton/matlab/netlab: has EM routines
 +
          ~/krypton/matlab/bayes/BNT/HMM: has HMM and EM routines
 +
/home/lml/krypton/bin/em -h
 +
 
 +
</nowiki>
 +
===  makebeads2  ===
 +
<nowiki>
 +
/home/lml/krypton/bin/makebeads2
 +
 
 +
randomly distributes beads within a volume.  created to let Jack simulate
 +
distribution of glut4 labels vesicles in the TIRF field of a microscope.
 +
A bead has a constant value between its inner and outer diameters. This value
 +
falls to zero 3 standard deviations inside the inner diameter and 3 sd outside
 +
the outer diameter. Beads are not allowed to intersect each other.
 +
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:
 +
-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 appropriatenote: 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):
 +
-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
 +
-G mean sd:  make bead sizes (scales) a Gaussian variable with specified mean and sd (instead of -s).
 +
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
 +
the size distribution will no longer match the parameters specified here.
 +
-g mean sd shell: like -G, but also specify bead shell thickness in microns.  mean doesn't scale the shell thickness.
 +
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:
+
Examples:
cluster [options]
+
#create 200 beads, with a 50 nm (5 z plane) gap before the pm, which has an
Options:
+
#intensity of 50. Apply a TIRF exponential excitation scale to it.
distance options:
+
makebeads2 -e .1 -z 5 63 -p 5 50 -n 200 beads1.i2i > beads1.info
-eucliddist:      calculate a Euclidean distance (same in x,y,z directions). This is the default.
+
# apply microscope psf
  (use -cdist option to set the nearby distance for this).
+
blur3d -P -N 256 256 128 beads1.i2i empiricalpsf_seg_40nm_seg.i2i beads1_blur3d.i2i
-absdist:   rather than calculate a real distance, calculate max(ABS(dx),ABS(dy),ABS(dz)) - for speed
+
# bin (averge) to 100/160 nm resolution
  (use -cdist to set the nearby distance for this.)
+
reduceima -A -X 1 256 4 -Y 1 256 4 beads1_blur3d.i2i beads1_blur3d4x4.i2i
-psfdist x y z:  distance (in um) a pt can be in the x, y, and z directions and be considered nearby.
+
# extract infocus plane
  Does not use -cdist. To approximate a psf you might specify .2 .2 .6
+
segment -Z 16 16 1 beads1_blur3d4x4.i2i beads1_blur2d4x4.i2i
      -cdist #:        how close (in um) two receptors must be to cluster, default = 0.500000
+
# add ScratchNG camera noise
other options:
+
noise -e 1.4 -n 8 beads1_blur2d4x4.i2i beads1_blur2d4x4N.i2i
      -2D:   do a 2D simulation (x and y), not a 3D simulation
+
histima -size 10 -bins 100 beads1_blur2d4x4N.i2i > beads1_blur2d4x4N.hist
-cylinder inner outer:  only place Ryr within a cylinder (e.g., plasma membrane) with specified
+
 
                        inner and outer radius (in um). The cylinder has its length the entire y dimension.
+
#creates beads, move them, look at the results
  Only the parts of the cylinder which fit in the world (-wsize) are used.
+
makebeads2 -z 5 63 beads1.i2i > beads1.info
-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)
+
#read those beads in and move them. but still must stay outside the first 50 nm.
-psize x y z:   pixel width (in um) in the x, y, and z directions (default = 0.1,0.1,0.1)
+
makebeads2 -z 5 63 -b beads1.info .05 .05 beads2.i2i > beads2.info
      -numryr #:        number of Ryr receptors to drop, default = 1000
+
concateima beads1.i2i beads2.i2i beads.i2i
-mindist #:   when placing Ryr receptors, keep this minimum distance (in um) between them.
+
imsets beads.i2i 2
-randstart #:   start the random number generator with # as the seed. So runs can be reproduced.
+
dave -tdim 2 -4 -I beads.i2i
-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.
+
#just create scripts (very fast) with positions of beads, and move them around.
diagnostics:
+
makebeads -z 5 63 -n 200 -A dummy.i2i > beads1.info
      -debug:          turn on debugging
+
makebeads -b beads1.info .05 .05 -z 5 63 -A dummy.i2i > beads2.info
      -verbose:        be a bit more verbose
+
makebeads -b beads2.info .05 .05 -z 5 63 -A dummy.i2i > beads3.info
      -h:  print this help
+
#now create the images
      -H:  print this help
+
makebeads -b beads1.info 0 0  beads1.i2i > beads1.info2
      -help:  print this help
+
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
 +
 
 +
source code in ~lml/krypton/facil
 +
 +
</nowiki>
 +
===  oxygen  ===
 +
<nowiki>
 +
Calculates steady state partial oxygen pressure (P) as a function of distance from a blood vessel (r).
 +
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).
 +
 
 +
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
 +
  Steady Heat Conduction in Layered Mediums: The Half-Space and Sphere, by Henry N. Pollack
 +
  J. of Geophysical Research, vol. 70(22), Nov. 15, 1965, pp. 5645-5648
 +
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.
 +
  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.
 +
 
 +
note: because R2 really should vary in an image, depending upon the distance between nearby blood vessels
 +
        and because Ps is not just a scale factor (so, eg, brighter blood vessels in an image, if brightness is
 +
        proportional to Ps, do NOT just cause a scale factor in the P(r) values), it may NOT be appropriate
 +
to take the image produced by this program and convolve it with an image of blood vessels to get
 +
estimates of oxygenation of tissue. This comment may apply to all three models (definitely to -m 1)
 +
 
 +
Usage: oxygen -m # [options] 
 +
    required:
 +
  -m # which model to use.
 +
        -m 1 :line source model with constant O2 consumption
 +
-m 2: point source model with constant O2 consumption.
 +
        -m 3 :point source model with O2 consumption proportional to O2 concentration.
 +
Use point source models if planning on convolving resulting image with a blood vessel image.
 +
 
 +
    options for all models:
 +
Although these options can be used in all models, different models have different sensitivities to them.
 +
  -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:
 +
  -n normalize output (doesn't affect -i image.i2i), ie, print r/R1  vs P/Ps  rather than r vs. P
 +
  -r add a third reference column which is the "simple" diffusion solution (goes as 1/r)
 +
This is for a point source in 3D (not a line source), and ignores O2 consumption.
 +
graph as: oxygen_krogh -r | xmgr -nxy stdin
 +
 
 +
    output image options:
 +
  -i image.i2i xdim ydim zdim:  create an image of the values, to use with blur3d to find
 +
O2 everywhere in an image as a function of distance from blood vessels.
 +
If you are planning on convolving you should probably specify -m 3 .
 +
  -d x y z if -i is specified. pixel dimensions in um. default = 0.60 0.60 10.00
 +
  -s # if -i is specified. scale output intensities by #. Otherwise max is 52.0 mm Hg
 +
  -o xorig yorig zorig: location of the blood vessel in the image (zero indexed, floating point)
 +
blur3d may care about this, depending upon options. default = (0.00,0.00,0.00)
 +
(maybe I should change this to define a line in the image when -m 1 is specified?)
 +
-p the output image should be for the simple 1/r point source (see -r explanation) rather
 +
for the line source (-m 1) or point source with O2 consumption (-m 2 or -m 3).
 +
 
 +
    other options:
 +
  -v verbose. stuff to stderr.
 +
  -V more verbose. stuff to stderr. debugging info.
 +
  -h print this help
  
 
Examples:
 
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
 +
 +
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;
 +
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
 +
source code in:  /home/lml/krypton/facil
 +
error: A model must be specified, i.e., -m # must be specified.
 +
  
Source code in ~krypton/lml/Zhuge/Ryr_clusters  
+
</nowiki>
  /home/lml/krypton/bin/cluster -h
+
===  sparkspread ===
 +
  <nowiki>
  
===  diffusion_limited_binding  ===
+
Calculates the spread of spark event amplitudes given that two events occur at the same
unknown option h
+
spark site and compares it to the spread of amplitudes given that two events occur at
 +
different spark sites. A spark site has a unique (x,y) position.
 +
Prints mean and stddev to stdout. Also prints out histograms and cumulative distributions.
  
Prints out distance (um) and concentration (particles/cm^3) at that distance
+
A valid datafile has either blank lines, comments (start with #) or a data line (spark event).
a slab volume of initial uniform concentration (1 particle/cm^3)which has a ligand
+
A data line has 8 or 11 fields. 11 if a stoc is associated with the spark event
binding to a plane at x = 0.  This is diffusion limited binding. See my notes of 10/20/98.
+
A valid stoc (last 3 fields) must have a nonzero stoc amplitude (1st of 3 fields)
 +
See /usr/people/lml/vision/Rhonghua/Sparks/singlesitev2 for a valid file format.
  
Usage: diffusion_limited_binding [options]
+
Usage: sparkspread [options] datafile
 
options:
 
options:
  -D #:   diffusion (cm^2/msec), default = 2.2E-09
+
  -h: do NOT print histogram for intraspark data.
  -t t1 t2:   start and stop time to simulate (msec), default = 0.000000 1000.000000
+
  -H: do NOT print histogram for interspark data.
set both numbers equal if you only want one time point.
+
  -c: do NOT print cumulative distribution for intraspark data.
  -x x1 x2: start and stop distances to print (um), default = 0.000000 10.000000
+
  -C: do NOT print cumulative distribution for interspark data.
set both number equal if you only want one position
+
  -b #: number of bins for histogram, default = 20
  -L #: thickness of slab volume (um), default = 10.000000
+
  -n: normalize the histograms so their maximum is 1
  -T #: number of samples in t, default = 10
+
  -k: also print ks statistic showing if two distributions are different.
  -X #: number of samples in x, default = 1000
+
  -h: print this help message.
+
</nowiki>
  -F: print out time (msec) and flux (particles/cm^2-msec) at x = 0
+
===  spot_diffusion ===
(i.e., rate molecules binding to x=0 surface).
+
<nowiki>
I've made flux towards lower x positive (normally it would be negative).
+
unknown option h
  -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)
 
 
===  ellipse ===
 
  
This program creates an elliptical cell, cell length is in the y direction.
+
Prints out time (secs) and concentration (nMolar) seen at a distance
It is used to model a squashed cell, and see how different it looks after
+
from a channel with a constant current, open for specified time.
blurring than a cylindrical cell
 
  
Usage: ellipse [options] ellipse.i2i
+
Usage: spot_diffusion [options]
 
options:
 
options:
  -d xdim ydim zdimdimensions of image, default = (50,100,50)
+
  -D #diffusion (cm^2/sec), default = 2.2E-06
  -r xradius zradius: radius (in pixels) in the x and z directions, default (20.000000,20.000000)
+
  -c #:  current (pAmp), default = 1
  -s samplerate: number of subsamples in x and z directions per pixel, default = 1
+
  -s #:  starting concentration (resting level, in nM), default = 0
  -i intensity: intensity inside the ellipse, default = 100.000000
+
  -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
 
   
 
   
===  em ===
+
</nowiki>
Creates (or reads in) a HMM and then generates random data from it
+
===  total_ca ===
(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.
+
#/home/lml/krypton/bin/total_ca
This is a way for me to learn how to implement the EM algorithm.
+
 
 +
Reads in a floating point image or short int image as produced by simulation (i.e., cylindrical coords), calculates
 +
the total calcium change (i.e., [ca](r)*pi*r*r - t(0)) as a function of distance from the calcium entry site.
 +
Output is printed to stdout.
 +
All input concentrations should be in nM
 +
Each z slice is analyzed separately (i.e., z is assumed to be time) unless image is rectangular and 3D (-R).
  
Usage: em [options]  
+
Usage: total_ca [options] ca.i2i
options:
+
      options for printing graphs of calcium (not concentration) vs. distance from ca entry location:
  -s #: number of states, default = 2. Must specify -t and -p after this.
+
the units for the graph are nM*um^3, but 1nM = .6ions/um^3 , so multiply be .6 to get ions
  -t # # # ... #: state transition probabilities. If there are S states (e.g., -s #)
+
                      (and 1pA = 3,000 ions/msec if you want to convert to pA-msec).
                        order: T[1][1], T[1][2], ... T[1][S], T[2][1] ... T[S][S] if there are S states),
+
        -n: normalize calcium distance graph for each z slice (so sum of amplitudes = 1),
                        where T[i][j] is the probability of a transition from state i to state j.
+
                      (otherwise when graph spacing is changed, -g option, the height of the graph will change).
  -p # # # ... #: prior probabilities of states (S entries if there are S states)
+
  -a:   print absolute calcium, not delta calcium (the default).
  -P #: which prior estimate to use for the pdf of the data (ie., estimate of Poisson process)
+
                      when this is applied to a uniform image it should produce a 4pi*r*r distribution.
        1 = uniform, 2 = delta, 3 = uniform+delta, 4 = peice of observed data histogram (default)
+
            The default, delta calcium, prints the delta (i.e., change) from slice 0 (regardless -z option)
        5 = true pdf (Poisson)
+
        (but delta calcium not calculated if 3D rectangular, i.e., -R specified).
  -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
+
  -p # #: pixel size in microns in the radial (x) and lengthwise (y) directions,
See also: ~/krypton/facil/transpose.pl  to print out selected lines from the output file
+
default =  0.10 and  0.10
          ~/krypton/matlab/netlab: has EM routines
+
  -P # # #: pixel size in microns in x,y,z directions (rectangular not cylindrical coords),
          ~/krypton/matlab/bayes/BNT/HMM: has HMM and EM routines
+
default = ( 0.10, 0.10, 0.10)
/home/lml/krypton/bin/em -h
+
  -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.
  
== Statistics ==
+
see also:
===  cluster_distances.pl  ===
+
    printvals, float2int, in matlab: readxmgr, acurves (see ~lml/krypton/JSinger for an example)
  
  Takes output from channel_current2 (after 11/24/09) and pulls out statistics about
+
source code in ~lml/krypton/Walsh directory.
  mean distance to each BK cluster. Then produces average stats from all the files
+
   
  analyzed. Output to stdout.
+
</nowiki>
 +
=== vcspat-models  ===
 +
  <nowiki>
 +
  argc = 1
  
 +
This program creates a volume image with objects randomly placed
 +
within it.  The mask image defines where an object is allowed to be placed.
 +
The mask value can be changed with the -M option.  Objects can either be individual
 +
voxels (the default) or tiny images (-o option) or connected voxels in an image (-O).
  
usage:
+
Usage:
 +
  vcspat-models [options] mask.i2i out.i2i
  
   -files:file1:file2:...:filen       which files to analyze. Defaults are files named 2_*.currents in cwd.
+
Options:
   -numBKvsProb       also prints numBK vs prob data suitable for xmgrace
+
   -m #    : model number (default 0).
 +
            0 - grid pattern
 +
            1 - random pattern
 +
  -M #    : value of mask pixels (default 1).
 +
  -r #    : number of random points to use in random pattern (default 25000)
 +
  -o name  : image to use at point in pattern (default just turns on a pixel)
 +
(can use up to 256 images - image will be randomly chosen)
 +
   -a : if objects overlap, add their pixel values instead of just replacing
  
 +
Options related to objects:
 +
  -O thresh name.i2i: threshold an image to use for objects. Extracts as an object each
 +
            connected set of voxels above threshold.  Places these  objects randomly
 +
            into the output image (uses each object once). Use with the
 +
            -m 1 option. Do not use the -r option
 +
  -P name.i2i id.i2i: similar to -O option, extracts as an object each of the
 +
    the objects in name.i2i based upon their pixel values (object id) in id.i2i
 +
(e.g., id.i2i was produced via objs_via_ascent). This option preserves the
 +
distinction between objects in name.i2i which may be touching - since simple thresholding is not used.
 +
If only an id.i2i is available (no name.i2i), you can specify -P id.i2i id.i2i
 +
  -v: replace objects (after fitting them into the image) with just the single voxel
 +
at the brightest location in the object.  Only use with -O and -e options.
 +
  -S # #:  minimum and maximum object sizes to allow (use with -O option).
 +
  -e: do not allow (exclude) objects to be placed so that they overlap with each
 +
other, go outside the image, or go outside the mask.  The default is to allow
 +
overlaps and to just zero out that part of an object which goes outside the
 +
image volume or mask.
 +
  -n: number the objects in out.i2i (use with -O or -P options). Rather than all
 +
the pixels in an object being their original values, all the pixels in object 1
 +
will be labeled 1, all those in object 2 labeled 2, etc.  If -e not specied and
 +
objects overlap the first object placed (usually the largest) will prevail.
 +
Can also be used with -v, then output will have the brightest voxel set to object id, others to 0.
 +
The output of this can be analyzed by object_overlap program.
 +
  -N out2.i2i:  create a second output file, number the objects in out2.i2i (like -n).
  
example:
+
OtherOptions
   (channel_current2  .... > file.channel_current) >& file1.currents
+
  -s #    : seed for random number generator (default pid)
   (channel_current2  .... > file2.channel_current) >& file2.currents
+
   -x #    : x increment for grid pattern (default 3)
   cluster_distances.pl -numBKvsProb -files=file1.currents:file2.currents > avg_distances.txt
+
   -y #    : y increment for grid pattern (default 3)
   fgrep -v clusters avg_distances.txt |xmgrace -pipe
+
   -z #    : z increment for grid pattern (default 3)
 +
   -V: verbose
  
  note: mean distances to clusters are not always increasing (e.g., mean distance to 10th
+
note: entire image name (with extension) is required.
      cluster could be SMALLER than the mean distance to the 9th cluster).  I think this
+
note: a - in place of an image name means stdin or stdout.
      has to do with limiting my maximum distance (see comments in this file).
+
Examples:
 +
  objs_via_ascent in1.i2i inid1.i2i
 +
  objs_via_ascent in2.i2i inid2.i2i
 +
  vcspat-models-new -m 1 -M 1 -P in1.i2i inid1.i2i -N outid1.i2i mask.i2i out1.i2i
 +
  vcspat-models-new -m 1 -M 1 -P in2.i2i inid2.i2i -N outid2.i2i  mask.i2i out2.i2i
 +
  object_overlap outid1.i2i outid2.i2i  > obj_overlap
 +
  overlapL out1.i2i out2.i2i > coloc
 +
 
 +
See also: krypton/Qiong/run1,  vcspat, randompuncs, spatial_stats2, objs_via_ascent, countobjs
 +
 
 +
Source code in /storage/big1/lml/jac/was_invitro/Projects/cspat-volume
 +
 
 +
</nowiki>
 +
== Image Analysis ==
 +
===  Corecell.pl  ===
 +
<nowiki>
 +
 
 +
Takes a 3d image and an outline and keeps all data pts within the specified distance
 +
of the outline (removes the "core" of the cell). 
 +
Also produces a file named in_image_H.histo. See help for histogram2 about that.
 +
If in_image2.i2i out_image2.i2i are specied, in_image2.i2i is also cored
 +
(and histogram2 is applied to the pair in_image.i2i and in_image2.i2i when producing in_image_H.histo).
 +
 
 +
Written to let Ronghua only keep BK and Ryanodine label near the plasma membrane.
 +
Note: touching voxels may have a distance of .5 voxels, and voxels at the same
 +
      position may have a distance of -.5 (??)
 +
Note: pixels may be kept near the end of the cell, since they have close distance to the end
 +
      (rather than to the plasma membrane. Might -Z # # option to histogram2 fix this?).
 +
Note: there might be problems if boundary.pts touches the edge of the image.
 +
 
 +
 
 +
Corecell.pl [options] in_image.i2i boundary.pts out_image.i2i [in_image2.i2i out_image2.i2i]
 +
 
 +
options:
 +
-interp interpolate missing z slices in boundary.pts before using it.
 +
zslices must be in ascending order in boundary.pts.
 +
contours must all be drawn in the same direction (i.e., all clockwise or all counter-clockwise).
 +
The name of each object is changed to "nuke"A maximum of 1000 zslices is allowed.
 +
-shrink=#  shrink boundary.pts by this number of pixels before using it
 +
-expand=#  expand boundary.pts by this number of pixels before using it
 +
-zrange=#:#    only examine z slices (1-indexed in this range)
 +
-dist=#: keep all voxels within this distance of the boundary, default = 2
 +
-dx=#          pixel size x size (default = 1. all that really matters is relative x,y, and z size)
 +
-dy=#          pixel size y size (although if you change this then that may affect -dist)
 +
-dz=#          pixel size z size
 +
-dontcapends    first and last outline slices aren't capped (removes -c from the call to histogram2).
 +
        typically you'd use this if the outlines are circular cross-sections of a cylindrical
 +
cell (ie, z is along the length of the cell).  If the outlines are along the length
 +
of the cell (ie, cell is in the xy plane, as Jeff likes to do), then you wouldn't use this option.
 +
-verbose print out extra info to stderr as it goes along
 +
-vverbose very verbose
 +
-keepfiles keep all intermediate files (all begin with _)
 +
 
 +
example:
 +
  #cell's length is in the xy plane, need to flip it to get cross sections to outline with planimeter3
 +
  transp -YZ im.i2i im_YZ.i2i
 +
planimeter3 -I im_YZ.i2i -R im_YZ.pts
 +
  transp -YZ im2.i2i im2_YZ.i2i
 +
  #cell's original zspacing = 250 nm, but x and y are 80, so relative spacing is about 3:1, after transp
 +
  #it is the y direction that has the 250 nm spacing.
 +
Corecell.pl -dy=3 -dist=3 -interp im_YZ.i2i im_YZ.pts im_YZ_near_pm.i2i im2_YZ.i2i im2_YZ_near_pm.i2i
 +
dave -T 1 YZ -T 2 YZ -z 3 -I im_YZ_near_pm.i2i -I im2_YZ_near_pm.i2i
  
 +
see also: shrink_wrap (to apply prior to Corecell.pl to get a better starting surface)
 
   
 
   
  see also:
+
</nowiki>
   channel_current2
+
=== count_2d_objs2.pl  ===
   /home/lml/krypton/Zhuge/BKandRyr/analysis6/run12
+
<nowiki>
   /home/lml/krypton/Huang/Kth_pt.m
+
run countobjs on a 2D time series
   p. 637 of Cressie.  
+
creates temporary files _temp.i2i and _temp.stats in the current directory.
 +
note: scale and black level forces each time point to be rescaled the same and
 +
      therefore to be thresholded the same.
 +
file.stats will have data ordered as:
 +
time number_of_objects mean_iod sd_iod mean_size sd_size
 +
 
 +
count_2d_objs2.pl [options] image.i2i file.stats
 +
 
 +
options:
 +
   -tstart=# first time point to examine, default = 1
 +
  -tstop=# last time point to examine, default = last z slice.
 +
  -min=# minimum size object to allow, default = 1
 +
  -max=# maximum size object to allow, default = 100000
 +
  -thresh=# threshold, default = 0
 +
  -scale=# scale, default = 1
 +
  -black=# black, default = 0
 +
  -allstats=filename print info about each object to _temp.stats (otherwise just summary stats from each t printed)
 +
and rename it "filename"
 +
   -outimage=image.i2i see -o option in countobjs.
 +
   -Outimage=image.i2i see -O  option in countobjs
 +
   -Qimage=image.i2i see -Q option in countobjs, note: id numbers will restart from 1 on each slice.
 +
 
 +
  -verbose
 +
  -dummy
 +
  -noclean
  
 
   
 
   
===  coloc.pl  ===
+
</nowiki>
 +
===  distance2surface_overtime.pl  ===
 +
<nowiki>
  
calls coloc3way with a bunch of different thresholds. Creates an output file which can be
+
Finds the distance (in pixels) of a specified pt (over time) from the nearest pixel
graphed with VennDiagram.m.  
+
greater than 0 in 3Dimage.i2i (or greater than -threshold).  Alternatively, finds
 +
the distance to the boundary surface specified with the -surface option.
 +
The coords is as produced by track_pts (x y z otherstuff).
 +
Written to let Andrea take a tracked gene in the nucleus and find its
 +
distance to the nuclear envelope over time.
 +
Note: touching voxels may have a distance of .5 voxels, and voxels at the same
 +
      position may have a distance of -.5 (??)
  
coloc.pl im1.i2i im2.i2i im3.i2i  > out.coloc3way
+
distance2surface.pl [options] 3Dimage.i2i specifiedpt.coords outfile.dist
  
 
options:
 
options:
-time_vs_thresh just generate a file which shows which times correspond to which thresholds. images can be dummy names.
+
-surface=boundary.pts find distance to the surface defined by boundary.pts
 +
  rather than the distance to nearest >0 voxel 3Dimage.i2i
 +
-shrink=#  shrink boundary.pts by this number of pixels before using it
 +
-expand=#  expand boundary.pts by this number of pixels before using it
 +
-zrange=#:#    only examine z slices (1-indexed in this range)
 +
-threshold=#    threshold 3Dimage.i2i (voxels <= threshold set to 0, > threshold set to boundary).
 +
-pixel=# pixel size (in x and y) in nm
 +
-verbose print out extra into to stderr as it goes along
 +
-vverbose very verbose
 +
-keepfiles keep all intermediate files (all begin with _)
  
-t1=#:#:# threshold one should go from # to # by #. default = 800:1200:50
+
-t2=#:#:# threshold two should go from # to # by #. default = 800:1200:50
+
</nowiki>
-t3=#:#:# threshold three should go from # to # by #. default = 2000:4000:200
+
=== extract_area2.pl  ===
-numthresh=#1:#2:#3  ignore the third number in the -t1, -t2, and -t3 options (or in the default) and instead calculate a
+
<nowiki>
  threshold step size so that #1 thresholds are applied to im1.i2i (dat image)
+
Can't use 'defined(@array)' (Maybe you should just omit the defined()?) at /home/lml/krypton/bin/extract_area2.pl line 85.
  #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
+
</nowiki>
Dr. Melikian is interested in. Graph via xmgr -nxy. See header in file for coloc info.
+
===  findpaths_exo4.pl ===
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)
+
<nowiki>
-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
+
this program takes output from exo4.
(i.e., the denominator used when calculating the percent colocalized).
+
similar to findpaths_exo3.pl, but parses exo4 output rather than exo3 output.
prints to "file.xyr".  Must also specify either -Melikian or -Melikian2
+
 
xmgrace -graphtype fixed -settype xyr file.xyr
+
usage:
-matlab=file:#  like -area but as columns so easy to read into matlab: t p1 n1 p2 n2 p3 n3 p4 n4
+
   findpaths_exo4.pl file1.out
# 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.
+
options:
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
+
which paths:
-verbose
+
  -prestring="# debugpath 3 (102,156,-1):"  pull out paths that begin with this. default is the null string.
 +
    : null string paths should also be saved_paths later.
 +
    : "# debugpath .*:"  will pull out all the debugpaths (. matches any char and * means
 +
    : number of them)
 +
  -saved_paths     :  all the saved paths (within -zrange if that is also specifed)
 +
  -debugpaths     :  all the debug paths.  These options are mutually exclusive.
 +
  -zrange=minz:maxz     :  only print tracks which start within the z range specified (1-indexed, inclusive)  
  
example:
+
what to do with the paths:
 +
  -saved_labels=filename    :  implies -saved_paths. saves labels for each path into the specified filename. This
 +
    :  file can be read into play so that labels are visible at a location.
 +
for rpts file:
 +
  -rptsfile=track.rpts      :  create an rpts file (initially empty). use -rptstracks and -printfusion to put stuff in it.
 +
  -rptstracks     :  put paths (tracks) into the rpts file specified with -rptsfile    
 +
  -printfusion=#     :  print box (of width #) around fusion events to rptsfile. must us -rptsfile option with this.
 +
    :  note: -debugpaths do not have valid fusion times.
 +
  -pathcolor=#     :  instead of -1
 +
  -boxcolor=#     :  color of fusion box. instead of -2
  
coloc.pl im1.i2i im2.i2i im3.i2i > coloc.data
+
for xmgr file:
coloc.pl -time_vs_thresh im1.i2i im2.i2i im3.i2i > coloc.times
+
  -trackxmgr=track.xmgr    :  create an xmgr file of the tracks produced by the program "exo".
matlab
+
  -truetime     :  rather than use z value as "time" calculate time based on the "burst protocol"
>> VennDiagram('coloc.data','percent'# and manually look at coloc.times while doing this to convert times to thresholds.
+
    :  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
  
see also:
+
example:
~/krypton/packages/fiji/Fiji.app/plugins/jacob_.jar  - more traditional colocalization measures
+
  exo4 -d 120 -o adp12273_ids.i2i -V -w 10 -b 2 adp12273_c1_z1201_1320_masked.i2i > & adp12273_c1_z1201_1320_masked.out
coloc_tseries2
+
  play -min 0 adp12273_ids.i2i    # maxima of each region should be blue
colocalizeL
+
  findpaths_exo4.pl -trackxmgr=adp12273.xmgr -truetime adp12273_c1_z1201_1320_masked.out
 +
  xmgr adp12273.xmgr    #clicking on each set brings up its legend info which has its
 +
        #starting coord (1-indexed I think) and value.
 +
  findpaths_exo4.pl -rptsfile=adp12273.rpts -rptstracks -printfusion=4 adp12273_c1_z1201_1320_masked.out
 +
  addlines adp12273_c1_z1201_1320_masked.i2i adp12273.rpts - | play -P -1 R -P -3 G -
  
 +
see also:  ~lml/krypton/Huang/TIRF4/graph_exo3.csh
 
   
 
   
===  probcircle.pl  ===
+
</nowiki>
  given a sphere of diameter D, what is the prob of oberving a disk of radius r when a random plane intersects it?
+
===  get_find_vesselness_results.pl  ===
  prints to stdout: r prob(r) 1/prob(r)
+
<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.
  
   usage:  
+
</nowiki>
      probcircle.pl [options]  
+
===  mask_and_coloc.pl  ===
 +
<nowiki>
 +
Takes a threshold, x and y translation for vinculin image, a pts file, and two images, and creates a mask
 +
and then calculates colocalization. See README.
 +
 
 +
mask_and_coloc.pl -x=# -y=# -thresh=# -pts=file.rpts -vin=vin.i2i -trip=trip.i2i
 +
 
 +
options:
 +
  -tx=# translate by a max of -tx when calculating other colocalization numbers, default = 25
 +
  -ty=#
 +
  -step=# step size for other translations, default = 5
 +
  -noclean don't clean up (ie, don't remove) intermediate files created during this analysis
 +
  -overlap=file   just calculate overlap3, reusing the other files, put result into file.
 +
 
 +
 +
</nowiki>
 +
===  mask_gedmat_images4.pl  ===
 +
<nowiki>
 +
  mask_gedmat_images4.pl  -check_intersect  added.
 +
determines when outlines intersect and sets the aerr (area error flag) in the
 +
output file. eventually it will calculate areas a different way when that happens
 +
rather than combining masked images (see ~/krypton/Corvera/Raz/README for 10/18/13). not done yet ...
 +
 
 +
  Examines all the zip files (produced within fiji when outlining regions) in the current directory. These have
 +
  the boundary of the explant, day7 growth, and day11 growth.
 +
  note: this program assumes that all the data in the directory is from the same patient and the same tissue type.
 +
 
 +
  It recalculates the area measures by only including that part of the day7 and day11 growth which is between the explant
 +
  center and going towards the center of the well; area from the explant center going away from the center of the
 +
  well (ie, growing towards the well wall) is excluded. By doing this, we hope to minimize the
 +
  effect of growth (as measured by area) being stopped by the well wall when the explant is near the well wall. 
 +
  Output is written to stdout. The comments there explain the fields. area_mex is the old value, area_mex_border is the new.
 +
 
 +
  This is done by finding all the *_Area.zip files in the current directory, pulling out the outlines in those files
 +
  and using that information to recalculate areas.  It also needs to find the associated "combined" image file
 +
  (*_combined.i2i) to get image size and hence the position of the center of the well) and the fiji results file
 +
  (*_results.txt, so the numbers produced here can be easily compared with them).
 +
 
 +
  note: The algorithm assumes that the area NEVER DECREASES with time, and that the explant region is always surrounded
 +
by the day7 region which is surrounded by the day11 region. The latter assumption is sometimes invalid if
 +
the day 11 images were shifted relative to day 7 images; but that is usually ok.
 +
(if necessary, you can manually change the "bad_data" field in the output file to 1 and then use
 +
-cond in gedmat_to_xy.pl to eliminate those stats from further analysis.)
 +
It also assumes the smallest area in each zip file is the original explant area, the next largest area is
 +
called day7 area and the largest area (if 3 are present) is assumed to be day 11 area.
 +
Sometimes when growth is about 0, the outlines on, eg, day7, may have slightly less area than the original
 +
explant, so the outlines might be mis-ordered then. [actually it may read the correct day off the name of
 +
the i2i image now].
 +
 
 +
  note: If only 2 areas (ie, two .roi files) are present in the zip file, they are assumed to be for
 +
the explant and day7 (not day11).
 +
 
 +
  note: This program assumes the center of the combined image (usually 4 well images are combined into one) is the
 +
center of the well. see combine_images.pl. It also assumes the combined image name ends in combined.i2i
 +
(see -combined).
 +
 
 +
  note: some of the scripts I use to then analyze these results will multiply the area by 2, to get a "true" estimate
 +
  of growth; since the value produced by mask_gedmat_images3.pl will be (roughly) half of the real growth rates.
 +
 
 +
   usage:
 +
mask_gedmat_images3.pl [options]  
  
 
   options:
 
   options:
-D=# default = 1
+
-tmpdir=fullpathname directory to use for temporary files which are created, eg: -tmpdir=/home/lml/krypton
-just_prob don't print the third column
+
 
 +
-zip_file=file.zip
 +
-zip_file=file.zip:file2.zip:...:filen.zip
 +
only examine the one specified zip file, not all those in the directory
 +
(If the second form is used, you can specify as many as you want.)
 +
note: you may still need to specify -zip_ending so that the ending of this file can be stripped
 +
      off correctly (so the -combined_ending and -results_ending can then be added correctly).
 +
-zip_ending=stuff e.g., -zipending=_area.zip  .  All files which end in this will be analyzed; default = _Area.zip
 +
-skip=file.zip[:file2.zip...]  list of zip files (without the full path) to skip.
 +
 
 +
-results_ending=stuff e.g., -results_ending=_results.txt  .  This is what the -zip_ending should be replaced by
 +
to get the name of the associated fiji results file.  note the _ should be included here
 +
if it was included in -zip_ending.
  
  examples:
+
-combined_ending=stuff  e.g., -combined_ending=_combined_reduced_.i2i  . default = combined.i2i.
      probcircle.pl | xmgrace -free -pipe -nxy -
+
This is any string which helps identify the last part of the combined image filename.
 +
-combined_scaling=#:# e.g., -combined_scaling=2:2 if reduceima -bin 2 2 was applied to get _combined_reduced_.i2i.
  
  see also: p. 249 stereology_book.pdf
+
-scale=#:# distance and area (eg, -scale=2:4 if reduceima -bin 2 2 was used) scaling. This will multiply
    /home/lml/krypton/packages/fiji/stereology_lml.template
+
the area stored in the fiji file and the area calculated via my mask by the second number.
    /home/lml/krypton/Corvera/Raz/stereology/plot_results.pl
+
The first number will multiply the distance of the explant from the center of the image.
    /home/lml/krypton/facil/cross_sections_of_sphere
+
This option is just here to handle 001_BAP and 002_PRO datasets. They were analyzed in fiji
 +
with the images reduced by a factor of 2 in x and y. So the fiji areas produced will be low
 +
by 4x, as will my areas.  This option compensates for that.  See ~/Corvera/Raz/README for 10/11/13.  
  
   
+
-check_intersect check if outlines intersect with the explant's outline. If so, set an error flag on stdout printout
===  compare2dist  ===
+
and print info to stderr. eventually will just use area numbers rather than masking area in this situation.
 +
that is not done yet ...
  
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:
+
-save_day[=directory]
    time calcium prior_baseline post_baseline amplitude
+
saves the final binary mask for each days growth (eg, day7 growth minus the explant and minus the part growing towards the wall)
      where the values are
+
into a 3d mask image (patientid_tissue_day#_mask.i2i).  This image will be reduced down in xdim and ydim from the
      time:           time of STOC
+
original.  patientid_tissue_day#_.play_labels will also be created (labels which well each z slice comes from).
      calcium:        SR calcium level
+
This is mostly for quality control purposes.
      prior_baseline: amplitude just prior to STOC
+
In addition, patientid_tissue_day#.rpts will be created (similarly reduced down in size) (coords may be off by 1?).
      post_baseline:   amplitude just after STOC
+
View the file via: addlines maskim.i2i maskim.rpts -  |play.FC14 -P -1 R -labels maskim.play_labels -
      amplitude:       amplitude amplitude of STOC (not relative to baseline)
+
  or via: play_results3.pl
Data is expected to already be sorted by time (smallest to largest).
+
patientid_tissue_day#_orig.i2i will be the original images (also reduced in xdim and ydim, and only one 2d slice
comment lines must begin with a #
+
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
  
Usage: compare2dist [options] datafile1 datafile2
+
-just_check just check whether each zip roi outline has the correct number of associated image files.  
options:
+
eg, if the zip file has 3 outlines (explant, firstday, secondday) there should be two i2i files with DAY# in their name.
    -t #: only include data with an amplitude > #. The default
+
prints to stderr info about those which don't have the correct number. does nothing else.
is to assume a 0 threshold. If you have acquired the data
+
-verbose some extra info to stdout
using some thresholding criterium (eg, only peaks above
+
-debug prints some tracing info to stderr
10picoamps are counted) then you should provide that number
+
-print_fname print name of each zip file as it is being analyzed, to stderr.
here, even if all your data is above this (ie, you've applied
+
-dlevel=# extra debugging. the bigger the number the more the printout. # is an integer starting at 1.
the threshold in your identification phase). This is because
+
-dlevel=1 will print a trace of commands to execute to mimic (parts of) this perl script.
we need to know it when we shift amplitudes of the second
+
-noclean don't remove the temporary files which were created
distribution to see if it could match the first distribution.
+
the files are: _ones.i2i _explant.rpts _day11.rpts _day7.rpts _excluded_region.rpts
    -b: subtract average baseline from amplitude prior to use (ie, prior
+
      _explant.i2i  _day11.i2i _day7.i2i _day7_noex.i2i _day11_noex.i2i _day7_noex_halfex.i2i _day11_noex_halfex.i2i
to any thresholding or intensity shifting of data).
+
  (if multiple zip files were analyzed, only the files from the last one will be left, since they get reused)
    -s delta max: shift datafile2 amplitudes down by a maximum of max, in
+
-dont_recalc only for diagnostics. does NOT restrict the analysis to just the growth away from the wall.
increments of delta, to see if it will then match datafile1.
+
with this specified this entire program should just reproduce the numbers we already
  -p #: our guess of the percentage of data missing from datafile2 because it was
+
have in *Results.txt since that uses the entire area. ie, this make the program a no-op.
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 datafile1The 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
+
  see also:
This code is in ~lml/vision/Rhonghua/STOCS
+
/home/lml/krypton/Corvera/Raz/README
#/home/lml/krypton/bin/compare2dist
+
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
  
=== compare2gaussian  ===
+
  examples:
incorrect command line, need 1 data files.
+
cd /storage/big1/raz/GEDMAT/006_JTH/OM
This program calculates whether a given set of data could be samples from a known mixture of Gaussians.
+
 
datafile should have one data point per line. comment lines begin with #.
+
# generate 006_JTH_OM.areas with all the data (area_mex_border is the number which should replace farea)
Output statistics to stdout.
+
# 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 -
  
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
+
# 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 -
  
Source code is in ~lml/krypton/Lefkowitz
 
#/home/lml/krypton/bin/compare2gaussian
 
  
===  compare_dist2  ===
+
# 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 distributions are the same using chi-square test (unless -k).
 
It was written to examine the distribution of sizes of Ryanodine Receptor objects
 
to determine if they are randomly distributed. datafile1 should be the reference
 
data (gotten from many simulations or from a theoretical formula), datafile2
 
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).
+
  source code: in /home/lml/krypton/bin/mask_gedmat_images.pl
Comment lines must begin with a #
 
Floating pt numbers are truncated to integers for bin number (max bin number = 50000).
 
  
Usage: compare_dist2 [options] datafile1 datafile2
+
options:
+
</nowiki>
  -k perform K-S test instead (I'm not certain the numbins I use to calculate this is correct).
+
===  mask_gedmat_images4_new.pl  ===
  -a also print the histograms produced
+
<nowiki>
  -b also print the normalized histograms (total count datafile2 scaled to the same count as in datafile1,
+
  mask_gedmat_images4_new.pl
  bins with 0 removed), this is only done if -k not specified (ie, only if performing chi-square test).
+
The easiest way to call this is via analyze_gedmat9.pl, see its help.
  -c also print the cumulative prob distributions (only done if -k also specified)
+
   
  -r # #: only analyze sizes within the specified range (inclusive)
+
This version has the following changes compared with mask_gedmat_images3.pl:
  -m #: cap the maximum number of counts for any size in datafile1 to #
+
 
  -M #: cap the maximum number of counts for any size in datafile2 to #
+
1. @stats = &outline_stats(@outline) was used to calculate explant center (for masking) but
  -z: for chi-square keep zero entry bins (chi square only correct if this option is NOT used)
+
        the meanx and meany are just the mean of the outline, it is NOT a center of mass. usually ok for a compact explant.
so why is this option here?  if you just really want to use this program to do
+
  sub calc_com() is now used instead to calculate the true center of mass.  
histogram normalization (-b), and don't care about the stat. xmgrace running avg
+
-use_explant_outline will cause the OLD method to be used instead.
will produce strange results if you don't use -z, ie, if data not equally spaced.
+
 
  -v verbose
+
2.  bounding box was used to calculate area for sorting the outlines temporally (from smaller to larger area).  
  -V very verbose
+
      but when outlines intersect bounding box can at times NOT be a good surrogate for area.
example:
+
  $roi_area[$r] = ($maxx-$minx)*($maxy-$miny)
      create a simulated distribution and compare it with real restored data (real_ryrr.i2i, run5 does this 100 times):
+
  handled these two issues by writing sub calc_com().
  cluster -wsize 10 43 25 -cylinder 0.001 3 -psize 0.08 0.08 0.25 -mindist 0.030 -numryr 500 -image ryr.i2i
+
-use_bbox_area will cause the OLD method to be used instead.
  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
+
note: fiji areas are already sorted smallest to largest when I first bring them in (extract_area2.pl does that):
  setenv eprloc /storage/big1/epr/queues
+
  $prev_results = `extract_area2.pl -justfiles=$resultsfile`
  echo "  /storage/big1/epr/run_epr -V -log -NSC 4 -sm 1e-05 -it 5000 -sc 0.025 -co 0.001
+
  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
-psf ${myloc}/psf.i2i ${myloc}/ryr_bn.i2i ${myloc}/ryr_bnr.i2i " > /storage/big1/epr/queues/standard/lml.0
+
  being sorted based on bounding box, and fiji areas based on the true area in the Results.txt file. So the ordering
  while (1==1)  if ( ( ! -e ${eprloc}/standard/lml.0 ) && ( ! -e ${eprloc}/running/lml.0 ) ) then break endif sleep 60s end
+
  may be different at times. No change was made to this.
  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
+
  mask_gedmat_images4.pl  -check_intersect  added.
This code is in /home/lml/krypton/Zhuge/Ryr_clusters/
+
determines when outlines intersect and sets the aerr (area error flag) in the
#/home/lml/krypton/bin/compare_dist2
+
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.
  
===  correlationL ===
+
  Examines all the zip files (produced within fiji when outlining regions) in the current directory. These have
/home/lml/krypton/bin/correlationL
+
  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 plots intensities from image1 vs intensities from
+
  This is done by finding all the *_Area.zip files in the current directory, pulling out the outlines in those files
image2. image1 on the x axis, image 2 on the y axis. Intensities
+
  and using that information to recalculate areas. It also needs to find the associated "combined" image file
in both images are rescaled 0 to the size of the output image
+
  (*_combined.i2i) to get image size and hence the position of the center of the well) and the fiji results file
(default = 512).  The intensity at each pixel in the output
+
  (*_results.txt, so the numbers produced here can be easily compared with them).
image is the number of (image1,image2) voxels with that particular
+
 
intensity combination.
+
  note: The algorithm assumes that the area NEVER DECREASES with time, and that the explant region is always surrounded
The intent is to be able to look at the output image and get a sense
+
by the day7 region which is surrounded by the day11 region. The latter assumption is sometimes invalid if
for whether there is a correlation between intensities
+
the day 11 images were shifted relative to day 7 images; but that is usually ok.
in the two images.  If so, perhaps a least squares line
+
(if necessary, you can manually change the "bad_data" field in the output file to 1 and then use
fit should be done to see how well one images correlates with the
+
-cond in gedmat_to_xy.pl to eliminate those stats from further analysis.)
other, or -s option can be specified.
+
It also assumes the smallest area in each zip file is the original explant area, the next largest area is
The minimum, maximum, and scale factors are printed to stdout.
+
called day7 area and the largest area (if 3 are present) is assumed to be day 11 area.
Version 1.1
+
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: correlation [options] im1.i2i im2.i2i out.i2i
+
  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).
  -d xdim ydim: output dimensions of new image
 
(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
+
  note: This program assumes the center of the combined image (usually 4 well images are combined into one) is the
any voxels in image2 >= val2.
+
center of the well. see combine_images.pl. It also assumes the combined image name ends in combined.i2i
 +
(see -combined).
  
  -r: instead of intensities, use the rank
+
  note: some of the scripts I use to then analyze these results will multiply the area by 2, to get a "true" estimate
order of the intensities.
+
  of growth; since the value produced by mask_gedmat_images3.pl will be (roughly) half of the real growth rates.
  -a: automatically calculate the size of the
 
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:
+
  usage:
    # to apply this to a set of 3D images, using the same scales and size images for easy comparison
+
mask_gedmat_images3.pl [options]
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
+
  options:
produces two images. One image is a percent colocalization image
+
-tmpdir=fullpathname directory to use for temporary files which are created, eg: -tmpdir=/home/lml/krypton
and the other is a probability image.  The overlap program MUST be
 
run via the "many_overlaps" command.  The probability calculations
 
are the same as those performed by "probcolocal", but only -n
 
needs to be specified since the other values are automatically
 
extracted from the file produced by "many_overlaps".
 
  
The percent image is the percent of voxels above threshold in image1
+
-zip_file=file.zip
(as originally specified to "many_overlaps") which overlap with
+
-zip_file=file.zip:file2.zip:...:filen.zip
voxels above threshold in image2. A 100 in the output image = 100 percent.
+
only examine the one specified zip file, not all those in the directory
The probability of observing as much (or more) overlap as we did due to  
+
(If the second form is used, you can specify as many as you want.)
random chance is the prob.i2i image.  Probabilities are mulitplied by 100.
+
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.
  
Position along the y-axis (vertical axis) of the image, corresponds to
+
-results_ending=stuff e.g., -results_ending=_results.txt This is what the -zip_ending should be replaced by
thresholds for image2. The x-axis represents image1 thresholdsThe
+
to get the name of the associated fiji results file. note the _ should be included here
lowest threshold is the bottom left cornerSee the first line in
+
if it was included in -zip_ending.
your datafile for the range of thresholds this represents.
 
Overlap produces statistics for a range of allowed overlaps.
 
Create_images, by default, chooses an overlap within 1 voxel.
 
If you want to use a different overlap distance use the -o option.
 
  
See also: overlap, probcolocal, many_overlaps
+
-combined_ending=stuff  e.g., -combined_ending=_combined_reduced_.i2i  . default = combined.i2i.
 +
This is any string which helps identify the last part of the combined image filename.
 +
-combined_scaling=#:# e.g., -combined_scaling=2:2 if reduceima -bin 2 2 was applied to get _combined_reduced_.i2i.
  
Usage:
+
-scale=#:# distance and area (eg, -scale=2:4 if reduceima -bin 2 2 was used) scaling. This will multiply
create_images [options] datafile percent.i2i prob.i2i
+
the area stored in the fiji file and the area calculated via my mask by the second number.
options:
+
The first number will multiply the distance of the explant from the center of the image.
  -o distance:    voxels within this distance count as overlapped.
+
This option is just here to handle 001_BAP and 002_PRO datasets. They were analyzed in fiji
  -n number:    number of voxels (1000000 default), see probcolocal.
+
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.  
  
Examples:
+
-check_intersect check if outlines intersect with the explant's outline. If so, set an error flag on stdout printout
  many_overlaps -t 100 1000 100 -T 100 1000 100 alpha_T.i2i beta_T.i2i tmp_output
+
and print info to stderr. eventually will just use area numbers rather than masking area in this situation.  
  create_images -n 363264 tmp_output percent.i2i prob.i2i
+
that is not done yet ...  
 
== Analysis of Points ==
 
===  components.pl  ===
 
  
Calculates the number of connected components resolved over a range of point densities.
 
  
components.pl [options]
+
-save_day[=directory]
 +
saves the final binary mask for each days growth (eg, day7 growth minus the explant and minus the part growing towards the wall)
 +
into a 3d mask image (patientid_tissue_day#_mask.i2i).  This image will be reduced down in xdim and ydim from the
 +
original.  patientid_tissue_day#_.play_labels will also be created (labels which well each z slice comes from).
 +
This is mostly for quality control purposes.
 +
In addition, patientid_tissue_day#.rpts will be created (similarly reduced down in size) (coords may be off by 1?).
 +
View the file via: addlines maskim.i2i maskim.rpts -  |play.FC14 -P -1 R -labels maskim.play_labels -
 +
  or via: play_results3.pl  
 +
patientid_tissue_day#_orig.i2i will be the original images (also reduced in xdim and ydim, and only one 2d slice
 +
from each original 3d image).
 +
note: older versions of play may need the comment line at the top of maskim.play_labels removed.
 +
note: if you want images to be in another directory, specify a full pathname, eg -save_day=/home/lml/krypton (without last /).
 +
note: any existing file with these names will be OVER-WRITTEN.
 +
note: this option creates lots of temporary files (in tmpdir) of the form __*.i2i, any existing
 +
      files that match this will be DELETED.
 +
see also: montage
  
options:
+
-patient5 patient5 files have some odd naming. use this option if analyzing them.
  
-numpts=low:hi:delta
+
-use_explant_outline legacy. specify this if you want the center of the explant to be based on the average of the pixel positions
-repeat=# number of times to repeat at each point density
+
of just the pixels along the boundary (rather than the center of mass).
-res=# in microns
+
-use_bbox_area legacy. specify this if you want to order the outlines based on their bounding box area rather than their true area.
-outfile=name name of output file. otherwise to _tmp. always need write permission in current directory.
+
You should probably specify both options (if you want either one), I'm not sure about consistency if only one is specified.
  
   
+
-just_check just check whether each zip roi outline has the correct number of associated image files.
=== convex_hull.pl  ===
+
eg, if the zip file has 3 outlines (explant, firstday, secondday) there should be two i2i files with DAY# in their name.
 +
prints to stderr info about those which don't have the correct number. does nothing else.
 +
-just_stats goes a bit further than -just_check (does that too), sets -verbose and prints out stats about each outline. then exits.
 +
-verbose some extra info to stdout
 +
-debug prints some tracing info to stderr
 +
-print_fname print name of each zip file as it is being analyzed, to stderr.
 +
-dlevel=# extra debugging. the bigger the number the more the printout. # is an integer starting at 1.
 +
-dlevel=1 will print a trace of commands to execute to mimic (parts of) this perl script.
 +
-noclean don't remove the temporary files which were created
 +
the files are: _ones.i2i _explant.rpts _day11.rpts _day7.rpts _excluded_region.rpts
 +
      _explant.i2i _day11.i2i  _day7.i2i _day7_noex.i2i _day11_noex.i2i _day7_noex_halfex.i2i _day11_noex_halfex.i2i
 +
  (if multiple zip files were analyzed, only the files from the last one will be left, since they get reused)
 +
-dont_recalc only for diagnostics. does NOT restrict the analysis to just the growth away from the wall.
 +
with this specified this entire program should just reproduce the numbers we already
 +
have in *Results.txt since that uses the entire area. ie, this make the program a no-op.
 +
 
 +
  see also:
 +
/home/lml/krypton/Corvera/Raz/README
 +
analyze_gedmat3.pl a script which calls mask_gedmat_images3.pl for all of Raz's data. Also versions 4,5,6, and 7.
 +
play_results3.pl
 +
raz_rates.pl
 +
mask_gedmat_images.pl
 +
mask_gedmat_images2.pl
 +
/storage/big1/raz/GEDMAT/
 +
ReadROI.pl
 +
extract_area.pl
 +
combine_images.pl
 +
gedmat_to_xy.pl
 +
/home/lml/krypton/Corvera/Raz/analyze_gedmat.pl
 +
chres_rpts.pl
 +
  filter_rptsinz.pl
 +
 
 +
  examples:
 +
cd /storage/big1/raz/GEDMAT/006_JTH/OM
 +
 
 +
# generate 006_JTH_OM.areas with all the data (area_mex_border is the number which should replace farea)
 +
# also produce 006_JTH_OM_7masks.i2i and 006_JTH_OM_11masks.i2i so I can check on the validity of the algorithm.
 +
# place diagnostic mask images in /home/lml/krypton/Corvera/Raz/output and the output data file in
 +
# /home/lml/krypton/Corvera/Raz (note: all directories must already exist).
 +
mask_gedmat_images.pl -tmpdir=/home/lml/krypton/Corvera/Raz/output  -zip_ending=_Area.zip -results_ending=_Results.txt
 +
-combined_ending=combined.i2i -days=7:11
 +
-save_day=/home/lml/krypton/Corvera/Raz/output
 +
>& /home/lml/krypton/Corvera/Raz/006_JTH_OM.areas
 +
 
 +
# look at the masks produced:
 +
cd /home/lml/krypton/Corvera/Raz/output
 +
      play_results3.pl 006_JTH_OM_day7
 +
or:
 +
fgrep -v # 006_JTH_OM_11masks.play_labels > tmp.play_labels  # eliminate the comment line, play doesn't like those.
 +
play -labels tmp.play_labels 006_JTH_OM_7masks.i2i
 +
 
 +
# compare the full areas produced which what fiji did (as a check). only pull out the good data. they should be very similar:
 +
cd /home/lml/krypton/Corvera/Raz
 +
gedmat_to_xy.pl -cond='if (($date eq "date_sure")&&($perr==0)&&($aerr==0)) {1;} else {0;}'
 +
-xcoord='$area' -ycoord='$farea' 006_JTH_OM.areas | xmgrace -free -pipe
 +
 
 +
# now grab the data we really want. compare the old way, with the area when the growth half near the well border is masked off:
 +
gedmat_to_xy.pl -cond='if (($date eq "date_sure")&&($perr==0)&&($aerr==0)) {1;} else {0;}'  
 +
-xcoord='$area_mex' -ycoord='$area_mex_border' 006_JTH_OM.areas | xmgrace -free -pipe
 +
 
 +
# it may be hard to see some of these images as they are very large, do it this way (note the -L to keep the -1 boundary values):
 +
addlines _ones.i2i _excluded_region.rpts - | reduceima -bin 3 3 -L - -|play -P -1 R -P -2 G -P -3 B -P -4 C -P -5 Y -
  
This program takes an object outputfile (unless -rptsin or -tripletsin) produced by countobjs (or maskobjs) and finds the minimal
 
spanning tree connecting the center of mass of the objects, and the convex hull. Writes out connections as an rpts file to stdout.
 
It also loops through 20 thresholds  for the pts, and prints to stderr some stats about the minimal spanning tree and
 
convex hull of the points above each of these thresholds.
 
  
Options can be used to only selected a subset of the objects and to constrain the maximum distance (-maxdist).  
+
# 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 -
  
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
 
convex hull area, so that when the threshold rises high enough, only maxima inside the cell will still be present and hence
 
the convex hull will be stable and of much smaller area.
 
  
This program requires perl modules Graph::Kruskal and Math::Geometry::Planar, use cpanp to install these:
+
# do a bunch of stuff
    yum install perl-CPANPLUS-0.91.3-202.fc16.noarch   - for cpanp
+
analyze_gedmat3.pl # apply this perl script to lots of data
    cpanp -i Graph::Kruskal
+
cd output
    cpanp i Math::Geometry::Planar
+
      play_results3.pl 006_JTH_OM_day7   # look at some of it
 +
raz_rates.pl # generate stats
 +
  
usage:
 
  convex_hull.pl -tripletsin file1.triplets  > file1_mst.rpts
 
  
   input options:
+
   source code: in /home/lml/krypton/bin/mask_gedmat_images.pl
    -dx=#   spacing in the x direction, default = 1
 
    -dy=#   spacing in the y direction, default = 1
 
    -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)
+
</nowiki>
    -iod1=min:max   min and max object iod allowed for file1.objs (inclusive), or intensity if -tripletsin was specified.
+
===  membrane3D.pl  ===
    -maxdist=#: :  don't allow connections between pts further apart than this distance (after applying dx, dy, dz spacing factors).
+
<nowiki>
  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.
+
A script to run the routines necessary to perform 3D membrane segmentation.
    default maxdist is  3000
+
note: it needs write permission in the directory where inputimage.i2i resides since all output images go there too.  
 +
It will run the following programs, in order:
 +
  1. /home/lml/krypton/facil/i2i2mhd (convert to mhd format)
 +
  2. /home/lml/krypton/segmentation/MR-Source/ACME/ACME-Binary/bin/cellPreprocess (median filter, fill holes)
 +
  3. /home/lml/krypton/segmentation/MR-Source/ACME/ACME-Binary/bin/resample (resample pixel sizes)
 +
  4. /home/lml/krypton/segmentation/MR-Source/ACME/ACME-Binary/bin/multiscalePlateMeasureImageFilter  (determine the planarity of each region)
 +
  5. /home/lml/krypton/segmentation/MR-Source/ACME/ACME-Binary/bin/membraneVotingField3D (update planarity based on neighbors voting)
 +
  6. /home/lml/krypton/segmentation/MR-Source/ACME/ACME-Binary/bin/membraneSegmentation  (produce segmented regions via a watershed algorithm)
 +
Each program expects input files of a certain type (e.g. unsigned char).
  
  output options:
 
    -addlines :  output rpts format which addlines is more likely to be happy with (may not work in dave?)
 
    -hist :  calculate histogram of distances (hist[int(dist)]++, where int just truncates to integer). obsolete.
 
    -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.  obsolete.
 
    -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.
 
-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:
+
usage:
    -silent :  suppress warning messages.
+
  membrane3D.pl [options] inputimage.[i2i|mhd|mha] outimage.mhd
    -verbose
 
-debug
 
  
example:
+
output files:
   convex_hull2.pl -tripletsin -jack=jack.rpts:5 -addlines -twod -maxdist=100 file1.triplets  > file1_mst.rpts
+
   inputimage.mhd produced by i2i2mhd  - short ints
   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 -
+
  inputimage_med.mhd produced by cellPreprocess
 +
  inputimage_med_resamp.mhd produced by resample, unsigned char
 +
  inputimage_med_resamp_planar.mhd produced by multiscalePlateMeasureImageFilter, floating pt (doubles) between 0 and 1, how "planar" a pt is.
 +
   inputimage_med_resamp_eigen.mhd produced by multiscalePlateMeasureImageFilter, an eigenmatrix at each pt
 +
  inputimage_med_resamp_eigen_voting.mhd produced by membraneVotingField3D, result of voting, unsigned char
 +
  outimage.mhd produced by membraneSegmentation, result of watershed, each region labeled with an id (short integer).
  
 +
note: all units below are in the same units as the pixel units (I think). So if pixel spacing is 2 (um) in x, and a radius
 +
      of 2 is specified, that is a one pixel radius.
  
see also:
+
step 1. options for converting i2i to mhd:
   convex_hull, objs2mst.pl
+
  -convert=dx:dy:dz   The first step is converting our i2i format to mhd format. This specifies the pixel spacing
   objs2bb.pl, objs2dist.pl, objs2dist121.pl, closest_object, closest_voxel, countobjs, maskobjs, objs_via_ascent
+
in x y and z directions for that. default assumes 1:1:1. The "conversion" really just creates inputimage.mhd which
  resolve_pts
+
is a text header which points to the original i2i image and gives some info about it.    
 +
If the input image has a .mhd or .mha extension already (instead of .i2i) then no conversion is done.
 +
Olga's images acquired with a 10x objective have a pixel size of .645 um/pixel (and z spacing of 10 um).
 +
Example: G03_x_1_1_binned.i2i has a pixel size of 2.5x2.5x10.  So -convert=2.5:2.5:10 specifies this in the mhd header.
  
+
step 2. options for cellPreproces:
===  objs2alldists.pl  ===
+
this may produce an unsigned char image (?)
Like obs2disp.pl but calculates the distance to ALL the objects (within -maxdist), not just the closest.
+
   -median=# radius of median filtering preprocessing (and hole filling). If this is not specified it isn't done.
See ~/krypton/Zhuge/grants/AsthmaRO1/README for 5/27/11 and /home/lml/krypton/Zhuge/BKandRyr/analysis6/run18
 
   (which did NOT use this).
 
  
This program takes 2 object outputfiles produced by countobjs (or maskobjs) and finds the shortest distance
+
step 3. options for resampling:
from the center of mass of objects in file1.out to the center of mass of objects in file2.out.
+
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.
  
If both file arguments are the same (e.g., objs2dist.pl file1.out file1.out >file.dist), you can use this
+
  note: it may be necessary to do the above operations, which also convert the image into unsigned char, which is required for
routine to find the distances between objects within an image (an object match with the same id is automatically
+
step 4, multiscalePlateMeasureImageFilter?
ignored in this case so objects don't match to themselves). See also the option -skipsame.
+
  note: step 6 (watershed) may also work best if the pixel sizes are the same in all directions.
  
(modified from /storage/big1/lml/was_voxel/Corvera/track/objs2bb.pl)
+
step 4. options relating to planarity:
 +
the planarity image produced will be doubles from 0-1.
 +
  -planar=# the sigma of the Gaussian used when classifying pixels as planar or not. default = 1
 +
  -alpha=# see the help for /home/lml/krypton/segmentation/MR-Source/ACME/ACME-Binary/bin/multiscalePlateMeasureImageFilter
 +
  -beta=# ditto
 +
  -gamma=# ditto
 +
  -c=# ditto
 +
  -planaropts="options for multiscalePlateMeasureImageFilter here" 
 +
available options (so far, but anything specified here will be passed), : -a # -b # -g # -c # -d -s -B -T
 +
options which go here should be specified in the format that multiscalePlateMeasureImageFilter wants them,
 +
for example: -planaropts="-c 5 -d -B"
 +
not in the alternative format that Membrane3D.pl desires (e.g. -planaropts="-a 5" is correct, -planaropts="-alpha=5" is wrong).
 +
    -stop_after_planar don't do anything after this step (e.g. voting for planar patches may not make sense if -B or -T specified)
  
usage:
+
step 5. options relating to voting:
  objs2alldists.pl file1.out file2.out >file.dist 
+
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
  
options:
+
step 6. options relating to watershed segmentation:
  -dx=# :  spacing in the x direction ,default = 1
+
The resulting image will be long ints (id numbers) of regions.  
  -dy=# : spacing in the y direction ,default = 1
+
                See the help for /home/lml/krypton/segmentation/MR-Source/ACME/ACME-Binary/bin/membraneSegmentation
  -dz=# :  spacing in the z direction ,default = 1
+
  -thresh=# threshold value. this is applied to the tensor voting image to turn it into a binary image. then a distance
  -size1=min:max :  min and max object size allowed for file 1 in pixels (inclusive)
+
transform and watershed are applied. default = 128
  -size2=min:max :  min and max object size allowed for file 2 in pixels (inclusive)
+
  -segopts="options for membraneSegmentation here"   
  -iod1=min:max :  min and max object iod allowed for file 1 (inclusive)
+
for example:  -segopts="-S -l 20 -a 5 -c -D" will use this exact string as options.
  -iod2=min:max :  min and max object iod allowed for file 2 (inclusive)
+
options so far: -S -l # -a # -s # -n -i # -w # -m # -c -v -d -D
  -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 egdave -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
 
  
 +
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:
 
example:
  countobjs -k -t 2000 2000 wave1.objs wave1.i2i
+
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
  countobjs -k -t 2000 2000 wave2.objs wave2.i2i
+
# -convert: just put correct pixel size info into an mhd header
  objs2dist.pl wave1.objs wave2.objs > wave1and2.dist
+
# -median:  smooth with a filter 10 um (4 pixels, since they are now 2.5um/pixel) in radius (diameter?)
 +
# -resample: change to a square pixel (10 um in x y and z). Change image format to unsigned char (needed by MultiscalePlateMeasureImageFilter)
 +
# -planaropts: options for planarity filter
 +
# -region:  width (in um) of neighbors for voting on planarity and updating it.
 +
# -segopts:
 +
# -thresh:  threshold for watershed segmentation
 +
membrane3D.pl -convert=2.5:2.5:10 -median=10 -resample=2:2:1 -planaropts="  " -region=50 -segopts="  "  -thresh
 +
G03_x_1_1_binned.i2i G03_x_1_1_results.mhd
  
see also:
+
see also: /home/lml/krypton/segmentation/MR-Source/ACME/lmltest/README
  objs2dist121.pl, closest_object, closest_voxel, countobjs, maskobjs, objs_via_ascent, pt_distances
+
  /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
  
 
   
 
   
===  objs2dist2.pl  ===
+
</nowiki>
objs2dist2.pl: like objs2dist.pl but when -rpts specified prints out lines to ALL objects
+
===  Norio_stats.pl  ===
      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 programs takes each pts file in the current directory, thresholds the associated vinculin image,
 +
applies that mask to the trip6 image, and produces a .coloc file from the masked trip6 image (using mask_and_coloc.pl);
 +
overlap statistics are then calculated (and put into a file name *_masked.coloc where * is the root of the trip6 image name)
 +
and finally the highest ratio data from each image pair is printed to stdout (using sort_overlap3.pl).
  
This program takes 2 object outputfiles produced by countobjs (or maskobjs) and finds the shortest distance
+
stats.pl [options]  > stats.out
from the center of mass of objects in file1.out to the center of mass of objects in file2.out.
+
  -nothing : do nothing, just echo what would be done
 +
  -h : print this help
 +
  -thresh=#    : threshold for the vinculin image. default = 20
 +
  -regions=#:#  : only allow mask regions within the specified min:max size (in pixels, inclusive).
 +
: Also creates *_count.i2i  and *.countobjs (* = root of vinculin image name) intermediate files.
 +
: note: these counts are for the vinculin image after the mask (pts file) is applied.
 +
  -clean:      : clean up (ie, remove) *_count.i2i and *.countobjs images (if -regions specified)
  
If both file arguments are the same (e.g., objs2dist.pl file1.out file1.out >file.dist), you can use this
+
routine to find the distances between objects within an image (an object match with the same id is automatically
+
</nowiki>
ignored in this case so objects don't match to themselves). See also the option -skipsame.
+
===  run2_Ronghua.pl ===
 +
<nowiki>
  
(modified from /storage/big1/lml/was_voxel/Corvera/track/objs2bb.pl)
+
this program goes through Ronghua's directory (see -dir option)
 +
analyzing files.  output is put into the current working directory (ie, the directiory
 +
run.pl is run from).
 +
A tag in the name of the form Ryr_thresh_minsize_maxsize_Bk_thresh_minsize_maxsize
 +
is added to the output name  of name.patchdist  (nearest voxel distance between whole
 +
patches) and name.comdist (distances between nearest center of mass of the patches).
  
 
usage:
 
usage:
   objs2dist2.pl file1.out file2.out >file.dist 
+
   run.pl [options]
  
 
options:
 
options:
   -dx=# : spacing in the x direction ,default = 1
+
   -dir=directorypath    : without the final slash. directory to analyze. default = /mnt/big3/rzg/mtc/immunocytochemistry/july05/imcc/70105/epr
   -dy=# : spacing in the y direction ,default = 1
+
   -ryrthresh=# : threshold for ryr (488) images, default =  
   -dz=# : spacing in the z direction ,default = 1
+
   -min_ryrsize=# : minimum allowed object size in pixels, default = 5
   -size1=min:max :  min and max object size allowed for file 1 in pixels (inclusive)
+
   -max_ryrsize=# : max allowed object size in pixels, default = 150
   -size2=min:max :  min and max object size allowed for file 2 in pixels (inclusive)
+
   -min_ryriod=# : minimum allowed object iod, default = 354
   -iod1=min:max : min and max object iod allowed for file 1 (inclusive)
+
   -max_ryriod=# : maximum allowed object iod, default = 10000000
   -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).
+
   -bkthresh=# : threshold for bk (594) images, default =
  default maxdist is 20.
+
   -min_bksize=# : minimum allowed object size in pixels, default = 5
   -hist : calculate histogram of distances (hist[int(dist)]++, where int just truncates to integer).
+
   -max_bksize=# : max allowed object size in pixels, default = 50
   -sizehist : calculate histogram of object sizes (in voxels) in file1.out. (hist[int(size)]++, where int just
+
   -min_bkiod=# : minimum allowed object iod, default = 4686
  truncates to integer). If you don't care about distances between two files (ie, only want -sizehist)
+
   -max_bkiod=# : maximum allowed object iod, default = 10000000
  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
+
   -dx=# : relative distance in x, default = 1  
  in file2.out that are <= maxdist away (these lines will become an object named "near_to_file1.out").
+
   -dy=# : relative distance in y, default = 3
  display this in dave eg:  dave -n 0 -u -I file.i2i file.rpts (use the -n 0 and -u options)
+
   -dz=# : relative distance in z, default = 1
  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.
+
   -noclean
  # controls the size of the jack. 1=1 pixel in size, 2 = 2 pixels, etc.
+
   -debug
   -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
 
   -verbose
  
example:
+
   countobjs -k -t 2000 2000 wave1.objs wave1.i2i
+
</nowiki>
   countobjs -k -t 2000 2000 wave2.objs wave2.i2i
+
===  countobjs  ===
   objs2dist2.pl wave1.objs wave2.objs > wave1and2.dist
+
<nowiki>
 +
Usage:
 +
   countobjs [options] outputfile image1.i2i [image2.i2i]
 +
Description:
 +
  Count objects in co-localized images. If only one image given
 +
  the objects will be counted in that one image.  Copious amounts
 +
  of information will be written to the output file.
 +
  A - for outputfile will write to stdout.
 +
  outpufile can be analyzed with objs2bb.pl and objs2dist.pl
 +
 
 +
Options:
 +
  -C # #        : set opacity and brightness level to these values (0-255 only)
 +
  -k             : use original images for data analysis (so scale and black level not important and
 +
      -t option can be in same units as original, unscaled, image values)
 +
  -S # # #      : image # scale and black level (default autoscale image)
 +
  -r # # # # # # : region of image to count
 +
                  (-r x0 y0 z0    x1 y1 z1)
 +
                  (  ^lower left  ^upper right)
 +
                  (zero indexed coordinates)
 +
                  (default whole image)
 +
  -s # #        : size of smallest and largest objects to count
 +
                  (default 1-100000)
 +
  -m # #        : min and max iod of allowable objects (applied to image1 only).
 +
  -t thresh1 thresh2    : thresholds (applied after -S or default scaling, unless -k specified).
 +
                  Like left brightness slider in DAVE.
 +
                  if only one image, second number still required, but ignored.
 +
  -o <image.i2i> : output image with all objects represented by the voxel
 +
                  with the maximum intensity in the object
 +
                  the intensity of the voxel will be the IOD of the object.
 +
  -O <image.i2i> : output image with all pixels in each object having
 +
                  the intensity of the original objects IOD.
 +
                  NOTE: this image will be in floating point format.
 +
                        use float2int to convert it back to "normal" format.
 +
   -Q <image.i2i> : output image with all pixels in each object having
 +
                  a unique id # (1-# of objects). Must be < 32766 objects.
 +
                  NOTE: this image will be in standard signed short int format.
 +
  -M #          : When countobjs is given 2 images, this flag will
 +
                  turn of some subset of the voxels for colcalization.
 +
                  calculations.
 +
                  0: turn off colcalized voxels (default on)
 +
                  1: turn off image 1 voxels (default on)
 +
                  2: turn off image 2 voxels (default on)
 +
  -q     : quiet. don't print out all objects, but just summary statistics
 +
  -Z            : simple analysis, no sliders, opacity,etc. can use with -t option.
 +
  -h            : show this message.
 +
  -H            : show even more help.
 +
 
 +
Notes:
 +
  A - in place of an image name means stdin or stdout.
 +
  Source code in /storage/big1/lml/jac/was_invitro/Projects/countobjs
 +
 
 +
 
 +
</nowiki>
 +
===  countobjsmax3d  ===
 +
<nowiki>
 +
Usage:
 +
  countobjsmax3d [options] -Q imageid.i2i outputfile image1.i2i
 +
Description:
 +
  This version of countobjs finds 3d maxima in image1.i2i, then finds all pixels connected
 +
  to each maxima and downhill from it.  These are labelled with a unique id number and stored
 +
  in imageid.i2i (specified with the -Q option, which is REQUIRED for this version)
 +
  You may want to display imageid.i2i after using colorize_image on it.
 +
  Not tested yet.
 +
 
 +
   Count objects in co-localized images. If only one image given
 +
  the objects will be counted in that one image.  Copious amounts
 +
  of information will be written to the output file.
 +
  A - for outputfile will write to stdout.
 +
  outpufile can be analyzed with objs2bb.pl and objs2dist.pl
 +
 
 +
Options:
 +
  -r # # # # # # : region of image to count
 +
                  (-r x0 y0 z0    x1 y1 z1)
 +
                  (  ^lower left  ^upper right)
 +
                  (zero indexed coordinates)
 +
                  (default whole image)
 +
  -s # #        : size of smallest and largest objects to count
 +
                  (default 1-100000)
 +
  -m # #        : min and max iod of allowable objects (applied to image1 only).
 +
  -t thresh1 thresh2    : thresholds (applied after -S). Like left brightness slider in DAVE.
 +
                  if only one image, second number still required, but ignored.
 +
  -o <image.i2i> : output image with all objects represented by the voxel
 +
                  with the maximum intensity in the object
 +
                  the intensity of the voxel will be the IOD of the object.
 +
  -O <image.i2i> : output image with all pixels in each object having
 +
                  the intensity of the original objects IOD.
 +
                  NOTE: this image will be in floating point format.
 +
                        use float2int to convert it back to "normal" format.
 +
  -Q <image.i2i> : output image with all pixels in each object having
 +
                  a unique id # (1-# of objects). Must be < 32766 objects.
 +
                  NOTE: this image will be in standard signed short int format.
 +
  -M #          : When countobjs is given 2 images, this flag will
 +
                  turn of some subset of the voxels for colcalization.
 +
                  calculations.
 +
                  0: turn off colcalized voxels (default on)
 +
                  1: turn off image 1 voxels (default on)
 +
                  2: turn off image 2 voxels (default on)
 +
  -q     : quiet. don't print out all objects, but just summary statistics
 +
  -Z            : simple analysis, no sliders, opacity,etc. can use with -t option.
 +
  -h            : show this message.
 +
  -H            : show even more help.
 +
 
 +
Notes:
 +
  A - in place of an image name means stdin or stdout.
 +
  Source code in /storage/big1/lml/jac/was_invitro/Projects/countobjs
 +
 
 +
 
 +
</nowiki>
 +
===  threshold.pl  ===
 +
<nowiki>
 +
threshold.pl -numvox=#  [-produce=newimage.i2i] image.i2i
 +
 
 +
calculate the largest threshold for image.i2i which has at least # voxels
 +
equal or above it.  Prints the threshold and the number above threshold to stdout.
 +
 
 +
options:
  
see also:
+
   -produce=newimage.i2i    : take the calculated threshold, apply it to image.i2i to produce newimage.i2i
   objs2dist121.pl, objs2dist.pl, closest_object, closest_voxel, countobjs, maskobjs, objs_via_ascent, pt_distances
 
  
 
   
 
   
===  objs2mst.pl  ===
+
</nowiki>
 +
===  thresholdz.pl  ===
 +
<nowiki>
 +
thresholdz.pl -numvox=#  [-produce=newimage.i2i] image.i2i
 +
 
 +
calculate the largest threshold for image.i2i which has at least # voxels
 +
equal or above it.  Prints the threshold and the number above threshold to stdout.
 +
 
 +
options:
  
This program takes an object outputfiles (unless -rptsin) produced by countobjs (or maskobjs) and finds the minimal
+
  -produce=newimage.i2i    : take the calculated threshold, apply it to image.i2i to produce newimage.i2i
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:
+
  objs2mst.pl file1.objs > file1_mst.rpts
+
</nowiki>
 +
===  2Ddistances  ===
 +
  <nowiki>
  
options:
+
Calculates a histogram of the amount of light as a function of distance from boundary (0 valued) voxels as specified in the mask.
  -dx=# :  spacing in the x direction, default = 1
+
Applies a 2D mask to a 2D time series.
  -dy=# :  spacing in the y direction, default = 1
 
  -dz=# :  spacing in the z direction, default = 1
 
  -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)
 
  -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.
 
  -addlines :  output rpts format which addlines is more likely to be happy with (may not work in dave?)
 
  -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)
 
  -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:
+
Usage:
  countobjs -k -t 2000 2000 wave1.objs wave1.i2i
+
2Dhistogram [options] inimage.i2i inmask.i2i
  objs2mst.pl wave1.objs  > wave1mst.rpts
+
Options:
  dave -I wave1.i2i -n 0 -u wave1mst.rpts
+
  -v: verbose
  
see also:
+
Source code in ~krypton/lml/facil 
   objs2bb.pl, objs2dist.pl, objs2dist121.pl, closest_object, closest_voxel, countobjs, maskobjs, objs_via_ascent
+
   -d dimage.i2i : save the distance image as dimage.i2i (converted to ints by casting)
  resolve_pts
+
  -n: don't normalize the histogram by the number of voxels in the mask at that distance
 +
  -a #:  average together this many time pts for output histogram. default = 20
 +
see also: histogramL, histogram2
  
 +
Copyright 2010 University of Massachusetts Medical School and the Biomedical Imaging Group
 +
All rights reserved. Explicit permission to use this program must be received prior to use.
 
   
 
   
===  objs_within_dist.pl ===
+
</nowiki>
 +
===  analyze_histo ===
 +
<nowiki>
 +
# /home/lml/krypton/bin/analyze_histo
  
This program takes 2 object outputfiles produced by countobjs (or maskobjs) and finds the number of objects
+
Analyzes the output histogram image produced by histogram2 via the -f option.
in the second file which are within a given distance of each object in the first file. A histogram is
+
Prints out 2 columns: first column is bin number, second column is value at the cutoff.
printed out.
+
This is similar to the program "threshold" but instead of one threshold value for the
Distances are from the center of mass of objects in file1.out to the center of mass of objects in file2.out.
+
entire image, it gives one at each distance (from a membrane).
(modified from objs2dist.pl)
 
  
usage:
+
Usage: analyze_histo [options] aimage_H.i2i
  objs_within_dist.pl file1.out file2.out >file.dist 
+
options:
 +
-v: calculate cutoff based on percentage of voxels instead of percentage of light
 +
-f #: fractional cutoff (e.g., .80 = 80%), default = 0.950000
 +
-w #: number of bins for running average (default = 5), should be odd.
 +
-t #: only look at voxels >= intensity (must be >= 0), default = 1
  
options:
+
Examples:
  -dx=# :  spacing in the x direction ,default = 1
+
histogram2 -f a_H.i2i -O a_H.histo -o -p 0 0 0 -d 40 -z 3 mask.i2i a.i2i b.i2i
  -dy=# :  spacing in the y direction ,default = 1
+
analyze_histo -f .95 a_H.i2i > a_H.cutoffs
  -dz=# :  spacing in the z direction ,default = 1
+
 
  -size1=min:max :  min and max object size allowed for file 1 in pixels (inclusive)
+
See also: histogram, histogram2, threshold
  -size2=min:max :  min and max object size allowed for file 2 in pixels (inclusive)
+
 
  -iod1=min:max :  min and max object iod allowed for file 1 (inclusive)
+
source code in /storage/big1/lml/jac/was_invitro/Projects/boundary/boundary
  -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).
+
</nowiki>
  default maxdist is ~ 3000.
+
=== analyze_yaodl ===
  -rpts : read in file in rpts format
+
  <nowiki>
  -verbose : extra info written to stderr
 
  -vverbose : print other info. can be combined with -verbose.
 
  
example:
+
This program reads in a yaodl file as produced by DAVE (volume widget menu: volume to surface ...)
  countobjs -k -t 2000 2000 wave1.objs wave1.i2i
+
(hmc produces an ascii format which analyze_yaodl can't handle).
  countobjs -k -t 2000 2000 wave2.objs wave2.i2i
+
It identifies connected surfaces (since DAVE considers all surfaces from one pass as one object).
  objs_within_dist.pl wave1.objs wave2.objs > wave1and2.dist
+
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.
  
see also:
+
Usage: analyze_yaodl [options] infile.ydl
  objs2dist121.pl, closest_object, closest_voxel, countobjs, maskobjs, objs_via_ascent, pt_distances
+
options:
 +
  -y largest.ydl:  write out largest surface of eac object to largest.ydl
 +
  -i image.i2i:  read in the image file associated with infile.ydl (not needed for anything yet).
 +
        -n: recalculate "better" normals (use this with the -y option)
 +
(dave used to produce terrible normals, now they are ok, so this isn't needed anymore)
 +
  -v: verbose
  
 +
note: source code in /storage/big1/lml/Fischer/src directory.
 
   
 
   
===  connected_random_pts ===
+
</nowiki>
Generates random pts in a planar region, calculates how many connected components are created
+
===  BestPath ===
if a pt is connected to all other pts within a given radius.
+
<nowiki>
 +
 
 +
Finds the brightest path from a start pixel to a stop pixel (1-indexed).
  
 
Usage:
 
Usage:
connected_random_pts [options]
+
BestPath [options] image.i2i
 
Options:
 
Options:
-x lowx hix:         pts have xcoords within this range, default = (0.0,100.0)
+
-t #: threshold. Only pixels with values > # are allowed in the path, default = 0.000000
-y lowy hiy:         pts have ycoords within this range, default = (0.0,100.0)
+
-s x y z: start coordinate (1-indexed). default = (1,1,1)
-r #: radius (in pixels), default = 5.0
+
-S x y z: stop coordinate (1-indexed). default = (1,1,1)
-s #: long int starting seed for random number generator. default = process id.
+
-v: verbose
-n #: number of pts to create, default = 1000
 
  -h: help
 
  -v: verbose
 
 
 
See also:
 
krypton/Huang/README, components.pl, Kth_pt.m, num_observed.m, mean_minimum_distance.m,objs2mst.pl
 
  
 
Source code in ~krypton/lml/facil   
 
Source code in ~krypton/lml/facil   
 
   
 
   
== Image Manipulation ==
+
</nowiki>
===  align_quadrants.pl ===
+
===  BestPath3D ===
This program displays the four quadrant images of a well. The 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
+
 
neighboring quadrants. When done, each quadrant must have one (or two) points specified.
+
Finds the brightest path from a start pixel to a stop pixel (1-indexed).
Points must be in pair order (see recalc_quadrant2.pl).  When done, the use must write them out
+
Converts voxels into nodes in a graph and finds the lowest cost path from the start node to the stop node.
via z (when middle mouse is also pressed, no confimation is given in play).   
+
The cost of each node is (maxval-imval), so bright nodes have less cost. Output in rpts format to stdout.
The quadrant images are then aligned based on these points and newimage.i2i is created.
+
BestPath3D always turns all (above threshold) voxels in the image into graph nodes. BestPath3D_ellipse only
 +
looks at voxels within an ellipse with a major axis connecting the start and endpts.
 +
Usage:
 +
BestPath3D [options] image.i2i > image.rpts
 +
BestPath3D_ellipse [options] image.i2i > image.rpts
 +
Options:
 +
-t #: threshold. Only pixels with values > # are allowed in the path, default = 0.000000
 +
-s x y z: start coordinate (1-indexed).  
 +
-S x y z: stop coordinate (1-indexed).
 +
Up to 1000  pairs of start/stop pixels can be specified. At least one pair must be specified.
 +
-r scale black  rescale image values so new = (old-black)/scale prior to being used
 +
-n name name of object that is placed into the rpts file.
 +
-f exfac perpfac: Only used if you are running BestPath3D_ellipse
 +
        sets principal axis a to have the specified endpts (from -s and -S), then expands it by factor exfac,
 +
                        and sets the length of the perpendicular b and c axes to be perpfac times the original axis a length
 +
defaults: exfac = 1.000000, perpfac = 1.000000
 +
-v: verbose
 +
-d: debug
 +
-D debug.i2i: debug. also write out image with 50 added to all voxels within the ellipsoid.
 +
 
 +
Examples:
 +
make_spiralim -d 200 200 30 -r 70 -p spiral_small.i2i # create a test image
 +
                -s 171 101 1  -S 170 99 30            # written out by make_spiralim
 +
BestPath3D_ellipse -v -t -1 -s 171 101 1 -S 170 99 30 -f 3 13 spiral_small.i2i > spiral.rpts
 +
note: spiral_small.i2i is a tough case, since the spiral goes very far from the start/stop points
 +
This requires a -f 3 to expand out the endpts and then a 13 to expand out perpendicularly.
 +
If you just expand out perpendicularly (e.g. -f 1 13) the ellipsoid doesn't grow faster enough
 +
near the endpts so some of the spiral data is not included in the ellipsoid. See -D option.
  
It will also create a file with the output from play, for future reference.
+
See also: make_spiralim, BestPath, BestPath2, make_ellipsoid, DAVE -> Stuff -> Best Path ...
It will be named, eg, G02_combined_play.pts. It can be passed manually to recalc_quadrant2.pl to redo
 
the alignment if necessary.
 
  
usage:
+
Source code in ~krypton/lml/facil 
  align_quadrants.pl [options] well newimage.i2i
+
 +
</nowiki>
 +
===  BestPath3D_ellipse  ===
 +
<nowiki>
  
 +
Finds the brightest path from a start pixel to a stop pixel (1-indexed).
 +
Converts voxels into nodes in a graph and finds the lowest cost path from the start node to the stop node.
 +
The cost of each node is (maxval-imval), so bright nodes have less cost. Output in rpts format to stdout.
 +
BestPath3D always turns all (above threshold) voxels in the image into graph nodes. BestPath3D_ellipse only
 +
looks at voxels within an ellipse with a major axis connecting the start and endpts.
 +
Usage:
 +
BestPath3D [options] image.i2i > image.rpts
 +
BestPath3D_ellipse [options] image.i2i > image.rpts
 +
Options:
 +
-t #: threshold. Only pixels with values > # are allowed in the path, default = 0.000000
 +
-s x y z: start coordinate (1-indexed).
 +
-S x y z: stop coordinate (1-indexed).
 +
Up to 1000  pairs of start/stop pixels can be specified. At least one pair must be specified.
 +
-r scale black  rescale image values so new = (old-black)/scale prior to being used
 +
-n name name of object that is placed into the rpts file.
 +
-f exfac perpfac:  Only used if you are running BestPath3D_ellipse
 +
        sets principal axis a to have the specified endpts (from -s and -S), then expands it by factor exfac,
 +
                        and sets the length of the perpendicular b and c axes to be perpfac times the original axis a length
 +
defaults: exfac = 1.000000, perpfac = 1.000000
 +
-v: verbose
 +
-d: debug
 +
-D debug.i2i: debug. also write out image with 50 added to all voxels within the ellipsoid.
  
examples:
+
Examples:
  align_quadrants.pl [options] G02 G02_combined.i2i
+
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.
  
options:
+
See also: make_spiralim, BestPath, BestPath2, make_ellipsoid, DAVE -> Stuff -> Best Path ...
-no_pts_output don't produce the pts file
 
-noblend by default the quadrant images are blended together where
 
they overlap. use this option to turn that off.
 
-print_overlap also print the amount of overlap to stderr
 
-debug
 
-debug_all
 
  
 +
Source code in ~krypton/lml/facil 
 +
 +
</nowiki>
 +
===  boundaryL  ===
 +
<nowiki>
 +
Usage:
 +
  boundary [options] original.i2i
  
see also:
+
Description:
combine_images
+
  Boundary takes an image, applys a threshold to the image,
recalc_quadrant2.pl
+
  rolls a ball outside then inside the object. This defines
/home/lml/krypton/Corvera/Raz/README 5/16/14
+
  what pixels are considered inside, outside, and boundary.
http://wiki.imagej.net/Grid/Collection_Stitching_Plugin
 
  
 +
  Expects:  Input image and optionally some given options
 +
  Modifies: Nothing
 +
  Returns:  Output image with the name of image with _B added.
 +
            (if input.i2i was original image input_B.i2i
 +
            is output image)
  
   
+
Options:
=== combine_images.pl ===
+
-I        : Do not roll ball inside of the cell.
 +
              (rolling the ball inside the cell results
 +
              in a smoother surface)
 +
  -r #      : Set radius to # for sphere exterior to cell.
 +
              (default = 3)
 +
-R #      : Set radius to # for sphere interior to cell.
 +
              (default = 3)
 +
-t #      : Set threshold for all z slices to > #.
 +
              (default is 10)
 +
-T filename: Use file filename for thresholds for each z slice.
 +
              (one threshold for each zslice - one threshold on a line)
 +
-X        : Restrict search in X direction.
 +
              (can be used to cap a cylinder whose long axis
 +
              is along the x axis)
 +
-Y        : Restrict search in Y direction.
 +
              (can be used to cap a cylinder whose long axis
 +
              is along the y axis)
 +
-i string  : Add string to history of output image.
 +
  -h        : Print this message.
 +
  -H        : Print this message and then some.
  
This program runs combine_images on all the images in the current directory.  All images which have names
+
Caveats:
like L##_morestuff.i2i (where L is any letter and # is any digit) will be combined;
+
  Requires lots of memory and time to run (megabytes+minutes).
all the A02 will be combined (to produce A02_comb.i2i), all the A03, etc.
+
 
The resulting image for the combination of the A02 images will be A02_tag.i2i (see -newtag option, e.g. A02_comb.i2i).
+
Notes:
Any images already existing in the current directory with a name like L##_stuff_oldtag.i2i will be ignored.
+
  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.
  
usage:
+
Keywords:
combine_images.pl [options]
+
  surface location, boundary, boundaries, border
  
options:
+
Additional programs:
-newtag=something The output filename for L##*.i2i will be L##_newtag.i2i.  Default = comb
+
  histogram, shrink_wrap, createBoundary, analysis
-oldtag=something Any files of the form L##*_oldtag.i2i will be ignored. Default = comb
 
-pixsize=# pass this as -p # to combine_images program (pixel size).
 
Specify -pixsize=2.41 (um/pixel) for the 2.5X objective.
 
-reduceima=#:#:tag After creating output image, apply reduceima to it 
 
with -bin # # and the specified output tag on the name.
 
So, e.g., A02_comb.i2i will become A02_tag.i2i
 
-flipx flip images in X prior to combining them
 
-flipy flip images in Y prior to combining them (can be used at the same time as -flipx)
 
-x=#:#:#:# manually specified picture offsets. see combine images
 
-y=#:#:#:# manually specified picture offsets. see combine images
 
-o=# number of pixels the images overlap (ignores info in image headers). see combine_images
 
-f do MOT pad images at border (as of 2/3/14). see combine_images.
 
-remove Remove the full-size combined image (e.g., A02_comb.i2i) when done (use with -reduceima).
 
-dummy Just echo what would be done, but don't do anything
 
-verbose Echo as things are done.
 
-debug
 
  
note:
+
Last Changed: Wed Feb 10, 1993
combine_images (in /storage/big1/lml/Linux/bin) and reduceima (in /storage/big1/kef/Linuxbin) must be in your
 
path for this perl script to work.  You can check this by just typing: which combine_images  and  which reduceima;
 
if they are not found you need to add their directory to your PATH environment variable (echo $PATH will show you
 
what it is currently). How this is done varies depending upon which shell you are running. Under tcsh it would
 
be  setenv PATH $PATH:/storage/big1/kef/Linuxbin:/storage/big1/lml/Linux/bin .
 
  
example:
 
      cd /storage/big3/kdb/Zeiss/20130326/GEDMAT_002_PRO_SQ2_DAY14
 
# Combine all images in each well. The combined image will be L##_combined (-newtag=combined).
 
# Then reduce the combined size back down to the size of one original image;
 
# call the new image L##_combined_reduc.i2i (-reduceima=2:2:reduc). 
 
# Finally, remove the big (unreduced) combined image (-remove). 
 
# First do a dummy run (-dummy) to see if it is going to do what we want:
 
      combine_images.pl -newtag=combined -reduceima=2:2:reduc -pixsize=2.41 -remove -dummy   
 
# ok, now the real thing (just leave off -dummy):
 
      combine_images.pl -newtag=combined -reduceima=2:2:reduc -pixsize=2.41 -remove
 
  
see also:
+
</nowiki>
combine_images
+
===  calc_area  ===
/storage/big1/raz/GEDMAT
+
<nowiki>
mask_gedmat_images.pl
 
  
+
This program takes in a surface image and a data image and calculates:
===  overlap_images.pl  ===
+
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.
  
  Takes output from parsepos.pl  and calculates how the images overlap so they can then be combined easily (-create option).
+
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.
  
overlap_images.pl [options]  
+
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).
  
options:
+
note: entire image name (with extension) is NOT required.
-xdim=# xdim of image in pixels, default = 1392
+
note: a - in place of an image name means stdin or stdout.
-ydim=# ydim of image in pixels, default = 1040
+
note: a compressed image will be automatically be uncompressed.
-zdim=# zdim of image in pixels, default = 25
 
-pixsize=# size of pixels in um, default = 0.645
 
-create=file.i2i actually combine the images into one big image  
 
-flipx flip each image around its x-axis prior to inserting it into the new image (if -create is specified)
 
-flipy flip each image around its y-axis prior to inserting it into the new image (if -create is specified)
 
-verbose
 
-dummy just echo what would be done, but don't do anything (nothing normally done anyway unless -create specified).
 
  
see also:
+
Source code in /storage/big1/lml/was_invitro/Moore/pkc
parsepos.pl
+
insert_image called by this program if -create is specified.
+
</nowiki>
reduceima if -create is used, this may be needed to make the image small enough to see via play.
+
==closest_object  ===
+
<nowiki>
example:
 
        parsepos.pl -pre=/storage/big3/kdb/Zeiss/20121004/LectinExp3/ -post=_1_1_20121004_LectinExp3.i2i \
 
                /storage/big3/kdb/Zeiss/20121004/LectinExp3/LextinExp3.pos | overlap_images.pl -create=newimage.i2i
 
reduceima -A -bin 4 4 newimage.i2i newimage_reduced.i2i
 
  
  note: you may need /storage/big1/lml/Linux/bin and /storage/big1/kef/Linux/bin in your path
+
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" 
  
  source code in /storage/big1/lml/Corvera/Olga/data/ptrs
+
Usage:
see also: insert_image
+
closest_object [options] image1.i2i image2.i2i > im1_im2.hist
  http://bigwww.epfl.ch/algorithms.html -> MosaicJ (which may already exist in Fiji)
+
Options:
 +
-t # #: image1 and image2 thresholds, pixels > # are above threshold, default = 0.
 +
-w # # #: x,y, zweights for pixel distances (ie, pixel size), default = 1 for each.
 +
-m # :         maxdistance (in units used for -w) to look for the closest pixel, default = 10.000000
 +
-r #:         resolution for output histogram, ie, binsize, default = 0.100000
 +
-e lowx lowy lowz hix hiy hiz: only look at voxels within this extent (subvolume), 1-indexed, inclusive.
 +
-s minsize maxsize:    only look at objects in image1.i2i within the size range (inclusive, in voxels)
 +
-S minsize maxsize:    only look at objects in image2.i2i within the size range (inclusive, in voxels)
 +
-i miniod maxiod:    only look at objects in image1.i2i within the iod range (inclusive)
 +
-I miniod maxiod:    only look at objects in image2.i2i within the iod range (inclusive)
 +
-d image1d.i2i: the original intensity image for image1 (since image1 has pixel values as id numbers)
 +
-D image2d.i2i: the original intensity image for image2 (since image2 has pixel values as id numbers)
 +
if you want the iod or pixel intensity stats to be meaningful, you need to provide
 +
the original data by using the -d and -D options.
 +
  -v: verbose
 +
  -V: very verbose
 +
Examples:
 +
    Find the distance from the closest Ryr voxel in each object to a BK object. Record the iod
 +
    of the BK object in the histogram:
 +
countobjs -t 5 10 -Q ryr_id.i2i ryr.countobjs ryr.i2i      : this finds Ryr connected objects and labels them with id
 +
countobjs -t 10 10 -O bk_iodR.i2i bk.countobjs bk.i2i     : this calculates the iod of BK objects
 +
float2intL -M 30000 bk_iodR.i2i bk_iod.i2i     : rescale BK iod to integer format
 +
closest_object -w 1 1 3 -o 5 100  ryr_id.i2i bk_iod.i2i > ryr_bk.info
 +
cull -s -c -1 -4 < ryr_bk.info |xmgrace -source stdin
 +
        note: you may want to take a 10 pt running avg inside xmgrace to compensate for
 +
issues related to discretization of distances
 +
See also:
 +
closest_voxel objs_via_ascent /home/lml/krypton/Zhuge/BKandRyr/graph.pl,match.pl
 +
Bugs:
  
 +
Source code in ~krypton/lml/facil 
 
   
 
   
===  parsepos.pl ===
+
</nowiki>
  Parse a position file produced by Zeiss system to pull out x y coords for each of the images taken in well C09.
+
===  closest_voxel ===
Output triples (well_id x y) written to stdout.
+
  <nowiki>
Position may be in microns, x increasing to the right, y increasing down.
+
 
 +
Calculates the closest distance from an above threshold voxel in image1 to an above threshold voxel in image2.
 +
Histogram of these distances is printed to stdout.
  
  parsepos.pl filename.pos
+
Usage:
 +
closest_voxel [options] image1.i2i image2.i2i > im1_im2.hist
 +
Options:
 +
-t # #: image1 and image2 thresholds, pixels > # are above threshold, default = 0.
 +
-w # # #: x,y, zweights for pixel distances (ie, pixel size), default = 1 for each.
 +
-m # :         maxdistance (in units used for -w) to look for the closest pixel, default = 10.000000
 +
-r #:         resolution for output histogram, ie, binsize, default = 0.100000
 +
-s lowx lowy lowz hix hiy hiz: only look at voxels within this subvolume, 1-indexed, inclusive.
 +
-Q: only the voxel in each image1 object closest to an image2 voxel should count.
 +
Use this if image1.i2i was created via the -Q option from countobjs.
 +
-o minsize maxsize:    only look at objects in image1.i2i within the size range (inclusive, in voxels)
 +
must use -Q option along with this.
 +
-p: also print the detailed info of which voxel matched to which other voxel
 +
  -v: verbose
 +
  -V: very verbose
 +
Examples:
 +
    Find the distance from the closest Ryr voxel in each object to a BK object. Record the iod
 +
    of the BK object in the histogram:
 +
countobjs -t 5 10 -Q ryr_id.i2i ryr.countobjs ryr.i2i      : this finds Ryr connected objects and labels them with id
 +
countobjs -t 10 10 -O bk_iodR.i2i bk.countobjs bk.i2i     : this calculates the iod of BK objects
 +
float2intL -M 30000 bk_iodR.i2i bk_iod.i2i     : rescale BK iod to integer format
 +
closest_voxel -w 1 1 3 -o 5 100 -Q ryr_id.i2i bk_iod.i2i > ryr_bk.info
 +
cull -s -c -1 -4 < ryr_bk.info |xmgrace -source stdin
 +
        note: you may want to take a 10 pt running avg inside xmgrace to compensate for
 +
issues related to discretization of distances
 +
See also:
 +
graph.pl  
 +
Bugs:
  
  options:
+
Source code in ~krypton/lml/facil 
-well=string well to analyze. default = C09
+
   
-pre=prestring add this string in front of the well_id
+
</nowiki>
-post=postring add this string after the well_id
+
=== coloc  ===
these two options are needed if you want to pass this output to
+
<nowiki>
overlap_image.pl -create=newimage.i2i, since that will need to be able
 
to find the image associated with each well_id.
 
-verbose additional output to stderr
 
-vverbose additional output to stderr
 
  
  example:
+
  This program reads in 2 or 3 images, and writes out an image in which
parsepos.pl -pre=/storage/big3/kdb/Zeiss/20121004/LectinExp3/ -post=_1_1_20121004_LectinExp3.i2i  \
+
colocalized voxels (voxels > threshold in all images) are kept, others
/storage/big3/kdb/Zeiss/20121004/LectinExp3/LextinExp3.pos | overlap_images.pl -create=newimage.i2i
+
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:
 
overlap_images.pl
 
insert_image
 
  
  note: you may need /storage/big1/lml/Linux/bin and /storage/big1/kef/Linux/bin in your path.
+
This programs reads in three images and produces a new version of image3.
 +
Each voxel which is colocalized (has image1 > thresh1
 +
and image2 > thresh2) has the value in image3 set to 32000 (-n 32000). Otherwise the value in image3 is not
 +
changed. Once these modifications are made, image1.i2i image2.i2i and newimage3.i2i can be read
 +
into DAVE (in that order) and voxels which are colocalized in the first two channels
 +
will be guaranteed to be colocalized in the third channel.
 +
 
 +
Usage: coloc3ims [options] image1.i2i image2.i2i image3.i2i newimage3.i2i
 +
options:
 +
  -t thresh1 thresh2:  thresholds for image1 and image2, defaults = 0 and 0
 +
  -n newval: instead of setting newimage3 to 0, set it to newval
 +
  -m: instead of setting newimage3 to 0, set it to the max value in image3.i2i
 +
 
 +
note: entire image name (with extension) is NOT required.
 +
note: a - in place of an image name means stdin or stdout.
 +
note: a compressed image will be automatically be uncompressed.
 +
 +
</nowiki>
 +
===  coloc_tseries2  ===
 +
<nowiki>
 +
 
 +
Similar to coloc_tseries, but compares a 2D time series to itself.
 +
Prints xmgr formatted graphs to stdout.
 +
 
 +
Usage: coloc_tseries2  image1 outfile
 +
options:
 +
-t thresh:    only count voxels > thresh. default = 0
 +
-z start stop: only look at these z planes (inclusive, 1-indexed). default = all z planes.
 +
-n: don't include a legend in the stdout.
 +
        -v:          verbose
 +
 
 +
source code in:  /home/lml/krypton/facil
 +
 
 +
see also: /home/lml/krypton/Corvera/paper2010/Dynamics_in_Dave/README
 +
 +
</nowiki>
 +
===  com_2d_objs  ===
 +
<nowiki>
 +
 
 +
This program takes an image and finds the intensity weighted center of mass of each 2d object.
 +
Object 1 is all pixels with value = 1, object 2 is pixels with value 2, etc. Max objects = 10
 +
Statistics are written to stdout
 +
 
 +
Usage: com_2d_objs [options] image.i2i
 +
options:
 +
  -z start stop: zplanes to analyze. 0-indexed inclusive. default is all z planes
 +
  -r #: put data out rpts format (integer coords, only center of mass info). Only use if only one object.
 +
# is the pixel value (!= 0), usually -1 through -7.
 +
  -o: coords should be one-indexed (ie, min x = 1). default = 0. -r sets this automatically.
 +
  -v: verbose
 +
 
 +
Source in /home/lml/krypton/facil
 +
See Also: /home/lml/krypton/Lawson/Jacques/README
  
 +
Examples:
 +
  planimeter3.20081007 -I 110215ligand_0_491.i2i -R 110215ligand_0_491_cell1.rpts
 +
  interp -S -p -1 -o cell1 110215ligand_0_491_cell1.rpts 110215ligand_0_491_cell1_interpS.rpts
 +
  create_dcimL -d 1 -s 502 501 1440 one.i2i
 +
  addlines one.i2i 110215ligand_0_491_cell1_interpS.rpts - | maskedsmul -O 0 one.i2i - cell1_binary.i2i
 +
    # could do the same for a second object (etc), with create_dcimL -d 2, then use mathi2i
 +
    # to add the images before analysis
 +
  com_2d_objs cell1_binary.i2i > cell1_binary.stats
 
   
 
   
===  prep_and_restore.pl ===
+
</nowiki>
 +
===  exo4 ===
 +
<nowiki>
 +
Phase 1: Associates each voxel in inimage.i2i which is > threshold with a maxima in the image.  It finds
 +
        the maxima by doing a steepest ascent walk in the image.  Writes summary info about regions found to
 +
        stdout in the same format as countobjs.  Only the location of the maxima found in phase 1 are passed to phase 2.
 +
        All vesicles must start out as maxima. (see also -readmax option)
 +
Phase 2: In each rolling window of time points (see -w), examines the intensity over time of each maxima
 +
        (found in previous step) to see if it
 +
        meets certain criteria (i.e., looks like a vesicle fusing with the plasma membrane - undergoing
 +
        exocytosis).  If it matches this criteria it prints out the "path" of the maxima and its
 +
        pixel value and iod value.  These paths can be converted to rpts format for
 +
        addlines or xmgr format
 +
        using found4.pl. 
 +
The fusion model: think of intensity as shown below. once the vesicle primes its intensity jumps. when it fuses
 +
it drops back down.
  
Restores all the i2i files in the current directory. Skips any files with   _.i2i or _r.i2i in their name.
+
peak intensity profile:
Also ignores any files which do not have dat or ctx in their name.
+
   pintens                  ----------------
 +
                          |                |
 +
                        |                  |
 +
                        |                    |
 +
  tintens -------------                      ------------------
  
options:
+
          0  t1       t2                  t3
-dummy just print what would be done
+
          t1      |prise|              |ffall|
-bkgnd=# pass this through to find_bkgnd as the -a option. eg, -bkgnd=-.10 will lower the bkgnd value
 
which is subtracted off by 10 percent.
 
        -smooth=#       smoothness factor (smaller is less smoothing). default = .00002
 
        -iterations=#  maximum number of iterations, default = 999
 
        -scale=#:#      GFP and RFP output scaling for restoration (respectively). default = 1.0 and 1.0.
 
-verbose echo what is being done
 
        -maxfiles=# only analyze this many files. primarily for debugging
 
-twod during background subtraction, vary the background value for each 2D slice, instead of
 
just using the same value for all z slices.
 
-files=:file.i2i:...:filen.i2i   just restore these files. and do it even if _.i2i or _r.i2i exists.
 
-dont_restore  do the data prep (filename_.i2i and filename__.i2i produced), but don't do the restoration (but not filename__r.i2i).
 
-beowulf queue the restorations to run on our beowulf (dispatched via qsub, using pbs (torque), from a daemon running on m13)
 
rather than immediately on the localhost.
 
see also: pbsnodes (on m13, only servers running fc16 or fc17 are on the allowed list right now)
 
          qstat -f (on m13) will show lots of info on each job.
 
If this is not specified, each restoration is run sequentially, with this script blocking while waiting for each one.
 
-gpu only use this if you are logged into zirconium. It will run the restoration on zirconium using the GPU version
 
of the restoration.
 
-outdir=dir    rather than place the results in the current directory, place it in the fully qualified specified directory.
 
leave off the last /
 
      -GFPpsf=file    fully qualified path to GPFpsf (used when file name is *_#_#_1*.i2i, eg,  file_0_1_1.i2i)
 
default = /storage/big1/lml/Corvera/Olga/data/GFPpsf_segxyz_.i2i
 
note: psf should have background values of ~0, otherwise 0-padding will produce blocking artifacts.
 
      -RFPpsf=file    fully qualified path to RPFpsf (used when file name is *_#_#_2*.i2i, eg,  file_0_1_2.i2i)
 
default = /storage/big1/lml/Corvera/Olga/data/RFPpsf_segxyz_.i2i
 
note: psf should have background values of ~0, otherwise 0-padding will produce blocking artifacts.
 
-silent print less info
 
  
 +
t1: time of tethering (should stop moving)
 +
t2: time of priming (peak intensity increases from tintens to pintens)
 +
t3: time of fusing (peak intensity drops back down, but iod should stay high and possibly even increase a bit)
 +
prise is the time it takes to rise froom tintens to pintens during priming (docking)
 +
ffall is the time it takes to fall from pintens to tintens during fusion.
 +
 +
exo4 is similar to exo3 but has slightly different options and checks all possible fusion times
 +
simultaneously. exo3 only picked the latest (in time) possible fusion event based only upon intensity
 +
changes during the falltime. exo4 considers what is happening elsewhen in the window before deciding
 +
on a fusion time. It picks the fusion candidate (iod rise and intensity fall) which is closest in time to
 +
the maxima disappearing (-check_max) and which has a stationary period (-primedtime) within the
 +
specified time range. Hopefully this makes it less likely to make mistakes.
  
  examples:
+
Should work in 2d or 3d.  Only reads in a window of time points at once
cd /storage/big3/kdb/Zeiss/20121004/LectinExp3
+
so should be able to handle large images.
        /home/lml/krypton/Corvera/Olga/prep_and_restore.pl -files=G11_0_1_1_20121004_LectinExp3.i2i:G03_0_1_2_20121004_LectinExp3.i2i
 
      -beowulf -outdir=/storage/big1/lml/Corvera/Olga/data
 
  
  see also:
+
Usage:
epr_beowulf   a GUI front end for submitting individual restoration jobs to the beowulf queue
+
   exo4 [options] inimage.i2i  > inimage.count
/storage/big1/epr/bin/cuda/epr_gpu -cuda 1  if logged into zirconium, will run a single job on the graphics card (like -gpu option).
 
prepdata
 
preppsf
 
  
  note: /storage/big1/lml/Linux/bin /storage/big1/lml/Linux/bin64 and /storage/big1/kef/Linux/bin probably need to be in your
+
Options:
path to successfully run this script.
 
  
   
+
options related to input:
=== prepfiles.pl  ===
+
  -T startt stopt : only examine these time points (0-indexed, inclusive)
prepfiles.pl [options]  
+
  -p numskip numuse : patterned read. skip numskip z planes, then analyze numuse zplanes, then repeat.
 +
  This is useful if the acquisition protocol was, e.g., 1 fps for 1 min, 20 fps for 3 seconds
 +
  repeated over and over, and you only want to look at the 20 fps data.
 +
  numuse must be >= window size (see -w option). Pattern starts at t=0 even if -T is
 +
  specified (but startt time points are still skipped).
 +
  -w #         : number of time pts in a window, default = 100
 +
                        a negative number means read in entire dataset at once (one big window)
 +
  -jump # : jump # time pts before examining next window of time pts. This doesn't skip data, just
 +
  analyzes a "window" less often (so more has changed). Default = 0
 +
                        which means the very next time pt is added to window (and oldest dropped) and then
 +
                        the window of data is re-evaluated. May not work with -p option.
 +
  -r rptsfile : read in rptsfileshould have one closed object in it. Uses this as a mask for all the planes.
 +
  -d tdim : the time dimension of the image (over-rides anything stored in the header)
 +
  -b #: : blur (smooth) image before looking for objects (maxima), using a window of the specified
 +
: halfwidth (in pixels) in x,y, and z (z width will be set to 0 if 2*width > zdim).
  
Takes a dual-wavelength image and splits it into two separate images (segim_huge), applies scratchng, and prepdata.
+
Phase 1: options related object finding via ascent (see objs_via_ascent2d), info printed out.
Run this from a directory. It will be applied to all images in the directory. There must be
+
          If an object doesn't satisfy these criteria, its maxima is not kept, so it is not considered a maxima
a file called dark.i2i in the directory too. Removes all intermediate files and original 2wavelength image.
+
          for the next stage of processing which tracks maxima into paths and checks if they are fusion events.
 +
          The iod and size specified here are also used later, but the next phase just looks with the square iod region.
 +
  -t threshold : any voxel > threshold in inimage.i2i is tracked to a 3d maxima (default = 0.0).
 +
  -i miniod maxiod : erase all objects whose iod doesn't fall in the specified range (default: 1-1000000000)
 +
  -s minsize maxsize : erase all objects whose size (in voxels, inclusive) doesn't fall in the specified range
 +
  (default = 1-1000000). note: object size and iod might be large since all voxels which
 +
  connect up via steepest ascent algorithm to the maximum count in this first phase.
 +
  -strict_max : ignore "maxima" which are really on a plateau (option might cause
 +
                        saturated maxima to be missed)
 +
  -readmax file : skip phase 1, instead just reading maxima in from the specified file
  
options:
+
Phase 1b: noptions related to fitting Gaussians (not used for anything yet):
   -safe : don't delete the original dual-wavelength image
+
   -g # : fit Gaussians (+ dc term) to each object found (eventually I will use this for something).
   -echo : echo what is being done
+
  only includes pixels in object within # pixels from the brightest point.
 +
  -G # : same as -g, but uses gradient info of fuction during fit (i.e., a different fit routine).
 +
  The -G version seems a bit buggy.
 +
   -n : normalize the Gaussian fom (shouldn't affect individual fits, just allow comparison between fits
  
   
+
Phase 2: options related to "paths" over time:
=== recalc_quadrant2.pl  ===
+
  Maxima must exist for 0 time pts, be stationary for 0 time pts prior to disappearing
align_quadrants.pl calls this program. It is easier to use it than to call recalc_quadrant2.pl manually.
+
  While a maxima is present, a pixel within range only counts as part of object
 +
  if above threshold (-t option). While a maxima is present,
 +
  a region will only be considered if size (pixels > thresh and within range) is within size (-s)
 +
  and iod is within iod (-i option).
 +
  -iodsize #           check iod within +/- range pixels., default = 3
 +
  -maxspeed #   max distance a maxima can move (in pixels) between time points, default = 5
 +
  -diststill #          how far (in x or y) in pixels a maxima can move and still be considered "still",
 +
  (this is the location compared to last position of maxima) default = 0
 +
  -fall time frac   maximum # of time pts peak intensity can take to show the specified fractional decrease
 +
  when vesicle is fusing. default = 10 and 0.300000
 +
  -iodrise frac   the fractional increase in iod which must be seen
 +
  when vesicle is fusing (see -fall). default = 0
 +
  -check_max #   vesicle must also change from max to not a max within # timepts after fusing
 +
  -minpeakval #          peak intensity value must exceed this when vesicle is fusing (-fall time parameter)
 +
  -primedtime # #   minimum and max # of time pts vesicle must be primed before fusing.
  
This program converts from pts printed by play (so in the coordinate system gotten from combining the four quadrant images of a well (with no overlap))
+
options related to output:
to one used by register_images.pl (ie, each pt is in the coordinate system of its own individual image).
+
  -debugpath x y z      print out debug info about the path that passes near (within 5 pixels) here
It also pairs the points up and orders them the way that register_images.pl requires.
+
                        (fgrep output for the word: debugpath). can be used 10 times. 1-indexed.
It assumes the user picked matching pairs of pts in order when using play. Eg, first a pt was picked (s key while holding down middle mouse button),
+
  A -1 for z, means debug any path near x and y, regardless of z value (only if -L used).
then its matching point in a neighboring quadrant was picked. This was then repeated 3 times (so 3 pairs of points are present).
+
  -neardebug #        for -debugpath, definition of near, in pixels, default = 5
note: the file names for the files associated with each quadrant are not stored in the output by default, just the quadrant number,
+
  -onlydebug      : only print out info for debug paths. ignore all other paths.
      use -qnames to change this; they are needed if you want to subsequently have register_images.pl use chained.txt to actually combine the images.
+
  -a : print all info about each object found (like countobjs does) rather than just summary stats
 +
                      : for each time point.
 +
  -o outimage : create an ouput image of marked objects (object ids reused each time point). Max of each
 +
: object will be marked with the negative of the object id.
 +
  -fit_model : fit a square wave to intensity profile of each vesicle found to be fusing (and to debugpaths)
 +
                        not used for anything yet.
 +
  -v : verbose
 +
  -V : very verbose. may produce huge files. put this as first option to get option parsing info out.
  
 +
Examples:
 +
max2d_simple -t 50 inputimage.i2i -p max.pts
 +
exo4 -v -r mask.rpts -d 600 -b 1 -w 100 -jump 20
 +
  -strict_max -readmax max.pts  -s 10 1000 -i 10 1000000 -t 1
 +
      -duration 20 -timestill 20 -maxspeed 5 -iodsize 5 -diststill 2
 +
      -rise 25 .3 -fall 15 .3 -iodrise .1 -minpeakval 60 primedtime 30 90
 +
      -neardebug 2 -debugpath 152 161 237 -debugpath 134 124 -1 
 +
      inputimage.i2i >& inputimage.out
 +
graph_exo3.csh inputimage.out,  which does the following:
 +
    findpaths_exo3.pl -trackxmgr=tmpavg.xmgr inputimage.out
 +
    findpaths_exo3.pl -trackxmgr=tmppeak.xmgr -peak inputimage.out
 +
    findpaths_exo3.pl -trackxmgr=tmpfit.xmgr -finalfit inputimage.out
 +
    findpaths_exo3.pl -trackxmgr=tmpdist.xmgr -distance inputimage.out
 +
    xmgr -graph 0 tmppeak.xmgr tmpfit.xmgr -graph 1 tmpavg.xmgr -graph 2 tmpdist.xmgr &
 +
in xmgr: Edit->Arrange Graphs, select all the graphs, then set rows to 3,
 +
        Edit-Preferences set Crosshair cursor, linked scrolling.
 +
findpaths_exo3.pl -trackrpts=tmp.rpts -printfusion=4 inputimage.out
 +
addlines inputimage.i2i tmp.rpts - | play -P -1 R -P -2 G -
 +
dave -n 0 -u -K -I inputimage.i2i tmp.rpts
  
recalc_quadrant2.pl [options] < pts.txt > chained.txt
+
source code in /home/lml/krypton/facil
 +
see also:
 +
  objs_via_ascent,  ~lml/krypton/Huang/TIRF4/found4.pl, run7
 +
#/home/lml/krypton/bin/exo4
  
options:
 
-res=# resolution the display was downsampled by prior to getting coords (ie, what was used in chres, see below).
 
if chres was .5, then -res=2, ie, 1/chres value. default = 2.
 
-xdim=# default = 1392
 
-ydim=# default = 1040
 
-qnames=name0:name1:name2:name3    file names associated with the images used to produce each of the 4 quadrants.
 
  they must be in this order. If not specified, then the output will not be
 
  usable by register_images.pl (unless -root is implemented there).
 
-outimage=image.i2i also produce an output combined image (ie, call register_images.pl, see below).
 
-qnames required for this option.
 
-blend if -outimage is specified, then blend the overlapping images to produce the output image.
 
-verbose print overlap info to stderr. maybe to use in -o option to combine_images.
 
-debug stuff to stderr
 
  
more info. the quadrants in the combined image (see combine_images below) are numbered as follows:
+
</nowiki>
quadrant 1 |  quadrant 3
+
===  exo6 ===
quadrant 0  |  quadrant 2
+
<nowiki>
    where x increases to the right, y increases up
+
This programs find vesicle fusion events in a 2D time series.
  
example:
+
Each maxima (-readmax) gets a size and iod associated with it.  Only pixels > threshold (-t)
 +
within the iod region (-iodsize) count toward the iod and size.  Once the maximum disappears
 +
(-nomax_length) the region centered around the previous location of the maximum is used.
 +
Maxima are tracked from one time pt to the next by finding the closest maxima (within -maxspeed)
 +
to its previous location.  Tracks continue after the maximum disappears for -nomax_length time pts.
  
# combine the 4 well images without overlap to see what pts might match between quadrants:
+
At the end of this time, the path is then analyzed to see if it meets criteria for a fusing vesicle.
    combine_images -o 0 F06_0_2_0_20140505_GEDMAT_P025_WES_OM_Day14.i2i F06_1_2_0_20140505_GEDMAT_P025_WES_OM_Day14.i2i 
+
All time pts during which the maxima exists must have an iod within the correct range (-i) and
          F06_2_2_0_20140505_GEDMAT_P025_WES_OM_Day14.i2i F06_3_2_0_20140505_GEDMAT_P025_WES_OM_Day14.i2i tmp.i2i
+
and correct size (-s). The fusion time is identified by the intensity of the maxima falling
 +
fast enough and far enough (-fall); while within the same interval the iod rises enough (-iodrise).
 +
Fusion time is then further refined to be the time of largest iod increase (between adjacent time pts)
 +
within this interval.
  
# look at the resulting image and identify matching pts:
+
A fusion event may also need to be the correct time interval from when the maxima disappears (-check_max).
    chres -S .5 .5 1 tmp.i2i - |play -     # save (s) pairs of pts which match between the quadrants. print them using z.  create file F06_pts.txt:
+
It may also need to be significantly brighter than the background (-minpeakratio).
marked points
+
It may be required to have a minimum peak value during fusion (-minpeakval).
x= 769 y= 497 z=  1 set=  1 value=    3099
 
x= 799 y= 525 z=  1 set=  1 value=    3684
 
x= 709 y= 819 z=  1 set=  1 value=    4039
 
x= 682 y= 854 z=  1 set=  1 value=    3974
 
x= 518 y= 497 z=  1 set=  1 value=    3257
 
x= 543 y= 524 z=  1 set=  1 value=    3436
 
  
# now use this program to multiply by 2, subtract xdim (1392) and/or ydim (1040) as appropriate, pair and order pts.
+
Once the fusion time is found, the program finds the stationary (-diststill) time interval prior to fusion.
    recalc_quadrant2.pl -outimage=F06_combined.i2i -qnames=F06_0_2_0_20140505_GEDMAT_P025_WES_OM_Day14.i2i:F06_1_2_0_20140505_GEDMAT_P025_WES_OM_Day14.i2i:F06_2_2_0_20140505_GEDMAT_P025_WES_OM_Day14.i2i:F06_3_2_0_20140505_GEDMAT_P025_WES_OM_Day14.i2i  < F06_pts.txt > F06_chained.txt
+
This (priming) time interval must be within certain constraints (-primedtime) for the path to be considered
 +
representing a valid fusion event.
 +
 +
exo6 is similar to exo4 but reads in one time point at a time, there is no concept of a "window"
 +
It only works on a 2D time series
 +
 
 +
Usage:
 +
  exo6 [options] -readmax max.rpts inimage.i2i  > inimage.count
 +
 
 +
Options:
 +
 
 +
options related to input:
 +
  -T startt stopt : only examine these time points (0-indexed, inclusive)
 +
  -r rptsfile : read in rptsfile.  should have one closed object in it. Uses this as a mask for all the planes.
 +
  -d tdim : the time dimension of the image (over-rides anything stored in the header)
 +
  -b #: : blur (smooth) image before looking for objects (maxima), using a window of the specified
 +
: halfwidth (in pixels) in x,y, and z (z width will be set to 0 if 2*width > zdim).
 +
  -readmax file : read maxima in from the specified file (this is REQUIRED)
 +
 
 +
options related to finding fusion events:
 +
  -t threshold : any voxel > threshold in inimage.i2i is tracked to a 3d maxima (default = 0.0).
 +
  -i miniod maxiod : erase all objects whose iod doesn't fall in the specified range (default: 1-1000000000)
 +
  -s minsize maxsize : erase all objects whose size (in voxels, inclusive) doesn't fall in the specified range
 +
  (default = 1-1000000). note: object size and iod might be large since all voxels which
 +
  connect up via steepest ascent algorithm to the maximum count in this first phase.
 +
  -iodsize #           check iod within +/- range pixels., default = 3
 +
  -maxspeed #   max distance a maxima can move (in pixels) between time points, default = 5
 +
  -diststill #          how far (in x or y) in pixels a maxima can move and still be considered "still",
 +
  (this is the location compared to last position of maxima) default = 0
 +
  -fall time frac   maximum # of time pts peak intensity can take to show the specified fractional decrease
 +
  when vesicle is fusing. default = 10 and 0.300000
 +
  -startfall time   how close (in timepts) in time the peak intensity must start to fall in relation
 +
  to the fusion time (biggest jump in iod between two consecutive time pts). default = 1
 +
  -iodrise frac   the fractional increase in iod which must be seen
 +
  when vesicle is fusing (see -fall). default = 0
 +
  -check_max min# max#   vesicle must also change from max to not a max >= min# timepts and <= max# timepts after fusing
 +
  -nomax_length #        only analyze a path # time pts after max first disappears
 +
                        the default (which is also the minimum allowed value) = 1
 +
  -minpeakval #          peak intensity value must exceed this sometime while vesicle is fusing (-fall time  parameter)
 +
  default value = 0
 +
  -minpeakratio ratio# time# dist#:   the ratio of maxval/(median bkgnd value) must >= ratio# within
 +
  time# time steps of fusion.
 +
  bkgnd values are those pixels whose distance from max is >= dist# and <= iodsize
 +
  defaults: not to check this at all
 +
  -primedtime # #   minimum and max # of time pts vesicle must be primed before fusing.
 +
 
 +
options related to speed:
 +
  -nomedian   if -minpeakratio is defined, this causes the avg bkgnd value to be used instead
 +
  of the median value (calculation of median can be expensive).
 +
  -buffered_read #   read # z planes at a time to speed up disk I/O. Default is 1 z plane at a time
  
# same thing, but in two steps.
+
options related to output:
    recalc_quadrant2.pl -qnames=F06_0_2_0_20140505_GEDMAT_P025_WES_OM_Day14.i2i:F06_1_2_0_20140505_GEDMAT_P025_WES_OM_Day14.i2i:F06_2_2_0_20140505_GEDMAT_P025_WES_OM_Day14.i2i:F06_3_2_0_20140505_GEDMAT_P025_WES_OM_Day14.i2i  < F06_pts.txt > F06_chained.txt
+
  -debugpath x y z      print out debug info about the path that passes near (within 5 pixels) here
    register_images.pl -zdim=5 -xscale=1 -yscale=1 -post= -debug -out=F06_combined.i2i F06_chained.txt
+
                        (fgrep output for the word: debugpath). can be used 10 times. 1-indexed.
 +
  A -1 for z, means debug any path near x and y, regardless of z value (only if -L used).
 +
  -neardebug #        for -debugpath, definition of near, in pixels, default = 5
 +
  -onlydebug      : only print out info for debug paths. ignore all other paths.
 +
  -a : print all info about each object found (like countobjs does) rather than just summary stats
 +
                      : for each time point.
 +
  -o outimage : create an ouput image of marked objects (object ids reused each time point). Max of each
 +
: object will be marked with the negative of the object id.
 +
  -v : verbose
 +
  -V : very verbose. may produce huge files. put this as first option to get option parsing info out.
  
 +
Examples:
 +
max2d_simple -t 50 inputimage.i2i -p max.pts
 +
exo6 -v -r mask.rpts -d 600 
 +
  -readmax max.pts  -s 10 1000 -i 10 1000000 -t 1
 +
      -timestill 20 -maxspeed 5 -iodsize 5 -diststill 2
 +
      -fall 15 .3 -iodrise .1 -minpeakval 60 primedtime 30 90
 +
      -neardebug 2 -debugpath 152 161 237 -debugpath 134 124 -1 
 +
      inputimage.i2i >& inputimage.out
 +
graph_exo3.csh inputimage.out,  which does the following:
 +
    findpaths_exo3.pl -trackxmgr=tmpavg.xmgr inputimage.out
 +
    findpaths_exo3.pl -trackxmgr=tmppeak.xmgr -peak inputimage.out
 +
    findpaths_exo3.pl -trackxmgr=tmpfit.xmgr -finalfit inputimage.out
 +
    findpaths_exo3.pl -trackxmgr=tmpdist.xmgr -distance inputimage.out
 +
    xmgr -graph 0 tmppeak.xmgr tmpfit.xmgr -graph 1 tmpavg.xmgr -graph 2 tmpdist.xmgr &
 +
in xmgr: Edit->Arrange Graphs, select all the graphs, then set rows to 3,
 +
        Edit-Preferences set Crosshair cursor, linked scrolling.
 +
findpaths_exo5.pl -rptsfile=tmp.rpts -rptstracks -printfusion=4 inputimage.out
 +
addlines inputimage.i2i tmp.rpts - | play -P -1 R -P -2 G -
 +
dave -n 0 -u -K -I inputimage.i2i tmp.rpts
  
 +
source code in /home/lml/krypton/facil
 
see also:
 
see also:
/home/lml/krypton/Corvera/Raz/README 5/15/14
+
  objs_via_ascent,  track_back2, ~lml/krypton/Huang/TIRF4/findpaths_exo5.pl, run7, graph_exo3.pl
align_quadrants.pl
+
#/home/lml/krypton/bin/exo6
recalc_quadrant.pl
+
 
combine_images
+
 
combine_images.pl
+
</nowiki>
register_images.pl
+
=== find_2d_objs  ===
insert_image2
+
<nowiki>
 +
 
 +
For each z slice (time point) in the image, find 8-connected objects.  Print info to stdout.
 +
Only voxels > threshold can be part of an object (default = 0.000000). Doesn't use much memory (reads in a slice at a time).
 +
Should handle our regular (short int) image format and floating point images.
 +
 
 +
Usage:
 +
find_2d_objs [options] image1.i2i
 +
Options:
 +
-s min max: object must be within this size in pixels (inclusive), default = 1 100000
 +
-b min max: object IOD must be within this range (inclusive), default = 1.000000 1000000000.000000
 +
-t #: threshold for image1.i2i default = 0.000000
 +
-T #: adaptive threshold. # = pixel intensity/mean intensity for each time pt. must be > # to be in object.
 +
If -o specified, only pixels under the mask counted calculating mean intensity.
 +
-i thresh.i2i: use with -T option if desired. thresh.i2i is used to calculate the threshold intead of image1.i2i
 +
If -o specified, then that mask will also be applied to thresh.i2i.
 +
-n image.i2i: write out new image with all voxels not part of an object set to 0
 +
-z low high: only analyze z slices from low to high (1-indexed, inclusive).
 +
      -o mask.i2i:    apply mask image to before analyzing it. only keep pixels in image1.i2i under mask pixels > 0.
 +
mask.i2i must be in our standard image format (short int). If 3d, only first 2d image used.
 +
  -v: verbose
 +
 
 +
See also: pt_distances, max2d, max3dL, maxima, maxL, maxzL, float2intL, int2float, playexact
 +
            track, max2d_simple, countobjs
 +
 
 +
Example:
 +
        # find all objects between 5 and 30 pixels, minimum iod of 200, above a threshold of 100, write out new image:
 +
    find_2d_objs -t 100 -s 5 30 -b 200 1e9 -n newimage.i2i image.i2i > image.objs 
  
 +
Source code in ~krypton/lml/facil 
 
   
 
   
===  register_images.pl ===
+
</nowiki>
 +
===  find_blobs ===
 +
<nowiki>
 +
/home/lml/krypton/bin/find_blobs
 +
insufficient number of arguments
 +
This program pads an image in z, then calls "invariant" (with -F 10) to produce multiple resolutions
 +
of the original image along with its 2nd derivative in the gradient direction.
 +
The blurred originals are used to find the location of the maxima. The derivative images should
 +
have a zero crossing at the inflection points (eg, "edges"). The maxima should be in regions with
 +
negative second derivative. This program then calls flood2zero to find the spatial extent of each
 +
"blob" (bright region surrounding the maxima). Ideally this should just be a flood fill until
 +
the zero crossing is found, but noise, etc. means that a lower threshold works better.
  
Takes a bunch of images taken in one well on the microscope, translates them
+
USAGE: find_blobs [options] inputimage.i2i outputroot
based on ChainedTrans.txt and combines them into one big image.
 
  
ChainedTrans.txt should be a partially ordered file with entries like
+
output extensions of files produced (in same directory as inputimage.i2i):
X02:X03    (685,282):(736,287)  
+
      .ppts          padded points coords (location of maxima in blurred, but not deriv, image).
This means that location (685,282) in file X02 is the same as location (736,287) in file X03.
+
      .pts            unpadded points, with z value transformed back to unpadded coordinates
By partially ordered I mean that for file1:file2  file1 should already have been the
+
      .bpts          unpadded points after filtering to keep bright points (\>= min_intensity)  
right hand side of a similar line previously (so its position is already defined relative to
+
      .dpts          bpts with "unordered" -> "ordered" and "break" -> "#moveto", for display in DAVE
the file on the left hand side), unless it is the very first line in
+
      _bres#.i2i      blurred, but no derivatives, at resolution level = # (bigger # = lower res.)
the file. So every right hand side is relative to a left hand side which has already
+
      _dres#.i2i      blurred & derivatives taken, at resolution level = #
had its position defined.
+
      _dres#_obj.i2i  objects found in *_dres#.i2i by floodfilling from points in *.bpts
Output goes to new_trans.i2i
+
      _dres#.obj      statistics on *_dres#_obj.i2i
 +
      _flood.out      output from flood2zero
 +
      .out            output from invariant
  
register_images.pl [options] ChainedTrans.txt
 
-out=filename.i2i  name of output file produced. default = newimage.i2i
 
-post=string the rest of the filename after what is in ChainedTrans.txt, eg, if the file is named
 
X01_0_0_1.i2i, -post=_0_0_1.i2i (this is also the default for post if not specified).
 
-xdim=# size of original each original image (before recaling by maxtrima, see example below). default = 1392.
 
-ydim=# default = 1040
 
-zdim=# default = 21
 
-xscale=# binning done by matrixima (see example), coords will be scaled by this. default = 4.
 
-yscale=#
 
-blend when combining images, blend the values where they overlap (default is to just replace any previous
 
value with the new value).
 
    -dummy
 
-debug
 
-h
 
  
 +
options: 
 +
    -m #:   any maxima less than this will get filtered out, default = 1
 +
    -d #:   any derivative voxel with a value >= # will stop the flood fill
 +
                  this is in the original, floating point coord system (prior to 
 +
                  rescaling to write out deriv. image). default = -5
 +
    -p #:   pad data in z so that we don't have wrap around problems, default = 10
 +
    -z #:   number of z planes (in original image) to skip in front and back when
 +
                finding blob voxels - the derivative calculation tends to create negatives
 +
                  in the first and last few planes. default = 2 
 +
    -r #:   number of resolutions to calculate, default = 1
 +
    -e #:   maximum spatial extent of object in pixels (ie, radius), default = 5
 +
                    this is needed since the floodfill can otherwise escape and fill huge
 +
                    volumes (the first and last z slices tend to be all negative, along with
 +
                    negative values in the background regions).
 +
    -s #:    maximum number of voxels in object, default = 300
 +
    -N #:   normalize image prior to use so its max = #, default = 10000
 +
    -b sigx sigy sigz:  standard deviation,in pixels, of Gaussian used in blurring
 +
                    (passed as args for -s option of invariant), default = 2 2 1
  
-shift no circular shift (see tranima). old.
+
examples:
note: tranima will pad images with -32768 which play will show in red (I think) and DAVE will be bothered by.
 
  
example:
+
    find_blobs control3cluster4r_r_cell.i2i c3c4F10
matrixima -row 4 W X Y Z -col 3 01 02 03 -pos 0 -obj 0 -fil 1 new.i2i
+
    dave -n 0 -u -z 1 -I control3cluster4r_r_cell.i2i -I c3c4F10_dres0_obj.i2i -S 2 1 0 c3c4F10.dpts
play new.i2i  -> ChainedTrans.txt
 
        register_images.pl ChainedTrans.txt
 
        dave -I new_trans.i2i -K -z 15  # a very big file.
 
 
 
source code: ~/krypton/bin/
 
see also:
 
combine use this on newer images which have spatial information stored in their header
 
parsepos.pl
 
~/krypton/Corvera/Olga
 
/storage/big1/lml/Corvera/Olga
 
recalc_quadrant.pl
 
recalc_quadrant2.pl
 
align_quadrants.pl the simplest manual method of aligning the four images in the well
 
  
 +
source for this cshell script is in /storage/big1/lml/was_invitro/unc/curvature
 
   
 
   
===  smooth_gaps.pl ===
+
</nowiki>
  This program applies smooth_gaps to all files named *reduced.i2i
+
===  find_vessels ===
  and produces files named *reduced_sg.i2i (unless -tag changed it).
+
  <nowiki>
  
  usage:
+
This program takes an image and scans it vertically in y at dx intervals.  It counts the number of
smooth_gaps.pl -run [options]
+
times a vessel of at least the specified width is entered.  A vessel is any pixel with the specified
 +
intensity value.  Each z slice in analyzed separately (and read in sequentially).  A count of vessels vs time and dx displacement is
 +
written to stdout.
 +
See /home/lml/krypton/Corvera/grant2010.  
  
  options:
+
Usage: find_vessels [options] image.i2i
-tag=something    tag to add before the .i2i in the new file name.
+
options:
-verbose   print out each filename as it is being smoothed.
+
  -z start stop: zplanes to analyze. 0-indexed inclusive. default is all z planes
-dummy   just echo what would be done, but don't do anything
+
  -i #: intensity of a pixel in the vessel. default = 32767
 +
  -w #: minimum vertical width of vessel in pixels, default = 2
 +
  -d #: dx step size, default = 100
 +
  -v: verbose
  
  see also:
+
Source in /home/lml/krypton/facil
smooth_gaps
+
See Also:
 +
Examples:
 +
 +
</nowiki>
 +
===  fit3gaussians  ===
 +
<nowiki>
 +
# /home/lml/krypton/bin/fit3gaussians -h
 +
This fits a 3 component (Gaussian diffusion) model to Joan Politz's data.
  
+
Usage:
===  trans.pl  ===
+
  fit3gaussians [options]
  
Takes a bunch of images taken in one well on the microscope, translates them
+
Description:
based on ChainedTrans.txt and combines them into one big image.
+
  Fits a three component Gaussian model to time series data.
  
ChainedTrans.txt should be a partially ordered file with entries like
+
Options:
X02:X03    (685,282):(736,287)  
+
  -a      : rather than having data fit a 3D diffusion model, have it fit a 2D model.
This means that location (685,282) in file X02 is the same as location (736,287) in file X03.
+
  -d # #  : only look at data sets from # to # (inclusive, first data set = 0).
By partially ordered I mean that for file1:file2 file1 should already have been the
+
            timings for the available data sets are (in seconds after uncaging):
right hand side of a similar line previously (so its position is already defined relative to
+
before_uncaging  0.050000  0.550000  1.050000  1.550000  11.550000  21.549999 
the file on the left hand side), unless it is the very first line in
+
31.549999  0.000000  0.000000  0.000000  0.000000  0.000000 
the file. So every right hand side is relative to a left hand side which has already
+
0.000000 
had its position defined.
+
            default data sets to look at are 1 to 4
Output goes to new_trans.i2i
+
  -e # #  : change the time in dataset # (0-indexed) to # (in seconds)
 +
  -f file : file name for test data (as produced by "distances" program).
 +
  -F file : file name for times for all the datasets from file, one time per line.
 +
            this also changes the default range to be all the sets
 +
            (use -d after this on the command line if you want to change the sets used).
 +
      note: there must be less than 1000 datasets.
 +
  -n # #  : number of function parameters and variances used for  
 +
            each parameter (default 10 paramters and  5 variances)
 +
  -p # #  : set function parameter number to some value (first # can be 0 to
 +
            the maximum number of parameters)
 +
  -s # # : set function paramter # start value to some value (first # can be 0 to
 +
            the maximum number of parameters)
 +
  -S # #  : set function paramter # variance value to some initial value (first # can be 0 to  
 +
            the maximum number of parameters)
 +
  -r # # #: set function paramter # range values to some initial values (first # can be 0 to
 +
            the maximum number of parameters)
 +
  -t #    : maximum number of random trials to search for parameters (default=100).
 +
  -T #    : search terminates when # successive times the smallest variance search is best. (default=5)
 +
  -m #    : maximum number of times to perform search, regardless of best variance (default=1000).
 +
  -M #    : maximum number of times try (for each parameter) to find a point within allowed range
 +
            default = 100
 +
  -D func #: print debug info. for specified function at level #
 +
              func 1: ars, levels: 1-4 with 4 being most info.
 +
              func 2: radial search, levels: 1-2
 +
              func 3: finding a test point, levels: 1-2
 +
  -P      :  just print out the data and theoretical curves for the start point and terminate.
  
register_images.pl [options] ChainedTrans.txt
+
example (see ~lml/vision/Politz/run)
-out=filename.i2i name of output file produced. default = newimage.i2i
+
default settings are:
-post=string the rest of the filename after what is in ChainedTrans.txt, eg, if the file is named
+
  t1 in seconds                  : range: -4.900E-02 to  5.500E+00, start: -2.500E-02
X01_0_0_1.i2i, -post=_0_0_1.i2i (this is also the default for post if not specified).
+
  D1 in microns^2/sec            : range:  1.000E-02 to  1.000E+02, start: 5.000E+00
-xdim=# size of original each original image (before recaling by maxtrima, see example below). default = 1392.
+
  mag1 in intensity/micron^3      : range:  5.000E+01 to  3.000E+04, start:  3.000E+03
-ydim=# default = 1040
+
  dc value                        : range:  0.000E+00 to  2.000E+03, start:  2.000E+02
-zdim=# default = 21
+
  D2                              : range:  1.000E-01 to  1.000E+03, start:  1.000E+02
-xscale=# binning done by matrixima (see example), coords will be scaled by this. default = 4.
+
  mag2                            : range:  5.000E+00 to  3.000E+04, start:  3.000E+02
-yscale=#
+
  t2                              : range: -4.900E-02 to  5.000E+03, start:  5.000E+02
-blend when combining images, blend the values where they overlap (default is to just replace any previous
+
  D3                              : range:  1.000E-01 to  1.000E+03, start:  1.000E+02
value with the new value).
+
  mag3                            : range:  5.000E+00 to  3.000E+04, start:  3.000E+02
    -dummy
+
  t3                              : range: -4.900E-02 to  5.000E+03, start:  5.000E+02
-debug
 
-h
 
  
 +
</nowiki>
 +
===  flood2zero  ===
 +
<nowiki>
  
-shift no circular shift (see tranima). old.
+
This program takes an original 3D image, a 2nd derivative image
note: tranima will pad images with -32768 which play will show in red (I think) and DAVE will be bothered by.
+
as produced by invariant -F 9 -b, and a list of 3d maxima and produces
 +
a new image which is just those voxels from orig.i2i that are negative
 +
(the 2nd derivative of a bright spot is < 0) in the derivative image
 +
and connected to a 3D maxima. So it is used in conjuction with invariant
 +
to identifiy bright blobs (eg, synapses) in a 3D image.
  
example:
+
Usage: flood2zero [options] orig.i2i deriv.i2i image.pts newimage.i2i
matrixima -row 4 W X Y Z -col 3 01 02 03 -pos 0 -obj 0 -fil 1 new.i2i
+
options:
play new.i2i  -> ChainedTrans.txt
+
  -b # : which resolution of maxima to use (object=noderiv_maxima# in pts file)
        register_images.pl ChainedTrans.txt
+
  -v #  : instead of using 0 as the object boundary cutoff, use #
        dave -I new_trans.i2i -K -z 15 # a very big file.
+
        -z low hi: zrange to examine, zero-indexed, inclusive.
 +
  -d dist: max chessboard distance (in voxels) from each point to flood fill.
 +
  -s size: maximum size in voxels of an object (will truncate to this size), default= 10000
 +
  -o file: save object (blob) statistics to specified file. This is very similar to
 +
what countobjs would produce when applied to newimage.i2i except newimage.i2i
 +
can have blobs which touch (due to the size contraints here) and hence show
 +
up as one large blob instead of two smaller blobs. Also, if the header for the
 +
image has a scale factor in it (which invariant writes) this scale factor will
 +
be used to convert all statistics back into original unscaled values.
 +
 
 +
note: entire image name (with extension) is NOT required.
 +
note: a - in place of an image name means stdin or stdout.
 +
note: a compressed image will be automatically be uncompressed.
 +
[source in /usr/people/lml/invitro/unc/curvature/flood2zero.c]
 +
 +
</nowiki>
 +
===  gsearch  ===
 +
<nowiki>
 +
program to do graph search on a slice of edge image
 +
USAGE:
 +
example gsearch -d name -x # -y # -a # -b # edge.i2i text.gpts
 +
    edge.i2i : magnitude input image
 +
    text.gpts: output is a graph points (gpts) text
 +
file having the same format as rpts file
 +
new boundary is stored under z=slice # (default: 1)
 +
 
 +
Options:
 +
-d  option specifies name of image containing direction of each edge
 +
    pixel of edge.i2i
 +
-k option specifies constant of proportionality
 +
    to be used with filgra (default: 1.0)
 +
-x  start x coordinate.
 +
-y  start y coordinate.
 +
-a  stop x coordinate.
 +
-b  stop y coordinate.
 +
-h prints this message.
  
source code: ~/krypton/bin/
 
see also:
 
combine use this on newer images which have spatial information stored in their header
 
parsepos.pl
 
~/krypton/Corvera/Olga
 
/storage/big1/lml/Corvera/Olga
 
recalc_quadrant.pl
 
recalc_quadrant2.pl
 
align_quadrants.pl the simplest manual method of aligning the four images in the well
 
  
 +
Source code in /storage/big1/lml/jac/was_invitro/graph
 
   
 
   
===  blur3d ===
+
</nowiki>
 +
===  histogram2 ===
 +
<nowiki>
 +
Usage:
 +
  histogram2 [options] boundary.i2i aimage.i2i bimage.i2i
 +
Description:
 +
  This program creates a number of histograms of intensity or volume as a function of
 +
  distance of the object voxels from the nearest background voxel.
 +
  Requires:
 +
    boundary.i2i - boundary image created with boundary or createBoundary.
 +
object voxels are those with a value of 6
 +
background voxels are those with a value of 4
 +
border voxels are those with a value of 2
 +
all other voxels are ignored.
 +
            NOTE: by default this is assumed to be padded by 7 pixels all around.
 +
                  ie, IT IS LARGER THAN aimage.i2i and bimage.i2i
 +
                  createBoundary does this. see -p if you don't want this default.
 +
    aimage.i2i  - data image a.
 +
    bimage.i2i  - data image b.
 +
  Returns:
 +
    aimage_H.histo - output file with histogram info (-H can change this).
 +
  Output file format (10 columns):
 +
  1. bin number (i.e., distance from background) (each bin = 0.1 pixels)
 +
      note:a pixel touching the boundary is a distance of .5 (center is .5 from edge)
 +
  2. histogram of intensities in image a.
 +
  3. number of pixels in this bin (i.e., volume at this distance).
 +
  4. histogram of intensities in image b.
 +
  5. histogram of intensities in image a > athreshold (intens-thresh if -s option used).
 +
  6. histogram of intensities in image b > bthreshold (intens-thresh if -s option used).
 +
  7. histogram of intensities in image a, where values in a are such that
 +
      if (image a > athreshold)  and (image b > bthreshold), a=a (a-athresh if -s option) else a=0.
 +
  8. histogram of intensities in image b, where values in b are such that
 +
      if (image a > athreshold)  and (image b > bthreshold), b=b (b-bthresh if -s option) else b=0.
 +
  9. # of pixels in image a > image a threshold (at this distance), like 3 but only
 +
      counting voxels > threshold.
 +
  10.# of pixels in image b > image b threshold (at this distance), like 3 but only
 +
      counting voxels > threshold.
 +
 
 +
Input Options:
 +
  -o    :  border pixels are background voxels (default is object voxel)
 +
  -p x y z  :padding in x,y,z included in the boundary image  (default 7 in all directions).
 +
          (boundary image found in the programs boundary and
 +
            createBoundary are by default padded by 7 pixels
 +
            on all sides of the image.
 +
 
 +
Distance Options:
 +
  -P x y z : don't find histogram of all pixels to boundary, just the distance
 +
            of this pixel from the boundary. Can be used multiple times on command line.
 +
            (x,y,z) is 1-indexed (like play) aimage.i2i coordinate values.
 +
  -d #:    maximum distance (in pixels) to check, default = .5*(min dim)
 +
          Any pixel further than the maximum distance is considered to be at the maximum distance.
 +
          This apply also for the -ta and -tb distance based thresholds.
 +
  -x #  :  set x weight to # (default 1.0).
 +
  -y #  :  set y weight to # (default 1.0).
 +
  -z #  :  set z weight to # (default 1.0).
 +
  -F    :  Fast histogram - voxel level (default fast).
 +
  -S    :  Sub-voxel resolution histogram(default fast).
 +
  -Y # #:  limit Y direction from # to # (default off).
 +
          If the long axis of the cell is in the in the y direction,
 +
          and the cell is cut off, using the -Y option will limit searching
 +
          for the boundary in that direction, i.e. the ends past these values will
 +
          not be considered part of the boundary.
 +
          (similarly true for -X and -Z options)
 +
  -X # #:  limit X direction from # to # (default off), inclusive, 1-indexed.
 +
  -Z # #:  limit Z direction from # to # (default off).
 +
  -c:    pixels outside the image are considered border pixels.  For example, if the outlines
 +
          used to create boundary.i2i were in z=1, but you want pixels inside the z=1 boundary
 +
          to be counted as being 1 pixel away from the boundary (eg, from the phantom z=0 slice)
 +
          use this option.
 +
 
 +
Threshold Options:
 +
  -a #  :  set aimage threshold to # (default 0.000000).
 +
  -b #  :  set bimage threshold to # (default 0.000000).
 +
  -s :    subtract thresholds (and then clamp to >=0) rather than simply keeping intensities > threshold.
 +
          This is more like what you might want to do to subtract off background or nonspecific flourescence.
 +
  -ta athresh.txt  :  apply different thresholds at different distances to aimage.i2i.
 +
                    athresh.txt as produced by analyze_histo (applied to -f aimage_H.i2i output)
 +
  (i.e., 2 columns: bin # (tenths of a pixel) and threshold).
 +
  -tb bthresh.txt  :  like -ta, but for bimage.i2i
 +
  -ra # :  rescale athresh.txt prior to use, multiply values in file by #.
 +
  -rb # :  rescale bthresh.txt prior to use, multiply values in file by #.
 +
 
 +
Ouput Options:
 +
  -f aimage_H.i2i xdim ydim:  print out a full histogram of aimage. This is a
 +
          2D image (eg, aimage_H.i2i) with the specified x and y dimensions.
 +
          The x direction is pixel intensity, and the y direction bin number (tenths of a pixel) and
 +
          the pixel value wll be set to the number of voxels at that distance and that intensity.
 +
          Specify -1 for xdim or ydim if you want that dimension calculated automatically
 +
          (xdim will be approx. max intensity in image and ydim about 10*max dist, see -d option).
 +
          Explicitly set the dimensions if you will want to add this image with others (since they must all
 +
          be the same dimensions), e.g., to average data from a set of control files.
 +
          note: -S option will cause the "number of voxels" to appear to change.
 +
          Use the analyze_histo program to produce a distance dependent threshold file from this (e.g. to read
 +
          back into histogram2 on another pass via the -ta or -tb option).  This image can be large (25MB).
 +
  -H file: Output filename for histogram (instead of aimage_H.histo).
 +
  -A aimage_thresh.i2i  :  write out aimage.i2i after threshold is applied (for visualization purposes)
 +
                          these are the pixel values used to produce column 5 of aimage_H.histo
 +
  -B bimage_thresh.i2i  :  write out bimage.i2i after threshold is applied (for visualization purposes)
 +
                          these are the pixel values used to produce column 6 of aimage_H.histo
 +
 
 +
Miscellaneous Options:
 +
  -D distimage.i2i  :  print the distance image (for debugging). Each voxel is 100 times its distance
 +
    from the membrane (a pixel neighboring the background has a distance of .5 pixels).
 +
                      This can also be used by mask_image to then mask desired pixels.
 +
  -h    :  print this message.
 +
 
 +
Notes:
 +
  All the images should be oriented in the same direction.
 +
  Entire image name (with extension) is required.
 +
  A - in place of an image name means stdin or stdout.
 +
 
 +
 
 +
Example:
 +
  create_dcim -d 4 -s 234 294 24 -| addlines -P -1 - rob15_nucleus.rpts -|
 +
            flood -e -1 -E 2 -I 6 -b 4 - mask.i2i
 +
  histogram2 -p 0 0 0 -Z 2 23 -d 40 -a 3552 -b 7767 -z 1.34 mask.i2i rob15f_rtm.i2i rob15r_rtm.i2i
 +
 
 +
Example: use a variable distance threshold to subtract background flourescence from dual labeled images:
 +
    addlines -P -1 control_aimage.i2i control_membrane.rpts -| flood -e -1 -E 2 -I 6 -b 4 - mask.i2i
 +
        # create a full histogram so we can use a variable threshold based upon distance from membrane:
 +
    histogram2 -p 0 0 0 -d 40 -z 1.34 -f controla_H.i2i mask.i2i control_aimage.i2i control_aimage.i2i
 +
        # create the variable threshold file:
 +
    analyze_histo controla_H.i2i > controla_H.thresholds
 +
        # repeat for control bimage (e.g., second wavelength):
 +
    histogram2 -p 0 0 0 -d 40 -z 1.34 -f controlb_H.i2i mask.i2i control_bimage.i2i control_bimage.i2i
 +
    analyze_histo controlb_H.i2i > controlb_H.thresholds
 +
        # now apply these thresholds to the real dual labeled (not the control) data:
 +
    addlines -P -1 real_aimage.i2i real_membrane.rpts -| flood -e -1 -E 2 -I 6 -b 4 - real_mask.i2i
 +
    histogram2 -p 0 0 0 -d 40 -z 1.34 -s -ta controla_H.thresholds -tb controlb_H.thresholds \
 +
                    real_mask.i2i real_aimage.i2i real_bimage.i2i
 +
See Also:
 +
  boundary, createBoundary, analysis, analyze_histo, threshold, nucleus_overlaps, mask_image, Corecell.pl.
 +
 
 +
Source code in /storage/big1/lml/jac/was_invitro/Projects/boundary/boundary
 +
 
 +
 
 +
</nowiki>
 +
===  image2ptsL  ===
 +
<nowiki>
  
Blurs an image by a psf.  
+
This program takes an image, and identifies boundary pixels of objects.
FFTs are done with 4 byte floats, so total space needed will be 4 times the padded image size (in voxels)
+
Boundary pixels are foreground pixels which have at least one
plus the size of the two original images (image and psf)
+
backgound pixel among their 8 neighbors.
The input image can be real or short int format. The psf must be short int format.
+
In addition, any foreground pixel which is on the edge of a 2D
note: performs a convolution (not a correlation).
+
slice is also considered a boundary pixel.
note: fixed a small bug. 10/17/11
+
These boundary pixels are written out in "addlines" format.
 +
Each zslice is analyzed sequentially.
 +
Points are unordered, and they are all considered part of one object.
 +
Points in the pts file have their value set to -1
  
Usage: blur3d [options] image psf newimage
+
Usage: image2pts [options] image.i2i pointfile.pts
 
options:
 
options:
  -S #:  scale (multiply) output values by # (to prevent underflow or overflow)
+
  -t #: threshold, above which is foreground. Default = 0
  voxels which after scaling are > 32767 are set to 32767. voxels < -32766 are set to -32766.
+
note: entire image name (with extension) is NOT required.
    -p # # #: pad the image in x, y, and z by the specified amounts
+
note: a - in place of an image name means stdin or stdout.
by default image is padded (with 0) by 1/4 psf width all around,
+
note: a compressed image will be automatically be uncompressed.
so its size for blurring becomes bigger by psf/2.
+
psf is always padded to the same size the image becomes.
+
</nowiki>
Padding is stripped off before newimage is written, so it will be the same size as
+
===  invariant  ===
the original image.
+
  <nowiki>
    -N # # #: pad so that the image has the specified dimensions after padding (just prior to FFT).
+
 
  -n #: pad with # instead of boundary pixel values.
+
This program takes an image, blurs it with a Gaussian of
  -Z:   pad with zero instead of the boundary pixel values.
+
specified standard deviation and then takes derivatives of the image
  -c # # #: the center of the psf is at (#,#,#) zero indexed.  
+
It does all of this in the frequency domain.
                the default is to take the brightest pixel as its center.
+
 
  -Cdon't center the psf at all (default is to center on the max, unless -c is specified).
+
outfile is the root name for derivative of blurred images (outfile_dres#.i2i, unless -M),  plain blurred
  -P:   normalize the psf so each slice (after padding) averages to 1. -P acts like an optical PSF.
+
images (-b option, outfile_bres#.i2i) and/or pts files (-m or -M options, outfile.pts).
        the default is to normalize so the entire psf (after padding) has an average pixel value of 1
+
 
              (the default keeps total light constant).
+
Any function which is a ratio of sum of products of derivatives (eg, (LxxLy + LyzLx)/(LyLy+LzLz))
  -d:   don't normalize at all.
+
can be calculated.  Edit file init_invariant.c in
  -o:   do a cross correlation instead of a blur (convolution)
+
/usr/people/lml/invitro/unc/curvature and recompile on molmed if you want a function which
  -R:   output image as 4 byte floating point instead of short integer.
+
is not listed here.
  -v:  verbose. print more info to stderr.
+
 
 +
Usage: invariant [options] infile.i2i outfile
 +
options:
 +
  -F #:  function to calculate. Default = 1. Available functions are:
 +
  -F 1: LxLx+LyLy+LzLz : 3D gradient squared
 +
  -F 2: .5(Lxx+Lyy+Lzz)/sqrt(LxLx+LyLy+LzLz) : normalized 3D Laplacian
 +
  -F 3: LxLx+LyLy : 2D gradient squared
 +
  -F 4: sqrt(LxLx+LyLy) : 2D gradient
 +
  -F 5: 2(LxxLyy-Lxy^2)/(Lxx^2 + Lyy^2 + 2Lxy^2): 2D light or dark blobs (p. 252 IPMI '91)
 +
  -F 6: 2(LxxLyy-Lxy^2), same a -F 5, no normalization (so noise isn't magnified).
 +
  -F 7: mean curvature of 3D isointensity surface normalized by gradient squared
 +
  -F 8: mean curvature of 3D isointensity surface, no normalization.
 +
  -F 9: 2nd der. in the grad. direction times gradient squared.
 +
  -F 10: 2nd der. in the grad. direction (should = 0 at locations of edges)(use -u option).
 +
  -F 11 XYZ    e.g., -F 11 021  take zero derivatives in X direction, 2 in Y, 1 in Z (Lyyz).
 +
by calling invariant multiple times with various XYZ and using the -g option you
 +
can create a bunch of derivative images which you can then read in and combine
 +
however you like (e.g., my curvature_eigenvectors program)
 +
  -N #: normalize image intensities prior to use to be between 0 and #
 +
this performs: newval = #*(val-minval)/(maxval-minval)
 +
  -u #: during division (-F 2,5,7,10) set divide by 0 to this integer, default=0.
 +
        note: this is the final output pixel value, after any scale factors (-r or -R).
 +
        a good value is -32768, the minimum possible output pixel value.
 +
  -s sigx sigy sigz:   standard deviation in spatial domain of Gaussian.
 +
  -S sigx sigy sigz:   standard deviation in frequency domain of Gaussian.
 +
default = 3.402823E+38  3.402823E+38  3.402823E+38
 +
  -l # res2 res3 ... :  # = number of different resolution levels to calculate.
 +
res2 ... res# are the relative sigmas for each resolution level after
 +
the first one. eg, -l 3 .9 .7 means that 3 blurred levels should
 +
be calculated and the sigma (in the freq domain) of the second
 +
level should be .9 of the first level (ie, more blurred), and the 3rd
 +
level should be .7 of the first level (as specified with -S).
 +
  -L # factor:  # = number of resolution levels. factor is the relative sigmas in
 +
the spatial domain for each level relative to the previous level.
 +
  -e epsiloncutoff for Gaussian intensity calculation.
 +
default = 0.040000
 +
  -r: apply scalefactor to output so min= -32766 or max= 32766. This is useful
 +
especially when all the values would otherwise be < 1.
 +
This also prints to stderr the min and max values before rescaling.
 +
  -R #: rescale output by multiplying all values by #.
 +
  -m: calculate coords of 3D maxima after blurring and taking derivatives.
 +
Creates an outfile.pts file.
 +
  -M: same as -m, but also prevents writing out blurred images.
 +
        -b:         calculate coords of 3D maxima after blurring (but before derivatives). This
 +
        can be used with the -m option. Objects associated with this option will
 +
        be named "noderiv_maxima#", where # is the resolution number.
 +
        This is useful for passing to flood2zero to find the extent of the bright spots.
 +
Also writes out blurred images (outfile_bres#.i2i).
 +
  -B: same as -b, but prevents writing out the blurred images.
 +
  -n #: maxima must have an intensity > # (must use -m, -M, or -b with this)
 +
  -f #: max pixel must be > all neighbors by at least # to be a maxima. default = 0.000100
 +
  -g: output a floating point image (no rescaling done). This output can be used
 +
by my curvature_eigenvectors program. -u option still applies.
  
note: entire image name (with extension) is NOT required.
+
note: image dimensions which factor to 2, 3, or 5 go fastest with the FFT.
note: can read from stdin or write to stdout (use a dash instead of the file name)
+
note: the entire image name is NOT required.
note: a compressed image will be automatically be uncompressed.
+
note: compressed images will be uncompressed.
 +
note: a - in place of an image name means stdin or stdout.
 +
see also: max3d, multi_gauss_deriv, flood2zero, find_blobs, blur_spatial, canny, zerosu.
 +
source in /storage/big1/lml/was_invitro/unc/curvature
 +
/home/lml/krypton/bin/invariant
  
Copyright 2010 University of Massachusetts Medical School and the Biomedical Imaging Group
+
</nowiki>
All rights reserved. Explicit permission to use this program must be received prior to use.
+
===  linux_epr_x86_64-7-12-2012  ===
 +
<nowiki>
 
   
 
   
===  canny  ===
 
  
This program reads in a 2 or 3d image and outputs the results
+
epr                              UMMC/BIG                          Jul 12 2012
of a 2D Canny edge detector on it. Canny is the derivative
+
 
(in the gradient direction) of the magnitude of the first
+
NAME
derivative (so it is a type of 2nd derivative).   
+
    epr - Exhaustive Photon Replacement (EPR) restores contrast by removing
NOTE: see option -n below for an exact answer.
+
    residual out-of-focus light and improves resolution while maintaining
Each z slice is treated
+
    numerical accuracy of 3-D images of specimens obtained with serial
independently of the others. Its application will often be
+
    optical sectioning from wide-field or confocal light microscopy.
preceded by a Gaussian blur and followed by the calculation
+
 
of zero crossings.
+
  SYNOPSIS
If an INT type image is input, an INT is output.  
+
    epr [options] before-image[.tif] after-image[.tif]
If a REAL type image is input, a REAL is output.
+
 
 +
DESCRIPTION
 +
    epr performs regularized, iterative image restoration with a non-
 +
    negativity constraint.  The before-image is a three dimensional (3-D)
 +
    TIFF image composed of rectangular, regularly spaced, optical sections.
 +
    Large images are decomposed into smaller, overlapping (in x and y only)
 +
    image segments for restoration, and the restored segments are recomposed.
 +
    The after-image is the restored 3-D image. All options must appear
 +
    before the image file names, but the order of options is not important.
  
Usage: canny [options] infile outfile
+
    epr has the following options:
  options:
 
-d: Debugging flag
 
-n: normalize the result. This option causes the true 2nd
 
derivative to be calculated. Without it, only the sign
 
of the second derivative is guaranteed to be correct
 
(which is sufficient if only zero crossings will be
 
calculated from it). Divides each point by Ix*Ix+Iy*Iy.
 
-s #:  scale factor to multiply all output values by. This is
 
useful if you are outputing an INTEGER image with a very
 
small range of values which would otherwise all be truncated
 
to just a few numbers.
 
note: entire image name (with extension) is NOT required.
 
note: a - in place of an image name means stdin or stdout.
 
Example usage:
 
To create a gradient edge strength image for a shrink wrap run:
 
  blur_spatial image.i2i -|canny - -|zerosu - - |blur_spatial - out.i2i
 
 
===  cblur  ===
 
 
Usage: cblur [options] arg1.i2i arg2.i2i
 
  For every zero valued point in each xz plane,  cblur
 
  replaces the zero value with the -100 times the distance
 
  from the nearest non-zero voxel in the xz plane.
 
Options: None at this time.
 
  
Note: entire image name (with extension) is required.
+
    -h                Prints basic help on syntax and available options.
Note: a - in place of an image name means stdin or stdout.
 
  
 +
                              Required Parameters
  
=== center_of_mass  ===
+
    -psf file[.tif]  The 3-D point spread function image file. The psf must
 +
                      match the optical configuration used for the before-
 +
                      image. The psf depth (number of z-planes) need only be
 +
                      less-than or equal-to twice that of the before-image.
 +
                      Extra z-planes are symmetrically discarded.
  
This program reads in a 4D image and translates each 3D image
+
    -smoothness alpha The alpha value where alpha is typically 0 < alpha < RNL.
so its center of mass is moved to be the center of the image.
+
    -sm alpha        RNL is the residuals noise limit as reported by prepdata
One 3D image is read at a time.
+
                      (see also). Smaller values of a correspond to less
 +
                      smoothing. (RNL)^2 is usually a good starting choice for
 +
                      alpha.
  
Usage: center_of_mass [options] inimage.i2i outimage.i2i
+
    -iterations n    Maximum number of iterations to perform. Iterating may
options:
+
    -it n            terminate earlier if convergence is detected. (see
  -t tdim:  number of time points, default = 1. This is NOT read from the header.
+
                      -convergence)
  -T #:  threshold inimage.i2i prior to analysis. voxels <= # ignored, default = 0
+
 
  -v: verbose
+
                              Control Parameters
 +
 
 +
    -scaling n        where n is after image scaling factor. Used to prevent
 +
    -sc n            integer overflow when saving after image to file.
 +
                      Default=1.0
  
note: source code in krypton:/home/lml/krypton/facil directory.
+
    -convergence n    Criteria for terminating iteration, where n is << 1.
+
    -co n            0.00001 represents true convergence. 0.001 usually
===  combine_images  ===
+
                      achieves 90-95% convergence in about half the number
This program reads a bunch of image files which have their xy position within a well stored in their header.
+
                      of iterations. Values of n larger than 0.001 are not
It then combines the images. Karls acquisition program for the Zeiss microscope should automatically add
+
                      generally recommended. Default=0.001
this information to the header. A maximum of 50 images can be combined. Images must all be the same size.
 
Images are also assumed to be aligned in z already. Images are added to the output image in the order specified
 
on the command line, with later pixel values replacing previous values if there is an overlap of the images.
 
  
Usage: combine_images [options] im1.i2i im2.i2i [more input images]  outim.i2i
+
    -axial n1 n2      The z-axis object extrapolation beyond the sectioned
options:
+
    -ax n1 n2        image data where n1 is before first plane and n2 is
-d debug. stuff to stderr.
+
                      after last plane. n is in planes.  By default,
-f do NOT fill pixel locations which have no data with nearest data value (added 2/3/14)
+
                      extrapolation extends +-1/2 the z-axis extent of the point
Filling is done by default to try to avoid introducing sharp intensity edges into the image.
+
                      spread function image and should be sufficient. Smaller
-X flip each input image in X before using it (-Y can also be specified at the same time)
+
                      values of n1 or n2 have the effect of spatially
-Y flip each input image in Y before using it
+
                      constraining the restored object and should be applied
-p # over-ride the specified pixel size with this one (in um). The 2.5X objective has a
+
                      carefully.
pixel size of 2.58 um stored in the image header (for images acquired prior to 4/13/13)
 
but it should be 2.41
 
-x #:#[:#...]  rather than use the x positions stored in the image header use these x pixel positions.
 
these should be the x offset of one image relative to another, in the same order as the
 
image names on the command line (there MUST be one number for each image). For example:
 
combine_images -x=0:500:0:500 im11.i2i im21.i2i im12.i2i im22.i2i outim.i2i  if im21.i2i and im22.i2i
 
are displaced 500 pixels to the right of the other two images.
 
-y #:#[:#...]  same, but for displacement in the y direction. Since these are pixels, they should be integers.
 
note: many times images are 1392x1040 and overlap by 50 pixels, and image 0 is bottom left
 
      image 1 is top left, image 2 is bottom right, and image3 is top right, then:
 
      -x 0:0:1342:1342 -y 0:990:0:990  should work
 
-o # rather than specifying -x and -y, thus just specifies the overlap (e.g., 50) and figures out
 
the rest for you (assumes images ordered BL,TL,BR,TP - as above - and x and y overlap the same
 
works for any size image.
 
  
note: entire image name (with extension) is NOT required.
+
    -time n1          The timepoint where you want the restoration to occur (0 indexed)
note: a - in place of an image name means stdin or stdout.
+
    -t n1
note: compressed images are temporarily uncompressed into /usr/tmp.
 
  
See also: parsepos.pl (not needed now that Karl fills the image header with this info)
+
    -threads n        The number of threads FFTW should use. Default=1
    combine_images.pl    applies combine_images (and, optionally, reduceima) to all files in a directory.
+
    -th n
    register_images.pl
+
 
    align_well_images.pl    pre-processor for combine_images if the y-coord in the header is invalid.
+
    -transverse n    The x-axis and y-axis object extrapolation in pixels.
    insert_image
+
    -tr n            The epr process extrapolates the restoration beyond the
 +
                      bounds of each image segment in order to account for
 +
                      exterior out-of-focus contributions. Default = 1/4 of X or Y
 +
                      dimsenion PSF width, which ever is larger.
 +
 
 +
EXAMPLES
 +
    To see the command line syntax
  
Source code in ~/krypton/facil/combine_images.c
+
      % epr
combine_images:
+
    or
 +
      % epr -h
  
== Miscellaneous ==
+
    Given specimen image mycell_.i2i and point spread function image mypsf_.i2i
===  analyze_cross_sections_of_voronoi.pl  ===
+
      let smoothness equal 0.0005, maximum number of iteration equal 250
 +
      and convergence equal 0.001. Perform single-resoltion(default) EPR:
  
This program reads files produced by cross_sections_of_voronoi (-P)
+
      % epr -psf mypsf_ -smoothness 0.0005 -iterations 250 mycell_ mycell_r
Results prints volume (x) vs predicted volume (y) to stdout.
 
  
analyze_cross_sections_of_voronoi.pl [options] file1.txt [... filen.txt]
+
FAQ (Frequently Asked Questions)
  
options:
+
      see  http://...
-debug info about all fields on each line printed to stderr
+
FILES
-stdout everything to stdout
+
        xcomp:/home/epr/epr
-print_avg for each file, just graph mean and std error of the mean, rather than all data pts
+
        xcomp:/home/epr/cs_epr.lo
  
 +
SEE ALSO
 +
        prepdata
 +
        preppsf
  
examples:
 
cross_sections_of_voronoi -P voronoi.i2i > filename1.txt
 
cross_sections_of_voronoi -P voronoi.i2i > filename2.txt
 
        axnalyze_cross_sections_of_voronoi.pl *.txt
 
  
see also:
+
</nowiki>
/storage/big1/lml/Raz/voronoi/README, true_vs_predicted.xmgr
+
===  many_overlapsL  ===
/home/lml/krypton/Corvera/Raz/stereology/README, run_voronoi.pl, run_voronoi2.pl, compare_volume_measurements.pl, plot_results.pl
+
<nowiki>
cross_sections_of_voronoi
+
insufficient number of arguments
/home/lml/krypton/packages/fiji/Fiji.app/macros/stereology_lml.txt
 
/home/lml/krypton/packages/fiji/run_stereology.txt
 
/storage/big1/lml/Raz/voronoi/
 
  
 +
This shell script calls overlap many times for a range of thresholds
 +
in both images.
 +
Unknown options are passed to overlap.
 +
Output is put into the specified output file
 +
This should then be processed by the program: create_images
 +
Note: a temporary file is created in the current directory.
 +
See also: create_images, overlap, probcolocal
 
   
 
   
===  neartrack.pl ===
+
USAGE: many_overlaps [options] image1.i2i image2.i2i output
neartrack.pl
+
options:
 +
  -t low hi step :range of thresholds for image1.i2i
 +
default = 1, 101, 10
 +
  -T low hi step :range of thresholds for image2.i2i
 +
default = 1, 101, 10
 +
 +
</nowiki>
 +
===  map_to_surface ===
 +
<nowiki>
 +
error: 
 +
There should be 3 or 5 main arguments (exluding options).
 +
Arguments seen:
 +
This program takes a surface (which are those voxels which are nonzero)
 +
and one (or two) data images.  It then maps (moves) the data voxels (nonzero
 +
voxels) to the position of the nearest surface voxel.  When done, one (or two) new
 +
image is produced which has the data values at these new positions.
 +
In addition, some statistics about the mapping are printed to stderr.
  
  find which track a specified coordinate is near (ie, with dx,dy) (eg, DAVE crosshairs gives us a coord, what track is it?)
+
NOTE:A surface can be generated by Simple_2D_wrap or shrink_wrap. This "mesh"
  assumes coords passed are zero indexed
+
representation of the surface (which DAVE can display using the -i option)
 +
can be converted into a surface .i2i image for map_to_surface using
 +
/usr/people/jac/cell/bin/make_surface -I surface.i2i -c 1 mesh.i2i surface.rpts
 +
The resulting surface is made up of voxels. Voxels which are just below the
 +
surface will be considered to be a distance of 1 voxel from the surface
 +
(the distance between the centers of the two voxels).
  
    usageneartrack.pl -x=# -y=# [-z=#] [-dx=#] [-dy=#] [-oneindexed] file.rpts
+
Usage:
 +
   map_to_surface [options] surface.i2i image.i2i out_image.i2i [image1.i2i out_image1.i2i]
 +
Options:
  
+
a second input image and output image can be specified on the command line.
===  parse_macros4.pl  ===
 
Can't use 'defined(%hash)' (Maybe you should just omit the defined()?) at /home/lml/krypton/bin/parse_macros4.pl line 562.
 
  
=== path_diff.pl ===
+
-c: rather than mapping data values to the nearest surface voxel, map
compare the differences between the paths found from two different runs of exo5
+
a count of the number of data values which mapped to the
 +
surface voxel. I.e., if 2 data voxels mapped to a surface voxel, a
 +
2 is stored there (rather than the max of the 2 data values-the default).
 +
-b: rather than mapping data values to the nearest surface voxel, or
 +
a count, just map a 1 (ie, binary) onto the surface where ever a data
 +
voxel maps (regardless of how many map there or their intensity).
 +
-m: surface.i2i is actually a mesh file, not an image file
 +
produced from a mesh file. In this case, only map data
 +
values to surface vertices (since map_to_surface doesn't
 +
yet know how to convert mesh files to complete surfaces
 +
like make_surface).
 +
      -d #:  minimum distance (in voxels) which data must be from the surface and
 +
still be mapped onto itData closer than this is ignored.
 +
By default all data is examined (ie, min_distance = 0)
 +
      -D #:  maximum distance (in voxels) which data can be from the surface and
 +
still be mapped onto it.  Data further than this is ignored.
 +
By default all data is examined (ie, max_distance = 1/2 the minimum
 +
image dimension, this should include all of the data).
 +
      -x:    exclude data voxels which are already on the surface (they will be zeroed).
 +
(note: setting the minimum distance > 0 will not achieve the same effect since
 +
that would still allow a data voxel on the surface to match to a surface
 +
voxel at a neighboring position).
  
path_diff.pl file1 file2
+
Source code in /storage/big1/lml/was_invitro/Moore/pkc
 +
 
 +
</nowiki>
 +
===  min_cylinder  ===
 +
<nowiki>
 +
MIN_CYLINDER program - Version 1.0
 +
 
 +
This program takes an initial cylindrical mesh surface
 +
and allows it to deform to minimize a function of
 +
surface curvature and stretch and image intensity
 +
 
 +
Usage: min_cylinder [options] insurface infile outsurface
 +
 
 +
OPTIONS CONTROLLING TERMINATION CRITERIA:
 +
[-n #] Maximum iterations
 +
[-c #] Minimum pixel changes per iteration
 +
 
 +
OPTIONS CONTROLLING SURFACE SHAPE:
 +
[-w # # # # # #] Weights for Su Sv Suu Suv Svv E
 +
default = 0.20, 0.20, 0.10, 0.20, 0.10, -0.10
 +
NOTE: for a 2D time series, the u
 +
direction is usually in the xy plane
 +
and v is the time direction.
 +
-b:  use bilinear interpolation along the u coordinate
 +
      direction to calculate the energy component due to
 +
      the data. This option only works in conjunction with
 +
      the -D option. This causes all data along the boundary
 +
      in each xy plane to contribute to the energy of the
 +
      surface, instead of just voxels at the locations of the
 +
      vertices of the surface.
 +
      NOTE: does not use weights specified by -W option yet.
 +
-a:  same as -b but the average energy along the boundary is
 +
      calculated instead of total, so long lines are not preferred.
 +
-p:  same as -a but the average energy along each boundary segment
 +
      is weighted by the percentage of total boundary length which
 +
that segment contributes. So long bad lines count more than
 +
short bad lines.
 +
-g:  weight the data along the boundary by the dot product with the
 +
unit length vector normal to the gradient. Thus boundary segments which
 +
are parallel to the data gradient direction will count less than
 +
they otherwise would. Use with -b, -a, or -p option.
 +
-z #: the cost of a zero length line (before applying w6)
 +
      default = 0, only valid with -a or -b option.
 +
-N: use "normal" curvature instead of parameterization
 +
dependent curvature calculation.  This option should produce
 +
a more correct curvature calculation, so the program does not
 +
get fooled into thinking that small objects have smaller
 +
curvature.
 +
 
 +
OPTIONS CONTROLLING ALLOWABLE SURFACE MOVEMENT:
 +
[-D]  Restrict movement to 2 dimensions (x & y)
 +
[-s]  Skip first and last planes of cylinder
 +
      (so they won't move at all).
 +
[-S filename] filename of z planes to skip (do not use with -s).
 +
[-f]  Fix first and last planes of cylinder to move only in x&y
 +
[-F filename] filename of z planes to fix to move only in x&y
 +
(do not use with the -f option).
 +
[-A]  when the -F or -S flag specified, normally if two adjacent
 +
      slices are specified in the rpts file then the surfaces on
 +
      either side of these become independent of the each other.
 +
      If -A is specified then they will still affect each other.
 +
 
 +
OPTIONS CONTROLLING INPUT, OUTPUT, AND DEBUGGING INFO:
 +
[-W # # #] Weights for scaling x y z dimensions.
 +
[-r rescale]  rescale image data from 0 to rescale
 +
before using. default = 1000.000000
 +
    If rescale <0 then no rescaling will be done.
 +
[-u]  expect input image to be i2i - output also i2i.
 +
[-I #] write out vertex coords every # images
 +
      written in unc image format. can be read
 +
      in and displayed by wire. If SAVE_ENERGY is
 +
  defined then energy of each vertex also saved.
 +
      Currently SAVE_ENERGY is defined.
 +
[-i]  Copy information fields flag
 +
[-t "title"]  New image title
 +
[-d #]  Debugging level, 1 (least) to 2 (most)
 +
 
 +
See also: Simple_2D_Wrap, 2D_wrap, shrink_wrap
 +
 
 +
</nowiki>
 +
===  morph3d  ===
 +
<nowiki>
 +
 
 +
This program does morphological processing on greyscale images. Currently the
 +
default intensity it filters with is a constant, although different shapes and
 +
intensity profiles are allowed.  Think of a 2d image as a 3d binary array of voxels
 +
where the height dimension is the intensity of the image at this x,y position.
 +
All those pixels which are less than or equal to the height are 1, others are zero.
 +
This object (made up of voxels which are 1) is the UMBRA of the image.
 +
 
 +
Dilation: Take the umbra of
 +
the image and the umbra of the filter. Then the image dilated by the filter is
 +
those voxels which get "reached" by the filter voxels when the filter umbra
 +
is translated through the image umbra (i.e., move the origin of the filter umbra
 +
everywhere inside the image umbra, all those voxels ever reached by the filter are
 +
part of the dilated umbra).
 +
For a constant intensity filter this reduces to just taking the
 +
maximum of the image intensities at the filter's locations.
 +
 
 +
Erosion: similar to dilation, but now as you move the filter around, only keep
 +
those voxels which, when the filter umbra is centered on them, permit all the
 +
filter voxels to lie on top of image voxels (i.e., the filter umbra fits inside
 +
the image umbra when centered on that voxel).Erosion is dilation of the background.
 +
This reduces to a minimum for a constant intensity filter.
 +
 
 +
Opening: erosion followed by dilation, can be visualized by taking the filter umbra
 +
surface and pushing it hard up under the image umbra surface. The highest voxels
 +
reached by the filter surface represent the new filtered image surface.
 +
(e.g. the "solvent or probe accessible surface" from below.
 +
 
 +
Closing: dilation followed by erosion.  Dilation can be visualized as
 +
flipping the filter umbra and rolling it along the top (outside) of
 +
the image umbra and recording the lowest voxels reached. (e.g.,the solvent
 +
accessible surface from above.).
 +
 
 +
If a 3D image is input, and a 3D filter shape is specified, then all analysis
 +
is done using 3D morphological filtering.  If a 2D filter is specified, then each
 +
zplane is analyzed separately.
 +
 
 +
Usage: morph3d [options] inimage.i2i outimage.i2i
 +
options:
 +
  -v: verbose, prints out which z slice is being analyzed to stderr.
 +
  -b #: any pixels <= # are background, ignore them. default = -32766
 +
  -h #: the maximum height (intensity) of the filter center relative to other
 +
                      entries in the filter. The default =0, ie all entries in the
 +
                      filter are at the same height.  If a nonzero value is specified
 +
                      a linear falloff in height to zero at the edges of the filter is
 +
                      assumed.
 +
  -m: when -m is specified the filter's intensities must fit under the
 +
image intensities without any intensities going negative. If this
 +
not the case, then a zero value is put in that center pixel location.
 +
For example, if we specify a filter which is 100 brighter in the
 +
center than at the edge, and the filter is over a region that is 50
 +
brighter in the center, then (if -m is not specified) that pixel value
 +
might stay 50 (since the template can fit under the image intensity by
 +
lowering itself so its edges have negative values)If -m
 +
is specified, the filter will not fit and the pixel will get set to 0.
 +
  -f #:  morphological filter shape. 6 = jack (ie, 3D cross, default)
 +
7= 3D asterisk, 4 = 2D plus
 +
1= 2D filled square, 8 = 3D cube, 2= 2D filled circle,
 +
3= 2D asterisk, 5= 2D cross.
 +
2D shapes are done one zslice at a time.
 +
  -l #: just use a single LINE, of specified orientation .
 +
1 = LL-UR, 2 = UL-LR, 3 = Left-Right, 4 = Up-Down.
 +
5 = In-Out in z, 6 = ULIn-LROut (a diagonal in 3D).
 +
  -s # # #:  size of x,y, and z "radius"  in pixels (4 4 2 default).
 +
  [-e|-d|-o|-c]:      erosion (min), dilation (max), opening (e then d), or
 +
closing (d then e). default is closing.
  
options:
+
note: entire image name is NOT required.
  -dx=# x coord at fusion time can differ by this and still be considered same path (default = 0)
+
note: a - in place of an image name means stdin or stdout.
  -dy=# y coord at fusion time can differ by this and still be considered same path (default = 0)
+
note: the origin of the filter element is at its center.
  -df=# fusion time can differ by this and still be considered same path (default = 0)
 
  
  -debug
+
see also: morph  - this is an older, one z-slice at a time version.
  -Debug
 
 
   
 
   
===  trackinfo.pl ===
+
</nowiki>
 +
===  multi_gauss_deriv ===
 +
<nowiki>
 +
 
 +
This program takes an image, blurs it with a Gaussian of
 +
specified standard deviation and then takes derivatives of the image
 +
It does all of this in the frequency domain.  The FFT will be done in parallel
 +
unless the environment variable NPROCS is set to 1.
 +
FFT_MAXMEM variable defines the maximum memory the FFT will use.
 +
outfile is the root name for images and/or pts (-m or -M) files.
  
# analyze output from "track or track -r".
+
Usage: multi_gauss_deriv [options] infile.i2i outfile
# assumes coords passed are zero indexed.  
+
options:
 +
  -x order:  number of derivatives in the x direction.
 +
default = 0
 +
  -y order:  number of derivatives in the y direction.
 +
default = 0
 +
  -z order:  number of derivatives in the z direction.
 +
default = 0
 +
  -s sigx sigy sigz:  standard deviation in spatial domain of Gaussian.
 +
  -S sigx sigy sigz:  standard deviation in frequency domain of Gaussian.
 +
default = 3.402823E+38  3.402823E+38  3.402823E+38
 +
  -l # res2 res3 ... :  # = number of different resolution levels to calculate.
 +
res2 ... res# are the relative sigmas for each resolution level after
 +
the first one. eg, -l 3 .9 .7  means that 3 blurred levels should
 +
be calculated and the sigma (in the freq domain) of the second
 +
level should be .9 of the first level (ie, more blurred), and the 3rd
 +
level should be .7 of the first level (as specified with -S).
 +
  -L # factor:  # = number of resolution levels. factor is the relative sigmas in
 +
the spatial domain for each level relative to the previous level.
 +
  -e epsilon:  cutoff for Gaussian intensity calculation.
 +
default = 0.040000
 +
  -r: apply scalefactor to output so min= -32766 or max= 32766. This is useful
 +
especially when all the values would otherwise be < 1.
 +
This also prints to stderr the min and max values before rescaling.
 +
  -R #: rescale output by multiplying all values by #.
 +
  -m: calculate coords of 3D maxima after blurring.
 +
  -M: same as -m, but also prevents writing out blurred images.
 +
  -n #: maxima must have an intensity > # (must use -m or -M with this)
 +
  -f #: max pixel must be > all neighbors by at least # to be a maxima. default = 0.000100
 +
note: image dimensions which factor to 2, 3, or 5 go fastest with the FFT.
 +
note: the entire image name is NOT required.
 +
note: compressed images will be uncompressed.
 +
note: a - in place of an image name means stdin or stdout.
 +
see also: max3d, gauss_deriv_unc, blur_spatial, canny, zerosu.
 +
 +
</nowiki>
 +
===  objs_via_ascent  ===
 +
<nowiki>
  
# usage:  trackinfo.pl -x=# -y=# [options] file.rpts
+
Associates each voxel in inimage.i2i which is > threshold with a 3d maxima in the image.  It finds
 +
the 3d maxima by doing a steepest ascent walk in the image.  Writes info about regions found to
 +
stdout in the same format as countobjs.  Writes an image with each pixel labeled with its region
 +
id to outimage.i2i.  
  
options:
+
Usage:
 +
  objs_via_ascent [options] inimage.i2i outimage.i2i > inimage.count
  
#    -reg=# : just print info about the specified region number
+
Options:
#    -track=# : just print info about the specified track
+
  -t threshold:any voxel > threshold in inimage.i2i is tracked to a 3d maxima (default = 0.000000).
#    -trackcoords=minsize:maxsize:miniod:maxiod:minlife:maxlife
+
  -i miniod maxiod : erase all objects whose iod doesn't fall in the specified range
# : print the coords (rpts format) of all tracks which satisfy
+
  -s minsize maxsize : erase all objects whose size (in voxels, inclusive) doesn't fall in the specified range
#   the criteria (or all its regions satisfy them). lifetime is # of timepts it exists for.
+
 
#    -tdist=mindist:maxdist: use with -trackcoords to specify min and max (xy manhattan) distance track travels
+
Examples:
#    -micro:   print coords of all