I hereby claim:
- I am bbarad on github.
- I am bbarad (https://keybase.io/bbarad) on keybase.
- I have a public key whose fingerprint is 15F1 05DC C3D0 E590 8B2E DA2B ABE8 2F5A C18E 2902
To claim this, I am signing this object:
# Must have already entered dev mode to use this shell script from a crosh shell. | |
wget -O ~/Downloads/crouton http://goo.gl/fd3zc | |
sudo sh -e ~/Downloads/crouton -t x11,audio,keyboard,extension -n i3precise | |
# This takes 15-20 minutes. | |
sudo enter-chroot -n i3precise |
I hereby claim:
To claim this, I am signing this object:
javascript:!function(){ | |
if(window.location.href.indexOf("user=")>-1) | |
{window.location.href=window.location.href+'&sortby=pubdate';} | |
else if(window.location.href.indexOf("&q=")>-1) | |
{window.location.href=window.location.href+'&scisbd=1';} | |
}(); |
import parse | |
import trace | |
filename_list = ["test_1.tpkl", "test_2.tpkl"] | |
for filename in filename_list: | |
trace = parse.parse(filename) | |
new_name = "{}.dat".format(filename[:-5]) | |
trace.write_dat(new_name) |
import imageio | |
import mrcfile | |
import os | |
import sys | |
def make_photos(basename, working_directory="."): | |
""" | |
Convert MRC file with stack of classes to series of scaled PNGs for web viewing. | |
Args: | |
basename (str): name of desired folder within class_images - usually the same name as the mrc file. |
""" | |
Script to convert eman2 segmentation hdf maps to imod model files at a user defined contour level. | |
Requires python>=3.5 as well as having Eman2 and IMOD in the path. | |
Usage: `python3 tomoseg_to_imod.py -i EXAMPLE.hdf -o EXAMPLE.mod -t 0.8` | |
Author: Benjamin Barad <[email protected]> | |
""" | |
import argparse |
from autoscript_sdb_microscope_client import SdbMicroscopeClient | |
import time | |
ip_address = '192.168.0.1' # depends on system setup | |
open_time = 1.5 # seconds | |
microscope = SdbMicroscopeClient() | |
microscope.connect(ip_address) | |
gis_port = microscope.gas.get_gis_port("Pt dep") | |
print(gis_port.get_temperature()) | |
gis_port.open() | |
time.sleep(open_time) |
# Adjust angles from imod alignment before warp import to allow flattening of tomograms | |
# Replaces imod's taSolution.log file with adjusted deltlts, while preserving the original file in taSolution.log.bak | |
# Author: Benjamin Barad 2022 | |
# Usage: | |
# cd WARPTOPFOLDER/imod | |
# python adjust_angles.py * | |
# Alternatively, instead of the wildcard individual tilt series folders can be specified. | |
import pandas as pd |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# Adapted by Benjamin Barad ([email protected]) from code by Digvijay Singh ([email protected]) | |
# Run in an mdocs folder, makes an "Adjusted_mdoc" subfolder with corrected angles, which allows more flexibility for | |
# which program is used for tilt series alignment while guaranteeing a flat tomogram. I use it with etomo and warp primarily. | |
# Instead of identifying the "0" tilt based on transmission, you do it based on a predetermined milling angle. | |
# This has benefits and disadvantages, and is particularly useful if knowing absolute orientation is useful for future | |
# analysis. |
# Author: Benjamin Barad | |
# A quick script to erode the masks generated by warp to more tightly surround frost and beads | |
# Warp's neural net masking can be used to quickly remove gold beads and hunks of frost from tomograms. | |
# However, it tends to overmask and generate a nice big blob around each bead. This is desirable for | |
# limiting particle picking, but not for tomogram generation. This script erodes the mask to more tightly | |
# surround the frost and beads. | |
# Usage: | |
# 1. Run warp and generate masks for your tomograms with boxnet3mask | |
# 2. Close warp and rename the warp "mask" folder to "mask_raw" | |
# 3. Run this script as follows: |