Skip to content

AFNI/NIfTI Server

Sections
Personal tools
You are here: Home » AFNI » Documentation

Doxygen Source Code Documentation


ResliceBrick.m File Reference

Go to the source code of this file.


Functions

'AMzsspgrco+orig.BRIK', 'AHzsspgrax+orig' ResliceBrick ()
 if (isempty(tmp))
 if (exist(CodeBrick)==2)
 if (err)
make sure Opt is OK if (nargin==2)
else if (~isfield(Opt, 'Prefix')|isempty(Opt.Prefix))
end if (~isfield(Opt, 'verbose')|isempty(Opt.verbose))
end if (~isfield(Opt, 'WriteBrick')|isempty(Opt.WriteBrick))
end end if ((~isfield(Opt,'WriteBrick')|~Opt.WriteBrick)&nargout< 4)
end end warndlg (sprintf('Warning%s:From the number of output arguments and the Opt.WriteBrick, it does not look like you are planning on doing much.', FuncName))
end if (isempty(Opt.Prefix))
 if ((exist(sprintf('%s.HEAD', Info.RootName))==2)|(exist(sprintf('%s.BRIK', Info.RootName))==2)) ErrMessage
end load the brick if (Opt.verbose)
end load the brick fprintf (1,'Loading brick%s from disk...', BrickName)
end fprintf (1,'\tDone.\n')
end determine the required
transformation 
fprintf (1,'Reslicing%s to%s...\n', OldCode, NewCode)
 V (:,:,:)
Info ORIGIN (1)
Info ORIGIN (2)
Info ORIGIN (3)
 fprintf (1,'Writing resliced brick%s to disk...', Info.RootName)

Variables

 function [err, ErrMessage, Info, V]
the output prefix is the input
prefix_< NewCode
WriteBrick = 1
the output prefix is the input
prefix_< NewCode > you need
to have the images making
up the different volumes to
be in aqcuired in the same
plane and orientation In this 
example
Author __pad2__
Author Bethesda Maryland Define
the function name for easy
referencing 
FuncName = 'ResliceBrick'
Debug Flag DBG = 1
initailize return variables err = 1
 ErrMessage = ''
make sure Code is OK tmp = WordNumber(AllOrient , NewCode, '|')
maybe it s a Brick CodeBrick = RemoveExtension(NewCode, '.HEAD|.BRIK')
 return
end NewCode = InfoCode.ORIENT_SPECIFIC
change it to string [err, NewCode] = AFNI_OrientCode (NewCode)
end end Clean up the input
Brick s header 
BrickName = RemoveExtension(BrickName, '.HEAD|.BRIK')
make sure Opt is OK Opt Prefix = ''
Opt verbose = 1
 drawnow
end Info RootName = sprintf('%s%s', Opt.Prefix, BrickName_View)
 end [err, V, Info, ErrMessage] = BrikLoad(sprintf('%s', BrickName))
 V = permute(V, maplocation)
 Info_orig = Info
Info DELTA = Info_orig.DELTA(maplocation).* mapsign
 N = size(V,1)
end setup the new header and
write out the files 
FIXED
Info DATASET_DIMENSIONS = Info_orig.DATASET_DIMENSIONS(maplocation)

Function Documentation

fprintf ,
'Writing resliced brick%s to disk...'  ,
Info.  RootName
 

end determine the required transformation fprintf ,
'Reslicing%s to%s...\n ,
OldCode  ,
NewCode 
 

end fprintf ,
'\tDone.\n
 

end load the brick fprintf ,
'Loading brick%s from disk...'  ,
BrickName 
 

end load the brick if Opt.  verbose  ) 
 

if (exist(sprintf('%s.HEAD', Info.RootName))==2)|(exist(sprintf('%s.BRIK', Info.RootName))==2)   ) 
 

end if isempty(Opt.Prefix  ) 
 

end end if  ) 
 

end if isfield(Opt, 'WriteBrick')|isempty(Opt.WriteBrick)  ) 
 

end if isfield(Opt, 'verbose')|isempty(Opt.verbose)  ) 
 

else if isfield(Opt, 'Prefix')|isempty(Opt.Prefix)  ) 
 

make sure Opt is OK if nargin  = = 2  ) 
 

if err   ) 
 

if exist(CodeBrick = = 2  ) 
 

if isempty(tmp)   ) 
 

Info ORIGIN  ) 
 

Info ORIGIN  ) 
 

Info ORIGIN  ) 
 

'AMzsspgrco+orig.BRIK', 'AHzsspgrax+orig' ResliceBrick  )  [static, virtual]
 

V ,
,
 

end end warndlg sprintf('Warning%s:From the number of output arguments and the Opt.WriteBrick, it does not look like you are planning on doing much.', FuncName  ) 
 


Variable Documentation

Author __pad2__
 

Definition at line 42 of file ResliceBrick.m.

end end Clean up the input Brick s header BrickName = RemoveExtension(BrickName, '.HEAD|.BRIK')
 

Definition at line 73 of file ResliceBrick.m.

CodeBrick = RemoveExtension(NewCode, '.HEAD|.BRIK')
 

Definition at line 60 of file ResliceBrick.m.

Info DATASET_DIMENSIONS = Info_orig.DATASET_DIMENSIONS(maplocation)
 

Definition at line 153 of file ResliceBrick.m.

Debug Flag DBG = 1
 

Definition at line 49 of file ResliceBrick.m.

Info DELTA = Info_orig.DELTA(maplocation).* mapsign
 

Definition at line 123 of file ResliceBrick.m.

drawnow
 

Definition at line 89 of file ResliceBrick.m.

end[err, maplocation, mapsign, Mtrans] = BrikLoad(sprintf('%s', BrickName))
 

Definition at line 118 of file ResliceBrick.m.

end err = 1
 

Definition at line 168 of file ResliceBrick.m.

ErrMessage = ''
 

Definition at line 107 of file ResliceBrick.m.

the output prefix is the input prefix_<NewCode> you need to have the images making up the different volumes to be in aqcuired in the same plane and orientation In this example
 

Definition at line 1 of file ResliceBrick.m.

end setup the new header and write out the files FIXED
 

Definition at line 151 of file ResliceBrick.m.

end setup the new header and write out the files FuncName = 'ResliceBrick'
 

Definition at line 151 of file ResliceBrick.m.

function[err, ErrMessage, Info, V]
 

Initial value:

 ResliceBrick (BrickName, NewCode, Opt)
%
%   [err, ErrMessage, Info, M] = ResliceBrick (BrickName, NewCode, [Opt])
%
%Purpose:
%  Reslices an AFNI brick kinda a la 3daxialize but in any orientation desired
%  No interpolation or shananigans are done 
%   
%Input Parameters:
%   BrickName the name of the afni brick
%   NewCode The orientation code to write the new brick as 'RPS' or 'RAI' 
%     or the name of a brick to reslice the data as. The new code is extracted from
%     that brick's header.
%   Opt is an optional options structure with the following fields
%     .Prefix : (optional) prefix of the output brick. Default is ''
%               in which case

Definition at line 1 of file ResliceBrick.m.

Info_orig = Info
 

Definition at line 121 of file ResliceBrick.m.

end N = size(V,1)
 

Definition at line 142 of file ResliceBrick.m.

end NewCode = InfoCode.ORIENT_SPECIFIC
 

Definition at line 64 of file ResliceBrick.m.

end Opt Prefix = ''
 

Definition at line 93 of file ResliceBrick.m.

return
 

Definition at line 169 of file ResliceBrick.m.

end Info RootName = sprintf('%s%s', Opt.Prefix, BrickName_View)
 

Definition at line 95 of file ResliceBrick.m.

change it to string[err, NewCode] = AFNI_OrientCode (NewCode)
 

Definition at line 66 of file ResliceBrick.m.

make sure Code is OK tmp = WordNumber(AllOrient , NewCode, '|')
 

Definition at line 56 of file ResliceBrick.m.

V = permute(V, maplocation)
 

Definition at line 120 of file ResliceBrick.m.

end Opt verbose = 1
 

Definition at line 83 of file ResliceBrick.m.

end Opt WriteBrick = 1
 

Definition at line 84 of file ResliceBrick.m.

 

Powered by Plone

This site conforms to the following standards: