Skip to content

Instantly share code, notes, and snippets.

# -*- coding: utf-8 -*-
# <nbformat>3</nbformat>
# <codecell>
import argparse
import os
from surfer import Brain
import scipy.io as sio
#!/bin/bash
# Commands are from AFNI
# Example is presented on monkey M12
# 1. Convert .nii.gz to afni format (will create M12+orig.BRIK and M12+orig.HEAD)
3dcopy M12_N3Corrected_calc_norm_reorient_iso_bound_mems_cortex_ace_gwb_ctr.nii.gz M12
# 2. Copy new vol into new subject directory
@margulies
margulies / color_surface_model
Last active December 13, 2015 18:08
Making colored surfaces for 3D models
http://i.materialise.com/
Example: http://bit.ly/14UlEXS
Also should work for blender
Open freesurfer file in caret.
Save as .wrl file using caret.
Open .wrl file
scroll to bottom of file.
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
font: 10px sans-serif;
}
.chord path {
fill-opacity: .67;
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
font: 10px sans-serif;
}
.bar rect {
fill: steelblue;
<html>
<head>
<title>Interactive Line Graph</title>
<script src="http://d3js.org/d3.v2.js"></script>
<!--
using JQuery for element dimensions
This is a small aspect of this example so it can be removed fairly easily if needed.
-->
<script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script src="sample_data.js"></script>
@margulies
margulies / index.html
Last active December 15, 2015 21:09 — forked from nrabinowitz/index.html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Histogram</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.v2.min.js"></script>
<style type="text/css">
body {
margin: 3em;
}
@margulies
margulies / wos.php
Created April 6, 2013 17:59 — forked from pol/wos.php
<?php
$auth_url = "http://search.isiknowledge.com/esti/wokmws/ws/WOKMWSAuthenticate?wsdl";
$auth_client = @new SoapClient($auth_url);
$auth_response = $auth_client->authenticate();
print_r($auth_response);
echo "REQUEST HEADERS:\n" . $auth_client->__getLastRequestHeaders() . "\n";
$search_url = "http://search.isiknowledge.com/esti/wokmws/ws/WokSearchLite?wsdl";
@margulies
margulies / wos.php
Created April 6, 2013 18:02 — forked from pol/wos.php
<?php
$auth_url = "http://search.isiknowledge.com/esti/wokmws/ws/WOKMWSAuthenticate?wsdl";
$auth_client = @new SoapClient($auth_url);
$auth_response = $auth_client->authenticate();
print_r($auth_response);
echo "REQUEST HEADERS:\n" . $auth_client->__getLastRequestHeaders() . "\n";
$search_url = "http://search.isiknowledge.com/esti/wokmws/ws/WokSearchLite?wsdl";
d3.csv("data/gates_money.csv", function(data) {
custom_bubble_chart.init(data);
custom_bubble_chart.toggle_view('all');
});
$(document).ready(function() {
$('#view_selection a').click(function() {
var view_type = $(this).attr('id');
$('#view_selection a').removeClass('active');
$(this).toggleClass('active');