Skip to content

Instantly share code, notes, and snippets.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
diff --git a/src/gui/mrview/gui_image.cpp b/src/gui/mrview/gui_image.cpp
index 5b63138..fa21df2 100644
--- a/src/gui/mrview/gui_image.cpp
+++ b/src/gui/mrview/gui_image.cpp
@@ -287,7 +287,8 @@ namespace MR
slice_max[plane] = slice_min[plane] - 1.0;
min_max_set();
- if (windowing_reset_required)
+ // hack to autoscale images to correct range
@maxpietsch
maxpietsch / # python3 - 2017-08-07_11-01-19.txt
Created August 11, 2017 21:26
python3 on macOS 10.12.6 - Homebrew build logs
Homebrew build logs for python3 on macOS 10.12.6
Build date: 2017-08-07 11:01:19
@maxpietsch
maxpietsch / draw_neural_net.py
Created November 1, 2017 18:53 — forked from craffel/draw_neural_net.py
Draw a neural network diagram with matplotlib!
import matplotlib.pyplot as plt
def draw_neural_net(ax, left, right, bottom, top, layer_sizes):
'''
Draw a neural network cartoon using matplotilb.
:usage:
>>> fig = plt.figure(figsize=(12, 12))
>>> draw_neural_net(fig.gca(), .1, .9, .1, .9, [4, 7, 2])
@maxpietsch
maxpietsch / fashion_mnist_cnn.py
Created April 8, 2018 20:41 — forked from kashif/fashion_mnist_cnn.py
Fashion Mnist Benchmark
'''Trains a simple convnet on the Zalando MNIST dataset.
Gets to 81.03% test accuracy after 30 epochs
(there is still a lot of margin for parameter tuning).
3 seconds per epoch on a GeForce GTX 980 GPU with CuDNN 5.
'''
from __future__ import print_function
import numpy as np
from mnist import MNIST
This file has been truncated, but you can view the full file.
@maxpietsch
maxpietsch / add_mrview_app.sh
Created June 25, 2019 08:34
macos mrview as applicatio
#!/usr/bin/env bash
APP=mrview
mkdir -vp ${APP}.app/Contents/MacOS ${APP}.app/Contents/Resources
PATH="$PATH:/usr/libexec" # PlistBuddy in PATH
printf '#!/usr/bin/osascript\ntell application "Terminal"\n\tactivate\n\tdo script "mrview; exit"\nend tell\n' > ${APP}.app/Contents/MacOS/${APP}
chmod +x ${APP}.app/Contents/MacOS/${APP}
PlistBuddy ${APP}.app/Contents/Info.plist -c "add CFBundleDisplayName string ${APP}"
PlistBuddy ${APP}.app/Contents/version.plist -c "add ProjectName string ${APP}"
@maxpietsch
maxpietsch / vectorreorient.cpp
Created July 3, 2020 15:39
reorient vector field after transformation
/* Copyright (c) 2008-2020 the MRtrix3 contributors.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* Covered Software is provided under this License on an "as is"
* basis, without warranty of any kind, either expressed, implied, or
* statutory, including, without limitation, warranties that the
* Covered Software is free of defects, merchantable, fit for a
#!/usr/bin/env python3
# tool to visualise angular and l=0 dependency of multiple MRtrix3 response functions
# Author: Maximilian Pietsch
import argparse
import numpy as np
from scipy.special import sph_harm
import matplotlib.pyplot as plt
@maxpietsch
maxpietsch / dwiqc.py
Last active October 13, 2020 15:43
generate screenshots for QC report
#!/usr/bin/env python
#
# generate screenshots for QC report
#
#
# Author: Max Pietsch
# King's College London
# maximilian.pietsch@kcl.ac.uk
#