This is a bash script, as an example, on how to do click-testing GUI based on finding components based on how they look.
- opencv
- scrot
- findimage
- xdotool
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| # translate utility that utilize google translator, support python2 & python3 | |
| # Note that the order or arguments in the URL matters. | |
| try: | |
| from urllib import urlencode | |
| except: | |
| from urllib.parse import urlencode |
This is a bash script, as an example, on how to do click-testing GUI based on finding components based on how they look.
| import json, sys, numpy as np | |
| from scipy import misc, signal | |
| from PIL import Image | |
| infile, outfile, modelpath = sys.argv[1:] | |
| model = json.load(open(modelpath)) | |
| im = Image.open(infile).convert("YCbCr") | |
| im = misc.fromimage(im.resize((2*im.size[0], 2*im.size[1]), resample=Image.NEAREST)).astype("float32") | |
| planes = [np.pad(im[:,:,0], len(model), "edge") / 255.0] | |
| for step in model: | |
| o_planes = [sum([signal.convolve2d(ip, np.float32(kernel), "valid") |
| import os | |
| import argparse | |
| import nibabel as nib | |
| def build_argparser(): | |
| DESCRIPTION = "Convert tractograms (TRK -> TCK)." | |
| p = argparse.ArgumentParser(description=DESCRIPTION) | |
| p.add_argument('tractograms', metavar='bundle', nargs="+", help='list of tractograms.') | |
| p.add_argument('-f', '--force', action="store_true", help='overwrite existing output files.') |
| # Author: | |
| # Linwood Creekmore III | |
| # email: [email protected] | |
| # Acknowledgements: | |
| # http://programmingadvent.blogspot.com/2013/06/kmzkml-file-parsing-with-python.html | |
| # http://gis.stackexchange.com/questions/159681/geopandas-cant-save-geojson | |
| # https://gist.github.com/mciantyre/32ff2c2d5cd9515c1ee7 | |
| # -*- coding: utf-8 -*- | |
| ## Copyright (C) 2021 Valentin Lab | |
| ## | |
| ## Redistribution and use in source and binary forms, with or without | |
| ## modification, are permitted provided that the following conditions | |
| ## are met: | |
| ## | |
| ## 1. Redistributions of source code must retain the above copyright | |
| ## notice, this list of conditions and the following disclaimer. |
| // License: WTFPL | |
| <div id="loadingMask" style="width: 100%; height: 100%; position: fixed; background: #fff;"></div> | |
| <script> | |
| function fadeOut(el) { | |
| el.style.opacity = 1; | |
| var last = +new Date(); | |
| var tick = function() { | |
| el.style.opacity = +el.style.opacity - (new Date() - last) / 80; | |
| last = +new Date(); |
| <html> | |
| <head></head> | |
| <body> | |
| <p> | |
| <b>How to use this tool:</b> In Chrome, open Session Buddy. Click on the gear at the top-right, and select "Export". | |
| </p> | |
| <p> | |
| In the export dialog, select "JSON" as the export type, and be sure to select both "Sessions" and "Windows" in the "Show" options. | |
| </p> | |
| <p> |