This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SimpleITK as sitk | |
import numpy as np | |
import os | |
import matplotlib.pyplot as plt | |
folder_dicom = 'FILL THIS PATH IN' | |
where_to_save = 'PATH_TO_SAVE/filename.nrrd' | |
# read in the dicom series as an image |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import json | |
import subprocess | |
def python_submit(command, | |
out='./slurm-%j.out', | |
gpu='2080ti', | |
node='any', | |
memory=24, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
import numpy as np | |
from typing import Callable, Sequence, Union | |
arr_type = Union[np.ndarray, torch.Tensor] | |
def flatten_other_dims( | |
xs: Union[arr_type, Sequence[arr_type]], dim: Union[int, Sequence[int]] = None | |
): | |
"""Flattens all dimensions other than the specified dimension(s). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
imoport numpy as np | |
import SimpleITK as sitk | |
def get_maps(binary_seg): | |
dist_map = sitk.Abs(sitk.SignedMaurerDistanceMap(binary_seg, | |
squaredDistance=False, | |
useImageSpacing=True)) | |
surface_map = sitk.LabelContour(binary_seg) | |
return (dist_map, surface_map) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apt-get update | |
apt-get install --yes \ | |
build-essential \ | |
cmake \ | |
libtool \ | |
autoconf \ | |
pkg-config \ | |
gfortran \ | |
libopenblas-dev \ | |
liblapack-dev \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from pycpd import RigidRegistration | |
# Based off of this example: https://github.com/siavashk/pycpd/blob/master/examples/bunny_rigid_3D.py | |
X = np.loadtxt('data/bunny_target.txt') | |
# synthetic data, equaivalent to X + 1 | |
Y = np.loadtxt('data/bunny_source.txt') | |
reg = RigidRegistration(**{'X': X, 'Y': Y}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ---------------------------------------------------------------------------- | |
* This file was automatically generated by SWIG (http://www.swig.org). | |
* Version 4.0.2 | |
* | |
* Do not make changes to this file unless you know what you are doing--modify | |
* the SWIG interface file instead. | |
* ----------------------------------------------------------------------------- */ | |
package org.opensim.modeling; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ---------------------------------------------------------------------------- | |
* This file was automatically generated by SWIG (http://www.swig.org). | |
* Version 4.0.2 | |
* | |
* Do not make changes to this file unless you know what you are doing--modify | |
* the SWIG interface file instead. | |
* ----------------------------------------------------------------------------- */ | |
package org.opensim.modeling; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ---------------------------------------------------------------------------- | |
* This file was automatically generated by SWIG (http://www.swig.org). | |
* Version 4.0.2 | |
* | |
* Do not make changes to this file unless you know what you are doing--modify | |
* the SWIG interface file instead. | |
* ----------------------------------------------------------------------------- */ | |
package org.opensim.modeling; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file was automatically generated by SWIG (http://www.swig.org). | |
# Version 4.0.2 | |
# | |
# Do not make changes to this file unless you know what you are doing--modify | |
# the SWIG interface file instead. | |
from sys import version_info as _swig_python_version_info | |
if _swig_python_version_info < (2, 7, 0): | |
raise RuntimeError("Python 2.7 or later required") |
NewerOlder