Hi Janine,

The problem was that I wasn't completely creating it using the GLM gui. I finally figured out how to do that (surprise, click "save" on the "GLM setup" window) and the problem was solved.

Thanks for your help!


On Wed, Mar 5, 2014 at 3:05 PM, Janine Bijsterbosch <[log in to unmask]> wrote:
Hi Paul,

You can actually paste variables into the GLM gui all in one go using the paste window (it's ctrl+y). I don't know why it doesn't like your design.mat file, do the file names match up correctly?

Cheers,

Janine

-----
Dr Janine Bijsterbosch
Postdoctoral Researcher
FMRIB Centre, University of Oxford
John Radcliffe Hospital
Oxford, United Kingdom
[log in to unmask]

On 5 Mar 2014, at 11:32, Paul Beach wrote:

Hi Janine,

That's actually what I thought, based on looking through the entirety of the nets_examples.m file.

Looking at my error message, though:
"An exception has been thrown: design.mat is not a valid vest file."
it looks as though it doesn't like my design.mat file, which I don't really understand. I'm going to try and re-make it.

As an aside, is there ANY way to properly make the design.mat file outside of the GLM gui (i.e. in something like a text file)? It's a real pain to type all these demeaned variables one at a time.

Thanks


On Wed, Mar 5, 2014 at 2:12 PM, Janine Bijsterbosch <[log in to unmask]> wrote:
Hi Paul,

You can actually run your full analysis using FSLnets. It allows you to estimate the correlation matrix, perform the R to Z transform and run the randomise analysis (without the need to write your data as niftis, or put it into the 4D format because FSLnets will do both steps for you).

Cheers,

Janine

-----
Dr Janine Bijsterbosch
Postdoctoral Researcher
FMRIB Centre, University of Oxford
John Radcliffe Hospital
Oxford, United Kingdom
[log in to unmask]

On 5 Mar 2014, at 10:32, Paul Beach wrote:

Thanks for the suggestion. I had to change "avwmaths" in my save_avw.m script to "fslmaths."

Now I just have to deal with this randomise error. I think it has to do with my input files, which I doubt are in the correct format. 

My resting-state data are currently in the format of pairwise correlation matrices - obtained via AFNI. How does one go about taking simple correlation matrices for subjects and turning them into the 4D matrices that are necessary? Is there a page you/someone else could suggest?

Thanks for your help.


On Wed, Mar 5, 2014 at 12:18 PM, Stephen Smith <[log in to unmask]> wrote:
This sounds like you are running a very old version of something - we have not had a command of this name for years....maybe check the read_avw matlab code you're using?
Cheers.


On 5 Mar 2014, at 17:13, Paul Beach <[log in to unmask]> wrote:

Well, I changed some things around and got matlab to be executable from terminal. I opened FSL, then matlab, ran my FSLNets and now I'm getting this:

>>[p_uncorrected,p_corrected]=nets_glm(netmat1,'painad3_design.mat','design.con',1);  % returns matrices of 1-p
 
/bin/bash: /usr/local/fsl/bin/avwmaths: No such file or directory
randomise options: -i /private/tmp/tpb3f28761_1972_41d9_9a0a_c76d2dde7550 -o /private/tmp/tpb3f28761_1972_41d9_9a0a_c76d2dde7550 -d painad3_design.mat -t design.con -x -n 5000 
Loading Data: Image Exception : #22 :: ERROR: Could not open image /private/tmp/tpb3f28761_1972_41d9_9a0a_c76d2dde7550
ERROR: Program failed

An exception has been thrown
ERROR: Could not open image /private/tmp/tpb3f28761_1972_41d9_9a0a_c76d2dde7550Trace: read_volume4DROI.


Exiting
Error in ==> nets_glm at 3
XXX=size(netmat,2);

??? Output argument "p_uncorrected" (and maybe others) not assigned
during call to
"/Users/pabeach1/Dropbox/Research/DATAS/fMRI/Pain/matlab/CURRENT_SCRIPTS_and_files/FSLNets/nets_glm.m>nets_glm". 


On Wed, Mar 5, 2014 at 11:47 AM, Paul Beach <[log in to unmask]> wrote:
Ok...

I added the necessary FSL startup information in my .bash_profile as per this page:
I'm assuming this is what you meant by "in your unix path."

I get FSL running (in terminal)

I open matlab (via icon, not in terminal - does this matter??), run my FSLNets, and I'm still getting the same error.  :-/


On Wed, Mar 5, 2014 at 11:17 AM, Stephen Smith <[log in to unmask]> wrote:
Hi - you need to have FSL running and in your unix path before you call matlab - then it should probably work OK.
Steve.


On 5 Mar 2014, at 16:13, Paul Beach <[log in to unmask]> wrote:

Steve,

A few other error problems, now. I've installed FSL on my local machine and it looks like everything is setup properly. Now, when I run the same command I get a different error message.

>> [p_uncorrected,p_corrected]=nets_glm(netmat1,'painad3_design.mat','design.con',1);  % returns matrices of 1-p
 
/bin/bash: /usr/local/fsl/bin/avwmaths: No such file or directory
/bin/bash: randomise: command not found
Error in ==> nets_glm at 3
XXX=size(netmat,2);

??? Output argument "p_uncorrected" (and maybe others) not assigned
during call to "/Users/pabeach1/Dropbox/Research/DATAS/fMRI
data/Pain/matlab folder/CURRENT SCRIPTS and
files/FSLNets/nets_glm.m>nets_glm".


Obviously it's not finding the above commands in the path I set at the beginning of the FSLnets script, which I set as per your instruction. I have the following at the beginning of my FSLnets script:

setenv( 'FSLDIR', '/usr/local/fsl');
fsldir = getenv('FSLDIR');
fsldirmpath = sprintf('%s/etc/matlab',fsldir);
path(path, fsldirmpath);
clear fsldir fsldirmpath;

addpath /Users/pabeach1/Dropbox/Research/DATAS/fMRI data/Pain/matlab folder/CURRENT SCRIPTS and files/FSLNets
addpath /Users/pabeach1/Dropbox/Research/DATAS/fMRI data/Pain/matlab folder/CURRENT SCRIPTS and files/FSLNets /Users/pabeach1/Dropbox/Research/DATAS/fMRI data/Pain/matlab folder/CURRENT SCRIPTS and files/FSLNets addpath(sprintf('%s/etc/matlab',getenv('FSLDIR')))


The first bit I included as part of a makeshift "startup.m" and it fixed the prior error I was getting. The second bit is obviously from the FSLnets script, itself, though specific to my matlab and FSLDIR file paths. 

Regardless, though, the current error appears as though matlab is not finding the correct file path - or - that the avwmaths/randomise programs are simply not there...which doesn't make sense.

Is this a problem, perhaps, with my randomise input?

Thoughts?


On Wed, Mar 5, 2014 at 9:38 AM, Paul Beach <[log in to unmask]> wrote:
Steve,

I was thinking this may be the problem as I was doing this using isolated FSLnets .m files on my laptop. Thanks for confirming.


On Wed, Mar 5, 2014 at 1:39 AM, Stephen Smith <[log in to unmask]> wrote:
Hi - please see the top of nets_examples.m - where it explains how to setup your path, including the relevant folder from $FSLDIR, which is what you're missing.

Steve



On 4 Mar 2014, at 20:51, Paul Beach <[log in to unmask]> wrote:

> FSL folks,
>
> I'm trying to work through a problem I'm encountering using the FSLnets series.
>
> All portions previous to this problem have ran smoothly.
> When I get to the nets_glm portion I'm using the following command and get this resultant error message:
>
> >> [p_uncorrected,p_corrected]=nets_glm(netmat1,'painad3_design.mat','design.con',1);
>
> ??? Undefined function or method 'save_avw_hdr' for input arguments of
>
> type 'double'.
>
>
> Error in ==> save_avw at 26
>
>        save_avw_hdr(img,tmpname,vtype,vsize);
>
>
> Error in ==> nets_glm at 16
>
> save_avw(reshape(netmat',XXX,1,1,TTT),fname,'f',[1 1 1 1]);
>
>
> Any suggestions on how to fix this??
>
> Thanks!
>
> --
> Paul Beach
> DO/PhD candidate
> Michigan State University
> College of Osteopathic Medicine
>   - Medical Scientist Training Program
> Neuroscience Program


---------------------------------------------------------------------------
Stephen M. Smith, Professor of Biomedical Engineering
Associate Director,  Oxford University FMRIB Centre

FMRIB, JR Hospital, Headington, Oxford  OX3 9DU, UK
+44 (0) 1865 222726  (fax 222717)
[log in to unmask]    http://www.fmrib.ox.ac.uk/~steve
---------------------------------------------------------------------------

Stop the cultural destruction of Tibet



--
Paul Beach
DO/PhD candidate - Year VI
Michigan State University
- College of Osteopathic Medicine
- Neuroscience Program
   - Bozoki Lab: Neurology/Radiology



--
Paul Beach
DO/PhD candidate - Year VI
Michigan State University
- College of Osteopathic Medicine
- Neuroscience Program
   - Bozoki Lab: Neurology/Radiology


---------------------------------------------------------------------------
Stephen M. Smith, Professor of Biomedical Engineering
Associate Director,  Oxford University FMRIB Centre

FMRIB, JR Hospital, Headington, Oxford  OX3 9DU, UK
+44 (0) 1865 222726  (fax 222717)
[log in to unmask]    http://www.fmrib.ox.ac.uk/~steve
---------------------------------------------------------------------------

Stop the cultural destruction of Tibet







--
Paul Beach
DO/PhD candidate - Year VI
Michigan State University
- College of Osteopathic Medicine
- Neuroscience Program
   - Bozoki Lab: Neurology/Radiology



--
Paul Beach
DO/PhD candidate - Year VI
Michigan State University
- College of Osteopathic Medicine
- Neuroscience Program
   - Bozoki Lab: Neurology/Radiology


---------------------------------------------------------------------------
Stephen M. Smith, Professor of Biomedical Engineering
Associate Director,  Oxford University FMRIB Centre

FMRIB, JR Hospital, Headington, Oxford  OX3 9DU, UK
+44 (0) 1865 222726  (fax 222717)
[log in to unmask]    http://www.fmrib.ox.ac.uk/~steve
---------------------------------------------------------------------------

Stop the cultural destruction of Tibet







--
Paul Beach
DO/PhD candidate - Year VI
Michigan State University
- College of Osteopathic Medicine
- Neuroscience Program
   - Bozoki Lab: Neurology/Radiology




--
Paul Beach
DO/PhD candidate - Year VI
Michigan State University
- College of Osteopathic Medicine
- Neuroscience Program
   - Bozoki Lab: Neurology/Radiology




--
Paul Beach
DO/PhD candidate - Year VI
Michigan State University
- College of Osteopathic Medicine
- Neuroscience Program
   - Bozoki Lab: Neurology/Radiology