Skip to content

Instantly share code, notes, and snippets.

View agisga's full-sized avatar

Alexej Gossmann agisga

View GitHub Profile
@agisga
agisga / T1_brain_MRI_make_gif.R
Last active July 5, 2018 17:06
Make a GIF animation from a set of brain MRI DICOM images
# Copyright (c) 2018 Alexej Gossmann
# MIT License https://choosealicense.com/licenses/mit/
library(oro.dicom)
library(oro.nifti)
library(fslr)
library(R.matlab)
library(tidyverse)
library(gganimate)
library(doParallel)
@agisga
agisga / rank3_CPD.R
Last active September 23, 2017 16:58
library(dplyr)
library(tidyr)
library(ggplot2)
library(rTensor)
#--- generate data
# bell-shaped spacial component with different means
space_index <- seq(-1, 1, l = 100)
case1 <- matrix(rep(dnorm(space_index, mean = 0, sd = 0.3), 10), 100, 100)
# This code was used for the following blog post:
#
# http://www.alexejgossmann.com/email_data_analysis/
#
# All private information was replaced with **********
library(readr)
library(dplyr)
library(tidyr)
library(ggplot2)
# This code was used for the following blog post:
#
# http://www.alexejgossmann.com/email_data_analysis/
#
# Part of the code is based on: http://www.johnantony.com/sending-and-receiving-outlook-email-via-ruby/
# All private information (such as email addresses and passwords) was replaced with ***********
require 'mail'
require 'daru'
@agisga
agisga / ggvis_multiple_hypotheses_testing.R
Created November 30, 2016 19:58
An iteractive visualization comparing 6 methods for multiple test corrections
#---
#
# Copyright (C) 2016 Alexej Gossmann
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@agisga
agisga / benchmarking_nmatrix_solve_2.rb
Created December 24, 2015 13:02
fixes a mistake and improves on the previous benchmarking script
require 'benchmark'
require 'nmatrix'
puts "------------ Without nmatrix-lapacke -----------"
n = 1000
m = 100
puts "(A is #{n} x #{n}, B is #{n} x #{m})"