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
#! -*- coding:utf-8 -*- | |
import sys; reload(sys); sys.setdefaultencoding('utf-8') | |
import cv2; import numpy as np; from cv2 import cv; | |
from time import time | |
import matplotlib.pyplot as plt | |
try: from psychopy.core import quit; | |
except: pass | |
""" [1] 데이터 플랏 윈도우 세팅 """ | |
fig = plt.figure(); # 그래프를 그리기 위한 변수 정의 |
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 python2 | |
# -*- coding: utf-8 -*- | |
""" | |
Vibrotactile Experiment (Version: 2015-04-28) | |
Made by Hio-been Han & Dongmyeong Lee @KIST.jeelab | |
Written in python2.7 with PsychoPy2 (www.psychopy.org by J. Pierce) | |
Revision/Error report -> hiobeen@yonsei.ac.kr | |
""" |
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 leap_image, sys, Leap, time, numpy as np | |
from matplotlib import pyplot as plt | |
import cv2 | |
import cv2.cv as cv | |
colormap = 'gist_gray' | |
fig = plt.figure() | |
my_figure = plt.imshow(np.ones([420,420]),vmin=0,vmax=235,cmap=colormap) | |
fig.show(); plt.ion() |
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
__author__ = 'Hiobeen_MBPR' | |
#!/usr/bin/python2 | |
""" (0) Import modules """ | |
import facemorpher, os | |
# Get a list of image paths in a folder | |
""" (1) Path & Variable setting """ | |
fd = '/Users/Hiobeen_MBPR/PycharmProjects/python_sketchpad/pics/' | |
filelist_temp = os.listdir(fd) |
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
% ---- script structure ---- | |
% %% (0) Set dataset directory and subject list | |
% | |
% % 0-1 : Set subject list | |
% % 0-2 : Set directory | |
% % 0-3 : Set anatomy & functional image to handle easily | |
% % 0-3-1 : ANATOMY unzip & reorient | |
% % 0-3-2 : FUNCTIONAL de-compress (batch TRs into single TR) | |
% | |
% %% (1) Start preprocessing batch loop |
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 success = hb_mat2ARFF(v,arff_filename, relationtxt , titletxt) | |
%success = hb_mat2ARFF(v,arff_filename, relationtxt , titletxt) | |
% *.mat binary to WEKA ARFF | |
% hiobeen@yonsei.ac.kr | |
if nargin < 4 | |
titletxt = 'temp.arff'; | |
end ; if nargin < 3 | |
relationtxt ='hb_variable'; | |
end ; if nargin < 2 |
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 [v,nBad,badIdx] = hb_3Dto1D(mat) | |
% Convert fMRI data of 4D (X,Y,Z+time) into 2D (space,time) | |
sizes = size(mat); | |
v = nan([sizes(1)*sizes(2)*sizes(3),sizes(4)]); | |
% 3D to 1D | |
for idx = 1:size(mat, 4) | |
temp = mat(:,:,:,idx); | |
v(:,idx) = temp(:); |
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
#! -*-coding: utf-8 -*- | |
__author__ = 'Hio-been' | |
import pandas.io.data as web | |
from datetime import datetime | |
import matplotlib.pyplot as plt | |
import os, sys; reload(sys); sys.setdefaultencoding('utf-8') | |
import numpy as np | |
#https://gist.github.com/Han-Hiobeen/faba03d188452981c1ed |
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
%% calculate functional connectivity between two voxels | |
% function [ connectivity_collection,... | |
% basic_r, basic_cr, basic_cr_lag,... % correlation and cross-corr for HIGHPASS (replica) | |
% band_r, band_cr, band_cr_lag,... % correlation and cross-corr for BANDPASS | |
% band_ch, band_plv ] = ... | |
% hb_getConnectivity_ds115(hp1, hp2, bp1, bp2) | |
function [ connectivity_collection,... | |
basic_r, basic_cr, basic_cr_lag,... % correlation and cross-corr for HIGHPASS (replica) | |
band_r, band_cr, band_cr_lag,... % correlation and cross-corr for BANDPASS |
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 [pval, ci, stats] = hb_anovaContrast_withStats(stats, cont_coeffs, alpha) | |
%% INPUT data type | |
% | |
% stats <- structure type % | |
% stats.Ns : [1 x nCondition] matrix, number of samples | |
% stats.Ms : [1 x nCondition] matrix, means | |
% stats.Ss : [1 x nCondition] matrix, standard deviations | |
% cont_coeffs <- [ 1, -1, 0, 0 ...]; % should be length at nCondition | |
% | |
% written by Hio-Been Han, for GOSHIMTONG 2016-1, YONSEI PSYCHOLOGY |
OlderNewer