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 | philippboehmsturm/antx-master | clip2clipcell.m | .m | antx-master/mritools/ant/clip2clipcell.m | 535 | utf_8 | d16bd7454b17f3567c289ce192a36711 |
%% convertse cellstring (pahts) in clipboard to matlabstyle cell (back to clipboard)
function clip2clipcell
% mat2clip(s.folder);
a=clipboard('paste');
a2=strsplit2(a,char(10))';
ro =['{' ; cellfun(@(a) {[ ' ''' a '''']},a2); '};'];
mat2clip(ro);
function Tokens = strsplit2(String, Delim)
Toke... |
github | philippboehmsturm/antx-master | xsegment.m | .m | antx-master/mritools/ant/xsegment.m | 6,419 | utf_8 | 24a16dd3893c304bd366c9e57ab9f0e9 | %% SEGMENT MOUSE
% function xsegment(t2,template)
% function xsegment(t2,template,job)...see below
% function xsegment(t2,template,'segment') %% SEGMENT ONLY without using Freiburg-normalization
%% INPUT:
% t2 : FPfile of t2.nii
% template: {cell} with ordered TPMs(GM,WM,CSF)+FPfile of reorient.mat
%%... |
github | philippboehmsturm/antx-master | listeval.m | .m | antx-master/mritools/ant/listeval.m | 3,581 | utf_8 | 234ee4dc1d9633a6812f57baf29db123 |
function out=listeval(p,ro)
% eval([name '=an;']);
% ro=an;
% ro=rmfield(ro,'ls');
% eval([name '=ro;']);
% p=struct2list(ro)
% eval(['p=struct2list(' name ')']);
v=1:size(p,1);
for i=1:size(p,1)
if ~isnan(v(i))
try
d=p{v(i)};
eval(d);
s=... |
github | philippboehmsturm/antx-master | deform.m | .m | antx-master/mritools/ant/deform.m | 2,241 | utf_8 | bb077683bbc4f48c80f10bd74dc37ca4 |
function deform( files ,direction, resolution, interpx)
if exist('direction')~=1; direction=[]; end;
if isempty(direction); direction =1; end
if exist('resolution')~=1; resolution=[]; end;
if isempty(resolution); resolution =[.025 .025 .025]; end
if exist('interpx')~=1; interpx=[]; end;
if ise... |
github | philippboehmsturm/antx-master | warp_summary.m | .m | antx-master/mritools/ant/warp_summary.m | 3,237 | utf_8 | 2d5764972476ecc2dded7048bf8ad89b |
% imswap==1: than rfile is on top
function warp_summary(s)
if 0
s.file='w_t2.nii';
s.slice=75;
warp_summary(s);
warp_summary(struct('sfile','x_t2.nii','slice',100))
end
jet=[0 0 0.5625;0 0 0.625;0 0 0.6875;0 0 0.75;0 0 0.8125;0 0 0.875;0 0 0.9375;0 0 1;0 0.0625 1;0 0.125 1;0 0.1875 1;0... |
github | philippboehmsturm/antx-master | snip_listbox_undocumented.m | .m | antx-master/mritools/ant/snip_listbox_undocumented.m | 1,237 | utf_8 | 37d32151a083cc83906345a3c6af639f |
function snip_listbox_undocumented
fg;
set(gcf,'units','norm')
hListbox = uicontrol('Style','Listbox','units','norm','position',[.2 .3 .2 .55], 'String',...
{'item #1','item #2','item #3' '44444' '555' '66666' '77777','888888' '99999' '100000'},'fontsize',10);
jScrollPane = java(findjobj(hListbox))
j... |
github | philippboehmsturm/antx-master | xsegment_test.m | .m | antx-master/mritools/ant/xsegment_test.m | 6,476 | utf_8 | a24925f027d684bad739810fcaa3a89e | %% SEGMENT MOUSE
% function xsegment(t2,template)
% function xsegment(t2,template,job)...see below
% function xsegment(t2,template,'segment') %% SEGMENT ONLY without using Freiburg-normalization
%% INPUT:
% t2 : FPfile of t2.nii
% template: {cell} with ordered TPMs(GM,WM,CSF)+FPfile of reorient.mat
%%... |
github | philippboehmsturm/antx-master | warp_summary2.m | .m | antx-master/mritools/ant/warp_summary2.m | 11,000 | utf_8 | 08574cbfbd4cfa9cc61034bd961a5556 |
%nsb: number of slices : [],=[nan nan] [nan x] [x nan] [line]..each subject in one line
function warp_summary2(s)
if 0
study='O:\harms1\harms3_lesionfill\proj_Harms3_lesionfill.m'
ant,antcb('load',study);
s.file='w_t2.nii';
s.slice=75;
warp_summary(s);
cmap2=jet;
c... |
github | philippboehmsturm/antx-master | xnewproject.m | .m | antx-master/mritools/ant/xnewproject.m | 2,841 | utf_8 | 5e4d3c95835c354517bc4a4c7751597d |
%% create a new Project for a study
% #yg GUI-NOTE
% for some parameters exist #r "interactive selectors" #w (this selectors appear on the very left side of the parameter as icon)
% to use the "interactive selectors" move coursor to the line of the parameter, if an "interactive selectors" exists
% ... |
github | philippboehmsturm/antx-master | test_atlasreadout.m | .m | antx-master/mritools/ant/test_atlasreadout.m | 603 | utf_8 | c3ee34538cfcd72548303952bac60921 |
function lut= test_atlasreadout(tmpVOL, ANO2,idxLUT)
% luts,ANO2,tmpVOL
d=tmpVOL>.3;
w=ANO2.*d;
id=unique(w(:));
id(id==0)=[];
w2=w(:);
a=ANO2(:);
tb=zeros(length(id),3);
for i=1:length(id)
tb(i,:)= [ id(i) length(find(w==id(i))) length(find(a==id(i))) ];
end
tb(:,4)=tb(:,2)./tb(:... |
github | philippboehmsturm/antx-master | testgetVoxsize.m | .m | antx-master/mritools/ant/templateBerlin_hres/testgetVoxsize.m | 308 | utf_8 | 1c4e4b05e48cbabccb276fca2e15f8bf |
function testgetVoxsize
% idxLUT = BrAt_ComputeAreaSize(idxLUT,ANO2,FIBT2);
load myLabels_line178
a=idxLUT
fn=fieldnames(a(1))
t={}
for i=1:length(a)
r=a(i);
t(i,:)= struct2cell(r)';
end
an=ANO2;
s=single(ANO2==70);
for i=10:size(t,1)
c=a(i).children
end |
github | philippboehmsturm/antx-master | preadfile2.m | .m | antx-master/mritools/basic/preadfile2.m | 3,378 | utf_8 | 66f380d6bab308aa4ce2da43114a0b57 |
function d=preadfile2(fil)
%___________________________________________________________________________
% % function [dat ]=preadfile(fil);
%___________________________________________________________________________
% Rread file (e.g *.vmrk/*.m/*.txt)
% _________________________________________________________... |
github | philippboehmsturm/antx-master | cfg_getfile3.m | .m | antx-master/mritools/basic/cfg_getfile3.m | 54,634 | utf_8 | 91aaf726f873730f5bc19ca90fab8c59 | function [t,sts] = cfg_getfile2(varargin)
% File selector
% FORMAT [t,sts] = cfg_getfile2(n,typ,mesg,sel,wd,filt,frames)
% n - Number of files
% A single value or a range. e.g.
% 1 - Select one file
% Inf - Select any number of files
% [1 Inf] - Selec... |
github | philippboehmsturm/antx-master | cfg_getfile2.m | .m | antx-master/mritools/basic/cfg_getfile2.m | 55,020 | utf_8 | 32241ea18ea3aa966a282f90f9b3996b | function [t,sts] = cfg_getfile2(varargin)
% File selector2
% FORMAT [t,sts] = cfg_getfile2(n,typ,mesg,sel,wd,filt,frames)
% n - Number of files
% A single value or a range. e.g.
% 1 - Select one file
% Inf - Select any number of files
% [1 Inf] - Sele... |
github | philippboehmsturm/antx-master | regexpi2.m | .m | antx-master/mritools/basic/regexpi2.m | 239 | utf_8 | b8607d0cd879b58ffd5464e037d9a370 |
function id=regexpi2(cells, str,varargin)
%same as regexpi but jelds indizes of mathing cells , instead of empty cells ('I'm tired to code this again and again)
id=regexpi(cells,str,varargin{:});
id=find(cellfun('isempty',id)==0); |
github | philippboehmsturm/antx-master | pwrite2file2.m | .m | antx-master/mritools/basic/pwrite2file2.m | 2,649 | utf_8 | e2ae057b7002f2041cdc57b5405d13ae |
function pwrite2file2(pathname, dataX,header , varargin );
%___________________________________________________________________________
% function pwrite2file2(pathname, dataX ,header );
% function pwrite2file2(pathname, dataX,header,1 ); %OPENS WITH GUI
%_____________________________________________________________... |
github | philippboehmsturm/antx-master | saveppt2.m | .m | antx-master/mritools/basic/saveppt2.m | 34,821 | utf_8 | ebc652b861c7b914076b2bb03fb52fa7 | % SAVEPPT2 saves plots to PowerPoint.
% SAVEPPT2(save_file,<additional parameters>)
% Saves the current Matlab figure window or Simulink model window to a PowerPoint
% file designated by save_file. If save_file is omitted, the user is prompted to enter
% one via UIPUTFILE. If the path is omitted from filespec,... |
github | philippboehmsturm/antx-master | paste.m | .m | antx-master/mritools/basic/paste.m | 9,652 | utf_8 | bf7f5acc28513bb7fad714c663a5f5da | % PASTE copies the content of the clipboard to a variable; creates a
% string, a cell array, or a numerical array, depending on content.
%
% Usage:
% x = paste;
% x = paste(dec,sep,lf);
%
% The program will try to create an array. For this to succeed, the
% material that is passed from the clipboard must be... |
github | philippboehmsturm/antx-master | explorer.m | .m | antx-master/mritools/basic/explorer.m | 587 | utf_8 | 51c33caf85e473fe358d5135101462b3 |
%%open explorerWindow
% function explorer(paths)
% paths: []points to pwd | singlepath | cell of multiple paths
%% examples
% explorer
% explorer(which('ws.m'))
%explorer({'c:\';'T:\'})
function explorer(paths)
if exist('paths')==1
if ischar(paths);
paths={paths} ;
end
else
path... |
github | philippboehmsturm/antx-master | foo.m | .m | antx-master/mritools/basic/foo.m | 368 | utf_8 | 4b9faa18de94fd280b2356eb1c3e7b30 |
% in the command window
% fh=foo; % load the function handles to the subfunctions
% fh.msub(10,5)
% fh.madd(pi,pi)
function fh=foo
fh.msub=@msub;
fh.madd=@madd;
end
function r=msub(a,b)
r=a-b;
end
function r=madd(a,b)
r=a+b;
end
% % in the command window
% fh=foo; % load the function handles to the... |
github | philippboehmsturm/antx-master | copyfilem.m | .m | antx-master/mritools/basic/copyfilem.m | 350 | utf_8 | a0489299e41cdbba11041a05ab090bf0 | % mass-copy files ;
% input:
% f1: cell of files =sources (this are copied)
% f2: cell of filenames to create
% f1 and f2 match in size
function copyfilem(f1,f2)
% f1=s.a
% f2=stradd(s.a,'c')
if ischar(f1)
f1=cellstr(f1);
end
if ischar(f2)
f2=cellstr(f2);
end
for i=1:length(f1)
cop... |
github | philippboehmsturm/antx-master | copyc.m | .m | antx-master/mritools/basic/copyc.m | 4,281 | utf_8 | 88c9009ee763f7ef71ddb03510964860 | %% copy cell 2d-cell of strings to matlabs -style {',,,' '...' ; ',,,' '...' }
function out = copy2(a, delim)
%MAT2CLIP Copies matrix to system clipboard.
%
% MAT2CLIP(A) copies the contents of 2-D matrix A to the system clipboard.
% A can be a numeric array (floats, integers, logicals), character array,
% or ... |
github | philippboehmsturm/antx-master | cprintf2.m | .m | antx-master/mritools/basic/cprintf2.m | 1,834 | utf_8 | 812361e55a2246989fbc2d1aa09082cc |
function count = cprintf2(style,format,header,varargin)
% for cellarry
% cprintf2([1 0 1], z.pp ,'DONE' );
% cprintf2([1 0 0], {'affe','mensch','klopapier'} ,'DONE' );
% cprintf2({[1 0 0] ;[0 .5 0] },{z.pp z.pp2} ,{'toDO' 'DONE'} );
if ~iscell(style)
if exist('header')~=0
if ~isempty(header)
... |
github | philippboehmsturm/antx-master | pdir.m | .m | antx-master/mritools/basic/pdir.m | 1,389 | utf_8 | c88a30f31ea56bc9fdb66a7bb691c488 |
%% get files/dirs/all from path
% [files FPfiles]=pdir(pathx, modex, flt )
%% IN
% pathx :path to search (optional), default pwd
% modex :type to search (optional), default 'file' use['file' |'dir' |'all']
% flt :window filter (optional),default '*.*'
% %% OUT
% files elements (files and or folder... |
github | philippboehmsturm/antx-master | copy.m | .m | antx-master/mritools/basic/copy.m | 6,238 | utf_8 | 06fe29236a1db0782c1d2bc8a53db0ac | % COPY puts a string, cell array, or numerical array into the clipboard,
% from where it can easily be imported by other programs.
%
% Usage:
% copy(x)
% copy(...,dec,sep,lf)
%
% x can be a numerical array (one or two dimensional), a cell array, a
% string, or a handle to a figure. The program does not hand... |
github | philippboehmsturm/antx-master | strsplit2.m | .m | antx-master/mritools/basic/strsplit2.m | 429 | utf_8 | 3dd0486ba38026bd1112df1217f41d76 |
% split string into tokens separated by delim
% if no delimiter is given, white space characters are used as delimiters
% syntax: Tokens = strsplit(Delim, String)
function Tokens = strsplit2(String, Delim)
Tokens = [];
while (size(String,2) > 0)
if isempty(Delim)
[Tok, String] = strtok(Strin... |
github | philippboehmsturm/antx-master | timestr.m | .m | antx-master/mritools/basic/timestr.m | 279 | utf_8 | 259e40678e8c60267fa0a221588a8ea0 |
% get formated current time , used as filePrefix
% function str=timestr
function str=timestr(sep)
if exist('sep')==1
str=regexprep(datestr(now),{'-' ' ' ':'},{'' '_' ,'-'}) ; %with - between HH:MM:SS
else
str=regexprep(datestr(now),{'-' ' ' ':'},{'' '_' ,''});
end
|
github | philippboehmsturm/antx-master | psavefigs.m | .m | antx-master/mritools/basic/psavefigs.m | 1,172 | utf_8 | 85c61faf27e42d6d9bd83fd99eb4872d |
function psavefigs(folder)
% function psavefigs(folder)
%
o=regexprep(datestr(now),{':' ' ' },'_');
ch=flipud(get(0,'children'));
mkdir(folder);
for i=1:length(ch)
tx=['save Image "' num2str(i) '" to folder "' folder '"' ];
try
cprintf(rand(1,3),[tx '\n']);
catch
disp(... |
github | philippboehmsturm/antx-master | xlsindex.m | .m | antx-master/mritools/basic/xlsindex.m | 242 | utf_8 | 26e17c2ce9f33ee338f1c1114215886f | %get excelindex (Az,BB...)
function xls_idx = xlsindex(idx)
xls_idx = [];
while idx>0
xls_idx = [char(mod(idx-1,26)+65), xls_idx];
if mod(idx,26)
idx = fix(idx/26);
else
idx = fix(idx/26)-1;
end
end |
github | philippboehmsturm/antx-master | cell2str.m | .m | antx-master/mritools/basic/cell2str.m | 357 | utf_8 | 1409b98cede395a89c17f1afe3d29c24 | %% concatenate cells to a string
% function b=cell2str(a,sep)
% cell2str({'aa' 'bb' 'cc' 'dd'} , '_');
% cell2str({'aa' 'bb' 'cc' 'dd'});
function b=cell2str(a,sep)
if ~exist('sep') ; sep=''; end
if length(a)==1
b=char(a);
else
b='';
for i=1:length(a)-1
b=[b a{i} sep ];
e... |
github | philippboehmsturm/antx-master | preadfile.m | .m | antx-master/mritools/basic/preadfile.m | 4,083 | utf_8 | df20068c8d598f5bb802667faa02903a |
function [dat]=preadfile(fil,varargin);
%___________________________________________________________________________
% % function [dat ]=preadfile(fil,varargin);
%___________________________________________________________________________
% Rread file (e.g *.vmrk/*.m/*.txt)
% ##optional##
% function [mark,infm... |
github | philippboehmsturm/antx-master | documentthis.m | .m | antx-master/mritools/basic/documentthis.m | 1,088 | utf_8 | e0f2ea9a73f6100a7a68c681aee40438 |
function documentthis(pa, fi,figs)
% documentthis([path.res], 'test2')
% documentthis('test.ppt', 'test2',[1 2 3])
if 0
pa=path.res
fi='muell'
end
if ~exist('figs'); figs=[]; end
if isempty(figs);
figs=sort(findobj(0,'type','figure'));
end
if ~exist('fi'); fi=[]; end
if ise... |
github | philippboehmsturm/antx-master | logMessage.m | .m | antx-master/mritools/snips/logMessage.m | 1,909 | utf_8 | 032080759d77c4301449d314377fcd43 |
function logMessage(jEditbox,text,severity)
if 0
fg
hEditbox=uicontrol('style','edit','units','normalized','position',[0 0 1 1])
jEditbox=findjobj(hEditbox)
e=hEditbox
% jEditbox.setEditorKit(javax.swing.text.html.HTMLEditorKit);
% % alternative: jEditbox.setContentType('text/html');
htmlStr = [... |
github | philippboehmsturm/antx-master | snip_contour.m | .m | antx-master/mritools/snips/snip_contour.m | 4,559 | utf_8 | dc3d6b94d65624d09220dbf531ae2c61 |
function bla
% aa='V:\projects\atlasRegEdemaCorr\nii32\s20150908_FK_C1M01_1_3_1_1\_Atpl_mouseatlasNew_left.nii'
% bb='V:\projects\atlasRegEdemaCorr\nii32\s20150908_FK_C1M01_1_3_1_1\elx_T2_left-0.nii'
bb='V:\projects\atlasRegEdemaCorr\nii32\s20150908_FK_C1M01_1_3_1_1\_Atpl_mouseatlasNew.nii'
% bb='V:\projects\... |
github | philippboehmsturm/antx-master | snip_test_table.m | .m | antx-master/mritools/snips/snip_test_table.m | 5,693 | utf_8 | 7318335f079ff9d81732894b6a6be12d | function test_table(tb)
if 1
% colortag='<html><div style="background:yellow;">Panel 1'
colortag='<html><div style="color:red;"> '
% % colortag='<html><TD BGCOLOR=#40FF68>'
tbsel=cellfun(@(tb) [ colortag tb],tb,'UniformOutput',0)
end
if 0
colergen = @(color,text) ['<html><table border=... |
github | philippboehmsturm/antx-master | snip_mosaic.m | .m | antx-master/mritools/snips/snip_mosaic.m | 4,072 | utf_8 | 7fe5de7de9b100ea89196719a005b2f5 |
function bla
% aa='V:\projects\atlasRegEdemaCorr\nii32\s20150908_FK_C1M01_1_3_1_1\_Atpl_mouseatlasNew_left.nii'
% bb='V:\projects\atlasRegEdemaCorr\nii32\s20150908_FK_C1M01_1_3_1_1\elx_T2_left-0.nii'
aa='V:\projects\atlasRegEdemaCorr\nii32\s20150908_FK_C1M01_1_3_1_1\_Atpl_mouseatlasNew.nii'
% bb='V:\project... |
github | philippboehmsturm/antx-master | snipp_uitable1.m | .m | antx-master/mritools/snips/snipp_uitable1.m | 707 | utf_8 | 7330f0d367d0abdde9ee2317e67e78a3 |
function snipp_uitable1
raw={'p1'; 'p2'; 'p3'}; %points id %COLUMN not row
column1=[200;250;300]; %distances
column1=num2cell(column1);
checked=false(size(raw,1),1); %is it checked?
cellArray=[raw,column1,checked];
set(handles.uitable1, 'Data', cellArray);
set(handles.uitable1, 'ColumnFormat', {'string... |
github | philippboehmsturm/antx-master | starttimer.m | .m | antx-master/mritools/snips/starttimer.m | 583 | utf_8 | efa88d642eaaa939cf583dd0ac2355b4 | function starttimer
try; delete(timerfind('tag','xboxtimer')); end
t = timer('TimerFcn',@timercallback, 'Period', 1,'tag','xboxtimer','ExecutionMode', 'FixedRate');
start(t);
function timercallback(u1,u2)
try
txt=evalin('base','msgtxt');
hfig=findobj(0,'tag','xbox');
% set(findobj(hfig,'tag','sta... |
github | philippboehmsturm/antx-master | param2struct.m | .m | antx-master/mritools/paramgui/param2struct.m | 1,625 | utf_8 | d79dfda1c2921c5dfd699ee91da2615a |
%convert paramarray(p) to structur, and delete infoTags
function x=param2struct(p)
%% EXAMPLE
if 0
p={...
'inf98' '*** ALLEN LABELING ' '' ''
'inf99' 'USE EITHER APPROACH-1 OR APPROACH-2' '' ''
'inf100... |
github | philippboehmsturm/antx-master | pickatlas.m | .m | antx-master/mritools/labs/pickatlas.m | 2,394 | utf_8 | 3d8ecb5286f9ec1095851b84ffb6fa36 |
function tx=pickatlas(cordsMNI)
global Atlas
if length(Atlas) ==0;%isglobal(Atlas)
pax=regexprep(which('pickatlas.m'),'pickatlas.m','');
err=exist(fullfile(pax,'Atlas.mat'));
if err==0
LookUpFilePath='MNI_atlas_templates_from_wfu_pickatlas' ;%'MNI_atlas_templates'
LookUpFileName='... |
github | philippboehmsturm/antx-master | vc2nc_spm.m | .m | antx-master/mritools/labs/vc2nc_spm.m | 1,456 | utf_8 | f7657c14caf6595c0011e2362b960080 |
function nc=vc2nc_spm(v2,hb)
% volume coords to normalized cords
% xSPM.M
% ----------------------------------
s_x=hb(1,:);%hb.hdr.hist.srow_x;
s_y=hb(2,:);%hb.hdr.hist.srow_y;
s_z=hb(3,:);%hb.hdr.hist.srow_z;
% s_x(find(s_x(1:3)==0))=1;
% s_y(find(s_y(1:3)==0))=1;
% s_z(find(s_z(1:3)==0))=1;
nc(:... |
github | philippboehmsturm/antx-master | pclustermaxima.m | .m | antx-master/mritools/labs/pclustermaxima.m | 1,578 | utf_8 | c6a242932b996b9057310548de28cb4b |
function [s]=pclustermaxima(Z,xyz,hdr)
% Sizes, maxima and locations of clusters
%
% function [s]=pclustermaxima(Z,xyz,hdr)
%
% IN:
% Z : values (Accuracies,t,Z... but not p-values)
% XYZ: locations [x y x]' {in voxels} [3 x nvox]
%
% OUT:
% hdr: [1x1 struct] header
% XYZmm: [3x25... |
github | philippboehmsturm/antx-master | pick_wrapper.m | .m | antx-master/mritools/labs/pick_wrapper.m | 1,206 | utf_8 | 9dea0177def61738e725b8227053d065 |
function [labelx header s]=pick_wrapper(XYZmni, show,varargin)
% example: add 1st column 'title: cluster'
% [labelx header labelcell]=pick_wrapper(XYZmm', 'show',{'cluster',num2cell(num2str(A))});
% example2
% [labelx header labelcell]=pick_wrapper(XYZmm', 'show',{ {'cluster' 'maxAC' 'Zval'},tmp3} );
% example... |
github | philippboehmsturm/antx-master | slice_overlay2.m | .m | antx-master/mritools/labs/slice_overlay2.m | 31,151 | utf_8 | fdac67cf84b3f2a9379b6690de640d8d | function varargout = slice_overlay2(action, varargin);
% Function to display + manage slice display
% Slice display works on a global structure SO
% with fields
% - img - array of images to display
% - img structs contain fields
% vol - vol struct info (see spm_vol)
% can also be... |
github | philippboehmsturm/antx-master | labs.m | .m | antx-master/mritools/labs/labs.m | 21,991 | utf_8 | e43df7fd66d4c63ecfc0b11a05e7b8b7 | function outw=labs(varargin)
% -labs: instant labeling and more
% examples
% labs([-33 -44 43])
% labs(XYZmm(:,ix),{'addcolpre',{'R' 'p'} rp(ix,:)})
% labs(XYZmm(:,ix),{'addcolpost',{'R' 'p'} rp(ix,:)})
if nargin==1 | nargin==2
cords=varargin{1};
if size(cords,1)==3
cords=cords';
end
... |
github | philippboehmsturm/antx-master | getclustertable.m | .m | antx-master/mritools/labs/getclustertable.m | 10,359 | utf_8 | a0366a31e247943486349aff661a214c |
function table=getclustertable(vol,mat,dim,tresh)
% get clustertable for statistical fMRI-volume
% usage type
% type [1]: function table=getclustertable(vol,mat,dim,tresh)
% type [2]: function table=getclustertable([Num Dis]) -->for SPM
% type [2]: function table=getclustertable -->for SPM defau... |
github | philippboehmsturm/antx-master | pwrite2file.m | .m | antx-master/mritools/labs/pwrite2file.m | 1,903 | utf_8 | ef4698616f9af2dada7a256479c962f6 |
function pwrite2file(name2wr, info,varargin );
%___________________________________________________________________________
% function pwrite2file(name2wr, info );
% function pwrite2file(name2wr, info,1 ); %OPENS WITH GUI
%___________________________________________________________________________
% pwrite2file(nam... |
github | philippboehmsturm/antx-master | pclustermaximaContraint.m | .m | antx-master/mritools/labs/pclustermaximaContraint.m | 9,793 | utf_8 | 69cf55d2404e3c6d881f77f0cf4216fe |
function [sv]=pclustermaximaContraint(Z,A,XYZ,hdr,Num,Dis,invertZ)
%number of maxima pr cluster and distance among cluster copy of [spm_list ~line 204]
%
% function [sv]=pclustermaximaContraint(Z,A,XYZ,hdr,Num,Dis)
% NOTE: usage after applying [pclustermaxima]
% IN
% Z [vector] (Z,T but not p!)
% ... |
github | philippboehmsturm/antx-master | conmanhook.m | .m | antx-master/mritools/labs/conmanhook.m | 8,679 | utf_8 | 45692d6801449f4c645f38ab4371be28 |
function conmanhook(ra,r0,val)
% hook in the spm_contrastmanager
% [1] conmanhook('hook') ;%hook & modify spm_conman
% [2] conmanhook('unhook') ; %remove modification in spm_conman
%============================================================================
% hook to spm_conman
%=============... |
github | philippboehmsturm/antx-master | showtable2.m | .m | antx-master/mritools/labs/showtable2.m | 8,329 | utf_8 | 9827e3822a85cb1d20e80bad5cfc0824 |
function showtable2(pos,tab,varargin)
if 0
showtable2([0 0 1 1],tab,'fontsize',9,'fontweight','normal','backgroundcolor','w')
if ~exist('fontsize','var'); fontsize=8;end
if ~exist('color','var'); color='k';end
end
colbg=[1 1 1; 1 1 .8;];
for i=1:size(colbg,1);
colbghex(i,:) ... |
github | philippboehmsturm/antx-master | busy.m | .m | antx-master/mritools/labs/busy.m | 1,860 | utf_8 | 566b8dd115197f908a53bd983743ac48 |
function busy(varargin)
% fg
% text(.5,.5,'dddd')
% set(gcf,'menubar','none')
% frame = get(handle(gcf), 'JavaFrame');
%
%
% clear
if nargin==1
if varargin{1}==1
busyRemove;
return
end
end
busyRemove;
img2=strrep(which('labs.m'),'labs.m','monkey.png');
img=imrea... |
github | philippboehmsturm/antx-master | showtable3.m | .m | antx-master/mritools/labs/showtable3.m | 7,090 | utf_8 | 59185186193dd8a258cb22cad1188626 |
function showtable3(pos,tab,varargin)
if 0
showtable3([0 0 1 1],tab,'fontsize',9,'fontweight','normal','backgroundcolor','w')
if ~exist('fontsize','var'); fontsize=8;end
if ~exist('color','var'); color='k';end
end
colbg=[1 1 1; 1 1 .8;];
for i=1:size(colbg,1);
colbghex(i,:) ... |
github | philippboehmsturm/antx-master | vc2nc.m | .m | antx-master/mritools/labs/vc2nc.m | 1,415 | utf_8 | 8f5497fb37161f2aa7920c509ee01023 |
function nc=vc2nc(v2,hb)
% volume coords to normalized cords
% ----------------------------------
s_x=hb.hdr.hist.srow_x;
s_y=hb.hdr.hist.srow_y;
s_z=hb.hdr.hist.srow_z;
% s_x(find(s_x(1:3)==0))=1;
% s_y(find(s_y(1:3)==0))=1;
% s_z(find(s_z(1:3)==0))=1;
nc(:,1) = s_x(1).* v2(:,1) + s_x(2).* v2(:... |
github | philippboehmsturm/antx-master | m_select3d.m | .m | antx-master/mritools/labs/m_select3d.m | 11,219 | utf_8 | 9813d3db9488481df18c76c0bb374a61 | function [pout, vout, viout, facevout, faceiout] = m_select3d(obj)
%SELECT3D(H) Determines the selected point in 3-D data space.
% P = SELECT3D determines the point, P, in data space corresponding
% to the current selection position. P is a point on the first
% patch or surface face intersected along the sele... |
github | philippboehmsturm/antx-master | pmakemask.m | .m | antx-master/mritools/labs/pmakemask.m | 4,079 | utf_8 | 27116389c072e8e0718ac7a51e8904fd |
function pmakemask(nameout,radius)
% pmakemask('__muell',10)
% make mask based on current position of SPM's coordinate
% nameout: outputfilename
% radius : radius of VOI [mm]
% example: pmakemask('__muell',10) ;%current MIP-poistion with radius 10mm
% =======================================================... |
github | philippboehmsturm/antx-master | fun2_activateResults.m | .m | antx-master/mritools/labs/fun2_activateResults.m | 802 | utf_8 | f987e9dbe2372ef2d74d4d4a730a630e |
function fun2_activateResults
% 'fun2_activateResults: function used during shift MIPcursor'
drawnow;
pause(.1);
fig3=findobj(0,'Tag','Graphics');
ax=findobj(fig3,'Tag','hMIPax');
xyz=spm_mip_ui('GetCoords',ax);
[labelx header labelcell]=pick_wrapper(xyz(:)', 'Noshow');%
% cprintf([1 0 1],'fun2_activateR... |
github | philippboehmsturm/antx-master | pwritevol2vol.m | .m | antx-master/mritools/labs/pwritevol2vol.m | 852 | utf_8 | f780ac0088af85ea5244122ccf0abd12 |
function pwritevol2vol(name,dat3d,strct, description)
% function pwritevol2vol(name,dat3d,strct, description)
% write 3d volume to majo-IMG/HDR
if exist('description')==0; description=''; end
name=regexprep(name,'.img$','');
[pathi nameshort aaa]=fileparts(name);
if isempty(pathi)
pathi=... |
github | philippboehmsturm/antx-master | batab.m | .m | antx-master/mritools/labs/batab.m | 1,093 | utf_8 | 195ad1cdae29a80928bd58947226df6d |
function varargout=batab(varargin) %show BAtable
% use with SPM: batab(1) from cmd-line
busy;
if varargin{1}==1%whole brain
xSPM= evalin('base','xSPM');
hReg= evalin('base','hReg');
TabDat = spm_list('List',xSPM,hReg);
assignin('base','TabDat',TabDat);
elseif varargin{1}==2%curent cl... |
github | philippboehmsturm/antx-master | slice2mm.m | .m | antx-master/mritools/methods/slice2mm.m | 1,355 | utf_8 | 37d73cbd53149366b185b95bff9647bf |
%% convert slice to mm (get mm of slices)
% function out=slice2mm(fi, slices, dimx);
%% IN
% fi: fp-path of volume or spm-volume-header
% slices: array of slice-numbers
% dimx: which dimention 1,2,3 or 'allen' (which is dimx=2) or 'native' (which is dimx==3) (space)
%% OUT : 2d-array [slices x mm]
%% ... |
github | philippboehmsturm/antx-master | makeMaskT2.m | .m | antx-master/mritools/methods/makeMaskT2.m | 701 | utf_8 | 21be7a2bd6867d4729f11ef7c66a66b9 |
%make mask from t2 image
% makeMaskT2(file,fileout, thresh)
% example
% file='O:\harms1\harms3_lesionfill\templates\AVGT.nii'
% fileout='O:\harms1\harms3_lesionfill\templates\allemask.nii'
% thresh='>50'; %string with operator and number ,e.g. '>0'
% makeMaskT2(file,fileout, thresh)
function makeMaskT2(f... |
github | philippboehmsturm/antx-master | fileparts2.m | .m | antx-master/mritools/methods/fileparts2.m | 305 | utf_8 | 9f58b31e1b0df0639f018820177e1a9f |
% fileparts2: for multiple paths (cell)
% function [pathstr, name, ext] = fileparts2(file)
function [pathstr, name, ext] = fileparts2(fi)
if ~iscell(fi); fi=cellstr(fi); end
[pathstr name ext]=deal({});
for i=1:length(fi)
[pathstr{i,1} name{i,1} ext{i,1}]=fileparts(fi{i});
end
|
github | philippboehmsturm/antx-master | makeMaskT3m.m | .m | antx-master/mritools/methods/makeMaskT3m.m | 782 | utf_8 | 2181a7bdb9633683ef4a9e7ccd084535 |
%make mask from t2 image
% makeMaskT2(file,fileout, thresh)
% example
% file='O:\harms1\harms3_lesionfill\templates\AVGT.nii'
% fileout='O:\harms1\harms3_lesionfill\templates\allemask.nii'
% thresh='>50'; %string with operator and number ,e.g. '>0'
% makeMaskT2(file,fileout, thresh)
function makeMaskT3(f... |
github | philippboehmsturm/antx-master | explorerpreselect.m | .m | antx-master/mritools/methods/explorerpreselect.m | 109 | utf_8 | 6abb83b2bfe58926f850ff85939548a0 | %% preselect file in explorer
function explorerpreselect(fi)
system(['explorer.exe /select,"' fi '"']);
|
github | philippboehmsturm/antx-master | bruker2nifti.m | .m | antx-master/mritools/methods/bruker2nifti.m | 8,396 | utf_8 | e75dca28e0fa06efd4296d9b329dfea0 |
function tagout=bruker2nifti(pathin, pathout)
%
% s=input('use GUI or ')
% [files,dirs] = spm_select('FPListRec',a,'2dseq')
%% gui ..get 2dseq
if ~exist('pathin') || isempty(pathin); pathin=pwd; end
disp('====================================================');
disp('*** find recursively all "2dseq"... |
github | philippboehmsturm/antx-master | rimg2nii.m | .m | antx-master/mritools/methods/rimg2nii.m | 2,359 | utf_8 | dc8f91efbfd0f1f2dd217a74210cf2be |
function fiout=rimg2nii(in,gui )
%% convert analyze2niffti with empty(GUI) or path/FPfile-INPUT
% fiout=rimg2nii(in,gui )
%% INPUTS
% in: empty [],path <string> or fullpathfilename of imag(s) <string/cell>
% gui: <0|1> with GUI for selection of files (empty: open GUI)
%
%% OUTPUTS
% fiout: cell with FP... |
github | philippboehmsturm/antx-master | existn.m | .m | antx-master/mritools/methods/existn.m | 605 | utf_8 | 9b9c7d7b122cf84063d957e54566ad2d |
%% exist-function for multiple files/objects --if input is cell-type
%% function b=existn(ce,varargin)
% output: vector with flags as in exist.m
%% example
% q={ 'O:\data\karina\dat\s2014109_02sr_1_x_x\JD.nii'
% 'O:\data\karina\dat\s20141009_03sr_1_x_x\JD.nii'
% 'O:\data\karina\dat\s20141009_05sr_1_... |
github | philippboehmsturm/antx-master | spm_orthviews2.m | .m | antx-master/mritools/displaykey/spm_orthviews2.m | 62,002 | utf_8 | b294d80d56447081c7b5e8b06fc6c119 | function varargout = spm_orthviews(action,varargin)
% Display Orthogonal Views of a Normalized Image
% FORMAT H = spm_orthviews('Image',filename[,position])
% filename - name of image to display
% area - position of image
% - area(1) - position x
% - area(2) - position y
% - area... |
github | philippboehmsturm/antx-master | dispoverlay3.m | .m | antx-master/mritools/displaykey/dispoverlay3.m | 7,652 | utf_8 | a56808f77d607327389520407878aff2 |
function dispoverlay3(img1all,img2,namestr)
% FOR MULTIPLE PATHS
% dispoverlay2(paths,img2 )
% paths: cell of paths
% img2 : referenceImage
if ~iscell(img1all); img1all={img1all}; end
% if ~iscell(img1all); img1all={img1all}; end
global ovl ;
ovl.img1all=img1all;
ovl.img2 =img2 ;
ovl.n ... |
github | philippboehmsturm/antx-master | spm_image2.m | .m | antx-master/mritools/displaykey/spm_image2.m | 23,612 | utf_8 | a789d28249f3ecdab3d96e985ff422b5 | function spm_image(op,varargin)
% image and header display
% FORMAT spm_image
%_______________________________________________________________________
%
% spm_image is an interactive facility that allows orthogonal sections
% from an image volume to be displayed. Clicking the cursor on either
% of the three images mov... |
github | philippboehmsturm/antx-master | dispoverlay2.m | .m | antx-master/mritools/displaykey/dispoverlay2.m | 4,799 | utf_8 | c7a17e8fbc5c1d90a1a11a783e1f7ece |
function dispoverlay2(paths,img2)
% FOR MULTIPLE PATHS
% dispoverlay2(paths,img2 )
% paths: cell of paths
% img2 : referenceImage
global ovl ;
ovl.paths=paths;
ovl.img2 =img2 ;
ovl.n =1 ;
ovl.doloop =1;
%====================================
while ovl.doloop==1
% for i=6:size(pa... |
github | philippboehmsturm/antx-master | Kopie von keyb.m | .m | antx-master/mritools/displaykey/Kopie von keyb.m | 12,469 | utf_8 | 70d6eccf6e42cba7b93669fe43cbd6dc |
function keyb(src,evnt)
if nargin==0
helphelp;
return
end
if length(evnt.Modifier) == 1 & strcmp(evnt.Modifier{:},'control') & strcmp(evnt.Key, 'control')
return
end
if length(evnt.Modifier) == 1 & strcmp(evnt.Modifier{:},'shift') & strcmp(evnt.Key, 'shift')
return
end
box=getappda... |
github | philippboehmsturm/antx-master | dispoverlay.m | .m | antx-master/mritools/displaykey/dispoverlay.m | 2,217 | utf_8 | 1f8ba913d57538f42af3d5e293bcc2a9 |
function dispoverlay(img1,img2, namestr)
% inside function used for s1_checkoverlay
% img1='V:\MRI_testdata\T2w_nifti\s20150909_FK_C2M09_1_3_1\\s20150909_FK_C2M09_1_3_1.nii'
% img2='V:\mritools\tpm\pgreyr62.nii'
% namestr ='7/28 - s20150909_FK_C2M09_1_3_1'
displaykey2(img1,img2);
delete(findobj(gcf,'t... |
github | philippboehmsturm/antx-master | propertiesGUI.m | .m | antx-master/mritools/others/propertiesGUI.m | 71,009 | utf_8 | 588c931336a6890ed0c786d68a8a78ad | function [hPropsPane,parameters] = propertiesGUI(hParent, parameters, filename, selectedBranch)
% propertiesGUI displays formatted editable list of properties
%
% Syntax:
%
% Initialization:
% [hPropsPane,parameters] = propertiesGUI(hParent, parameters)
%
% Run-time interaction:
% propertiesGUI(hProp... |
github | philippboehmsturm/antx-master | statusbar2.m | .m | antx-master/mritools/others/statusbar2.m | 5,517 | utf_8 | 2e007da52415e6ab6672df267410c7ab |
%% statusbar in commandwindow
%% function statusbar2(task,varargin)
% statusbar2(0) ;%start statusbar + timer starts
% statusbar2(0, 'info1', 'info2','info3') ;%start statusbar + timer starts+ optional up to 3 infos (string) can be displayed
% statusbar2(1, 'info1UPdate', 'info2UPdate','info3UPdate'); %u... |
github | philippboehmsturm/antx-master | load_nii_ext.m | .m | antx-master/mritools/others/nii/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 | philippboehmsturm/antx-master | rri_orient.m | .m | antx-master/mritools/others/nii/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 | philippboehmsturm/antx-master | save_untouch0_nii_hdr.m | .m | antx-master/mritools/others/nii/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 | philippboehmsturm/antx-master | rri_zoom_menu.m | .m | antx-master/mritools/others/nii/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 | philippboehmsturm/antx-master | rri_select_file.m | .m | antx-master/mritools/others/nii/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 | philippboehmsturm/antx-master | clip_nii.m | .m | antx-master/mritools/others/nii/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 | philippboehmsturm/antx-master | affine.m | .m | antx-master/mritools/others/nii/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 | philippboehmsturm/antx-master | load_untouch_nii_img.m | .m | antx-master/mritools/others/nii/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 | philippboehmsturm/antx-master | load_untouch_nii.m | .m | antx-master/mritools/others/nii/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 | philippboehmsturm/antx-master | collapse_nii_scan.m | .m | antx-master/mritools/others/nii/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 | philippboehmsturm/antx-master | rri_orient_ui.m | .m | antx-master/mritools/others/nii/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 | philippboehmsturm/antx-master | load_untouch0_nii_hdr.m | .m | antx-master/mritools/others/nii/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 | philippboehmsturm/antx-master | load_nii.m | .m | antx-master/mritools/others/nii/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 | philippboehmsturm/antx-master | unxform_nii.m | .m | antx-master/mritools/others/nii/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 | philippboehmsturm/antx-master | load_untouch_nii_hdr.m | .m | antx-master/mritools/others/nii/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 | philippboehmsturm/antx-master | save_nii_ext.m | .m | antx-master/mritools/others/nii/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 | philippboehmsturm/antx-master | view_nii_menu.m | .m | antx-master/mritools/others/nii/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 | philippboehmsturm/antx-master | save_untouch_header_only.m | .m | antx-master/mritools/others/nii/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 | philippboehmsturm/antx-master | pad_nii.m | .m | antx-master/mritools/others/nii/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 | philippboehmsturm/antx-master | load_nii_hdr.m | .m | antx-master/mritools/others/nii/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 | philippboehmsturm/antx-master | save_untouch_slice.m | .m | antx-master/mritools/others/nii/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 | philippboehmsturm/antx-master | load_nii_img.m | .m | antx-master/mritools/others/nii/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,... |
github | philippboehmsturm/antx-master | bresenham_line3d.m | .m | antx-master/mritools/others/nii/bresenham_line3d.m | 4,682 | utf_8 | f2e52d1f3ac9779b22baf3bb4d2ac201 | % Generate X Y Z coordinates of a 3D Bresenham's line between
% two given points.
%
% A very useful application of this algorithm can be found in the
% implementation of Fischer's Bresenham interpolation method in my
% another program that can rotate three dimensional image volume
% with an affine matrix:
... |
github | philippboehmsturm/antx-master | make_nii.m | .m | antx-master/mritools/others/nii/make_nii.m | 7,105 | utf_8 | 6b1565392965b164217621e71d213ddd | % Make NIfTI structure specified by an N-D matrix. Usually, N is 3 for
% 3D matrix [x y z], or 4 for 4D matrix with time series [x y z t].
% Optional parameters can also be included, such as: voxel_size,
% origin, datatype, and description.
%
% Once the NIfTI structure is made, it can be saved into NIfT... |
github | philippboehmsturm/antx-master | verify_nii_ext.m | .m | antx-master/mritools/others/nii/verify_nii_ext.m | 1,721 | utf_8 | 0339aeb8d7286e4f08165c9eeeb4c2cd | % Verify NIFTI header extension to make sure that each extension section
% must be an integer multiple of 16 byte long that includes the first 8
% bytes of esize and ecode. If the length of extension section is not the
% above mentioned case, edata should be padded with all 0.
%
% Usage: [ext, esize_total] = ... |
github | philippboehmsturm/antx-master | get_nii_frame.m | .m | antx-master/mritools/others/nii/get_nii_frame.m | 4,497 | utf_8 | cc9b1b92f34e5ae67dc34c35a5174c75 | % Return time frame of a NIFTI dataset. Support both *.nii and
% *.hdr/*.img file extension. If file extension is not provided,
% *.hdr/*.img will be used as default.
%
% It is a lightweighted "load_nii_hdr", and is equivalent to
% hdr.dime.dim(5)
%
% Usage: [ total_scan ] = get_nii_frame(filename)
%
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.