Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Jean-Christophe Fillion-Robin jcfr

🎯
Focusing
View GitHub Profile
@jcfr
jcfr / boost_fixup_rpath.sh
Created Mar 22, 2022
Script to patch the Boost libraries changing the occurences of `@rpath` back to a full path
View boost_fixup_rpath.sh
#/bin/env bash
# This script allows to patch the Boost libraries changing the occurences of `@rpath`
# back to a full path specific to this dashboard.
#
# This is currently required by Slicer macOS packaging infrastructure.
set -euo pipefail
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
@jcfr
jcfr / slicer_plot_data.py
Last active Mar 16, 2022 — forked from ebrahimebrahim/slicer_plot_data.py
use a class to manage the nodes involved in a slicer plot view
View slicer_plot_data.py
# To try this example, save this to a file slicer_plot_data.py, then execute Slicer from the command line
# with the arguments `--python-script slicer_plot_data.py`.
import qt
import vtk
import slicer
class SlicerPlotData:
@jcfr
jcfr / FindQtModules.py
Last active Feb 9, 2022
Execuable to find all Qt modules referenced by a set of C++ source files
View FindQtModules.py
"""
This executable allows to find all Qt modules referenced by a set of C++ source files.
A Qt module (e.g QtNetwork) aggregates together a collection of Qt classes and is
associated with a set of public and private headers.
For example, to select multiple files and identify associated Qt modules:
QT_INCLUDE_DIR=/path/to/Qt5.15.2/5.15.2/gcc_64/include
python FindQtModules.py $QT_INCLUDE_DIR $(find /path/to/Awesome/Lib/ -type f)
View slicer-convertHtmlToPdf-snippet.py
@staticmethod
def convertHtmlToPdf(htmlFilePath, pdfFilePath):
"""
Convert HTML file to PDF.
It returns the tuple ``(success, errorString)``.
.. note::
Conversion from HTML to PDF is performed using :func:`slicer.qSlicerWebWidget.printToPdf()`
@jcfr
jcfr / qVariantMapToSettings.cpp
Created Jul 9, 2012
Qt example illustrating how to write list of QVariantMap into a settings file.
View qVariantMapToSettings.cpp
// Qt includes
#include <QSettings>
#include <QVariantMap>
// STL includes
#include <cstdlib>
int main(int, char*[])
{
@jcfr
jcfr / CMakeLists.txt
Last active Sep 7, 2021
CMake project allowing to build OpenSSL 32 and 64-bit for Windows and upload the associated "tar.gz" archives on http://packages.kitware.com
View CMakeLists.txt
cmake_minimum_required(VERSION 2.8.10.2)
#
# This project allows to configure, build, archive and upload an OpenSSL install tree.
#
if(DEFINED UPLOAD_PACKAGE_SCRIPT)
set(MIDAS_URL "http://packages.kitware.com")
set(FOLDER_ID 203)
@jcfr
jcfr / pytest-plugins-pip-installable-master.sh
Last active Dec 31, 2020
Since the project `pytest-plugins` contains multiple independent python projects, it is not directly pip-installable. This is problematic when upstream maintainers have not yet created a new release and a project wants to depends on the latest version of some of the project. As a workaround, this script allows to *force* push to $REPO a branch f…
View pytest-plugins-pip-installable-master.sh
#!/usr/bin/env bash
REPO=git@github.com:jcfr/pytest-plugins.git
#UPSTREAM_REPO=git://github.com/manahl/pytest-plugins.git
UPSTREAM_REPO=$REPO
UPSTREAM_BRANCH=fix-virtualenv-installed-package-on-windows
PACKAGES="pytest-virtualenv"
# Since the project `pytest-plugins` contains multiple independent
# python projects, it is not directly pip-installable.
@jcfr
jcfr / get-and-build-openssl-for-slicer.sh
Last active Sep 7, 2020
Shell script to build OpenSSL as a prerequisite for building Qt
View get-and-build-openssl-for-slicer.sh
#!/usr/bin/env bash
base_dir=$(pwd) &&
rm -rf zlib* &&
echo "Cloning zlib" &&
git clone git://github.com/commontk/zlib.git &&
echo "Cloning zlib - done" &&
mkdir zlib-build &&
mkdir zlib-install &&
@jcfr
jcfr / 2020.07.21_Slicer-icons.md
Created Jul 21, 2020
Slicer iconsas of July 21, 2020
View 2020.07.21_Slicer-icons.md
Name Icon
SuperLoadableModuleTemplate.png
CLIExtensionTemplate.png
ScriptedLoadableModuleTemplate.png
ScriptedLoadableExtensionTemplate.png
ScriptedSegmentEditorEffectExtensionTemplate.png
Segm
@jcfr
jcfr / 2015-08-25_test_cmake_download_from_dropbox.cmake
Last active Apr 20, 2020
Simple CMake script to help Jorge identify issue with the version of CMake used to setup Slicer miniconda dashboard on MacOSX
View 2015-08-25_test_cmake_download_from_dropbox.cmake
#
# To run the script:
#
# cmake -DDEST=/home/jcfr -P 2015-08-25_test_cmake_download_from_dropbox.cmake
#
if(NOT EXISTS "${DEST}")
set(DEST ".")
endif()