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
| radi = 10; | |
| seD = strel('diamond',1); | |
| close all; | |
| img = (ROI.RAW(:,:,2))*255; | |
| simg = size(img); | |
| background = imopen(medfilt2(img, [25 25]), strel('disk', round(length(img)/60))); | |
| imagesc(img-background ); axis image | |
| %img = img - background; | |
| img = img - min(img(:)); |
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
| close all; tic | |
| [X Y] = meshgrid(1:512, 1:512); | |
| Z = (X-255).^2 + (Y-255 -200).^2; | |
| Z(Z<50^2) = 1; | |
| Z(Z~=1) = 0; | |
| toc | |
| imagesc(Z); axis image; colorbar |
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
| if ~exist('m') | |
| m = mobiledev() | |
| end | |
| i=1; | |
| tic | |
| close all | |
| clear t x | |
| while true | |
| subplot(121) |
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
| clear all; | |
| close all; | |
| %% 適当にスパイクっぽいものの生成 | |
| x = -1.:0.25:6*pi; | |
| mu = [1 2]; | |
| sigma = [1 0.5; 0.5 2]; | |
| R = chol(sigma); | |
| z = randn(10,2)*R; | |
| z2 = randn(100120, 1); |
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
| function [] = msclab_mat2avi(frames, exportfileName, fps) | |
| % function [avifile] = msclab_mat2avi(frames, exportfileName, fps) | |
| % function for making moviefile from XxYxTime matrix | |
| % Value range should be 0~1. | |
| frameVol = size(frames); | |
| roi_window = [0 0 size(frames, 1) size(frames, 2)]; | |
| disp(['Export "' exportfileName '"...']); | |
| disp 'MatrixSize' | |
| disp([frameVol]) |
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
| %% Cell masker | |
| close all; clear all; | |
| rawImg = imread('coins.png'); | |
| mask = zeros(size(rawImg)); | |
| mask(1:end-1,1:end-1) = 1; | |
| % img = medfilt2(rawImg, [0.5 0.5]); | |
| img = imsharpen(rawImg); | |
| segmentImage(img) | |
| %% |
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
| int ir_out = 12; | |
| int led = 9; | |
| // Original Codefrom http://eikatou.net/blog/2012/07/1796/ | |
| // 全明 | |
| unsigned int data[] = {347,174,44,44,42,43,43,130,44,132,42,44,41,131,43,44,43,44,43,43,43,131,42,43,43,43,43,130,43,44,43,133,41,43,43,130,43,45,42,43,42,132,43,44,42,43,43,43,44,45,41,43,43,42,45,131,42,130,43,46,41,131,43,46,41,44,42,131,42,45,41,131,42,44,43,43,43,131,42,45,43,43,43}; | |
| unsigned int dataWarm[] = {343,173,46,43,40,48,38,133,40,135,38,48,38,136,38,48,40,45,38,48,41,132,41,45,38,48,38,132,41,46,41,135,41,45,38,135,38,48,38,48,38,136,38,133,40,136,38,48,42,44,38,136,38,132,41,48,38,136,38,48,38,48,38,48,38,133,41,48,38,135,38,48,38,48,38,133,40,132,44,42,42,132,44}; | |
| unsigned int dataCold[] = {343,179,41,43,43,46,40,132,39,132,41,45,41,131,42,48,40,43,41,48,41,130,41,46,40,46,41,130,44,48,38,132,41,46,41,132,41,46,41,48,38,130,43,133,41,132,41,48,39,45,41,46,41,131,43,45,41,132,41,45,41,46,41,45,41,132,41,132,41,132,41,45,41,45,42,132,41,132,42,48,38,132,41}; | |
| int last = 0; | |
| unsigned long us = micros |
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
| clear all; | |
| close all; | |
| % PVM1741 Params | |
| dp.Dist = 570; | |
| dp.Width = 365.8; | |
| dp.WidPx = 1920; | |
| % calc | |
| dp.WidDeg = 2*(atan(0.5*dp.Width/dp.Dist)*180/pi); % Angle of View |
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
| function [Citation] = pmid2APA(pmid) | |
| %% | |
| bufCell=pmid2medlineCell(pmid); | |
| %% JNS用 | |
| ROIcitation={'AU' 'DP' 'TI' 'TA' 'VI' 'IP' 'PG'}; | |
| for i=1:length(ROIcitation) | |
| eval(['Cell.' ROIcitation{i} '=strfind(bufCell, ''' ROIcitation{i} ''' );']); | |
| eval([ROIcitation{i} '=' '[];']); | |
| end |
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
| def linspace(initVal, last, num) | |
| arr = [*initVal..num] | |
| arr = arr.collect{|i| i.to_f*last/num} | |
| return arr | |
| end |