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
"""Virtually move around head position.""" | |
import os | |
from copy import deepcopy | |
from subprocess import run | |
import mne | |
import numpy as np | |
from move_head import move_head |
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 neurodsp | |
import neurodsp.aperiodic | |
import neurodsp.plts | |
import neurodsp.sim | |
import neurodsp.spectral | |
import numpy as np | |
from pyrasa.irasa import irasa | |
n_seconds = 10 | |
fs = 500 # sampling rate in Hz |
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 pickle | |
class MyClass: | |
"""Example class to pickle. Version 2.""" | |
def __init__(self, a, b, c, d=4): | |
"""New field `d` with default value, so no problems right?""" | |
self.a = a | |
self.b = b |
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
"""Interface between python and the MEG hardware at Aalto's MEG core. | |
This is intended to be used in combination with PsychoPy to perform classic experiments | |
involving simple events and responses. | |
Example that presents a visual stimulus, sends a trigger code to the MEG and waits for a | |
button response with one of the response pads: | |
>>> from psychopy import core, visual | |
>>> from aalto_meg import AaltoMEG |
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
#!/bin/bash | |
# Start tmux | |
tmux new -d -s "slurm$SLURM_JOB_ID" | |
# Make job wait for user to connect | |
sleep 8h |
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
"""Plot a cluster. | |
Plot the spatial extend of a cluster (as those returned from the cluster-based | |
permutation stats) on a brain. | |
Author: Marijn van Vliet <[email protected]> | |
""" | |
import mne | |
import numpy as np |
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
""" | |
Plot the spatial extent of a cluster (as those returned from the cluster-based | |
permutation stats) on a brain. | |
Author: Marijn van Vliet <[email protected]> | |
""" | |
import mne | |
import numpy as np |
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
""" | |
Obtain head -> MRI transform for the MOUS dataset for use with MNE-Python. | |
If you want to analyze the "Mother of all unification studies" dataset with | |
FreeSurfer and MNE-Python, you will need the MRI->HEAD coordinate | |
transformations. In the original dataset, the T1w_space_CTF.nii files contain | |
this information, but it takes some doing to distill this into a transform | |
object as used by MNE-Python. | |
This script assumes you have ran FreeSurfer on the T1w.nii files of all the |
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
""" | |
Proposal for an event API for MNE-Python. | |
----------------------------------------- | |
We want figures to be able to communicate with each other, such that a change | |
in one figure can trigger a change in another figure. For example, moving the | |
time cursor in a Brain plot can update the current time in an evoked plot. | |
Another scenario is two drawing routines drawing into the same window. For | |
example, one function is drawing a source estimate, while another is drawing | |
magnetic field lines. The event system will allow both drawing routines to |
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
use std::io::{self, Read}; | |
// This reads in the puzzle input from stdin. So you would call this program like: | |
// cat input | cargo run | |
// It then feeds the input as a string to the functions that solve both parts of the puzzle. | |
fn main() { | |
let mut input = String::new(); | |
io::stdin().read_to_string(&mut input).unwrap(); | |
println!("Part 1 answer: {}", part1(strip_bom(&input))); | |
println!("Part 2 answer: {}", part2(strip_bom(&input))); |
NewerOlder