Back to the main page.

Bug 2893 - reading fails for parcellation dconnseries generated by wb_command

Status CLOSED FIXED
Reported 2015-05-08 09:31:00 +0200
Modified 2015-07-15 13:31:06 +0200
Product: FieldTrip
Component: fileio
Version: unspecified
Hardware: PC
Operating System: Mac OS
Importance: P5 normal
Assigned to: Robert Oostenveld
URL:
Tags:
Depends on:
Blocks:
See also:

Robert Oostenveld - 2015-05-08 09:31:55 +0200

Hi Tim and Robert. Working on practical 2 I came across the following issue: I take a dconnseries file and I parcelate it with wb_command with the Yeo11 scheme in a pconnseries. See script: /home/hcpcourse/tmpusers/frankenstein/hcpcourse/tmpcode/Test_ParcellateDconnseries_1.sh It parcellates the dconnseries file: /home/hcpcourse/tmpusers/frankenstein/hcpcourse/tmpdata/177746_MEG_Motort_tmegconne_[LM-TEMG-RH]_[CM-imcoh]_[FB-alpha].imcoh.dconnseries.nii into the pconnseries file: /home/hcpcourse/tmpusers/frankenstein/hcpcourse/tmpdata/177746_MEG_Motort_tmegconne_[LM-TEMG-RH]_[CM-imcoh]_[FB-alpha].imcoh.Yeo11.pconnseries.nii NOW I am trying to use ft_read_cifti to read the time resolved parcellated connectome , split it into 4 non-time resolved connectomes(one for each epoch) and write them in different pconn files , one for each epoch. The matlab script I am using is /home/hcpcourse/tmpusers/frankenstein/hcpcourse/tmpcode/P2E_SplitPconnseries.m which when I ran (I use the wrapper script /home/hcpcourse/tmpusers/frankenstein/hcpcourse/tmpcode/P2E_SplitPconnseries.sh to run it on the hcpcourse machine) I get the following error: ========================================================================= [hcpcourse@Honolulu-TCE tmpcode]$ ./P2E_SplitPconnseries.sh Warning: No display specified. You will not be able to display graphics on the screen. started parsing startup.m finished parsing startup.m pconnFile = /home/hcpcourse/tmpusers/frankenstein/hcpcourse/tmpdata/177746_MEG_Motort_tmegconne_[LM-TEMG-RH]_[CM-imcoh]_[FB-alpha].imcoh.Yeo11.pconnseries.nii Execution failed: P2E_SplitPconnseries.m Error using & Matrix dimensions must agree. Error in ft_write_cifti (line 517) Error in megconnectome (line 129) MATLAB:dimagree ============================================================================ Be looking into this line it seems that it looks at the number of nodes in the brain structure on which the connectivity corresponds. In the dense representation we have 8004 nodes and in the parcellated pconnseris 107 nodes If you just ft_read_cifti the pconnseries file you get the structure a1=ft_read_cifti('177746_MEG_Motort_tmegconne_[LM-TEMG-RH]_[CM-imcoh]_[FB-alpha].imcoh.Yeo11.pconnseries.nii') a1 = dimord: 'chan_chan_time' data: [107x107x4 double] time: [-0.1500 0.1500 0.4500 0.7500] hdr: [1x1 struct] unit: 'mm' brainordinate: [1x1 struct] label: {1x107 cell} imcoh: [107x107x4 double] As you see there is ".brainordinate" filed which when i look into >> a1.brainordinate ans = brainstructure: [428214x1 double] brainstructurelabel: {'CORTEX_LEFT' 'CORTEX_RIGHT'} parcellation: [8004x1 double] parcellationlabel: {1x107 cell} pos: [8004x3 double] has the brainstructure field with a crazy high number of nodes fara far higher than the 8004 it should have. I am not sure if this is a problem of wb_command when converting a dconnseries into a pconnseries or a problem of ft_read_cifti in fieltrip which is missing some parameter. That is why I addressed the email to both. Could you please have a look and see if there is any quick fix??? As you know all the tmeg connectivity results will be in pconnseries derived by wb_command from dconnseries and we should be able to split them in MATLAB (or wb_command) . If you could find a solution by end of the day (Friday) maybe I could accomodate such a change in Practical 2.


Robert Oostenveld - 2015-05-08 10:07:55 +0200

I copied the data and made a test script. I also tested against the script test_bug2096 from bug #2096. This fixes it (in FieldTrip, not yet in megcommectome as that requires a recompile etc.) Furthermore, I changed the default for the debug option to false. mac011> svn commit Sending fileio/ft_read_cifti.m Sending fileio/ft_write_cifti.m Adding test/test_bug2893.m Transmitting file data ... Committed revision 10393.


Robert Oostenveld - 2015-05-08 10:17:37 +0200

I copied the fixed version into the cifti-matlab release. mac011> git push washu master X11 forwarding request failed on channel 0 Counting objects: 15, done. Delta compression using up to 4 threads. Compressing objects: 100% (8/8), done. Writing objects: 100% (8/8), 1.51 KiB | 0 bytes/s, done. Total 8 (delta 6), reused 0 (delta 0) To git@github.com:Washington-University/cifti-matlab.git db73e6c..5e0ba33 master -> master


Robert Oostenveld - 2015-05-08 10:31:56 +0200

I did a "git clone" of the latest cifti-matlab and fieldtrip on both course machines. I am now compiling megconnectome-3.0-rc7 and will get that installed as well.


Robert Oostenveld - 2015-07-15 13:31:06 +0200

closed several bugs at once that were recently fixed