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 16, 2009 09:54AM
Dear Bob and Ziad, and other helpful matlab-to-AFNI converters,

I have almost successfully written a 64x64 matrix (matp) of numbers (floating point) as an AFNI Brik file, but alas, I need help with the very last step. I want to convert matp into a functional overlay that can be read into AFNI.

I have read in the header info from the header of a functional dataset, and modified the attributes as below. Note that my matrix was only calculated for slice 1, so i only need one sub-brick.

[err, Func, FInfo, ErrMessage] = BrikLoad ('scan1+orig');

InfoDelOut = FInfo;
InfoDelOut.RootName = ''; %that'll get set by WriteBrik
InfoDelOut.DATASET_RANK(2) = 1; %one sub-brick
InfoDelOut.TAXIS_NUMS(1) = InfoDelOut.DATASET_RANK(2); %one sub-brick
InfoDelOut.BRICK_TYPES = [1]; %store data as shorts
InfoDelOut.BRICK_STATS = []; %automatically set
InfoDelOut.BRICK_FLOAT_FACS = [];%automatically set
InfoDelOut.BRICK_LABS = 'test';
InfoDelOut.IDCODE_STRING = '';%automatically set
InfoDelOut.BRICK_STATAUX = [1 2 3 160 2 2]; %WHAT IS THIS?
InfoDelOut.DATASET_DIMENSIONS(3) = 1; %write out slice 1

%Important! See README.attributes for more details
InfoDelOut.SCENE_DATA(1) = 0; %3DIM_HEAD_FUNC
InfoDelOut.SCENE_DATA(2) = 3; %fitt: t-statistic
InfoDelOut.SCENE_DATA(3) = 2; %corresponds to SCENE_DATA(1)

Then I defined the OptDelOut struct:

OptDelOut.Scale = 1;
OptDelOut.Prefix = 'Testmap';
OptDelOut.verbose = 0;
OptDelOut.View = '+orig';
OptDelOut.Slices = 1;

And ran the WriteBrik command:
[err, ErrMessage, matpInfo] = WriteBrik (matp, InfoDelOut, OptDelOut);

This produced no errors, and when i read Testmap+orig back into matlab using the LoadBrik command, and plotted it with imagesc, everything was fine. But when I tried to load Testmap+orig into AFNI, i got these errors:

DATASET error: non-matching SCENE_TYPE[2]
DATASET error: function type missing auxilliary statistical data
DATASET error: illegal time-dependent dataset and func_type combination!

So I have not specified things properly in SCENE_DATA. The numbers in matp are not any of the options for the func type, so i just picked t-statistic (3). Can you please advise?

Thanks very much!
cnan
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