The output looks correct to me.
The functional gifti file doesn't have the vertex coordinate information. It is like a surface overlay. It only contains one value for each vertex.
The pial and white surface gifti files have the vertex coordinates and information about how triangles are formed.
Best,
Yujing
From: freesurfer-bounces@nmr.mgh.harvard.edu freesurfer-bounces@nmr.mgh.harvard.edu On Behalf Of wangzhiwei3233 Sent: Tuesday, January 30, 2024 1:27 AM To: freesurfer@nmr.mgh.harvard.edu Subject: Re: [Freesurfer] converting preprecessed functional surface data to gifti
External Email - Use Caution
Dear Yujing,
Thank you for your response.
I attempted the command again as follows:
mris_convert -f $funcfile ${SUBJECTS_DIR}/fsaverage/surf/${hemi}.white ./$fname.gii
This time, no errors were reported. However, upon comparison, it appears that the output gii file is identical (same file size) to the output from the following command line:
mri_convert $funcfile ./$fname.gii (Note: mri_convert, not mris_convert)
The content of the output file is as follows:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE GIFTI SYSTEM "http://gifti.projects.nitrc.org/gifti.dtd">
<GIFTI Version="1.0" NumberOfDataArrays="1">
<MetaData>
<MD>
<Name><![CDATA[UserName]]></Name>
<Value><![CDATA[wzw]]></Value>
</MD>
<MD>
<Name><![CDATA[Date]]></Name>
<Value><![CDATA[Tue Jan 30 11:31:22 2024]]></Value>
</MD>
<MD>
<Name><![CDATA[gifticlib-version]]></Name>
<Value><![CDATA[gifti library version 1.09, 28 June, 2010]]></Value>
</MD>
</MetaData>
<LabelTable/>
<DataArray Intent="NIFTI_INTENT_NONE"
DataType="NIFTI_TYPE_FLOAT32"
ArrayIndexingOrder="RowMajorOrder"
Dimensionality="1"
Dim0="163842"
Encoding="GZipBase64Binary"
Endian="LittleEndian"
ExternalFileName=""
ExternalFileOffset="">
<MetaData/>
<Data>eJysunV4ldfWtxsh7u7utuLua95xJ8RICQQnFA1OCQQIWjQ4xYsXdyheNDR4sKLBKSSEIkkg+Z69r+vd17fP6dnvOd975j9rZeVZz5xzzDF+4/(.....more lines like this, not shown )
It appears that there is no vertex coordinate information in it. I am uncertain whether the output result file is correct. What should the output file look like?
My ultimate goal is to perform GLM analysis in SPM using these gii data. The 'gifti' function in SPM can read the output gii file, but it contains only values (cdata: 163842×1 single), as I split the frames, so the frame is "×1". This leads to errors in further analysis. I also converted the pial surface to gii and read it using the 'gifti' function in SPM; it contained three fields:
faces: [327680×3 int32]
mat: [4×4 double]
vertices: [163842×3 single]
It seems that there is no problem with converting the pial surface to gii, but there is an issue with converting functional surface data to gii.
Best,
zhiwei
Date: Fri, 26 Jan 2024 13:29:24 +0000
From: "Huang, Yujing" <YHUANG43@mgh.harvard.edumailto:YHUANG43@mgh.harvard.edu>
Subject: Re: [Freesurfer] converting preprecessed functional surface
data to gifti
To: Freesurfer support list <freesurfer@nmr.mgh.harvard.edumailto:freesurfer@nmr.mgh.harvard.edu>
Message-ID:
<MN2PR04MB5982358D1DE7CF24B4127E7C9D792@MN2PR04MB5982.namprd04.prod.outlook.commailto:MN2PR04MB5982358D1DE7CF24B4127E7C9D792@MN2PR04MB5982.namprd04.prod.outlook.com>
Content-Type: text/plain; charset="utf-8"
How does your command line look like? To convert functional file, use ?-f <function-file>?. You also need to specify surface file.
Best,
Yujing
From: freesurfer-bounces@nmr.mgh.harvard.edumailto:freesurfer-bounces@nmr.mgh.harvard.edu <freesurfer-bounces@nmr.mgh.harvard.edumailto:freesurfer-bounces@nmr.mgh.harvard.edu> On Behalf Of wangzhiwei3233
Sent: Friday, January 26, 2024 4:39 AM
To: freesurfer@nmr.mgh.harvard.edumailto:freesurfer@nmr.mgh.harvard.edu
Subject: [Freesurfer] converting preprecessed functional surface data to gifti
External Email - Use Caution
Dear Freesurfer experts,
How can I convert the preprecessed functional surface data to gifti format(gii)?
I tried mris_convert, but I encountered the following error.
error: freadFloat: fread failed
Your assistance would be highly appreciated.
Best regards,
zhiwei