Skip to content

Instantly share code, notes, and snippets.

@thewtex
thewtex / gist:502857
Created August 1, 2010 02:13
tmux.conf
We couldn’t find that file to show.
@thewtex
thewtex / ImageViewer.cxx
Created September 27, 2010 02:16
colormap min/max FLTK ImageViewer
/*=========================================================================
Program: Insight Segmentation & Registration Toolkit
Module: $RCSfile: ImageViewer.cxx,v $
Language: C++
Date: $Date: 2008-05-10 19:56:09 $
Version: $Revision: 1.4 $
Copyright (c) 2002 Insight Consortium. All rights reserved.
See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
....
void VTKImageIO2::StripSymmetricTensorBinaryBufferSymmetry( const void *fullBuffer,
void *strippedBuffer,
StreamingImageIOBase::SizeType num )
{
std::streamsize bytesRemaining = num;
const SizeType componentSize = this->GetComponentSize();
SizeType pixelSize = componentSize * 6;
char zero[1024];
@thewtex
thewtex / add-reviewers.py
Created November 12, 2010 13:43
Add authors of the files that were changed as reviewers to a Gerrit submission.
#!/usr/bin/env python
info = """Add reviewers to a Gerrit change.
Authors of files that were edited are nominated as potential reviewers.
*Caveats*
- Should be executed from the root of the repository.
- Should be executed while checked out on the topic branch to be pushed to
@thewtex
thewtex / issue-password.py
Created May 3, 2011 21:18
keyboard-interactive automatic password submission
#!/usr/bin/env python
# automatically give password to scripts that use ssh/scp and do not have public
# key authentification available.
PASSWORD = 'abc123'
import pexpect
import sys
@thewtex
thewtex / rename_files_and_modules.py
Created December 14, 2011 01:58
itk registration name refactoring rename files and modules
#!/usr/bin/env python
import csv
import os
import sys
import subprocess
if len(sys.argv) < 2:
print('input class name CSV file')
sys.exit(1)
@thewtex
thewtex / fix_file_content.sh
Created December 14, 2011 02:32
itk registration name refactoring fix file content
#!/bin/sh
if test $# -lt 1; then
echo 'input old to new csv file'
exit 1
fi
sed -e 's%^%s/%' -e 's%,%/%' -e 's%$%/g%' < "$1" > sed_script
find CMake Documentation CMakeLists.txt Examples Modules Testing Utilities Wrapping \
@thewtex
thewtex / itkImageIOFactoryRegisterManager.h
Created December 5, 2012 17:39
Default ITK factory registration code that gets generated when using include(${ITK_USE_FILE})
/*=========================================================================
*
* Copyright Insight Software Consortium
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0.txt
*
@thewtex
thewtex / WhatsNewIn4.3.0.rst
Created December 18, 2012 07:25
What's New in ITK 4.3.0 Webinar

What's New in ITK 4.3.0

Overview

The 4.3.0 release is a major milestone that marks the hard work on many outstanding community members.

DCMTK ImageIO

@thewtex
thewtex / notify
Created February 17, 2013 02:13
Script to send a tmux, desktop, and audio notification after the completion of the given command when using tmux.
#!/bin/bash
# Send a tmux, desktop, and audio notification after the completion
# of the given command when using tmux.
#
# Requires: tmux
# Recommended: espeak, libnotify
tmux_window=$(/usr/bin/tmux list-windows \
-F "#{window_active} #{window_index} #{window_name}" | \