Skip to content

Instantly share code, notes, and snippets.

Avatar
👶
Introducing a mini-human to the world

Matt McCormick thewtex

👶
Introducing a mini-human to the world
View GitHub Profile
View ViewerChannelTestingData.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View I46_tiles_ngff_datatree.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@thewtex
thewtex / save_image_from_numpy_array_affine_matrix.py
Created Aug 9, 2021
Save an image from a numpy array and an affine matrix
View save_image_from_numpy_array_affine_matrix.py
import itk
import numpy as np
def save(np_array: np.ndarray, filename: str, affine_matrix: np.ndarray):
# -1 for translation
Dimension = affine_matrix.shape[0] - 1
# Is this a multi-component image?
is_vector = np_array.ndim != Dimension
print('is_vector', is_vector)
@thewtex
thewtex / ImageChannelInterleavedContiguous.ipynb
Last active Oct 27, 2020
Demonstrate image channel interleaved vs contiguous in ITK / PIL / Matplotlib versus PyTorch
View ImageChannelInterleavedContiguous.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View Segmentation_Image_Distance.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@thewtex
thewtex / AnisotropicSpacing.ipynb
Created Jun 21, 2020
X/Y/Z anisotropic voxel scaling possible with the itkwidgets.view function?
View AnisotropicSpacing.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@thewtex
thewtex / ContourExtractor2D.ipynb
Created Jun 10, 2020
itk.ContourExtractor2DImageFilter example
View ContourExtractor2D.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@thewtex
thewtex / ITKCommitPrefixChangelog.py
Created May 15, 2020
Generate a Markdown changelog from commits between recent tags that use the ITK commit prefixes
View ITKCommitPrefixChangelog.py
#!/usr/bin/env python3
import subprocess
import sys
if len(sys.argv) < 2:
print('Usage: ' + sys.argv[0] + ' <ReleaseNotesFilePath.md>')
sys.exit(1)
output_file = sys.argv[1]
@thewtex
thewtex / build-test-package.yml
Last active Jun 16, 2020
ITK remote module GitHub Actions configuration
View build-test-package.yml
name: Build, test, package
on: [push,pull_request]
jobs:
build-test-cxx:
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 3
matrix:
@thewtex
thewtex / netlify-zarr-config.py
Created Mar 6, 2020
Prepare a Zarr Directory Store for deployment on a Netlify Site
View netlify-zarr-config.py
#!/usr/bin/env python3
"""Netlify does not serve hidden files, i.e files starting with a '.'. Copy Zarr
hidden files and generate a '_redirects' file for Zarr DirectoryStore
deployment.
References:
- https://docs.netlify.com/routing/redirects/#syntax-for-the-redirects-file
- https://community.netlify.com/t/hidden-files-removed-in-zip-deploy/8997