|
|
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 |
( |
1 |
, |
|
|
'Writing resliced brick%s to disk...' |
, |
|
|
Info. |
RootName |
|
) |
|
|
| end fprintf |
( |
1 |
, |
|
|
'\tDone.\n' |
|
|
) |
|
|
| end load the brick fprintf |
( |
1 |
, |
|
|
'Loading brick%s from disk...' |
, |
|
|
BrickName |
|
|
) |
|
|
| end load the brick if |
( |
Opt. |
verbose |
) |
|
|
| end if |
( |
~ |
isfield(Opt, 'WriteBrick')|isempty(Opt.WriteBrick) |
) |
|
|
| end if |
( |
~ |
isfield(Opt, 'verbose')|isempty(Opt.verbose) |
) |
|
|
| else if |
( |
~ |
isfield(Opt, 'Prefix')|isempty(Opt.Prefix) |
) |
|
|
| 'AMzsspgrco+orig.BRIK', 'AHzsspgrax+orig' ResliceBrick |
( |
|
) |
[static, virtual] |
|
Variable Documentation
| make sure Code is OK tmp = WordNumber(AllOrient , NewCode, '|') |
|
| V = permute(V, maplocation) |
|
|