-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #117 from berkeley-stat159/dev
Update Master 12_12
- Loading branch information
Showing
59 changed files
with
656 additions
and
565 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
.PHONY: all clean coverage test | ||
.PHONY: all clean coverage test verbose | ||
|
||
all: clean | ||
|
||
clean: | ||
find . -name "*.so" -o -name "*.pyc" -o -name "*.pyx.md5" | xargs rm -f | ||
|
||
coverage: | ||
nosetests code/utils data --with-coverage --cover-package=data --cover-package=utils | ||
nosetests code/utils/tests data/tests --with-coverage --cover-package=data/data.py --cover-package=code/utils/functions | ||
|
||
test: | ||
nosetests code/utils data | ||
nosetests code/utils/tests data/tests | ||
|
||
verbose: | ||
nosetests -v code/utils data | ||
nosetests -v code/utils/tests data/tests |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,13 @@ | ||
# project-template | ||
# UC Berkeley Stat 159/259 Fall 2015 | ||
## Project-Theta | ||
|
||
[![Build Status](https://travis-ci.org/berkeley-stat159/project-theta.svg?branch=master)](https://travis-ci.org/berkeley-stat159/project-theta?branch=master) | ||
[![Coverage Status](https://coveralls.io/repos/berkeley-stat159/project-theta/badge.svg?branch=master)](https://coveralls.io/r/berkeley-stat159/project-theta?branch=master) | ||
|
||
Fall 2015 group project | ||
_**Group members:**_ Siyao Chang ([`changsiyao`](https://github.com/changsiyao)) , Boying Gong ([`boyinggong`](https://github.com/boyinggong)), Benjamin Hsieh ([`BenjaminHsieh`](https://github.com/BenjaminHsieh)), Brian Qiu ([`brianqiu`](https://github.com/brianqiu)), Jiang Zhu ([`pigriver123`](https://github.com/pigriver123)) | ||
|
||
_**Topic:**_ [The Neural Basis of Loss Aversion in Decision Making Under Risk] (https://openfmri.org/dataset/ds000005/) | ||
[SOME SUMMARY OF PAPER] | ||
|
||
## Instructions | ||
[NEED TO ADD] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
.PHONY: test coverage | ||
|
||
test: | ||
nosetests code/utils -w .. | ||
nosetests code/utils/tests -w .. | ||
|
||
coverage: | ||
nosetests code/utils -w .. --with-coverage --cover-package=utils | ||
nosetests code/utils/tests -w .. --with-coverage --cover-package=utils/functions |
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 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 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 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 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 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 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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
""" | ||
A collection of basic utility functions for use in outlier detection/graphing | ||
of fd, dvars, and meanSignal, see graphoutlier_functions.py | ||
""" | ||
|
||
import numpy as np | ||
import nibabel as nib | ||
|
||
|
||
def loadtxt_dict(file_name, fig_name): | ||
""" | ||
Input: | ||
Txt file specified by file_name | ||
Name of figure file wish to output | ||
Output: | ||
Dictonary that attached to file_name the np array after loading | ||
file_name | ||
""" | ||
data = np.loadtxt(file_name) | ||
dict_out = {fig_name: data} | ||
return dict_out | ||
|
||
def loadnib_dict(file_name, fig_name): | ||
""" | ||
Input: | ||
Bold file (bold.nii, bold.nii.gz) specified by file_name | ||
Name of figure file wish to output | ||
Output: | ||
Dictonary that attached to file_name the np array after loading file_name | ||
""" | ||
img = nib.load(file_name) | ||
data = img.get_data() | ||
dict_out = {fig_name: data} | ||
return dict_out | ||
|
||
|
||
# Calculate mean | ||
def vol_mean(data): | ||
""" Return mean across voxels for $D `data` | ||
Input: | ||
np array of data | ||
Output: np array of dim (T,) | ||
mean of data across all but the last dimension | ||
""" | ||
mean_list = [] | ||
# Loop over the each volume and outputs the mean of each dimension | ||
for i in range(data.shape[-1]): | ||
mean = np.mean(data[...,i]) | ||
mean_list.append(mean) | ||
return np.asarray(mean_list) |
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 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
Oops, something went wrong.