set nsphere = 5 set sphere_coords = centers.txt # Make icosahedrons foreach icoi ( `count -digits 1 1 ${nsphere}` ) set xyz = `head -$icoi ${sphere_coords} | tail -1` CreateIcosahedron \ -overwrite \ -tosphere \ -ctr $xyz[1-3] \ -prefix ico_${icoi}.gii \ -rad 3.5 \ -ld 20 if ( "$icoi" == "1" ) then SurfaceMetrics -i ico_${icoi}.gii -coords endif 1deval \ -a ico_1.gii.coord.1D.dset \ -expr "$icoi" > ico_${icoi}.1D end # Combine the icosahedrons together in one surface file. ConvertSurface \ -overwrite \ -onestate \ -anatomical \ -merge_surfs \ -i ico_?.gii \ -o ico_combined.gii cat ico_?.1D > ico_combined.1D # The niml dset should be a little easier to work with, because # it gets loaded automatically. ConvertDset \ -overwrite \ -i ico_combined.1D \ -o ico_combined.niml.dset