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 / slicer_additional_dictionary.txt
Created July 7, 2023 05:29
Additonal dictionary used when running SimpleITKSpellChecking against Slicer code base
Andras
Andruejol
Aucoin
Allowlist
Arial
Backend
Blocklist
Canaria
Cancelling
Cividis
@jcfr
jcfr / github_create_resources_release.sh
Last active June 28, 2025 14:45
Convenient shell script to create an orphan release useful for hosting binary assets (e.g images) used in documentation
# SPDX-FileCopyrightText: 2023 Jean-Christophe Fillion-Robin <jcfr@kitware.com>
# SPDX-License-Identifier: BSD-3-Clause
#-----------------------------------------------------------------------------
tag_name=collection-archives
release_name=CollectionArchives
git checkout --orphan=${tag_name}
git rm -rf .
#-----------------------------------------------------------------------------
@jcfr
jcfr / slicer_lupdate_preprocess.py
Last active March 30, 2023 20:53
Rewrite tr-like function calls found in Slicer scripted modules to include the context as first argument
# SPDX-FileCopyrightText: 2023 Jean-Christophe Fillion-Robin <jcfr@kitware.com>
# SPDX-License-Identifier: BSD-3-Clause
import ast
import argparse
import errno
import os
import sys
import astor
@jcfr
jcfr / boost_fixup_rpath.sh
Created March 22, 2022 21:58
Script to patch the Boost libraries changing the occurences of `@rpath` back to a full path
#/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 March 16, 2022 19:30 — forked from ebrahimebrahim/slicer_plot_data.py
use a class to manage the nodes involved in a slicer plot view
# 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 February 9, 2022 13:25
Execuable to find all Qt modules referenced by a set of C++ source files
"""
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)
@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 / pytest-plugins-pip-installable-master.sh
Last active December 31, 2020 17:27
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…
#!/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 / 2020.07.21_Slicer-icons.md
Created July 21, 2020 14:16
Slicer iconsas of July 21, 2020
Name Icon
SuperLoadableModuleTemplate.png
CLIExtensionTemplate.png
ScriptedLoadableModuleTemplate.png
ScriptedLoadableExtensionTemplate.png
ScriptedSegmentEditorEffectExtensionTemplate.png
Segm
@jcfr
jcfr / vtkITKTransformInverse.h
Created March 9, 2019 00:19
vtkITKTransformInverse.h difference between Slicer PR#1099 and PR#1096
// PR#1096
// https://github.com/Slicer/Slicer/pull/1096/commits/5d8cce93acfcd9504e98cb318e1ddff92afea723#diff-685fe5dc92e213efacb56c685635f8a7
/*=========================================================================
Program: Visualization Toolkit
Module: $RCSfile: vtkITKTransformInverse.h,v $
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.