Skip to content

Instantly share code, notes, and snippets.

View videan42's full-sized avatar

David Joy videan42

View GitHub Profile
@videan42
videan42 / grr.py
Last active August 29, 2015 14:25
body = {}
if 'description' in req:
body['description'] = req['description']
if 'location' in req:
body['location'] = req['location']
for email in ['repEmail', 'clientEmail', 'sdrEmail']:
if req.get(email):
try:
from queue import Queue, Empty
except ImportError:
from Queue import Queue, Empty
from threading import Thread
import time
import random
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
#!/usr/bin/env python
import os
import subprocess
import numpy as np
from PIL import Image
import matplotlib.pyplot as plt
@videan42
videan42 / 0001_Makefile_Destdir.patch
Created December 21, 2013 18:26
Updated patch for AUR julia-git
--- julia/Makefile
+++ julia/Makefile
@@ -169,48 +169,48 @@ install:
@$(MAKE) $(QUIET_MAKE) release
@$(MAKE) $(QUIET_MAKE) debug
@for subdir in "bin" "libexec" $(JL_LIBDIR) $(JL_PRIVATE_LIBDIR) "share/julia" "share/man/man1" "include/julia" "share/julia/site/"$(VERSDIR) "etc/julia" ; do \
- mkdir -p $(PREFIX)/$$subdir ; \
+ mkdir -p $(DESTDIR)/$(PREFIX)/$$subdir ; \
done
- cp -a $(BUILD)/bin/julia* $(PREFIX)/bin/
@videan42
videan42 / gist:6211169
Last active December 20, 2015 23:19
Nifti1Image issue 182 test
diff --git a/nibabel/tests/test_nifti1.py b/nibabel/tests/test_nifti1.py
index b43f032..b315fd0 100644
--- a/nibabel/tests/test_nifti1.py
+++ b/nibabel/tests/test_nifti1.py
@@ -964,6 +964,25 @@ def test_affines_init():
assert_array_equal(new_hdr.get_zooms(), [3, 4, 5])
+def test_set_qform_and_sform_on_missing_header():
+ # Make sure the qform and sform get set if the header is missing
@videan42
videan42 / gist:6180429
Created August 8, 2013 00:46
pelican quickstart patch
diff --git a/pelican/tools/pelican_quickstart.py b/pelican/tools/pelican_quickstart.py
index 3f02355..0af7f8f 100755
--- a/pelican/tools/pelican_quickstart.py
+++ b/pelican/tools/pelican_quickstart.py
@@ -72,6 +72,41 @@ def get_template(name, as_encoding='utf-8'):
fd.close()
+def makedirs(dirpath):
+ try:
diff --git a/nibabel/nifti1.py b/nibabel/nifti1.py
index 79fec02..18f3bde 100644
--- a/nibabel/nifti1.py
+++ b/nibabel/nifti1.py
@@ -7,6 +7,29 @@
#
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
''' Header reading / writing functions for nifti1 image format
+
+Example