Print

Print


Thanks, Peter!

Best,

Chao-Gan

On Tue, Nov 20, 2018 at 12:57 AM Stewart, Peter <[log in to unmask]> wrote:

I’m more familiar with volume than surface based methods so I cannot answer your below question, but I would highly recommend that you check out CAT12 by Christian Gaser and folks. The viewer included with that toolbox (called directly via “cat_surf_display” or also accessible by the GUI) provides extremely nice rendering of images with some additional tweaks, like the ability to inflate surfaces, etc. SurfIce by Chris Rorden is a standalone that also works very nicely for visualization. Of course, SPM does a great job rendering as well, as Guillame has suggested.

 

Peter

From: SPM (Statistical Parametric Mapping) <[log in to unmask]> On Behalf Of YAN Chao-Gan
Sent: Friday, November 16, 2018 7:17 PM
To: [log in to unmask]
Subject: [External] Re: [SPM] unsure why SPM12 unable to load GIFTI files during 1st-level Analysis

 

Dear Guillaume,

 

Thank you very much for your response and introducing the nice tool of MRIcroS.

 

I have a further question regarding to how to put data back to GIfTI cdata.

 

1. Just directly put back, there would be a problem.

gl = gifti('sub-Sub001_task-rest_space-fsaverage5_hemi-L.func.gii');
Data=gl.cdata;
gl.cdata=Data;
Error using gifti/subsasgn (line 130)
Syntax not implemented.

 

2. Use a for loop

gl = gifti('sub-Sub001_task-rest_space-fsaverage5_hemi-L.func.gii');
Data=gl.cdata;

for i=1:size(Data,2)
    gl.cdata(:,i)=Data(:,i);
end

Index in position 2 exceeds array bounds (must not exceed 1).

Error in gifti/subsasgn (line 115)
                                this.data{idx(k)}.data =
                                single(builtin('subsasgn',this.data{idx(k)}.data,s,A(:,k)));

This error occurred when i=58.

 

Do you have any hints?

 

Thanks,

 

Chao-Gan

 

 

 

On Fri, Nov 16, 2018 at 6:21 PM Flandin, Guillaume <[log in to unmask]> wrote:

Dear Chao-Gan,

Use spm_mesh_render instead:
  spm_mesh_render('Left1.gii')
otherwise, with gifti/plot, you need to do this:
  plot(gifti('lh.white.gii'),gifti('Left1.gii'));

I will update gifti/plot to match spm_mesh_render's behaviour but have a
look at the contextual menu with spm_mesh_render as it gives you a lot
more functionalities.

Concerning a MATLAB-based viewer for GIfTI files, there is MRIcroS from
the prolific Chris Rorden:
  https://www.nitrc.org/projects/mricros/
otherwise if there is a viewer you like but does not support GIfTI, we
should be able to find a way to export the data in a suitable format.

Best regards,
Guillaume.


On 16/11/2018 03:52, YAN Chao-Gan wrote:
> Hi Rouhi and Guillaume,
>
> Thank you very much for your response!
>
> When I saved the gifti file as demonstrated by Guillaume, I can not plot
> it. Please see below for my codes and the error message, could you
> please give me some hints?
> gl = gifti('sub-Sub001_task-rest_space-fsaverage5_hemi-L.func.gii');
> ggl = gifti(gl.cdata(:,1));
> ggl.private.metadata = struct('name','SurfaceID','value','lh.white.gii');
> save(ggl,'Left1.gii','ExternalFileBinary');
> Left1=gifti('Left1.gii');
> plot(Left1)
> Error using gifti/subsref (line 24)
> Reference to non-existent field 'vertices'.
>
> Error in gifti/plot (line 48)
>     'vertices',  subsref(this,struct('type','.','subs','vertices')),...
>  
> BTW, do you know if there is any nice matlab-based Viewer for gifti
> files? (I know I can view them in freeview, but trying to find a
> matlab-based one).
>
> Thanks,
>
> Chao-Gan
>
>
>
>
>
> On Sat, Nov 10, 2018 at 7:53 AM Rouhollah Abdollahi <[log in to unmask]
> <mailto:[log in to unmask]>> wrote:
>
>     Dear Chao-Gan,
>
>     Freesurfer does not make the mid thickness surfaces. However you can
>     do it yourself by loading the pial and white surfaces in Matlab and
>     average them to make the mid thickness surface.  Also I have to
>     mention for the point of visualization the fsavrage surface is
>     pretty good and you don’t need the mid surface one. 
>
>     Hope it helps 
>
>     Best
>     Rouhi 
>
>     On Sat 10. Nov 2018 at 00:17, YAN Chao-Gan <[log in to unmask]
>     <mailto:[log in to unmask]>> wrote:
>
>         Hi Guillaume,
>
>         Thank you very much for your response!
>
>         Yes, this comes from fmriprep. Indeed there is a
>         sub-001_hemi-L_midthickness.surf.gii for each subject, however,
>         there is no midthickness file under the fsaverage5 in freesurfer.
>
>         I am also ccing Chris to see if he has any suggestions. Hi
>         Chris, any insights?
>
>         Thanks,
>
>         Chao-Gan
>
>         On Fri, Nov 9, 2018 at 6:41 PM Flandin, Guillaume
>         <[log in to unmask] <mailto:[log in to unmask]>> wrote:
>
>             Dear Chao-Gan,
>
>             I assume that these files are obtained from fmriprep? I
>             don't know if
>             things have changed in the meantime but rereading an email
>             exchange I
>             had with Chris and Oscar on this topic a year ago, the surface
>             (geometry) meshes for fsnative (native subject specific
>             surface) are in
>             ../anat/sub-*_T1w_midthickness.*.surf.gii while the other
>             surfaces (like
>             fsaverage5) are standard FreeSurfer surfaces and are
>             therefore to be
>             found in your FreeSurfer installation (possibly in a
>             different file format).
>
>             Best regards,
>             Guillaume.
>
>
>             On 08/11/2018 00:06, YAN Chao-Gan wrote:
>             > Dear Guillaume,
>             >
>             > Thank you very much for your code example. I just wonder
>             where can I
>             > find 'mesh.surf.gii' in your example?
>             >
>             > For a functional image like
>             > "sub-001_task-rest_space-fsaverage5_hemi-R.func.gii", I
>             think I should
>             > find some thing like
>             "fsaverage5_hemi-R_midthickness.surf.gii". Do you
>             > happen to know where would
>             "fsaverage5_hemi-R_midthickness.surf.gii" exist?
>             >
>             > Thank you very much!
>             >
>             > Best,
>             >
>             > Chao-Gan
>             >
>             >
>             > On Fri, Oct 13, 2017 at 11:04 PM Guillaume Flandin
>             <[log in to unmask] <mailto:[log in to unmask]>
>             > <mailto:[log in to unmask] <mailto:[log in to unmask]>>>
>             wrote:
>             >
>             >     Hi Patrick,
>             >
>             >     Then, given you're not using them for proper
>             inference, it probably
>             >     doesn't matter too much - it's just that the
>             separation in two
>             >     hemispheres is an artefact of the preprocessing
>             pipeline (eg you would
>             >     rarely do that with volumetric data).
>             >
>             >     To combine the surface meshes, you can do something
>             like this:
>             >
>             >     M = gifti({'L.surf.gii','R.surf.gii'});
>             >     M = spm_mesh_join(M);
>             >     save(gifti(M),'mesh.surf.gii')
>             >
>             >     and for the functional data it would be something like:
>             >
>             >     gl = gifti('L.func.gii');
>             >     gr = gifti('R.func.gii');
>             >     for i=1:size(gr.cdata,2)
>             >       gg = gifti([gl.cdata(:,i);gr.cdata(:,i)]);
>             >       gg.private.metadata =
>             >     struct('name','SurfaceID','value','mesh.surf.gii');
>             >      
>             >   
>              save(gg,spm_file('mesh.func.gii','suffix',sprintf('_%05d',i)),'ExternalFileBinary');
>             >     end
>             >
>             >     As with the previous snippet, I haven't tried it so it
>             might require
>             >     adjustments...
>             >
>             >     Best regards,
>             >     Guillaume.
>             >
>             >
>             >     On 13/10/17 15:39, Patrick Sadil wrote:
>             >     > Hello Guillaume,
>             >     >      I see. We had only been planning on using these
>             data as a
>             >     really rough localizer, grabbing voxels that were
>             active as
>             >     determined by an uncorrected p-value threshold. But,
>             it sounds like
>             >     even that would be improved by analyzing the entire
>             hemisphere
>             >     together. Sorry, to keep asking questions about this,
>             but do you
>             >     know of a reliable way to combine these hemispheres?
>             >     >
>             >     > Best,
>             >     > Patrick
>             >     >
>             >
>             >     --
>             >     Guillaume Flandin, PhD
>             >     Wellcome Trust Centre for Neuroimaging
>             >     University College London
>             >     12 Queen Square
>             <https://maps.google.com/?q=12+Queen+Square+%0D%0A+%C2%A0+%C2%A0+%C2%A0London+WC1N+3BG&entry=gmail&source=g>
>             <https://maps.google.com/?q=12+Queen+Square+%0D%0A+%C2%A0+%C2%A0+%C2%A0London+WC1N+3BG&entry=gmail&source=g>> 
>                London WC1N 3BG
>             <https://maps.google.com/?q=12+Queen+Square+%0D%0A+%C2%A0+%C2%A0+%C2%A0London+WC1N+3BG&entry=gmail&source=g>
>             >
>             >
>             >
>             > --
>             > Chao-Gan YAN, Ph.D.
>             > Professor, Principal Investigator
>             > Deputy Director, Magnetic Resonance Imaging Research Center
>             > Institute of Psychology, Chinese Academy of Sciences
>             > 16 Lincui Road, Chaoyang District, Beijing 100101, China
>             <https://maps.google.com/?q=16+Lincui+Road,+Chaoyang+District,+Beijing+100101,+China&entry=gmail&source=g>
>             > -
>             > Initiator
>             > <http://rfmri.org/DPARSF>DPABI
>             > <http://rfmri.org/DPABI><http://rfmri.org/DPARSF>,
>             > <http://dpabi.org>DPARSF <http://rfmri.org/DPARSF>, PRN
>             > <http://rfmri.org/PRN> and The R-fMRI Network
>             <http://rfmri.org>
>             > (RFMRI.ORG <http://RFMRI.ORG> <http://rfmri.org/>)
>             > http://rfmri.org/yan
>             > http://scholar.google.com/citations?user=lJQ9B58AAAAJ
>
>             --
>             Guillaume Flandin, PhD
>             Wellcome Centre for Human Neuroimaging
>             UCL Queen Square Institute of Neurology
>             London WC1N 3BG
>
>
>
>         --
>         Chao-Gan YAN, Ph.D.
>         Professor, Principal Investigator
>         Deputy Director, Magnetic Resonance Imaging Research Center
>         Institute of Psychology, Chinese Academy of Sciences
>         16 Lincui Road, Chaoyang District, Beijing 100101, China
>         <https://maps.google.com/?q=16+Lincui+Road,+Chaoyang+District,+Beijing+100101,+China&entry=gmail&source=g>
>         -
>         Initiator
>         <http://rfmri.org/DPARSF>DPABI
>         <http://rfmri.org/DPABI><http://rfmri.org/DPARSF>,
>         <http://dpabi.org>DPARSF <http://rfmri.org/DPARSF>, PRN
>         <http://rfmri.org/PRN> and The R-fMRI Network <http://rfmri.org>
>         (RFMRI.ORG <http://rfmri.org/>)
>         http://rfmri.org/yan
>         http://scholar.google.com/citations?user=lJQ9B58AAAAJ
>
>     --
>     Sent from Gmail Mobile
>
>
>
> --
> Chao-Gan YAN, Ph.D.
> Professor, Principal Investigator
> Deputy Director, Magnetic Resonance Imaging Research Center
> Institute of Psychology, Chinese Academy of Sciences
> 16 Lincui Road, Chaoyang District, Beijing 100101, China
> -
> Initiator
> <http://rfmri.org/DPARSF>DPABI
> <http://rfmri.org/DPABI><http://rfmri.org/DPARSF>,
> <http://dpabi.org>DPARSF <http://rfmri.org/DPARSF>, PRN
> <http://rfmri.org/PRN> and The R-fMRI Network <http://rfmri.org>
> (RFMRI.ORG <http://rfmri.org/>)
> http://rfmri.org/yan
> http://scholar.google.com/citations?user=lJQ9B58AAAAJ

--
Guillaume Flandin, PhD
Wellcome Centre for Human Neuroimaging
UCL Queen Square Institute of Neurology
London WC1N 3BG



--

Chao-Gan YAN, Ph.D.

Professor, Principal Investigator
Deputy Director, Magnetic Resonance Imaging Research Center
Institute of Psychology, Chinese Academy of Sciences
16 Lincui Road, Chaoyang District, Beijing 100101, China

-



IMPORTANT WARNING: The information in this message (and the documents attached to it, if any) is confidential and may be legally privileged. It is intended solely for the addressee. Access to this message by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken, or omitted to be taken, in reliance on it is prohibited and may be unlawful. If you have received this message in error, please delete all electronic copies of this message (and the documents attached to it, if any), destroy any hard copies you may have created and notify me immediately by replying to this email. Thank you. Geisinger Health System utilizes an encryption process to safeguard Protected Health Information and other confidential data contained in external e-mail messages. If email is encrypted, the recipient will receive an e-mail instructing them to sign on to the Geisinger Health System Secure E-mail Message Center to retrieve the encrypted e-mail.



--
Chao-Gan YAN, Ph.D.
Professor, Principal Investigator
Deputy Director, Magnetic Resonance Imaging Research Center
Institute of Psychology, Chinese Academy of Sciences
16 Lincui Road, Chaoyang District, Beijing 100101, China
-