Skip to content
Snippets Groups Projects
Commit 9fa67c20 authored by aknecht2's avatar aknecht2
Browse files

OSG Documentation Update

parent 9b6f1285
No related branches found
No related tags found
No related merge requests found
Showing
with 5558 additions and 0 deletions
MANIFEST 0 → 100644
# file GENERATED by distutils, do NOT edit
setup.py
ih/__init__.py
ih/conf.py
ih/imgproc.py
ih/statistics.py
ih/validator.py
ih/workflow.py
scripts/ih-adaptive-threshold
scripts/ih-bitwise-and
scripts/ih-bitwise-not
scripts/ih-bitwise-or
scripts/ih-bitwise-xor
scripts/ih-blur
scripts/ih-color-filter
scripts/ih-contour-cut
scripts/ih-convert-color
scripts/ih-crawl
scripts/ih-crop
scripts/ih-data
scripts/ih-edges
scripts/ih-error-log
scripts/ih-extract
scripts/ih-extract-all
scripts/ih-extract-multi
scripts/ih-gaussian-blur
scripts/ih-meanshift
scripts/ih-median-blur
scripts/ih-morphology
scripts/ih-normalize-intensity
scripts/ih-resize
scripts/ih-run
scripts/ih-setup
scripts/ih-sql-aggregate
scripts/ih-stats-anova
scripts/ih-stats-correlate
scripts/ih-stats-export
scripts/ih-stats-histogram-bin
scripts/ih-stats-normalize
scripts/ih-stats-shoot-area
scripts/ih-stats-threshold
scripts/ih-stats-treatment-comp
scripts/ih-stats-ttest
scripts/ih-threshold
scripts/osg-wrapper.sh
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#!/usr/bin/python
import argparse
import traceback
import ih.imgproc
parser = argparse.ArgumentParser(description = "Thresholds an image based on windows.")
parser.add_argument("--input", dest="input", help="Path to input image.", required = True)
parser.add_argument("--value", dest="value", type=int, help="Value to write to pixels. Usually 255 or 0.", required = True)
parser.add_argument("--adaptiveType", dest="adaptiveType", help="Adaptive type to use. Either 'mean' or 'gaussian'.", required = True)
parser.add_argument("--thresholdType", dest="thresholdType", help="Threshold type to use. Either 'binary' or 'inverse'.", required = True)
parser.add_argument("--blockSize", dest="blockSize", type=int, help="Window size to consider. Should be an odd number.", required = True)
parser.add_argument("--C", dest="C", type=int, help="Constant to subtract from window mean.", required = True)
parser.add_argument("--outputdir", dest="outputdir", default=".", help="Path to write output files, if not specified use current directory.")
parser.add_argument("--output", default=None, dest="output", help="Name of output image to write, if not specified, use input image name.")
args = parser.parse_args()
try:
plant = ih.imgproc.Image(args.input, args.outputdir, args.output, False)
plant.adaptiveThreshold(args.value, args.adaptiveType, args.thresholdType, args.blockSize, args.C)
plant.write()
except Exception as e:
print traceback.format_exc()
#!/usr/bin/python
import argparse
import traceback
import ih.imgproc
parser = argparse.ArgumentParser(description = "Converts an image between color spectrums.")
parser.add_argument("--input1", dest="input1", help="Path to first input image.", required = True)
parser.add_argument("--input2", dest="input2", help="Path to second input image.", required = True)
parser.add_argument("--outputdir", dest="outputdir", default=".", help="Path to write output files, if not specified use current directory.")
parser.add_argument("--output", default=None, dest="output", help="Name of output image to write, if not specified, use input image name.")
parser.add_argument("--mask", default=False, dest="mask", action="store_true", help="Convert the first input image to a mask.")
args = parser.parse_args()
try:
plant = ih.imgproc.Image(args.input1, args.outputdir, args.output, False)
if args.mask:
plant.mask()
plant.bitwise_and(args.input2)
plant.write()
except Exception as e:
print traceback.format_exc()
#!/usr/bin/python
import argparse
import traceback
import ih.imgproc
parser = argparse.ArgumentParser(description = "Converts an image between color spectrums.")
parser.add_argument("--input", dest="input", help="Path to first input image.", required = True)
parser.add_argument("--outputdir", dest="outputdir", default=".", help="Path to write output files, if not specified use current directory.")
parser.add_argument("--output", default=None, dest="output", help="Name of output image to write, if not specified, use input image name.")
args = parser.parse_args()
try:
plant = ih.imgproc.Image(args.input, args.outputdir, args.output, False)
plant.bitwise_not()
plant.write()
except Exception as e:
print traceback.format_exc()
#!/usr/bin/python
import argparse
import traceback
import ih.imgproc
parser = argparse.ArgumentParser(description = "Converts an image between color spectrums.")
parser.add_argument("--input1", dest="input1", help="Path to first input image.", required = True)
parser.add_argument("--input2", dest="input2", help="Path to second input image.", required = True)
parser.add_argument("--outputdir", dest="outputdir", default=".", help="Path to write output files, if not specified use current directory.")
parser.add_argument("--output", default=None, dest="output", help="Name of output image to write, if not specified, use input image name.")
args = parser.parse_args()
try:
plant = ih.imgproc.Image(args.input1, args.outputdir, args.output, False)
plant.bitwise_or(args.input2)
plant.write()
except Exception as e:
print traceback.format_exc()
#!/usr/bin/python
import argparse
import traceback
import ih.imgproc
parser = argparse.ArgumentParser(description = "Converts an image between color spectrums.")
parser.add_argument("--input1", dest="input1", help="Path to first input image.", required = True)
parser.add_argument("--input2", dest="input2", help="Path to second input image.", required = True)
parser.add_argument("--outputdir", dest="outputdir", default=".", help="Path to write output files, if not specified use current directory.")
parser.add_argument("--output", default=None, dest="output", help="Name of output image to write, if not specified, use input image name.")
args = parser.parse_args()
try:
plant = ih.imgproc.Image(args.input1, args.outputdir, args.output, False)
plant.bitwise_xor(args.input2)
plant.write()
except Exception as e:
print traceback.format_exc()
#!/usr/bin/python
import argparse
import traceback
import ih.imgproc
parser = argparse.ArgumentParser(description = "Smoothes an image based on a evenly distributed kernel.")
parser.add_argument("--input", dest="input", help="Path to input image.", required = True)
parser.add_argument("--kwidth", dest="kwidth", type=int, help="Width of the kernel", required = True)
parser.add_argument("--kheight", dest="kheight", type=int, help="Height of the kernel", required = True)
parser.add_argument("--anchorx", default=-1, dest="anchorx", type=int, help="X position of the anchor")
parser.add_argument("--anchory", default=-1, dest="anchory", type=int, help="Y position of the anchor")
parser.add_argument("--border", default="default", dest="border", help="Border type for extrapolation.")
parser.add_argument("--outputdir", dest="outputdir", default=".", help="Path to write output files, if not specified use current directory.")
parser.add_argument("--output", default=None, dest="output", help="Name of output image to write, if not specified, use input image name.")
args = parser.parse_args()
try:
plant = ih.imgproc.Image(args.input, args.outputdir, args.output, False)
plant.blur((args.kwidth, args.kheight), (args.anchorx, args.anchory), args.border)
plant.write()
except Exception as e:
print traceback.format_exc()
#!/usr/bin/python
import argparse
import traceback
import ih.imgproc
parser = argparse.ArgumentParser(description = "Smoothes an image based on a evenly distributed kernel.")
parser.add_argument("--input", dest="input", help="Path to input image.", required = True)
parser.add_argument("--logic", dest="logic", help="Logic string to compute.", required = True)
parser.add_argument("--roi", dest="roi", help="roi file")
parser.add_argument("--ystart", dest="ystart", default=-1, help="Minimum Y of the roi.")
parser.add_argument("--yend", dest="yend", default=-1, help="Maximum Y of the roi.")
parser.add_argument("--xstart", dest="xstart", default=-1, help="Minimum X of the roi.")
parser.add_argument("--xend", dest="xend", default=-1, help="Maximum X of the roi.")
parser.add_argument("--outputdir", dest="outputdir", default=".", help="Path to write output files, if not specified use current directory.")
parser.add_argument("--output", default=None, dest="output", help="Name of output image to write, if not specified, use input image name.")
args = parser.parse_args()
try:
plant = ih.imgproc.Image(args.input, args.outputdir, args.output, False)
if args.roi:
plant.colorFilter(args.logic, args.roi)
else:
plant.colorFilter(args.logic, [args.ystart, args.yend, args.xstart, args.xend])
plant.write()
except Exception as e:
print traceback.format_exc()
#!/usr/bin/python
import argparse
import traceback
import ih.imgproc
parser = argparse.ArgumentParser(description = "Smoothes an image based on a evenly distributed kernel.")
parser.add_argument("--input", dest="input", help="Path to input image.", required = True)
parser.add_argument("--binary", dest="binary", help="Binary image to calculate contours from", required = True)
parser.add_argument("--basemin", default=100, dest="basemin", type=int, help="Minimum area of contour required to keep in final image.")
parser.add_argument("--padminx", default=0, dest="padminx", type=int, help="Padding added to left.")
parser.add_argument("--padmaxx", default=0, dest="padmaxx", type=int, help="Padding added to right.")
parser.add_argument("--padminy", default=0, dest="padminy", type=int, help="Padding added to top.")
parser.add_argument("--padmaxy", default=0, dest="padmaxy", type=int, help="Padding added to bottom.")
parser.add_argument("--resize", default=False, dest="resize", action="store_true", help="Whether or not to resize the actual image.")
parser.add_argument("--returnBound", default=False, dest="returnBound", action="store_true", help="Whether or not to write the bound.")
parser.add_argument("--roiwrite", default="roi.json", dest="roiwrite", help="The name of the roi file to write.")
parser.add_argument("--outputdir", dest="outputdir", default=".", help="Path to write output files, if not specified use current directory.")
parser.add_argument("--output", default=None, dest="output", help="Name of output image to write, if not specified, use input image name.")
args = parser.parse_args()
try:
plant = ih.imgproc.Image(args.input, args.outputdir, args.output, False)
plant.contourCut(args.binary, args.basemin, [args.padminy, args.padmaxy, args.padminx, args.padmaxx], args.resize, args.returnBound, args.roiwrite)
plant.write()
except Exception as e:
print traceback.format_exc()
#!/usr/bin/python
import argparse
import traceback
import ih.imgproc
parser = argparse.ArgumentParser(description = "Converts an image between color spectrums.")
parser.add_argument("--input", dest="input", help="Path to input image.", required = True)
parser.add_argument("--intype", dest="intype", help="Type of input image, one of [bgr, gray, hsv, lab, ycrcb]", required = True)
parser.add_argument("--outtype", dest="outtype", help="Type of output image, one of [bgr, gray, hsv, lab, ycrcb]", required = True)
parser.add_argument("--outputdir", dest="outputdir", default=".", help="Path to write output files, if not specified use current directory.")
parser.add_argument("--output", default=None, dest="output", help="Name of output image to write, if not specified, use input image name.")
args = parser.parse_args()
try:
plant = ih.imgproc.Image(args.input, args.outputdir, args.output, False)
plant.convertColor(args.intype, args.outtype)
plant.write()
except Exception as e:
print traceback.format_exc()
#!/usr/bin/python
import argparse
import traceback
import ih.workflow
parser = argparse.ArgumentParser(description = "Initial setup for job submission")
parser.add_argument("--dir", dest="dir", default=".", help="Base directory name.")
parser.add_argument("--template", default="input/crawl.json", dest="template", help="Name of template file to use for directory crawling.")
parser.add_argument("--validate", dest="validate", action="store_true", help="If specified only validates the workflow. Does not generate submission.")
args = parser.parse_args()
try:
loader = ih.workflow.ImageLoader(args.template, args.dir, args.validate, True)
loader.crawl()
loader.write()
loader._success()
except Exception as e:
print traceback.format_exc()
#!/usr/bin/python
import argparse
import traceback
import ih.imgproc
parser = argparse.ArgumentParser(description = "Smoothes an image based on a evenly distributed kernel.")
parser.add_argument("--input", dest="input", help="Path to input image.", required = True)
parser.add_argument("--roi", dest="roi", help="roi file")
parser.add_argument("--ystart", dest="ystart", help="Minimum Y of the roi.")
parser.add_argument("--yend", dest="yend", help="Maximum Y of the roi.")
parser.add_argument("--xstart", dest="xstart", help="Minimum X of the roi.")
parser.add_argument("--xend", dest="xend", help="Maximum X of the roi.")
parser.add_argument("--resize", default=False, dest="resize", action="store_true", help="Whether or not to actually resize the image.")
parser.add_argument("--outputdir", dest="outputdir", default=".", help="Path to write output files, if not specified use current directory.")
parser.add_argument("--output", default=None, dest="output", help="Name of output image to write, if not specified, use input image name.")
args = parser.parse_args()
try:
plant = ih.imgproc.Image(args.input, args.outputdir, args.output, False)
if args.roi:
plant.crop(args.roi, args.resize)
else:
plant.crop([args.ystart, args.yend, args.xtart, args.xend], args.resize)
plant.write()
except Exception as e:
print traceback.format_exc()
#!/usr/bin/python
import argparse
import traceback
import ih.statistics
import os
import json
parser = argparse.ArgumentParser(description = "Change input data format.")
parser.add_argument("--db", dest="db", help="Database to run statistics on.", required = True)
parser.add_argument("--dir", dest="dir", required = True, help="Folder to move files to.")
parser.add_argument("--type", dest="type", required = True, help="Type of translation. Should be one of [pcv, iap]")
parser.add_argument("--ids", dest="ids", nargs="+", default=None, help="List of ids to extract from db.")
parser.add_argument("--idfile", dest="idfile", default=None, help="Path to file containing list of ids.")
parser.add_argument("--imtypes", dest="imtypes", nargs="+", default=None, help="List of imtypes to extract from db.")
parser.add_argument("--imtypefile", dest="imtypefile", default=None, help="Path to file containing list of imtypes.")
parser.add_argument("--dates", dest="dates", nargs="+", default=None, help="List of dates to extract from db.")
parser.add_argument("--datefile", dest="datefile", default=None, help="Path to file containing list of dates.")
args = parser.parse_args()
try:
if args.idfile:
with open(args.idfile, "r") as rh:
ids = []
for line in rh.readlines():
ids.append(line.strip())
else:
ids = args.ids
if args.imtypefile:
with open(args.idfile, "r") as rh:
imtypes = []
for line in rh.readlines():
imtypes.append(line.strip())
else:
imtypes = args.imtypes
if args.datefile:
with open(args.datefile, "r") as rh:
dates = []
for line in rh.readlines():
dates.append(line.strip())
else:
dates = args.dates
stats = ih.statistics.Stats(args.db)
if args.type == "pcv":
stats.dataToPlantcv(args.dir, ids, imtypes, dates)
elif args.type == "iap":
stats.dataToIAP(args.dir, ids, imtypes, dates)
stats._closeConnection()
except Exception as e:
print traceback.format_exc()
\ No newline at end of file
#!/usr/bin/python
import argparse
import traceback
import ih.imgproc
parser = argparse.ArgumentParser(description = "Smoothes an image based on a evenly distributed kernel.")
parser.add_argument("--input", dest="input", help="Path to input image.", required = True)
parser.add_argument("--threshold1", dest="threshold1", type=int, help="Minimum threshold value.", required = True)
parser.add_argument("--threshold2", dest="threshold2", type=int, help="Maximum threshold value.", required = True)
parser.add_argument("--apertureSize", default = 3, dest="apertureSize", type=int, help="Aperture size for Sobel algorithm.")
parser.add_argument("--L2gradient", default = False, dest="L2gradient", action="store_true", help="Determines method to calculate gradient magnitutde.")
parser.add_argument("--outputdir", dest="outputdir", default=".", help="Path to write output files, if not specified use current directory.")
parser.add_argument("--output", default=None, dest="output", help="Name of output image to write, if not specified, use input image name.")
args = parser.parse_args()
try:
plant = ih.imgproc.Image(args.input, args.outputdir, args.output, False)
plant.edges(args.threshold1, args.threshold2, args.apertureSize, args.L2gradient)
plant.write()
except Exception as e:
print traceback.format_exc()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment