This file contains 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
# %% | |
# A basic funtion to convert MNI coords (x,y,z) to harvard oxford "labels" using spherical masking. | |
# input: | |
# - list of coords of size N*3 | |
# output: | |
# - list of labels of size N | |
import numpy as np | |
from nilearn import datasets |
This file contains 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
val fibs = 0 #:: fibs.scan(1)(_ + _) | |
fibs take 5 toList |
This file contains 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 is a fairly ugly solution; in a hurry and didn't spend much time on it. | |
import scala.util.Random | |
case class WeightedItem[T](item: T, weight: Double) | |
val items = Seq(WeightedItem("Red", 1d/6), WeightedItem("Blue", 2d/6), | |
WeightedItem("Green", 3d/6) ) | |
def weightedSelection[T]( |
This file contains 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
#!/bin/bash | |
# Copy this into extracted `protege/` directory and execute in Terminal. Done! | |
# `Protege.app` will be available in the parent directory. | |
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
PROTEGE_DIR=$CURRENT_DIR | |
cd $PROTEGE_DIR |