Skip to content

Instantly share code, notes, and snippets.

View icaoberg's full-sized avatar
:bowtie:
Coding…

icaoberg icaoberg

:bowtie:
Coding…
View GitHub Profile
@icaoberg
icaoberg / isuser.sh
Created May 25, 2013 19:34
[OMERO.server][OMERO.searcher] Check if a user exists in the OMERO.server
#!/bin/bash
if [ "$#" -ne 1 ]; then
echo "Usage: $0 <username>" >&2
exit 1
fi
USERNAME=$1
TEMP=`omero user list | grep "$USERNAME"`
if [ -z "$TEMP" ]; then echo false; else echo true; fi
@icaoberg
icaoberg / isgroup.sh
Last active December 17, 2015 18:08
[OMERO.server][OMERO.searcher] Check if a group exists in the OMERO.server
#!/bin/bash
if [ "$#" -ne 1 ]; then
echo "Usage: $0 <groupname>" >&2
exit 1
fi
GROUPNAME=$1
TEMP=`omero group list | grep "$GROUPNAME"`
if [ -z "$TEMP" ]; then echo false; else echo true; fi
@icaoberg
icaoberg / mayavi_install.sh
Last active May 28, 2017 06:02
[Python] Install Mayavi in Ubuntu
#!/bin/bash
sudo apt-get install python-vtk python-wxgtk2.6 python-setuptools python-numpy python-configobj
sudo easy_install pip
sudo pip install mayavi
@icaoberg
icaoberg / list_all_queues.sh
Created June 7, 2013 20:14
[PBS] List all queues
pbs -Q
@icaoberg
icaoberg / rename.sh
Created July 16, 2013 04:30
[BASH] Rename all files in the current folder using a universally unique identifier (UUID)
#!/bin/bash
for FILE in *
do
if [ -f "$FILE" ];then
ID=`uuidgen`
EXTENSION=${FILE#*.}
mv -v "$FILE" "$ID"."$EXTENSION"
fi
done
@icaoberg
icaoberg / sphinx_docs_strings_example.py
Created July 29, 2013 11:21
[sphinx] Sphinxy docstrings example
#the docstrings for the method calculate from pyslid
def calculate( conn, iid, scale=1, set="slf33", field=True, rid=None, pixels=0, channels=[], zslice=0, timepoint=0, threshold=None, debug=False ):
'''
Calculates and returns a feature ids vector, a feature vector and the output scale given a valid
image identification (iid). It currently can calculate SLF33, SLF34, SLF35 and SLF36.
This method will try to retrieve the resolution of the image from the annotations.
If the method is unable to connect to the OMERO.server, then the method will return None.
@icaoberg
icaoberg / im2projection.m
Created October 1, 2013 18:46
[Matlab] im2projection: creates a sum or mean projection of the input image.
function out_img = img2projection( img, param )
% IM2GPROJECTION creates a sum or mean projection of the input image
%
% Input:
% img = a 3D binary or realvalued image.
% param = struct with a 'method' field that can be set
% to 'mean' if a mean value projection is desired
% Output:
% out_img = a 2D image that contains a projection
% in each dimension of the original image
@icaoberg
icaoberg / gitmovie.sh
Last active December 28, 2015 03:19
Version control visualization using gource
#!/bin/bash
#COMMENT: I used brew to install gource and ffmpeg in MacOSX
#To install brew and the two packages in terminal run
#ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
#brew install gource
#brew install ffmpeg
OUTPUT=$1
@icaoberg
icaoberg / pyslid.sh
Created November 12, 2013 20:35
gource script to generate movie for pyslid
#!/bin/bash
gource --hide dirnames,usernames --title "Protein Subcellular Location Image Database for Python" --seconds-per-day 1 --auto-skip-seconds 1 -1280x720 -o - | ffmpeg -y -r 60 -f image2pipe -vcodec ppm -i - -vcodec libx264 -preset ultrafast -pix_fmt yuv420p -crf 1 -threads 0 -bf 0 ./pyslid.mp4
@icaoberg
icaoberg / install.sh
Created November 21, 2013 04:07
Compiling libsvm in the Lane Center cluster
#!/bin/bash
git clone [email protected]:cjlin1/libsvm.git
cd libsvm
make