Skip to content

Instantly share code, notes, and snippets.

View pwighton's full-sized avatar

Paul Wighton pwighton

View GitHub Profile
@pwighton
pwighton / jetstream2-gpu-config-freeview-ubuntu-24.04.bash
Created August 19, 2026 19:30
Configure a jetstream2 GPU instance for FreeView
#!/bin/bash
# provision-freeview-gpu.sh
# Configure a Jetstream2 GPU instance (g3.*, GRID A100X vGPU) for hardware-
# accelerated FreeView over the Exosphere web desktop (TurboVNC + Guacamole).
#
# What it does:
# 1. Installs VirtualGL — FreeView renders on the vGPU via EGL, VirtualGL
# reads frames back into the (CPU-driven) VNC X server.
# 2. Adds freeview/tkmeditfv aliases that route through vglrun. The
# __EGL_VENDOR_LIBRARY_FILENAMES pin is needed because Mesa's EGL vendor
@pwighton
pwighton / install-freesurfer-8.2.0-ubuntu-24.04.bash
Last active August 19, 2026 18:54
Install FreeSurfer 8.2.0 and all patches on an Ubuntu 24.04 machine
#!/usr/bin/env bash
#
# Install FreeSurfer 8.2.0 on Ubuntu 24.04
#
# Ported from:
# - https://github.com/pwighton/fs-docker/blob/master/freesurfer/Dockerfile.8.2.0
# See also:
# - https://surfer.nmr.mgh.harvard.edu/fswiki/rel7downloads/rel8notes
set -euo pipefail
@pwighton
pwighton / 20260304-freebrowse-status-update.md
Created March 4, 2026 00:07
FreeBrowse Status Update 2026/03/04

FreeBrowse Status Update

2026/03/04

New features since last update

  • 2 URL parameters:
    • ?nvd=<url>: Open the niivue document at the specified URL
    • ?vol=<url>: Open the volume at the specified URL
  • Initial support for Surfaces (WIP)
  • 4d volume support
  • UI element to manipulate label intent code
@pwighton
pwighton / FreeSurfer-PetSurfer-by-example.md
Last active September 14, 2025 03:35
Step by step example of running PetSurfer

[Free|Pet]Surfer by Example

Init FreeSurfer env

At the NIH

  • Connect to Biowulf via NoMachine
  • Launch a terminal on Biowulf
  • Run:
@pwighton
pwighton / print_dcm_tags.py
Created February 8, 2022 21:42
Print dicom tags example
#!/usr/bin/env python3
import argparse
import pydicom
parser = argparse.ArgumentParser(description='Parse command line options')
parser.add_argument('input_file')
args = parser.parse_args()
dcm = pydicom.dcmread(args.input_file)
@pwighton
pwighton / 20211021-build-samseg-atlas-for-dorit-on-nike-take4.md
Created January 27, 2022 19:31
Building a samseg atlas and including corpus callosum as a WM label

Trying to make the atlas for Dorit on Nike

  • On Nike
  • With same parameters as original samseg atlas
  • Using Koens trick stiffnes 1.0 -> 0.1 trick
  • Using edgeCollapseEncouragmentFactor.txt=1.025 on restart
  • Using full set of subjects
  1. ssh to nike
singularity run \
  --cleanenv \
  -B /autofs/cluster/gerenuk/pwighton/singularity-images/license.txt:/license.txt \
  -B /autofs/cluster/gerenuk/pwighton/fmriprep-singularity/ds003455:/data \
  --env FS_LICENSE='/license.txt' \
  /autofs/cluster/gerenuk/pwighton/singularity-images/fmriprep-20.2.0rc2.simg \
    /data \
    /data/derivatives2 \
 participant \
@pwighton
pwighton / socket2file.py
Last active July 22, 2021 17:25
Reads from a socket and writes to file
#!/usr/bin/env python3
import argparse
import socket
import traceback
parser = argparse.ArgumentParser(description="Parse command line options")
parser.add_argument("port")
parser.add_argument("outfile")
args = parser.parse_args()
@pwighton
pwighton / 20200701-lcn-open-source-qms.md
Created July 1, 2020 17:34
An open Source QMS to facilitate translational research

An open Source QMS to facilitate translational research

Background: Cmet

  • CorticoMetrics is working to bring FreeSurfer to the clinic
  • To be used in the clinic, it needs to be FDA approved as a "Class II medical device"
  • A Medical device must be developed under a QMS (Quality Management System)
  • A QMS is a set of business processes and records that must be adhered to
    • "Design Review"
  • "Validation"
@pwighton
pwighton / 20200304-fs6-install-caltech.md
Last active March 5, 2020 23:02
Notes on how to install FreeSurfer 6.0 so that every command used during the course tutorials can be run.

FreeSurfer 6.0 Installation Notes

Notes on how to install FreeSurfer 6.0 so that every command used during the course tutorials can be run. This fills in some missing details documented here

Download and install

  • Follow instructions here to download and install FreeSurfer
  • Download tutorial data from here and extract
  • Patch FreeView (scroll to bottom of page)