Get RGB colors, one per line, for a given Python colormap. In the script below, we get RGB colors for the jet
matplotlib colormap.
import matplotlib.pyplot as plt
import numpy as np
# Generate the jet colormap
cmap = plt.cm.get_cmap('jet')
This gist contains a template script that can be run across multiple subjects using the sct_run_batch wrapper script.
The template bash script below can be run from you command line using the following command:
sct_run_batch -script example_script.sh -path-data <DATA> -path-output <DATA>_202X-XX-XX -jobs 16
import os | |
import glob | |
import hashlib | |
import argparse | |
def compute_checksum(file_path): | |
with open(file_path, 'rb') as f: | |
file_bytes = f.read() | |
return hashlib.md5(file_bytes).hexdigest() |
# Set ITK direction from image1 to image2 | |
# | |
# Usage: | |
# python change_itk_orientation.py <image1> <image2> | |
# Example: | |
# python change_itk_orientation.py sub-001_T1w.nii.gz sub-001_T1w_seg.nii.gz | |
# | |
# Jan Valosek | |
# |
This gist describes example of simple workflow on repository whose changes are tracked by git and GitHub
# Go to directory where repository will be cloned (downloaded)
cd ~/Documents
# Clone repository from GitHub
venv
and conda
are environment manager tools allowing to create virtual environments. Virtual environment separates the dependencies (Python packages) for different projects. This mean that each project can have its own dependencies. Usage of virtual environments allows you to avoid installing Python packages globally (to the system Python) which could break system tools or other projects.
MacOS or Linux (without or with site-packages)