Difference between revisions of "Software2"

From Wiki
Jump to navigation Jump to search
 
(6 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 7: Line 9:
  
 
== Simulation ==
 
== Simulation ==
===  analyze_simulation.pl -h ===
+
===  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
 
   
 
   
===  calc_diffusion3.pl -h ===
+
</nowiki>
 +
===  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:
  
 
   
 
   
===  compare_volume_measurements.pl -h ===
+
</nowiki>
 +
===  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:
  
 
   
 
   
===  filter_beads.pl -h ===
+
</nowiki>
 +
===  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:
  
 
   
 
   
===  graph_xpp2.pl -h ===
+
</nowiki>
 +
===  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:
  
 
   
 
   
===  oxygen_krogh.pl -h ===
+
</nowiki>
 +
===  oxygen_krogh.pl  ===
 +
<nowiki>
 
     NOT DONE YET.
 
     NOT DONE YET.
  
Line 215: Line 228:
  
 
   
 
   
===  random_path.pl -h ===
+
</nowiki>
 +
===  random_path.pl  ===
 +
<nowiki>
  
 
Generate a random path (ie, diffusion).
 
Generate a random path (ie, diffusion).
Line 243: Line 258:
  
 
   
 
   
===  readbeads.pl -h ===
+
</nowiki>
 +
===  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:
  
 
   
 
   
===  run_random_path.pl -h ===
+
</nowiki>
 +
===  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:
  
 
   
 
   
===  run_voronoi2.pl -h ===
+
</nowiki>
 +
===  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:
  
 
   
 
   
===  voronoi_vs_fiji.pl -h ===
+
</nowiki>
 +
===  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  ===
incorrect command line.
+
<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)
 
It is used to create test images for Fischer/hmc.
 
It is used to create test images for Fischer/hmc.
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  
incorrect command line.
+
 
 
Reads in 4 floating point images (or 4 short int images) as produced by simulation, calculates
 
Reads in 4 floating point images (or 4 short int images) as produced by simulation, calculates
 
the difference image deltaca.i2i (as a floating pt image) between the observed free calcium and what would be
 
the difference image deltaca.i2i (as a floating pt image) between the observed free calcium and what would be
Line 424: Line 451:
 
source code in ~lml/krypton/Walsh directory.
 
source code in ~lml/krypton/Walsh directory.
 
   
 
   
===  cellsim -h ===
+
</nowiki>
 +
===  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  -h ===
+
</nowiki>
  [0]: in main, before MPI_Init()
+
===  channel_current2 ===
[0]: in main, after MPI_Init()
+
  <nowiki>
[0]: /home/lml/krypton/bin/cellsimL -h
+
channel_current2: like channel_current, but looks at [ca] over time at each BK (not just max [ca]).
help:
+
From that, it calculates the max BK current. Channel_current adds the max [ca] that each BK voxel sees
unable to parse command: -h
+
from each voxel in a Ryr cluster, to get the max [ca] that BK pixel sees.  But the max [ca] could occur
    This program simulates Ca and Na in a cylindrical cell with
+
at different times since the Ryr cluster has a spatial extent.  Experimental.
    cylindrical symmetry.  
+
 
    Note: It is recommended that the stderr output be examined for
+
Calculates the current which would be produced when each object in Ryr_image.i2i releases calcium which
          lines with the words: warning, Warning, error, or Error on them.
+
activates nearby BK channels in BK_image.i2i. Produces a histogram of these output currents.
Usage
+
The input images should have each pixel in an object having the object id as its value. These images can be
    cellsim [options] >& output_datafile
+
produced with "countobjs -Q" or "objs_via_ascent" 
 +
note:  a one pixel border around the image is ignored (added 12/8/09).
 +
This may take about one-half hour to run.
  
Options controlling the duration of the simulation:
+
Usage:
    -time #:       total time to simulate (in sec), default = 0.000000
+
channel_current [options] -f filename Ryr_image.i2i BK_image.i2i > im1_im2.hist
    -time_rate #:  slow down time, ie take smaller dt steps during simulation.
+
Options:
                    this may be necessary if you are creating a large ca gradient,
+
-f filename resting: file containing [ca], in nM, as a function of distance and time. Right now this is
                    for example, with -ca_ring or -ca_src options (.5 means 1/2 the dt).
+
assumed to have 20 nm spacing and entries every msec. See
                    The number of iterations needed for convergence is
+
/home/lml/krypton/Zhuge/STIC/simulations/run32.ca as an example
                    roughly: I= (T*diff)/(dr*dr), where T is time, dr is
+
"resting" is the resting [ca], in nM, for the cell. It will we subtracted from the other
                    annulus thickness and diff is diffusion constant.
+
[ca] values to produce a "delta" [ca] which gets scaled linearly by Ryr intensity.
                    This ignores ion influx,etc. If you set diffusion rates very
+
The spark current used to produce this (see -C) should be roughly in the range expected
                    small, the iter # calculated will be too small if other stuff
+
for Ryr_image.i2i, since all delta [ca] is linearly extrapolated.
                    is happening, use -time_rate to compensate.
+
All distances > largest distance in filename will have their [ca] set to the [ca]
+
at the largest distance in filename.
Options controlling the geometry of the model:
+
note: Only the [ca] values at y == 1 are used. Is this what should be used?
    -radius #:     radius of the cell in microns, default = 6.000000
+
-u #: voltage (mV).  BK conductance is a function of voltage. default = -80.000000
    -rings #:     radius of the cell in rings, default = 60
+
-U low delta hi: voltages from low to hi by delta. Max is 20 voltages
                    Ring thickness = cell radius/ # of rings.
+
-r #:         resolution (binsize) for output histogram in femtoAmps, default = 1000.000000
    -length #:     length of the cell in disks, default = 300
+
-R #: reveral potential of BK channel in mV, default = -80.000000
                    Each disk will be the same thickness as a ring.
+
 
    -bc Rmax Lmin Lmax:     boundary conditions at maximum radius and minimum and
+
  distances:
                    maximum length coordinate (i.e., at the cell ends). These must
+
-w # # #: x,y, zweights for pixel distances (ie, pixel size), default = 1 for each.
                    be the letters I (for infinite) or S (for solid, i.e. no ions go
+
-p #: pixel size in nm (i.e., what 1 means in -w option), default = 80.000000
                    through the membrane). The I option is not always accurate. default: S
+
-m # :         maxdistance (in units used for -w, i.e., pixels) to look for the closest pixel, default = 10.000000
    -mask image.i2i: only voxels in image.i2i > 0 are part of the cellUse this
+
 
                    to specify an arbitrary shape for the cell.
+
  which pixels or clusters to include:
                    Not extensively tested.
+
-t # #: image1 and image2 thresholds, pixels > # are above threshold, default = 0.
    -spacing file: file specifies the spacing along each axis (i.e, size of each voxel).
+
-e lowx lowy lowz hix hiy hiz: only look at voxels within this extent (subvolume), 1-indexed, inclusive.
                    spacing is in nm, one entry per voxel, comment lines ignored (#).
+
-s minsize maxsize:     only look at objects in Ryr_image.i2i within the size range (inclusive, in voxels)
                    The cell direction (X,Y, or Z) must be the first letter on the line.
+
max size allowed = 100000
                    Other characters on the line will be ignored.
+
-S minsize maxsize:    only look at objects in BK_image.i2i within the size range (inclusive, in voxels)
                    The number of entries must be < 2000 each direction.
+
-i miniod maxiod:    only look at objects in Ryr_image.i2i within the iod range (inclusive. use -d also.)
                    Do not specify -rings,-radius,and -length if you use this option.
+
-I miniod maxiod:     only look at objects in BK_image.i2i within the iod range (inclusive. use -D also.)
                    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):
+
  scale factors:
    -ion name free_concentration D valence:  
+
-d Ryrimage1d.i2i #: the original intensity image for Ryr_image (since Ryr_image has pixel values as id numbers)
                    concentration in mMolar, D in cm^2/sec, valence in absolute value.
+
# is the number of Ryrimage1d.i2i intensity units required to produce spark current
                    valence is only used if -ion_src is also specified.
+
used in the calcium simulation (which produced the -f filename data).
                    concentration is the initial free concentration.
+
This will scale the [ca] produced by each Ryr voxel. Default = 30000.000000
    -buffer name total_concentration D:  
+
-D BKimage2d.i2i #: the original intensity image for BK_image (since BK_image has pixel values as id numbers)
                    concentration in mMolar, D in cm^2/sec.
+
# is the BKimage2d.i2i intensity from one BK channel.
                    concentration is the initial total concentration (sum of its free and all bound forms).
+
This will scale current produced. Default = 1000.000000
    -kin bufname ionname boundname onrate offrate D:
+
If you want the intensity of each Ryr or BK object to affect the ca release (for Ryr)
                    kinetics for interaction between bufname and ionname.  Boundname is the
+
or number of channels (for BK) , you need to provide the original data by using the  
                    name to give the bound pair.  bufname and ionname must have been
+
-d and -D options. Otherwise all voxels in an object contribute equally (so large objects
                    specified (with -ion -buffer or -kin options) prior to this option.
+
have more receptors or channels than small ones).
                    onrate:in 1/(mMolar*seconds), offrate: in 1/seconds, D: in cm^2/sec 
+
-c #: BK single channel conductance in pS, default = 220.0
    -equil_error relerr iter: maximum relative equilibrium error allowed during the  
+
-C #: peak current (in pAmps) used in the simulation to produce -f filename, default = 1.000000
                    initial calculation of concentrations from the user specified
+
This is just used for output produced by -v to estimate spark current produced per Ryr cluster.
                    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:
+
  miscellaneous:
    -ion_src name current dur lowdisk highdisk lowring highring:  
+
  -v: verbose. produces list of each Ryr cluster and K current produced to stderr. Other stuff too.
                    have a current source of the specified ion coming in through the specified rings
+
To write this to a separate file do: (channel_current -v ... > stdout.channel) >& stderr.channel
                    and numdisk (rings and disks are 0-indexed indices, inclusive).
+
  -V: very verbose
                    Current is in pA for the specified duration (sec).
 
                    The current is uniformly divided within the entire specified input volume.
 
                    All -buffer and -ion options must be specified prior to this.
 
                    See comments by the -time_rate option.
 
    -ion_src_file name imagename current duration:
 
                    Similar to -ion_src, but the specified floating point image is used to
 
                    scale the input current at each voxel. The total current coming into the
 
                    cell is adjusted so that after this per pixel rescaling, it will = "current".
 
                    -ion_current_trace with op = S, will modify this.
 
                    Typically do: int2float -M 1 psf.i2i imagename        prior to this.
 
    -ion_current_trace name filename dt op threshold:  modifies current specified with
 
                    the -ion_src or -ion_src_file options.
 
                    Times which the channel is open (i.e., current flows) is specified in a file.
 
                    The file is a list of numbers (current or scale), 1 per line, at dt (in sec) intervals.
 
                    If op = T, currents greater than the specified threshold means channel open, otherwise closed.
 
                    If op = S, the current as specified with -ion_src is scaled by the number in the list.
 
                    "threshold" is required but ignored when op = S.  Not extensively tested.
 
    -zap_sub name time:
 
                    At the specified time (in seconds) set the named substance concentration
 
                    to 0. This does not prevent it from being produced from other reactions.
 
                    This is useful if an injected "ion" was photons (e.g., photon+caged -> uncaged)
 
                    and the laser is turned off at the specified time.
 
  
Options related to output:
+
Examples:
    -save name filename type scale dt:
 
                    Save images of the specified substance (name) to specified file. By default
 
                    substances are saved in mM.  This will be multiplied by the scale
 
                    specified here. dt (in sec) is how often to save images.  Type is I
 
                    (short int, our normal format) or F (floating pt,2x space, more accurate).
 
                    The first image saved will be prior to any ion current. The last image
 
                    will always be the end of the simulation. "name" should be as
 
                    specified with the -ion, -buffer or -kin option.
 
                    If the image file already exists, new images will postpended to it.
 
    -save all tag type scale dt:
 
                    Equivalent to -save for all ions and buffers. Uses default file names,
 
                    but adds the tag on the end. ions in nM, all else in uM, then times scale.
 
    -save_flow name rfilename lfilename scale dt:
 
                    Save flow images of the specified substance (name) to specified files.
 
                    rfile is radial flow, lfile is lengthwise flow. Images saved in floating pt.
 
                    Flow is in pA (1 pA = 3 molecules/usec) times scale.
 
                    dt (in sec) is how often to save images. 
 
    -save_flow all ltag rtag scale dt:
 
                    Equivalent to -save_flow for all ions and buffers. Uses default file names,
 
                    but adds the tag on the end. Output same scale as above.
 
                    NOTE: flow for EACH substance takes 8*(number of voxels) of space.
 
    -debug #:      set debug level to #. May substantially slow down the simulation.
 
                    1: extra print statements at init. 2: more testing while running. 3:
 
    -debug_subvolume #: Normally the total mmoles (in the entire cell) of each saved substance is
 
                    printed to stderr.  Setting this option will also cause the printing of the
 
                    total over a subvolume. Subvolume is all y >= # (0-indexed).
 
                    Example: if a cell has patch region at y=[1,10], setting # to the neck (11) of the
 
                    patch will let you see how much actually gets out into the main part of the cell.
 
  
Options related to MPI (multiprocessor stuff):
+
cellsim -spacing /home/lml/krypton/Zhuge/STIC/simulations/spacing2.txt ....     : produces ca.i2i
    invoke on the wolves as, for example,  mpirun -np 3 -machinefile file_of_machine_names cellsim ...
+
printvalsL -spacing2.txt -R -t -i ca.i2i > ca.vals    
    -print_proc #:  only print output from the specified process (0 indexed).
+
kate ca.vals     : delete fist comment line
                  Some output (eg, Total mmoles of ions, etc) are only valid for process 0.
+
      objs_via_ascent -s 5 100 Ryr.i2i Ryrid.i2i > tmp
    -overlap #:   overlap neighboring regions by the specified number of voxels (default = 50)
+
tail tmp  : the mean IOD gives an idea of brightness needed to produce current used in cellsim, say 30000
                  This will also be the number of iterations between necessary synchronization.
+
      objs_via_ascent -s 5 100 BK.i2i BKid.i2i > tmp
    -debug_mpi #:  print MPI info. Execute MPI dummy stubs if MPI NOT present (eg, under Windows,SGI).
+
tail tmp  : the mean IOD gives an idea of brightness of a BK cluster, eg mean= 10000, but assume that's 10 channels
                  This version of the executable does NOT use MPI.
 
    -debug_mpi_proc rank numproc: set dummy rank and number of processes. use only if MPI NOT present!
 
  
EXAMPLES
+
channel_current -f ca.vals -w 1 1 3 -d Ryr.i2i 30000 -D BK.i2i 1000 Ryrid.i2i Bkid.i2i > ryr_bk.info
./cellsim -time .0010 -time_rate .5 -length 200 -rings 40 -radius 1 \
+
cull -s -c -1 -4 < ryr_bk.info |xmgrace -source stdin
        -ion Ca 100E-6 2.5E-6 2 -buffer Fluo3 .050 2.5E-7 -buffer Buf .230 1E-14 \
+
See also:
        -kin Fluo3 Ca CaFl 8E4 90 2.5E-7 -kin Buf Ca CaBuf 1E5 100 1E-14        \
+
closest_object closest_voxel objs_via_ascent /home/lml/krypton/Zhuge/BKandRyr/graph.pl,match.pl
        -ion_src Ca 1 .00105 99 102 0 3 \
+
graph_channel_current.pl, test_channel_current, /home/lml/krypton/Zhuge/STIC/simulations/run32  
        -save all _run1 I 1 .0001 >& cellsim_run1.out
+
/home/lml/krypton/Zhuge/BKandRyr/analysis6/cluster_distances.pl, plot_mean_sd_curve.pl
 +
/home/lml/krypton/Zhuge/xpp/ASM15.ode
 +
Bugs:
  
 +
Source code in ~krypton/lml/facil 
 +
# Popen is monotonic as it should be.
 +
must provide -f cafilename
  
Simulate for 100msec saving images every msec. 1 pA comes in the the pattern as specified
+
</nowiki>
by psf_float.i2i for 10 msec. The current is then modulated by values in current.txt which
+
===  cluster  ===
are one value per line, dt of 1 msec between them. Cell shape in mask.i2i. Voxel sizes in
+
  <nowiki>
spacing.txt
+
Drops random Ryr receptors into a world. Then 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
+
Usage:
      ~lml/vision/bin/float2int                    (convert a floating point image to standard SHORT INT format)
+
cluster [options]
      ~lml/vision/bin/int2float       (convert normal image to floating point)
+
Options:
      ~lml/vision/bin/playexact                    (to display a floating point image)
+
distance options:
      ~lml/invitro/Kargacin/changeheader          (change header of floating point image)
+
-eucliddist:      calculate a Euclidean distance (same in x,y,z directions). This is the default.
      ~lml/vision/bin/cyl2cart                    (convert from cylindrical to cartesian coords)
+
  (use -cdist option to set the nearby distance for this).
      ~lml/vision/bin/nadiffl7                    (many more options, but only 1 ion and 2 buffers)
+
-absdist:   rather than calculate a real distance, calculate max(ABS(dx),ABS(dy),ABS(dz)) - for speed
       ~lml/vision/bin/diffuse2                    (simple Gaussian spot diffusion program)
+
  (use -cdist to set the nearby distance for this.)
       ~lml/invitro/Kargacin/iplot                  (3D graph of a 2D image, intensity -> height)
+
-psfdist x y z:  distance (in um) a pt can be in the x, y, and z directions and be considered nearby.
      ~lml/invitro/Kargacin/blur4D_dFoverF        (blur with psf, calculate dFoverF)
+
  Does not use -cdist.  To approximate a psf you might specify .2 .2 .6
       ~lml/invitro/Kargacin/diffusion_limited_binding  (simulate diffusion limited binding)
+
       -cdist #:        how close (in um) two receptors must be to cluster, default = 0.500000
       ~lml/invitro/Kargacin/spot_diffusion         (simulate diffusion from a spot)
+
other options:
       ~lml/vision/facil/printvals                  (print image values, calculate dFoverF)
+
       -2D:   do a 2D simulation (x and y), not a 3D simulation
       ~lml/vision/JSinger/src/channel              (steady state based upon Neher paper)
+
-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.
 +
  Only the parts of the cylinder which fit in the world (-wsize) are used.
 +
-wsize x y z:   the width of the world (in um) in the x, y, and z directions (default = 2.0,2.0,2.0)
 +
-psize x y z:   pixel width (in um) in the x, y, and z directions (default = 0.1,0.1,0.1)
 +
       -numryr #:        number of Ryr receptors to drop, default = 1000
 +
-mindist #:   when placing Ryr receptors, keep this minimum distance (in um) between them.
 +
-randstart #:   start the random number generator with # as the seed. So runs can be reproduced.
 +
-image name.i2i   write out an image of the Ryr receptors.  Can then use blur3d to create a realistic
 +
  microscope image, and countobjs to analyze it and compare to real data.
 +
diagnostics:
 +
      -debug:          turn on debugging
 +
       -verbose:         be a bit more verbose
 +
      -h:  print this help
 +
       -H:  print this help
 +
       -help:  print this help
 +
 
 +
Examples:
  
===  channel_current2 ===
+
Source code in ~krypton/lml/Zhuge/Ryr_clusters  
channel_current2: like channel_current, but looks at [ca] over time at each BK (not just max [ca]).
+
  /home/lml/krypton/bin/cluster -h
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 extent.  Experimental.
 
  
Calculates the current which would be produced when each object in Ryr_image.i2i releases calcium which
+
</nowiki>
activates nearby BK channels in BK_image.i2i. Produces a histogram of these output currents.
+
===  diffusion_limited_binding ===
The input images should have each pixel in an object having the object id as its value. These images can be
+
  <nowiki>
produced with "countobjs -Q" or "objs_via_ascent"  
+
unknown option h
note: a one pixel border around the image is ignored (added 12/8/09).
 
This may take about one-half hour to run.
 
  
Usage:
+
Prints out distance (um) and concentration (particles/cm^3) at that distance
channel_current [options] -f filename Ryr_image.i2i BK_image.i2i > im1_im2.hist
+
a slab volume of initial uniform concentration (1 particle/cm^3)which has a ligand
Options:
+
binding to a plane at x = 0This is diffusion limited binding. See my notes of 10/20/98.
-f filename resting: file containing [ca], in nM, as a function of distance and time. Right now this is
 
assumed to have 20 nm spacing and entries every msec. See
 
/home/lml/krypton/Zhuge/STIC/simulations/run32.ca as an example
 
"resting" is the resting [ca], in nM, for the cell. It will we subtracted from the other
 
[ca] values to produce a "delta" [ca] which gets scaled linearly by Ryr intensity.
 
The spark current used to produce this (see -C) should be roughly in the range expected
 
for Ryr_image.i2i, since all delta [ca] is linearly extrapolated.
 
All distances > largest distance in filename will have their [ca] set to the [ca]
 
at the largest distance in filename.
 
note: Only the [ca] values at y == 1 are used. Is this what should be used?
 
-u #: voltage (mV)BK conductance is a function of voltage. default = -80.000000
 
-U low delta hi: voltages from low to hi by delta. Max is 20 voltages
 
-r #:         resolution (binsize) for output histogram in femtoAmps, default = 1000.000000
 
-R #: reveral potential of BK channel in mV, default = -80.000000
 
  
  distances:
+
Usage: diffusion_limited_binding [options] 
-w # # #: x,y, zweights for pixel distances (ie, pixel size), default = 1 for each.
+
options:
-p #: pixel size in nm (i.e., what 1 means in -w option), default = 80.000000
+
  -D #:   diffusion (cm^2/msec), default = 2.2E-09
-m # :         maxdistance (in units used for -w, i.e., pixels) to look for the closest pixel, default = 10.000000
+
  -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>
  
  which pixels or clusters to include:
+
This program creates an elliptical cell, cell length is in the y direction.
-t # #: image1 and image2 thresholds, pixels > # are above threshold, default = 0.
+
It is used to model a squashed cell, and see how different it looks after
-e lowx lowy lowz hix hiy hiz:  only look at voxels within this extent (subvolume), 1-indexed, inclusive.
+
blurring than a cylindrical cell
-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:
+
Usage: ellipse [options] ellipse.i2i
-d Ryrimage1d.i2i #: the original intensity image for Ryr_image (since Ryr_image has pixel values as id numbers)
+
options:
# is the number of Ryrimage1d.i2i intensity units required to produce spark current
+
  -d xdim ydim zdim:   dimensions of image, default = (50,100,50)
used in the calcium simulation (which produced the -f filename data).
+
  -r xradius zradius:  radius (in pixels) in the x and z directions, default (20.000000,20.000000)
This will scale the [ca] produced by each Ryr voxel. Default = 30000.000000
+
  -s samplerate:  number of subsamples in x and z directions per pixel, default = 1
-D BKimage2d.i2i #: the original intensity image for BK_image (since BK_image has pixel values as id numbers)
+
  -i intensity:  intensity inside the ellipse, default = 100.000000
# is the BKimage2d.i2i intensity from one BK channel.
+
This will scale current produced. Default = 1000.000000
+
</nowiki>
If you want the intensity of each Ryr or BK object to affect the ca release (for Ryr)
+
===  em  ===
or number of channels (for BK) , you need to provide the original data by using the
+
<nowiki>
-d and -D options. Otherwise all voxels in an object contribute equally (so large objects
+
Creates (or reads in) a HMM and then generates random data from it
have more receptors or channels than small ones).
+
(each model is a poisson process, with the j_th model having a lambda = 10*j).
-c #: BK single channel conductance in pS, default = 220.0
+
Then attempts to use an EM algorithm to estimate the original model.
-C #: peak current (in pAmps) used in the simulation to produce -f filename, default = 1.000000
+
This is a way for me to learn how to implement the EM algorithm.
This is just used for output produced by -v to estimate spark current produced per Ryr cluster.
+
 
 +
Usage: em [options]  
 +
options:
 +
  -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 #)
 +
                        order: T[1][1], T[1][2], ... T[1][S], T[2][1] ... T[S][S] if there are S states),
 +
                        where T[i][j] is the probability of a transition from state i to state j.
 +
  -p # # # ... #: prior probabilities of states (S entries if there are S states)
 +
  -P #: which prior estimate to use for the pdf of the data (ie., estimate of Poisson process)
 +
        1 = uniform, 2 = delta, 3 = uniform+delta, 4 = peice of observed data histogram (default)
 +
        5 = true pdf (Poisson)
 +
  -n #: number of data points to simulate, default = 100
 +
  -m #: maximum number of iterations to perform, default = 20
 +
        -truetrans: use the true transition probabilities as the initial guess (default = uniform)
 +
        -trueprior: use the true prior probabilities as the initial prior guess (default = uniform)
 +
  -findstates:  also find (and print) the estimate of the states at each time point.
 +
  -v:  verbose. print more info to stderr.
 +
  -V:  print some more info. Some printouts only occur if # data pts is < 1000
  
  miscellaneous:
+
Source code in /home/lml/krypton/facil/em.cc
  -v: verbose. produces list of each Ryr cluster and K current produced to stderr. Other stuff too.
+
See also: ~/krypton/facil/transpose.pl  to print out selected lines from the output file
To write this to a separate file do: (channel_current -v ... > stdout.channel) >& stderr.channel
+
          ~/krypton/matlab/netlab: has EM routines
  -V: very verbose
+
          ~/krypton/matlab/bayes/BNT/HMM: has HMM and EM routines
 +
/home/lml/krypton/bin/em -h
  
Examples:
+
</nowiki>
 +
===  makebeads2  ===
 +
<nowiki>
 +
/home/lml/krypton/bin/makebeads2
  
cellsim -spacing /home/lml/krypton/Zhuge/STIC/simulations/spacing2.txt ....     : produces ca.i2i  
+
randomly distributes beads within a volume.  created to let Jack simulate
printvalsL -spacing2.txt -R -t -i ca.i2i > ca.vals    
+
distribution of glut4 labels vesicles in the TIRF field of a microscope.
kate ca.vals     : delete fist comment line
+
A bead has a constant value between its inner and outer diameters. This value
      objs_via_ascent -s 5 100 Ryr.i2i Ryrid.i2i > tmp
+
falls to zero 3 standard deviations inside the inner diameter and 3 sd outside
tail tmp   : the mean IOD gives an idea of brightness needed to produce current used in cellsim, say 30000
+
the outer diameter. Beads are not allowed to intersect each other.
      objs_via_ascent -s 5 100 BK.i2i BKid.i2i > tmp
+
Writes info about beads created or moved to stdout (can be read back in with -b option).
tail tmp : the mean IOD gives an idea of brightness of a BK cluster, eg mean= 10000, but assume that's 10 channels
+
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 appropriate.  note: This will mess up the output in the file
 +
if you are running it as:  makebeads2 -W .... >& file.out
 +
 
 +
options controlling randomization (of a uniform random distribution unless otherwise noted):
 +
-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
 +
 
 +
Examples:
 +
#create 200 beads, with a 50 nm (5 z plane) gap before the pm, which has an
 +
#intensity of 50. Apply a TIRF exponential excitation scale to it.
 +
makebeads2 -e .1 -z 5 63 -p 5 50 -n 200 beads1.i2i > beads1.info
 +
# apply microscope psf
 +
blur3d -P -N 256 256 128 beads1.i2i empiricalpsf_seg_40nm_seg.i2i beads1_blur3d.i2i
 +
# bin (averge) to 100/160 nm resolution
 +
reduceima -A -X 1 256 4 -Y 1 256 4 beads1_blur3d.i2i beads1_blur3d4x4.i2i
 +
# extract infocus plane
 +
segment -Z 16 16 1 beads1_blur3d4x4.i2i beads1_blur2d4x4.i2i
 +
# add ScratchNG camera noise
 +
noise -e 1.4 -n 8 beads1_blur2d4x4.i2i beads1_blur2d4x4N.i2i
 +
histima -size 10 -bins 100 beads1_blur2d4x4N.i2i > beads1_blur2d4x4N.hist
 +
 
 +
#creates beads, move them, look at the results
 +
makebeads2 -z 5 63 beads1.i2i > beads1.info
 +
#read those beads in and move them. but still must stay outside the first 50 nm.
 +
makebeads2 -z 5 63 -b beads1.info .05 .05 beads2.i2i > beads2.info
 +
concateima beads1.i2i beads2.i2i beads.i2i
 +
imsets beads.i2i 2
 +
dave -tdim 2 -4 -I beads.i2i
 +
 
 +
#just create scripts (very fast) with positions of beads, and move them around.
 +
makebeads -z 5 63 -n 200 -A dummy.i2i > beads1.info
 +
makebeads -b beads1.info .05 .05 -z 5 63 -A dummy.i2i > beads2.info
 +
makebeads -b beads2.info .05 .05 -z 5 63 -A dummy.i2i > beads3.info
 +
#now create the images
 +
makebeads -b beads1.info 0 0  beads1.i2i > beads1.info2
 +
makebeads -b beads2.info 0 0  beads2.i2i > beads2.info2
 +
makebeads -b beads3.info 0 0 beads3.i2i > beads3.info2
 +
 
 +
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.
  
channel_current -f ca.vals -w 1 1 3 -d Ryr.i2i 30000 -D BK.i2i 1000 Ryrid.i2i Bkid.i2i > ryr_bk.info
+
The point source model (-m 2) implements equation 14 from HeatConduction.pdf
cull -s -c -1 -4 < ryr_bk.info |xmgrace -source stdin
+
  Steady Heat Conduction in Layered Mediums: The Half-Space and Sphere, by Henry N. Pollack
See also:
+
  J. of Geophysical Research, vol. 70(22), Nov. 15, 1965, pp. 5645-5648
closest_object closest_voxel objs_via_ascent /home/lml/krypton/Zhuge/BKandRyr/graph.pl,match.pl
+
This models O2 assuming a constant oxygen consumption by the tissue and constant O2 (Ps) at the blood vessel.
graph_channel_current.pl, test_channel_current, /home/lml/krypton/Zhuge/STIC/simulations/run32 
+
note: The value of dP/dr at R2 is forced to 0 unless -b # is specified.
/home/lml/krypton/Zhuge/BKandRyr/analysis6/cluster_distances.pl, plot_mean_sd_curve.pl
+
note: Since O2 consumption is constant, it might not make sense to use this in a convolution, since it isn't
/home/lml/krypton/Zhuge/xpp/ASM15.ode
+
      linear.
Bugs:
 
  
Source code in ~krypton/lml/facil 
+
Model 3 is a point source model, but O2 consumption by the tissue is proportional to the O2 level in the tissue.
# Popen is monotonic as it should be.
+
  I derived it from Crank's equations 6.60 (infinite hollow sphere model) and 14.13 (see below).
must provide -f cafilename
+
  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.
  
===  cluster  -h  ===
+
note: because R2 really should vary in an image, depending upon the distance between nearby blood vessels
Drops random Ryr receptors into a world.  Then calculates how many clusters and their sizes get produced.
+
        and because Ps is not just a scale factor (so, eg, brighter blood vessels in an image, if brightness is
Currently the "world" default size is  (2um)^3.  (see -wsize)
+
        proportional to Ps, do NOT just cause a scale factor in the P(r) values), it may NOT be appropriate
The origin of this world is in it's center (so it goes from -1um to +1 um in each direction by default).
+
to take the image produced by this program and convolve it with an image of blood vessels to get
A histogram of cluster sizes is printed to stdout.
+
estimates of oxygenation of tissue. This comment may apply to all three models (definitely to -m 1)
  
Usage:
+
Usage: oxygen -m # [options]
cluster [options]  
+
    required:
Options:
+
  -m # which model to use.
distance options:
+
        -m 1 :line source model with constant O2 consumption
-eucliddist:      calculate a Euclidean distance (same in x,y,z directions). This is the default.
+
-m 2: point source model with constant O2 consumption.
  (use -cdist option to set the nearby distance for this).
+
        -m 3 :point source model with O2 consumption proportional to O2 concentration.
-absdist:   rather than calculate a real distance, calculate max(ABS(dx),ABS(dy),ABS(dz)) - for speed
+
Use point source models if planning on convolving resulting image with a blood vessel image.
  (use -cdist to set the nearby distance for this.)
+
 
-psfdist x y z:   distance (in um) a pt can be in the x, y, and z directions and be considered nearby.
+
     options for all models:
  Does not use -cdist.  To approximate a psf you might specify .2 .2 .6
+
Although these options can be used in all models, different models have different sensitivities to them.
      -cdist #:        how close (in um) two receptors must be to cluster, default = 0.500000
+
  -R1 # vessel radius (um). Changes to this can change P a lot (if -m 1), and may require R2 to change (see -c).
other options:
+
default = 5.00
      -2D:   do a 2D simulation (x and y), not a 3D simulation
+
  -R2 # max distance any tissue is from a vessel (um). This changes the solution a lot for some models
-cylinder inner outeronly place Ryr within a cylinder (e.g., plasma membrane) with specified
+
but for the -m 3 model it only affects how far out data is graphed, default = 2268.00
                        inner and outer radius (in um). The cylinder has its length the entire y dimension.
+
More precisely, for -m 1 and -m 2 it is the distance at which dP/dr = 0 (ie, a b.c. on the pde).
  Only the parts of the cylinder which fit in the world (-wsize) are used.
+
  -Ps # partial pressure of Oxygen at the blood vessel (mm Hg). Default = 52.00
-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)
+
40 is typical of veins, 95 of arteries. This is held constant over time in all the models right now.
-psize x y z:   pixel width (in um) in the x, y, and z directions (default = 0.1,0.1,0.1)
+
For -m 1, this will affect the O2 value at R1, but how P changes RELATIVE to P(at R1) (as r increases)
      -numryr #:        number of Ryr receptors to drop, default = 1000
+
will not be affected (ie, it does NOT just scale everything).
-mindist #:   when placing Ryr receptors, keep this minimum distance (in um) between them.
+
    model 1 options:
-randstart #:   start the random number generator with # as the seed. So runs can be reproduced.
+
  -c use with -R1 to automatically calculate R2 based on the specified R1 (since R2 affects the solution).
-image name.i2i   write out an image of the Ryr receptors.  Can then use blur3d to create a realistic
+
(this also sets -m 1 as a convenience)
  microscope image, and countobjs to analyze it and compare to real data.
+
    model 2 options:
diagnostics:
+
  -b # changes the 2nd boundary condition to be P at R2 = # mm Hg
      -debug:          turn on debugging
+
instead of dP/dr = 0 at R2 (this also sets -m 2 as a convenience)
      -verbose:        be a bit more verbose
+
    model 3 options:
      -h:  print this help
+
  -P0 # the initial oxygenation level of the tissue (mm Hg). Default = 0.000000
      -H:  print this help
+
This will change the solution a lot, since it is also the level that O2, in steady state, approaches as r->infinity.
      -help:  print this help
+
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 zdimcreate 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.
 +
 +
 +
</nowiki>
 +
===  sparkspread  ===
 +
<nowiki>
  
Source code in ~krypton/lml/Zhuge/Ryr_clusters 
+
Calculates the spread of spark event amplitudes given that two events occur at the same
/home/lml/krypton/bin/cluster -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.
 +
 
 +
A valid datafile has either blank lines, comments (start with #) or a data line (spark event).
 +
A data line has 8 or 11 fields. 11 if a stoc is associated with the spark event
 +
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.
  
===  diffusion_limited_binding  -h ===
+
Usage: sparkspread [options] datafile
 +
options:
 +
  -h: do NOT print histogram for intraspark data.
 +
  -H: do NOT print histogram for interspark data.
 +
  -c: do NOT print cumulative distribution for intraspark data.
 +
  -C: do NOT print cumulative distribution for interspark data.
 +
  -b #: number of bins for histogram, default = 20
 +
  -n: normalize the histograms so their maximum is 1
 +
  -k: also print ks statistic showing if two distributions are different.
 +
 +
</nowiki>
 +
===  spot_diffusion ===
 +
<nowiki>
 
unknown option h
 
unknown option h
incorrect command line.
 
Prints out distance (um) and concentration (particles/cm^3) at that distance
 
a slab volume of initial uniform concentration (1 particle/cm^3)which has a ligand
 
binding to a plane at x = 0.  This is diffusion limited binding. See my notes of 10/20/98.
 
  
Usage: diffusion_limited_binding [options]   
+
Prints out time (secs) and concentration (nMolar) seen at a distance
 +
from a channel with a constant current, open for specified time.
 +
 
 +
Usage: spot_diffusion [options]   
 
options:
 
options:
  -D #:  diffusion (cm^2/msec), default = 2.2E-09
+
  -D #:  diffusion (cm^2/sec), default = 2.2E-06
  -t t1 t2start and stop time to simulate (msec), default = 0.000000 1000.000000
+
  -c #:  current (pAmp), default = 1
set both numbers equal if you only want one time point.
+
  -s #starting concentration (resting level, in nM), default = 0
  -x x1 x2: start and stop distances to print (um), default = 0.000000 10.000000
+
  -T #:   total time to simulate (seconds), default = 1.000000
set both number equal if you only want one position
+
  -t #: length of time current is on (seconds), default = 1.000000
  -L #: thickness of slab volume (um), default = 10.000000
+
  -r #: distance from channel opening (um), default = 0.100000
  -T #: number of samples in t, default = 10
+
  -R r0 r1 dr: average over a range of distances (crude psf), from r0 to r1 by dr (in um)
  -X #: number of samples in x, default = 1000
+
  -n #: number of time points to sample, default = 1000.000000
  -h: print this help message.
+
  -F: print out time (msec) and flux (particles/cm^2-msec) at x = 0
+
</nowiki>
(i.e., rate molecules binding to x=0 surface).
+
===  total_ca  ===
I've made flux towards lower x positive (normally it would be negative).
+
<nowiki>
  -B: print out time (msec) and total # of particles/cm^2 bound at x = 0  
+
#/home/lml/krypton/bin/total_ca
(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)
+
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.
===  ellipse  ===
+
Output is printed to stdout.
incorrect command line.
+
All input concentrations should be in nM
This program creates an elliptical cell, cell length is in the y direction.
+
Each z slice is analyzed separately (i.e., z is assumed to be time) unless image is rectangular and 3D (-R).
It is used to model a squashed cell, and see how different it looks after
+
 
blurring than a cylindrical cell
+
Usage: total_ca [options] ca.i2i
 +
      options for printing graphs of calcium (not concentration) vs. distance from ca entry location:
 +
the units for the graph are nM*um^3, but 1nM = .6ions/um^3 , so multiply be .6 to get ions
 +
                      (and 1pA = 3,000 ions/msec if you want to convert to pA-msec).
 +
        -n: normalize calcium distance graph for each z slice (so sum of amplitudes = 1),
 +
                      (otherwise when graph spacing is changed, -g option, the height of the graph will change).
 +
  -a:   print absolute calcium, not delta calcium (the default).
 +
                      when this is applied to a uniform image it should produce a 4pi*r*r distribution.
 +
            The default, delta calcium, prints the delta (i.e., change) from slice 0 (regardless -z option)
 +
        (but delta calcium not calculated if 3D rectangular, i.e., -R specified).
 +
 
 +
  -p # #: pixel size in microns in the radial (x) and lengthwise (y) directions,
 +
default = 0.10 and  0.10
 +
  -P # # #: pixel size in microns in x,y,z directions (rectangular not cylindrical coords),
 +
default = ( 0.10, 0.10, 0.10)
 +
  -r: data is rectangular, not cylindrical coords (-P sets this too)
 +
(e.g., already passed through cyl2cart).
 +
  -R: data is 3D rectangular (not 2D+time), not cylindrical coords.
 +
  -e x y:      0-indexed coords of calcium entry location (default: x= 0, y = ydim/2)
 +
  -E x y x:    0-indexed coords of calcium entry location for 3D rectangular data
 +
(i.e., z direction is not time). sets -R option.
 +
        -g #: graph spacing. default is the pixel size.
 +
        -s #:         subsample each voxel this number of times in the x (radial) and y (longitudinal) directions,
 +
                      (and z if 3D and not 2D+time) default = 3 (anything less tends to introduce errors).  
 +
        -z low hi dz: only look at z slices low to hi (0-indexed, inclusive), stepping by dz.
 +
 
 +
see also:
 +
    printvals, float2int, in matlab: readxmgr, acurves (see ~lml/krypton/JSinger for an example)
  
Usage: ellipse [options] ellipse.i2i
+
source code in ~lml/krypton/Walsh directory.
options:
 
  -d xdim ydim zdim:  dimensions of image, default = (50,100,50)
 
  -r xradius zradius:  radius (in pixels) in the x and z directions, default (20.000000,20.000000)
 
  -s samplerate:  number of subsamples in x and z directions per pixel, default = 1
 
  -i intensity:  intensity inside the ellipse, default = 100.000000
 
 
   
 
   
===  em  -h ===
+
</nowiki>
Creates (or reads in) a HMM and then generates random data from it
+
===  vcspat-models ===
(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.
+
argc = 1
This is a way for me to learn how to implement the EM algorithm.
 
  
Usage: em [options]
+
This program creates a volume image with objects randomly placed
options:
+
within it. The mask image defines where an object is allowed to be placed.
  -s #: number of states, default = 2. Must specify -t and -p after this.
+
The mask value can be changed with the -M option. Objects can either be individual
  -t # # # ... #: state transition probabilities. If there are S states (e.g., -s #)
+
voxels (the default) or tiny images (-o option) or connected voxels in an image (-O).
                        order: T[1][1], T[1][2], ... T[1][S], T[2][1] ... T[S][S] if there are S states),
+
 
                        where T[i][j] is the probability of a transition from state i to state j.
+
Usage:
  -p # # # ... #: prior probabilities of states (S entries if there are S states)
+
   vcspat-models [options] mask.i2i out.i2i
  -P #: which prior estimate to use for the pdf of the data (ie., estimate of Poisson process)
 
        1 = uniform, 2 = delta, 3 = uniform+delta, 4 = peice of observed data histogram (default)
 
        5 = true pdf (Poisson)
 
  -n #: number of data points to simulate, default = 100
 
  -m #: maximum number of iterations to perform, default = 20
 
        -truetrans: use the true transition probabilities as the initial guess (default = uniform)
 
        -trueprior: use the true prior probabilities as the initial prior guess (default = uniform)
 
  -findstates:  also find (and print) the estimate of the states at each time point.
 
  -vverbose. 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
+
Options:
See also: ~/krypton/facil/transpose.pl  to print out selected lines from the output file
+
  -m #    : model number (default 0).
          ~/krypton/matlab/netlab: has EM routines
+
            0 - grid pattern
          ~/krypton/matlab/bayes/BNT/HMM: has HMM and EM routines
+
            1 - random pattern
/home/lml/krypton/bin/em -h
+
  -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
  
== Statistics ==
+
Options related to objects:
=== cluster_distances.pl -h ===
+
  -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, etcIf -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).
  
Takes output from channel_current2 (after 11/24/09) and pulls out statistics about
+
OtherOptions
mean distance to each BK cluster.  Then produces average stats from all the files
+
  -s #    : seed for random number generator (default pid)
analyzed. Output to stdout.
+
  -x #    : x increment for grid pattern (default 3)
 +
  -y #    : y increment for grid pattern (default 3)
 +
  -z #    : z increment for grid pattern (default 3)
 +
  -V: verbose
  
 +
note: entire image name (with extension) is required.
 +
note: a - in place of an image name means stdin or stdout.
 +
Examples:
 +
  objs_via_ascent in1.i2i inid1.i2i
 +
  objs_via_ascent in2.i2i inid2.i2i
 +
  vcspat-models-new -m 1 -M 1 -P in1.i2i inid1.i2i -N outid1.i2i  mask.i2i out1.i2i
 +
  vcspat-models-new -m 1 -M 1 -P in2.i2i inid2.i2i -N outid2.i2i  mask.i2i out2.i2i
 +
  object_overlap outid1.i2i outid2.i2i  > obj_overlap
 +
  overlapL out1.i2i out2.i2i > coloc
  
  usage:
+
See also: krypton/Qiong/run1,  vcspat, randompuncs, spatial_stats2, objs_via_ascent, countobjs
  
  -files:file1:file2:...:filen       which files to analyze. Defaults are files named 2_*.currents in cwd.
+
Source code in /storage/big1/lml/jac/was_invitro/Projects/cspat-volume
  -numBKvsProb       also prints numBK vs prob data suitable for xmgrace
 
  
 +
</nowiki>
 +
== Image Analysis ==
 +
===  Corecell.pl  ===
 +
<nowiki>
  
example:
+
Takes a 3d image and an outline and keeps all data pts within the specified distance
  (channel_current2 .... > file.channel_current) >& file1.currents
+
of the outline (removes the "core" of the cell).  
  (channel_current2  .... > file2.channel_current) >& file2.currents
+
Also produces a file named in_image_H.histo. See help for histogram2 about that.
  cluster_distances.pl -numBKvsProb -files=file1.currents:file2.currents > avg_distances.txt
+
If in_image2.i2i out_image2.i2i are specied, in_image2.i2i is also cored
  fgrep -v clusters avg_distances.txt |xmgrace -pipe
+
(and histogram2 is applied to the pair in_image.i2i and in_image2.i2i when producing in_image_H.histo).
  
note: mean distances to clusters are not always increasing (e.g., mean distance to 10th
+
Written to let Ronghua only keep BK and Ryanodine label near the plasma membrane.
      cluster could be SMALLER than the mean distance to the 9th cluster).  I think this
+
Note: touching voxels may have a distance of .5 voxels, and voxels at the same
      has to do with limiting my maximum distance (see comments in this file).
+
      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 -h ===
+
</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 _)
 +
 
 +
 +
</nowiki>
 +
===  extract_area2.pl  ===
 +
<nowiki>
 +
Can't use 'defined(@array)' (Maybe you should just omit the defined()?) at /home/lml/krypton/bin/extract_area2.pl line 85.
 +
 
 +
</nowiki>
 +
===  findpaths_exo4.pl  ===
 +
<nowiki>
 +
 
 +
this program takes output from exo4.
 +
similar to findpaths_exo3.pl, but parses exo4 output rather than exo3 output.
  
-t1=#:#:# threshold one should go from # to # by #. default = 800:1200:50
+
usage:
-t2=#:#:# threshold two should go from # to # by #. default = 800:1200:50
+
   findpaths_exo4.pl file1.out
-t3=#:#:# threshold three should go from # to # by #. default = 2000:4000:200
 
-numthresh=#1:#2:#3   ignore the third number in the -t1, -t2, and -t3 options (or in the default) and instead calculate a
 
  threshold step size so that #1 thresholds are applied to im1.i2i (dat image)
 
  #2 thresholds are applied to im2.i2i (ctx image), #3 thresholds are applied to im3.i2i (rin image).
 
  e.g., -numthresh=5:10:10 will apply 5 different thresholds to im1.i2i, and 10 thresholds to im2.i2i and im3.i2i.
 
  Using this option lets me insure that each call to coloc.pl will produce exactly the same number of data points;
 
  this may make the statistical comparison between cells easier.
 
  
-Melikian=file in addition to creating output for VennDiagram, create text file with the coloc percentages
+
options:
Dr. Melikian is interested in. Graph via xmgr -nxy. See header in file for coloc info.
 
For this to work the three image files MUST be specified in the order 405  594  488 (i.e., rin.i2i ctx.i2i dat.i2i)
 
-Melikian2=file Same as -Melikian, but dat (488) is image 1, ctx (594) image 2, and rin (405) image 3
 
-area=file.xyr also print out Melikian data as xyr where r is proportional to the number of pixels involved
 
(i.e., the denominator used when calculating the percent colocalized).
 
prints to "file.xyr".  Must also specify either -Melikian or -Melikian2
 
xmgrace -graphtype fixed -settype xyr file.xyr
 
-matlab=file:#  like -area but as columns so easy to read into matlab: t p1 n1 p2 n2 p3 n3 p4 n4
 
# is the max n value (ie, all n values are scaled so the max over n1,n2,n3,n4 is #).
 
Since p1,p2,p3,p4 are percent, # is typically set to a small part of that, e.g. .05.
 
If # is negative then abs(#) is just used as a scale factor (so -1 would just keep the
 
n values as the number of voxels). Graph in matlab with line width of 2*n1:
 
matlab  # import data=(tdim,9)
 
>> lowy = data(:,2) - data(:,3); hiy = data(:,2) + data(:,3);  x = data(:,1);
 
>> area(x,hiy,'FaceColor',[1 0 0],'EdgeColor','r','LineWidth',1); hold on;
 
>> area(x,lowy,'FaceColor',[1 1 1],'EdgeColor','r','LineWidth',1);
 
Must also specify -Melikian or -Melikian2.
 
  
-debug
+
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  -h ===
+
</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.
 +
 
 +
</nowiki>
 +
=== mask_and_coloc.pl ===
 +
<nowiki>
 +
Takes a threshold, x and y translation for vinculin image, a pts file, and two images, and creates a mask
 +
and then calculates colocalization. See README.
  
  usage:
+
mask_and_coloc.pl -x=# -y=# -thresh=# -pts=file.rpts -vin=vin.i2i -trip=trip.i2i
      probcircle.pl [options]
 
  
  options:
+
options:
-D=# default = 1
+
  -tx=# translate by a max of -tx when calculating other colocalization numbers, default = 25
-just_prob don't print the third column
+
  -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.
  
   examples:
+
      probcircle.pl | xmgrace -free -pipe -nxy -
+
</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 ...
  
   see also: p. 249 stereology_book.pdf
+
   Examines all the zip files (produced within fiji when outlining regions) in the current directory. These have
    /home/lml/krypton/packages/fiji/stereology_lml.template
+
  the boundary of the explant, day7 growth, and day11 growth.
    /home/lml/krypton/Corvera/Raz/stereology/plot_results.pl
+
  note: this program assumes that all the data in the directory is from the same patient and the same tissue type.
    /home/lml/krypton/facil/cross_sections_of_sphere
+
 
 +
  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:
===  compare2dist  ===
+
-tmpdir=fullpathname directory to use for temporary files which are created, eg: -tmpdir=/home/lml/krypton
incorrect command line.
 
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:
+
-zip_file=file.zip
    time calcium prior_baseline post_baseline amplitude
+
-zip_file=file.zip:file2.zip:...:filen.zip
      where the values are
+
only examine the one specified zip file, not all those in the directory
      time:           time of STOC
+
(If the second form is used, you can specify as many as you want.)
      calcium:        SR calcium level
+
note: you may still need to specify -zip_ending so that the ending of this file can be stripped
      prior_baseline: amplitude just prior to STOC
+
      off correctly (so the -combined_ending and -results_ending can then be added correctly).
      post_baselineamplitude just after STOC
+
-zip_ending=stuff e.g., -zipending=_area.zip  . All files which end in this will be analyzed; default = _Area.zip
      amplitude:      amplitude amplitude of STOC (not relative to baseline)
+
-skip=file.zip[:file2.zip...]   list of zip files (without the full path) to skip.
Data is expected to already be sorted by time (smallest to largest).
 
comment lines must begin with a #
 
  
Usage: compare2dist [options] datafile1 datafile2
+
-results_ending=stuff e.g., -results_ending=_results.txt  . This is what the -zip_ending should be replaced by
options:
+
to get the name of the associated fiji results file.  note the _ should be included here
    -t #: only include data with an amplitude > #. The default
+
if it was included in -zip_ending.
is to assume a 0 threshold. If you have acquired the data
+
 
using some thresholding criterium (eg, only peaks above
+
-combined_ending=stuff  e.g., -combined_ending=_combined_reduced_.i2i  . default = combined.i2i.
10picoamps are counted) then you should provide that number
+
This is any string which helps identify the last part of the combined image filename.
here, even if all your data is above this (ie, you've applied
+
-combined_scaling=#:# e.g., -combined_scaling=2:2 if reduceima -bin 2 2 was applied to get _combined_reduced_.i2i.
the threshold in your identification phase). This is because
 
we need to know it when we shift amplitudes of the second
 
distribution to see if it could match the first distribution.
 
    -b: subtract average baseline from amplitude prior to use (ie, prior
 
to any thresholding or intensity shifting of data).
 
    -s delta max: shift datafile2 amplitudes down by a maximum of max, in
 
increments of delta, to see if it will then match datafile1.
 
  -p #: our guess of the percentage of data missing from datafile2 because it was
 
below our threshold/detection criteria (a # from 0 to 1).
 
This plus the amount of datafile2 shifted below threshold determines
 
our estimate of the amount of data missing from the shifted datafile2 and
 
the unshifted datafile1. The larger this number is, the more likely
 
the two curves will appear similar (since differences in actual data
 
examined will be proportionally smaller differences, and we are assuming
 
all missing data matches exactly, but see -m below). Default = 0.000000
 
    -m: assume all missing data maximally MISmatches, this would probably be
 
a worst case scenario, so that if the KS statistic says the distributions
 
could be the same even with the -m option, its probably true.  But I'm
 
not certain of this, since it really depends how this affects the
 
relative spacing between the cumulative distributions. I'd have to
 
think about it some more.
 
  
see also:test_distr, poisson
+
-scale=#:# distance and area (eg, -scale=2:4 if reduceima -bin 2 2 was used) scaling. This will multiply
This code is in ~lml/vision/Rhonghua/STOCS
+
the area stored in the fiji file and the area calculated via my mask by the second number.
  #/home/lml/krypton/bin/compare2dist
+
The first number will multiply the distance of the explant from the center of the image.
 +
This option is just here to handle 001_BAP and 002_PRO datasets. They were analyzed in fiji
 +
with the images reduced by a factor of 2 in x and y. So the fiji areas produced will be low
 +
by 4x, as will my areas.  This option compensates for that. See ~/Corvera/Raz/README for 10/11/13.
  
===  compare2gaussian  ===
+
-check_intersect check if outlines intersect with the explant's outline. If so, set an error flag on stdout printout
incorrect command line, need 1 data files.
+
and print info to stderr. eventually will just use area numbers rather than masking area in this situation.  
This program calculates whether a given set of data could be samples from a known mixture of Gaussians.
+
that is not done yet ...  
datafile should have one data point per line. comment lines begin with #.
 
Output statistics to stdout.
 
  
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
+
-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
  
Source code is in ~lml/krypton/Lefkowitz
+
-just_check just check whether each zip roi outline has the correct number of associated image files.
  #/home/lml/krypton/bin/compare2gaussian
+
eg, if the zip file has 3 outlines (explant, firstday, secondday) there should be two i2i files with DAY# in their name.
 +
prints to stderr info about those which don't have the correct number. does nothing else.
 +
-verbose some extra info to stdout
 +
-debug prints some tracing info to stderr
 +
-print_fname print name of each zip file as it is being analyzed, to stderr.
 +
-dlevel=# extra debugging. the bigger the number the more the printout. # is an integer starting at 1.
 +
-dlevel=1 will print a trace of commands to execute to mimic (parts of) this perl script.
 +
-noclean don't remove the temporary files which were created
 +
the files are: _ones.i2i _explant.rpts _day11.rpts _day7.rpts _excluded_region.rpts
 +
      _explant.i2i  _day11.i2i  _day7.i2i _day7_noex.i2i _day11_noex.i2i _day7_noex_halfex.i2i _day11_noex_halfex.i2i
 +
  (if multiple zip files were analyzed, only the files from the last one will be left, since they get reused)
 +
-dont_recalc only for diagnostics. does NOT restrict the analysis to just the growth away from the wall.
 +
with this specified this entire program should just reproduce the numbers we already
 +
have in *Results.txt since that uses the entire area. ie, this make the program a no-op.
 +
 
 +
  see also:
 +
/home/lml/krypton/Corvera/Raz/README
 +
analyze_gedmat3.pl a script which calls mask_gedmat_images3.pl for all of Raz's data. Also versions 4,5,6, and 7.
 +
play_results3.pl
 +
raz_rates.pl
 +
mask_gedmat_images.pl
 +
mask_gedmat_images2.pl
 +
/storage/big1/raz/GEDMAT/
 +
ReadROI.pl
 +
extract_area.pl
 +
combine_images.pl
 +
gedmat_to_xy.pl
 +
/home/lml/krypton/Corvera/Raz/analyze_gedmat.pl
 +
chres_rpts.pl
 +
  filter_rptsinz.pl
 +
 
 +
  examples:
 +
cd /storage/big1/raz/GEDMAT/006_JTH/OM
 +
 
 +
# generate 006_JTH_OM.areas with all the data (area_mex_border is the number which should replace farea)
 +
# also produce 006_JTH_OM_7masks.i2i and 006_JTH_OM_11masks.i2i so I can check on the validity of the algorithm.
 +
# place diagnostic mask images in /home/lml/krypton/Corvera/Raz/output and the output data file in
 +
# /home/lml/krypton/Corvera/Raz (note: all directories must already exist).
 +
mask_gedmat_images.pl -tmpdir=/home/lml/krypton/Corvera/Raz/output  -zip_ending=_Area.zip -results_ending=_Results.txt
 +
-combined_ending=combined.i2i -days=7:11
 +
-save_day=/home/lml/krypton/Corvera/Raz/output
 +
>& /home/lml/krypton/Corvera/Raz/006_JTH_OM.areas
 +
 
 +
# look at the masks produced:
 +
cd /home/lml/krypton/Corvera/Raz/output
 +
      play_results3.pl 006_JTH_OM_day7
 +
or:
 +
fgrep -v # 006_JTH_OM_11masks.play_labels > tmp.play_labels  # eliminate the comment line, play doesn't like those.
 +
play -labels tmp.play_labels 006_JTH_OM_7masks.i2i
 +
 
 +
# compare the full areas produced which what fiji did (as a check). only pull out the good data. they should be very similar:
 +
cd /home/lml/krypton/Corvera/Raz
 +
gedmat_to_xy.pl -cond='if (($date eq "date_sure")&&($perr==0)&&($aerr==0)) {1;} else {0;}'
 +
-xcoord='$area' -ycoord='$farea' 006_JTH_OM.areas | xmgrace -free -pipe
 +
 
 +
# now grab the data we really want. compare the old way, with the area when the growth half near the well border is masked off:
 +
gedmat_to_xy.pl -cond='if (($date eq "date_sure")&&($perr==0)&&($aerr==0)) {1;} else {0;}'  
 +
-xcoord='$area_mex' -ycoord='$area_mex_border' 006_JTH_OM.areas | xmgrace -free -pipe
 +
 
 +
# it may be hard to see some of these images as they are very large, do it this way (note the -L to keep the -1 boundary values):
 +
addlines _ones.i2i _excluded_region.rpts - | reduceima -bin 3 3 -L - -|play -P -1 R -P -2 G -P -3 B -P -4 C -P -5 Y -
 +
 
 +
 
 +
# run with some diagnostics:
 +
cd /storage/big1/raz/GEDMAT/006_JTH/OM
 +
/home/lml/krypton/bin/mask_gedmat_images.pl -tmpdir=/home/lml/krypton/Corvera/Raz -zip_ending=_Area.zip
 +
        -results_ending=_Results.txt -combined_ending=combined.i2i -days=7:11
 +
        -save_day=/home/lml/krypton/Corvera/Raz/006_JTH_OM_7masks.i2i    > /home/lml/krypton/Corvera/Raz/006_JTH_OM.areas
 +
# play.FC14 allows labels to have comment lines (first character of line is a #)
 +
cd home/lml/krypton/Corvera/Raz
 +
play.FC14 -labels 006_JTH_OM_11masks.play_labels 006_JTH_OM_11masks.i2i
 +
chres_rpts.pl -sx=.33 -sy=.33 -truncate -min=1:1 output/_day11.rpts > _day11_bin3.rpts
 +
chres_rpts.pl -sx=.33 -sy=.33 -truncate -min=1:1 output/_day7.rpts > _day7_bin3.rpts
 +
chres_rpts.pl -sx=.33 -sy=.33 -truncate -min=1:1 output/_explant.rpts > _explant_bin3.rpts
 +
reduceima -bin 3 3 output/_day11_noex_halfex.i2i - | addlines - _day11_bin3.rpts - | addlines - _day7_bin3.rpts - |
 +
addlines - _explant_bin3.rpts - | play -P -1 R -
 +
addlines /storage/big1/raz/GEDMAT/006_JTH/OM/D07_20130524_GEDMAT_006_JTH_OM_DAY7_combined.i2i output/_day11.rpts - |
 +
addlines - output/_day7.rpts - | addlines - output/_explant.rpts - | reduceima -bin 3 3 -L - - | play -P -1 R -
 +
 
 +
 
 +
# do a bunch of stuff
 +
analyze_gedmat3.pl # apply this perl script to lots of data
 +
cd output
 +
      play_results3.pl 006_JTH_OM_day7  # look at some of it
 +
raz_rates.pl # generate stats
 +
  
===  compare_dist2  ===
 
incorrect command line.
 
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
 
  -V very verbose
 
example:
 
      create a simulated distribution and compare it with real restored data (real_ryrr.i2i, run5 does this 100 times):
 
  cluster -wsize 10 43 25 -cylinder 0.001 3 -psize 0.08 0.08 0.25 -mindist 0.030 -numryr 500 -image ryr.i2i
 
  blur3d -S 40000 -P ryr.i2i psf.i2i ryr_b.i2i
 
  noise -c RCA ryr_b.i2i ryr_bn.i2i
 
  setenv myloc /home/lml/krypton/Zhuge/Ryr_clusters
 
  setenv eprloc /storage/big1/epr/queues
 
  echo "  /storage/big1/epr/run_epr -V -log -NSC 4 -sm 1e-05 -it 5000 -sc 0.025 -co 0.001
 
-psf ${myloc}/psf.i2i ${myloc}/ryr_bn.i2i ${myloc}/ryr_bnr.i2i " > /storage/big1/epr/queues/standard/lml.0
 
  while (1==1)  if ( ( ! -e ${eprloc}/standard/lml.0 ) && ( ! -e ${eprloc}/running/lml.0 ) ) then break endif sleep 60s end
 
  countobjs -k -s 5 300 -t 4500 4500 sim_ryr.objs ryr_bnr.i2i
 
  cull -s -c -2 < sim_ryr.objs > sim_ryr.stats
 
  countobjs -k -s 5 300 -t 4500 4500 real_ryr.objs real_ryrr.i2i
 
  cull -s -c -2 < real_ryr.objs > real_ryr.stats
 
  compare_dist2 -b sim_ryr.stats real_ryr.stats  >& chi_ryr
 
  compare_dist2 -k -b sim_ryr.stats real_ryr.stats  >& ks_ryr
 
  tail chi_ryr ks_ryr
 
  xmgrace chi_ryr; xmgrace ks_ryr
 
  
see also: cluster, run5
+
2.  bounding box was used to calculate area for sorting the outlines temporally (from smaller to larger area).
This code is in /home/lml/krypton/Zhuge/Ryr_clusters/
+
      but when outlines intersect bounding box can at times NOT be a good surrogate for area.
  #/home/lml/krypton/bin/compare_dist2
+
  $roi_area[$r] = ($maxx-$minx)*($maxy-$miny);  
 +
  handled these two issues by writing sub calc_com().
 +
-use_bbox_area will cause the OLD method to be used instead.
  
===  correlationL  ===
 
/home/lml/krypton/bin/correlationL
 
incorrect command line.
 
This program plots intensities from image1 vs intensities from
 
image2. image1 on the x axis, image 2 on the y axis. Intensities
 
in both images are rescaled 0 to the size of the output image
 
(default = 512).  The intensity at each pixel in the output
 
image is the number of (image1,image2) voxels with that particular
 
intensity combination.
 
The intent is to be able to look at the output image and get a sense
 
for whether there is a correlation between intensities
 
in the two images.  If so, perhaps a least squares line
 
fit should be done to see how well one images correlates with the
 
other, or -s option can be specified.
 
The minimum, maximum, and scale factors are printed to stdout.
 
Version 1.1
 
  
Usage: correlation [options] im1.i2i im2.i2i out.i2i
+
note: fiji areas are already sorted smallest to largest when I first bring them in (extract_area2.pl does that):
options:
+
  $prev_results = `extract_area2.pl -justfiles=$resultsfile`
  -d xdim ydim: output dimensions of new image
+
  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
(default = 512,512).
+
  being sorted based on bounding box, and fiji areas based on the true area in the Results.txt file. So the ordering
  -S im1scale im2scale: scale intensities with these scale factors. newval = (intens-min_intens)*scale
+
  may be different at times. No change was made to this.
  -B b1 b2:    force min_intens (black level) to specified valuenewval1 = (intens-b1)*scale1
+
 
  -i val1 val2: Ignore any voxels in image1 <= val1 and
+
  mask_gedmat_images4.pl -check_intersect  added.
any voxels in image2 <= val2.
+
determines when outlines intersect and sets the aerr (area error flag) in the
 +
output file. eventually it will calculate areas a different way when that happens
 +
rather than combining masked images (see ~/krypton/Corvera/Raz/README for 10/18/13). right now only sets the error flag.
  
  -h val1 val2: Ignore any voxels in image1 >= val1 and
+
  Examines all the zip files (produced within fiji when outlining regions) in the current directory. These have
any voxels in image2 >= val2.
+
  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.
  
  -r: instead of intensities, use the rank
+
  This is done by finding all the *_Area.zip files in the current directory, pulling out the outlines in those files
order of the intensities.
+
  and using that information to recalculate areas. It also needs to find the associated "combined" image file
  -a: automatically calculate the size of the
+
  (*_combined.i2i) to get image size and hence the position of the center of the well) and the fiji results file
output image. attempts to make the scale
+
  (*_results.txt, so the numbers produced here can be easily compared with them).  
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:
+
  note: The algorithm assumes that the area NEVER DECREASES with time, and that the explant region is always surrounded
    # to apply this to a set of 3D images, using the same scales and size images for easy comparison
+
by the day7 region which is surrounded by the day11 region. The latter assumption is sometimes invalid if
correlationL -S s1 s2 -d 512 512 -B 0 0 image1.i2i corr1.i2i    (and same for other images)
+
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
===  create_imagesL  ===
+
-cond in gedmat_to_xy.pl to eliminate those stats from further analysis.)
incorrect command line.
+
It also assumes the smallest area in each zip file is the original explant area, the next largest area is
This program takes output from many runs of "overlap" and
+
called day7 area and the largest area (if 3 are present) is assumed to be day 11 area.
produces two images. One image is a percent colocalization image
+
Sometimes when growth is about 0, the outlines on, eg, day7, may have slightly less area than the original
and the other is a probability image.  The overlap program MUST be
+
explant, so the outlines might be mis-ordered then. [actually it may read the correct day off the name of
run via the "many_overlaps" command. The probability calculations
+
the i2i image now].
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
+
  note: If only 2 areas (ie, two .roi files) are present in the zip file, they are assumed to be for
(as originally specified to "many_overlaps") which overlap with
+
the explant and day7 (not day11).
voxels above threshold in image2. A 100 in the output image = 100 percent.
 
The probability of observing as much (or more) overlap as we did due to
 
random chance is the prob.i2i image.  Probabilities are mulitplied by 100.
 
  
Position along the y-axis (vertical axis) of the image, corresponds to
+
  note: This program assumes the center of the combined image (usually 4 well images are combined into one) is the
thresholds for image2. The x-axis represents image1 thresholds. The
+
center of the well. see combine_images.pl. It also assumes the combined image name ends in combined.i2i
lowest threshold is the bottom left corner. See the first line in  
+
(see -combined).
your datafile for the range of thresholds this represents.
+
 
Overlap produces statistics for a range of allowed overlaps.
+
  note: some of the scripts I use to then analyze these results will multiply the area by 2, to get a "true" estimate
Create_images, by default, chooses an overlap within 1 voxel.
+
  of growth; since the value produced by mask_gedmat_images3.pl will be (roughly) half of the real growth rates.
If you want to use a different overlap distance use the -o option.
 
  
See also: overlap, probcolocal, many_overlaps
+
  usage:
 +
mask_gedmat_images3.pl  [options]
  
Usage:
+
  options:
create_images [options] datafile percent.i2i prob.i2i
+
-tmpdir=fullpathname directory to use for temporary files which are created, eg: -tmpdir=/home/lml/krypton
options:
 
  -o distance:   voxels within this distance count as overlapped.
 
  -n number:    number of voxels (1000000 default), see probcolocal.
 
  
Examples:
+
-zip_file=file.zip
  many_overlaps -t 100 1000 100 -T 100 1000 100 alpha_T.i2i beta_T.i2i tmp_output
+
-zip_file=file.zip:file2.zip:...:filen.zip
  create_images -n 363264 tmp_output percent.i2i prob.i2i
+
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.)
== Analysis of Points ==
+
note: you may still need to specify -zip_ending so that the ending of this file can be stripped
=== components.pl -h  ===
+
      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.
  
Calculates the number of connected components resolved over a range of point densities.
+
-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.
  
components.pl [options]
+
-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.
  
options:
+
-scale=#:# distance and area (eg, -scale=2:4 if reduceima -bin 2 2 was used) scaling. This will multiply
 +
the area stored in the fiji file and the area calculated via my mask by the second number.
 +
The first number will multiply the distance of the explant from the center of the image.
 +
This option is just here to handle 001_BAP and 002_PRO datasets. They were analyzed in fiji
 +
with the images reduced by a factor of 2 in x and y. So the fiji areas produced will be low
 +
by 4x, as will my areas.  This option compensates for that.  See ~/Corvera/Raz/README for 10/11/13.
  
-numpts=low:hi:delta
+
-check_intersect check if outlines intersect with the explant's outline. If so, set an error flag on stdout printout
-repeat=# number of times to repeat at each point density
+
and print info to stderr.  eventually will just use area numbers rather than masking area in this situation.
-res=# in microns
+
that is not done yet ...  
-outfile=name name of output file. otherwise to _tmp. always need write permission in current directory.
 
  
 
===  convex_hull.pl  -h  ===
 
  
This program takes an object outputfile (unless -rptsin or -tripletsin) produced by countobjs (or maskobjs) and finds the minimal
+
-save_day[=directory]
spanning tree connecting the center of mass of the objects, and the convex hull. Writes out connections as an rpts file to stdout.
+
saves the final binary mask for each days growth (eg, day7 growth minus the explant and minus the part growing towards the wall)
It also loops through 20 thresholds  for the pts, and prints to stderr some stats about the minimal spanning tree and
+
into a 3d mask image (patientid_tissue_day#_mask.i2i).  This image will be reduced down in xdim and ydim from the
convex hull of the points above each of these thresholds.
+
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 can be used to only selected a subset of the objects and to constrain the maximum distance (-maxdist).  
+
-patient5 patient5 files have some odd naming. use this option if analyzing them.
  
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
+
-use_explant_outline legacy. specify this if you want the center of the explant to be based on the average of the pixel positions
convex hull area, so that when the threshold rises high enough, only maxima inside the cell will still be present and hence
+
of just the pixels along the boundary (rather than the center of mass).
the convex hull will be stable and of much smaller area.
+
-use_bbox_area legacy. specify this if you want to order the outlines based on their bounding box area rather than their true area.
 +
You should probably specify both options (if you want either one), I'm not sure about consistency if only one is specified.
 +
 
 +
-just_check just check whether each zip roi outline has the correct number of associated image files.
 +
eg, if the zip file has 3 outlines (explant, firstday, secondday) there should be two i2i files with DAY# in their name.
 +
prints to stderr info about those which don't have the correct number. does nothing else.
 +
-just_stats goes a bit further than -just_check (does that too), sets -verbose and prints out stats about each outline. then exits.
 +
-verbose some extra info to stdout
 +
-debug prints some tracing info to stderr
 +
-print_fname print name of each zip file as it is being analyzed, to stderr.
 +
-dlevel=# extra debugging. the bigger the number the more the printout. # is an integer starting at 1.
 +
-dlevel=1 will print a trace of commands to execute to mimic (parts of) this perl script.
 +
-noclean don't remove the temporary files which were created
 +
the files are: _ones.i2i _explant.rpts _day11.rpts _day7.rpts _excluded_region.rpts
 +
      _explant.i2i  _day11.i2i  _day7.i2i _day7_noex.i2i _day11_noex.i2i _day7_noex_halfex.i2i _day11_noex_halfex.i2i
 +
  (if multiple zip files were analyzed, only the files from the last one will be left, since they get reused)
 +
-dont_recalc only for diagnostics. does NOT restrict the analysis to just the growth away from the wall.
 +
with this specified this entire program should just reproduce the numbers we already
 +
have in *Results.txt since that uses the entire area. ie, this make the program a no-op.
 +
 
 +
  see also:
 +
/home/lml/krypton/Corvera/Raz/README
 +
analyze_gedmat3.pl a script which calls mask_gedmat_images3.pl for all of Raz's data. Also versions 4,5,6, and 7.
 +
play_results3.pl
 +
raz_rates.pl
 +
mask_gedmat_images.pl
 +
mask_gedmat_images2.pl
 +
/storage/big1/raz/GEDMAT/
 +
ReadROI.pl
 +
extract_area.pl
 +
combine_images.pl
 +
gedmat_to_xy.pl
 +
/home/lml/krypton/Corvera/Raz/analyze_gedmat.pl
 +
chres_rpts.pl
 +
  filter_rptsinz.pl
 +
 
 +
  examples:
 +
cd /storage/big1/raz/GEDMAT/006_JTH/OM
 +
 
 +
# generate 006_JTH_OM.areas with all the data (area_mex_border is the number which should replace farea)
 +
# also produce 006_JTH_OM_7masks.i2i and 006_JTH_OM_11masks.i2i so I can check on the validity of the algorithm.
 +
# place diagnostic mask images in /home/lml/krypton/Corvera/Raz/output and the output data file in
 +
# /home/lml/krypton/Corvera/Raz (note: all directories must already exist).
 +
mask_gedmat_images.pl -tmpdir=/home/lml/krypton/Corvera/Raz/output  -zip_ending=_Area.zip -results_ending=_Results.txt
 +
-combined_ending=combined.i2i -days=7:11
 +
-save_day=/home/lml/krypton/Corvera/Raz/output
 +
>& /home/lml/krypton/Corvera/Raz/006_JTH_OM.areas
 +
 
 +
# look at the masks produced:
 +
cd /home/lml/krypton/Corvera/Raz/output
 +
      play_results3.pl 006_JTH_OM_day7
 +
or:
 +
fgrep -v # 006_JTH_OM_11masks.play_labels > tmp.play_labels  # eliminate the comment line, play doesn't like those.
 +
play -labels tmp.play_labels 006_JTH_OM_7masks.i2i
 +
 
 +
# compare the full areas produced which what fiji did (as a check). only pull out the good data. they should be very similar:
 +
cd /home/lml/krypton/Corvera/Raz
 +
gedmat_to_xy.pl -cond='if (($date eq "date_sure")&&($perr==0)&&($aerr==0)) {1;} else {0;}'
 +
-xcoord='$area' -ycoord='$farea' 006_JTH_OM.areas | xmgrace -free -pipe
 +
 
 +
# now grab the data we really want. compare the old way, with the area when the growth half near the well border is masked off:
 +
gedmat_to_xy.pl -cond='if (($date eq "date_sure")&&($perr==0)&&($aerr==0)) {1;} else {0;}' 
 +
-xcoord='$area_mex' -ycoord='$area_mex_border' 006_JTH_OM.areas | xmgrace -free -pipe
 +
 
 +
# it may be hard to see some of these images as they are very large, do it this way (note the -L to keep the -1 boundary values):
 +
addlines _ones.i2i _excluded_region.rpts - | reduceima -bin 3 3 -L - -|play -P -1 R -P -2 G -P -3 B -P -4 C -P -5 Y -
 +
 
 +
 
 +
# run with some diagnostics:
 +
cd /storage/big1/raz/GEDMAT/006_JTH/OM
 +
/home/lml/krypton/bin/mask_gedmat_images.pl -tmpdir=/home/lml/krypton/Corvera/Raz -zip_ending=_Area.zip
 +
        -results_ending=_Results.txt -combined_ending=combined.i2i -days=7:11
 +
        -save_day=/home/lml/krypton/Corvera/Raz/006_JTH_OM_7masks.i2i    > /home/lml/krypton/Corvera/Raz/006_JTH_OM.areas
 +
# play.FC14 allows labels to have comment lines (first character of line is a #)
 +
cd home/lml/krypton/Corvera/Raz
 +
play.FC14 -labels 006_JTH_OM_11masks.play_labels 006_JTH_OM_11masks.i2i
 +
chres_rpts.pl -sx=.33 -sy=.33 -truncate -min=1:1 output/_day11.rpts > _day11_bin3.rpts
 +
chres_rpts.pl -sx=.33 -sy=.33 -truncate -min=1:1 output/_day7.rpts > _day7_bin3.rpts
 +
chres_rpts.pl -sx=.33 -sy=.33 -truncate -min=1:1 output/_explant.rpts > _explant_bin3.rpts
 +
reduceima -bin 3 3 output/_day11_noex_halfex.i2i - | addlines - _day11_bin3.rpts - | addlines - _day7_bin3.rpts - |
 +
addlines - _explant_bin3.rpts - | play -P -1 R -
 +
addlines /storage/big1/raz/GEDMAT/006_JTH/OM/D07_20130524_GEDMAT_006_JTH_OM_DAY7_combined.i2i output/_day11.rpts - |
 +
addlines - output/_day7.rpts - | addlines - output/_explant.rpts - | reduceima -bin 3 3 -L - - | play -P -1 R -
 +
 
 +
 
 +
# do a bunch of stuff
 +
analyze_gedmat3.pl # apply this perl script to lots of data
 +
cd output
 +
      play_results3.pl 006_JTH_OM_day7  # look at some of it
 +
raz_rates.pl # generate stats
 +
 +
 
 +
 
 +
  source code: in /home/lml/krypton/bin/mask_gedmat_images.pl
 +
 
 +
 +
</nowiki>
 +
===  membrane3D.pl  ===
 +
<nowiki>
 +
 
 +
A script to run the routines necessary to perform 3D membrane segmentation.
 +
note: it needs write permission in the directory where inputimage.i2i resides since all output images go there too.
 +
It will run the following programs, in order:
 +
  1. /home/lml/krypton/facil/i2i2mhd (convert to mhd format)
 +
  2. /home/lml/krypton/segmentation/MR-Source/ACME/ACME-Binary/bin/cellPreprocess (median filter, fill holes)
 +
  3. /home/lml/krypton/segmentation/MR-Source/ACME/ACME-Binary/bin/resample (resample pixel sizes)
 +
  4. /home/lml/krypton/segmentation/MR-Source/ACME/ACME-Binary/bin/multiscalePlateMeasureImageFilter  (determine the planarity of each region)
 +
  5. /home/lml/krypton/segmentation/MR-Source/ACME/ACME-Binary/bin/membraneVotingField3D (update planarity based on neighbors voting)
 +
  6. /home/lml/krypton/segmentation/MR-Source/ACME/ACME-Binary/bin/membraneSegmentation  (produce segmented regions via a watershed algorithm)
 +
Each program expects input files of a certain type (e.g. unsigned char).
  
This program requires perl modules Graph::Kruskal and Math::Geometry::Planar, use cpanp to install these:
 
    yum install perl-CPANPLUS-0.91.3-202.fc16.noarch  - for cpanp
 
    cpanp -i Graph::Kruskal
 
    cpanp i Math::Geometry::Planar
 
  
 
usage:
 
usage:
  convex_hull.pl -tripletsin file1.triplets  > file1_mst.rpts
+
  membrane3D.pl [options] inputimage.[i2i|mhd|mha] outimage.mhd
  
  input options:
+
output files:
    -dx=#   spacing in the x direction, default = 1
+
  inputimage.mhd produced by i2i2mhd  - short ints
    -dy=#   spacing in the y direction, default = 1
+
  inputimage_med.mhd produced by cellPreprocess
    -dz=#   spacing in the z direction, default = 1
+
  inputimage_med_resamp.mhd produced by resample, unsigned char
    -rptsin     instead of file1.objs, read file1.rpts where file1.rpts was produced by max2d.
+
  inputimage_med_resamp_planar.mhd produced by multiscalePlateMeasureImageFilter, floating pt (doubles) between 0 and 1, how "planar" a pt is.
      -size1 and -iod1 are ignored when this option is specified.
+
  inputimage_med_resamp_eigen.mhd produced by multiscalePlateMeasureImageFilter, an eigenmatrix at each pt
    -tripletsin   instead of file1.objs read in file1.xyitriplets of x y and intensity.
+
  inputimage_med_resamp_eigen_voting.mhd produced by membraneVotingField3D, result of voting, unsigned char
 +
  outimage.mhd produced by membraneSegmentationresult of watershed, each region labeled with an id (short integer).
  
  analysis options:
+
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
    -size1=min:max     min and max object size allowed for file1.objs in pixels (inclusive)
+
      of 2 is specified, that is a one pixel radius.  
    -iod1=min:max   min and max object iod allowed for file1.objs (inclusive), or intensity if -tripletsin was specified.
 
    -maxdist=#: :  don't allow connections between pts further apart than this distance (after applying dx, dy, dz spacing factors).
 
  warning: if the distance is too small, then all the pts will not be connected to begin with;
 
    this may cause the minimal spanning tree algorithm to fail.
 
    default maxdist is  3000
 
  
  output options:
+
step 1. options for converting i2i to mhd:
    -addlines : output rpts format which addlines is more likely to be happy with (may not work in dave?)
+
  -convert=dx:dy:dz  The first step is converting our i2i format to mhd format.  This specifies the pixel spacing
    -hist : calculate histogram of distances (hist[int(dist)]++, where int just truncates to integer). obsolete.
+
in x y and z directions for that. default assumes 1:1:1. The "conversion" really just creates inputimage.mhd which
    -sizehist : calculate histogram of object sizes (in voxels) in file1.out. (hist[int(size)]++, where int just
+
is a text header which points to the original i2i image and gives some info about it.  
        truncates to integer). If you don't care about distances between two files (ie, only want -sizehist)
+
If the input image has a .mhd or .mha extension already (instead of .i2i) then no conversion is done.
        put the same file name for both files on the command line. obsolete.
+
Olga's images acquired with a 10x objective have a pixel size of .645 um/pixel (and z spacing of 10 um).
    -rpts=file.rpts :  put bounding boxes around objects found and lines between closest objects (similar to objs2bb.pl)
+
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.
  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?).
+
step 2. options for cellPreproces:
    -jack=max.rpts:# :  create an rpts file with the maxima in each object displayed as a small jack.
+
this may produce an unsigned char image (?)
    # controls the size of the jack. 1=1 pixel in size, 2 = 2 pixels, etc.
+
  -median=# radius of median filtering preprocessing (and hole filling). If this is not specified it isn't done.
-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:
+
step 3. options for resampling:
    -silent :   suppress warning messages.
+
this may produce an unsigned char image (?)
    -verbose
+
  -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.
-debug
+
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.
  
example:
+
  note: it may be necessary to do the above operations, which also convert the image into unsigned char, which is required for
  convex_hull2.pl -tripletsin -jack=jack.rpts:5 -addlines -twod -maxdist=100 file1.triplets  > file1_mst.rpts
+
step 4, multiscalePlateMeasureImageFilter?
  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 -
+
  note: step 6 (watershed) may also work best if the pixel sizes are the same in all directions.
  
 +
step 4. options relating to planarity:
 +
the planarity image produced will be doubles from 0-1.
 +
  -planar=# the sigma of the Gaussian used when classifying pixels as planar or not. default = 1
 +
  -alpha=# see the help for /home/lml/krypton/segmentation/MR-Source/ACME/ACME-Binary/bin/multiscalePlateMeasureImageFilter
 +
  -beta=# ditto
 +
  -gamma=# ditto
 +
  -c=# ditto
 +
  -planaropts="options for multiscalePlateMeasureImageFilter here" 
 +
available options (so far, but anything specified here will be passed), : -a # -b # -g # -c # -d -s -B -T
 +
options which go here should be specified in the format that multiscalePlateMeasureImageFilter wants them,
 +
for example: -planaropts="-c 5 -d -B"
 +
not in the alternative format that Membrane3D.pl desires (e.g. -planaropts="-a 5" is correct, -planaropts="-alpha=5" is wrong).
 +
    -stop_after_planar don't do anything after this step (e.g. voting for planar patches may not make sense if -B or -T specified)
  
see also:
+
step 5. options relating to voting:
  convex_hull, objs2mst.pl
+
the resulting tensor vote image will be unsigned chars from 0-255.
  objs2bb.pl, objs2dist.pl, objs2dist121.pl, closest_object, closest_voxel, countobjs, maskobjs, objs_via_ascent
+
  -region=# the sigma which defines the region within which a pixel influences other pixels. default = 10
  resolve_pts
 
  
+
step 6. options relating to watershed segmentation:
===  objs2alldists.pl  -h  ===
+
The resulting image will be long ints (id numbers) of regions.
Like obs2disp.pl but calculates the distance to ALL the objects (within -maxdist), not just the closest.
+
                See the help for /home/lml/krypton/segmentation/MR-Source/ACME/ACME-Binary/bin/membraneSegmentation
See ~/krypton/Zhuge/grants/AsthmaRO1/README for 5/27/11 and /home/lml/krypton/Zhuge/BKandRyr/analysis6/run18
+
  -thresh=# threshold value. this is applied to the tensor voting image to turn it into a binary image. then a  distance
   (which did NOT use this).
+
transform and watershed are applied. default = 128
 +
   -segopts="options for membraneSegmentation here"   
 +
for example:  -segopts="-S -l 20 -a 5 -c -D" will use this exact string as options.
 +
options so far: -S -l # -a # -s # -n -i # -w # -m # -c -v -d -D
  
This program takes 2 object outputfiles produced by countobjs (or maskobjs) and finds the shortest distance
+
other options:
from the center of mass of objects in file1.out to the center of mass of objects in file2.out.
+
  -verbose echo what is being done to stderr
 +
  -dummy don't really do anything; echo what would have been done to stderr.
 +
 
 +
example:
 +
reduceima -bin 4 4 G03_x_1_1.i2i G03_x_1_1_binned.i2i    - go from .645um/pixel, 10um in z -> 2.5um/pixel, 10um in z
 +
# -convert: just put correct pixel size info into an mhd header
 +
# -median:  smooth with a filter 10 um (4 pixels, since they are now 2.5um/pixel) in radius (diameter?)
 +
# -resample: change to a square pixel (10 um in x y and z). Change image format to unsigned char (needed by MultiscalePlateMeasureImageFilter)
 +
# -planaropts: options for planarity filter
 +
# -region:  width (in um) of neighbors for voting on planarity and updating it.
 +
# -segopts:
 +
# -thresh:  threshold for watershed segmentation
 +
membrane3D.pl -convert=2.5:2.5:10 -median=10 -resample=2:2:1 -planaropts="  " -region=50 -segopts="  "  -thresh
 +
G03_x_1_1_binned.i2i G03_x_1_1_results.mhd
  
If both file arguments are the same (e.g., objs2dist.pl file1.out file1.out >file.dist), you can use this
+
see also: /home/lml/krypton/segmentation/MR-Source/ACME/lmltest/README
routine to find the distances between objects within an image (an object match with the same id is automatically
+
  /home/lml/krypton/segmentation/FindingCellMembranesIn3D.pdf
ignored in this case so objects don't match to themselves). See also the option -skipsame.
+
          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
  
(modified from /storage/big1/lml/was_voxel/Corvera/track/objs2bb.pl)
+
 +
</nowiki>
 +
===  Norio_stats.pl ===
 +
<nowiki>
  
usage:
+
This programs takes each pts file in the current directory, thresholds the associated vinculin image,
  objs2alldists.pl file1.out file2.out >file.dist 
+
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).
  
options:
+
stats.pl [options]  > stats.out
   -dx=# : spacing in the x direction ,default = 1
+
   -nothing : do nothing, just echo what would be done
   -dy=# : spacing in the y direction ,default = 1
+
   -h : print this help
   -dz=# : spacing in the z direction ,default = 1
+
   -thresh=#     : threshold for the vinculin image. default = 20
   -size1=min:max : min and max object size allowed for file 1 in pixels (inclusive)
+
   -regions=#:: only allow mask regions within the specified min:max size (in pixels, inclusive).
  -size2=min:max :  min and max object size allowed for file 2 in pixels (inclusive)
+
: Also creates *_count.i2i and *.countobjs (* = root of vinculin image name) intermediate files.
  -iod1=min:max :  min and max object iod allowed for file 1 (inclusive)
+
: note: these counts are for the vinculin image after the mask (pts file) is applied.
  -iod2=min:max :  min and max object iod allowed for file 2 (inclusive)
+
   -clean:      : clean up (ie, remove) *_count.i2i and *.countobjs images (if -regions specified)
  -maxdist=#: :  don't allow matches further away than this distance (after applying dx, dy, dz spacing factors).
 
  default maxdist is ~  3000.
 
  -hist : calculate histogram of distances (hist[int(dist)]++, where int just truncates to integer).
 
  -sizehist :  calculate histogram of object sizes (in voxels) in file1.out. (hist[int(size)]++, where int just
 
  truncates to integer). If you don't care about distances between two files (ie, only want -sizehist)
 
  put the same file name for both files on the command line.
 
  -rpts=file.rpts : put bounding boxes around objects found and lines between closest objects (similar to objs2bb.pl)
 
  display this in dave eg: dave -n 0 -u -I file.i2i file.rpts (use the -n 0 and -u options)
 
  note: may not show up in dave until you click on "scale" to force a rescale (or draw?).
 
  -jack=max.rpts:# :  create an rpts file with the maxima in each object displayed as a small jack.
 
  # controls the size of the jack. 1=1 pixel in size, 2 = 2 pixels, etc.
 
  -strlim=# :  limit length of names of objects in rpts files to # characters.  dave sometimes crashes if the
 
  names are too long.
 
  -tyz : transpose coords in yz before writing them to the rpts (must specify -rpts option)
 
  -skipsame :  don't match an object in file1.out to an object with the same id in file2.out
 
  This is set automatically if file1.out = file2.out.
 
   -silent : don't print the distances (sets -hist)
 
  -simpleprint :  when printing distances, just print distance, one per line, nothing else. to be read in
 
  by ~/Zhuge/grants/AsthmaRO1/distance_distribution.m. note: that program assumes distances
 
  are in pixels and pixels are 80 nm, unless you specify pixelsize=somethingelse.
 
  -simpleprint2 :  like simpleprint, but the first column is id of the Ryr to which this BK is closest.
 
  -onelineprint :  like objs2alldists.pl  but prints the distance to ALL the objects (within -maxdist),
 
  not just the closest on one line, so we can keep track of which BK are near which Ryr.
 
  see comdists3.pl (which uses this option).
 
  -verbose
 
  
example:
+
  countobjs -k -t 2000 2000 wave1.objs wave1.i2i
+
</nowiki>
  countobjs -k -t 2000 2000 wave2.objs wave2.i2i
+
===  run2_Ronghua.pl  ===
  objs2dist.pl wave1.objs wave2.objs > wave1and2.dist
+
<nowiki>
  
see also:
+
this program goes through Ronghua's directory (see -dir option)
   objs2dist121.pl, closest_object, closest_voxel, countobjs, maskobjs, objs_via_ascent, pt_distances
+
analyzing files.  output is put into the current working directory (ie, the directiory
 +
run.pl is run from).
 +
A tag in the name of the form Ryr_thresh_minsize_maxsize_Bk_thresh_minsize_maxsize
 +
is added to the output name  of name.patchdist  (nearest voxel distance between whole
 +
patches) and name.comdist (distances between nearest center of mass of the patches).
 +
 
 +
usage:
 +
   run.pl [options]
 +
 
 +
options:
 +
  -dir=directorypath    : without the final slash. directory to analyze. default = /mnt/big3/rzg/mtc/immunocytochemistry/july05/imcc/70105/epr
 +
  -ryrthresh=# : threshold for ryr (488) images, default =
 +
  -min_ryrsize=# : minimum allowed object size in pixels, default = 5
 +
  -max_ryrsize=# : max allowed object size in pixels, default = 150
 +
  -min_ryriod=# : minimum allowed object iod, default = 354
 +
  -max_ryriod=# : maximum allowed object iod, default = 10000000
 +
 
 +
  -bkthresh=# : threshold for bk (594) images, default =
 +
  -min_bksize=# : minimum allowed object size in pixels, default = 5
 +
  -max_bksize=# : max allowed object size in pixels, default = 50
 +
  -min_bkiod=# : minimum allowed object iod, default = 4686
 +
  -max_bkiod=# : maximum allowed object iod, default = 10000000
 +
 
 +
  -dx=# : relative distance in x, default = 1
 +
  -dy=# : relative distance in y, default = 3
 +
  -dz=# : relative distance in z, default = 1
 +
 
 +
  -noclean
 +
  -debug
 +
  -verbose
  
 
   
 
   
===  objs2dist2.pl  -h  ===
+
</nowiki>
objs2dist2.pl: like objs2dist.pl but when -rpts specified prints out lines to ALL objects  
+
===  countobjs  ===
      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
+
Usage:
      to a Ryr to be activated. see /home/lml/krypton/Zhuge/paper2010/README for 5/20/10.
+
  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.
  
This program takes 2 object outputfiles produced by countobjs (or maskobjs) and finds the shortest distance
+
options:
from the center of mass of objects in file1.out to the center of mass of objects in file2.out.
 
  
If both file arguments are the same (e.g., objs2dist.pl file1.out file1.out >file.dist), you can use this
+
  -produce=newimage.i2i    : take the calculated threshold, apply it to image.i2i to produce newimage.i2i
routine to find the distances between objects within an image (an object match with the same id is automatically
 
ignored in this case so objects don't match to themselves). See also the option -skipsame.
 
  
(modified from /storage/big1/lml/was_voxel/Corvera/track/objs2bb.pl)
+
 +
</nowiki>
 +
===  thresholdz.pl  ===
 +
<nowiki>
 +
thresholdz.pl -numvox=#  [-produce=newimage.i2i] image.i2i
  
usage:
+
calculate the largest threshold for image.i2i which has at least # voxels
  objs2dist2.pl file1.out file2.out >file.dist 
+
equal or above it. Prints the threshold and the number above threshold to stdout.
  
 
options:
 
options:
  -dx=# :  spacing in the x direction ,default = 1
 
  -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 file 1 in pixels (inclusive)
 
  -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)
 
  -iod2=min:max :  min and max object iod allowed for file 2 (inclusive)
 
  -maxdist=#: :  don't allow matches further away than this distance (after applying dx, dy, dz spacing factors).
 
  default maxdist is 20.
 
  -hist :  calculate histogram of distances (hist[int(dist)]++, where int just truncates to integer).
 
  -sizehist :  calculate histogram of object sizes (in voxels) in file1.out. (hist[int(size)]++, where int just
 
  truncates to integer). If you don't care about distances between two files (ie, only want -sizehist)
 
  put the same file name for both files on the command line.
 
  -rpts=file.rpts :  put bounding boxes around objects found and lines from objects in file1.out to all objects
 
  in file2.out that are <= maxdist away (these lines will become an object named "near_to_file1.out").
 
  display this in dave eg:  dave -n 0 -u -I file.i2i file.rpts (use the -n 0 and -u options)
 
  note: may not show up in dave until you click on "scale" to force a rescale (or draw?).
 
  -jack=max.rpts:# :  create an rpts file with the maxima in each object displayed as a small jack.
 
  # controls the size of the jack. 1=1 pixel in size, 2 = 2 pixels, etc.
 
  -strlim=# :  limit length of names of objects in rpts files to # characters.  dave sometimes crashes if the
 
  names are too long.
 
  -tyz :  transpose coords in yz before writing them to the rpts (must specify -rpts option)
 
  -skipsame :  don't match an object in file1.out to an object with the same id in file2.out
 
  This is set automatically if file1.out = file2.out.
 
  -silent :  don't print the shortest distances (sets -hist)
 
  -verbose
 
  
example:
+
   -produce=newimage.i2i    : take the calculated threshold, apply it to image.i2i to produce newimage.i2i
   countobjs -k -t 2000 2000 wave1.objs wave1.i2i
+
 
  countobjs -k -t 2000 2000 wave2.objs wave2.i2i
+
  objs2dist2.pl wave1.objs wave2.objs > wave1and2.dist
+
</nowiki>
 +
===  2Ddistances  ===
 +
<nowiki>
 +
 
 +
Calculates a histogram of the amount of light as a function of distance from boundary (0 valued) voxels as specified in the mask.
 +
Applies a 2D mask to a 2D time series.
 +
 
 +
Usage:
 +
2Dhistogram [options] inimage.i2i inmask.i2i
 +
Options:
 +
  -v: verbose
  
see also:
+
Source code in ~krypton/lml/facil 
   objs2dist121.pl, objs2dist.pl, closest_object, closest_voxel, countobjs, maskobjs, objs_via_ascent, pt_distances
+
  -d dimage.i2i : save the distance image as dimage.i2i (converted to ints by casting)
 +
  -n: don't normalize the histogram by the number of voxels in the mask at that distance
 +
   -a #:  average together this many time pts for output histogram. default = 20
 +
see also: histogramL, histogram2
  
 +
Copyright 2010 University of Massachusetts Medical School and the Biomedical Imaging Group
 +
All rights reserved. Explicit permission to use this program must be received prior to use.
 
   
 
   
===  objs2mst.pl  -h ===
+
</nowiki>
 +
===  analyze_histo ===
 +
<nowiki>
 +
# /home/lml/krypton/bin/analyze_histo
  
This program takes an object outputfiles (unless -rptsin) produced by countobjs (or maskobjs) and finds the minimal
+
Analyzes the output histogram image produced by histogram2 via the -f option.
spanning tree connecting the center of mass of the objects. Writes out connections as an rpts file to stdout.
+
Prints out 2 columns: first column is bin number, second column is value at the cutoff.
Options can be used to only selected a subset of the objects and to constrain max distance (so multiple
+
This is similar to the program "threshold" but instead of one threshold value for the
trees can be produced).
+
entire image, it gives one at each distance (from a membrane).
  
usage:
+
Usage: analyze_histo [options] aimage_H.i2i
  objs2mst.pl file1.objs  > file1_mst.rpts
+
options:
 +
-v: calculate cutoff based on percentage of voxels instead of percentage of light
 +
-f #: fractional cutoff (e.g., .80 = 80%), default = 0.950000
 +
-w #: number of bins for running average (default = 5), should be odd.
 +
-t #: only look at voxels >= intensity (must be >= 0), default = 1
 +
 
 +
Examples:
 +
histogram2 -f a_H.i2i -O a_H.histo -o -p 0 0 0 -d 40 -z 3 mask.i2i a.i2i b.i2i
 +
analyze_histo -f .95 a_H.i2i > a_H.cutoffs
 +
 
 +
See also: histogram, histogram2, threshold
  
options:
+
source code in /storage/big1/lml/jac/was_invitro/Projects/boundary/boundary
  -dx=# :  spacing in the x direction, default = 1
+
   
  -dy=# : spacing in the y direction, default = 1
+
</nowiki>
  -dz=# :  spacing in the z direction, default = 1
+
===  analyze_yaodl ===
  -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)
 
  -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:
+
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).
  objs2mst.pl wave1.objs > wave1mst.rpts
+
It identifies connected surfaces (since DAVE considers all surfaces from one pass as one object).
  dave -I wave1.i2i -n 0 -u wave1mst.rpts
+
It then calculates and prints the volume and surface area of each connected surfaceOptionally
 +
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
  objs2bb.pl, objs2dist.pl, objs2dist121.pl, closest_object, closest_voxel, countobjs, maskobjs, objs_via_ascent
+
options:
  resolve_pts
+
  -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.
 
   
 
   
===  objs_within_dist.pl  -h ===
+
</nowiki>
 +
===  BestPath ===
 +
<nowiki>
  
This program takes 2 object outputfiles produced by countobjs (or maskobjs) and finds the number of objects
+
Finds the brightest path from a start pixel to a stop pixel (1-indexed).
in the second file which are within a given distance of each object in the first file. A histogram is
+
 
printed out.
+
Usage:
Distances are from the center of mass of objects in file1.out to the center of mass of objects in file2.out.
+
BestPath [options] image.i2i
(modified from objs2dist.pl)
+
Options:
 +
-t #: threshold. Only pixels with values > # are allowed in the path, default = 0.000000
 +
-s x y z: start coordinate (1-indexed). default = (1,1,1)
 +
-S x y z: stop coordinate (1-indexed). default = (1,1,1)
 +
-v: verbose
  
usage:
+
Source code in ~krypton/lml/facil 
  objs_within_dist.pl file1.out file2.out >file.dist  
+
 +
</nowiki>
 +
===  BestPath3D  ===
 +
  <nowiki>
  
options:
+
Finds the brightest path from a start pixel to a stop pixel (1-indexed).
  -dx=# :  spacing in the x direction ,default = 1
+
Converts voxels into nodes in a graph and finds the lowest cost path from the start node to the stop node.
  -dy=# :  spacing in the y direction ,default = 1
+
The cost of each node is (maxval-imval), so bright nodes have less cost. Output in rpts format to stdout.
  -dz=# : spacing in the z direction ,default = 1
+
BestPath3D always turns all (above threshold) voxels in the image into graph nodes. BestPath3D_ellipse only
  -size1=min:max :  min and max object size allowed for file 1 in pixels (inclusive)
+
looks at voxels within an ellipse with a major axis connecting the start and endpts.
  -size2=min:max min and max object size allowed for file 2 in pixels (inclusive)
+
Usage:
  -iod1=min:max :  min and max object iod allowed for file 1 (inclusive)
+
BestPath3D [options] image.i2i > image.rpts
  -iod2=min:max :  min and max object iod allowed for file 2 (inclusive)
+
BestPath3D_ellipse [options] image.i2i > image.rpts
  -maxdist=#: don't allow matches further away than this distance (after applying dx, dy, dz spacing factors).
+
Options:
  default maxdist is ~  3000.
+
-t #: threshold. Only pixels with values > # are allowed in the path, default = 0.000000
  -rpts : read in file in rpts format
+
-s x y z: start coordinate (1-indexed).
  -verbose :  extra info written to stderr
+
-S x y z: stop coordinate (1-indexed).
  -vverbose : print other info. can be combined with -verbose.
+
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 perpfacOnly 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.
  
example:
+
Examples:
  countobjs -k -t 2000 2000 wave1.objs wave1.i2i
+
make_spiralim -d 200 200 30 -r 70 -p spiral_small.i2i # create a test image
  countobjs -k -t 2000 2000 wave2.objs wave2.i2i
+
                -s 171 101 1  -S 170 99 30            # written out by make_spiralim
  objs_within_dist.pl wave1.objs wave2.objs > wave1and2.dist
+
BestPath3D_ellipse -v -t -1 -s 171 101 1 -S 170 99 30 -f 3 13 spiral_small.i2i > spiral.rpts
 +
note: spiral_small.i2i is a tough case, since the spiral goes very far from the start/stop points
 +
This requires a -f 3 to expand out the endpts and then a 13 to expand out perpendicularly.
 +
If you just expand out perpendicularly (e.g. -f 1 13) the ellipsoid doesn't grow faster enough
 +
near the endpts so some of the spiral data is not included in the ellipsoid. See -D option.
  
see also:
+
See also: make_spiralim, BestPath, BestPath2, make_ellipsoid, DAVE -> Stuff -> Best Path ...
  objs2dist121.pl, closest_object, closest_voxel, countobjs, maskobjs, objs_via_ascent, pt_distances
 
  
 +
Source code in ~krypton/lml/facil 
 
   
 
   
===  connected_random_pts  -h ===
+
</nowiki>
Generates random pts in a planar region, calculates how many connected components are created
+
===  BestPath3D_ellipse ===
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).
 +
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:
 
Usage:
connected_random_pts [options]
+
BestPath3D [options] image.i2i > image.rpts
 +
BestPath3D_ellipse [options] image.i2i > image.rpts
 
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).  
-r #: radius (in pixels), default = 5.0
+
-S x y z: stop coordinate (1-indexed).
-s #: long int starting seed for random number generator. default = process id.
+
Up to 1000  pairs of start/stop pixels can be specified. At least one pair must be specified.
-n #: number of pts to create, default = 1000
+
-r scale black  rescale image values so new = (old-black)/scale prior to being used
  -h: help
+
-n name name of object that is placed into the rpts file.
  -v: verbose
+
-f exfac perpfac:  Only used if you are running BestPath3D_ellipse
 +
        sets principal axis a to have the specified endpts (from -s and -S), then expands it by factor exfac,
 +
                        and sets the length of the perpendicular b and c axes to be perpfac times the original axis a length
 +
defaults: exfac = 1.000000, perpfac = 1.000000
 +
-v: verbose
 +
-d: debug
 +
-D debug.i2i: debug. also write out image with 50 added to all voxels within the ellipsoid.
 +
 
 +
Examples:
 +
make_spiralim -d 200 200 30 -r 70 -p spiral_small.i2i  # create a test image
 +
                -s 171 101 1  -S 170 99 30            # written out by make_spiralim
 +
BestPath3D_ellipse -v -t -1 -s 171 101 1 -S 170 99 30 -f 3 13 spiral_small.i2i > spiral.rpts
 +
note: spiral_small.i2i is a tough case, since the spiral goes very far from the start/stop points
 +
This requires a -f 3 to expand out the endpts and then a 13 to expand out perpendicularly.
 +
If you just expand out perpendicularly (e.g. -f 1 13) the ellipsoid doesn't grow faster enough
 +
near the endpts so some of the spiral data is not included in the ellipsoid. See -D option.
  
See also:
+
See also: make_spiralim, BestPath, BestPath2, make_ellipsoid, DAVE -> Stuff -> Best Path ...
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  -h ===
+
===  boundaryL ===
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
+
  Usage:
neighboring quadrants. When done, each quadrant must have one (or two) points specified.
+
  boundary [options] original.i2i
Points must be in pair order (see recalc_quadrant2.pl).  When done, the use must write them out
 
via z (when middle mouse is also pressed, no confimation is given in play). 
 
The quadrant images are then aligned based on these points and newimage.i2i is created.
 
  
It will also create a file with the output from play, for future reference.
+
Description:
It will be named, eg, G02_combined_play.pts. It can be passed manually to recalc_quadrant2.pl to redo
+
  Boundary takes an image, applys a threshold to the image,  
the alignment if necessary.
+
  rolls a ball outside then inside the object. This defines
 +
  what pixels are considered inside, outside, and boundary.
  
usage:
+
  Expects: Input image and optionally some given options
  align_quadrants.pl [options] well newimage.i2i
+
  Modifies: Nothing
 +
  Returns:  Output image with the name of image with _B added.
 +
            (if input.i2i was original image input_B.i2i
 +
            is output image)
  
 +
Options:
 +
-I        : Do not roll ball inside of the cell.
 +
              (rolling the ball inside the cell results
 +
              in a smoother surface)
 +
-r #      : Set radius to # for sphere exterior to cell.
 +
              (default = 3)
 +
-R #      : Set radius to # for sphere interior to cell.
 +
              (default = 3)
 +
-t #      : Set threshold for all z slices to > #.
 +
              (default is 10)
 +
-T filename: Use file filename for thresholds for each z slice.
 +
              (one threshold for each zslice - one threshold on a line)
 +
-X        : Restrict search in X direction.
 +
              (can be used to cap a cylinder whose long axis
 +
              is along the x axis)
 +
-Y        : Restrict search in Y direction.
 +
              (can be used to cap a cylinder whose long axis
 +
              is along the y axis)
 +
-i string  : Add string to history of output image.
 +
-h        : Print this message.
 +
-H        : Print this message and then some.
  
examples:
+
Caveats:
  align_quadrants.pl [options] G02 G02_combined.i2i
+
  Requires lots of memory and time to run (megabytes+minutes).
  
options:
+
Notes:  
-no_pts_output don't produce the pts file
+
  Entire image name (with extension) is required.
-noblend by default the quadrant images are blended together where
+
  Pixel values: boundary = 2, outside = 4, inside = 6.
they overlap.  use this option to turn that off.
+
  Output image is padded on all sides by 2*radius+1 of
-print_overlap also print the amount of overlap to stderr
+
  sphere rolled on the outside of the object.
-debug
 
-debug_all
 
  
 +
Keywords:
 +
  surface location, boundary, boundaries, border
  
see also:
+
Additional programs:
combine_images
+
  histogram, shrink_wrap, createBoundary, analysis
recalc_quadrant2.pl
 
/home/lml/krypton/Corvera/Raz/README 5/16/14
 
http://wiki.imagej.net/Grid/Collection_Stitching_Plugin
 
  
 +
Last Changed: Wed Feb 10, 1993
  
 
===  combine_images.pl  -h  ===
 
  
This program runs combine_images on all the images in the current directory. All images which have names
+
</nowiki>
like L##_morestuff.i2i (where L is any letter and # is any digit) will be combined;
+
=== calc_area  ===
all the A02 will be combined (to produce A02_comb.i2i), all the A03, etc.
+
  <nowiki>
The resulting image for the combination of the A02 images will be A02_tag.i2i (see -newtag option, e.g. A02_comb.i2i).
 
Any images already existing in the current directory with a name like L##_stuff_oldtag.i2i will be ignored.  
 
  
usage:
+
This program takes in a surface image and a data image and calculates:
combine_images.pl [options]
+
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.
  
options:
+
Typically one might apply a shrink_wrap to, say, a Vinculin image of a dual
-newtag=something The output filename for L##*.i2i will be L##_newtag.i2iDefault = comb
+
labelled image pairThen make_surface would convert this to a surface.  
-oldtag=something Any files of the form L##*_oldtag.i2i will be ignored. Default = comb
+
After this, map_to_surface would be applied to the 2 dual labelled images.
-pixsize=# pass this as -p # to combine_images program (pixel size).
+
Then overlap would be used to calculate the overlap of the two data sets
Specify -pixsize=2.41 (um/pixel) for the 2.5X objective.
+
(given some overlap range, which defaults to 1).
-reduceima=#:#:tag After creating output image, apply reduceima to it 
+
Then this program (calc_area) is used to get the area of the surface and the
with -bin # # and the specified output tag on the name.
+
amount of it which is examined using the range specified to the overlap program.
So, e.g., A02_comb.i2i will become A02_tag.i2i
+
This is important since to calculate the probability that the overlap was
-flipx flip images in X prior to combining them
+
due to chance you want to know what percentage of the area was included in
-flipy flip images in Y prior to combining them (can be used at the same time as -flipx)
+
the overlap calculation.
-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:
+
Usage: calc_area [options] surface.i2i data.i2i
combine_images (in /storage/big1/lml/Linux/bin) and reduceima (in /storage/big1/kef/Linuxbin) must be in your
+
options:
path for this perl script to work. You can check this by just typing: which combine_images  and  which reduceima;
+
  -r range: range in voxels (default = 1).
if they are not found you need to add their directory to your PATH environment variable (echo $PATH will show you
+
  -i image.i2i: also produce an output image
what it is currently). How this is done varies depending upon which shell you are running. Under tcsh it would
+
  this image will have bit 2 set for original data voxels
be   setenv PATH $PATH:/storage/big1/kef/Linuxbin:/storage/big1/lml/Linux/bin .
+
  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).
  
example:
+
note: entire image name (with extension) is NOT required.
      cd /storage/big3/kdb/Zeiss/20130326/GEDMAT_002_PRO_SQ2_DAY14
+
note: a - in place of an image name means stdin or stdout.
# Combine all images in each well. The combined image will be L##_combined (-newtag=combined).
+
note: a compressed image will be automatically be uncompressed.
# 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:
+
Source code in /storage/big1/lml/was_invitro/Moore/pkc
combine_images
+
/storage/big1/raz/GEDMAT
+
</nowiki>
mask_gedmat_images.pl
+
===  closest_object  ===
 +
<nowiki>
 +
 
 +
Calculates the closest distance from an object in image1 to an object in image2.  Also calculates closest distance
 +
between objects within each image separately.  Prints out info about matches.  If no other object is within the
 +
maximum distance (see -m option), the object is printed matching to object -1 at a huge distance.
 +
Histogram of these distances is printed to stdout.
 +
The input images should have each pixel in an object having the object id as its value. These images can be
 +
produced with "countobjs -Q" or "objs_via_ascent" 
 +
 
 +
Usage:
 +
closest_object [options] image1.i2i image2.i2i > im1_im2.hist
 +
Options:
 +
-t # #: image1 and image2 thresholds, pixels > # are above threshold, default = 0.
 +
-w # # #: x,y, zweights for pixel distances (ie, pixel size), default = 1 for each.
 +
-m # :         maxdistance (in units used for -w) to look for the closest pixel, default = 10.000000
 +
-r #:         resolution for output histogram, ie, binsize, default = 0.100000
 +
-e lowx lowy lowz hix hiy hiz:  only look at voxels within this extent (subvolume), 1-indexed, inclusive.
 +
-s minsize maxsize:    only look at objects in image1.i2i within the size range (inclusive, in voxels)
 +
-S minsize maxsize:    only look at objects in image2.i2i within the size range (inclusive, in voxels)
 +
-i miniod maxiod:    only look at objects in image1.i2i within the iod range (inclusive)
 +
-I miniod maxiod:    only look at objects in image2.i2i within the iod range (inclusive)
 +
-d image1d.i2i: the original intensity image for image1 (since image1 has pixel values as id numbers)
 +
-D image2d.i2i: the original intensity image for image2 (since image2 has pixel values as id numbers)
 +
if you want the iod or pixel intensity stats to be meaningful, you need to provide
 +
the original data by using the -d and -D options.
 +
  -v: verbose
 +
  -V: very verbose
 +
Examples:
 +
    Find the distance from the closest Ryr voxel in each object to a BK object. Record the iod
 +
    of the BK object in the histogram:
 +
countobjs -t 5 10 -Q ryr_id.i2i ryr.countobjs ryr.i2i      : this finds Ryr connected objects and labels them with id
 +
countobjs -t 10 10 -O bk_iodR.i2i bk.countobjs bk.i2i     : this calculates the iod of BK objects
 +
float2intL -M 30000 bk_iodR.i2i bk_iod.i2i     : rescale BK iod to integer format
 +
closest_object -w 1 1 3 -o 5 100  ryr_id.i2i bk_iod.i2i > ryr_bk.info
 +
cull -s -c -1 -4 < ryr_bk.info |xmgrace -source stdin
 +
        note: you may want to take a 10 pt running avg inside xmgrace to compensate for
 +
issues related to discretization of distances
 +
See also:
 +
closest_voxel objs_via_ascent /home/lml/krypton/Zhuge/BKandRyr/graph.pl,match.pl  
 +
Bugs:
  
 +
Source code in ~krypton/lml/facil 
 
   
 
   
===  overlap_images.pl  -h ===
+
</nowiki>
 +
===  closest_voxel ===
 +
<nowiki>
  
Takes output from parsepos.pl  and calculates how the images overlap so they can then be combined easily (-create option).
+
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.
  
  overlap_images.pl [options]
+
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  
-xdim=# xdim of image in pixels, default = 1392
+
-ydim=# ydim of image in pixels, default = 1040
+
</nowiki>
-zdim=# zdim of image in pixels, default = 25
+
=== coloc  ===
-pixsize=# size of pixels in um, default = 0.645
+
<nowiki>
-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:
+
  This program reads in 2 or 3 images, and writes out an image in which
parsepos.pl
+
colocalized voxels (voxels > threshold in all images) are kept, others
insert_image called by this program if -create is specified.
+
set to 0.  By default colocalized voxels are set to image1 values.
reduceima if -create is used, this may be needed to make the image small enough to see via play.
+
Usage: coloc [options] image1 image2 [image3] outimage
+
options:
example:
+
-a #:         threshold for image 1 (default = 0)
         parsepos.pl -pre=/storage/big3/kdb/Zeiss/20121004/LectinExp3/ -post=_1_1_20121004_LectinExp3.i2i  \
+
-b #:        threshold for image 2 (default = 0)
                /storage/big3/kdb/Zeiss/20121004/LectinExp3/LextinExp3.pos | overlap_images.pl -create=newimage.i2i
+
-c #:        threshold for image 3 (default = 0)
reduceima -A -bin 4 4 newimage.i2i newimage_reduced.i2i
+
-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
  
  note: you may need /storage/big1/lml/Linux/bin and /storage/big1/kef/Linux/bin in your path
+
</nowiki>
 +
===  coloc3ims  ===
 +
  <nowiki>
  
source code in /storage/big1/lml/Corvera/Olga/data/ptrs
 
see also: insert_image
 
  http://bigwww.epfl.ch/algorithms.html -> MosaicJ (which may already exist in Fiji)
 
  
+
This programs reads in three images and produces a new version of image3.  
===  parsepos.pl  -h  ===
+
Each voxel which is colocalized (has image1 > thresh1
Parse a position file produced by Zeiss system to pull out x y coords for each of the images taken in well C09.
+
and image2 > thresh2) has the value in image3 set to 32000 (-n 32000). Otherwise the value in image3 is not
Output triples (well_id x y) written to stdout.
+
changed. Once these modifications are made, image1.i2i image2.i2i and newimage3.i2i can be read
  Position may be in microns, x increasing to the right, y increasing down.
+
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.
  
parsepos.pl filename.pos
+
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
  
options:
+
note: entire image name (with extension) is NOT required.
-well=string well to analyze. default = C09
+
note: a - in place of an image name means stdin or stdout.
-pre=prestring add this string in front of the well_id
+
note: a compressed image will be automatically be uncompressed.
-post=postring add this string after the well_id
+
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
+
===  coloc_tseries2  ===
to find the image associated with each well_id.
+
<nowiki>
-verbose additional output to stderr
 
-vverbose additional output to stderr
 
  
example:
+
Similar to coloc_tseries, but compares a 2D time series to itself.
parsepos.pl -pre=/storage/big3/kdb/Zeiss/20121004/LectinExp3/ -post=_1_1_20121004_LectinExp3.i2i  \
+
Prints xmgr formatted graphs to stdout.
/storage/big3/kdb/Zeiss/20121004/LectinExp3/LextinExp3.pos | overlap_images.pl -create=newimage.i2i
 
 
  
 +
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
  
see also:
+
source code in:  /home/lml/krypton/facil
overlap_images.pl
 
insert_image
 
 
 
  note: you may need /storage/big1/lml/Linux/bin and /storage/big1/kef/Linux/bin in your path.
 
  
 +
see also: /home/lml/krypton/Corvera/paper2010/Dynamics_in_Dave/README
 
   
 
   
===  prep_and_restore.pl  -h ===
+
</nowiki>
 +
===  com_2d_objs ===
 +
<nowiki>
  
Restores all the i2i files in the current directory. Skips any files with   _.i2i or _r.i2i in their name.
+
This program takes an image and finds the intensity weighted center of mass of each 2d object.
Also ignores any files which do not have dat or ctx in their name.
+
Object 1 is all pixels with value = 1, object 2 is pixels with value 2, etc. Max objects = 10
 +
Statistics are written to stdout
  
options:
+
Usage: com_2d_objs [options] image.i2i
-dummy just print what would be done
+
options:
-bkgnd=# pass this through to find_bkgnd as the -a option. eg, -bkgnd=-.10 will lower the bkgnd value
+
  -z start stop: zplanes to analyze. 0-indexed inclusive. default is all z planes
which is subtracted off by 10 percent.
+
  -r #: put data out rpts format (integer coords, only center of mass info). Only use if only one object.
        -smooth=#      smoothness factor (smaller is less smoothing). default = .00002
+
# is the pixel value (!= 0), usually -1 through -7.
        -iterations=#  maximum number of iterations, default = 999
+
  -o: coords should be one-indexed (ie, min x = 1). default = 0. -r sets this automatically.
        -scale=#:#      GFP and RFP output scaling for restoration (respectively). default = 1.0 and 1.0.
+
  -v: verbose
-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
 
  
 +
Source in /home/lml/krypton/facil
 +
See Also: /home/lml/krypton/Lawson/Jacques/README
  
  examples:
+
Examples:
cd /storage/big3/kdb/Zeiss/20121004/LectinExp3
+
  planimeter3.20081007 -I 110215ligand_0_491.i2i -R 110215ligand_0_491_cell1.rpts
        /home/lml/krypton/Corvera/Olga/prep_and_restore.pl -files=G11_0_1_1_20121004_LectinExp3.i2i:G03_0_1_2_20121004_LectinExp3.i2i  
+
  interp -S -p -1 -o cell1 110215ligand_0_491_cell1.rpts 110215ligand_0_491_cell1_interpS.rpts
      -beowulf -outdir=/storage/big1/lml/Corvera/Olga/data
+
  create_dcimL -d 1 -s 502 501 1440 one.i2i
 +
  addlines one.i2i 110215ligand_0_491_cell1_interpS.rpts - | maskedsmul -O 0 one.i2i - cell1_binary.i2i
 +
    # could do the same for a second object (etc), with create_dcimL -d 2, then use mathi2i
 +
    # to add the images before analysis
 +
  com_2d_objs cell1_binary.i2i > cell1_binary.stats
 +
 +
</nowiki>
 +
===  exo4  ===
 +
<nowiki>
 +
Phase 1: Associates each voxel in inimage.i2i which is > threshold with a maxima in the image.  It finds
 +
        the maxima by doing a steepest ascent walk in the image.  Writes summary info about regions found to
 +
        stdout in the same format as countobjs.  Only the location of the maxima found in phase 1 are passed to phase 2.
 +
        All vesicles must start out as maxima. (see also -readmax option)
 +
Phase 2: In each rolling window of time points (see -w), examines the intensity over time of each maxima
 +
        (found in previous step) to see if it
 +
        meets certain criteria (i.e., looks like a vesicle fusing with the plasma membrane - undergoing
 +
        exocytosis).  If it matches this criteria it prints out the "path" of the maxima and its
 +
        pixel value and iod value.  These paths can be converted to rpts format for
 +
        addlines or xmgr format
 +
        using found4.pl. 
 +
The fusion model: think of intensity as shown below. once the vesicle primes its intensity jumps. when it fuses
 +
it drops back down.
  
  see also:
+
peak intensity profile:
epr_beowulf    a GUI front end for submitting individual restoration jobs to the beowulf queue
+
  pintens                  ----------------
/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
+
                        |                    |
 +
  tintens -------------                      ------------------
  
   note: /storage/big1/lml/Linux/bin /storage/big1/lml/Linux/bin64 and /storage/big1/kef/Linux/bin probably need to be in your
+
          0   t1      t2                  t3
path to successfully run this script.
+
          0  t1      |prise|              |ffall|
  
 +
t1: time of tethering (should stop moving)
 +
t2: time of priming (peak intensity increases from tintens to pintens)
 +
t3: time of fusing (peak intensity drops back down, but iod should stay high and possibly even increase a bit)
 +
prise is the time it takes to rise froom tintens to pintens during priming (docking)
 +
ffall is the time it takes to fall from pintens to tintens during fusion.
 
   
 
   
=== prepfiles.pl -h ===
+
exo4 is similar to exo3 but has slightly different options and checks all possible fusion times
prepfiles.pl [options]  
+
simultaneously. exo3 only picked the latest (in time) possible fusion event based only upon intensity
 +
  changes during the falltime. exo4 considers what is happening elsewhen in the window before deciding
 +
  on a fusion time. It picks the fusion candidate (iod rise and intensity fall) which is closest in time to
 +
the maxima disappearing (-check_max) and which has a stationary period (-primedtime) within the
 +
specified time range. Hopefully this makes it less likely to make mistakes.
 +
 
 +
Should work in 2d or 3d.  Only reads in a window of time points at once
 +
so should be able to handle large images.
 +
 
 +
Usage:
 +
  exo4 [options] inimage.i2i > inimage.count
 +
 
 +
Options:
 +
 
 +
options related to input:
 +
  -T startt stopt : only examine these time points (0-indexed, inclusive)
 +
  -p numskip numuse : patterned read.  skip numskip z planes, then analyze numuse zplanes, then repeat.
 +
  This is useful if the acquisition protocol was, e.g., 1 fps for 1 min, 20 fps for 3 seconds
 +
  repeated over and over, and you only want to look at the 20 fps data.
 +
  numuse must be >= window size (see -w option). Pattern starts at t=0 even if -T is
 +
  specified (but startt time points are still skipped).
 +
  -w #         : number of time pts in a window, default = 100
 +
                        a negative number means read in entire dataset at once (one big window)
 +
  -jump # : jump # time pts before examining next window of time pts. This doesn't skip data, just
 +
  analyzes a "window" less often (so more has changed). Default = 0
 +
                        which means the very next time pt is added to window (and oldest dropped) and then
 +
                        the window of data is re-evaluated. May not work with -p option.
 +
  -r rptsfile : read in 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.
 +
 
 +
Each maxima (-readmax) gets a size and iod associated with it. Only pixels > threshold (-t)
 +
within the iod region (-iodsize) count toward the iod and size.  Once the maximum disappears
 +
(-nomax_length) the region centered around the previous location of the maximum is used.
 +
Maxima are tracked from one time pt to the next by finding the closest maxima (within -maxspeed)
 +
to its previous location. Tracks continue after the maximum disappears for -nomax_length time pts.
 +
 
 +
At the end of this time, the path is then analyzed to see if it meets criteria for a fusing vesicle.
 +
All time pts during which the maxima exists must have an iod within the correct range (-i) and
 +
and correct size (-s). The fusion time is identified by the intensity of the maxima falling
 +
fast enough and far enough (-fall); while within the same interval the iod rises enough (-iodrise).
 +
Fusion time is then further refined to be the time of largest iod increase (between adjacent time pts)
 +
within this interval.
 +
 
 +
A fusion event may also need to be the correct time interval from when the maxima disappears (-check_max).
 +
It may also need to be significantly brighter than the background (-minpeakratio).
 +
It may be required to have a minimum peak value during fusion (-minpeakval).
 +
 
 +
Once the fusion time is found, the program finds the stationary (-diststill) time interval prior to fusion.
 +
This (priming) time interval must be within certain constraints (-primedtime) for the path to be considered
 +
representing a valid fusion event.
 +
 +
exo6 is similar to exo4 but reads in one time point at a time, there is no concept of a "window"
 +
It only works on a 2D time series
 +
 
 +
Usage:
 +
  exo6 [options] -readmax max.rpts inimage.i2i  > inimage.count
  
example:
+
Options:
  
# combine the 4 well images without overlap to see what pts might match between quadrants:
+
options related to input:
    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    
+
  -T startt stopt : only examine these time points (0-indexed, inclusive)
          F06_2_2_0_20140505_GEDMAT_P025_WES_OM_Day14.i2i F06_3_2_0_20140505_GEDMAT_P025_WES_OM_Day14.i2i tmp.i2i
+
  -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)
  
# look at the resulting image and identify matching pts:
+
options related to finding fusion events:
    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:
+
  -t threshold : any voxel > threshold in inimage.i2i is tracked to a 3d maxima (default = 0.0).
marked points
+
  -i miniod maxiod : erase all objects whose iod doesn't fall in the specified range (default: 1-1000000000)
x= 769 y= 497 z=   1 set=   1 value=     3099
+
  -s minsize maxsize : erase all objects whose size (in voxels, inclusive) doesn't fall in the specified range
x= 799 y= 525 z=   1 set=   1 value=    3684
+
  (default = 1-1000000). note: object size and iod might be large since all voxels which  
x= 709 y= 819 z=   1 set=   1 value=     4039
+
  connect up via steepest ascent algorithm to the maximum count in this first phase.
x= 682 y= 854 z=   1 set=   1 value=     3974
+
  -iodsize #           check iod within +/- range pixels., default = 3
x= 518 y= 497 z=   1 set=  1 value=     3257
+
  -maxspeed #   max distance a maxima can move (in pixels) between time points, default = 5
x= 543 y= 524 z1 set=  1 value=    3436
+
  -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.
  
# now use this program to multiply by 2, subtract xdim (1392) and/or ydim (1040) as appropriate, pair and order pts.
+
options related to speed:
    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
+
  -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:
=== register_images.pl  -h  ===
+
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
  
Takes a bunch of images taken in one well on the microscope, translates them
+
See also: pt_distances, max2d, max3dL, maxima, maxL, maxzL, float2intL, int2float, playexact
based on ChainedTrans.txt and combines them into one big image.
+
            track, max2d_simple, countobjs
  
ChainedTrans.txt should be a partially ordered file with entries like
+
Example:
X02:X03    (685,282):(736,287)
+
        # find all objects between 5 and 30 pixels, minimum iod of 200, above a threshold of 100, write out new image:
This means that location (685,282) in file X02 is the same as location (736,287) in file X03.
+
    find_2d_objs -t 100 -s 5 30 -b 200 1e9 -n newimage.i2i image.i2i > image.objs 
By partially ordered I mean that for file1:file2  file1 should already have been the
 
right hand side of a similar line previously (so its position is already defined relative to
 
the file on the left hand side), unless it is the very first line in
 
the file. So every right hand side is relative to a left hand side which has already
 
had its position defined.
 
Output goes to new_trans.i2i
 
  
register_images.pl [options] ChainedTrans.txt
+
Source code in ~krypton/lml/facil 
-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
+
</nowiki>
X01_0_0_1.i2i, -post=_0_0_1.i2i (this is also the default for post if not specified).
+
===  find_blobs  ===
-xdim=# size of original each original image (before recaling by maxtrima, see example below). default = 1392.
+
  <nowiki>
-ydim=# default = 1040
+
/home/lml/krypton/bin/find_blobs
-zdim=# default = 21
+
insufficient number of arguments
-xscale=# binning done by matrixima (see example), coords will be scaled by this. default = 4.
+
This program pads an image in z, then calls "invariant" (with -F 10) to produce multiple resolutions
-yscale=#
+
of the original image along with its 2nd derivative in the gradient direction.
-blend when combining images, blend the values where they overlap (default is to just replace any previous
+
The blurred originals are used to find the location of the maxima. The derivative images should
value with the new value).
+
have a zero crossing at the inflection points (eg, "edges"). The maxima should be in regions with
    -dummy
+
negative second derivative. This program then calls flood2zero to find the spatial extent of each
-debug
+
"blob" (bright region surrounding the maxima). Ideally this should just be a flood fill until
-h
+
the zero crossing is found, but noise, etc. means that a lower threshold works better.
  
 +
USAGE: find_blobs [options] inputimage.i2i outputroot
  
-shift no circular shift (see tranima). old.  
+
output extensions of files produced (in same directory as inputimage.i2i):
note: tranima will pad images with -32768 which play will show in red (I think) and DAVE will be bothered by.
+
      .ppts          padded points coords (location of maxima in blurred, but not deriv, image).  
 +
      .pts            unpadded points, with z value transformed back to unpadded coordinates
 +
      .bpts          unpadded points after filtering to keep bright points (\>= min_intensity)
 +
      .dpts          bpts with "unordered" -> "ordered" and "break" -> "#moveto", for display in DAVE
 +
      _bres#.i2i      blurred, but no derivatives, at resolution level = # (bigger # = lower res.)  
 +
      _dres#.i2i      blurred & derivatives taken, at resolution level = #
 +
      _dres#_obj.i2i  objects found in *_dres#.i2i by floodfilling from points in *.bpts
 +
      _dres#.obj      statistics on *_dres#_obj.i2i
 +
      _flood.out      output from flood2zero
 +
      .out            output from invariant
  
example:
 
matrixima -row 4 W X Y Z -col 3 01 02 03 -pos 0 -obj 0 -fil 1 new.i2i
 
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/
+
options:
see also:
+
    -m #:   any maxima less than this will get filtered out, default = 1
combine use this on newer images which have spatial information stored in their header
+
    -d #:   any derivative voxel with a value >= # will stop the flood fill
parsepos.pl
+
                  this is in the original, floating point coord system (prior to 
~/krypton/Corvera/Olga
+
                  rescaling to write out deriv. image). default = -5
/storage/big1/lml/Corvera/Olga
+
    -p #:   pad data in z so that we don't have wrap around problems, default = 10
recalc_quadrant.pl
+
    -z #:   number of z planes (in original image) to skip in front and back when
recalc_quadrant2.pl
+
                finding blob voxels - the derivative calculation tends to create negatives
align_quadrants.pl the simplest manual method of aligning the four images in the well
+
                  in the first and last few planes. default = 2 
 +
    -r #:   number of resolutions to calculate, default = 1
 +
    -e #:   maximum spatial extent of object in pixels (ie, radius), default = 5
 +
                    this is needed since the floodfill can otherwise escape and fill huge
 +
                    volumes (the first and last z slices tend to be all negative, along with
 +
                    negative values in the background regions).
 +
    -s #:    maximum number of voxels in object, default = 300
 +
    -N #:   normalize image prior to use so its max = #, default = 10000
 +
    -b sigx sigy sigz:  standard deviation,in pixels, of Gaussian used in blurring
 +
                    (passed as args for -s option of invariant), default = 2 2 1
 +
 
 +
examples:
 +
 
 +
    find_blobs control3cluster4r_r_cell.i2i c3c4F10
 +
    dave -n 0 -u -z 1 -I control3cluster4r_r_cell.i2i -I c3c4F10_dres0_obj.i2i -S 2 1 0 c3c4F10.dpts
  
 +
source for this cshell script is in /storage/big1/lml/was_invitro/unc/curvature
 
   
 
   
===  smooth_gaps.pl  -h ===
+
</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>
 +
 
 +
This program takes an image and scans it vertically in y at dx intervals.  It counts the number of
 +
times a vessel of at least the specified width is entered. A vessel is any pixel with the specified
 +
intensity value.  Each z slice in analyzed separately (and read in sequentially). A count of vessels vs time and dx displacement is
 +
written to stdout.
 +
See /home/lml/krypton/Corvera/grant2010.
 +
 
 +
Usage: find_vessels [options] image.i2i  
 +
options:
 +
  -z start stop: zplanes to analyze. 0-indexed inclusive. default is all z planes
 +
  -i #: intensity of a pixel in the vessel. default = 32767
 +
  -w #: minimum vertical width of vessel in pixels, default = 2
 +
  -d #: dx step size, default = 100
 +
  -v: verbose
  
  usage:
+
Source in /home/lml/krypton/facil
smooth_gaps.pl -run [options]
+
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.
  
  options:
+
Usage:
-tag=something    tag to add before the .i2i in the new file name.
+
   fit3gaussians [options]
-verbose   print out each filename as it is being smoothed.
 
-dummy   just echo what would be done, but don't do anything
 
  
  see also:
+
Description:
smooth_gaps
+
  Fits a three component Gaussian model to time series data.
  
   
+
Options:
=== trans.pl -h ===
+
  -a      : rather than having data fit a 3D diffusion model, have it fit a 2D model.
 +
  -d # # : only look at data sets from # to # (inclusive, first data set = 0).
 +
            timings for the available data sets are (in seconds after uncaging):
 +
before_uncaging  0.050000  0.550000  1.050000  1.550000  11.550000  21.549999 
 +
31.549999  0.000000  0.000000  0.000000  0.000000  0.000000  
 +
0.000000  
 +
            default data sets to look at are 1 to 4
 +
  -e # # : change the time in dataset # (0-indexed) to # (in seconds)
 +
  -f file : file name for test data (as produced by "distances" program).
 +
  -F file : file name for times for all the datasets from file, one time per line.
 +
            this also changes the default range to be all the sets
 +
            (use -d after this on the command line if you want to change the sets used).
 +
      note: there must be less than 1000 datasets.
 +
  -n # #  : number of function parameters and variances used for
 +
            each parameter (default 10 paramters and  5 variances)
 +
  -p # #  : set function parameter number to some value (first # can be 0 to
 +
            the maximum number of parameters)
 +
  -s # #  : set function paramter # start value to some value (first # can be 0 to
 +
            the maximum number of parameters)
 +
  -S # #  : set function paramter # variance value to some initial value (first # can be 0 to
 +
            the maximum number of parameters)
 +
  -r # # #: set function paramter # range values to some initial values (first # can be 0 to
 +
            the maximum number of parameters)
 +
  -t #    : maximum number of random trials to search for parameters (default=100).
 +
  -T #    : search terminates when # successive times the smallest variance search is best. (default=5)
 +
  -m #    : maximum number of times to perform search, regardless of best variance (default=1000).
 +
  -M #    : maximum number of times try (for each parameter) to find a point within allowed range
 +
            default = 100
 +
  -D func #: print debug info. for specified function at level #
 +
              func 1: ars, levels: 1-4 with 4 being most info.
 +
              func 2: radial search, levels: 1-2
 +
              func 3: finding a test point, levels: 1-2
 +
  -P      :  just print out the data and theoretical curves for the start point and terminate.
  
Takes a bunch of images taken in one well on the microscope, translates them
+
example (see ~lml/vision/Politz/run)
based on ChainedTrans.txt and combines them into one big image.
+
default settings are:
 +
  t1 in seconds                  : range: -4.900E-02 to  5.500E+00, start: -2.500E-02
 +
  D1 in microns^2/sec            : range:  1.000E-02 to  1.000E+02, start:  5.000E+00
 +
  mag1 in intensity/micron^3      : range:  5.000E+01 to  3.000E+04, start:  3.000E+03
 +
  dc value                        : range:  0.000E+00 to  2.000E+03, start:  2.000E+02
 +
  D2                              : range:  1.000E-01 to  1.000E+03, start:  1.000E+02
 +
  mag2                            : range:  5.000E+00 to  3.000E+04, start:  3.000E+02
 +
  t2                              : range: -4.900E-02 to  5.000E+03, start:  5.000E+02
 +
  D3                              : range:  1.000E-01 to  1.000E+03, start:  1.000E+02
 +
  mag3                            : range:  5.000E+00 to  3.000E+04, start:  3.000E+02
 +
  t3                              : range: -4.900E-02 to  5.000E+03, start:  5.000E+02
  
ChainedTrans.txt should be a partially ordered file with entries like
+
</nowiki>
X02:X03    (685,282):(736,287)  
+
===  flood2zero  ===
This means that location (685,282) in file X02 is the same as location (736,287) in file X03.
+
<nowiki>
By partially ordered I mean that for file1:file2  file1 should already have been the
+
 
right hand side of a similar line previously (so its position is already defined relative to
+
This program takes an original 3D image, a 2nd derivative image
the file on the left hand side), unless it is the very first line in
+
as produced by invariant -F 9 -b, and a list of 3d maxima and produces
the file. So every right hand side is relative to a left hand side which has already
+
a new image which is just those voxels from orig.i2i that are negative
had its position defined.
+
(the 2nd derivative of a bright spot is < 0) in the derivative image
Output goes to new_trans.i2i
+
and connected to a 3D maxima.  So it is used in conjuction with invariant
 +
to identifiy bright blobs (eg, synapses) in a 3D image.
 +
 
 +
Usage: flood2zero [options] orig.i2i deriv.i2i image.pts newimage.i2i
 +
options:
 +
  -b # : which resolution of maxima to use (object=noderiv_maxima# in pts file)
 +
  -v #  : instead of using 0 as the object boundary cutoff, use #
 +
        -z low hi: zrange to examine, zero-indexed, inclusive.
 +
  -d dist: max chessboard distance (in voxels) from each point to flood fill.
 +
  -s size: maximum size in voxels of an object (will truncate to this size), default= 10000
 +
  -o file: save object (blob) statistics to specified file. This is very similar to
 +
what countobjs would produce when applied to newimage.i2i except newimage.i2i
 +
can have blobs which touch (due to the size contraints here) and hence show
 +
up as one large blob instead of two smaller blobs. Also, if the header for the
 +
image has a scale factor in it (which invariant writes) this scale factor will
 +
be used to convert all statistics back into original unscaled values.
 +
 
 +
note: entire image name (with extension) is NOT required.
 +
note: a - in place of an image name means stdin or stdout.
 +
note: a compressed image will be automatically be uncompressed.
 +
[source in /usr/people/lml/invitro/unc/curvature/flood2zero.c]
 +
 +
</nowiki>
 +
===  gsearch  ===
 +
<nowiki>
 +
program to do graph search on a slice of edge image
 +
USAGE:
 +
example gsearch -d name -x # -y # -a # -b # edge.i2i text.gpts
 +
    edge.i2i : magnitude input image
 +
    text.gpts: output is a graph points (gpts) text
 +
file having the same format as rpts file
 +
new boundary is stored under z=slice # (default: 1)
  
register_images.pl [options] ChainedTrans.txt
+
Options:
-out=filename.i2i name of output file produced. default = newimage.i2i
+
-d option specifies name of image containing direction of each edge
-post=string the rest of the filename after what is in ChainedTrans.txt, eg, if the file is named
+
    pixel of edge.i2i
X01_0_0_1.i2i, -post=_0_0_1.i2i (this is also the default for post if not specified).
+
-k  option specifies constant of proportionality
-xdim=# size of original each original image (before recaling by maxtrima, see example below). default = 1392.
+
    to be used with filgra (default: 1.0)
-ydim=# default = 1040
+
-x  start x coordinate.
-zdim=# default = 21
+
-y  start y coordinate.
-xscale=# binning done by matrixima (see example), coords will be scaled by this. default = 4.
+
-a  stop x coordinate.
-yscale=#
+
-b  stop y coordinate.
-blend when combining images, blend the values where they overlap (default is to just replace any previous
+
-h prints this message.
value with the new value).
 
    -dummy
 
-debug
 
-h
 
  
  
-shift no circular shift (see tranima). old.  
+
Source code in /storage/big1/lml/jac/was_invitro/graph
note: tranima will pad images with -32768 which play will show in red (I think) and DAVE will be bothered by.
+
 +
</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.
  
example:
+
Input Options:
matrixima -row 4 W X Y Z -col 3 01 02 03 -pos 0 -obj 0 -fil 1 new.i2i
+
  -o    :  border pixels are background voxels (default is object voxel)
play new.i2i  -> ChainedTrans.txt
+
  -p x y z  :padding in x,y,z included in the boundary image  (default 7 in all directions).
        register_images.pl ChainedTrans.txt
+
          (boundary image found in the programs boundary and
        dave -I new_trans.i2i -K -z 15  # a very big file.
+
            createBoundary are by default padded by 7 pixels
 +
            on all sides of the image.
  
source code: ~/krypton/bin/
+
Distance Options:
see also:
+
  -P x y z : don't find histogram of all pixels to boundary, just the distance
combine use this on newer images which have spatial information stored in their header
+
            of this pixel from the boundary. Can be used multiple times on command line.
parsepos.pl
+
            (x,y,z) is 1-indexed (like play) aimage.i2i coordinate values.
~/krypton/Corvera/Olga
+
  -d #:    maximum distance (in pixels) to check, default = .5*(min dim)
/storage/big1/lml/Corvera/Olga
+
          Any pixel further than the maximum distance is considered to be at the maximum distance.
recalc_quadrant.pl
+
          This apply also for the -ta and -tb distance based thresholds.
recalc_quadrant2.pl
+
  -x #  :  set x weight to # (default 1.0).
align_quadrants.pl the simplest manual method of aligning the four images in the well
+
  -y #  :  set y weight to # (default 1.0).
 +
  -z #  :  set z weight to # (default 1.0).
 +
  -F    :  Fast histogram - voxel level (default fast).
 +
  -S    :  Sub-voxel resolution histogram(default fast).
 +
  -Y # #:  limit Y direction from # to # (default off).
 +
          If the long axis of the cell is in the in the y direction,
 +
          and the cell is cut off, using the -Y option will limit searching
 +
          for the boundary in that direction, i.e. the ends past these values will
 +
          not be considered part of the boundary.
 +
          (similarly true for -X and -Z options)
 +
  -X # #:  limit X direction from # to # (default off), inclusive, 1-indexed.
 +
  -Z # #:  limit Z direction from # to # (default off).
 +
  -c:    pixels outside the image are considered border pixels.  For example, if the outlines
 +
          used to create boundary.i2i were in z=1, but you want pixels inside the z=1 boundary
 +
          to be counted as being 1 pixel away from the boundary (eg, from the phantom z=0 slice)
 +
          use this option.
 +
 
 +
Threshold Options:
 +
  -a #  :  set aimage threshold to # (default 0.000000).
 +
  -b #  :  set bimage threshold to # (default 0.000000).
 +
  -s :    subtract thresholds (and then clamp to >=0) rather than simply keeping intensities > threshold.
 +
          This is more like what you might want to do to subtract off background or nonspecific flourescence.
 +
  -ta athresh.txt  :  apply different thresholds at different distances to aimage.i2i.
 +
                    athresh.txt as produced by analyze_histo (applied to -f aimage_H.i2i output)
 +
  (i.e., 2 columns: bin # (tenths of a pixel) and threshold).
 +
  -tb bthresh.txt  :  like -ta, but for bimage.i2i
 +
  -ra # :  rescale athresh.txt prior to use, multiply values in file by #.
 +
  -rb # :  rescale bthresh.txt prior to use, multiply values in file by #.
 +
 
 +
Ouput Options:
 +
  -f aimage_H.i2i xdim ydim: print out a full histogram of aimage. This is a
 +
          2D image (eg, aimage_H.i2i) with the specified x and y dimensions.
 +
          The x direction is pixel intensity, and the y direction bin number (tenths of a pixel) and
 +
          the pixel value wll be set to the number of voxels at that distance and that intensity.
 +
          Specify -1 for xdim or ydim if you want that dimension calculated automatically
 +
          (xdim will be approx. max intensity in image and ydim about 10*max dist, see -d option).
 +
          Explicitly set the dimensions if you will want to add this image with others (since they must all
 +
          be the same dimensions), e.g., to average data from a set of control files.
 +
          note: -S option will cause the "number of voxels" to appear to change.
 +
          Use the analyze_histo program to produce a distance dependent threshold file from this (e.g. to read
 +
          back into histogram2 on another pass via the -ta or -tb option).  This image can be large (25MB).
 +
  -H file: Output filename for histogram (instead of aimage_H.histo).
 +
  -A aimage_thresh.i2i  :  write out aimage.i2i after threshold is applied (for visualization purposes)
 +
                          these are the pixel values used to produce column 5 of aimage_H.histo
 +
  -B bimage_thresh.i2i  :  write out bimage.i2i after threshold is applied (for visualization purposes)
 +
                          these are the pixel values used to produce column 6 of aimage_H.histo
 +
 
 +
Miscellaneous Options:
 +
  -D distimage.i2i  :  print the distance image (for debugging). Each voxel is 100 times its distance
 +
    from the membrane (a pixel neighboring the background has a distance of .5 pixels).
 +
                      This can also be used by mask_image to then mask desired pixels.
 +
  -h    :  print this message.
 +
 
 +
Notes:
 +
  All the images should be oriented in the same direction.
 +
  Entire image name (with extension) is required.
 +
  A - in place of an image name means stdin or stdout.
 +
 
 +
 
 +
Example:
 +
  create_dcim -d 4 -s 234 294 24 -| addlines -P -1 - rob15_nucleus.rpts -|
 +
            flood -e -1 -E 2 -I 6 -b 4 - mask.i2i
 +
  histogram2 -p 0 0 0 -Z 2 23 -d 40 -a 3552 -b 7767 -z 1.34 mask.i2i rob15f_rtm.i2i rob15r_rtm.i2i
 +
 
 +
Example: use a variable distance threshold to subtract background flourescence from dual labeled images:
 +
    addlines -P -1 control_aimage.i2i control_membrane.rpts -| flood -e -1 -E 2 -I 6 -b 4 - mask.i2i
 +
        # create a full histogram so we can use a variable threshold based upon distance from membrane:
 +
    histogram2 -p 0 0 0 -d 40 -z 1.34 -f controla_H.i2i mask.i2i control_aimage.i2i control_aimage.i2i
 +
        # create the variable threshold file:
 +
    analyze_histo controla_H.i2i > controla_H.thresholds
 +
        # repeat for control bimage (e.g., second wavelength):
 +
    histogram2 -p 0 0 0 -d 40 -z 1.34 -f controlb_H.i2i mask.i2i control_bimage.i2i control_bimage.i2i
 +
    analyze_histo controlb_H.i2i > controlb_H.thresholds
 +
        # now apply these thresholds to the real dual labeled (not the control) data:
 +
    addlines -P -1 real_aimage.i2i real_membrane.rpts -| flood -e -1 -E 2 -I 6 -b 4 - real_mask.i2i
 +
    histogram2 -p 0 0 0 -d 40 -z 1.34 -s -ta controla_H.thresholds -tb controlb_H.thresholds \
 +
                    real_mask.i2i real_aimage.i2i real_bimage.i2i
 +
See Also:
 +
  boundary, createBoundary, analysis, analyze_histo, threshold, nucleus_overlaps, mask_image, Corecell.pl.
 +
 
 +
Source code in /storage/big1/lml/jac/was_invitro/Projects/boundary/boundary
 +
 
 +
 
 +
</nowiki>
 +
===  image2ptsL  ===
 +
<nowiki>
 +
 
 +
This program takes an image, and identifies boundary pixels of objects.
 +
Boundary pixels are foreground pixels which have at least one
 +
backgound pixel among their 8 neighbors.
 +
In addition, any foreground pixel which is on the edge of a 2D
 +
slice is also considered a boundary pixel.
 +
These boundary pixels are written out in "addlines" format.
 +
Each zslice is analyzed sequentially.
 +
Points are unordered, and they are all considered part of one object.
 +
Points in the pts file have their value set to -1
  
 +
Usage: image2pts [options] image.i2i pointfile.pts
 +
options:
 +
  -t #: threshold, above which is foreground. Default = 0
 +
note: entire image name (with extension) is NOT required.
 +
note: a - in place of an image name means stdin or stdout.
 +
note: a compressed image will be automatically be uncompressed.
 
   
 
   
===  blur3d ===
+
</nowiki>
incorrect command line.
+
===  invariant ===
Blurs an image by a psf.
+
<nowiki>
FFTs are done with 4 byte floats, so total space needed will be 4 times the padded image size (in voxels)
+
 
plus the size of the two original images (image and psf)
+
This program takes an image, blurs it with a Gaussian of
The input image can be real or short int format. The psf must be short int format.
+
specified standard deviation and then takes derivatives of the image
note: performs a convolution (not a correlation).
+
It does all of this in the frequency domain.
note: fixed a small bug. 10/17/11
+
 
 +
outfile is the root name for derivative of blurred images (outfile_dres#.i2i, unless -M),  plain blurred
 +
images (-b option, outfile_bres#.i2i) and/or pts files (-m or -M options, outfile.pts).
 +
 
 +
Any function which is a ratio of sum of products of derivatives (eg, (LxxLy + LyzLx)/(LyLy+LzLz))  
 +
can be calculated. Edit file init_invariant.c in
 +
/usr/people/lml/invitro/unc/curvature and recompile on molmed if you want a function which
 +
is not listed here.
  
Usage: blur3d [options] image psf newimage
+
Usage: invariant [options] infile.i2i outfile
 
options:
 
options:
  -S #:  scale (multiply) output values by # (to prevent underflow or overflow)
+
  -F #:   function to calculate. Default = 1. Available functions are:
  voxels which after scaling are > 32767 are set to 32767. voxels < -32766 are set to -32766.
+
  -F 1: LxLx+LyLy+LzLz : 3D gradient squared
    -p # # #: pad the image in x, y, and z by the specified amounts
+
  -F 2: .5(Lxx+Lyy+Lzz)/sqrt(LxLx+LyLy+LzLz) : normalized 3D Laplacian
by default image is padded (with 0) by 1/4 psf width all around,
+
  -F 3: LxLx+LyLy : 2D gradient squared
so its size for blurring becomes bigger by psf/2.
+
  -F 4: sqrt(LxLx+LyLy) : 2D gradient
psf is always padded to the same size the image becomes.  
+
  -F 5: 2(LxxLyy-Lxy^2)/(Lxx^2 + Lyy^2 + 2Lxy^2): 2D light or dark blobs (p. 252 IPMI '91)
Padding is stripped off before newimage is written, so it will be the same size as
+
  -F 6: 2(LxxLyy-Lxy^2), same a -F 5, no normalization (so noise isn't magnified).
the original image.
+
  -F 7: mean curvature of 3D isointensity surface normalized by gradient squared
    -N # # #: pad so that the image has the specified dimensions after padding (just prior to FFT).
+
  -F 8: mean curvature of 3D isointensity surface, no normalization.
  -n #: pad with # instead of boundary pixel values.
+
  -F 9: 2nd der. in the grad. direction times gradient squared.
  -Zpad with zero instead of the boundary pixel values.
+
  -F 10: 2nd der. in the grad. direction (should = 0 at locations of edges)(use -u option).
  -c # # #: the center of the psf is at (#,#,#) zero indexed.  
+
  -F 11 XYZ    e.g., -F 11 021  take zero derivatives in X direction, 2 in Y, 1 in Z (Lyyz).
                the default is to take the brightest pixel as its center.
+
by calling invariant multiple times with various XYZ and using the -g option you
  -C:   don't center the psf at all (default is to center on the max, unless -c is specified).
+
can create a bunch of derivative images which you can then read in and combine
  -P:   normalize the psf so each slice (after padding) averages to 1. -P acts like an optical PSF.
+
however you like (e.g., my curvature_eigenvectors program)
        the default is to normalize so the entire psf (after padding) has an average pixel value of 1
+
  -N #: normalize image intensities prior to use to be between 0 and #
              (the default keeps total light constant).
+
this performs: newval = #*(val-minval)/(maxval-minval)
  -d:  don't normalize at all.
+
  -u #: during division (-F 2,5,7,10) set divide by 0 to this integer, default=0.
  -o:  do a cross correlation instead of a blur (convolution)
+
        note: this is the final output pixel value, after any scale factors (-r or -R).
  -R:  output image as 4 byte floating point instead of short integer.
+
        a good value is -32768, the minimum possible output pixel value.
  -v:  verbose. print more info to stderr.
+
  -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: image dimensions which factor to 2, 3, or 5 go fastest with the FFT.
 +
note: the entire image name is NOT required.
 +
note: compressed images will be uncompressed.
 +
note: a - in place of an image name means stdin or stdout.
 +
see also: max3d, multi_gauss_deriv, flood2zero, find_blobs, blur_spatial, canny, zerosu.
 +
source in /storage/big1/lml/was_invitro/unc/curvature
 +
/home/lml/krypton/bin/invariant
 +
 
 +
</nowiki>
 +
===  linux_epr_x86_64-7-12-2012  ===
 +
<nowiki>
 +
 +
 
 +
epr                              UMMC/BIG                          Jul 12 2012
 +
 
 +
NAME
 +
    epr - Exhaustive Photon Replacement (EPR) restores contrast by removing
 +
    residual out-of-focus light and improves resolution while maintaining
 +
    numerical accuracy of 3-D images of specimens obtained with serial
 +
    optical sectioning from wide-field or confocal light microscopy.
 +
 
 +
SYNOPSIS
 +
    epr [options] before-image[.tif] after-image[.tif]
 +
 
 +
DESCRIPTION
 +
    epr performs regularized, iterative image restoration with a non-
 +
    negativity constraint.  The before-image is a three dimensional (3-D)
 +
    TIFF image composed of rectangular, regularly spaced, optical sections.
 +
    Large images are decomposed into smaller, overlapping (in x and y only)  
 +
    image segments for restoration, and the restored segments are recomposed.
 +
    The after-image is the restored 3-D image. All options must appear
 +
    before the image file names, but the order of options is not important.
  
note: entire image name (with extension) is NOT required.
+
    epr has the following options:
note:  can read from stdin or write to stdout (use a dash instead of the file name)
 
note: a compressed image will be automatically be uncompressed.
 
  
Copyright 2010 University of Massachusetts Medical School and the Biomedical Imaging Group
+
    -h                Prints basic help on syntax and available options.
All rights reserved. Explicit permission to use this program must be received prior to use.
 
 
===  canny  ===
 
incorrect command line.
 
This program reads in a 2 or 3d image and outputs the results
 
of a 2D Canny edge detector on it. Canny is the derivative
 
(in the gradient direction) of the magnitude of the first
 
derivative (so it is a type of 2nd derivative). 
 
NOTE: see option -n below for an exact answer.
 
Each z slice is treated
 
independently of the others.  Its application will often be
 
preceded by a Gaussian blur and followed by the calculation
 
of zero crossings.
 
If an INT type image is input, an INT is output.
 
If a REAL type image is input, a REAL is output.
 
  
Usage: canny [options] infile outfile
+
                              Required Parameters
  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.
+
    -psf file[.tif]  The 3-D point spread function image file. The psf must
Note: a - in place of an image name means stdin or stdout.
+
                      match the optical configuration used for the before-
 +
                      image.  The psf depth (number of z-planes) need only be
 +
                      less-than or equal-to twice that of the before-image.
 +
                      Extra z-planes are symmetrically discarded.
  
 +
    -smoothness alpha The alpha value where alpha is typically 0 < alpha < RNL.
 +
    -sm alpha        RNL is the residuals noise limit as reported by prepdata
 +
                      (see also). Smaller values of a correspond to less
 +
                      smoothing.  (RNL)^2 is usually a good starting choice for
 +
                      alpha.
  
===  center_of_mass  ===
+
    -iterations n    Maximum number of iterations to perform. Iterating may
incorrect command line.
+
    -it n            terminate earlier if convergence is detected. (see
This program reads in a 4D image and translates each 3D image
+
                      -convergence)
so its center of mass is moved to be the center of the image.
 
One 3D image is read at a time.
 
  
Usage: center_of_mass [options] inimage.i2i outimage.i2i
+
                              Control Parameters
options:
 
  -t tdim:  number of time points, default = 1. This is NOT read from the header.
 
  -T #:  threshold inimage.i2i prior to analysis. voxels <= # ignored, default = 0
 
  -v: verbose
 
  
note: source code in krypton:/home/lml/krypton/facil directory.
+
    -scaling n        where n is after image scaling factor. Used to prevent
+
    -sc n            integer overflow when saving after image to file.
===  combine_images  ===
+
                      Default=1.0
This program reads a bunch of image files which have their xy position within a well stored in their header.
 
It then combines the images. Karls acquisition program for the Zeiss microscope should automatically add
 
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
+
    -convergence n    Criteria for terminating iteration, where n is << 1.
options:
+
    -co n            0.00001 represents true convergence. 0.001 usually
-d debug. stuff to stderr.
+
                      achieves 90-95% convergence in about half the number
-f do NOT fill pixel locations which have no data with nearest data value (added 2/3/14)
+
                      of iterations. Values of n larger than 0.001 are not
Filling is done by default to try to avoid introducing sharp intensity edges into the image.
+
                      generally recommended. Default=0.001
-X flip each input image in X before using it (-Y can also be specified at the same time)
+
 
-Y flip each input image in Y before using it
+
    -axial n1 n2      The z-axis object extrapolation beyond the sectioned
-p # over-ride the specified pixel size with this one (in um). The 2.5X objective has a
+
    -ax n1 n2        image data where n1 is before first plane and n2 is
pixel size of 2.58 um stored in the image header (for images acquired prior to 4/13/13)
+
                      after last plane. n is in planes.  By default,  
but it should be 2.41
+
                      extrapolation extends +-1/2 the z-axis extent of the point
-x #:#[:#...]  rather than use the x positions stored in the image header use these x pixel positions.
+
                      spread function image and should be sufficient. Smaller
these should be the x offset of one image relative to another, in the same order as the
+
                      values of n1 or n2 have the effect of spatially
image names on the command line (there MUST be one number for each image). For example:
+
                      constraining the restored object and should be applied
combine_images -x=0:500:0:500 im11.i2i im21.i2i im12.i2i im22.i2i outim.i2i  if im21.i2i and im22.i2i
+
                      carefully.
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.
 
    insert_image
 
  
Source code in ~/krypton/facil/combine_images.c
+
    -transverse n    The x-axis and y-axis object extrapolation in pixels.
combine_images: incorrect command line.
+
    -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.
  
== Miscellaneous ==
+
EXAMPLES
===  analyze_cross_sections_of_voronoi.pl  -h  ===
+
    To see the command line syntax
  
This program reads files produced by cross_sections_of_voronoi (-P)
+
      % epr
Results prints volume (x) vs predicted volume (y) to stdout.
+
    or
 +
      % epr -h
  
analyze_cross_sections_of_voronoi.pl [options] file1.txt [... filen.txt]
+
    Given specimen image mycell_.i2i and point spread function image mypsf_.i2i
 +
      let smoothness equal 0.0005, maximum number of iteration equal 250
 +
      and convergence equal 0.001. Perform single-resoltion(default) EPR:
  
options:
+
      % epr -psf mypsf_ -smoothness 0.0005 -iterations 250 mycell_ mycell_r
-debug info about all fields on each line printed to stderr
 
-stdout everything to stdout
 
-print_avg for each file, just graph mean and std error of the mean, rather than all data pts
 
  
 +
FAQ (Frequently Asked Questions)
 +
 +
      see  http://...
 +
FILES
 +
        xcomp:/home/epr/epr
 +
        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 -h ===
+
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.
 +
 
 +
NOTE:A surface can be generated by Simple_2D_wrap or shrink_wrapThis "mesh"
 +
representation of the surface (which DAVE can display using the -i option)
 +
can be converted into a surface .i2i image for map_to_surface using
 +
/usr/people/jac/cell/bin/make_surface -I surface.i2i -c 1 mesh.i2i surface.rpts
 +
The resulting surface is made up of voxels. Voxels which are just below the
 +
surface will be considered to be a distance of 1 voxel from the surface
 +
(the distance between the centers of the two voxels).
 +
 
 +
Usage:
 +
  map_to_surface [options] surface.i2i image.i2i out_image.i2i [image1.i2i out_image1.i2i]
 +
Options:
 +
 
 +
a second input image and output image can be specified on the command line.
  
find which track a specified coordinate is near (ie, with dx,dy) (eg, DAVE crosshairs gives us a coord, what track is it?)
+
-c: rather than mapping data values to the nearest surface voxel, map
assumes coords passed are zero indexed
+
a count of the number of data values which mapped to the
 +
surface voxel. I.e., if 2 data voxels mapped to a surface voxel, a
 +
2 is stored there (rather than the max of the 2 data values-the default).
 +
-b: rather than mapping data values to the nearest surface voxel, or
 +
a count, just map a 1 (ie, binary) onto the surface where ever a data
 +
voxel maps (regardless of how many map there or their intensity).
 +
-m: surface.i2i is actually a mesh file, not an image file
 +
produced from a mesh file.  In this case, only map data
 +
values to surface vertices (since map_to_surface doesn't
 +
yet know how to convert mesh files to complete surfaces
 +
like make_surface).
 +
      -d #:  minimum distance (in voxels) which data must be from the surface and
 +
still be mapped onto it.  Data closer than this is ignored.
 +
By default all data is examined (ie, min_distance = 0)
 +
      -D #:  maximum distance (in voxels) which data can be from the surface and
 +
still be mapped onto it.  Data further than this is ignored.
 +
By default all data is examined (ie, max_distance = 1/2 the minimum
 +
image dimension, this should include all of the data).
 +
      -x:    exclude data voxels which are already on the surface (they will be zeroed).
 +
(note: setting the minimum distance > 0 will not achieve the same effect since
 +
that would still allow a data voxel on the surface to match to a surface
 +
voxel at a neighboring position).
  
    usage:  neartrack.pl -x=# -y=# [-z=#] [-dx=#] [-dy=#] [-oneindexed] file.rpts
+
Source code in /storage/big1/lml/was_invitro/Moore/pkc
  
+
</nowiki>
===  parse_macros4.pl  -h ===
+
===  min_cylinder ===
  Can't use 'defined(%hash)' (Maybe you should just omit the defined()?) at /home/lml/krypton/bin/parse_macros4.pl line 562.
+
  <nowiki>
 +
MIN_CYLINDER program - Version 1.0
  
=== path_diff.pl  -h  ===
+
  This program takes an initial cylindrical mesh surface
compare the differences between the paths found from two different runs of exo5
+
and allows it to deform to minimize a function of
 +
surface curvature and stretch and image intensity
  
path_diff.pl  file1 file2
+
Usage: min_cylinder [options] insurface infile outsurface
  
options:
+
OPTIONS CONTROLLING TERMINATION CRITERIA:
  -dx=# x coord at fusion time can differ by this and still be considered same path (default = 0)
+
[-n #] Maximum iterations
  -dy=# y coord at fusion time can differ by this and still be considered same path (default = 0)
+
[-c #] Minimum pixel changes per iteration
  -df=# fusion time can differ by this and still be considered same path (default = 0)
 
  
   -debug
+
OPTIONS CONTROLLING SURFACE SHAPE:
   -Debug
+
[-w # # # # # #] Weights for Su Sv Suu Suv Svv E
+
default = 0.20, 0.20, 0.10, 0.20, 0.10, -0.10
=== trackinfo.pl -h  ===
+
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 calculationThis option should produce
 +
a more correct curvature calculation, so the program does not
 +
get fooled into thinking that small objects have smaller
 +
curvature.
  
# analyze output from "track or track -r".
+
OPTIONS CONTROLLING ALLOWABLE SURFACE MOVEMENT:
# assumes coords passed are zero indexed.  
+
[-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.
  
# usage:   trackinfo.pl -x=# -y=# [options] file.rpts
+
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)
  
#  options:  
+
See also: Simple_2D_Wrap, 2D_wrap, shrink_wrap
  
#    -reg=# : just print info about the specified region number
+
</nowiki>
#    -track=# : just print info about the specified track
+
===  morph3d  ===
#    -trackcoords=minsize:maxsize:miniod:maxiod:minlife:maxlife
+
<nowiki>
# : print the coords (rpts format) of all tracks which satisfy
+
 
#   the criteria (or all its regions satisfy them). lifetime is # of timepts it exists for.
+
This program does morphological processing on greyscale images. Currently the
#    -tdist=mindist:maxdist: use with -trackcoords to specify min and max (xy manhattan) distance track travels
+
default intensity it filters with is a constant, although different shapes and
#    -micro:   print coords of all paths. color code them so if they connect at all
+
intensity profiles are allowed.  Think of a 2d image as a 3d binary array of voxels
#   they are the same color (eg, all along the same microtubule)
+
where the height dimension is the intensity of the image at this x,y position.
#    -x=# -y=# : find which track the specified coordinate is near (eg, DAVE
+
All those pixels which are less than or equal to the height are 1, others are zero.
#   crosshairs gives us a coord, what track is it?)
+
This object (made up of voxels which are 1) is the UMBRA of the image.
#    -z=# : also include z in distance calculation.
 
#    -dx=# : dx, default = 3
 
#    -dy=# : dy, default = 3
 
#    -dz=# : dy, default = 1000 (ie, essentially ignored)
 
#    -oneindexed : otherwise -x, -y, -z assumed to be zero indexed (rpts file is always one indexed)
 
#    -t : print additional region and track info (which should be in file.rpts
 
#   if -r was specified when running "track") for objects found
 
#   (eg, via -x=#,-y=#,or -region=#)
 
#    -sf=name : sort field. name of field to sort on when printing out a track.  
 
#   implies -t. default = time ("set");
 
#    -rs : reverse the "sense" of the sort (normally smallest to largest). implies -t.
 
#    -pf=field1:field2:field3 : print fields. which fields to print from the region info (implies -t).
 
#   default is all fields.  you can put as many fields as you want here,
 
#   separated by colons.
 
#    -verbose: : print info about progress to stderr
 
  
# example:
+
Dilation: Take the umbra of
#    track -a 3 -n 400 -r -s 0 5 -S -t 25 -v 5 500 -d 15 9 -u .33 .33 .25 5 -h .01 a.vel a.i2i > a.rpts
+
the image and the umbra of the filter. Then the image dilated by the filter is
#    trackinfo.pl -x=52 -y=28 -t -pf=set:size:nextid a.rpts
+
those voxels which get "reached" by the filter voxels when the filter umbra
#    trackinfo.pl -reg=103 -t -pf=set:size:nextid a.rpts
+
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
== Data Reformatting ==
+
those voxels which, when the filter umbra is centered on them, permit all the
===  chres_rpts.pl  -h  ===
+
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.
  
  Reads in some rpts files and rescales their x and y coords so that they will match an image which
+
Opening: erosion followed by dilation, can be visualized by taking the filter umbra
  has been similarly rescaled.
+
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.
  
  usage:
+
Closing: dilation followed by erosion.  Dilation can be visualized as
    chres_rpts.pl  [options] infile.rpts > outfile.rpts
+
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.).
  
  options:
+
If a 3D image is input, and a 3D filter shape is specified, then all analysis
-sx=# rescale x -> x*#
+
is done using 3D morphological filtering. If a 2D filter is specified, then each
-sy=# rescale y -> y*#
+
zplane is analyzed separately.
-truncate  after rescaling, truncate to an integer (newer versions of addlines can handle floating pt)
 
-round     after rescaling, round to an integer
 
-max=#:#    don't let x become > than #1. don't let y become > #2.
 
-min=#:#    don't let x become < than #1. don't let y become < #2.
 
  
  example:
+
Usage: morph3d [options] inimage.i2i outimage.i2i
# suppose you have a floating pt rpts file
+
options:
    find_peaks_inrpts.pl -rpts=QS_H10+1Q_3T3_center_2_peaks.rpts:.15:.033
+
  -v: verbose, prints out which z slice is being analyzed to stderr.
Results/mat_quad/QS_H10+1Q_3T3_center_2_control_q_kept.rpts > /dev/null
+
  -b #: any pixels <= # are background, ignore them. default = -32766
# and you want to see it in better spatial detail:
+
  -h #: the maximum height (intensity) of the filter center relative to other
    chres -S 4 4 1 Data/QS/QS_H10+1Q_3T3__center_2_ra7.i2i QS_H10+1Q_3T3__center_2_ra7_ch441.i2i
+
                      entries in the filter. The defaul