For some reason that e-mail did not come through very well.  If Tim’s 
suggestion doesn’t help, please attach whatever is below to a text file so it 
is a bit more readable.

Peace,

Matt.

From: 
<[email protected]<mailto:[email protected]>>
 on behalf of Timothy Coalson <[email protected]<mailto:[email protected]>>
Date: Monday, May 16, 2016 at 4:42 PM
To: Aaron C <[email protected]<mailto:[email protected]>>
Cc: "[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>>
Subject: Re: [HCP-Users] Some questions about the usage of CIFTI files

You did:

simulate_data=rand(59412,1000);

And assigned it to a 91282 grayordinates object - this will never work, 
ciftisavereset can't change the grayordinates.  You need to either generate a 
data matrix with 91282 grayordinates, or open a 59412 brainordinates file as 
the template.

As for the second example, I'm not sure.  From the code, it looks like it 
couldn't read the right number of bytes from the external binary file it was 
expecting, which should be named something like 
"C:\cifti_test\test.dtseries.nii.gii.data".  I don't know how this would 
happen, but it seems to point to the matlab gifti toolbox - you can try using 
wb_command -cifti-convert to do a round trip through gifti, and if it doesn't 
give an error, then your problem is likely on the matlab side.

Tim


On Mon, May 16, 2016 at 4:21 PM, Aaron C 
<[email protected]<mailto:[email protected]>> wrote:
Thank Tim and Matt very much for your answers! I tried the function 
"ciftisavereset" using the following test code but encountered an error. Test 
code: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % try to use the 
CIFTI header of the file "rfMRI_REST1_LR_Atlas_hp2000_clean.dtseries.nii" 
(91282*1200) cii = 
ciftiopen('C:\cifti_test\rfMRI_REST1_LR_Atlas_hp2000_clean.dtseries.nii','wb_command.exe');
 newcii = cii; % test ciftisavereset to see if it can save the data of 
different number of maps/columns using the existing CIFTI header 
simulate_data=rand(59412,1000); newcii.cdata=simulate_data; 
ciftisavereset(newcii,'C:\cifti_test\test.dtseries','wb_command.exe'); 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Output and error: 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Qt: Untested Windows 
version 6.2 detected! Elapsed time is 0.153600 seconds. Qt: Untested Windows 
version 6.2 detected!   While running: wb_command.exe -cifti-convert 
-from-gifti-ext C:\cifti_test\test.dtseries.gii C:\cifti_test\test.dtseries   
ERROR: Parse error while reading: Tried to read 237648000 from Elapsed time is 
0.319364 seconds. The system cannot find the path specified. 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% I also tried to use 
"ciftisave" to save the data read directly from an existing *.dtseries.nii 
CIFTI file, but I also encountered an error. Test code: 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% cii = 
ciftiopen('C:\cifti_test\rfMRI_REST1_LR_Atlas_hp2000_clean.dtseries.nii','wb_command.exe');
 ciftisave(cii,'C:\cifti_test\test.dtseries.nii','wb_command.exe'); 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Output and error: 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Qt: Untested Windows 
version 6.2 detected! Qt: Untested Windows version 6.2 detected!   While 
running: wb_command.exe -cifti-convert -from-gifti-ext 
C:\cifti_test\test.dtseries.nii.gii C:\cifti_test\test.dtseries.nii   ERROR: 
Parse error while reading: Tried to read 438153600 from>> 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% It seems that I cannot 
save *.dtseries.nii using either "ciftisavereset" or "ciftisave". Would you 
please give me some hints how to fix this problem? Thank you very much! From: 
[email protected]<mailto:[email protected]> To: 
[email protected]<mailto:[email protected]>; 
[email protected]<mailto:[email protected]> CC: 
[email protected]<mailto:[email protected]> Subject: 
Re: [HCP-Users] Some questions about the usage of CIFTI files Date: Fri, 13 May 
2016 21:24:08 +0000 The mismatch is because the medial wall is not excluded 
from that particular file.  The HCP data files (e.g. dense timeseries files) 
have the medial wall excluded. Peace, Matt. From: on behalf of Timothy Coalson 
Date: Friday, May 13, 2016 at 3:09 PM To: Aaron C Cc: 
"[email protected]<mailto:[email protected]>" Subject: 
Re: [HCP-Users] Some questions about the usage of CIFTI files Inline replies. 
Tim On Fri, May 13, 2016 at 1:20 PM, Aaron C wrote: Dear HCP experts, I have 
some questions about the usage of CIFTI files. 1. I checked the number of 
grayordinates of the following files using the command “wb_command 
-file-information”, and I noticed some of them have different number of 
grayordinates: “Parcels_LR.dlabel.nii” from Gordon et al.’s parcellation: 64984 
grayordinates (32492 left cortex vertices and 32492 right cortex vertices). 
“100206.aparc.a2009s.32k_fs_LR.dlabel.nii”: 59412 grayordinates (29696 left 
cortex vertices and 29716 right cortex vertices) 
“100206.MyelinMap.32k_fs_LR.dscalar.nii”: 59412 grayordinates (29696 left 
cortex vertices and 29716 right cortex vertices) 
“HCP_S900_820_rfMRI_MSMAll_groupPCA_d4500ROW_zcorr.dconn.nii”: 91282 
grayordinates (29696 left cortex vertices, 29716 right cortex vertices and 
31870 subcortical voxels) Probably the easiest way to fix this is to use 
-cifti-create-dense-from-template to make cifti files that do have matching 
indices.  Modifying a dconn is a bit trickier, and will also need to involve 
-cifti-transpose and -cifti-copy-mapping, and may use a lot of memory, so you 
may simply want to use the 91282 space as the template.   If two CIFTI files 
are with different number of grayordinates (e.g., “Parcels_LR.dlabel.nii” and 
“100206.MyelinMap.32k_fs_LR.dscalar.nii”), when both loaded into the MATLAB 
using "ciftiopen", then the first file will be just a 64984x1 array, and the 
second file will be just a 59412x1 array, but there is no other information 
about the correspondence of the same grayordinate between these two files. My 
question is how could I locate the same brain grayordinate from them? You can 
also use -cifti-export-dense-mapping to get the mapping from matrix index to 
vertex/voxel + structure, but this is likely to be more involved.  However, 
since you are interested in spatial neighbor information, you'll need this to 
figure that out.   2. I have the time series of only a subset of cortical 
surface vertices in a MATLAB matrix (e.g., a 59412x1200 matrix). How could I 
save the time series of the subset of cortical surface vertices in a CIFTI 
*.dtseries.nii file? The header of existing CIFTI *.dtseries.nii file cannot be 
used directly since I didn’t find such *.dtseries.nii file with a 
dimensionality of 59412x1200. Use the ciftisavereset function from 
https://wiki.humanconnectome.org/display/PublicData/HCP+Users+FAQ#HCPUsersFAQ-2.HowdoyougetCIFTIfilesintoMATLAB?
   Similarly, I also have the pairwise correlations between only a subset of 
cortical surface vertices in a MATLAB matrix (e.g., just a 59412x59412 matrix, 
not like a 91282x91282 matrix which also includes subcortical voxels). How 
could I save it in a CIFTI *.dconn.nii file? The header of existing CIFTI 
*.dconn.nii file cannot be used directly since I didn’t find such *.dconn.nii 
file with a dimensionality of 59412x59412.  dconn saving from matlab is not 
particularly well supported at the moment, unfortunately.  What you could do is 
to save it with ciftisavereset to a .dtseries.nii name, and then use 
-cifti-copy-mapping to change the series mapping to the same dense mapping.  
The fieldtrip-derived cifti functions have some support for symmetric dconns, 
but have only recently started trying to preserve the excluded vertices 
information in the saved file (and not by default).   3. How could I obtain 
surface vertex adjacencies of the fs_LR 32k surface using wb_command? I am 
looking for some commands in Connectome Workbench equivalent to the command 
“caret_command -surface-topology-neighbors” in the Caret software. We don't 
currently have a command for that in wb_command.  You can load the gifti 
surface in matlab, and use the triangles array to make the information directly 
(all vertices in a single triangle are neighbors).  Most spatial things 
workbench does use geodesic distances, rather than immediate neighbors.  
Immediate neighbors are not the same distance in different parts of the 
surface, or even for a single vertex.  There is a command to produce geodesic 
distances from one vertex to all vertices (with an optional distance limit), 
though we haven't made an all vertices to all vertices command like caret5 has 
(we stopped using matlab to do spatial computations, as it was too slow for our 
purposes). What kind of spatial things are you wanting to do?  We have commands 
for some of the more common spatial operations.   Thank you very much! 
_______________________________________________ HCP-Users mailing list 
[email protected]<mailto:[email protected]> 
http://lists.humanconnectome.org/mailman/listinfo/hcp-users 
_______________________________________________ HCP-Users mailing list 
[email protected]<mailto:[email protected]> 
http://lists.humanconnectome.org/mailman/listinfo/hcp-users   The materials in 
this message are private and may contain Protected Healthcare Information or 
other information of a sensitive nature. If you are not the intended recipient, 
be advised that any unauthorized use, disclosure, copying or the taking of any 
action in reliance on the contents of this information is strictly prohibited. 
If you have received this email in error, please immediately notify the sender 
via telephone or return mail.

_______________________________________________
HCP-Users mailing list
[email protected]<mailto:[email protected]>
http://lists.humanconnectome.org/mailman/listinfo/hcp-users


_______________________________________________
HCP-Users mailing list
[email protected]<mailto:[email protected]>
http://lists.humanconnectome.org/mailman/listinfo/hcp-users

________________________________
The materials in this message are private and may contain Protected Healthcare 
Information or other information of a sensitive nature. If you are not the 
intended recipient, be advised that any unauthorized use, disclosure, copying 
or the taking of any action in reliance on the contents of this information is 
strictly prohibited. If you have received this email in error, please 
immediately notify the sender via telephone or return mail.

_______________________________________________
HCP-Users mailing list
[email protected]
http://lists.humanconnectome.org/mailman/listinfo/hcp-users

Reply via email to