Skip to content

Instantly share code, notes, and snippets.

View pwighton's full-sized avatar

Paul Wighton pwighton

  • CorticoMetrics LLC
  • Chelsea MA
View GitHub Profile
@pwighton
pwighton / FreeSurfer-PetSurfer-by-example.md
Last active May 7, 2024 01:08
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)
  1. Description of the platform/product:
  • name and version of the software: FreeSurfer 6.0
  • free?: yes
  • commercial?: no
  • open source?: yes
  • what DICOM library do you use?: DCMQI to write DICOM-SEG
  • Description of the relevant features of the platform: Freesurfer's subcortical segmentation results can be converted to DICOM-SEG using fs-aseg.json that has been kindly provided by Emily Lindemer.
  • are both single and multiple segments supported?: Yes, however Freesurfer's subcortical segmentation process assumes a mutually exclusive label set.
  • do you support both BINARY and FRACTIONAL segmentation types? BINARY only.
  • do you support compressed objects? I beleive itkimage2
FROM amazonlinux:latest
# root does everything for now
# ---------------------------------------------------------------------
USER root
# For freesurfer
# ---------------------------------------------------------------------
# So that we can run `yum -y install git-lfs`
RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.rpm.sh | bash