Skip to content

Instantly share code, notes, and snippets.

View jcfr's full-sized avatar
🎯
Focusing

Jean-Christophe Fillion-Robin jcfr

🎯
Focusing
View GitHub Profile
@jcfr
jcfr / cmake_python_download.cmake
Last active August 29, 2015 14:01
Short CMake script attempting to download Python-2.7.3.tgz. It has been created in an attempt to reproduce issue discussed here: http://slicer-devel.65872.n3.nabble.com/Problems-downloading-packages-on-Windows-during-Slicer-build-tt4031572.html
set(file "./Python-2.7.3.tgz")
message(STATUS "Removing ${file}")
file(REMOVE ${file})
message(STATUS "Removing ${file} - done")
message(STATUS "Downloading ${file}")
file(
DOWNLOAD https://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz ${file}
SHOW_PROGRESS
@jcfr
jcfr / slicer-trunk-project-week-commit-log.txt
Created May 21, 2014 20:15
Commits log for Slicer trunk for the past 5 project week
$ git lg --since "JAN 6 2014" --until "JAN 10 2014"
* 1e9c716 - COMP: Fix loading of external "loadable module" providing python script (4 months ago) <jcfr>
* aea1198 - ENH: add a new color node, continous around 0.0 (4 months ago) <naucoin>
* 73622dc - BUG: use vtkNew for copied look up tables (4 months ago) <naucoin>
* cf8359c - BUG: Allow assigning procedural color nodes to map scalars (4 months ago) <naucoin>
* 266dea0 - BUG: check for color transfer functions first (4 months ago) <naucoin>
* 59968e4 - COMP: Modern gcc compilers have a reasonable template depth limit (4 months ago) <jcfr>
* 4c57a60 - COMP: Ensure Slicer_RemoteModule_Add worked when source directory is passed (4 months ago) <jcfr>
* a6934aa - STYLE: Add X,O,M and S documentation for VolumeRendering module (4 months ago) <finetjul>
* 7d1c27f - BUG: Cleanup ROI widget and representation (4 months ago) <finetjul>
@jcfr
jcfr / Ubuntu-ExtensionWizardResources.py
Last active August 29, 2015 14:02
A collection of ExtensionWizardResources.py generated on the different Slicer platform. The differences of resource file illustrates this Qt issue: https://bugreports.qt-project.org/browse/QTBUG-39422
import base64
from __main__ import slicer
qt_resource_handle = None
qt_resource_data = base64.decodestring("""
cXJlcwAAAAEAAQsdAAAAFAABCqsAAAnhiVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0
AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3
Lmlua3NjYXBlLm9yZ5vuPBoAAAleSURBVFiFxVd5cFXVGf+dc+59W/LyXl4WCMQ0QiABAsGKIEJU
VNRSFW3VDg7i1LoNWkBcq2gaHVuZOoJYnbG1tdopjsswMq5VQUChVAFBZF8Skpd9e/u7yznn6x9Z
@jcfr
jcfr / vtkMRMLNode.cxx
Last active August 29, 2015 14:03
Track major update of vtkMRMLNode.cxx - [r23187 , Slicer/Slicer@bca1b5c2] -> [r23191 , Slicer/Slicer@7b76f67 ] -> [r23415 , Slicer/Slicer@b5b6e3be ]
/*=auto=========================================================================
Portions (c) Copyright 2005 Brigham and Women\"s Hospital (BWH) All Rights Reserved.
See COPYRIGHT.txt
or http://www.slicer.org/copyright/copyright.txt for details.
Program: 3D Slicer
Module: $RCSfile: vtkMRMLNode.cxx,v $
Date: $Date: 2006/03/17 15:10:09 $
@jcfr
jcfr / fix-vc9-redist-manifests.ps1
Last active August 29, 2015 14:04
Patch manifests in the redist folder of Visual Studio 9 (2008) replacing "9.0.30729.1" with "9.0.21022.8"
#REQUIRES -Version 2.0
<#
.SYNOPSIS
Patch manifests in the redist folder of Visual Studio 9 (2008)
.DESCRIPTION
To avoid the dll hell associated with runtime libraries distribution. There are
two approaches:
(1) edit the manifest file to have "9.0.21022.8" from the "9.0.30729.XXX" that is there, you "trick"
your executable into using the newer dlls. There appears to be no ill effects from this.
@jcfr
jcfr / README.md
Last active August 29, 2015 14:05
Collection of shell script useful to maintain Slicer legacy modules. Originally created while working on Slicer issue #3401
@jcfr
jcfr / one-pubMed-abstract-per-page.ipynb
Last active August 29, 2015 14:09
IPython notebook allowing to transform a list of PubMed abstracts into a RTF document with one abstract per page.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jcfr
jcfr / jsoncpp-configure-build-test.sh
Last active August 29, 2015 14:11
Comparison of Json C/C++ parser - configure/build/test times
url=git@github.com:open-source-parsers/jsoncpp.git
name=jsoncpp
git clone $url
mkdir $name-build/ && cd $_
cmake -DCMAKE_BUILD_TYPE:STRING=Release ../$name
make -j3
@jcfr
jcfr / FindPythonQt.cmake
Created February 9, 2015 21:47
Illustrate update done to FindPythonQt.cmake while debugging Slicer packaging issue caused by CTK update. See here for more details: http://slicer-devel.65872.n3.nabble.com/Windows-and-Linux-nightly-packages-td4033451.html
# Find PythonQt
#
# Sets PYTHONQT_FOUND, PYTHONQT_INCLUDE_DIR, PYTHONQT_LIBRARY, PYTHONQT_LIBRARIES
#
# Python is required
find_package(PythonLibs)
if(NOT PYTHONLIBS_FOUND)
message(FATAL_ERROR "error: Python is required to build PythonQt")
endif()
@jcfr
jcfr / 2015.02.16_slicer-load-all-extensions-and-display-module-names.log
Created February 16, 2015 18:46
Script and associated output illustrating issue associated generation of Modules/Extensions listing reported by Ron on February 16th, 2015
Number of registered modules: 290
SystemError: /home/kitware/Dashboards/Package/Slicer-440-package/Python-2.7.3/Objects/classobject.c:511: bad argument to internal function
qSlicerScriptedLoadableModuleWidget::setPythonSource "/home/kitware/Dashboards/Package/Slicer-440-package/Slicer-build/lib/Slicer-4.4/qt-scripted-modules/Editor.py" - Failed to instantiate scripted pythonqt class "Editor" 0x416e210
Fail to instantiate module "Editor"
SystemError: /home/kitware/Dashboards/Package/Slicer-440-package/Python-2.7.3/Objects/classobject.c:511: bad argument to internal function
qSlicerScriptedLoadableModuleWidget::setPythonSource "/home/kitware/Dashboards/Package/Slicer-440-package/Slicer-build/lib/Slicer-4.4/qt-scripted-modules/LabelStatistics.py" - Failed to instantiate scripted pythonqt class "LabelStatistics" 0x416e910
Fail to instantiate module "LabelStatistics"
{'CornerAnnotation': <bound method CornerAnnotation.runTest of <CornerAnnotation.CornerAnnotation instance at 0x3f35e60>>, 'FiducialLayoutSwit