Back to PLS Help

creating DATAMAT file: error when loading sunject image data
annapbarnes
Posted on 07/02/13 04:23:44
Number of posts: 8
annapbarnes posts:

Hi

I'm having problems loading my image data into the create datamat session.  I have 2 conditions GM and WM and 34 subjects from 2 different groups.  The filename structure is subjID-condition-group.nii. I enter 2 conditions *GM*.nii and *WM*.nii and then press select subjects. I am presented with 34 entries subjID--group.nii. I select all these and then click create datamat. I am presented with a list of 34 files and I select all of those and then choose my brain mask and click create. It picks up 34 subjects for condition 1 and then stops at condition 2 subject 1 with an error in the matlab window (see below). I can see its looking for PLS-analysis.hdr -why ? PLS-analysis is my working folder. At what point would I have input this as a filename?  Could someone please point at the obviously stupid error I'm making :) thanks, Anna

Error using load_nii_hdr (line 39)
Cannot find file "/home/anna/IMAGES/DEMENTIA-PETMR/PLS-analysis.hdr".
 
Error in load_nii (line 172)
   [nii.hdr,nii.filetype,nii.fileprefix,nii.machine] = load_nii_hdr(filename);
 
Error in struct_create_datamat>CreateDatamat (line 406)
            img = load_nii(subj_files{i,j}, 1);
 
Error in struct_create_datamat (line 34)
         CreateDatamat;
 
Error using waitfor
Error while evaluating uicontrol Callback

Replies:

Untitled Post

I'm Online
jshen
Posted on 07/02/13 08:47:59
Number of posts: 291
jshen replies:

The raw image can be stored anywhere. However, it is better not to put raw image in your working folder. If you are running fMRI study, images belong to the same run should be kept in the same folder. Please take a look at the examples under:

http://research.baycrest.org/pls/source/Testdata.zip

If it is still not working, please give me more details, like: what are all the folder names and file names for your images, and how you want the datamat to be created, and what is the module (E.R.fMRI? Blocked fMRI?), and which image file names that you are selected for cond1 and which for condition2, etc.

 



Untitled Post
annapbarnes
Posted on 07/02/13 09:42:56
Number of posts: 8
annapbarnes replies:

Hi Jimmy

thanks for getting back so quick. I can answer some of these right off and then I will go back and create a different folder as you suggested.

I'm doing PLS structural ; condition 1 is grey matter maps *gm*.nii. condition 2 is white matter maps *wm*.nii.  I never get asked to load data for condition 2 - was confused by this.

Thanks

Anna



Untitled Post

I'm Online
jshen
Posted on 07/02/13 09:51:48
Number of posts: 291
jshen replies:

You will never get asked to load data for either condition, this is done automatically when you input subject in Structure PLS depending on your file name. Therefore, in Strcture PLS, the file names are critically important. In addition, in Structure PLS, all files with all conditions are stored in the same folder. Please list all the file names in full (not using wildcard * or ?) for all subjects and all conditions if it is still not working. Also please list the condition filters. I will have to reply you by the end of the day.



Untitled Post
annapbarnes
Posted on 07/02/13 10:27:01
Number of posts: 8
annapbarnes replies:

Hi Jimmy

This is much appreciated, I'm sure its something silly I've forgotten to do. Ubuntu OS and Matlab 64 R2012a

Here's the directory structure

PLS-analysis>data>*.nii and my working directory is PLS-analysis>PLS-results

Here's the complete list of filenames

ATKPA-GM-NC.nii   GILPA-HM-NC.nii    NELKA-GM-NC.nii   TAYVA-HM-NC.nii
ATKPA_HM-NC.nii   GINPA-GM-FTD.nii   NELKA-HM-NC.nii   THEPE-GM-FTD.nii
ATKRA-GM-DAT.nii  GINPA-HM-FTD.nii   PARGL-GM-FTD.nii  THEPE-HM-FTD.nii
ATKRA-HM-DAT.nii  HEAAL-GM-NC.nii    PARGL-HM-FTD.nii  TULAN-GM-FTD.nii
BUTJO-GM-FTD.nii  HEAAL-HM-NC.nii    ROBBR-GM-NC.nii   TULAN-HM-FTD.nii
BUTJO-HM-FTD.nii  HEAFRA-HM-FTD.nii  ROBBR-HM-NC.nii   TULWI-GM-NC.nii
COOCE-GM-NC.nii   HEAFR-GM-FTD.nii   ROBMA-GM-FTD.nii  TULWI-HM-NC.nii
COOCE-HM-NC.nii   HICRO-GM-DAT.nii   ROBMA-HM-FTD.nii  WARTE-GM-FTD.nii
COOST-GM-DAT.nii  HICRO-HM-DAT.nii   SKIKE-GM-FTD.nii  WARTE-HM-FTD.nii
COOST-HM-DAT.nii  HOARO-GM-DAT.nii   SKIKE-HM-FTD.nii  WATJA-GM-NC.nii
EDWJO-GM-FTD.nii  HOARO-HM-DAT.nii   SKIMA-GM-NC.nii   WATJA-HM-NC.nii
EDWJO-HM-FTD.nii  HOLGE-GM-FTD.nii   SKIMA-HM-NC.nii   WATJO-GM-FTD.nii
FLECH-GM-DAT.nii  HOLGE-HM-FTD.nii   SOLPH-GM-DAT.nii  WATJO-HM-FTD.nii
FLECH-HM-DAT.nii  KERMI-GM-FTD.nii   SOLPH-HM-DAT.nii  WITDO-GM-DAT.nii
GILJO-GM-FTD.nii  KERMI-HM-FTD.nii   TAYJA-GM-FTD.nii  WITDO-HM-DAT.nii
GILJO-HM-FTD.nii  NELAN-GM-DAT.nii   TAYJA-HM-FTD.nii  WRIBA-GM-FTD.nii
GILPA-GM-NC.nii   NELAN-HM-DAT.nii   TAYVA-GM-NC.nii   WRIBA-HM-FTD.nii
 
And here's the error message that is spits out as soon as the progress window gets to condition 2, subj 1
 
Error using load_nii_hdr (line 39)
Cannot find file "/home/anna/IMAGES/DEMENTIA-PETMR/PLS-analysis/data.hdr".
 
Error in load_nii (line 172)
   [nii.hdr,nii.filetype,nii.fileprefix,nii.machine] = load_nii_hdr(filename);
 
Error in struct_create_datamat>CreateDatamat (line 406)
            img = load_nii(subj_files{i,j}, 1);
 
Error in struct_create_datamat (line 34)
         CreateDatamat;
 
Error using waitfor
Error while evaluating uicontrol Callback
 

 



Untitled Post

I'm Online
jshen
Posted on 07/02/13 16:19:03
Number of posts: 291
jshen replies:

I am sure that the following answer will solve your problem:

You must keep the file name consistent. It is okay to use both "-" and "_", since you can put condition filter like *GM*.nii and *HM*.nii. However, when you assign "_" to "ATKPA_HM-NC.nii", you cannot assign "-" to "ATKPA-GM-NC.nii". I have tried, if you rename them to either "ATKPA_HM-NC.nii / ATKPA_GM-NC.nii" or "ATKPA-HM-NC.nii / ATKPA-GM-NC.nii", they will both work; otherwise, exactly the same error message will pop up.

Please check all the file names carefully, and make sure there is no mistake. If you still get problem, please only take 2 or 3 pairs to start, and find wrong file name in the rest files. Eventually, you will be fine.

Good Luck!

 



Untitled Post
annapbarnes
Posted on 07/03/13 04:35:31
Number of posts: 8
annapbarnes replies:

Of course - thank you so much. I thought I had checked all the filenames but just goes to show that you need a second pair of eyes or get a computer to do the check for you smiley.  Should work fine now. 

 

Thanks

Anna




Login to reply to this topic.

  • Keep in touch

Enter your email above to receive electronic messages from Baycrest, including invitations to programs and events, newsletters, updates and other communications.
You can unsubscribe at any time.
Please refer to our Privacy Policy or contact us for more details.

  • Follow us on social
  • Facebook
  • Instagram
  • Linkedin
  • Pinterest
  • Twitter
  • YouTube

Contact Us:

3560 Bathurst Street
Toronto, Ontario
Canada M6A 2E1
Phone: (416) 785-2500

Baycrest is an academic health sciences centre fully affiliated with the University of Toronto