Skip to content

Instantly share code, notes, and snippets.

View FredLoney's full-sized avatar

Fred Loney FredLoney

  • Oregon Health & Sciences University
  • Portland, OR
View GitHub Profile
@FredLoney
FredLoney / lndicom.py
Created September 25, 2013 00:20
Creates links to DICOM files.
#!/usr/bin/env python
"""Creates links to DICOM files."""
import sys
import os
import argparse
import dicom
from dicom.filereader import InvalidDicomError
@FredLoney
FredLoney / logging_helper.py
Last active April 24, 2024 17:07
Prints the current stack to a logger.
import inspect
import logging
HEADER_FMT = "Call stack at %s, line %d in function %s, frames %d to %d of %d:"
"""The log header message formatter."""
STACK_FMT = "%s, line %d in function %s."
"""The log stack message formatter."""
def log_stack(logger=None, limit=None, start=0):