Skip to content

Instantly share code, notes, and snippets.

@nicholst
nicholst / Proto_wRefs.qmd
Last active February 14, 2026 09:20
Prototype Quarto document with references
---
title: "Quarto Proto Doc"
author:
- name: Y.R. Name
orcid: XXXX-XXXX-XXXX-XXXX
email: yr.name@yr.inst.edu
affiliation:
- name: University of Universities
date: last-modified
bibliography: Proto_wRefs.bib
@article{spearmanProofMeasurementAssociation1904,
title = {The {{Proof}} and {{Measurement}} of {{Association}} between {{Two Things}}},
author = {Spearman, C.},
year = {1904},
month = jan,
journal = {The American Journal of Psychology},
volume = {15},
number = {1},
eprint = {1412159},
eprinttype = {jstor},
@nicholst
nicholst / Proto.qmd
Last active February 13, 2026 17:39
Prototype Quarto document
---
title: "Quarto Proto Doc"
author:
- name: Y.R. Name
orcid: XXXX-XXXX-XXXX-XXXX
email: yr.name@yr.inst.edu
affiliation:
- name: University of Universities
date: last-modified
toc: true
@nicholst
nicholst / FSLeyes-ModulatedEffectsizeDemo.sh
Last active July 3, 2023 20:31
FSLeyes demonstration code for significance-modulated effect size overlay
#!/bin/bash
#
# 1st level, subject-space, FSL-stlye naming
#
AnatImg=highres2example_func
EffectImg=cope1
StatImg=zstat1
@nicholst
nicholst / LME-FE-RE-confounding.R
Created May 15, 2023 18:15
Script to characterise performance of lme4's lmer under total confounding of fixed and random effects
library(lme4)
N=100
K=10
rho=0.8
Yiid = rnorm(N*K)
Subj = factor(rep(1:N,each=K))
Ycs = Yiid;
Y0 = rnorm(N)
for (i in 1:N)
@nicholst
nicholst / snpm.m
Created August 31, 2018 15:40
snpm.m - from SnPM10, circa Feb 2011 (before SnPM13, when separate GUI window was removed)
function varargout=snpm(Action)
% SnPM: nonParametric statistical analysis toolbox for SPM
%_______________________________________________________________________
% ___ ____ __ __
% / __) ___ ( _ \( \/ ) Statistical nonParametric Mapping toolbox
% \__ \( _ ) )___/ ) ( The Wellcome Department of Cognitive Neurology
% (___/(_)_)(__) (_/\/\_) SnPM8
%_______________________________________________________________________
%
% This is SnPM8, the beta release of the nonParametric toolbox for SPM
@nicholst
nicholst / 2D_expectedEC.m
Last active May 19, 2018 13:22
2D_expectedEC.m
mySizeX=100;
mySizeY=100;
myNumOfRealizations=500;
mySmoothRandomFields = zeros(mySizeX,mySizeY,myNumOfRealizations);
%%% Sam: Insert your smoothing RF sim code here... return a 3D image,
%%% each 2D slice smoothed according to desired FWHM, slices independent,
%%% for different realisations
mySmoothRandomFields = %<BLAH>%
@nicholst
nicholst / 2D_expectedEC.cpp
Created May 4, 2018 21:55
2D_expectedEC.cpp
/**************************************************************************************
* *
**************************************************************************************/
bool
EulerCharacteristics2D::computeFieldDerivatives ()
{
try
{
// NULL conditions
if (myRandomFields == NULL || myNumOfRealizations <= 0 || myRealizationSize <= 0) throw "myRandomFields not allocated";