Doxygen Source Code Documentation
BrikLoad.m File Reference
Go to the source code of this file.
Functions | |
BrikName,[Opt] | Purpose:Parameters: (id Input,[,] 2 DATASET_RANK) |
Note that indexing in matlab is different than in AFNI Matlab starts indexing at while AFNI starts with So | voxel (i, j, k) in AFNI corresponds to voxel(i+1 |
plot the time course of | voxel (29, 33, 3)%plot(squeeze(V(30 |
plot the time course of squeeze is used to turn the x1x1x160 matrix into a x1 vector for the plot function see also WriteBrik The core for this | function (fread and reshape) is based on%Timothy M.Ellmore's(Laboratory of Brain and Cognition |
if (~isstruct(param1)) | |
if (~isfield(Opt,'FileFormat')) | |
if (isempty(Opt.FileFormat)) | |
if (~isempty(xtr)) | |
end | elseif (strcmp(Opt.FileFormat, '1D')|strcmp(Opt.FileFormat, '1d')) |
end | if (is1D) |
if (~isfield(Opt, 'method')|isempty(Opt.method)) | |
end | if (isfield(Opt,'Slices')&~isempty(Opt.Slices)) |
end | if (length(Opt.Slices)~=1) |
end | if (~isfield(Opt, 'SliceSize_1D')|isempty(Opt.SliceSize_1D)) |
if (isfield(Opt,'Frames')&~isempty(Opt.Frames)) | |
if (err) | |
end assume you have a brik format and proceed as usual make sure Opt fields are set OK That s done for the new usage format | if (~isfield(Opt,'')|isempty(Opt.)) |
end | if (~isfield(Opt,'Format')|isempty(Opt.Format)) |
end | if (~isfield(Opt,'MachineFormat')|isempty(Opt.MachineFormat)) |
end | if (~isfield(Opt,'Scale')|isempty(Opt.Scale)) |
end you can change the default for the new usage here | if (~isfield(Opt,'Slices')|isempty(Opt.Slices)) |
end | if (~isfield(Opt,'Frames')|isempty(Opt.Frames)) |
end | if (~isfield(Opt,'FileFormat')|isempty(Opt.FileFormat)) |
end set the format | if (eq_str(Opt.Format,'vector')) |
elseif (eq_str(Opt.Format,'matrix')) | |
if (~isempty(vtmp)) | |
if (~filexist(sHead)) | |
end | if (~filexist(sBRIK)) |
end get Brik info and setup for slice and frame | selectors (for FMRISTAT)[err |
if (~strcmp(Info.ByteOrder,'unspecified')) | |
found byte order make sure it does not conflict with the user option | if (~isempty(Opt.MachineFormat)) |
found byte order make sure it does not conflict with the user option user specified a format | if (~strcmp(Info.ByteOrder, Opt.MachineFormat)) |
found byte order make sure it does not conflict with the user option user specified a format warn | ErrEval (FuncName,'Wrn_Machine format specified conflicts with.HEAD info.Proceeding with fread...') |
end else did not find ByteOrder in use user option or pick default | if (isempty(Opt.MachineFormat)) |
ErrEval (FuncName,'Wrn_No Machine Format was specified by user or found in.HEAD file.Using ieee-be(MSB_FIRST)') | |
if (length(itype) > 1) | |
errordlg (ErrMessage) | |
if (fidBRIK< 0) | |
if isallslices | fseek (fidBRIK, numpix *Info.DATASET_DIMENSIONS(3)*(frame-1)*Info.TypeBytes, 'bof') |
V (istrt:istp) | |
fseek (fidBRIK, numpix *(slice-1+Info.DATASET_DIMENSIONS(3)*(frame-1))*Info.TypeBytes, 'bof') | |
end end end end | fclose (fidBRIK) |
scale if required | if (Opt.Scale) = AFNI_OrientCode(NewCode) |
if (~isempty(iscl)) | |
end end end if reshape V | if (~DoVect) |
size (V) figure(1) | |
subplot (2, 2, k) | |
imagesc (V(:,:, Opt.Slices(i), Opt.Frames(j))) | |
if (exist('spectral')) colormap(spectral) | |
figure (2) | |
imagesc (V(:,:, i, j)) | |
colormap (spectral) | |
Variables | |
function [err, V, Info, ErrMessage] | |
see New | Usage [err, V, Info, ErrMessage] |
see New name of the brik | form |
see New name of the brik vector or matrix this is | optional |
plot the time course of squeeze is used to turn the x1x1x160 matrix into a x1 vector for the plot function see also | BrikInfo |
plot the time course of squeeze is used to turn the x1x1x160 matrix into a x1 vector for the plot function see also | Info_1D |
plot the time course of squeeze is used to turn the x1x1x160 matrix into a x1 vector for the plot function see also WriteBrik The core for this NIMH function ReadBRIK Slices and Frames options were added by Dr Keith Worsley for FMRISTAT | http |
plot the time course of squeeze is used to turn the x1x1x160 matrix into a x1 vector for the plot function see also WriteBrik The core for this NIMH function ReadBRIK Slices and Frames options were added by Dr Keith Worsley for FMRISTAT Marquette University Biophysics Research | institute |
plot the time course of squeeze is used to turn the x1x1x160 matrix into a x1 vector for the plot function see also WriteBrik The core for this NIMH function ReadBRIK Slices and Frames options were added by Dr Keith Worsley for FMRISTAT Marquette University Biophysics Research Medical College of Wisconsin | Contact |
Debug Flag | DBG = 1 |
initailize return variables | err = 1 |
V = [] | |
Info = [] | |
ErrMessage = '' | |
switch | nargin |
switch | case |
switch | DoVect = 0 |
Opt | MachineFormat = '' |
Opt | Format = 'matrix' |
Opt | Scale = 1 |
Opt | Slices = [] |
Opt | Frames = [] |
Opt | FileFormat = '' |
else | Opt = param1 |
otherwise | |
return | |
end Are we dealing with a D file | is1D = 0 |
try to | guess [St, xtr] = Remove1DExtension(BrikName) |
Opt | verb = 1 |
Opt | method = 0 |
end Opt | chunk_size = Opt.SliceSize_1D |
Opt | chunk_index = Opt.Slices - 1 |
Opt | col_index = Opt.Frames - 1 |
end | end [err, V, Info] = Read_1D(BrikName, Opt) |
end Fix the name of the brik make sure there are no BRIK or HEAD | vtmp = findstr(BrikName,'.BRIK') |
remove BRIK | BrikName = BrikName(1:vtmp(1)-1) |
end Now make sure HEAD and BRIK are present | sHead = sprintf('%s.HEAD', BrikName) |
sBRIK = sprintf('%s.BRIK', BrikName) | |
allslices = 1:Info.DATASET_DIMENSIONS(3) | |
end | isallslices = all(ismember(allslices,Opt.Slices)) |
allframes = 1:Info.DATASET_RANK(2) | |
end | isallframes = all(ismember(allframes,Opt.Frames)) |
found byte order | specs |
found byte order make sure it does not conflict with the user option user specified a format | clash |
end else did not find ByteOrder in | HEAD |
end end figure out storage type | itype = unique(Info.BRICK_TYPES) |
end switch case | typestr = 'ubit8' |
fidBRIK = fopen(BrikName, 'rb', Opt.MachineFormat) | |
end | numpix = Info.DATASET_DIMENSIONS(1)*Info.DATASET_DIMENSIONS(2) |
numslices = length(Opt.Slices) | |
numframes = length(Opt.Frames) | |
for | k |
istrt = 1+numpix*numslices*(k-1) | |
istp = istrt-1+numpix*numslices | |
else for | j |
scale if required | facs = Info.BRICK_FLOAT_FACS(Opt.Frames) |
iscl = find (facs) | |
find non zero scales | NperBrik = Info.DATASET_DIMENSIONS(1) .* Info.DATASET_DIMENSIONS(2) .* numslices |
end end end if | required |
for | i |
end | colorbar |
Function Documentation
|
Referenced by __glutSetupColormap(), apply_frame(), create_colormap(), Gif_NewXContextFromVisual(), glutGetColor(), main(), and SUMA_ShowAllVisuals(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Variable Documentation
|
Definition at line 244 of file BrikLoad.m. |
|
Definition at line 239 of file BrikLoad.m. |
|
Definition at line 84 of file BrikLoad.m. |
|
Definition at line 290 of file BrikLoad.m. |
|
Definition at line 138 of file BrikLoad.m. |
|
Definition at line 177 of file BrikLoad.m. |
|
Definition at line 176 of file BrikLoad.m. |
|
Definition at line 255 of file BrikLoad.m. |
|
Definition at line 178 of file BrikLoad.m. Referenced by quantize3_ord_dither(), quantize_ord_dither(), SUMA_AddColAttr(), and SUMA_AddDsetColAttr(). |
|
Definition at line 385 of file BrikLoad.m. |
|
Definition at line 99 of file BrikLoad.m. |
|
Definition at line 109 of file BrikLoad.m. |
|
Definition at line 203 of file BrikLoad.m. |
|
Definition at line 181 of file BrikLoad.m. |
|
Definition at line 349 of file BrikLoad.m. |
|
Definition at line 272 of file BrikLoad.m. |
|
Definition at line 328 of file BrikLoad.m. |
|
Definition at line 292 of file BrikLoad.m. |
|
Definition at line 198 of file BrikLoad.m. |
|
|
Definition at line 41 of file Test_BrikLoad.m. Referenced by SUMA_SaveDrawnROINIML(), and SUMA_Write_DrawnROI_NIML(). |
|
Definition at line 2070 of file GroupAna.m. |
|
Initial value: Definition at line 1 of file BrikLoad.m. |
|
Definition at line 153 of file BrikLoad.m. |
|
Definition at line 262 of file BrikLoad.m. |
|
Definition at line 99 of file BrikLoad.m. |
|
Initial value: Definition at line 381 of file BrikLoad.m. |
|
Definition at line 237 of file BrikLoad.m. |
|
Definition at line 84 of file BrikLoad.m. |
|
Definition at line 99 of file BrikLoad.m. |
|
Definition at line 158 of file BrikLoad.m. |
|
Definition at line 248 of file BrikLoad.m. |
|
Definition at line 243 of file BrikLoad.m. |
|
Definition at line 329 of file BrikLoad.m. |
|
Definition at line 334 of file BrikLoad.m. Referenced by SUMA_EquateSurfaceSize(), and SUMA_ProjectSurfaceToSphere(). |
|
Definition at line 333 of file BrikLoad.m. Referenced by SUMA_EquateSurfaceSize(), and SUMA_ProjectSurfaceToSphere(). |
|
Definition at line 294 of file WriteBrik.m. Referenced by EDIT_coerce_autoscale(), EDIT_coerce_autoscale_new(), EDIT_coerce_scale_type(), EDIT_coerce_type(), main(), mkcxcon(), PR_type_scale(), T3D_type_av_CB(), THD_init_datablock_brick(), v1h_put_nc_type(), and v1h_put_NCtype(). |
|
Initial value: Definition at line 332 of file BrikLoad.m. |
|
|
Definition at line 264 of file BrikLoad.m. |
|
Definition at line 78 of file Read_1D.m. Referenced by main(), and start_pass(). |
|
Definition at line 117 of file BrikLoad.m. |
|
Definition at line 330 of file BrikLoad.m. |
|
Definition at line 300 of file BrikLoad.m. |
|
Definition at line 298 of file BrikLoad.m. Referenced by int_downsample(). |
|
Definition at line 299 of file BrikLoad.m. |
|
|
Definition at line 5 of file BrikLoad.m. |
|
Definition at line 145 of file BrikLoad.m. |
|
Definition at line 340 of file BrikLoad.m. |
|
Definition at line 350 of file BrikLoad.m. |
|
Definition at line 223 of file BrikLoad.m. |
|
Definition at line 167 of file WriteBrik.m. |
|
Definition at line 222 of file BrikLoad.m. |
|
|
|
Definition at line 251 of file BrikLoad.m. |
|
Definition at line 302 of file WriteBrik.m. |
|
Initial value: BrikLoad (BrikName, [form], [MachineFormat]) % %Purpose: % loads an AFNI brik into V % % %Input Parameters: % BrikName Definition at line 5 of file BrikLoad.m. Referenced by main(). |
|
Definition at line 345 of file BrikLoad.m. |
|
|
Definition at line 215 of file BrikLoad.m. |