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
n = getNodes('vtkMRMLGPURayCastVolumeRenderingDisplayNode*').values()[0]
highDef = n.GetPerformanceControl() == slicer.vtkMRMLVolumeRenderingDisplayNode.MaximumQuality
v = getNode('CTChest')
minSpacing = 1.0
if v.GetMinSpacing() > 0:
minSpacing = v.GetMinSpacing()
sampleDistance = minSpacing / n.GetEstimatedSampleDistance()
@jcfr
jcfr / 2015-04-06_Slicer-r24159_EMSegCL_Task_HumanEye_BRAINS_small-fail
Last active August 29, 2015 14:18
The test "EMSegCL_Task_HumanEye_BRAINS_small" intermittently fails. This gist show the difference of output FAIL vs PASS
kitware@factory-south-ubuntu:~/Dashboards/Nightly/Slicer-0-build/Slicer-build$ ~/Dashboards/Support/cmake-3.1.0-rc3-Linux-x86_64/bin/ctest -R EMSegCL_Task_HumanEye_BRAINS_small -V
UpdateCTestConfiguration from :/home/kitware/Dashboards/Nightly/Slicer-0-build/Slicer-build/DartConfiguration.tcl
Parse Config file:/home/kitware/Dashboards/Nightly/Slicer-0-build/Slicer-build/DartConfiguration.tcl
Add coverage exclude regular expressions.
Add coverage exclude: /CMakeFiles/CMakeTmp/
Add coverage exclude: .*/moc_.*
Add coverage exclude: .*/ui_.*
Add coverage exclude: .*/qrc_.*
Add coverage exclude: .*/Testing/.*
Add coverage exclude: .*Python.cxx
@jcfr
jcfr / FindPythonQt.cmake
Last active August 29, 2015 14:23
Possible patch to address issue reported by Caroline Essert on June 25, 2015. See http://slicer-devel.65872.n3.nabble.com/Problem-building-CTK-PythonQt-tp4034371p4034402.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 / CMakeLists.txt
Last active September 2, 2015 17:50
Illustrate issue with file(INSTALL ....) function on MacOSX
cmake_minimum_required(VERSION 2.8.6)
file(WRITE "${CMAKE_SOURCE_DIR}/foo.cpp"
"
class foo
{
public:
foo(){}
~foo(){}
};
#-----------------------------------------------------------------------------
project(TestGitCmd)
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
cmake_minimum_required(VERSION 2.8)
#-----------------------------------------------------------------------------
find_program(git_EXECUTABLE
NAMES git.cmd git eg.cmd eg
@jcfr
jcfr / Update Slicer CLI buildsystem to download test data fom midas.ipynb
Last active September 17, 2015 04:09
Convenient script useful to update CMakeLists.txt of Slicer CLI modules
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
license_file=~/Projects/Visomics/NOTICE
while read i;
do
echo "Checking $i"
if ! grep -q Copyright $i
then
echo "=> Updating $i"
cat $license_file $i >$i.new && mv $i.new $i
@jcfr
jcfr / slicer-4.0-module-description.xsl
Created October 21, 2011 03:49
slicer-4.0-module-description.xsl
<?xml version="1.0" encoding="UTF-8"?>
<xsl:transform version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" indent="yes" encoding="UTF-8"/>
<xsl:template name="newline"><xsl:text>&#10;</xsl:text></xsl:template>
<!-- Source: http://geekswithblogs.net/Erik/archive/2008/04/01/120915.aspx -->
<xsl:template name="string-replace-all">
@jcfr
jcfr / slicer-4.0-module-category.xsl
Created October 21, 2011 03:50
slicer-4.0-module-category.xsl
<?xml version="1.0" encoding="UTF-8"?>
<xsl:transform version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" indent="yes" encoding="UTF-8"/>
<xsl:template match="/executable">
<xsl:value-of select="category" />
</xsl:template>
@jcfr
jcfr / slicer-4.0-module-parameterdescription.xsl
Last active September 27, 2015 17:08
slicer-4.0-module-parameterdescription.xslThe XSLT understands nested parameter tag (Thanks Julien)
<?xml version="1.0" encoding="UTF-8"?>
<xsl:transform version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" indent="yes" encoding="UTF-8"/>
<xsl:template name="newline"><xsl:text>&#10;</xsl:text></xsl:template>
<!-- See http://na-mic.org/Mantis/view.php?id=2536 -->
<xsl:template match="name"> (<xsl:value-of select="."/>)</xsl:template>