Skip to content

Instantly share code, notes, and snippets.

View schluppeck's full-sized avatar

Denis Schluppeck schluppeck

View GitHub Profile
Time (volumes) fMRI response (% signal change)
0.00000000 -1.40227509
1.00000000 0.23600006
2.00000000 1.15530396
3.00000000 0.13700867
4.00000000 -0.52494049
5.00000000 0.38183594
6.00000000 -0.29989624
7.00000000 0.76611328
8.00000000 -2.88539886
@schluppeck
schluppeck / Pluto-with-julia-docker.md
Created September 4, 2020 14:14
running pluto.jl in a docker container

What's this?

  • assuming macos / linux but may work in Windows Terminal, too, if you have Docker Desktop installed
cd ~/julia
# run container / default UID / GID
docker run -it --rm  \
  -p 1234:1234 \
 --user 1000:1000 \
@schluppeck
schluppeck / Readme.md
Last active August 18, 2020 20:39
extract image features from pre-processed text images

Outline

Use morphological operations to turn a pixel based image of text into geometric information (x,y locations), sizes, etc. to allow direct comparison

Pre-requisites

I used rstats, RStudio and some cran and Bioconductor libraries. Check code.

Steps

@schluppeck
schluppeck / index.html
Created March 22, 2020 22:30
leaflet map (visit via bl.ocks.org)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>leaflet</title>
<script>(function() {
// If window.HTMLWidgets is already defined, then use it; otherwise create a
// new object. This allows preceding code to set options that affect the
// initialization process (though none currently exist).
window.HTMLWidgets = window.HTMLWidgets || {};
@schluppeck
schluppeck / diff.html
Created March 16, 2020 10:13
rendering git diff in color to HTML
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- This file was created with the aha Ansi HTML Adapter. https://github.com/theZiz/aha -->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="application/xml+xhtml; charset=UTF-8" />
<title>stdin</title>
</head>
<body>
<pre>
@schluppeck
schluppeck / loop_tree.sh
Created March 11, 2020 12:37
show directory changes with tree command
# in a directory with bla.feat folder present
# might have to brew install tree on macos first
while true;
do
clear
tree -L 1 bla.feat
sleep 3
done
@schluppeck
schluppeck / file_renaming.sh
Last active January 9, 2020 20:22
using a bash look and awk to rename some badly formed file names
# dealing with OneDrive filesep issues...
#
# ds 2020-06-09, coffee break unix hacking.
# shell loop for moving files with windows sep \ into folders with filesep /
# for example: files called Carblblblabl\ACTUAL_FILE.jpg
# should go into folder Carblblblabl/ACTUAL_FILE.jpg
# idea. use AWK with field sep \ to split into two strings.
@schluppeck
schluppeck / completeAnalysis.m
Last active December 3, 2019 18:25
looping over all the voxels in a dataset and calculating t-stats (fMRI)
%% demo of a complete analysis of the faces v houses
% data
%
% ds 2019-12-03
%% load the data (nifti file)
data = niftiread('filtered_func_data.nii');
%% load the design matrix
%% FFTDEMO_HRF (adapted from FFTDEMO in Matlab)
% FFT for Spectral Analysis
% This example shows the use of the FFT function for spectral analysis. A
% common use of FFT's is to find the frequency components of a signal buried in
% a noisy time domain signal.
%
% Copyright 1984-2005 The MathWorks, Inc.
% $Revision: 5.8.4.2 $ $Date: 2009/04/03 21:23:24 $
function fftdemo_hrf()
@schluppeck
schluppeck / returnSlice.m
Created November 12, 2019 18:02
2019 solution to the returnSlice() matlab problem
function s = returnSlice(array, sliceNum, orientation)
% returnSlice - return a 2d slice from a 3d array in given orientation
%
% ds, 2019-11-05, for matlab class
% add some reality check about sizes... just in case
% potential problem: user can ask for sliceNum that goes beyond size of
% array
% find out sizes of the data cube