This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% use anonymous function to wrap Matlab plot3. Pass on options as per plot3 | |
myPlot3 = @(P,varargin) plot3(P(:,1), P(:,2), P(:,3), varargin{:}); | |
% e.g. make a noisy spiral | |
t = transpose( linspace(0, 2.*pi, 100) ); | |
X =[sin(2.*t), cos(2.*t)+rand(size(t)), t] | |
% plot | |
figure | |
myPlot3(X, '.-', 'color', 'r', 'linewidth', 2) | |
axis vis3d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# downloading pubmed data into json files | |
# | |
# used curl --help and stackoverflow for inspiration. also check out the posts here: | |
# http://superuser.com/questions/149329/what-is-the-curl-command-line-syntax-to-do-a-post-request | |
# define some variables - change as appropriate | |
author="schluppeck-d" | |
# pubmed search cgi is located here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pmid2bibtex.rb | |
# convert a PubMed PMID to BibTeX citation format | |
# updated version of http://chrisamiller.com/science/2010/12/13/using-bioruby-to-fetch-citations-from-pubmed/ | |
# works as of 2015-03-18 | |
require 'bio' | |
Bio::NCBI.default_email = "me@me.com" # required for EUtils | |
id = "18265351" | |
pm = Bio::PubMed::efetch(id) # array of MEDLINE-formatted string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function [ fHandle ] = jneurosci(fHandle, colWidth) | |
%jneurosci - provide some defaults for figures to get to JNeurosci style | |
% | |
% usage: [ fHandle ] = jneurosci( fHandle ) | |
% by: lpzds1 | |
% date: May 28, 2015 | |
% | |
% inputs: fHandle, colWidth [1, 1.5, 2] | |
% outputs: fHandle | |
% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# example of how to use a simple BASH loop w/ FSL to traverse | |
# directories and create summary images of rendered_thresh_zstat?.hdr | |
# in a nice way | |
# input 1 is folder name | |
if [[ ! -d $1 ]]; then | |
echo "(uhoh) directory $1 does not exist" | |
echo " usage:" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% spectrovis.m | |
% | |
% $Id: spectrovis.m 1022 2012-08-07 10:29:58Z svnuser $ | |
% usage: spectrovis(varargin) | |
% by: denis schluppeck based on mglRetinotopy by justin gardner | |
% date: 2010-06-06 | |
% | |
% purpose: Displays a retinotopy stimulus, there are many | |
% parameters you can set, you can set as many | |
% or as few as you like. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% make random coordinates on [0..1] | |
xy = rand(50,2) | |
% plot them with scatter | |
figure, scatter(xy(:,1), xy(:,2)) | |
% get convex hull of cloud + plot | |
k = convhull(xy(:,1), xy(:,2)) | |
hold on | |
plot(xy(k,1), xy(k,2), 'r-') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function [ ] = rmText(f_) | |
%rmText - remove text objects from a figure | |
% | |
% usage: [ ] = rmText( f_ ) | |
% by: lpzds1, Denis Schluppeck | |
% date: Aug 20, 2015 | |
% inputs: f_ | |
% outputs: | |
% | |
% purpose: matlab figure exporting is a bit of a pain, so sometime one |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# | |
# creating a table that contains a given term week (2,3,4...) | |
# and the corresponding dates. using bash / unix. e.g. | |
# Week 2 - Wed 30 Sep 2015 | |
# Week 3 - Wed 7 Oct 2015 | |
# Week 4 - Wed 14 Oct 2015 | |
# Week 5 - Wed 21 Oct 2015 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function [dip,xl,xu, ifault, gcm, lcm, mn, mj] = HartigansDipTest(xpdf) | |
% function [dip,xl,xu, ifault, gcm, lcm, mn, mj]=HartigansDipTest(xpdf) | |
% | |
% This is a direct translation by F. Mechler (August 27 2002) | |
% into MATLAB from the original FORTRAN code of Hartigan's Subroutine DIPTST algorithm | |
% Ref: Algorithm AS 217 APPL. STATIST. (1985) Vol. 34. No.3 pg 322-325 | |
% | |
% Appended by F. Mechler (September 2 2002) to deal with a perfectly unimodal input | |
% This check the original Hartigan algorithm omitted, which leads to an infinite cycle |
OlderNewer