Question about fliplr on surf


I have some question about group analysis. I have conditions of visual stimuli on the left side or the right side. I also transform all stats data to std surface. Now I want to do group analysis, but how could I flip the left and right of the data on the surf? For example, if subj A view stimuli on the left side and subj B view stimuli on the right side, is it plausible to do group analysis on subj A rh and subj B lh?

Thanks a lot!!


You can mirror the surface data or the volumetric data by flipping the data from one side to another. For volumetric data, use 3dLRflip. For surface data, flip the surfaces with this kind of script.

The xmat input for ConvertSurface can do shifts and mirroring of surfaces.

ConvertSurface -o shift_left_pial.gii -i original_left_pial.gii -overwrite -xmat_1D shiftorigin.1D

ConvertSurface -o shift_right_pial.gii -i shift_left_pial.gii -overwrite -xmat_1D mirror.1D

where shiftorigin.1D is this:

1 0 0 dx
0 1 0 dy
0 0 1 dz

and mirror.1D is this:

-1 0 0 0
0 1 0 0
0 0 1 0

You could even concatenate the two transformations. In this case, I’ve kept it as two separate operations to make it clear what is going on.

Thank you very much, Daniel.
But there are some other questions. Firstly, the data I want toniml.dset. And I found ConverSurface could not recognize it. Secondly, is the 1D file defined by myself? Or do I need to get it from other command?
Thanks a lot!!


Another question is that, is it reasonable to fliplr on surf data use this form?
e.g. I have stats.lh.niml.dset and I want transform it to match the std.141.rh surface

SurfToSurf -i_gii $surfdir/std.141.lh.smoothwm.gii \
                -i_gii $surfdir/lh.smoothwm.gii \
                -prefix std.141. \
                -mapfile ${surfdir}/std.141.${subjName}_TPL_lh.niml.M2M \
                -dset stats.lh.niml.dset -overwrite

SurfToSurf -i_gii $surfdir/std.141.rh.smoothwm.gii \
        -i_gii $surfdir/std.141.lh.smoothwm.gii \
        -prefix trans.rh. \
        -dset std.141.stats.lh.niml.dset -overwrite

Thanks a lot!!

You can copy and paste that matrix into a 1D text file. The niml.dset data would have to be remapped from the volume to the newly mirrored surface.

Thanks for your kind reply,

But sorry to bother again. I am wondering if there is a way to flip lh to rh on surf directly? Because I have done all the deconvolution on the surf~

Thanks a lot!!

SurfToSurf won’t flip the data for you, so you would have to flip the surfaces separately. At that point, you could use SurfToSurf to map data from one surface to another similar surface or 3dVol2Surf to map data from a volume onto the flipped surface. There will be important differences between a left and right surfaces with one of them flipped, so the match won’t be exact.