Skip to content

Instantly share code, notes, and snippets.

View schluppeck's full-sized avatar

Denis Schluppeck schluppeck

View GitHub Profile
@schluppeck
schluppeck / roses.jl
Created May 28, 2024 21:21
Mathematical roses in a Pluto.jl notebook
### A Pluto.jl notebook ###
# v0.19.40
using Markdown
using InteractiveUtils
# This Pluto notebook uses @bind for interactivity. When running this notebook outside of Pluto, the following 'mock version' of @bind gives bound variables a default value (instead of an error).
macro bind(def, element)
quote
local iv = try Base.loaded_modules[Base.PkgId(Base.UUID("6e696c72-6542-2067-7265-42206c756150"), "AbstractPlutoDingetjes")].Bonds.initial_value catch; b -> missing; end
@schluppeck
schluppeck / Readme.md
Created February 6, 2024 11:18
convert DOC to DOCX in the command line

Leverage libreoffice to do this job.

Might have to install libreoffice - on macos using brew one way to do this is:

brew install  libreoffice-language-pack --cask libreoffice`

Key idea: use soffice --headless

@schluppeck
schluppeck / index.md
Created December 6, 2023 10:00
Data and Materials for PCN lab (UoN, 2022-23)

Data and spreadsheet

The 2nd year lab for the Psychology and Cognitive Neuroscience course (University of Nottingham) walks students through the main ideas behind the use of linear regression in the analysis of functional magnetic resonance imagingn (fMRI) data.

The instructor provides three selected, indicative timeseries samples from a 4d data set.

The data were acquired in a standard faces versus objects, category localiser experiment. For details, [see this FAQ document](https://schluppeck.github.io/PCN-Y2-questions/#what-were-the-stimuli

Data files:

@schluppeck
schluppeck / notes.md
Last active July 24, 2023 17:43
converting DCM to nifti

Conversion notes

Denis Schluppeck, 2023-07-21

Converting GE data via XNAT at SPMIC/Psychology. Trying to find a consistent workflow for Psychology users, especially for fMRI and related.

things to consider

  • voxel sizes 2mm isotropic to 2.5mm or even 3mm? SNR gains, data size
  • dummies. GE protocol includes data even before steady-state is reached. Therefore need to cut this by hand? Principled way of doing this in pre-processing in mrTools?
@schluppeck
schluppeck / Readme.md
Last active November 7, 2022 19:47
Matlab code for regression example from PSGY4009 class

script example from PSGY4009 / lecture 6

denis schluppeck, 2022-11-07

Make sure you have access to data. I used the following dataset / files for the demos here:

https://github.com/schluppeck/hands-on-brain-data

Download the data (click the green button, download ZIP, unzip). Or if you know how to use git/github, you can also clone the repo

@schluppeck
schluppeck / tiledStuff.m
Last active July 22, 2022 17:09
tiled layout with new matlab functions
%% example of tiled plots with shared axes and labels
%
% ds 2022-07-22
figure()
nRows = 4;
nCols = 4;
t = tiledlayout(nRows,nCols,'TileSpacing','Compact');
@schluppeck
schluppeck / find_julia_packages.md
Created March 22, 2022 22:34
find julia packages in a list of Pluto notebooks or jl files

situation

need to quickly find out which packages a set of julia files are using. in my case, this was to create an environment after the fact... so I can ship it to people who have a clean install.

quick hack: grep through .jl files and find bits of text that start with "using"

not perfect, but got me 90% of the way there

grep "^\W*using" *.jl | cut -d: -f2 | sed s/using// | tr -d "[:blank:]" | sort | uniq
@schluppeck
schluppeck / Readme.md
Last active March 24, 2021 12:31
bash looping with regexp

some ideas for looping over dirs, files w/ bash

setup some folders and files

need to have files and folders to play with. here all size 0 files, adapt to your own needs...

# create a directory and go there
cd ~
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 \