- Python
- SimpleITK
- NumPy
conda install numpy -y
#!/usr/bin/env python3 | |
""" | |
This script prints out the revision number and bitstream ID of the latest | |
nightly build of 3D Slicer. | |
""" | |
import re | |
import sys | |
from sys import platform as _platform |
from glob import glob | |
from time import gmtime, strftime | |
from os.path import expanduser, splitext, basename, join, isdir | |
import qt, vtk, ctk, slicer | |
import numpy as np | |
import SimpleITK as sitk | |
ONE_BY_THREE_LAYOUT_ID = 501 | |
;= @echo off | |
;= rem Call DOSKEY and use this file as the macrofile | |
;= %SystemRoot%\system32\doskey /listsize=1000 /macrofile=%0% | |
;= rem In batch mode, jump to the end of the file | |
;= goto:eof | |
;= Add aliases below here | |
e.=explorer . | |
glol=git log --oneline --all --graph --decorate $* | |
ls=ls --show-control-chars -F --color $* | |
pwd=cd |
import numpy as np | |
import matplotlib.pyplot as plt | |
def k_means(points, num_classes, epsilon=1e-5, plot=False): | |
means = np.random.rand(num_classes, 2) | |
diff_means = np.inf | |
while(diff_means > epsilon): | |
# Assignment step |
#!/usr/bin/env python | |
import re | |
import sys | |
from pathlib import Path | |
from sys import platform as _platform | |
import time | |
import shutil | |
import urllib.request | |
import tarfile |
import numpy as np | |
points = vtk.vtkPoints() | |
vertices = vtk.vtkCellArray() | |
sizes = vtk.vtkFloatArray() | |
sizes.SetName('Sizes') | |
colors = vtk.vtkFloatArray() | |
colors.SetName('Colors') |
import os | |
import sys | |
import argparse | |
from os.path import join, exists, isdir | |
""" | |
Usage: Slicer --no-main-window --python-script interpolateMergedContours.py -i labelmapsInDir -o labelmapsOutDir | |
""" | |
def interpolateMergedContours(inputImagePath, outputImagePath=None, outputMeshPath=None): |
from PyQt4.QtGui import QImage, qRgb | |
import numpy as np | |
class NotImplementedException: | |
pass | |
gray_color_table = [qRgb(i, i, i) for i in range(256)] | |
def toQImage(im, copy=False): | |
if im is None: |