plateform stringclasses 1
value | repo_name stringlengths 13 113 | name stringlengths 3 74 | ext stringclasses 1
value | path stringlengths 12 229 | size int64 23 843k | source_encoding stringclasses 9
values | md5 stringlengths 32 32 | text stringlengths 23 843k |
|---|---|---|---|---|---|---|---|---|
github | APSDetectors/RoachFirmPy-master | gen_ucf.m | .m | RoachFirmPy-master/ANLYellowBlocks/mkid_dacadc_4x/xps_library/@xps_adc_mkid_4x_r2/gen_ucf.m | 3,032 | utf_8 | 26e3675df4b10667893187319a84bbc2 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% Center for Astronomy Signal Processing and Electronics Research %
% http://seti.ssl.berkeley.edu/casper/ %
... |
github | APSDetectors/RoachFirmPy-master | set.m | .m | RoachFirmPy-master/ANLYellowBlocks/mkid_dacadc_4x/xps_library/@xps_adc_mkid_4x_r2/set.m | 1,837 | utf_8 | 36e88663abfc3840e2a2596d6628fb05 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% Center for Astronomy Signal Processing and Electronics Research %
% http://seti.ssl.berkeley.edu/casper/ ... |
github | APSDetectors/RoachFirmPy-master | xps_adc_mkid_4x_r2.m | .m | RoachFirmPy-master/ANLYellowBlocks/mkid_dacadc_4x/xps_library/@xps_adc_mkid_4x_r2/xps_adc_mkid_4x_r2.m | 5,361 | utf_8 | 31719e618341a5d447fcf15c4d2e761a | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% Center for Astronomy Signal Processing and Electronics Research %
% http://seti.ssl.berkeley.edu/casper/ %
... |
github | pquochuy/Audio-Event-Features-master | fzcr.m | .m | Audio-Event-Features-master/fzcr.m | 158 | utf_8 | 5e67f8141199786d59bd3e6b27e61954 | % count zero crossings
function [z] = fzcr(x)
x_ = zeros(size(x));
x_(2 : end) = x(1 : end-1);
z = sum(abs(sign(x) - sign(x_)))/(2*length(x));
end |
github | pquochuy/Audio-Event-Features-master | trifbank.m | .m | Audio-Event-Features-master/_core/trifbank.m | 2,372 | utf_8 | 399001dda0009b44b9265aec39ef04d7 |
function [ H, f, c ] = trifbank( M, K, R, fs, h2w, w2h )
% TRIFBANK Triangular filterbank.
%
% [H,F,C]=TRIFBANK(M,K,R,FS,H2W,W2H) returns matrix of M triangular filters
% (one per row), each K coefficients long along with a K coefficient long
% frequency vector F and M+2 coefficient long cutoff frequency vecto... |
github | akhanf/vasst-dev-master | genAlignedNiftiRGB_Hp.m | .m | vasst-dev-master/epilepsy/register_ex_histology/deprecated/genAlignedNiftiRGB_Hp.m | 5,661 | utf_8 | 3972484b3da78e23807f866a0c853c53 |
% transform rgb 100 um pngs to 3D nifti's in aligned space
function genAlignedNiftiRGB_Hp(subj, struct, session,png_res)
data_dir=sprintf('/eq-nas/%s/EpilepsyDatabase',getenv('USER'));
hist_dir=sprintf('/eq-nas/%s/EpilepsyHistology',getenv('USER'));
%line below for testing
%subj='EPI_P040'; struct='Neo'; session='... |
github | akhanf/vasst-dev-master | barwitherr.m | .m | vasst-dev-master/tools/matlab/barwitherr.m | 6,062 | utf_8 | 894962c3205f5ba925dd59c84274e516 | %**************************************************************************
%
% This is a simple extension of the bar plot to include error bars. It
% is called in exactly the same way as bar but with an extra input
% parameter "errors" passed first.
%
% Parameters:
% errors - the errors to be plotted (extra... |
github | akhanf/vasst-dev-master | nrrdread.m | .m | vasst-dev-master/tools/matlab/nrrdread.m | 4,336 | utf_8 | c8da0a11197d4ee17837cf8582dcee34 | function [X, meta] = nrrdread(filename)
%NRRDREAD Import NRRD imagery and metadata.
% [X, META] = NRRDREAD(FILENAME) reads the image volume and associated
% metadata from the NRRD-format file specified by FILENAME.
%
% Current limitations/caveats:
% * "Block" datatype is not supported.
% * Only tested with "... |
github | akhanf/vasst-dev-master | reorderCaminoConnectivityMatrix.m | .m | vasst-dev-master/tools/matlab/reorderCaminoConnectivityMatrix.m | 718 | utf_8 | 45d192cd7037b41f6f292b80f344483c |
function reorderCaminoConnectivityMatrix (input_conmat_csv,input_label_list_txt,output_mat)
conmat=importdata(input_conmat_csv);
lut=readtable(input_label_list_txt,'Delimiter',' ','ReadVariableNames',false);
%first, create LUT to go from input index to output index
index_lut=zeros(size(lut,1),1);
for i=1:length(in... |
github | akhanf/vasst-dev-master | fdr_bh.m | .m | vasst-dev-master/tools/matlab/fdr_bh.m | 9,039 | utf_8 | 6ee458c4ce61569d12d9b362c8b4c276 | % fdr_bh() - Executes the Benjamini & Hochberg (1995) and the Benjamini &
% Yekutieli (2001) procedure for controlling the false discovery
% rate (FDR) of a family of hypothesis tests. FDR is the expected
% proportion of rejected hypotheses that are mistakenly rejected
% ... |
github | akhanf/vasst-dev-master | applyTransformPNG.m | .m | vasst-dev-master/tools/matlab/applyTransformPNG.m | 1,110 | utf_8 | b65ae5fd93c0c9839e1edb350f14e0bf |
%transform 2D image with linear flirt xfm
function applyTransformPNG ( in_png, ref_png, flirt_xfm, png_res, out_png, inverse)
%bgnd val for hist pngs
histfillval=244;
T=importdata(flirt_xfm);
T=T([1 2 4],[1 2 4]);
%applyxfm to pix coords
sform=eye(3); %vox to phys
... |
github | akhanf/vasst-dev-master | computeSegStats.m | .m | vasst-dev-master/tools/matlab/computeSegStats.m | 1,485 | utf_8 | 1295dcf1d9bcc839bbf2ed81cb6d23ee |
function computeSegStats (label_csv,label_root,label_path,img_root,img_path,subjlist,out_csv,out_mat)
%
% label_csv='/home/ROBARTS/alik/vasst-dev-local/pipeline/cfg/labels/name_number/JHU-labels.csv'
%
% label_root='/eq-nas/alik/EpilepsyDatabase/EPL14B';
% img_root='/eq-nas/alik/EpilepsyDatabase/EPL14B';
%
% label_... |
github | akhanf/vasst-dev-master | convertNifti4DtoRGB24.m | .m | vasst-dev-master/tools/matlab/convertNifti4DtoRGB24.m | 899 | utf_8 | 1cbac6824fba6a3e1ddc79205ffc4e5c | % convert 4D uchar to RGB nifti
function convertNifti4DtoRGB24 ( in_nii_gz, out_nii_gz)
%in_nii_gz='/eq-nas/alik/EpilepsyDatabase/standard/projects/atlases/ctrl_avg/dti/distortCorrect/caminoDTI/dt_rgb.4d.nii.gz';
%out_nii_gz='/eq-nas/alik/EpilepsyDatabase/standard/projects/atlases/ctrl_avg/dti/distortCorrect/caminoDT... |
github | akhanf/vasst-dev-master | getConnectivitySubj.m | .m | vasst-dev-master/tools/matlab/getConnectivitySubj.m | 1,491 | utf_8 | 95018d3a75d151aa9abed7e51fc66b10 | % by alik, modified by jlau
% takes as input pre-processed fMRI subject data and computes time series, correlation, partial correlation
% modified 20150904 before being committed to git
function [C,T,V]=getConnectivitySubj(subj,label_csv)
work_dir=pwd;
[lbl,timeseries] = textread([label_csv],'%d %*d %*s %*s %*s ... |
github | akhanf/vasst-dev-master | convertNiftiFLOAT32to4D.m | .m | vasst-dev-master/tools/matlab/convertNiftiFLOAT32to4D.m | 711 | utf_8 | 78b0c57f4d115758ac30fd37fdd36114 | % convert FLOAT32 to 4D nifti
% purpose: for niftyreg deformation/displacement fields which are collapsed
% and only shown dim4 = 1
% path to script: /cluster/software/vasst-dev/tools/matlab/
function convertNiftiFLOAT32to4D ( in_nii_gz, out_nii_gz)
% define input and output files
out_nii=out_nii_gz(1:end-3)... |
github | akhanf/vasst-dev-master | convertNiftiRGB24to4D.m | .m | vasst-dev-master/tools/matlab/convertNiftiRGB24to4D.m | 1,025 | utf_8 | 6e00d85e3d7a92928888acc26d3abb28 | % convert RGB to 4D uchar nifti
function convertNiftiRGB24to4D ( in_nii_gz, out_nii_gz)
%in_nii_gz='/eq-nas/alik/EpilepsyDatabase/standard/projects/atlases/ctrl_avg/dti/distortCorrect/caminoDTI/dt_rgb.nii.gz';
%out_nii_gz='/eq-nas/alik/EpilepsyDatabase/standard/projects/atlases/ctrl_avg/dti/distortCorrect/caminoDTI/d... |
github | akhanf/vasst-dev-master | savejson.m | .m | vasst-dev-master/tools/matlab/jsonlab/savejson.m | 18,983 | utf_8 | 2f510ad749556cadd303786e2549f30a | function json=savejson(rootname,obj,varargin)
%
% json=savejson(rootname,obj,filename)
% or
% json=savejson(rootname,obj,opt)
% json=savejson(rootname,obj,'param1',value1,'param2',value2,...)
%
% convert a MATLAB object (cell, struct or array) into a JSON (JavaScript
% Object Notation) string
%
% author: Qianqian Fa... |
github | akhanf/vasst-dev-master | loadjson.m | .m | vasst-dev-master/tools/matlab/jsonlab/loadjson.m | 16,145 | ibm852 | 7582071c5bd7f5e5f74806ce191a9078 | function data = loadjson(fname,varargin)
%
% data=loadjson(fname,opt)
% or
% data=loadjson(fname,'param1',value1,'param2',value2,...)
%
% parse a JSON (JavaScript Object Notation) file or string
%
% authors:Qianqian Fang (fangq<at> nmr.mgh.harvard.edu)
% created on 2011/09/09, including previous works from
%
% ... |
github | akhanf/vasst-dev-master | loadubjson.m | .m | vasst-dev-master/tools/matlab/jsonlab/loadubjson.m | 13,300 | utf_8 | b15e959f758c5c2efa2711aa79c443fc | function data = loadubjson(fname,varargin)
%
% data=loadubjson(fname,opt)
% or
% data=loadubjson(fname,'param1',value1,'param2',value2,...)
%
% parse a JSON (JavaScript Object Notation) file or string
%
% authors:Qianqian Fang (fangq<at> nmr.mgh.harvard.edu)
% created on 2013/08/01
%
% $Id$
%
% input:
% fname: ... |
github | akhanf/vasst-dev-master | saveubjson.m | .m | vasst-dev-master/tools/matlab/jsonlab/saveubjson.m | 17,723 | utf_8 | 3414421172c05225dfbd4a9c8c76e6b3 | function json=saveubjson(rootname,obj,varargin)
%
% json=saveubjson(rootname,obj,filename)
% or
% json=saveubjson(rootname,obj,opt)
% json=saveubjson(rootname,obj,'param1',value1,'param2',value2,...)
%
% convert a MATLAB object (cell, struct or array) into a Universal
% Binary JSON (UBJSON) binary string
%
% author... |
github | akhanf/vasst-dev-master | genAlignedNiftiRGB.m | .m | vasst-dev-master/tools/matlab/epilepsy/genAlignedNiftiRGB.m | 5,404 | utf_8 | 277bbcbd8355498712852bf933ba37f8 | % transform rgb 100 um pngs to 3D nifti's in aligned space
function genAlignedNiftiRGB(data_dir,subj, struct, session,png_res,histology_study)
hist_dir=sprintf('/eq-nas/%s/EpilepsyHistology/%s',getenv('USER'),histology_study);
%line below for testing
%subj='EPI_P040'; struct='Neo'; session='9.4T'; png_res=100;
re... |
github | akhanf/vasst-dev-master | computeColourDeconvolve.m | .m | vasst-dev-master/tools/matlab/histology/computeColourDeconvolve.m | 517 | utf_8 | ad59a797fdc10e93cfd665e14f3cd55e |
function out_img=computeColourDeconvolve(in_img,MOD)
% MOD is correct at this point
%now to apply to RGB:
% added +1 to avoid log(0) becoming Inf - Aug 30,2016
od_img=- ( 255.*log(double(in_img+1)./255) ./ log(255) );
%out_img=zeros(size(od_img));
D=inv(MOD)';
%out_img=exp(-(out_img-255.0)*log(255)/255);
% ve... |
github | akhanf/vasst-dev-master | genHistNiftiPng.m | .m | vasst-dev-master/tools/matlab/histology/genHistNiftiPng.m | 6,820 | utf_8 | a4fca154fd2b8a4dd8b48590ba1c872d | % generate 100um png and nifti files
function genHistNiftiPng ( datadir, out_res, varargin )
%addpath('~/epilepsy/shared_data/scripts/histology');
%datadir='/media/Histology/Histology';
subjs=varargin;
%only generate 2um pngs for NEUN
%resolutions={100,20,2}; %100
%nii or png?
%stain?
%resolution?
%100 -> all sta... |
github | akhanf/vasst-dev-master | genHistNiftiPngFromThumbnail.m | .m | vasst-dev-master/tools/matlab/histology/genHistNiftiPngFromThumbnail.m | 3,172 | utf_8 | dec84cc836c1a747a2ad12147414a372 | % generate 100um png and nifti files
function genHistNiftiPngFromThumbnail ( datadir, out_dir, out_res, varargin )
subjs=varargin;
out_res_mm=out_res/1000;
for s=1:length(subjs);
subj=subjs{s};
histdir=sprintf('%s/%s/tif',datadir,subj);
niidir=sprintf('%s/%s/%dum_Grayscale_nii',out_dir,subj,out... |
github | akhanf/vasst-dev-master | loadHistologyAnnotation.m | .m | vasst-dev-master/tools/matlab/histology/loadHistologyAnnotation.m | 2,024 | utf_8 | 9b8f2564459b901e6758af0198b7128c | %% get landmarks for stain coregistration validation -- on HE, GFAP, NEUN --
function loadHistologyAnnotation (annot_folder , res_microns);
hist_microns=0.5;
ds=res_microns./hist_microns;
[path,annot_name,ext]=fileparts(annot_folder);
out_dir=sprintf('%s/../%dum_Annotations_%s',path,res_microns,annot_name);
mkdir(o... |
github | akhanf/vasst-dev-master | genAlignedFeatureMap_general_initLmk.m | .m | vasst-dev-master/tools/matlab/histology/genAlignedFeatureMap_general_initLmk.m | 4,714 | utf_8 | 12f4b4012b8086439fa9e9c931a25687 | % transform feature map 100 um niftis to 3D nifti's in aligned space
function genAlignedFeatureMap_general(data_dir,subj, struct, stain,in_dir,out_dir,out_name,res_um);
%featuredir is where reg niftis exist
resetvol=0;
%get resolution from input image
%res_um=100;
res_mm=res_um/1000;
reg_dir=sprintf('%s/... |
github | akhanf/vasst-dev-master | loadHistologyAnnotation_linkContours.m | .m | vasst-dev-master/tools/matlab/histology/loadHistologyAnnotation_linkContours.m | 4,117 | utf_8 | b9cdb468dd35501a62fed4d89b90db64 | %% get landmarks for stain coregistration validation -- on HE, GFAP, NEUN --
function loadHistologyAnnotation (annot_folder , res_microns);
hist_microns=0.5;
ds=res_microns./hist_microns;
[path,annot_name,ext]=fileparts(annot_folder);
out_dir=sprintf('%s/../%dum_Annotations_%s',path,res_microns,annot_name);
mkdir(o... |
github | akhanf/vasst-dev-master | genAlignedFeatureMapVecOrient.m | .m | vasst-dev-master/tools/matlab/histology/genAlignedFeatureMapVecOrient.m | 4,576 | utf_8 | c1af201709df5e10b98e7f71aa77e3a9 |
% transform feature map 100 um niftis to 3D nifti's in aligned space
function genAlignedFeatureMapVecOrient(data_dir,subj, struct, session,stain,in_dir,out_dir,out_name)
%featuredir is where reg niftis exist
resetvol=0;
png_res=100;
png_res_mm=png_res/1000;
%line below for testing
%subj='EPI_P040'; struct='... |
github | akhanf/vasst-dev-master | genAlignedFeatureMap_general.m | .m | vasst-dev-master/tools/matlab/histology/genAlignedFeatureMap_general.m | 4,806 | utf_8 | d3cf98f2ee0029ff7b6ab87bf24d1c02 | % transform feature map 100 um niftis to 3D nifti's in aligned space
function genAlignedFeatureMap_general(data_dir,subj, struct, stain,in_dir,out_dir,out_name,res_um);
%featuredir is where reg niftis exist
resetvol=0;
%get resolution from input image
%res_um=100;
res_mm=res_um/1000;
reg_dir=sprintf('%s/... |
github | akhanf/vasst-dev-master | genAlignedFeatureMap.m | .m | vasst-dev-master/tools/matlab/histology/genAlignedFeatureMap.m | 4,544 | utf_8 | c56cc177aabe3de2733348e565b7a767 | % transform feature map 100 um niftis to 3D nifti's in aligned space
function genAlignedFeatureMap(data_dir,subj, struct, session, stain,in_dir,out_dir,out_name,res_um);
%featuredir is where reg niftis exist
resetvol=0;
%get resolution from input image
%res_um=100;
res_mm=res_um/1000;
reg_dir=sprintf('%s/... |
github | akhanf/vasst-dev-master | generateVonMisesFeatures.m | .m | vasst-dev-master/tools/matlab/histology/generateVonMisesFeatures.m | 1,581 | utf_8 | fd197d68645c10c2858cbe4e7931cbd2 |
function generateVonMisesFeatures (in_mat,out_mat)
warning('off','all')
load(in_mat);
% compute von mises features
vm_a=zeros(size(hist_counts));
vm_k=zeros(size(hist_counts));
vm_mu=zeros(size(hist_counts));
vm_adjrsquare=zeros(size(hist_counts));
vm_a1=zeros(size(hist_counts));
vm_k1=zeros(size(hist_counts));
v... |
github | akhanf/vasst-dev-master | dump_struct.m | .m | vasst-dev-master/tools/matlab/histology/toolbox_general/dump_struct.m | 1,389 | utf_8 | 746b6d65b8fc8c67e8cb806c235f5e6a | function fid = dump_struct(s,fid,header)
% dump_struct - dump the content of a struct to a file
%
% dump_struct(s,fid, header);
%
% Copyright (c) 2008 Gabriel Peyre
if nargin<3
header = '';
end
if isstr(fid)
fid = fopen(fid, 'a');
if fid<=0
error(['File ' fid ' does not exist.']);
end
en... |
github | akhanf/vasst-dev-master | poissrnd.m | .m | vasst-dev-master/tools/matlab/histology/toolbox_general/poissrnd.m | 10,053 | utf_8 | 64b00f80e484b0c01bfd50a87756f587 | function r = poissrnd(lambda,m,n)
%POISSRND Random matrices from Poisson distribution.
% R = POISSRND(LAMBDA) returns a matrix of random numbers chosen
% from the Poisson distribution with parameter LAMBDA.
%
% The size of R is the size of LAMBDA. Alternatively,
% R = POISSRND(LAMBDA,M,N) returns an M by N... |
github | akhanf/vasst-dev-master | perform_faces_reorientation.m | .m | vasst-dev-master/tools/matlab/histology/toolbox_general/perform_faces_reorientation.m | 2,816 | utf_8 | 2cf3d5c1ad6ea271b524352db5492c2c | function faces = perform_faces_reorientation(vertex,faces, options)
% perform_faces_reorientation - reorient the faces with respect to the center of the mesh
%
% faces = perform_faces_reorientation(vertex,faces, options);
%
% try to find a consistant reorientation for faces of a mesh.
%
% if options.method = 'fast... |
github | akhanf/vasst-dev-master | gamrnd.m | .m | vasst-dev-master/tools/matlab/histology/toolbox_general/gamrnd.m | 10,861 | utf_8 | 9b8a786919b4ddfbebdf74985b19ebb2 | function r = gamrnd(a,b,m,n);
%GAMRND Random matrices from gamma distribution.
% R = GAMRND(A,B) returns a matrix of random numbers chosen
% from the gamma distribution with parameters A and B.
% The size of R is the common size of A and B if both are matrices.
% If either parameter is a scalar, the size of ... |
github | akhanf/vasst-dev-master | binornd.m | .m | vasst-dev-master/tools/matlab/histology/toolbox_general/binornd.m | 9,362 | utf_8 | 0ca5d51eb461d57552c90487eab9946d | function r=binornd(n,p,mm,nn)
% BINORND Random matrices from a binomial distribution.
% R = BINORND(N,P,MM,NN) is an MM-by-NN matrix of random
% numbers chosen from a binomial distribution with parameters N and P.
%
% The size of R is the common size of N and P if both are matrices.
% If either parameter is a scalar, ... |
github | akhanf/vasst-dev-master | iradon.m | .m | vasst-dev-master/tools/matlab/histology/toolbox_signal/iradon.m | 9,900 | utf_8 | 28cae50d959ca460cfc01acf31c2e700 | function [img,H] = iradon(varargin)
%IRADON Compute inverse Radon transform.
% I = iradon(R,THETA) reconstructs the image I from projection
% data in the 2-D array R. The columns of R are parallel beam
% projection data. IRADON assumes that the center of rotation
% is the center point of the projections, wh... |
github | akhanf/vasst-dev-master | load_signal.m | .m | vasst-dev-master/tools/matlab/histology/toolbox_signal/load_signal.m | 12,338 | utf_8 | b70e4cb57d6b467ae9c90d4b3310a81f | function y = load_signal(name, n, options)
% load_signal - load a 1D signal
%
% y = load_signal(name, n, options);
%
% name is a string that can be :
% 'regular' (options.alpha gives regularity)
% 'step', 'rand',
% 'gaussiannoise' (options.sigma gives width of filtering in pixels),
% [natural signa... |
github | akhanf/vasst-dev-master | load_hdr.m | .m | vasst-dev-master/tools/matlab/histology/toolbox_signal/load_hdr.m | 4,933 | utf_8 | 6e9f25ee3fd41a80fb31c4e53984631b | function [img, fileinfo] = load_hdr(filename)
% load_hdr - loading a radiance RBGE file.
%
% [img, fileinfo] = load_hdr(filename);
%
% Written by Lawrence A. Taplin (taplin@cis.rit.edu)
%
% Based loosely on the c-code RGBE implementation written by Bruce Walters
% http://www.graphics.cornell.edu/~bjw/rgbe.html
%
% f... |
github | akhanf/vasst-dev-master | perform_wavortho_transf.m | .m | vasst-dev-master/tools/matlab/histology/toolbox_signal/perform_wavortho_transf.m | 2,728 | utf_8 | 6476ef3c801e5a72274dd3d854e438cc | function f = perform_wavortho_transf(f,Jmin,dir,options)
% perform_wavortho_transf - compute orthogonal wavelet transform
%
% fw = perform_wavortho_transf(f,Jmin,dir,options);
%
% You can give the filter in options.h.
%
% Works in arbitrary dimension.
%
% Copyright (c) 2009 Gabriel Peyre
options.n... |
github | akhanf/vasst-dev-master | plot_curvelet.m | .m | vasst-dev-master/tools/matlab/histology/toolbox_signal/plot_curvelet.m | 2,421 | utf_8 | a1a1177c6c1d743518abcfacae1e9e03 | function J = plot_curvelet(MW, options)
% plot_curvelet - display curvelets coefficients
%
% J = plot_curvelet(MW);
%
% Based on curvelab.
%generate curvelet image (a complex array)
I = fdct_wrapping_dispcoef(MW);
% remove bckgd
U = (I==.5);
J = ones(size(I)+2);
JU = ones(size(I)+2);
J(2:end-1,2:end-1) = I;
JU... |
github | akhanf/vasst-dev-master | plot_tensor_field.m | .m | vasst-dev-master/tools/matlab/histology/toolbox_signal/plot_tensor_field.m | 5,736 | utf_8 | 8e241783316bc4c13529031d81db17d4 | function h = plot_tensor_field(H, M, options)
% plot_tensor_field - display a tensor field
%
% h = plot_tensor_field(H, M, options);
%
% options.sub controls sub-sampling
% options.color controls color
%
% Copyright (c) 2006 Gabriel Peyre
if nargin<3
options.null = 0;
end
if not( isstruct(op... |
github | akhanf/vasst-dev-master | perform_homotopy.m | .m | vasst-dev-master/tools/matlab/histology/toolbox_signal/perform_homotopy.m | 11,418 | utf_8 | dd245ff8cad26000a60436c3c2e2c418 | function [X,Lambda] = perform_homotopy(D,y)
% perform_homotopy - compute the L1 regularization path
%
% X = perform_homotopy(D,y);
%
% Copyright (c) 2012 Gabriel Peyre
[P,N] = size(D);
niter = 10*P;
X = []; Lambda = [];
% initialization
C = D'*y;
[lambda,I] = max(abs(C));
x = zeros(N,1);
X(:,end+1) = x; Lambda(e... |
github | akhanf/vasst-dev-master | load_image.m | .m | vasst-dev-master/tools/matlab/histology/toolbox_signal/load_image.m | 20,071 | utf_8 | 2407ce9458db2bca9c208e744785af5a | function M = load_image(type, n, options)
% load_image - load benchmark images.
%
% M = load_image(name, n, options);
%
% name can be:
% Synthetic images:
% 'chessboard1', 'chessboard', 'square', 'squareregular', 'disk', 'diskregular', 'quaterdisk', '3contours', 'line',
% 'line_vertical', 'l... |
github | akhanf/vasst-dev-master | perform_curvelet_transform.m | .m | vasst-dev-master/tools/matlab/histology/toolbox_signal/perform_curvelet_transform.m | 33,957 | utf_8 | 63811c4cedefc4b0a5ede5a2b3269c54 | function y = perform_curvelet_transform(x,options)
% perform_curvelet_transform - a wrapper to curvlab
%
% M = perform_curvelet_transform(MW,options);
%
% Forward and backward curvelet transform
% You must provide options.n (width of the image).
%
% Visit www.curvelab.org for the full code.
optio... |
github | akhanf/vasst-dev-master | perform_wavelet_transf.m | .m | vasst-dev-master/tools/matlab/histology/toolbox_signal/perform_wavelet_transf.m | 6,359 | utf_8 | e186b6bffa94179c6c7e4497ba32e904 | function x = perform_wavelet_transf(x, Jmin, dir, options)
% perform_wavelet_transf - peform fast lifting transform
%
% y = perform_wavelet_transf(x, Jmin, dir, options);
%
% Implement 1D and 2D symmetric wavelets with symmetric boundary treatements, using
% a lifting implementation.
%
% h = options.f... |
github | akhanf/vasst-dev-master | perform_thresholding.m | .m | vasst-dev-master/tools/matlab/histology/toolbox_signal/perform_thresholding.m | 6,251 | utf_8 | 47aba185bb0bd0505c7e8aa326bc40c1 | function y = perform_thresholding(x, t, type, options)
% perform_thresholding - perform hard or soft thresholding
%
% y = perform_thresholding(x, t, type, options);
%
% t is the threshold
% type is either 'hard' or 'soft' or 'semisoft' or 'strict' or 'block'.
%
% works also for complex data, and for cell array... |
github | akhanf/vasst-dev-master | perform_stft.m | .m | vasst-dev-master/tools/matlab/histology/toolbox_signal/perform_stft.m | 5,289 | utf_8 | b4057f12e297c275b4333d8483ce92dd | function y = perform_stft(x, w,q, options)
% perform_stft - compute a local Fourier transform
%
% Forward transform:
% MF = perform_stft(M,w,q, options);
% Backward transform:
% M = perform_stft(MF,w,q, options);
%
% w is the width of the window used to perform local computation.
% q is the spacing betwen eac... |
github | akhanf/vasst-dev-master | perform_solve_bp.m | .m | vasst-dev-master/tools/matlab/histology/toolbox_signal/perform_solve_bp.m | 72,049 | utf_8 | 527f7660ac12d11f05dda0f0f346b726 | function sol = p(A, y, N, maxIters, lambda, OptTol)
% SolveBP: Solves a Basis Pursuit problem
% Usage
% sol = SolveBP(A, y, N, maxIters, lambda, OptTol)
% Input
% A Either an explicit nxN matrix, with rank(A) = min(N,n)
% by assumption, or a string containing the name of a
% ... |
github | akhanf/vasst-dev-master | phantom.m | .m | vasst-dev-master/tools/matlab/histology/toolbox_signal/phantom.m | 6,447 | utf_8 | 5cac992f6a3cdfa201a0e3dc7206f4b3 | function [p,ellipse]=phantom(varargin)
%PHANTOM Generate a head phantom image.
% P = PHANTOM(DEF,N) generates an image of a head phantom that can
% be used to test the numerical accuracy of RADON and IRADON or other
% 2-D reconstruction algorithms. P is a grayscale intensity image that
% consists of ... |
github | akhanf/vasst-dev-master | perform_arith_coding.m | .m | vasst-dev-master/tools/matlab/histology/toolbox_signal/perform_arith_coding.m | 30,315 | utf_8 | b017b1e1fe107dfccde92738b628d194 | function [y,nbr_bits] = perform_arith_coding(xC, dir)
% perform_arithmetic_coding_slow - perform adaptive arithmetic coding
%
% [y,nbr_bits] = perform_arithmetic_coding_slow(x, dir);
%
% dir=1 for encoding, dir=-1 for decoding.
%
% Based on the code of (c) Karl Skretting
%
% Copyright (c) 2008 Gabriel Peyre
%
% ... |
github | akhanf/vasst-dev-master | perform_omp.m | .m | vasst-dev-master/tools/matlab/histology/toolbox_signal/perform_omp.m | 9,857 | utf_8 | 84fa05746f22e0ac58735d2c53b486f1 | function X = perform_omp(D,Y,options)
% perform_omp - perform orthogonal matching pursuit
%
% X = perform_omp(D,Y,options);
%
% D is the dictionary of size (n,p) of p atoms
% Y are the m vectors to decompose of size (n,m)
% X are the m coefficients of the decomposition of size (p,m).
%
% Orthogonal matching ... |
github | akhanf/vasst-dev-master | mad.m | .m | vasst-dev-master/tools/matlab/histology/toolbox_signal/mad.m | 7,921 | utf_8 | 6d4949e64f7802d97e068c87415b0460 | function y = mad(x,flag)
%MAD Mean/median absolute deviation.
% Y = MAD(X) returns the mean absolute deviation of the values in X. For
% vector input, Y is MEAN(ABS(X-MEAN(X)). For a matrix input, Y is a row
% vector containing the mean absolute deviation of each column of X. For
% N-D arrays, MAD oper... |
github | akhanf/vasst-dev-master | plot_hufftree.m | .m | vasst-dev-master/tools/matlab/histology/toolbox_signal/plot_hufftree.m | 792 | utf_8 | b3a28991b5dc6e37df21dad9f445068a | function plot_hufftree(T,p)
% plot_hufftree - plot a huffman tree
%
% plot_hufftree(T);
%
% Copyright (c) 2008 Gabriel Peyre
hold on;
plot_tree(T{1},[0,0],1);
hold off;
axis tight;
axis off;
%%
function plot_tree(T,x,j)
tw = 15;
lw = 1.5;
ms = 10;
if not(iscell(T))
de = [-.02 -.2];
... |
github | akhanf/vasst-dev-master | perform_haar_transf.m | .m | vasst-dev-master/tools/matlab/histology/toolbox_signal/perform_haar_transf.m | 3,170 | utf_8 | 14b7d7fd610eca05949ef196c55d7b83 | function f = perform_haar_transf(f, Jmin, dir, options)
% perform_haar_transf - peform fast Haar transform
%
% y = perform_haar_transf(x, Jmin, dir);
%
% Implement a Haar wavelets.
% Works in any dimension.
%
% Copyright (c) 2008 Gabriel Peyre
n = size(f,1);
Jmax = log2(n)-1;
if dir==1
%%% FORWARD %%%
... |
github | akhanf/vasst-dev-master | perform_huffcoding.m | .m | vasst-dev-master/tools/matlab/histology/toolbox_signal/perform_huffcoding.m | 1,491 | utf_8 | 41a9144e1a2da192d37cf10a40add3e2 | function y = perform_huffcoding(x,T,dir)
% perform_huffcoding - perform huffman coding
%
% y = perform_huffcoding(x,T,dir);
%
% dir=+1 for coding
% dir=-1 for decoding
%
% T is a Huffman tree, computed with compute_hufftree
%
% Copyright (c) 2008 Gabriel Peyre
if dir==1
%%% CODING %%%
... |
github | akhanf/vasst-dev-master | wm_seg_afd.m | .m | vasst-dev-master/tools/matlab/freesurfer/wm_seg_afd.m | 3,956 | utf_8 | c9ad19684ddf34c5ef47d999a496eabc | function [Dice,pval]=wm_seg_adf(subject, th_pval)
% For the subject "subject": computes the Dice coefficient D=2Nab/Na+Nb
% where:
% Na is the volume of the WM obtrained trough the volume-based labeling
% Nb is the volume of the WM segmented in the surface-based stream
% Nab is the volume of the overlap
% Uses... |
github | akhanf/vasst-dev-master | load_dicom_series.m | .m | vasst-dev-master/tools/matlab/freesurfer/load_dicom_series.m | 3,255 | utf_8 | b60aa048f680fe00980380c850cd4dd3 | function [vol, M, tmpdcminfo, mr_parms] = load_dicom_series(seriesno,dcmdir,dcmfile)
% [vol, M, dcminfo] = load_dicom_series(seriesno,<dcmdir>,<dcmfile>)
%
% Reads in a dicom series given:
% 1. The series number and directory, or
% 2. A dicom file from the desired series
%
% If the series number is given but no dcmdi... |
github | akhanf/vasst-dev-master | write_annotation.m | .m | vasst-dev-master/tools/matlab/freesurfer/write_annotation.m | 5,161 | utf_8 | 65cffd8c342a5cbc1d5d6f6109db8945 | % Contact ythomas@csail.mit.edu or msabuncu@csail.mit.edu for bugs or questions
%
%=========================================================================
%
% Copyright (c) 2008 Thomas Yeo and Mert Sabuncu
% All rights reserved.
%
%Redistribution and use in source and binary forms, with or without
%modific... |
github | akhanf/vasst-dev-master | cc_cut_dir_afd.m | .m | vasst-dev-master/tools/matlab/freesurfer/cc_cut_dir_afd.m | 8,948 | utf_8 | 0f0f00b54724b5bc6d70ccbae4d0bf2b | function [ddr, ddl, Isubj]=cc_cut_dir_adf(dirname, th_pval)
% For each subject in the directory "dirname":
% Computes the Dice coefficients measuring the overlap
% of the WM volume in right and left hemispheres to check
% if the corpus_callosum is correctly located.
%
% Uses the p values
%
%
% cc_cut_dir_afd.m
%... |
github | akhanf/vasst-dev-master | ribbon_afd.m | .m | vasst-dev-master/tools/matlab/freesurfer/ribbon_afd.m | 7,593 | utf_8 | 105801cd74c8eed1c807b10f37842421 | function [Dice]=ribbon_adf(subject, th_pval)
% For each subject "subject":
% Computes the Dice coefficients measuring the overlap of the
% Cortical Ribbon volume computed
% 1- from the subcortical labeling
% 2- as the space between the white and the pial surface
%
% Uses the pvalues, tr... |
github | akhanf/vasst-dev-master | subcortical_labeling_afd.m | .m | vasst-dev-master/tools/matlab/freesurfer/subcortical_labeling_afd.m | 4,804 | utf_8 | 9c621c12c9503b2b135eb577c0a81f59 | function [y]=check_ROI(SubjectDir,th_pval)
%
% For one subject: check if the size of 20 ROIs is within the normal range
% The 20 following ROIs are checked: Left-Lateral-Ventricle Right-Lateral-Ventricle
% Left-Hippocampus Right-Hippocampus Left-Thalamus-Proper Right-Thalamus-Proper
% Left-Caudate Right-Cauda... |
github | akhanf/vasst-dev-master | unwarp_resample.m | .m | vasst-dev-master/tools/matlab/freesurfer/unwarp_resample.m | 11,180 | utf_8 | 4f62076f2cdf3422888c26deabf1142b | function [imvol_out, M_out] = unwarp_resample(imvol,M,imvol_out_size,M_out,Mdc,unwarpflag,Jacobianflag,plotflag,interp_method,inflag,thruflag,gradfilename)
%
% In this file:
%
% unwarp_resample - from AD's unwarp_and_resample_vol
% proj, jdproj - for projecting out e.g. throughplane component of
% displ... |
github | akhanf/vasst-dev-master | cortical_labeling_afd_txt.m | .m | vasst-dev-master/tools/matlab/freesurfer/cortical_labeling_afd_txt.m | 7,062 | utf_8 | 1e9fedefb4b79b1cb80f9931181ecff1 | function [A_lh, A_rh]=cortical_label_adf(subject, p_val)
% Computes the area of the different cortical labels
% and compare them to the normal range
% Uses p_value to detect the abnormal areas
% Uses the lh/rh.parc.txt files
%
%
% cortical_labeling_afd_txt.m
%
% Original Author: Laurence Wastiaux
% CVS Revision Info... |
github | akhanf/vasst-dev-master | read_label_old.m | .m | vasst-dev-master/tools/matlab/freesurfer/read_label_old.m | 939 | utf_8 | 3ad8774abd49aecfdb7638e142fdf93f |
%
% read_label_old.m
%
% Original Author: Bruce Fischl
% CVS Revision Info:
% $Author: nicks $
% $Date: 2011/03/02 00:04:12 $
% $Revision: 1.3 $
%
% Copyright © 2011 The General Hospital Corporation (Boston, MA) "MGH"
%
% Terms and conditions for use, reproduction, distribution and contribution
% are found i... |
github | akhanf/vasst-dev-master | cc_cut_afd.m | .m | vasst-dev-master/tools/matlab/freesurfer/cc_cut_afd.m | 7,765 | utf_8 | 353c06ba9788caae3dfc98e3b8e9b9b8 | function [dr,dl]=cc_cut_adf(subject, name,th_pval)
% For each subject "subject":
% Computes the Dice coefficients measuring the overlap
% of the WM volume in right and left hemispheres to check
% if the corpus_callosum is correctly located.
%
% Uses .lta transform and p values
%
%
% cc_cut_afd.m
%
% O... |
github | akhanf/vasst-dev-master | load_dicom_fl.m | .m | vasst-dev-master/tools/matlab/freesurfer/load_dicom_fl.m | 5,467 | utf_8 | efaa1cd90a63c6f97c1a432ae0784c87 | function [vol, M, dcminfo, mr_parms] = load_dicom_fl(flist)
% [vol, M, dcminfo, mr_parms] = load_dicom_fl(flist)
%
% Loads a volume from the dicom files in flist.
%
% The volume dimensions are arranged such that the
% readout dimension is first, followed by the phase-encode,
% followed by the slices (this is not implem... |
github | akhanf/vasst-dev-master | convert_unwarp_resample.m | .m | vasst-dev-master/tools/matlab/freesurfer/convert_unwarp_resample.m | 13,982 | utf_8 | a2759cd5b258cb5b88b8a6086835f230 | function convert_unwarp_resample(infile,series,outfile,corfovflag,unwarpflag,jacflag,interp_method,user_gradwarpfile,called_by_script)
%
%% convert_unwarp_resample.m contains:
% convert_unwarp_resample()
% load_dicom_and_stuff()
% mdc()
% header2map(), type2map(), map2manuf() refer to TABLE = GRADWARPPATH/table.mat
%
... |
github | akhanf/vasst-dev-master | talairaching_dir_afd.m | .m | vasst-dev-master/tools/matlab/freesurfer/talairaching_dir_afd.m | 5,712 | utf_8 | 583571aad74bc6c6e5cf998815a7891a | function [probas, Isubj,nf]=taldir(dirname, th_pval, DirTable)
%
% Computes the probability of the Talairach transform matrices
% of all the subjects found in the directory "dirname".
% Uses the mean vector and covariance matrix obtained with talairachin_table.m from
% the data set (default data set: /space/... |
github | akhanf/vasst-dev-master | wm_seg_dir_afd.m | .m | vasst-dev-master/tools/matlab/freesurfer/wm_seg_dir_afd.m | 4,655 | utf_8 | a56b19b685866251b51ffedfcb1a08a2 | function [Dice, Pval, Isubj]=wm_seg_dir_adf(dirname, th_pval)
% For all the subjects in the directory "dirname":
% Computes the Dice coefficients D=2Nab/Na+Nb
% where:
% Na is the volume of the WM obtained trough the volume-based labeling
% Nb is the volume of the WM ... |
github | akhanf/vasst-dev-master | talairaching_afd.m | .m | vasst-dev-master/tools/matlab/freesurfer/talairaching_afd.m | 4,437 | utf_8 | 9c33512f5396ed541ae81d98f7f92488 | function [proba, pinf]=talmat(filename, th_pval, DirTable)
%
% Computes the probability of the Talairach transform matrix
% 'filename/mri/transforms/talairach.xfm'.
% Uses the mean vector and covariance matrix obtained with talairachin_table.m from
% the data set (default data set: /space/neo/2/recon/buck... |
github | akhanf/vasst-dev-master | surf_registration_afd.m | .m | vasst-dev-master/tools/matlab/freesurfer/surf_registration_afd.m | 4,846 | utf_8 | c243515fe07fa094dc4a23afd21ed444 | function [prv ] = surf_registration_adf(subject, th_pval)
%% Tests the overall surface based registration %%
%
%
% surf_registration_afd.m
%
% Original Author: Laurence Wastiaux
% CVS Revision Info:
% $Author: nicks $
% $Date: 2011/03/02 00:04:13 $
% $Revision: 1.3 $
%
% Copyright © 2011 The General Hospita... |
github | akhanf/vasst-dev-master | pons_cut_dir_afd.m | .m | vasst-dev-master/tools/matlab/freesurfer/pons_cut_dir_afd.m | 4,448 | utf_8 | e4689904ebbbc4bcb996de64d47fe0b0 | function [D, Isubj]=pons_cut_dir_adf(dirname,th_pval)
% For all the subjects in the directory "dirname":
% Computes the Dice coefficients D=2Nab/Na+Nb
% where:
% Na is the volume of the Cerebellum obtrained trough the volume-based labeling
% Nb is the volume "filled" ... |
github | akhanf/vasst-dev-master | cortical_labeling_dir_afd_txt.m | .m | vasst-dev-master/tools/matlab/freesurfer/cortical_labeling_dir_afd_txt.m | 8,189 | utf_8 | be59e2988dcabd90486cd46037961f7c | function [Dl, Dr,I]=cortical_label_dir_adf(dirname, p_val)
% Computes the area of the different cortical labels
% and compare them to the normal range for all the
% subjects in directory "dirname"
% Uses the p_values to detect the abnormal structures
% Uses the lh/rh.parc.txt files
%
%
% cortical_labeling_dir_afd_t... |
github | akhanf/vasst-dev-master | talairaching_stats.m | .m | vasst-dev-master/tools/matlab/freesurfer/talairaching_stats.m | 2,681 | utf_8 | 2befe06f104a7992177b4c7e89ab4cb2 | function [D,mu,sigma]=talairach_stats_correct(dirname, outdir)
%
% Computes the mean and covariance matrix from a training set
%
% By default, the 3 translation parameters are not considered
% -> mu is a 1x9 vector and sigma a 9x9 matrix
%
% talairaching_stats.m
%
% Original Author: Laurence Wastiaux
% CVS Revi... |
github | akhanf/vasst-dev-master | pons_cut_afd.m | .m | vasst-dev-master/tools/matlab/freesurfer/pons_cut_afd.m | 3,884 | utf_8 | b657b76d8eb7daf12c020e3b698a8426 | function [D]=pons_cut_adf(subject, th_pval)
% For the subject "subject": computes the Dice coefficient D=2*Nab/(Na+Nb)
% Na is the volume of the Cerebellum+Brain-stem obtrained trough the volume-based labeling
% Nb is the volume "filled" obtained from the surface-based stream
% Nab is the volume of th... |
github | akhanf/vasst-dev-master | subcortical_labeling_dir_afd.m | .m | vasst-dev-master/tools/matlab/freesurfer/subcortical_labeling_dir_afd.m | 6,044 | utf_8 | 4be83c3fdfb548ae429ea7e468aa7d42 | function [Dvol,I]=check_ROI_dir(Dirname, th_pval)
%
% For all the subjects in a directory:
% check if the size of 20 ROIs is within the normal range
% The 20 following ROIs are checked: Left-Lateral-Ventricle Right-Lateral-Ventricle
% Left-Hippocampus Right-Hippocampus Left-Thalamus-Prop... |
github | akhanf/vasst-dev-master | ribbon_dir_afd.m | .m | vasst-dev-master/tools/matlab/freesurfer/ribbon_dir_afd.m | 8,832 | utf_8 | 789f78215045139f2b61108eb6adfa33 | function [D, Isubj]=ribbon_dir_adf(dirname, th_pval)
% For each subject in the directory "dirname":
% Computes the Dice coefficients measuring the overlap of the
% Cortical Ribbon volume computed
% 1- from the subcortical labeling
% 2- as the space between the white and the pial surface
%
%... |
github | akhanf/vasst-dev-master | load_nii_ext.m | .m | vasst-dev-master/tools/matlab/nifti_tools/load_nii_ext.m | 5,544 | utf_8 | 09a2960b9d48f4b0363d5065f1780cbd | % Load NIFTI header extension after its header is loaded using load_nii_hdr.
%
% Usage: ext = load_nii_ext(filename)
%
% filename - NIFTI file name.
%
% Returned values:
%
% ext - Structure of NIFTI header extension, which includes num_ext,
% and all the extended header sections in the header extens... |
github | akhanf/vasst-dev-master | rri_orient.m | .m | vasst-dev-master/tools/matlab/nifti_tools/rri_orient.m | 2,357 | utf_8 | e1b7cfcaf2517b7887ac6e02d9ab504d | % Convert image of different orientations to standard Analyze orientation
%
% Usage: nii = rri_orient(nii);
% Jimmy Shen (jimmy@rotman-baycrest.on.ca), 26-APR-04
%___________________________________________________________________
function [nii, orient, pattern] = rri_orient(nii, varargin)
if nargin >... |
github | akhanf/vasst-dev-master | save_untouch0_nii_hdr.m | .m | vasst-dev-master/tools/matlab/nifti_tools/save_untouch0_nii_hdr.m | 8,813 | utf_8 | a0a201073cb18f09b62842e94094c451 | % internal function
% - Jimmy Shen (jimmy@rotman-baycrest.on.ca)
function save_nii_hdr(hdr, fid)
if ~isequal(hdr.hk.sizeof_hdr,348),
error('hdr.hk.sizeof_hdr must be 348.');
end
write_header(hdr, fid);
return; % save_nii_hdr
%------------------------------------------------... |
github | akhanf/vasst-dev-master | rri_zoom_menu.m | .m | vasst-dev-master/tools/matlab/nifti_tools/rri_zoom_menu.m | 770 | utf_8 | f0bae2b3d88fd719c47fd467e867e19f | % Imbed a zoom menu to any figure.
%
% Usage: rri_zoom_menu(fig);
%
% - Jimmy Shen (jimmy@rotman-baycrest.on.ca)
%
%--------------------------------------------------------------------
function menu_hdl = rri_zoom_menu(fig)
if isnumeric(fig)
menu_hdl = uimenu('Parent',fig, ...
'Label','... |
github | akhanf/vasst-dev-master | rri_select_file.m | .m | vasst-dev-master/tools/matlab/nifti_tools/rri_select_file.m | 17,235 | utf_8 | 0e0b14435a670dd8805aa514f7dbb6bb | function [selected_file, selected_path] = rri_select_file(varargin)
%
% USAGE: [selected_file, selected_path] = ...
% rri_select_file(dir_name, fig_title)
%
% Allow user to select a file from a list of Matlab competible
% file format
%
% Example:
%
% [selected_file, selected_path] = ...
% ... |
github | akhanf/vasst-dev-master | clip_nii.m | .m | vasst-dev-master/tools/matlab/nifti_tools/clip_nii.m | 3,421 | utf_8 | 19da887808bddae362df38b0e9f35076 | % CLIP_NII: Clip the NIfTI volume from any of the 6 sides
%
% Usage: nii = clip_nii(nii, [option])
%
% Inputs:
%
% nii - NIfTI volume.
%
% option - struct instructing how many voxel to be cut from which side.
%
% option.cut_from_L = ( number of voxel )
% option.cut_from_R = ( number of voxel )
% option... |
github | akhanf/vasst-dev-master | affine.m | .m | vasst-dev-master/tools/matlab/nifti_tools/affine.m | 16,664 | utf_8 | 419b609560eb98534c0e32cc4506cc7f | % Using 2D or 3D affine matrix to rotate, translate, scale, reflect and
% shear a 2D image or 3D volume. 2D image is represented by a 2D matrix,
% 3D volume is represented by a 3D matrix, and data type can be real
% integer or floating-point.
%
% You may notice that MATLAB has a function called 'imtransform.... |
github | akhanf/vasst-dev-master | load_untouch_nii_img.m | .m | vasst-dev-master/tools/matlab/nifti_tools/load_untouch_nii_img.m | 15,224 | utf_8 | 46fb6696904467f1848e2882cd7a72f6 | % internal function
% - Jimmy Shen (jimmy@rotman-baycrest.on.ca)
function [img,hdr] = load_untouch_nii_img(hdr,filetype,fileprefix,machine,img_idx,dim5_idx,dim6_idx,dim7_idx,old_RGB,slice_idx)
if ~exist('hdr','var') | ~exist('filetype','var') | ~exist('fileprefix','var') | ~exist('machine','var')
e... |
github | akhanf/vasst-dev-master | load_untouch_nii.m | .m | vasst-dev-master/tools/matlab/nifti_tools/load_untouch_nii.m | 6,373 | utf_8 | 303eb6438d7d37e2144d554504fbdf54 | % Load NIFTI or ANALYZE dataset, but not applying any appropriate affine
% geometric transform or voxel intensity scaling.
%
% Although according to NIFTI website, all those header information are
% supposed to be applied to the loaded NIFTI image, there are some
% situations that people do want to leave the ... |
github | akhanf/vasst-dev-master | collapse_nii_scan.m | .m | vasst-dev-master/tools/matlab/nifti_tools/collapse_nii_scan.m | 7,038 | utf_8 | 2d30d10b884719503df2974ff39b7093 | % Collapse multiple single-scan NIFTI files into a multiple-scan NIFTI file
%
% Usage: collapse_nii_scan(scan_file_pattern, [collapsed_fileprefix], [scan_file_folder])
%
% Here, scan_file_pattern should look like: 'myscan_0*.img'
% If collapsed_fileprefix is omit, 'multi_scan' will be used
% If scan_file_fol... |
github | akhanf/vasst-dev-master | rri_orient_ui.m | .m | vasst-dev-master/tools/matlab/nifti_tools/rri_orient_ui.m | 5,635 | utf_8 | 3361ce417798ffe2c6b53cf194b2a146 | % Return orientation of the current image:
% orient is orientation 1x3 matrix, in that:
% Three elements represent: [x y z]
% Element value: 1 - Left to Right; 2 - Posterior to Anterior;
% 3 - Inferior to Superior; 4 - Right to Left;
% 5 - Anterior to Posterior; 6 - Superior to Inferior;
% e.g.:
% Standard... |
github | akhanf/vasst-dev-master | load_untouch0_nii_hdr.m | .m | vasst-dev-master/tools/matlab/nifti_tools/load_untouch0_nii_hdr.m | 8,293 | utf_8 | d823050e9ba931a2ba7f9d9a3893d2d1 | % internal function
% - Jimmy Shen (jimmy@rotman-baycrest.on.ca)
function hdr = load_nii_hdr(fileprefix, machine)
fn = sprintf('%s.hdr',fileprefix);
fid = fopen(fn,'r',machine);
if fid < 0,
msg = sprintf('Cannot open file %s.',fn);
error(msg);
else
fseek(fid,0,'bof')... |
github | akhanf/vasst-dev-master | load_nii.m | .m | vasst-dev-master/tools/matlab/nifti_tools/load_nii.m | 7,006 | utf_8 | 71beffc9e2b0c7e14c2f8dc8adbadbf1 | % Load NIFTI or ANALYZE dataset. Support both *.nii and *.hdr/*.img
% file extension. If file extension is not provided, *.hdr/*.img will
% be used as default.
%
% A subset of NIFTI transform is included. For non-orthogonal rotation,
% shearing etc., please use 'reslice_nii.m' to reslice the NIFTI file.
% I... |
github | akhanf/vasst-dev-master | unxform_nii.m | .m | vasst-dev-master/tools/matlab/nifti_tools/unxform_nii.m | 1,221 | utf_8 | ff8be64760837046b931857d59ca304e | % Undo the flipping and rotations performed by xform_nii; spit back only
% the raw img data block. Initial cut will only deal with 3D volumes
% strongly assume we have called xform_nii to write down the steps used
% in xform_nii.
%
% Usage: a = load_nii('original_name');
% manipulate a.img to make... |
github | akhanf/vasst-dev-master | load_untouch_nii_hdr.m | .m | vasst-dev-master/tools/matlab/nifti_tools/load_untouch_nii_hdr.m | 8,739 | utf_8 | eb068c88e2b7bb518ea557d0734bc65d | % internal function
% - Jimmy Shen (jimmy@rotman-baycrest.on.ca)
function hdr = load_nii_hdr(fileprefix, machine, filetype)
if filetype == 2
fn = sprintf('%s.nii',fileprefix);
if ~exist(fn)
msg = sprintf('Cannot find file "%s.nii".', fileprefix);
error(msg);
end
... |
github | akhanf/vasst-dev-master | save_nii_ext.m | .m | vasst-dev-master/tools/matlab/nifti_tools/save_nii_ext.m | 1,015 | utf_8 | db919f3a7a4b2f64dae641b1e97fa4a0 | % Save NIFTI header extension.
%
% Usage: save_nii_ext(ext, fid)
%
% ext - struct with NIFTI header extension fields.
%
% NIFTI data format can be found on: http://nifti.nimh.nih.gov
%
% - Jimmy Shen (jimmy@rotman-baycrest.on.ca)
%
function save_nii_ext(ext, fid)
if ~exist('ext','var') | ~exist('fi... |
github | akhanf/vasst-dev-master | view_nii_menu.m | .m | vasst-dev-master/tools/matlab/nifti_tools/view_nii_menu.m | 14,895 | utf_8 | d81fb80884a14ae659630258fbc330bc | % Imbed Zoom, Interp, and Info menu to view_nii window.
%
% Usage: view_nii_menu(fig);
%
% - Jimmy Shen (jimmy@rotman-baycrest.on.ca)
%
%--------------------------------------------------------------------
function menu_hdl = view_nii_menu(fig, varargin)
if isnumeric(fig)
menu_hdl = init(fig);
... |
github | akhanf/vasst-dev-master | save_untouch_header_only.m | .m | vasst-dev-master/tools/matlab/nifti_tools/save_untouch_header_only.m | 2,203 | utf_8 | 6622b1835d5ad8ce504298473ab7684f | % This function is only used to save Analyze or NIfTI header that is
% ended with .hdr and loaded by load_untouch_header_only.m. If you
% have NIfTI file that is ended with .nii and you want to change its
% header only, you can use load_untouch_nii / save_untouch_nii pair.
%
% Usage: save_untouch_header_on... |
github | akhanf/vasst-dev-master | pad_nii.m | .m | vasst-dev-master/tools/matlab/nifti_tools/pad_nii.m | 3,854 | utf_8 | a38d813f9f822362d873bc92725f565b | % PAD_NII: Pad the NIfTI volume from any of the 6 sides
%
% Usage: nii = pad_nii(nii, [option])
%
% Inputs:
%
% nii - NIfTI volume.
%
% option - struct instructing how many voxel to be padded from which side.
%
% option.pad_from_L = ( number of voxel )
% option.pad_from_R = ( number of voxel )
% option... |
github | akhanf/vasst-dev-master | load_nii_hdr.m | .m | vasst-dev-master/tools/matlab/nifti_tools/load_nii_hdr.m | 10,311 | utf_8 | ef81f82b43da4fbd79a9de1787b5ae22 | % internal function
% - Jimmy Shen (jimmy@rotman-baycrest.on.ca)
function [hdr, filetype, fileprefix, machine] = load_nii_hdr(fileprefix)
if ~exist('fileprefix','var'),
error('Usage: [hdr, filetype, fileprefix, machine] = load_nii_hdr(filename)');
end
machine = 'ieee-le';
new_ext = 0;... |
github | akhanf/vasst-dev-master | save_untouch_slice.m | .m | vasst-dev-master/tools/matlab/nifti_tools/save_untouch_slice.m | 20,263 | utf_8 | 833f175c0298d11697418454a03993db | % Save back to the original image with a portion of slices that was
% loaded by "load_untouch_nii". You can process those slices matrix
% in any way, as long as their dimension is not altered.
%
% Usage: save_untouch_slice(slice, filename, ...
% slice_idx, [img_idx], [dim5_idx], [dim6_idx], [dim7_idx])
%
% ... |
github | akhanf/vasst-dev-master | load_nii_img.m | .m | vasst-dev-master/tools/matlab/nifti_tools/load_nii_img.m | 12,720 | utf_8 | 5670adb84a76f241bd221003bee8187d | % internal function
% - Jimmy Shen (jimmy@rotman-baycrest.on.ca)
function [img,hdr] = load_nii_img(hdr,filetype,fileprefix,machine,img_idx,dim5_idx,dim6_idx,dim7_idx,old_RGB)
if ~exist('hdr','var') | ~exist('filetype','var') | ~exist('fileprefix','var') | ~exist('machine','var')
error('Usage: [img,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.