AFNI Message Board

Dear AFNI users-

We are very pleased to announce that the new AFNI Message Board framework is up! Please join us at:

https://discuss.afni.nimh.nih.gov

Existing user accounts have been migrated, so returning users can login by requesting a password reset. New users can create accounts, as well, through a standard account creation process. Please note that these setup emails might initially go to spam folders (esp. for NIH users!), so please check those locations in the beginning.

The current Message Board discussion threads have been migrated to the new framework. The current Message Board will remain visible, but read-only, for a little while.

Sincerely, AFNI HQ

History of AFNI updates  

|
June 17, 2009 10:58AM
I don't think you need the Frames (or Slices) options at all, assuming you want to write all data in one go.

Below is a simple example that works for me. It requires the following variables:
- Info from an existing dataset (using BrikInfo),
- DATA as a X x Y x Z x T matrix (T=1 in your case; you may set subbrikcount=1)
- fnout as the name for your output brik
- a 'briklabels' cell where each element is the label for that subbrik (you could use briklabels={'foo'} to see if it works).
It writes a brik in floats, while it sets the statistical parameter of each subbrik as a z-score.

best,
Nick


subbrikcount=size(DATA,4);

myOpt=struct();
myOpt.Prefix=fnout;
myOpt.OverWrite='y';

myInfo=Info; %copy from input data
myInfo.BRICK_TYPES=repmat(3,1,subbrikcount); %float
myInfo.BRICK_STATS=[]; %is set by writebrik (see documentation)
myInfo.BRICK_FLOAT_FACS=[]; %" "
myInfo.DATASET_RANK(2)=subbrikcount;
myInfo.SCENE_DATA(2)=11; %brik

myInfo.HISTORY_NOTE=[myInfo.HISTORY_NOTE '; my genious comments' ];

brikstataux=[];
headers=[];
for i=1:subbrikcount
if i>1
headers=[headers '~'];
end
headers=[headers briklabels{i} ];
brikstataux=[brikstataux (i-1) 5 0]; %z score
end;

myInfo.BRICK_LABS=headers;
myInfo.BRICK_STATAUX=brikstataux;
myInfo.STAT_AUX=[];
fprintf('Writing brik with headers %s\n', headers);
disp(myInfo);

[err, ErrMessage, newInfo] = WriteBrik(DATA, myInfo, myOpt);
Subject Author Posted

WriteBrik

cnan June 16, 2009 09:54AM

Re: WriteBrik

Daniel Glen June 16, 2009 12:18PM

Re: WriteBrik

cnan June 16, 2009 01:57PM

Re: WriteBrik

Judd June 16, 2009 02:24PM

Re: WriteBrik

Daniel Glen June 16, 2009 04:44PM

Re: WriteBrik: OK now

cnan June 17, 2009 03:59AM

Re: WriteBrik: how to write multiple slices?

cnan June 17, 2009 05:42AM

Re: WriteBrik: how to write multiple slices?

Nick Oosterhof June 17, 2009 10:07AM

Re: WriteBrik: how to write multiple slices?

cnan June 17, 2009 10:26AM

Re: WriteBrik: how to write multiple slices?

Nick Oosterhof June 17, 2009 10:58AM

Re: WriteBrik: how to write multiple slices?: OK

cnan June 18, 2009 06:40AM

Re: WriteBrik: how to write multiple slices?: OK

Nick Oosterhof June 18, 2009 07:21AM

Re: WriteBrik: how to write multiple slices?: OK

cnan June 18, 2009 07:55AM