Dear Barbara,
Yes, you could smooth the projected data:
R = spm_mesh_to_grid(M, V, T);
Rs = zeros(size(R));
spm_smooth(R,Rs,[6 6 6]); % FHWM in voxels
...
V = spm_write_vol(V,Rs);
You might also want to binarise your variables, eg R = R > threshold,
and save it with spm_type('uint8').
Best regards,
Guillaume.
On 11/01/17 16:39, Barbara Kreilkamp wrote:
> Dear Guillaume,
> This seems to work, although I had to pick a mesh from a different image
> instead, as the spm_0001.gii did not have one (I generated this .gii
> using CAT12 segmentation module in SPM12 - latest versions).
> I was looking to generate significance clusters in nifti format, but I
> get a 'ribbon' with the T-values. Would dilating or smoothing help me to
> generate those cluster volumes? I want to use those as
> region-of-interest masks in further analysis.
>
> Best wishes and thank you very much,
> Barbara Anne
>
> On Wed, Jan 11, 2017 at 3:46 PM, Guillaume Flandin <[log in to unmask]
> <mailto:[log in to unmask]>> wrote:
>
> Dear Barbara Anne,
>
> If your GIfTI t-map was created by SPM then you should find where the
> corresponding mesh is by looking at:
> g = gifti('spmT_0001.gii');
> g.private.metadata
>
> Best regards,
> Guillaume.
>
>
> On 11/01/17 14:33, Barbara Kreilkamp wrote:
> > Dear Guillaume,
> > Thank you for this. Unfortunately the algorithm trips me up at
> > mesh.surf.gii as I do not have this file. Is there a way to generate it?
> > A quick search in the manual did not give me any clues.
> > I had picked 'ROI analysis and surface and thickness estimation' in
> > CAT12 segmentation module.
> > Best wishes,
> > Barbara Anne
> >
> > On Wed, Jan 11, 2017 at 11:58 AM, Guillaume Flandin <[log in to unmask] <mailto:[log in to unmask]>
> > <mailto:[log in to unmask] <mailto:[log in to unmask]>>> wrote:
> >
> > Dear Barbara Anne,
> >
> > There might be a more direct way to do this in CAT12 but using
> SPM12
> > functions, you can try the following:
> >
> > % Data
> > T = export(gifti('spmT_0001.gii'),'patch');
> > T = T.facevertexcdata;
> >
> > % Mesh
> > M = export(gifti('mesh.surf.gii'),'patch');
> >
> > % A NifTI image to serve as reference
> > V = spm_vol(spm_select(1,'image'));
> >
> > % Interpolation
> > R = spm_mesh_to_grid(M, V, T);
> >
> > % Save image
> > V = struct(...
> > 'fname', 'spmT_0001.nii',...
> > 'dim', V.dim,...
> > 'dt', [spm_type('float32') spm_platform('bigend')],...
> > 'mat', V.mat,...
> > 'pinfo', [1 0 0]');
> > V = spm_write_vol(V,R);
> >
> > Best regards,
> > Guillaume.
> >
> >
> > On 11/01/17 10:15, Barbara Kreilkamp wrote:
> > > Dear all,
> > >
> > > Could you please tell me how to convert a T-score .gii image
> to nifti
> > > please? I am trying to save significant clusters to a nifti
> image
> > using
> > > CAT12/SPM12.
> > >
> > > Thanks ever so,
> > > Barbara Anne
> >
> > --
> > Guillaume Flandin, PhD
> > Wellcome Trust Centre for Neuroimaging
> > University College London
> > 12 Queen Square
> > London WC1N 3BG
> >
> >
>
> --
> Guillaume Flandin, PhD
> Wellcome Trust Centre for Neuroimaging
> University College London
> 12 Queen Square
> London WC1N 3BG
>
>
--
Guillaume Flandin, PhD
Wellcome Trust Centre for Neuroimaging
University College London
12 Queen Square
London WC1N 3BG
|