Skip to content

Instantly share code, notes, and snippets.

View ClePol's full-sized avatar
🐍

Clemens Pollak ClePol

🐍
View GitHub Profile
import argparse
import subprocess
import time
import sys
import select
import threading
import os
import errno
import shlex
import datetime
@ClePol
ClePol / extract_DICOM_timestamps.py
Last active July 28, 2021 14:06
Extract timestamps and registration metadata from fMRI & diffusion DICOMS
import os
import argparse
import pydicom
import numpy as np
@ClePol
ClePol / FSfromPython.py
Created June 5, 2020 12:35
How to run freesurfer inside a python script
import shlex
import subprocess
import sys
def which(program):
def is_exe(fpath):
return os.path.isfile(fpath) and os.access(fpath, os.X_OK)
fpath, fname = os.path.split(program)
if fpath:
if is_exe(program):