Skip to content

Instantly share code, notes, and snippets.

function [solution,solution_image] = amazer(mz,p,q)
% Solve mazes using image processing!
% mz is a binary image of a maze (1s represent walls)
% p and q are the start and end points
% walls = bwmorph(mz,'dilate',2);
% walls = bwmorph(mz,'thicken',5);
walls = mz;
DA = bwdistgeodesic(~walls,p(1),p(2),'quasi-euclidean');
@asarnow
asarnow / ctf.py
Created March 23, 2019 19:50
Function for evaluating the CTF on a grid of spatial frequencies
def eval_ctf(s, a, def1, def2, angast=0, phase=0, kv=300, ac=0.1, cs=2.0, bf=0, lp=0):
"""
:param s: Precomputed frequency grid for CTF evaluation.
:param a: Precomputed frequency grid angles.
:param def1: 1st prinicipal underfocus distance (Å).
:param def2: 2nd principal underfocus distance (Å).
:param angast: Angle of astigmatism (deg) from x-axis to azimuth.
:param phase: Phase shift (deg).
:param kv: Microscope acceleration potential (kV).
:param ac: Amplitude contrast in [0, 1.0].
@asarnow
asarnow / SEP Script
Last active September 19, 2015 07:18 — forked from steve-jansen/README.md
Stop and start Symantec Endpoint Protection on OS X
This script enables you stop and start Symantec Endpoint Protection on OS X
## Installation
```
sudo curl https://gist.githubusercontent.com/steve-jansen/61a189b6ab961a517f68/raw/sep -o /usr/local/bin/sep
sudo chmod 755 /usr/local/bin/sep
sudo chown root:staff /usr/local/bin/sep
```