Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
from pathlib import Path | |
import torch | |
import torchvision | |
import numpy as np | |
from PIL import Image | |
import torchio as tio | |
from tqdm import trange | |
output_dir = Path('/tmp/transformed') |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# Paste this code into the Slicer Python console | |
pip_install('highresnet') | |
import SampleData | |
from highresnet.inference import infer | |
from highresnet.cli.download_oasis import download_oasis | |
input_path = download_oasis() | |
loadVolume(input_path) |
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 | |
import matplotlib.pyplot as plt | |
def fourier_transform(array: np.ndarray): | |
transformed = np.fft.fftn(array) | |
fshift = np.fft.fftshift(transformed) | |
return fshift | |
def inv_fourier_transform(fshift: np.ndarray): | |
f_ishift = np.fft.ifftshift(fshift) |
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 tempfile | |
from pathlib import Path | |
from subprocess import call | |
# pip install moviepy opencv-python scikit-image face_recognition | |
import cv2 | |
import numpy as np | |
from PIL import Image | |
from tqdm import tqdm |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# Last modified on the 14th of May, 2018 | |
mkdir -p ~/git | |
cd ~/git | |
# Replace fepegar by your username on Inria Forge. You’ll be asked your password | |
user="fepegar" | |
# To clone the master branch: | |
git clone https://[email protected]/authscm/$user/git/morpheme-privat/morpheme-privat.git --depth 1 | |
# Install zlib1g-dev if Linux |
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
mkdir -p $HOME/git | |
cd $HOME/git | |
git clone https://github.com/KCL-BMEIS/niftyreg.git --depth 1 | |
cd niftyreg | |
mkdir build install | |
cd build | |
# This gave me trouble on a DGX | |
## If cmake is run just once, make may not work. Might be related to https://stackoverflow.com/q/47684410/3956024 | |
#cmake -DCMAKE_INSTALL_PREFIX:STRING=../install -DUSE_CUDA:BOOL=ON -DCMAKE_C_COMPILER:STRING=/usr/bin/gcc-6 .. |