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
from menpo.shape import PointCloud | |
from menpo.shape import PointDirectedGraph | |
from menpo.shape import bounding_box | |
import json | |
def read_landmarker_pts(fname): | |
# Note: It's in this order! | |
#old_order = ['chin', 'left-eye', 'right-eye', 'left-eyebrow', 'nose', 'right-eyebrow', 'outer-mouth', 'inner-mouth'] | |
face_parts = { |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
function write_gav2csv(infile, outprefix, smoothOn) | |
% WRITE_GAV2CSV Write the grand-average file as a CSV | |
% write_gav2csv(infile, outfile) | |
% | |
% infile : Input grand average file name (e.g., 'myfile.gav') | |
% outprefix : Prefix to output (e.g., 'myfile'). A separate file will be created corresponding to each bin. | |
% smoothOn : 0 means no smoothing. 1 [default] = single smoothing. 2 = double smoothing, etc. | |
% | |
% Created by Zarrar Shehzad on 2015-04-23. |
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 script assumes that you have https://github.com/czarrar/rparcellate | |
# 1. Make sure to create a group mask (in some standard space) | |
# -- I would recommend using `fslmaths -Tstd -bin` or `fslmaths -Tmin -bin` | |
# -- Then make sure to mask your group mask by `rparcellate/rois/ho_maxprob25.nii.gz`. This is a special grey-matter mask. | |
# read in your group mask | |
suppressMessages(library(niftir)) | |
mask_file <- "/path/to/group_mask.nii.gz" | |
grp_mask <- read.mask(mask_file) |
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
# Installing the niftir package from github | |
# note: if you have a mac, this package has some open issues so I might recommend using another package (see below) | |
## Various Dependencies | |
cat("Installing various dependencies\n") | |
install.packages( | |
c("codetools", "foreach", "doMC", "multicore", "getopt", "optparse", | |
"bigmemory", "biganalytics", "bigmemory.sri") | |
, repos="http://cran.us.r-project.org") | |
install.packages( | |
c("plyr", "Rcpp", "RcppArmadillo", "inline", "devtools"), |
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 file will be called the `le_correcter.R` file shown below | |
# and both files must be in the same directory. | |
# This file contains the low-level functions to find the clusters | |
# as well as convert ROIs to voxelwise data. | |
suppressPackageStartupMessages(library(connectir)) | |
suppressPackageStartupMessages(library(inline)) | |
plugin_bigmemory <- function() { | |
l <- getPlugin("RcppArmadillo") |
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
# To use, please install CPAC (CWAS branch) or clone and add this to your path | |
# git clone https://github.com/FCP-INDI/C-PAC.git | |
# cd C-PAC | |
# git checkout cwas | |
# also see: https://github.com/FCP-INDI/C-PAC/tree/cwas | |
from CPAC.cwas import calc_cwas | |
# Load your data | |
## Create the (`S`,`T`,`V`) dataset to hold everything: `S` subjects, `T` timepoints, `V` voxels |
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
id | group | name | |
---|---|---|---|
1002 | cortex | left caudal anterior cingulate | |
1003 | cortex | left caudal middle frontal | |
1005 | cortex | left cuneus | |
1006 | cortex | left entorhinal | |
1007 | cortex | left fusiform | |
1008 | cortex | left inferior parietal | |
1009 | cortex | left inferior temporal | |
1010 | cortex | left isthmus cingulate | |
1011 | cortex | left lateral occipital |
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
#!/usr/bin/env python | |
import argparse | |
import os | |
from os import path | |
from CPAC.network_centrality import calc_centrality | |
### |
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
import numpy as np | |
import os | |
#from CPAC.network_centrality import load | |
#from CPAC.cwas.subdist import norm_cols | |
import nibabel as nib | |
from scipy.sparse import coo_matrix, cs_graph_components | |
def load(datafile, template): | |
NewerOlder