<HTML><HEAD><TITLE>mri2mesh report</TITLE></HEAD><BODY><pre>
 
==============================
==> mri2mesh started  2019. 12. 07. (토) 15:29:23 KST ...
==============================
command line options: --all SPR06 SPR06_T1.nii.gz
 
==============================
==> --brain/--brainf: Preparing GM and WM surfaces ...
==============================
 
==============================
==> running FreeSurfer recon-all on T1fs! ...
==============================

fslmaths SPR06_T1.nii.gz /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/T1fs

fslreorient2std /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/T1fs /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/T1fs

fslswapdim /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/T1fs x -z y /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmpImg

mri_convert -cs 1 /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmpImg.nii.gz /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmpImg.nii.gz

mri_convert -cm /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmpImg.nii.gz /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmpImg.nii.gz

rm /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmpImg.nii.gz

fslswapdim /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/T1fs x -z y /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmpImg

mri_convert -nc -cs 1 -oni 256 -onj 256 -onk 256 -rt cubic /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmpImg.nii.gz /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/T1fs_resamp.nii.gz

fslswapdim /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/T1fs_resamp x z -y /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/T1fs_resamp

rm /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmpImg.nii.gz

fslorient -setqform -1 0 0 128.000000 0 1 0 -128.000000 0 0 1 -127.000000 0 0 0 1 /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/T1fs_resamp

fslorient -setsform -1 0 0 128.000000 0 1 0 -128.000000 0 0 1 -127.000000 0 0 0 1 /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/T1fs_resamp

flirt -in /usr/share/fsl/5.0/data/standard/MNI152_T1_1mm.nii.gz -ref /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/T1fs_resamp -out /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/MNIfs_reg

fslroi /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/T1fs_resamp /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/T1fs_roi 0 -1 0 -1 68 188

fslcreatehd 256 256 68 1 1 1 1 1 0 0 0 16 /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmpImg

fslmerge -z /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/T1fs_roi /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmpImg /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/T1fs_roi

rm /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmpImg.nii.gz

fslcpgeom /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/T1fs_resamp /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/T1fs_roi

fslswapdim /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/T1fs_roi x -z y /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/T1fs_roi_FS

recon-all -i /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/T1fs_roi_FS.nii.gz -s /mnt/Research/simnibs/test2/SPR06/fs_SPR06

recon-all -s /mnt/Research/simnibs/test2/SPR06/fs_SPR06 -all -3T -cubic -cm
 
==============================
==> Convert WM and GM hemispheres to STL ...
==============================

mris_convert /mnt/Research/simnibs/test2/SPR06/fs_SPR06/surf/rh.white /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/wm.rh.stl

mris_convert /mnt/Research/simnibs/test2/SPR06/fs_SPR06/surf/rh.pial /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/gm.rh.stl

mris_convert /mnt/Research/simnibs/test2/SPR06/fs_SPR06/surf/lh.white /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/wm.lh.stl

mris_convert /mnt/Research/simnibs/test2/SPR06/fs_SPR06/surf/lh.pial /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/gm.lh.stl

cd /mnt/Research/simnibs/test2/SPR06/m2m_SPR06

cp /home/junhyuk/simnibs_2.1.2/resources/templates/CC_filterkernel.nii.gz /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/.

mri_convert /mnt/Research/simnibs/test2/SPR06/fs_SPR06/mri/orig.mgz /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/T1fs_conform.nii.gz

fslswapdim /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/T1fs_conform.nii.gz x z -y /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/T1fs_conform.nii.gz

cp /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/T1fs_conform.nii.gz /mnt/Research/simnibs/test2/SPR06/SPR06_T1fs_conform.nii.gz

mri_convert /mnt/Research/simnibs/test2/SPR06/fs_SPR06/mri/nu.mgz /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/T1fs_nu_conform.nii.gz

fslswapdim /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/T1fs_nu_conform.nii.gz x z -y /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/T1fs_nu_conform.nii.gz
 
==============================
==> creating subcortical mask for joining the hemispheres ...
==============================

cd /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp

mri_convert /mnt/Research/simnibs/test2/SPR06/fs_SPR06/mri/aparc.a2009s+aseg.mgz ./segmentation-mask.nii.gz

fslswapdim segmentation-mask.nii.gz x z -y segmentation-mask.nii.gz

fslmaths segmentation-mask.nii.gz -thr 251 -uthr 255 -bin CC.nii.gz

fslmaths CC.nii.gz -kernel file CC_filterkernel.nii.gz -fmean CC_filt.nii.gz -odt float

fslmaths CC_filt.nii.gz -thr 0.1 -bin CC_final.nii.gz

cat

fslmaths segmentation-mask.nii.gz -thr 24 -uthr 24 -dilM -bin CSFslab.nii.gz

flirt -in CSFslab.nii.gz -ref CSFslab.nii.gz -applyxfm -init yshift.mat -out CSFslab_shift.nii.gz

fslmaths segmentation-mask.nii.gz -mul 0 -bin subcortical.nii.gz

fslmaths segmentation-mask.nii.gz -thr 4 -uthr 4 -add subcortical.nii.gz -bin subcortical.nii.gz

fslmaths segmentation-mask.nii.gz -thr 10 -uthr 10 -add subcortical.nii.gz -bin subcortical.nii.gz

fslmaths segmentation-mask.nii.gz -thr 14 -uthr 14 -add subcortical.nii.gz -bin subcortical.nii.gz

fslmaths segmentation-mask.nii.gz -thr 24 -uthr 24 -add subcortical.nii.gz -bin subcortical.nii.gz

fslmaths segmentation-mask.nii.gz -thr 28 -uthr 28 -add subcortical.nii.gz -bin subcortical.nii.gz

fslmaths segmentation-mask.nii.gz -thr 31 -uthr 31 -add subcortical.nii.gz -bin subcortical.nii.gz

fslmaths segmentation-mask.nii.gz -thr 43 -uthr 43 -add subcortical.nii.gz -bin subcortical.nii.gz

fslmaths segmentation-mask.nii.gz -thr 49 -uthr 49 -add subcortical.nii.gz -bin subcortical.nii.gz

fslmaths segmentation-mask.nii.gz -thr 60 -uthr 60 -add subcortical.nii.gz -bin subcortical.nii.gz

fslmaths segmentation-mask.nii.gz -thr 63 -uthr 63 -add subcortical.nii.gz -bin subcortical.nii.gz

fslmaths subcortical.nii.gz -add CC_filt.nii.gz -add CSFslab_shift.nii.gz -dilM -ero -bin subcortical.nii.gz

fslswapdim subcortical.nii.gz x -z y subcortical_FS.nii.gz

mri_convert -odt uchar ./subcortical_FS.nii.gz ./subcortical_FS.nii.gz

cp subcortical_FS.nii.gz ../ref_FS.nii.gz

mri_tessellate ./subcortical_FS.nii.gz 255 ./subcortical_FS.fsmesh

mris_smooth -n 5 ./subcortical_FS.fsmesh ./subcortical_FS.fsmesh
smoothing for 5 iterations
smoothing surface tessellation for 5 iterations...
smoothing complete - recomputing first and second fundamental forms...
writing smoothed curvature to ./rh.curv
writing smoothed area to ./rh.area

mris_convert ./subcortical_FS.fsmesh ./subcortical_FS.stl

fslmaths segmentation-mask.nii.gz -thr 85 -uthr 85 -bin opticrad.nii.gz

fslswapdim opticrad.nii.gz x -z y opticrad_FS.nii.gz

mri_convert -odt uchar ./opticrad_FS.nii.gz ./opticrad_FS.nii.gz

mri_tessellate ./opticrad_FS.nii.gz 255 ./opticrad_FS.fsmesh

mris_smooth -n 5 ./opticrad_FS.fsmesh ./opticrad_FS.fsmesh
smoothing for 5 iterations
smoothing surface tessellation for 5 iterations...
smoothing complete - recomputing first and second fundamental forms...
writing smoothed curvature to ./rh.curv
writing smoothed area to ./rh.area

mris_convert ./opticrad_FS.fsmesh ./opticrad_FS.stl

/home/junhyuk/simnibs_2.1.2/bin/meshfix subcortical_FS.stl -a 2.0 --remove-handles -q -o subcortical.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix subcortical.off -a 2.0 -u 5 --vertices 7500 -q -o subcortical.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix subcortical.off -a 2.0 --dilate -1 -q -o subcortical_small

/home/junhyuk/simnibs_2.1.2/bin/meshfix subcortical.off -a 2.0 --dilate -1 -q -o subcortical_small_small

/home/junhyuk/simnibs_2.1.2/bin/meshfix subcortical.off -a 2.0 --dilate 1 -q -o subcortical_large

/home/junhyuk/simnibs_2.1.2/bin/meshfix subcortical_small.off -a 2.0 -u 5 -q -o subcortical_small

/home/junhyuk/simnibs_2.1.2/bin/meshfix opticrad_FS.stl -a 2.0 --remove-handles -q -o opticrad.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix opticrad.off -a 2.0 -u 5 -q -o opticrad.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix opticrad.off -a 2.0 --dilate 1 -q -o opticrad_large

/home/junhyuk/simnibs_2.1.2/bin/meshfix opticrad_large.off -a 2.0 --dilate 1 -q -o opticrad_large
 
==============================
==> preparing wm and gm hemispheres ...
==============================

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm.rh.stl -a 2.0 --remove-handles -q -o wm.rh_fixed

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm.rh_fixed.off -a 2.0 -u 5 --vertices 60000 -q -o wm.rh_fixed

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm.rh_fixed.off -a 2.0 -u 1 -q -o wm.rh_fixed

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm.rh_fixed.off -a 2.0 -q -o wm.rh_fixed

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm.rh.stl -a 2.0 -u 5 --vertices 69000 --remove-handles -q -o gm.rh_fixed
MeshFix failed!
Please try manually using ReMESH: http://remesh.sourceforge.net

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm.rh_fixed.off -a 2.0 -u 5 -q -o gm.rh_fixed

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm.rh_fixed.off -a 2.0 -u 1 -q -o gm.rh_fixed

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm.rh_fixed.off -a 2.0 -q -o gm.rh_fixed

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm.lh.stl -a 2.0 --remove-handles -q -o wm.lh_fixed

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm.lh_fixed.off -a 2.0 -u 5 --vertices 60000 -q -o wm.lh_fixed

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm.lh_fixed.off -a 2.0 -u 1 -q -o wm.lh_fixed

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm.lh_fixed.off -a 2.0 -q -o wm.lh_fixed

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm.lh.stl -a 2.0 -u 5 --vertices 69000 --remove-handles -q -o gm.lh_fixed

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm.lh_fixed.off -a 2.0 -u 5 -q -o gm.lh_fixed

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm.lh_fixed.off -a 2.0 -u 1 -q -o gm.lh_fixed

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm.lh_fixed.off -a 2.0 -q -o gm.lh_fixed

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm.rh_fixed.off opticrad_large.off -a 2.0 --shells 2 --cut-inner 0 -q -o wm.rh_fixed.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm.rh_fixed.off opticrad_large.off -a 2.0 --shells 2 --cut-inner 0 -q -o gm.rh_fixed.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm.lh_fixed.off opticrad_large.off -a 2.0 --shells 2 --cut-inner 0 -q -o wm.lh_fixed.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm.lh_fixed.off opticrad_large.off -a 2.0 --shells 2 --cut-inner 0 -q -o gm.lh_fixed.off
 
==============================
==> joining wm hemispheres ...
==============================

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm.rh_fixed.off subcortical_small.off -a 2.0 --shells 2 -j -o wm.rh_fixed2

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm.rh_fixed2.off wm.lh_fixed.off -a 2.0 --shells 2 -j -o wm_fixed

cp wm_fixed.off wm_fixed2.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm_fixed2.off subcortical_small.off -a 2.0 --shells 2 --decouple-outout 0 -o wm_fixed2.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm_fixed2.off subcortical_small.off -a 2.0 --shells 2 --cut-inner 0 -o wm_fixed2.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm_fixed2.off subcortical.off -a 2.0 --shells 2 --decouple-outout 0 -o wm_fixed2.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm_fixed2.off subcortical.off -a 2.0 --shells 2 --decouple-outout 0 -o wm_fixed2.off
 
==============================
==> joining gm hemispheres ...
==============================

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm.rh_fixed.off subcortical_large.off -a 2.0 --shells 2 -j -o gm.rh_fixed2

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm.rh_fixed2.off gm.lh_fixed.off -a 2.0 --shells 2 -j -o gm_fixed

cp gm_fixed.off gm_fixed2.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed2.off subcortical.off -a 2.0 --shells 2 --decouple-outout 0 -o gm_fixed2.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed2.off subcortical.off -a 2.0 --shells 2 --cut-inner 0 -o gm_fixed2.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed2.off subcortical_large.off -a 2.0 --shells 2 --decouple-outout 0 -o gm_fixed2.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed2.off subcortical_large.off -a 2.0 --shells 2 --decouple-outout 0 -o gm_fixed2.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed2.off subcortical_large.off -a 2.0 --shells 2 --decouple-outout 0 -o gm_fixed2.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed2.off subcortical_large.off -a 2.0 --shells 2 --decouple-outout 0 -o gm_fixed2.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed2.off subcortical_large.off -a 2.0 --shells 2 --decouple-outout 0 -o gm_fixed2.off
 
==============================
==> decoupling final gm from final wm ...
==============================

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed2.off -a 2.0 -u 1 -q -o gm_fixed3.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed3.off -a 2.0 -q -o gm_fixed3.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed3.off -a 2.0 -u 1 -q -o gm_fixed3.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed3.off -a 2.0 -q -o gm_fixed3.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm_fixed2.off -a 2.0 -u 1 -q -o wm_fixed3.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm_fixed3.off -a 2.0 -q -o wm_fixed3.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm_fixed3.off -a 2.0 -u 1 -q -o wm_fixed3.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm_fixed3.off -a 2.0 -q -o wm_fixed3.off

echo ** GM-WM decoupling: Iteration 1 **

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed3.off wm_fixed3.off -a 2.0 --shells 2 --decouple-outout 0 -o gm_fixed3.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed3.off wm_fixed3.off -a 2.0 --shells 2 --decouple-outout 0 -o gm_fixed3.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed3.off wm_fixed3.off -a 2.0 --shells 2 --cut-inner 0 -o gm_fixed3.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed3.off -a 2.0 -u 1 -q -o gm_fixed3.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed3.off -a 2.0 -q -o gm_fixed3.off

echo ** GM-WM decoupling: Iteration 2 **

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed3.off wm_fixed3.off -a 2.0 --shells 2 --decouple-outout 0 -o gm_fixed3.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed3.off wm_fixed3.off -a 2.0 --shells 2 --cut-inner 0 -o gm_fixed3.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed3.off -a 2.0 -u 1 -q -o gm_fixed3.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed3.off -a 2.0 -q -o gm_fixed3.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed3.off gm_fixed3.off --fineTuneOut 0.2 4 --shells 2 -o gm_fixed3.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed3.off -a 2.0 -u 1 -q -o gm_fixed3.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed3.off -a 2.0 -q -o gm_fixed3.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm_fixed3.off gm_fixed3.off --fineTuneIn 0.2 4 --shells 2 -o wm_fixed3.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm_fixed3.off -a 2.0 -u 1 -q -o wm_fixed3.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm_fixed3.off -a 2.0 -q -o wm_fixed3.off

echo Overall iterations needed for preparing WM and GM:1 2 1 5 2

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed3.off --stl -q -o /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/gm.stl

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm_fixed3.off --stl -q -o /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/wm.stl
 
==============================
==> creating volume masks from final GM and WM surfaces ...
==============================

/home/junhyuk/simnibs_2.1.2/bin/meshfix /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/wm.stl --no-clean --fsmesh -o wm.fsmesh

/home/junhyuk/simnibs_2.1.2/bin/meshfix /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/gm.stl --no-clean --fsmesh -o gm.fsmesh

cat

cp unity.xfm ../unity.xfm

mris_transform --dst ./subcortical_FS.nii.gz --src ./subcortical_FS.nii.gz ./wm.fsmesh ./unity.xfm ./wm.fsmesh
Reading dst volume...
Reading src volume...

mris_transform --dst ./subcortical_FS.nii.gz --src ./subcortical_FS.nii.gz ./gm.fsmesh ./unity.xfm ./gm.fsmesh
Reading dst volume...
Reading src volume...

mris_fill -c ./wm.fsmesh /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/wm.nii.gz
reading surface from ./wm.fsmesh...
writing filled volume to /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/wm.nii.gz...

mris_fill -c ./gm.fsmesh /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/gm.nii.gz
reading surface from ./gm.fsmesh...
writing filled volume to /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/gm.nii.gz...

fslswapdim /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/wm.nii.gz x z -y /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/wm.nii.gz

fslswapdim /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/gm.nii.gz x z -y /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/gm.nii.gz

cd /mnt/Research/simnibs/test2/SPR06
 
==============================
==> --subcort: Preparing ventricles surface and cerebellum/brainstem surface ...
==============================

cd /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp
 
==============================
==> creating ventricles mask ...
==============================

mri_convert /mnt/Research/simnibs/test2/SPR06/fs_SPR06/mri/aparc.a2009s+aseg.mgz ./segmentation-mask.nii.gz

fslswapdim segmentation-mask.nii.gz x z -y segmentation-mask.nii.gz

fslmaths segmentation-mask.nii.gz -mul 0 -bin ventricles_raw.nii.gz

fslmaths segmentation-mask.nii.gz -thr 4 -uthr 4 -add ventricles_raw.nii.gz -bin ventricles_raw.nii.gz

fslmaths segmentation-mask.nii.gz -thr 5 -uthr 5 -add ventricles_raw.nii.gz -bin ventricles_raw.nii.gz

fslmaths segmentation-mask.nii.gz -thr 14 -uthr 14 -add ventricles_raw.nii.gz -bin ventricles_raw.nii.gz

fslmaths segmentation-mask.nii.gz -thr 24 -uthr 24 -add ventricles_raw.nii.gz -bin ventricles_raw.nii.gz

fslmaths segmentation-mask.nii.gz -thr 31 -uthr 31 -add ventricles_raw.nii.gz -bin ventricles_raw.nii.gz

fslmaths segmentation-mask.nii.gz -thr 43 -uthr 43 -add ventricles_raw.nii.gz -bin ventricles_raw.nii.gz

fslmaths segmentation-mask.nii.gz -thr 44 -uthr 44 -add ventricles_raw.nii.gz -bin ventricles_raw.nii.gz

fslmaths segmentation-mask.nii.gz -thr 63 -uthr 63 -add ventricles_raw.nii.gz -bin ventricles_raw.nii.gz

fslmaths ventricles_raw.nii.gz -dilM -ero -bin ventricles_raw.nii.gz

imcp ventricles_raw /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/mask_prep/ventricles_raw

fslmaths /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/wm.nii.gz -ero -bin wm_small.nii.gz

fslmaths ventricles_raw.nii.gz -mul wm_small.nii.gz -bin ventricles_raw.nii.gz

fslswapdim ventricles_raw.nii.gz x -z y ventricles_FS.nii.gz

mri_convert -odt uchar ./ventricles_FS.nii.gz ./ventricles_FS.nii.gz

mri_tessellate ./ventricles_FS.nii.gz 255 ./ventricles_FS.fsmesh

mris_smooth -n 5 ./ventricles_FS.fsmesh ./ventricles_FS.fsmesh
smoothing for 5 iterations
smoothing surface tessellation for 5 iterations...
smoothing complete - recomputing first and second fundamental forms...
writing smoothed curvature to ./rh.curv
writing smoothed area to ./rh.area

mris_convert ./ventricles_FS.fsmesh ./ventricles_FS.stl

/home/junhyuk/simnibs_2.1.2/bin/meshfix ventricles_FS.stl -a 2.0 -q -o ventricles.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix ventricles.off -a 2.0 -u 5 --vertices 7500 -q -o ventricles.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix ventricles.off -a 2.0 --smooth 1 -q -o ventricles.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix ventricles.off -a 2.0 -u 5 -q -o ventricles.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix ventricles.off -a 2.0 -q -o ventricles.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix ventricles.off -a 2.0 -u 1 -q -o ventricles.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix ventricles.off -a 2.0 -q -o ventricles.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix ventricles.off --stl -q -o /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/ventricles.stl
 
==============================
==> creating brainstem and cerebellum mask ...
==============================

fslmaths segmentation-mask.nii.gz -mul 0 -bin cerebellum_raw.nii.gz

fslmaths segmentation-mask.nii.gz -thr 7 -uthr 7 -add cerebellum_raw.nii.gz -bin cerebellum_raw.nii.gz

fslmaths segmentation-mask.nii.gz -thr 8 -uthr 8 -add cerebellum_raw.nii.gz -bin cerebellum_raw.nii.gz

fslmaths segmentation-mask.nii.gz -thr 16 -uthr 16 -add cerebellum_raw.nii.gz -bin cerebellum_raw.nii.gz

fslmaths segmentation-mask.nii.gz -thr 46 -uthr 46 -add cerebellum_raw.nii.gz -bin cerebellum_raw.nii.gz

fslmaths segmentation-mask.nii.gz -thr 47 -uthr 47 -add cerebellum_raw.nii.gz -bin cerebellum_raw.nii.gz

fslmaths cerebellum_raw -bin cerebellum_raw

imcp cerebellum_raw /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/mask_prep/cerebellum_raw

fslmaths /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/gm.nii.gz -dilM -bin gm_large.nii.gz

fslmaths cerebellum_raw.nii.gz -sub gm_large.nii.gz -bin cerebellum_raw.nii.gz

fslmaths cerebellum_raw.nii.gz -ero -dilM -bin cerebellum_raw.nii.gz

fslswapdim cerebellum_raw.nii.gz x -z y cerebellum_FS.nii.gz

mri_convert -odt uchar ./cerebellum_FS.nii.gz ./cerebellum_FS.nii.gz

mri_tessellate ./cerebellum_FS.nii.gz 255 ./cerebellum_FS.fsmesh

mris_smooth -n 5 ./cerebellum_FS.fsmesh ./cerebellum_FS.fsmesh
smoothing for 5 iterations
smoothing surface tessellation for 5 iterations...
smoothing complete - recomputing first and second fundamental forms...
writing smoothed curvature to ./rh.curv
writing smoothed area to ./rh.area

mris_convert ./cerebellum_FS.fsmesh ./cerebellum_FS.stl

/home/junhyuk/simnibs_2.1.2/bin/meshfix cerebellum_FS.stl --no-clean -q -o cerebellum.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix cerebellum.off -a 2.0 -q -o cerebellum.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix cerebellum.off -a 2.0 -u 5 --vertices 8571 -q -o cerebellum.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix cerebellum.off -a 2.0 -q -o cerebellum.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix cerebellum.off -a 2.0 -u 1 -q -o cerebellum.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix cerebellum.off -a 2.0 -q -o cerebellum.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix cerebellum.off --stl -q -o /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/cerebellum.stl
 
==============================
==> creating volume masks from final ventricles and cerebellum surfaces ...
==============================

/home/junhyuk/simnibs_2.1.2/bin/meshfix /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/ventricles.stl --no-clean --fsmesh -o ventricles.fsmesh

mris_transform --dst ../ref_FS.nii.gz --src ../ref_FS.nii.gz ./ventricles.fsmesh ../unity.xfm ./ventricles.fsmesh
Reading dst volume...
Reading src volume...

mris_fill -c ./ventricles.fsmesh /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/ventricles.nii.gz
reading surface from ./ventricles.fsmesh...
writing filled volume to /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/ventricles.nii.gz...

fslswapdim /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/ventricles.nii.gz x z -y /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/ventricles.nii.gz

/home/junhyuk/simnibs_2.1.2/bin/meshfix /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/cerebellum.stl --no-clean --fsmesh -o cerebellum.fsmesh

mris_transform --dst ../ref_FS.nii.gz --src ../ref_FS.nii.gz ./cerebellum.fsmesh ../unity.xfm ./cerebellum.fsmesh
Reading dst volume...
Reading src volume...

mris_fill -c ./cerebellum.fsmesh /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/cerebellum.nii.gz
reading surface from ./cerebellum.fsmesh...
writing filled volume to /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/cerebellum.nii.gz...

fslswapdim /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/cerebellum.nii.gz x z -y /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/cerebellum.nii.gz

cd /mnt/Research/simnibs/test2/SPR06
 
==============================
==> --head: Preparing CSF, skull and skin surfaces ...
==============================

cd /mnt/Research/simnibs/test2/SPR06/m2m_SPR06
 
==============================
==> Coregistering images to T1fs_conform ...
==============================

fslswapdim T1fs_roi x -z y tmp/T1fs_roi_FS

mri_nu_correct.mni --n 1 --proto-iters 1000 --distance 50 --no-rescale --i tmp/T1fs_roi_FS.nii.gz --o tmp/T1fs_nu_roi.nii.gz

fslswapdim tmp/T1fs_nu_roi x z -y tmp/T1fs_nu_roi

fslmaths T1fs_roi -bin -s 1 tmp/T1fs_roi-mask

flirt -dof 12 -in /usr/share/fsl/5.0/data/standard/MNI152_T1_1mm.nii.gz -ref T1fs_nu_conform -omat tmp/MNI2conform_forbet.mat

convert_xfm -omat tmp/Conform2MNI.mat -inverse tmp/MNI2conform_forbet.mat

cd /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp
 
==============================
==> Get CSF mask from T1fs and T2fs ...
==============================

bet T1fs_nu_roi T1fs_conform_betted -e -m -g -0.2

betsurf --t1only -m -o /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/T1fs_roi T1fs_conform_betted_mesh.vtk Conform2MNI.mat csf_raw

mv csf_raw_inskull_mask.nii.gz csf_raw.nii.gz

imcp csf_raw /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/mask_prep/csf_raw

fslmaths /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/gm.nii.gz -dilM -bin gm_large.nii.gz

fslmaths /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/cerebellum.nii.gz -dilM -add gm_large.nii.gz -bin brain_large.nii.gz

fslmaths csf_raw.nii.gz -add brain_large.nii.gz -bin csf_raw.nii.gz

fslswapdim csf_raw.nii.gz x -z y csf_FS.nii.gz

mri_convert -odt uchar ./csf_FS.nii.gz ./csf_FS.nii.gz

mri_tessellate ./csf_FS.nii.gz 255 ./csf_FS.fsmesh

mris_smooth -n 5 ./csf_FS.fsmesh ./csf_FS.fsmesh
smoothing for 5 iterations
smoothing surface tessellation for 5 iterations...
smoothing complete - recomputing first and second fundamental forms...
writing smoothed curvature to ./rh.curv
writing smoothed area to ./rh.area

mris_convert ./csf_FS.fsmesh ./csf_FS.stl

/home/junhyuk/simnibs_2.1.2/bin/meshfix csf_FS.stl -a 2.0 -u 5 --vertices 60000 -q -o csf.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix csf.off -a 2.0 -q -o csf.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix csf.off -a 2.0 -u 1 -q -o csf.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix csf.off -a 2.0 -q -o csf.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix csf.off --stl -q -o /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/csf.stl

/home/junhyuk/simnibs_2.1.2/bin/meshfix /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/csf.stl --no-clean --fsmesh -o csf.fsmesh

mris_transform --dst ../ref_FS.nii.gz --src ../ref_FS.nii.gz ./csf.fsmesh ../unity.xfm ./csf.fsmesh
Reading dst volume...
Reading src volume...

mris_fill -r 0.5 -c ./csf.fsmesh /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/csf.nii.gz
reading surface from ./csf.fsmesh...
writing filled volume to /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/csf.nii.gz...

fslswapdim /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/csf.nii.gz x z -y /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/csf.nii.gz
 
==============================
==> Get skull mask from T1 and T2 ...
==============================

mv csf_raw_outskull_mask.nii.gz skull_raw.nii.gz

imcp skull_raw /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/mask_prep/skull_raw

fslmaths /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/csf.nii.gz -dilM -bin csf_large.nii.gz

fslmaths skull_raw.nii.gz -add csf_large.nii.gz -bin skull_raw.nii.gz

fslswapdim skull_raw.nii.gz x -z y skull_FS.nii.gz

mri_convert -odt uchar ./skull_FS.nii.gz ./skull_FS.nii.gz

mri_tessellate ./skull_FS.nii.gz 255 ./skull_FS.fsmesh

mris_smooth -n 5 ./skull_FS.fsmesh ./skull_FS.fsmesh
smoothing for 5 iterations
smoothing surface tessellation for 5 iterations...
smoothing complete - recomputing first and second fundamental forms...
writing smoothed curvature to ./rh.curv
writing smoothed area to ./rh.area

mris_convert ./skull_FS.fsmesh ./skull_FS.stl

/home/junhyuk/simnibs_2.1.2/bin/meshfix skull_FS.stl -a 2.0 -u 5 --vertices 60000 -q -o skull.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix skull.off -a 2.0 -q -o skull.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix skull.off -a 2.0 -u 1 -q -o skull.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix skull.off -a 2.0 -q -o skull.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix skull.off --stl -q -o /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/skull.stl

/home/junhyuk/simnibs_2.1.2/bin/meshfix /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/skull.stl --no-clean --fsmesh -o skull.fsmesh

mris_transform --dst ../ref_FS.nii.gz --src ../ref_FS.nii.gz ./skull.fsmesh ../unity.xfm ./skull.fsmesh
Reading dst volume...
Reading src volume...

mris_fill -r 0.5 -c ./skull.fsmesh /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/skull.nii.gz
reading surface from ./skull.fsmesh...
writing filled volume to /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/skull.nii.gz...

fslswapdim /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/skull.nii.gz x z -y /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/skull.nii.gz
 
==============================
==> Get skin mask from T1 and T2 ...
==============================

mv csf_raw_outskin_mask.nii.gz skin_raw.nii.gz

fslmaths skin_raw -sub /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/skull -bin -mul /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/T1fs_nu_conform skin_estimate

echo Threshold for skin 20.000000

fslmaths /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/skull.nii.gz -dilM -bin skull_large.nii.gz

fslmaths /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/T1fs_nu_conform -s 1 -thr 20.000000 -add skin_raw.nii.gz -add skull_large.nii.gz -bin skin_raw.nii.gz

fslmaths skin_raw -ero -ero skin_raw_ero

cluster --in=skin_raw_ero --thresh=0.5 --no_table --osize=skin_raw_ero

fslmaths skin_raw_ero -thr 2888298.000000 -bin skin_raw_ero

fslmaths skin_raw_ero -dilM -dilM -dilM -dilM -mul skin_raw -bin -fillh skin_raw

fslmaths /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/T1fs_nu_conform -edge T1fs_nu_edge

imcp skin_raw skin_tmp_it1

fslmaths skin_tmp_it1 -s 1 -thr 0.7 -bin skin_tmp_small

fslmaths skin_tmp_it1 -sub skin_tmp_small -mul T1fs_nu_edge skin_tmp_strength

immv skin_tmp_small skin_tmp_it2

fslmaths skin_tmp_it2 -s 1 -thr 0.7 -bin skin_tmp_small

fslmaths skin_tmp_it2 -sub skin_tmp_small -mul T1fs_nu_edge skin_tmp_strength

immv skin_tmp_small skin_tmp_it3

fslmaths skin_tmp_it3 -s 1 -thr 0.7 -bin skin_tmp_small

fslmaths skin_tmp_it3 -sub skin_tmp_small -mul T1fs_nu_edge skin_tmp_strength

immv skin_tmp_small skin_tmp_it4

fslmaths skin_tmp_it4 -s 1 -thr 0.7 -bin skin_tmp_small

fslmaths skin_tmp_it4 -sub skin_tmp_small -mul T1fs_nu_edge skin_tmp_strength

immv skin_tmp_small skin_tmp_it5

fslmaths skin_tmp_it5 -s 1 -thr 0.7 -bin skin_tmp_small

fslmaths skin_tmp_it5 -sub skin_tmp_small -mul T1fs_nu_edge skin_tmp_strength

immv skin_tmp_small skin_tmp_it6

fslmaths skin_tmp_it2 -add skull_large -bin skin_raw

imcp skin_raw /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/mask_prep/skin_raw

fslswapdim skin_raw.nii.gz x -z y skin_FS.nii.gz

mri_convert -odt uchar ./skin_FS.nii.gz ./skin_FS.nii.gz

mri_tessellate ./skin_FS.nii.gz 255 ./skin_FS.fsmesh

mris_smooth -n 5 ./skin_FS.fsmesh ./skin_FS.fsmesh
smoothing for 5 iterations
smoothing surface tessellation for 5 iterations...
smoothing complete - recomputing first and second fundamental forms...
writing smoothed curvature to ./rh.curv
writing smoothed area to ./rh.area

mris_convert ./skin_FS.fsmesh ./skin_FS.stl

/home/junhyuk/simnibs_2.1.2/bin/meshfix skin_FS.stl -q --stl -o skin_FS.stl

/home/junhyuk/simnibs_2.1.2/bin/meshfix skin_FS.stl -a 2.0 -u 5 --vertices 60000 -q -o skin.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix skin.off -a 2.0 -q -o skin.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix skin.off -a 2.0 -u 1 -q -o skin.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix skin.off -a 2.0 -q -o skin.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix skin.off --stl -q -o /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/skin.stl

/home/junhyuk/simnibs_2.1.2/bin/meshfix /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/skin.stl --no-clean --fsmesh -o skin.fsmesh

mris_transform --dst ../ref_FS.nii.gz --src ../ref_FS.nii.gz ./skin.fsmesh ../unity.xfm ./skin.fsmesh
Reading dst volume...
Reading src volume...

mris_fill -r 0.5 -c ./skin.fsmesh /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/skin.nii.gz
reading surface from ./skin.fsmesh...
writing filled volume to /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/skin.nii.gz...

fslswapdim /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/skin.nii.gz x z -y /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/skin.nii.gz

cd /mnt/Research/simnibs/test2/SPR06
 
==============================
==> --vol: Volume meshing ...
==============================

cat

/home/junhyuk/simnibs_2.1.2/bin/gmsh -3 -bin -o SPR06.msh SPR06.geo
error code 139
exiting mri2mesh
</pre></BODY></HTML>
<HTML><HEAD><TITLE>mri2mesh report</TITLE></HEAD><BODY><pre>
 
==============================
==> mri2mesh started  2019. 12. 09. (월) 16:33:05 KST ...
==============================
command line options: --all SPR06 SPR06_T1.nii.gz
 
==============================
==> --brain/--brainf: Preparing GM and WM surfaces ...
==============================
 
==============================
==> skipping recon-all, using previous results to save time! ...
==============================
 
==============================
==> Convert WM and GM hemispheres to STL ...
==============================

mris_convert /mnt/Research/simnibs/test2/SPR06/fs_SPR06/surf/rh.white /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/wm.rh.stl

mris_convert /mnt/Research/simnibs/test2/SPR06/fs_SPR06/surf/rh.pial /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/gm.rh.stl

mris_convert /mnt/Research/simnibs/test2/SPR06/fs_SPR06/surf/lh.white /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/wm.lh.stl

mris_convert /mnt/Research/simnibs/test2/SPR06/fs_SPR06/surf/lh.pial /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/gm.lh.stl

cd /mnt/Research/simnibs/test2/SPR06/m2m_SPR06

cp /home/junhyuk/simnibs_2.1.2/resources/templates/CC_filterkernel.nii.gz /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/.

mri_convert /mnt/Research/simnibs/test2/SPR06/fs_SPR06/mri/orig.mgz /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/T1fs_conform.nii.gz

fslswapdim /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/T1fs_conform.nii.gz x z -y /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/T1fs_conform.nii.gz

cp /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/T1fs_conform.nii.gz /mnt/Research/simnibs/test2/SPR06/SPR06_T1fs_conform.nii.gz

mri_convert /mnt/Research/simnibs/test2/SPR06/fs_SPR06/mri/nu.mgz /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/T1fs_nu_conform.nii.gz

fslswapdim /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/T1fs_nu_conform.nii.gz x z -y /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/T1fs_nu_conform.nii.gz
 
==============================
==> creating subcortical mask for joining the hemispheres ...
==============================

cd /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp

mri_convert /mnt/Research/simnibs/test2/SPR06/fs_SPR06/mri/aparc.a2009s+aseg.mgz ./segmentation-mask.nii.gz

fslswapdim segmentation-mask.nii.gz x z -y segmentation-mask.nii.gz

fslmaths segmentation-mask.nii.gz -thr 251 -uthr 255 -bin CC.nii.gz

fslmaths CC.nii.gz -kernel file CC_filterkernel.nii.gz -fmean CC_filt.nii.gz -odt float

fslmaths CC_filt.nii.gz -thr 0.1 -bin CC_final.nii.gz

cat

fslmaths segmentation-mask.nii.gz -thr 24 -uthr 24 -dilM -bin CSFslab.nii.gz

flirt -in CSFslab.nii.gz -ref CSFslab.nii.gz -applyxfm -init yshift.mat -out CSFslab_shift.nii.gz

fslmaths segmentation-mask.nii.gz -mul 0 -bin subcortical.nii.gz

fslmaths segmentation-mask.nii.gz -thr 4 -uthr 4 -add subcortical.nii.gz -bin subcortical.nii.gz

fslmaths segmentation-mask.nii.gz -thr 10 -uthr 10 -add subcortical.nii.gz -bin subcortical.nii.gz

fslmaths segmentation-mask.nii.gz -thr 14 -uthr 14 -add subcortical.nii.gz -bin subcortical.nii.gz

fslmaths segmentation-mask.nii.gz -thr 24 -uthr 24 -add subcortical.nii.gz -bin subcortical.nii.gz

fslmaths segmentation-mask.nii.gz -thr 28 -uthr 28 -add subcortical.nii.gz -bin subcortical.nii.gz

fslmaths segmentation-mask.nii.gz -thr 31 -uthr 31 -add subcortical.nii.gz -bin subcortical.nii.gz

fslmaths segmentation-mask.nii.gz -thr 43 -uthr 43 -add subcortical.nii.gz -bin subcortical.nii.gz

fslmaths segmentation-mask.nii.gz -thr 49 -uthr 49 -add subcortical.nii.gz -bin subcortical.nii.gz

fslmaths segmentation-mask.nii.gz -thr 60 -uthr 60 -add subcortical.nii.gz -bin subcortical.nii.gz

fslmaths segmentation-mask.nii.gz -thr 63 -uthr 63 -add subcortical.nii.gz -bin subcortical.nii.gz

fslmaths subcortical.nii.gz -add CC_filt.nii.gz -add CSFslab_shift.nii.gz -dilM -ero -bin subcortical.nii.gz

fslswapdim subcortical.nii.gz x -z y subcortical_FS.nii.gz

mri_convert -odt uchar ./subcortical_FS.nii.gz ./subcortical_FS.nii.gz

cp subcortical_FS.nii.gz ../ref_FS.nii.gz

mri_tessellate ./subcortical_FS.nii.gz 255 ./subcortical_FS.fsmesh

mris_smooth -n 5 ./subcortical_FS.fsmesh ./subcortical_FS.fsmesh
smoothing for 5 iterations
smoothing surface tessellation for 5 iterations...
smoothing complete - recomputing first and second fundamental forms...
writing smoothed curvature to ./rh.curv
writing smoothed area to ./rh.area

mris_convert ./subcortical_FS.fsmesh ./subcortical_FS.stl

fslmaths segmentation-mask.nii.gz -thr 85 -uthr 85 -bin opticrad.nii.gz

fslswapdim opticrad.nii.gz x -z y opticrad_FS.nii.gz

mri_convert -odt uchar ./opticrad_FS.nii.gz ./opticrad_FS.nii.gz

mri_tessellate ./opticrad_FS.nii.gz 255 ./opticrad_FS.fsmesh

mris_smooth -n 5 ./opticrad_FS.fsmesh ./opticrad_FS.fsmesh
smoothing for 5 iterations
smoothing surface tessellation for 5 iterations...
smoothing complete - recomputing first and second fundamental forms...
writing smoothed curvature to ./rh.curv
writing smoothed area to ./rh.area

mris_convert ./opticrad_FS.fsmesh ./opticrad_FS.stl

/home/junhyuk/simnibs_2.1.2/bin/meshfix subcortical_FS.stl -a 2.0 --remove-handles -q -o subcortical.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix subcortical.off -a 2.0 -u 5 --vertices 7500 -q -o subcortical.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix subcortical.off -a 2.0 --dilate -1 -q -o subcortical_small

/home/junhyuk/simnibs_2.1.2/bin/meshfix subcortical.off -a 2.0 --dilate -1 -q -o subcortical_small_small

/home/junhyuk/simnibs_2.1.2/bin/meshfix subcortical.off -a 2.0 --dilate 1 -q -o subcortical_large

/home/junhyuk/simnibs_2.1.2/bin/meshfix subcortical_small.off -a 2.0 -u 5 -q -o subcortical_small

/home/junhyuk/simnibs_2.1.2/bin/meshfix opticrad_FS.stl -a 2.0 --remove-handles -q -o opticrad.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix opticrad.off -a 2.0 -u 5 -q -o opticrad.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix opticrad.off -a 2.0 --dilate 1 -q -o opticrad_large

/home/junhyuk/simnibs_2.1.2/bin/meshfix opticrad_large.off -a 2.0 --dilate 1 -q -o opticrad_large
 
==============================
==> preparing wm and gm hemispheres ...
==============================

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm.rh.stl -a 2.0 --remove-handles -q -o wm.rh_fixed

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm.rh_fixed.off -a 2.0 -u 5 --vertices 60000 -q -o wm.rh_fixed

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm.rh_fixed.off -a 2.0 -u 1 -q -o wm.rh_fixed

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm.rh_fixed.off -a 2.0 -q -o wm.rh_fixed

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm.rh.stl -a 2.0 -u 5 --vertices 69000 --remove-handles -q -o gm.rh_fixed
MeshFix failed!
Please try manually using ReMESH: http://remesh.sourceforge.net

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm.rh_fixed.off -a 2.0 -u 5 -q -o gm.rh_fixed

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm.rh_fixed.off -a 2.0 -u 1 -q -o gm.rh_fixed

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm.rh_fixed.off -a 2.0 -q -o gm.rh_fixed

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm.lh.stl -a 2.0 --remove-handles -q -o wm.lh_fixed

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm.lh_fixed.off -a 2.0 -u 5 --vertices 60000 -q -o wm.lh_fixed

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm.lh_fixed.off -a 2.0 -u 1 -q -o wm.lh_fixed

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm.lh_fixed.off -a 2.0 -q -o wm.lh_fixed

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm.lh.stl -a 2.0 -u 5 --vertices 69000 --remove-handles -q -o gm.lh_fixed

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm.lh_fixed.off -a 2.0 -u 5 -q -o gm.lh_fixed

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm.lh_fixed.off -a 2.0 -u 1 -q -o gm.lh_fixed

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm.lh_fixed.off -a 2.0 -q -o gm.lh_fixed

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm.rh_fixed.off opticrad_large.off -a 2.0 --shells 2 --cut-inner 0 -q -o wm.rh_fixed.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm.rh_fixed.off opticrad_large.off -a 2.0 --shells 2 --cut-inner 0 -q -o gm.rh_fixed.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm.lh_fixed.off opticrad_large.off -a 2.0 --shells 2 --cut-inner 0 -q -o wm.lh_fixed.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm.lh_fixed.off opticrad_large.off -a 2.0 --shells 2 --cut-inner 0 -q -o gm.lh_fixed.off
 
==============================
==> joining wm hemispheres ...
==============================

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm.rh_fixed.off subcortical_small.off -a 2.0 --shells 2 -j -o wm.rh_fixed2

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm.rh_fixed2.off wm.lh_fixed.off -a 2.0 --shells 2 -j -o wm_fixed

cp wm_fixed.off wm_fixed2.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm_fixed2.off subcortical_small.off -a 2.0 --shells 2 --decouple-outout 0 -o wm_fixed2.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm_fixed2.off subcortical_small.off -a 2.0 --shells 2 --cut-inner 0 -o wm_fixed2.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm_fixed2.off subcortical.off -a 2.0 --shells 2 --decouple-outout 0 -o wm_fixed2.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm_fixed2.off subcortical.off -a 2.0 --shells 2 --decouple-outout 0 -o wm_fixed2.off
 
==============================
==> joining gm hemispheres ...
==============================

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm.rh_fixed.off subcortical_large.off -a 2.0 --shells 2 -j -o gm.rh_fixed2

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm.rh_fixed2.off gm.lh_fixed.off -a 2.0 --shells 2 -j -o gm_fixed

cp gm_fixed.off gm_fixed2.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed2.off subcortical.off -a 2.0 --shells 2 --decouple-outout 0 -o gm_fixed2.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed2.off subcortical.off -a 2.0 --shells 2 --cut-inner 0 -o gm_fixed2.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed2.off subcortical_large.off -a 2.0 --shells 2 --decouple-outout 0 -o gm_fixed2.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed2.off subcortical_large.off -a 2.0 --shells 2 --decouple-outout 0 -o gm_fixed2.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed2.off subcortical_large.off -a 2.0 --shells 2 --decouple-outout 0 -o gm_fixed2.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed2.off subcortical_large.off -a 2.0 --shells 2 --decouple-outout 0 -o gm_fixed2.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed2.off subcortical_large.off -a 2.0 --shells 2 --decouple-outout 0 -o gm_fixed2.off
 
==============================
==> decoupling final gm from final wm ...
==============================

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed2.off -a 2.0 -u 1 -q -o gm_fixed3.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed3.off -a 2.0 -q -o gm_fixed3.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed3.off -a 2.0 -u 1 -q -o gm_fixed3.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed3.off -a 2.0 -q -o gm_fixed3.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm_fixed2.off -a 2.0 -u 1 -q -o wm_fixed3.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm_fixed3.off -a 2.0 -q -o wm_fixed3.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm_fixed3.off -a 2.0 -u 1 -q -o wm_fixed3.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm_fixed3.off -a 2.0 -q -o wm_fixed3.off

echo ** GM-WM decoupling: Iteration 1 **

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed3.off wm_fixed3.off -a 2.0 --shells 2 --decouple-outout 0 -o gm_fixed3.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed3.off wm_fixed3.off -a 2.0 --shells 2 --decouple-outout 0 -o gm_fixed3.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed3.off wm_fixed3.off -a 2.0 --shells 2 --cut-inner 0 -o gm_fixed3.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed3.off -a 2.0 -u 1 -q -o gm_fixed3.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed3.off -a 2.0 -q -o gm_fixed3.off

echo ** GM-WM decoupling: Iteration 2 **

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed3.off wm_fixed3.off -a 2.0 --shells 2 --decouple-outout 0 -o gm_fixed3.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed3.off wm_fixed3.off -a 2.0 --shells 2 --cut-inner 0 -o gm_fixed3.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed3.off -a 2.0 -u 1 -q -o gm_fixed3.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed3.off -a 2.0 -q -o gm_fixed3.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed3.off gm_fixed3.off --fineTuneOut 0.2 4 --shells 2 -o gm_fixed3.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed3.off -a 2.0 -u 1 -q -o gm_fixed3.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed3.off -a 2.0 -q -o gm_fixed3.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm_fixed3.off gm_fixed3.off --fineTuneIn 0.2 4 --shells 2 -o wm_fixed3.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm_fixed3.off -a 2.0 -u 1 -q -o wm_fixed3.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm_fixed3.off -a 2.0 -q -o wm_fixed3.off

echo Overall iterations needed for preparing WM and GM:1 2 1 5 2

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed3.off --stl -q -o /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/gm.stl

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm_fixed3.off --stl -q -o /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/wm.stl
 
==============================
==> creating volume masks from final GM and WM surfaces ...
==============================

/home/junhyuk/simnibs_2.1.2/bin/meshfix /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/wm.stl --no-clean --fsmesh -o wm.fsmesh

/home/junhyuk/simnibs_2.1.2/bin/meshfix /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/gm.stl --no-clean --fsmesh -o gm.fsmesh

cat

cp unity.xfm ../unity.xfm

mris_transform --dst ./subcortical_FS.nii.gz --src ./subcortical_FS.nii.gz ./wm.fsmesh ./unity.xfm ./wm.fsmesh
Reading dst volume...
Reading src volume...

mris_transform --dst ./subcortical_FS.nii.gz --src ./subcortical_FS.nii.gz ./gm.fsmesh ./unity.xfm ./gm.fsmesh
Reading dst volume...
Reading src volume...

mris_fill -c ./wm.fsmesh /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/wm.nii.gz
reading surface from ./wm.fsmesh...
writing filled volume to /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/wm.nii.gz...

mris_fill -c ./gm.fsmesh /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/gm.nii.gz
reading surface from ./gm.fsmesh...
writing filled volume to /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/gm.nii.gz...

fslswapdim /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/wm.nii.gz x z -y /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/wm.nii.gz

fslswapdim /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/gm.nii.gz x z -y /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/gm.nii.gz

cd /mnt/Research/simnibs/test2/SPR06
 
==============================
==> --subcort: Preparing ventricles surface and cerebellum/brainstem surface ...
==============================

cd /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp
 
==============================
==> creating ventricles mask ...
==============================

mri_convert /mnt/Research/simnibs/test2/SPR06/fs_SPR06/mri/aparc.a2009s+aseg.mgz ./segmentation-mask.nii.gz

fslswapdim segmentation-mask.nii.gz x z -y segmentation-mask.nii.gz

fslmaths segmentation-mask.nii.gz -mul 0 -bin ventricles_raw.nii.gz

fslmaths segmentation-mask.nii.gz -thr 4 -uthr 4 -add ventricles_raw.nii.gz -bin ventricles_raw.nii.gz

fslmaths segmentation-mask.nii.gz -thr 5 -uthr 5 -add ventricles_raw.nii.gz -bin ventricles_raw.nii.gz

fslmaths segmentation-mask.nii.gz -thr 14 -uthr 14 -add ventricles_raw.nii.gz -bin ventricles_raw.nii.gz

fslmaths segmentation-mask.nii.gz -thr 24 -uthr 24 -add ventricles_raw.nii.gz -bin ventricles_raw.nii.gz

fslmaths segmentation-mask.nii.gz -thr 31 -uthr 31 -add ventricles_raw.nii.gz -bin ventricles_raw.nii.gz

fslmaths segmentation-mask.nii.gz -thr 43 -uthr 43 -add ventricles_raw.nii.gz -bin ventricles_raw.nii.gz

fslmaths segmentation-mask.nii.gz -thr 44 -uthr 44 -add ventricles_raw.nii.gz -bin ventricles_raw.nii.gz

fslmaths segmentation-mask.nii.gz -thr 63 -uthr 63 -add ventricles_raw.nii.gz -bin ventricles_raw.nii.gz

fslmaths ventricles_raw.nii.gz -dilM -ero -bin ventricles_raw.nii.gz

imcp ventricles_raw /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/mask_prep/ventricles_raw

fslmaths /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/wm.nii.gz -ero -bin wm_small.nii.gz

fslmaths ventricles_raw.nii.gz -mul wm_small.nii.gz -bin ventricles_raw.nii.gz

fslswapdim ventricles_raw.nii.gz x -z y ventricles_FS.nii.gz

mri_convert -odt uchar ./ventricles_FS.nii.gz ./ventricles_FS.nii.gz

mri_tessellate ./ventricles_FS.nii.gz 255 ./ventricles_FS.fsmesh

mris_smooth -n 5 ./ventricles_FS.fsmesh ./ventricles_FS.fsmesh
smoothing for 5 iterations
smoothing surface tessellation for 5 iterations...
smoothing complete - recomputing first and second fundamental forms...
writing smoothed curvature to ./rh.curv
writing smoothed area to ./rh.area

mris_convert ./ventricles_FS.fsmesh ./ventricles_FS.stl

/home/junhyuk/simnibs_2.1.2/bin/meshfix ventricles_FS.stl -a 2.0 -q -o ventricles.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix ventricles.off -a 2.0 -u 5 --vertices 7500 -q -o ventricles.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix ventricles.off -a 2.0 --smooth 1 -q -o ventricles.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix ventricles.off -a 2.0 -u 5 -q -o ventricles.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix ventricles.off -a 2.0 -q -o ventricles.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix ventricles.off -a 2.0 -u 1 -q -o ventricles.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix ventricles.off -a 2.0 -q -o ventricles.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix ventricles.off --stl -q -o /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/ventricles.stl
 
==============================
==> creating brainstem and cerebellum mask ...
==============================

fslmaths segmentation-mask.nii.gz -mul 0 -bin cerebellum_raw.nii.gz

fslmaths segmentation-mask.nii.gz -thr 7 -uthr 7 -add cerebellum_raw.nii.gz -bin cerebellum_raw.nii.gz

fslmaths segmentation-mask.nii.gz -thr 8 -uthr 8 -add cerebellum_raw.nii.gz -bin cerebellum_raw.nii.gz

fslmaths segmentation-mask.nii.gz -thr 16 -uthr 16 -add cerebellum_raw.nii.gz -bin cerebellum_raw.nii.gz

fslmaths segmentation-mask.nii.gz -thr 46 -uthr 46 -add cerebellum_raw.nii.gz -bin cerebellum_raw.nii.gz

fslmaths segmentation-mask.nii.gz -thr 47 -uthr 47 -add cerebellum_raw.nii.gz -bin cerebellum_raw.nii.gz

fslmaths cerebellum_raw -bin cerebellum_raw

imcp cerebellum_raw /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/mask_prep/cerebellum_raw

fslmaths /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/gm.nii.gz -dilM -bin gm_large.nii.gz

fslmaths cerebellum_raw.nii.gz -sub gm_large.nii.gz -bin cerebellum_raw.nii.gz

fslmaths cerebellum_raw.nii.gz -ero -dilM -bin cerebellum_raw.nii.gz

fslswapdim cerebellum_raw.nii.gz x -z y cerebellum_FS.nii.gz

mri_convert -odt uchar ./cerebellum_FS.nii.gz ./cerebellum_FS.nii.gz

mri_tessellate ./cerebellum_FS.nii.gz 255 ./cerebellum_FS.fsmesh

mris_smooth -n 5 ./cerebellum_FS.fsmesh ./cerebellum_FS.fsmesh
smoothing for 5 iterations
smoothing surface tessellation for 5 iterations...
smoothing complete - recomputing first and second fundamental forms...
writing smoothed curvature to ./rh.curv
writing smoothed area to ./rh.area

mris_convert ./cerebellum_FS.fsmesh ./cerebellum_FS.stl

/home/junhyuk/simnibs_2.1.2/bin/meshfix cerebellum_FS.stl --no-clean -q -o cerebellum.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix cerebellum.off -a 2.0 -q -o cerebellum.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix cerebellum.off -a 2.0 -u 5 --vertices 8571 -q -o cerebellum.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix cerebellum.off -a 2.0 -q -o cerebellum.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix cerebellum.off -a 2.0 -u 1 -q -o cerebellum.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix cerebellum.off -a 2.0 -q -o cerebellum.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix cerebellum.off --stl -q -o /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/cerebellum.stl
 
==============================
==> creating volume masks from final ventricles and cerebellum surfaces ...
==============================

/home/junhyuk/simnibs_2.1.2/bin/meshfix /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/ventricles.stl --no-clean --fsmesh -o ventricles.fsmesh

mris_transform --dst ../ref_FS.nii.gz --src ../ref_FS.nii.gz ./ventricles.fsmesh ../unity.xfm ./ventricles.fsmesh
Reading dst volume...
Reading src volume...

mris_fill -c ./ventricles.fsmesh /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/ventricles.nii.gz
reading surface from ./ventricles.fsmesh...
writing filled volume to /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/ventricles.nii.gz...

fslswapdim /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/ventricles.nii.gz x z -y /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/ventricles.nii.gz

/home/junhyuk/simnibs_2.1.2/bin/meshfix /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/cerebellum.stl --no-clean --fsmesh -o cerebellum.fsmesh

mris_transform --dst ../ref_FS.nii.gz --src ../ref_FS.nii.gz ./cerebellum.fsmesh ../unity.xfm ./cerebellum.fsmesh
Reading dst volume...
Reading src volume...

mris_fill -c ./cerebellum.fsmesh /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/cerebellum.nii.gz
reading surface from ./cerebellum.fsmesh...
writing filled volume to /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/cerebellum.nii.gz...

fslswapdim /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/cerebellum.nii.gz x z -y /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/cerebellum.nii.gz

cd /mnt/Research/simnibs/test2/SPR06
 
==============================
==> --head: Preparing CSF, skull and skin surfaces ...
==============================

cd /mnt/Research/simnibs/test2/SPR06/m2m_SPR06
 
==============================
==> Coregistering images to T1fs_conform ...
==============================

fslswapdim T1fs_roi x -z y tmp/T1fs_roi_FS

mri_nu_correct.mni --n 1 --proto-iters 1000 --distance 50 --no-rescale --i tmp/T1fs_roi_FS.nii.gz --o tmp/T1fs_nu_roi.nii.gz

fslswapdim tmp/T1fs_nu_roi x z -y tmp/T1fs_nu_roi

fslmaths T1fs_roi -bin -s 1 tmp/T1fs_roi-mask

flirt -dof 12 -in /usr/share/fsl/5.0/data/standard/MNI152_T1_1mm.nii.gz -ref T1fs_nu_conform -omat tmp/MNI2conform_forbet.mat

convert_xfm -omat tmp/Conform2MNI.mat -inverse tmp/MNI2conform_forbet.mat

cd /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp
 
==============================
==> Get CSF mask from T1fs and T2fs ...
==============================

bet T1fs_nu_roi T1fs_conform_betted -e -m -g -0.2

betsurf --t1only -m -o /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/T1fs_roi T1fs_conform_betted_mesh.vtk Conform2MNI.mat csf_raw

mv csf_raw_inskull_mask.nii.gz csf_raw.nii.gz

imcp csf_raw /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/mask_prep/csf_raw

fslmaths /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/gm.nii.gz -dilM -bin gm_large.nii.gz

fslmaths /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/cerebellum.nii.gz -dilM -add gm_large.nii.gz -bin brain_large.nii.gz

fslmaths csf_raw.nii.gz -add brain_large.nii.gz -bin csf_raw.nii.gz

fslswapdim csf_raw.nii.gz x -z y csf_FS.nii.gz

mri_convert -odt uchar ./csf_FS.nii.gz ./csf_FS.nii.gz

mri_tessellate ./csf_FS.nii.gz 255 ./csf_FS.fsmesh

mris_smooth -n 5 ./csf_FS.fsmesh ./csf_FS.fsmesh
smoothing for 5 iterations
smoothing surface tessellation for 5 iterations...
smoothing complete - recomputing first and second fundamental forms...
writing smoothed curvature to ./rh.curv
writing smoothed area to ./rh.area

mris_convert ./csf_FS.fsmesh ./csf_FS.stl

/home/junhyuk/simnibs_2.1.2/bin/meshfix csf_FS.stl -a 2.0 -u 5 --vertices 60000 -q -o csf.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix csf.off -a 2.0 -q -o csf.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix csf.off -a 2.0 -u 1 -q -o csf.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix csf.off -a 2.0 -q -o csf.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix csf.off --stl -q -o /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/csf.stl

/home/junhyuk/simnibs_2.1.2/bin/meshfix /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/csf.stl --no-clean --fsmesh -o csf.fsmesh

mris_transform --dst ../ref_FS.nii.gz --src ../ref_FS.nii.gz ./csf.fsmesh ../unity.xfm ./csf.fsmesh
Reading dst volume...
Reading src volume...

mris_fill -r 0.5 -c ./csf.fsmesh /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/csf.nii.gz
reading surface from ./csf.fsmesh...
writing filled volume to /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/csf.nii.gz...

fslswapdim /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/csf.nii.gz x z -y /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/csf.nii.gz
 
==============================
==> Get skull mask from T1 and T2 ...
==============================

mv csf_raw_outskull_mask.nii.gz skull_raw.nii.gz

imcp skull_raw /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/mask_prep/skull_raw

fslmaths /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/csf.nii.gz -dilM -bin csf_large.nii.gz

fslmaths skull_raw.nii.gz -add csf_large.nii.gz -bin skull_raw.nii.gz

fslswapdim skull_raw.nii.gz x -z y skull_FS.nii.gz

mri_convert -odt uchar ./skull_FS.nii.gz ./skull_FS.nii.gz

mri_tessellate ./skull_FS.nii.gz 255 ./skull_FS.fsmesh

mris_smooth -n 5 ./skull_FS.fsmesh ./skull_FS.fsmesh
smoothing for 5 iterations
smoothing surface tessellation for 5 iterations...
smoothing complete - recomputing first and second fundamental forms...
writing smoothed curvature to ./rh.curv
writing smoothed area to ./rh.area

mris_convert ./skull_FS.fsmesh ./skull_FS.stl

/home/junhyuk/simnibs_2.1.2/bin/meshfix skull_FS.stl -a 2.0 -u 5 --vertices 60000 -q -o skull.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix skull.off -a 2.0 -q -o skull.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix skull.off -a 2.0 -u 1 -q -o skull.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix skull.off -a 2.0 -q -o skull.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix skull.off --stl -q -o /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/skull.stl

/home/junhyuk/simnibs_2.1.2/bin/meshfix /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/skull.stl --no-clean --fsmesh -o skull.fsmesh

mris_transform --dst ../ref_FS.nii.gz --src ../ref_FS.nii.gz ./skull.fsmesh ../unity.xfm ./skull.fsmesh
Reading dst volume...
Reading src volume...

mris_fill -r 0.5 -c ./skull.fsmesh /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/skull.nii.gz
reading surface from ./skull.fsmesh...
writing filled volume to /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/skull.nii.gz...

fslswapdim /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/skull.nii.gz x z -y /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/skull.nii.gz
 
==============================
==> Get skin mask from T1 and T2 ...
==============================

mv csf_raw_outskin_mask.nii.gz skin_raw.nii.gz

fslmaths skin_raw -sub /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/skull -bin -mul /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/T1fs_nu_conform skin_estimate

echo Threshold for skin 20.000000

fslmaths /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/skull.nii.gz -dilM -bin skull_large.nii.gz

fslmaths /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/T1fs_nu_conform -s 1 -thr 20.000000 -add skin_raw.nii.gz -add skull_large.nii.gz -bin skin_raw.nii.gz

fslmaths skin_raw -ero -ero skin_raw_ero

cluster --in=skin_raw_ero --thresh=0.5 --no_table --osize=skin_raw_ero

fslmaths skin_raw_ero -thr 2888298.000000 -bin skin_raw_ero

fslmaths skin_raw_ero -dilM -dilM -dilM -dilM -mul skin_raw -bin -fillh skin_raw

fslmaths /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/T1fs_nu_conform -edge T1fs_nu_edge

imcp skin_raw skin_tmp_it1

fslmaths skin_tmp_it1 -s 1 -thr 0.7 -bin skin_tmp_small

fslmaths skin_tmp_it1 -sub skin_tmp_small -mul T1fs_nu_edge skin_tmp_strength

immv skin_tmp_small skin_tmp_it2

fslmaths skin_tmp_it2 -s 1 -thr 0.7 -bin skin_tmp_small

fslmaths skin_tmp_it2 -sub skin_tmp_small -mul T1fs_nu_edge skin_tmp_strength

immv skin_tmp_small skin_tmp_it3

fslmaths skin_tmp_it3 -s 1 -thr 0.7 -bin skin_tmp_small

fslmaths skin_tmp_it3 -sub skin_tmp_small -mul T1fs_nu_edge skin_tmp_strength

immv skin_tmp_small skin_tmp_it4

fslmaths skin_tmp_it4 -s 1 -thr 0.7 -bin skin_tmp_small

fslmaths skin_tmp_it4 -sub skin_tmp_small -mul T1fs_nu_edge skin_tmp_strength

immv skin_tmp_small skin_tmp_it5

fslmaths skin_tmp_it5 -s 1 -thr 0.7 -bin skin_tmp_small

fslmaths skin_tmp_it5 -sub skin_tmp_small -mul T1fs_nu_edge skin_tmp_strength

immv skin_tmp_small skin_tmp_it6

fslmaths skin_tmp_it2 -add skull_large -bin skin_raw

imcp skin_raw /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/mask_prep/skin_raw

fslswapdim skin_raw.nii.gz x -z y skin_FS.nii.gz

mri_convert -odt uchar ./skin_FS.nii.gz ./skin_FS.nii.gz

mri_tessellate ./skin_FS.nii.gz 255 ./skin_FS.fsmesh

mris_smooth -n 5 ./skin_FS.fsmesh ./skin_FS.fsmesh
smoothing for 5 iterations
smoothing surface tessellation for 5 iterations...
smoothing complete - recomputing first and second fundamental forms...
writing smoothed curvature to ./rh.curv
writing smoothed area to ./rh.area

mris_convert ./skin_FS.fsmesh ./skin_FS.stl

/home/junhyuk/simnibs_2.1.2/bin/meshfix skin_FS.stl -q --stl -o skin_FS.stl

/home/junhyuk/simnibs_2.1.2/bin/meshfix skin_FS.stl -a 2.0 -u 5 --vertices 60000 -q -o skin.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix skin.off -a 2.0 -q -o skin.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix skin.off -a 2.0 -u 1 -q -o skin.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix skin.off -a 2.0 -q -o skin.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix skin.off --stl -q -o /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/skin.stl

/home/junhyuk/simnibs_2.1.2/bin/meshfix /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/skin.stl --no-clean --fsmesh -o skin.fsmesh

mris_transform --dst ../ref_FS.nii.gz --src ../ref_FS.nii.gz ./skin.fsmesh ../unity.xfm ./skin.fsmesh
Reading dst volume...
Reading src volume...

mris_fill -r 0.5 -c ./skin.fsmesh /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/skin.nii.gz
reading surface from ./skin.fsmesh...
writing filled volume to /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/skin.nii.gz...

fslswapdim /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/skin.nii.gz x z -y /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/skin.nii.gz

cd /mnt/Research/simnibs/test2/SPR06
 
==============================
==> --vol: Volume meshing ...
==============================

cat

/home/junhyuk/simnibs_2.1.2/bin/gmsh -3 -bin -o SPR06.msh SPR06.geo
error code 139
exiting mri2mesh
</pre></BODY></HTML>
<HTML><HEAD><TITLE>mri2mesh report</TITLE></HEAD><BODY><pre>
 
==============================
==> mri2mesh started  2019. 12. 10. (화) 09:14:04 KST ...
==============================
command line options: --all SPR06 SPR06_T1.nii.gz
 
==============================
==> --brain/--brainf: Preparing GM and WM surfaces ...
==============================
 
==============================
==> skipping recon-all, using previous results to save time! ...
==============================
 
==============================
==> Convert WM and GM hemispheres to STL ...
==============================

mris_convert /mnt/Research/simnibs/test2/SPR06/fs_SPR06/surf/rh.white /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/wm.rh.stl

mris_convert /mnt/Research/simnibs/test2/SPR06/fs_SPR06/surf/rh.pial /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/gm.rh.stl

mris_convert /mnt/Research/simnibs/test2/SPR06/fs_SPR06/surf/lh.white /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/wm.lh.stl

mris_convert /mnt/Research/simnibs/test2/SPR06/fs_SPR06/surf/lh.pial /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/gm.lh.stl

cd /mnt/Research/simnibs/test2/SPR06/m2m_SPR06

cp /home/junhyuk/simnibs_2.1.2/resources/templates/CC_filterkernel.nii.gz /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/.

mri_convert /mnt/Research/simnibs/test2/SPR06/fs_SPR06/mri/orig.mgz /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/T1fs_conform.nii.gz

fslswapdim /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/T1fs_conform.nii.gz x z -y /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/T1fs_conform.nii.gz

cp /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/T1fs_conform.nii.gz /mnt/Research/simnibs/test2/SPR06/SPR06_T1fs_conform.nii.gz

mri_convert /mnt/Research/simnibs/test2/SPR06/fs_SPR06/mri/nu.mgz /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/T1fs_nu_conform.nii.gz

fslswapdim /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/T1fs_nu_conform.nii.gz x z -y /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/T1fs_nu_conform.nii.gz
 
==============================
==> creating subcortical mask for joining the hemispheres ...
==============================

cd /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp

mri_convert /mnt/Research/simnibs/test2/SPR06/fs_SPR06/mri/aparc.a2009s+aseg.mgz ./segmentation-mask.nii.gz

fslswapdim segmentation-mask.nii.gz x z -y segmentation-mask.nii.gz

fslmaths segmentation-mask.nii.gz -thr 251 -uthr 255 -bin CC.nii.gz

fslmaths CC.nii.gz -kernel file CC_filterkernel.nii.gz -fmean CC_filt.nii.gz -odt float

fslmaths CC_filt.nii.gz -thr 0.1 -bin CC_final.nii.gz

cat

fslmaths segmentation-mask.nii.gz -thr 24 -uthr 24 -dilM -bin CSFslab.nii.gz

flirt -in CSFslab.nii.gz -ref CSFslab.nii.gz -applyxfm -init yshift.mat -out CSFslab_shift.nii.gz

fslmaths segmentation-mask.nii.gz -mul 0 -bin subcortical.nii.gz

fslmaths segmentation-mask.nii.gz -thr 4 -uthr 4 -add subcortical.nii.gz -bin subcortical.nii.gz

fslmaths segmentation-mask.nii.gz -thr 10 -uthr 10 -add subcortical.nii.gz -bin subcortical.nii.gz

fslmaths segmentation-mask.nii.gz -thr 14 -uthr 14 -add subcortical.nii.gz -bin subcortical.nii.gz

fslmaths segmentation-mask.nii.gz -thr 24 -uthr 24 -add subcortical.nii.gz -bin subcortical.nii.gz

fslmaths segmentation-mask.nii.gz -thr 28 -uthr 28 -add subcortical.nii.gz -bin subcortical.nii.gz

fslmaths segmentation-mask.nii.gz -thr 31 -uthr 31 -add subcortical.nii.gz -bin subcortical.nii.gz

fslmaths segmentation-mask.nii.gz -thr 43 -uthr 43 -add subcortical.nii.gz -bin subcortical.nii.gz

fslmaths segmentation-mask.nii.gz -thr 49 -uthr 49 -add subcortical.nii.gz -bin subcortical.nii.gz

fslmaths segmentation-mask.nii.gz -thr 60 -uthr 60 -add subcortical.nii.gz -bin subcortical.nii.gz

fslmaths segmentation-mask.nii.gz -thr 63 -uthr 63 -add subcortical.nii.gz -bin subcortical.nii.gz

fslmaths subcortical.nii.gz -add CC_filt.nii.gz -add CSFslab_shift.nii.gz -dilM -ero -bin subcortical.nii.gz

fslswapdim subcortical.nii.gz x -z y subcortical_FS.nii.gz

mri_convert -odt uchar ./subcortical_FS.nii.gz ./subcortical_FS.nii.gz

cp subcortical_FS.nii.gz ../ref_FS.nii.gz

mri_tessellate ./subcortical_FS.nii.gz 255 ./subcortical_FS.fsmesh

mris_smooth -n 5 ./subcortical_FS.fsmesh ./subcortical_FS.fsmesh
smoothing for 5 iterations
smoothing surface tessellation for 5 iterations...
smoothing complete - recomputing first and second fundamental forms...
writing smoothed curvature to ./rh.curv
writing smoothed area to ./rh.area

mris_convert ./subcortical_FS.fsmesh ./subcortical_FS.stl

fslmaths segmentation-mask.nii.gz -thr 85 -uthr 85 -bin opticrad.nii.gz

fslswapdim opticrad.nii.gz x -z y opticrad_FS.nii.gz

mri_convert -odt uchar ./opticrad_FS.nii.gz ./opticrad_FS.nii.gz

mri_tessellate ./opticrad_FS.nii.gz 255 ./opticrad_FS.fsmesh

mris_smooth -n 5 ./opticrad_FS.fsmesh ./opticrad_FS.fsmesh
smoothing for 5 iterations
smoothing surface tessellation for 5 iterations...
smoothing complete - recomputing first and second fundamental forms...
writing smoothed curvature to ./rh.curv
writing smoothed area to ./rh.area

mris_convert ./opticrad_FS.fsmesh ./opticrad_FS.stl

/home/junhyuk/simnibs_2.1.2/bin/meshfix subcortical_FS.stl -a 2.0 --remove-handles -q -o subcortical.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix subcortical.off -a 2.0 -u 5 --vertices 7500 -q -o subcortical.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix subcortical.off -a 2.0 --dilate -1 -q -o subcortical_small

/home/junhyuk/simnibs_2.1.2/bin/meshfix subcortical.off -a 2.0 --dilate -1 -q -o subcortical_small_small

/home/junhyuk/simnibs_2.1.2/bin/meshfix subcortical.off -a 2.0 --dilate 1 -q -o subcortical_large

/home/junhyuk/simnibs_2.1.2/bin/meshfix subcortical_small.off -a 2.0 -u 5 -q -o subcortical_small

/home/junhyuk/simnibs_2.1.2/bin/meshfix opticrad_FS.stl -a 2.0 --remove-handles -q -o opticrad.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix opticrad.off -a 2.0 -u 5 -q -o opticrad.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix opticrad.off -a 2.0 --dilate 1 -q -o opticrad_large

/home/junhyuk/simnibs_2.1.2/bin/meshfix opticrad_large.off -a 2.0 --dilate 1 -q -o opticrad_large
 
==============================
==> preparing wm and gm hemispheres ...
==============================

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm.rh.stl -a 2.0 --remove-handles -q -o wm.rh_fixed

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm.rh_fixed.off -a 2.0 -u 5 --vertices 60000 -q -o wm.rh_fixed

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm.rh_fixed.off -a 2.0 -u 1 -q -o wm.rh_fixed

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm.rh_fixed.off -a 2.0 -q -o wm.rh_fixed

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm.rh.stl -a 2.0 -u 5 --vertices 69000 --remove-handles -q -o gm.rh_fixed
MeshFix failed!
Please try manually using ReMESH: http://remesh.sourceforge.net

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm.rh_fixed.off -a 2.0 -u 5 -q -o gm.rh_fixed

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm.rh_fixed.off -a 2.0 -u 1 -q -o gm.rh_fixed

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm.rh_fixed.off -a 2.0 -q -o gm.rh_fixed

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm.lh.stl -a 2.0 --remove-handles -q -o wm.lh_fixed

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm.lh_fixed.off -a 2.0 -u 5 --vertices 60000 -q -o wm.lh_fixed

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm.lh_fixed.off -a 2.0 -u 1 -q -o wm.lh_fixed

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm.lh_fixed.off -a 2.0 -q -o wm.lh_fixed

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm.lh.stl -a 2.0 -u 5 --vertices 69000 --remove-handles -q -o gm.lh_fixed

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm.lh_fixed.off -a 2.0 -u 5 -q -o gm.lh_fixed

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm.lh_fixed.off -a 2.0 -u 1 -q -o gm.lh_fixed

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm.lh_fixed.off -a 2.0 -q -o gm.lh_fixed

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm.rh_fixed.off opticrad_large.off -a 2.0 --shells 2 --cut-inner 0 -q -o wm.rh_fixed.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm.rh_fixed.off opticrad_large.off -a 2.0 --shells 2 --cut-inner 0 -q -o gm.rh_fixed.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm.lh_fixed.off opticrad_large.off -a 2.0 --shells 2 --cut-inner 0 -q -o wm.lh_fixed.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm.lh_fixed.off opticrad_large.off -a 2.0 --shells 2 --cut-inner 0 -q -o gm.lh_fixed.off
 
==============================
==> joining wm hemispheres ...
==============================

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm.rh_fixed.off subcortical_small.off -a 2.0 --shells 2 -j -o wm.rh_fixed2

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm.rh_fixed2.off wm.lh_fixed.off -a 2.0 --shells 2 -j -o wm_fixed

cp wm_fixed.off wm_fixed2.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm_fixed2.off subcortical_small.off -a 2.0 --shells 2 --decouple-outout 0 -o wm_fixed2.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm_fixed2.off subcortical_small.off -a 2.0 --shells 2 --cut-inner 0 -o wm_fixed2.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm_fixed2.off subcortical.off -a 2.0 --shells 2 --decouple-outout 0 -o wm_fixed2.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm_fixed2.off subcortical.off -a 2.0 --shells 2 --decouple-outout 0 -o wm_fixed2.off
 
==============================
==> joining gm hemispheres ...
==============================

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm.rh_fixed.off subcortical_large.off -a 2.0 --shells 2 -j -o gm.rh_fixed2

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm.rh_fixed2.off gm.lh_fixed.off -a 2.0 --shells 2 -j -o gm_fixed

cp gm_fixed.off gm_fixed2.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed2.off subcortical.off -a 2.0 --shells 2 --decouple-outout 0 -o gm_fixed2.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed2.off subcortical.off -a 2.0 --shells 2 --cut-inner 0 -o gm_fixed2.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed2.off subcortical_large.off -a 2.0 --shells 2 --decouple-outout 0 -o gm_fixed2.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed2.off subcortical_large.off -a 2.0 --shells 2 --decouple-outout 0 -o gm_fixed2.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed2.off subcortical_large.off -a 2.0 --shells 2 --decouple-outout 0 -o gm_fixed2.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed2.off subcortical_large.off -a 2.0 --shells 2 --decouple-outout 0 -o gm_fixed2.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed2.off subcortical_large.off -a 2.0 --shells 2 --decouple-outout 0 -o gm_fixed2.off
 
==============================
==> decoupling final gm from final wm ...
==============================

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed2.off -a 2.0 -u 1 -q -o gm_fixed3.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed3.off -a 2.0 -q -o gm_fixed3.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed3.off -a 2.0 -u 1 -q -o gm_fixed3.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed3.off -a 2.0 -q -o gm_fixed3.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm_fixed2.off -a 2.0 -u 1 -q -o wm_fixed3.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm_fixed3.off -a 2.0 -q -o wm_fixed3.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm_fixed3.off -a 2.0 -u 1 -q -o wm_fixed3.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm_fixed3.off -a 2.0 -q -o wm_fixed3.off

echo ** GM-WM decoupling: Iteration 1 **

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed3.off wm_fixed3.off -a 2.0 --shells 2 --decouple-outout 0 -o gm_fixed3.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed3.off wm_fixed3.off -a 2.0 --shells 2 --decouple-outout 0 -o gm_fixed3.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed3.off wm_fixed3.off -a 2.0 --shells 2 --cut-inner 0 -o gm_fixed3.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed3.off -a 2.0 -u 1 -q -o gm_fixed3.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed3.off -a 2.0 -q -o gm_fixed3.off

echo ** GM-WM decoupling: Iteration 2 **

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed3.off wm_fixed3.off -a 2.0 --shells 2 --decouple-outout 0 -o gm_fixed3.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed3.off wm_fixed3.off -a 2.0 --shells 2 --cut-inner 0 -o gm_fixed3.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed3.off -a 2.0 -u 1 -q -o gm_fixed3.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed3.off -a 2.0 -q -o gm_fixed3.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed3.off gm_fixed3.off --fineTuneOut 0.2 4 --shells 2 -o gm_fixed3.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed3.off -a 2.0 -u 1 -q -o gm_fixed3.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed3.off -a 2.0 -q -o gm_fixed3.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm_fixed3.off gm_fixed3.off --fineTuneIn 0.2 4 --shells 2 -o wm_fixed3.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm_fixed3.off -a 2.0 -u 1 -q -o wm_fixed3.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm_fixed3.off -a 2.0 -q -o wm_fixed3.off

echo Overall iterations needed for preparing WM and GM:1 2 1 5 2

/home/junhyuk/simnibs_2.1.2/bin/meshfix gm_fixed3.off --stl -q -o /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/gm.stl

/home/junhyuk/simnibs_2.1.2/bin/meshfix wm_fixed3.off --stl -q -o /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/wm.stl
 
==============================
==> creating volume masks from final GM and WM surfaces ...
==============================

/home/junhyuk/simnibs_2.1.2/bin/meshfix /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/wm.stl --no-clean --fsmesh -o wm.fsmesh

/home/junhyuk/simnibs_2.1.2/bin/meshfix /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/gm.stl --no-clean --fsmesh -o gm.fsmesh

cat

cp unity.xfm ../unity.xfm

mris_transform --dst ./subcortical_FS.nii.gz --src ./subcortical_FS.nii.gz ./wm.fsmesh ./unity.xfm ./wm.fsmesh
Reading dst volume...
Reading src volume...

mris_transform --dst ./subcortical_FS.nii.gz --src ./subcortical_FS.nii.gz ./gm.fsmesh ./unity.xfm ./gm.fsmesh
Reading dst volume...
Reading src volume...

mris_fill -c ./wm.fsmesh /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/wm.nii.gz
reading surface from ./wm.fsmesh...
writing filled volume to /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/wm.nii.gz...

mris_fill -c ./gm.fsmesh /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/gm.nii.gz
reading surface from ./gm.fsmesh...
writing filled volume to /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/gm.nii.gz...

fslswapdim /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/wm.nii.gz x z -y /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/wm.nii.gz

fslswapdim /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/gm.nii.gz x z -y /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/gm.nii.gz

cd /mnt/Research/simnibs/test2/SPR06
 
==============================
==> --subcort: Preparing ventricles surface and cerebellum/brainstem surface ...
==============================

cd /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp
 
==============================
==> creating ventricles mask ...
==============================

mri_convert /mnt/Research/simnibs/test2/SPR06/fs_SPR06/mri/aparc.a2009s+aseg.mgz ./segmentation-mask.nii.gz

fslswapdim segmentation-mask.nii.gz x z -y segmentation-mask.nii.gz

fslmaths segmentation-mask.nii.gz -mul 0 -bin ventricles_raw.nii.gz

fslmaths segmentation-mask.nii.gz -thr 4 -uthr 4 -add ventricles_raw.nii.gz -bin ventricles_raw.nii.gz

fslmaths segmentation-mask.nii.gz -thr 5 -uthr 5 -add ventricles_raw.nii.gz -bin ventricles_raw.nii.gz

fslmaths segmentation-mask.nii.gz -thr 14 -uthr 14 -add ventricles_raw.nii.gz -bin ventricles_raw.nii.gz

fslmaths segmentation-mask.nii.gz -thr 24 -uthr 24 -add ventricles_raw.nii.gz -bin ventricles_raw.nii.gz

fslmaths segmentation-mask.nii.gz -thr 31 -uthr 31 -add ventricles_raw.nii.gz -bin ventricles_raw.nii.gz

fslmaths segmentation-mask.nii.gz -thr 43 -uthr 43 -add ventricles_raw.nii.gz -bin ventricles_raw.nii.gz

fslmaths segmentation-mask.nii.gz -thr 44 -uthr 44 -add ventricles_raw.nii.gz -bin ventricles_raw.nii.gz

fslmaths segmentation-mask.nii.gz -thr 63 -uthr 63 -add ventricles_raw.nii.gz -bin ventricles_raw.nii.gz

fslmaths ventricles_raw.nii.gz -dilM -ero -bin ventricles_raw.nii.gz

imcp ventricles_raw /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/mask_prep/ventricles_raw

fslmaths /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/wm.nii.gz -ero -bin wm_small.nii.gz

fslmaths ventricles_raw.nii.gz -mul wm_small.nii.gz -bin ventricles_raw.nii.gz

fslswapdim ventricles_raw.nii.gz x -z y ventricles_FS.nii.gz

mri_convert -odt uchar ./ventricles_FS.nii.gz ./ventricles_FS.nii.gz

mri_tessellate ./ventricles_FS.nii.gz 255 ./ventricles_FS.fsmesh

mris_smooth -n 5 ./ventricles_FS.fsmesh ./ventricles_FS.fsmesh
smoothing for 5 iterations
smoothing surface tessellation for 5 iterations...
smoothing complete - recomputing first and second fundamental forms...
writing smoothed curvature to ./rh.curv
writing smoothed area to ./rh.area

mris_convert ./ventricles_FS.fsmesh ./ventricles_FS.stl

/home/junhyuk/simnibs_2.1.2/bin/meshfix ventricles_FS.stl -a 2.0 -q -o ventricles.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix ventricles.off -a 2.0 -u 5 --vertices 7500 -q -o ventricles.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix ventricles.off -a 2.0 --smooth 1 -q -o ventricles.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix ventricles.off -a 2.0 -u 5 -q -o ventricles.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix ventricles.off -a 2.0 -q -o ventricles.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix ventricles.off -a 2.0 -u 1 -q -o ventricles.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix ventricles.off -a 2.0 -q -o ventricles.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix ventricles.off --stl -q -o /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/ventricles.stl
 
==============================
==> creating brainstem and cerebellum mask ...
==============================

fslmaths segmentation-mask.nii.gz -mul 0 -bin cerebellum_raw.nii.gz

fslmaths segmentation-mask.nii.gz -thr 7 -uthr 7 -add cerebellum_raw.nii.gz -bin cerebellum_raw.nii.gz

fslmaths segmentation-mask.nii.gz -thr 8 -uthr 8 -add cerebellum_raw.nii.gz -bin cerebellum_raw.nii.gz

fslmaths segmentation-mask.nii.gz -thr 16 -uthr 16 -add cerebellum_raw.nii.gz -bin cerebellum_raw.nii.gz

fslmaths segmentation-mask.nii.gz -thr 46 -uthr 46 -add cerebellum_raw.nii.gz -bin cerebellum_raw.nii.gz

fslmaths segmentation-mask.nii.gz -thr 47 -uthr 47 -add cerebellum_raw.nii.gz -bin cerebellum_raw.nii.gz

fslmaths cerebellum_raw -bin cerebellum_raw

imcp cerebellum_raw /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/mask_prep/cerebellum_raw

fslmaths /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/gm.nii.gz -dilM -bin gm_large.nii.gz

fslmaths cerebellum_raw.nii.gz -sub gm_large.nii.gz -bin cerebellum_raw.nii.gz

fslmaths cerebellum_raw.nii.gz -ero -dilM -bin cerebellum_raw.nii.gz

fslswapdim cerebellum_raw.nii.gz x -z y cerebellum_FS.nii.gz

mri_convert -odt uchar ./cerebellum_FS.nii.gz ./cerebellum_FS.nii.gz

mri_tessellate ./cerebellum_FS.nii.gz 255 ./cerebellum_FS.fsmesh

mris_smooth -n 5 ./cerebellum_FS.fsmesh ./cerebellum_FS.fsmesh
smoothing for 5 iterations
smoothing surface tessellation for 5 iterations...
smoothing complete - recomputing first and second fundamental forms...
writing smoothed curvature to ./rh.curv
writing smoothed area to ./rh.area

mris_convert ./cerebellum_FS.fsmesh ./cerebellum_FS.stl

/home/junhyuk/simnibs_2.1.2/bin/meshfix cerebellum_FS.stl --no-clean -q -o cerebellum.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix cerebellum.off -a 2.0 -q -o cerebellum.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix cerebellum.off -a 2.0 -u 5 --vertices 8571 -q -o cerebellum.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix cerebellum.off -a 2.0 -q -o cerebellum.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix cerebellum.off -a 2.0 -u 1 -q -o cerebellum.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix cerebellum.off -a 2.0 -q -o cerebellum.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix cerebellum.off --stl -q -o /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/cerebellum.stl
 
==============================
==> creating volume masks from final ventricles and cerebellum surfaces ...
==============================

/home/junhyuk/simnibs_2.1.2/bin/meshfix /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/ventricles.stl --no-clean --fsmesh -o ventricles.fsmesh

mris_transform --dst ../ref_FS.nii.gz --src ../ref_FS.nii.gz ./ventricles.fsmesh ../unity.xfm ./ventricles.fsmesh
Reading dst volume...
Reading src volume...

mris_fill -c ./ventricles.fsmesh /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/ventricles.nii.gz
reading surface from ./ventricles.fsmesh...
writing filled volume to /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/ventricles.nii.gz...

fslswapdim /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/ventricles.nii.gz x z -y /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/ventricles.nii.gz

/home/junhyuk/simnibs_2.1.2/bin/meshfix /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/cerebellum.stl --no-clean --fsmesh -o cerebellum.fsmesh

mris_transform --dst ../ref_FS.nii.gz --src ../ref_FS.nii.gz ./cerebellum.fsmesh ../unity.xfm ./cerebellum.fsmesh
Reading dst volume...
Reading src volume...

mris_fill -c ./cerebellum.fsmesh /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/cerebellum.nii.gz
reading surface from ./cerebellum.fsmesh...
writing filled volume to /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/cerebellum.nii.gz...

fslswapdim /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/cerebellum.nii.gz x z -y /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/cerebellum.nii.gz

cd /mnt/Research/simnibs/test2/SPR06
 
==============================
==> --head: Preparing CSF, skull and skin surfaces ...
==============================

cd /mnt/Research/simnibs/test2/SPR06/m2m_SPR06
 
==============================
==> Coregistering images to T1fs_conform ...
==============================

fslswapdim T1fs_roi x -z y tmp/T1fs_roi_FS

mri_nu_correct.mni --n 1 --proto-iters 1000 --distance 50 --no-rescale --i tmp/T1fs_roi_FS.nii.gz --o tmp/T1fs_nu_roi.nii.gz

fslswapdim tmp/T1fs_nu_roi x z -y tmp/T1fs_nu_roi

fslmaths T1fs_roi -bin -s 1 tmp/T1fs_roi-mask

flirt -dof 12 -in /usr/share/fsl/5.0/data/standard/MNI152_T1_1mm.nii.gz -ref T1fs_nu_conform -omat tmp/MNI2conform_forbet.mat

convert_xfm -omat tmp/Conform2MNI.mat -inverse tmp/MNI2conform_forbet.mat

cd /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp
 
==============================
==> Get CSF mask from T1fs and T2fs ...
==============================

bet T1fs_nu_roi T1fs_conform_betted -e -m -g -0.2

betsurf --t1only -m -o /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/T1fs_roi T1fs_conform_betted_mesh.vtk Conform2MNI.mat csf_raw

mv csf_raw_inskull_mask.nii.gz csf_raw.nii.gz

imcp csf_raw /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/mask_prep/csf_raw

fslmaths /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/gm.nii.gz -dilM -bin gm_large.nii.gz

fslmaths /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/cerebellum.nii.gz -dilM -add gm_large.nii.gz -bin brain_large.nii.gz

fslmaths csf_raw.nii.gz -add brain_large.nii.gz -bin csf_raw.nii.gz

fslswapdim csf_raw.nii.gz x -z y csf_FS.nii.gz

mri_convert -odt uchar ./csf_FS.nii.gz ./csf_FS.nii.gz

mri_tessellate ./csf_FS.nii.gz 255 ./csf_FS.fsmesh

mris_smooth -n 5 ./csf_FS.fsmesh ./csf_FS.fsmesh
smoothing for 5 iterations
smoothing surface tessellation for 5 iterations...
smoothing complete - recomputing first and second fundamental forms...
writing smoothed curvature to ./rh.curv
writing smoothed area to ./rh.area

mris_convert ./csf_FS.fsmesh ./csf_FS.stl

/home/junhyuk/simnibs_2.1.2/bin/meshfix csf_FS.stl -a 2.0 -u 5 --vertices 60000 -q -o csf.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix csf.off -a 2.0 -q -o csf.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix csf.off -a 2.0 -u 1 -q -o csf.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix csf.off -a 2.0 -q -o csf.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix csf.off --stl -q -o /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/csf.stl

/home/junhyuk/simnibs_2.1.2/bin/meshfix /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/csf.stl --no-clean --fsmesh -o csf.fsmesh

mris_transform --dst ../ref_FS.nii.gz --src ../ref_FS.nii.gz ./csf.fsmesh ../unity.xfm ./csf.fsmesh
Reading dst volume...
Reading src volume...

mris_fill -r 0.5 -c ./csf.fsmesh /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/csf.nii.gz
reading surface from ./csf.fsmesh...
writing filled volume to /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/csf.nii.gz...

fslswapdim /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/csf.nii.gz x z -y /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/csf.nii.gz
 
==============================
==> Get skull mask from T1 and T2 ...
==============================

mv csf_raw_outskull_mask.nii.gz skull_raw.nii.gz

imcp skull_raw /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/mask_prep/skull_raw

fslmaths /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/csf.nii.gz -dilM -bin csf_large.nii.gz

fslmaths skull_raw.nii.gz -add csf_large.nii.gz -bin skull_raw.nii.gz

fslswapdim skull_raw.nii.gz x -z y skull_FS.nii.gz

mri_convert -odt uchar ./skull_FS.nii.gz ./skull_FS.nii.gz

mri_tessellate ./skull_FS.nii.gz 255 ./skull_FS.fsmesh

mris_smooth -n 5 ./skull_FS.fsmesh ./skull_FS.fsmesh
smoothing for 5 iterations
smoothing surface tessellation for 5 iterations...
smoothing complete - recomputing first and second fundamental forms...
writing smoothed curvature to ./rh.curv
writing smoothed area to ./rh.area

mris_convert ./skull_FS.fsmesh ./skull_FS.stl

/home/junhyuk/simnibs_2.1.2/bin/meshfix skull_FS.stl -a 2.0 -u 5 --vertices 60000 -q -o skull.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix skull.off -a 2.0 -q -o skull.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix skull.off -a 2.0 -u 1 -q -o skull.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix skull.off -a 2.0 -q -o skull.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix skull.off --stl -q -o /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/skull.stl

/home/junhyuk/simnibs_2.1.2/bin/meshfix /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/skull.stl --no-clean --fsmesh -o skull.fsmesh

mris_transform --dst ../ref_FS.nii.gz --src ../ref_FS.nii.gz ./skull.fsmesh ../unity.xfm ./skull.fsmesh
Reading dst volume...
Reading src volume...

mris_fill -r 0.5 -c ./skull.fsmesh /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/skull.nii.gz
reading surface from ./skull.fsmesh...
writing filled volume to /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/skull.nii.gz...

fslswapdim /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/skull.nii.gz x z -y /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/skull.nii.gz
 
==============================
==> Get skin mask from T1 and T2 ...
==============================

mv csf_raw_outskin_mask.nii.gz skin_raw.nii.gz

fslmaths skin_raw -sub /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/skull -bin -mul /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/T1fs_nu_conform skin_estimate

echo Threshold for skin 20.000000

fslmaths /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/skull.nii.gz -dilM -bin skull_large.nii.gz

fslmaths /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/T1fs_nu_conform -s 1 -thr 20.000000 -add skin_raw.nii.gz -add skull_large.nii.gz -bin skin_raw.nii.gz

fslmaths skin_raw -ero -ero skin_raw_ero

cluster --in=skin_raw_ero --thresh=0.5 --no_table --osize=skin_raw_ero

fslmaths skin_raw_ero -thr 2888298.000000 -bin skin_raw_ero

fslmaths skin_raw_ero -dilM -dilM -dilM -dilM -mul skin_raw -bin -fillh skin_raw

fslmaths /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/T1fs_nu_conform -edge T1fs_nu_edge

imcp skin_raw skin_tmp_it1

fslmaths skin_tmp_it1 -s 1 -thr 0.7 -bin skin_tmp_small

fslmaths skin_tmp_it1 -sub skin_tmp_small -mul T1fs_nu_edge skin_tmp_strength

immv skin_tmp_small skin_tmp_it2

fslmaths skin_tmp_it2 -s 1 -thr 0.7 -bin skin_tmp_small

fslmaths skin_tmp_it2 -sub skin_tmp_small -mul T1fs_nu_edge skin_tmp_strength

immv skin_tmp_small skin_tmp_it3

fslmaths skin_tmp_it3 -s 1 -thr 0.7 -bin skin_tmp_small

fslmaths skin_tmp_it3 -sub skin_tmp_small -mul T1fs_nu_edge skin_tmp_strength

immv skin_tmp_small skin_tmp_it4

fslmaths skin_tmp_it4 -s 1 -thr 0.7 -bin skin_tmp_small

fslmaths skin_tmp_it4 -sub skin_tmp_small -mul T1fs_nu_edge skin_tmp_strength

immv skin_tmp_small skin_tmp_it5

fslmaths skin_tmp_it5 -s 1 -thr 0.7 -bin skin_tmp_small

fslmaths skin_tmp_it5 -sub skin_tmp_small -mul T1fs_nu_edge skin_tmp_strength

immv skin_tmp_small skin_tmp_it6

fslmaths skin_tmp_it2 -add skull_large -bin skin_raw

imcp skin_raw /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/mask_prep/skin_raw

fslswapdim skin_raw.nii.gz x -z y skin_FS.nii.gz

mri_convert -odt uchar ./skin_FS.nii.gz ./skin_FS.nii.gz

mri_tessellate ./skin_FS.nii.gz 255 ./skin_FS.fsmesh

mris_smooth -n 5 ./skin_FS.fsmesh ./skin_FS.fsmesh
smoothing for 5 iterations
smoothing surface tessellation for 5 iterations...
smoothing complete - recomputing first and second fundamental forms...
writing smoothed curvature to ./rh.curv
writing smoothed area to ./rh.area

mris_convert ./skin_FS.fsmesh ./skin_FS.stl

/home/junhyuk/simnibs_2.1.2/bin/meshfix skin_FS.stl -q --stl -o skin_FS.stl

/home/junhyuk/simnibs_2.1.2/bin/meshfix skin_FS.stl -a 2.0 -u 5 --vertices 60000 -q -o skin.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix skin.off -a 2.0 -q -o skin.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix skin.off -a 2.0 -u 1 -q -o skin.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix skin.off -a 2.0 -q -o skin.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix skin.off --stl -q -o /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/skin.stl

/home/junhyuk/simnibs_2.1.2/bin/meshfix /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/skin.stl --no-clean --fsmesh -o skin.fsmesh

mris_transform --dst ../ref_FS.nii.gz --src ../ref_FS.nii.gz ./skin.fsmesh ../unity.xfm ./skin.fsmesh
Reading dst volume...
Reading src volume...

mris_fill -r 0.5 -c ./skin.fsmesh /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/skin.nii.gz
reading surface from ./skin.fsmesh...
writing filled volume to /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/skin.nii.gz...

fslswapdim /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/skin.nii.gz x z -y /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/skin.nii.gz

cd /mnt/Research/simnibs/test2/SPR06
 
==============================
==> --vol: Volume meshing ...
==============================

cat

/home/junhyuk/simnibs_2.1.2/bin/gmsh -3 -bin -o SPR06.msh SPR06.geo
error code 139
exiting mri2mesh
</pre></BODY></HTML>
<HTML><HEAD><TITLE>mri2mesh report</TITLE></HEAD><BODY><pre>
 
==============================
==> mri2mesh started  2019. 12. 10. (화) 12:35:56 KST ...
==============================
command line options: --all SPR06 SPR06_T1.nii.gz
 
==============================
==> --brain/--brainf: Preparing GM and WM surfaces ...
==============================
 
==============================
==> skipping recon-all, using previous results to save time! ...
==============================
 
==============================
==> Convert WM and GM hemispheres to STL ...
==============================

mris_convert /mnt/Research/simnibs/test2/SPR06/fs_SPR06/surf/rh.white /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/wm.rh.stl
<HTML><HEAD><TITLE>mri2mesh report</TITLE></HEAD><BODY><pre>
 
==============================
==> mri2mesh started  2019. 12. 10. (화) 12:36:02 KST ...
==============================
command line options: --head SPR06 SPR06_T1.nii.gz
 
==============================
==> --head: Preparing CSF, skull and skin surfaces ...
==============================

cd /mnt/Research/simnibs/test2/SPR06/m2m_SPR06
 
==============================
==> Coregistering images to T1fs_conform ...
==============================

fslswapdim T1fs_roi x -z y tmp/T1fs_roi_FS

mri_nu_correct.mni --n 1 --proto-iters 1000 --distance 50 --no-rescale --i tmp/T1fs_roi_FS.nii.gz --o tmp/T1fs_nu_roi.nii.gz

fslswapdim tmp/T1fs_nu_roi x z -y tmp/T1fs_nu_roi

fslmaths T1fs_roi -bin -s 1 tmp/T1fs_roi-mask

flirt -dof 12 -in /usr/share/fsl/5.0/data/standard/MNI152_T1_1mm.nii.gz -ref T1fs_nu_conform -omat tmp/MNI2conform_forbet.mat

convert_xfm -omat tmp/Conform2MNI.mat -inverse tmp/MNI2conform_forbet.mat

cd /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp
 
==============================
==> Get CSF mask from T1fs and T2fs ...
==============================

bet T1fs_nu_roi T1fs_conform_betted -e -m -g -0.2

betsurf --t1only -m -o /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/T1fs_roi T1fs_conform_betted_mesh.vtk Conform2MNI.mat csf_raw

mv csf_raw_inskull_mask.nii.gz csf_raw.nii.gz

imcp csf_raw /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/mask_prep/csf_raw

fslmaths /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/gm.nii.gz -dilM -bin gm_large.nii.gz

fslmaths /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/cerebellum.nii.gz -dilM -add gm_large.nii.gz -bin brain_large.nii.gz

fslmaths csf_raw.nii.gz -add brain_large.nii.gz -bin csf_raw.nii.gz

fslswapdim csf_raw.nii.gz x -z y csf_FS.nii.gz

mri_convert -odt uchar ./csf_FS.nii.gz ./csf_FS.nii.gz

mri_tessellate ./csf_FS.nii.gz 255 ./csf_FS.fsmesh

mris_smooth -n 5 ./csf_FS.fsmesh ./csf_FS.fsmesh
smoothing for 5 iterations
smoothing surface tessellation for 5 iterations...
smoothing complete - recomputing first and second fundamental forms...
writing smoothed curvature to ./rh.curv
writing smoothed area to ./rh.area

mris_convert ./csf_FS.fsmesh ./csf_FS.stl

/home/junhyuk/simnibs_2.1.2/bin/meshfix csf_FS.stl -a 2.0 -u 5 --vertices 60000 -q -o csf.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix csf.off -a 2.0 -q -o csf.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix csf.off -a 2.0 -u 1 -q -o csf.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix csf.off -a 2.0 -q -o csf.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix csf.off --stl -q -o /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/csf.stl

/home/junhyuk/simnibs_2.1.2/bin/meshfix /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/csf.stl --no-clean --fsmesh -o csf.fsmesh

mris_transform --dst ../ref_FS.nii.gz --src ../ref_FS.nii.gz ./csf.fsmesh ../unity.xfm ./csf.fsmesh
Reading dst volume...
Reading src volume...

mris_fill -r 0.5 -c ./csf.fsmesh /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/csf.nii.gz
reading surface from ./csf.fsmesh...
writing filled volume to /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/csf.nii.gz...

fslswapdim /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/csf.nii.gz x z -y /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/csf.nii.gz
 
==============================
==> Get skull mask from T1 and T2 ...
==============================

mv csf_raw_outskull_mask.nii.gz skull_raw.nii.gz

imcp skull_raw /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/mask_prep/skull_raw

fslmaths /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/csf.nii.gz -dilM -bin csf_large.nii.gz

fslmaths skull_raw.nii.gz -add csf_large.nii.gz -bin skull_raw.nii.gz

fslswapdim skull_raw.nii.gz x -z y skull_FS.nii.gz

mri_convert -odt uchar ./skull_FS.nii.gz ./skull_FS.nii.gz

mri_tessellate ./skull_FS.nii.gz 255 ./skull_FS.fsmesh

mris_smooth -n 5 ./skull_FS.fsmesh ./skull_FS.fsmesh
smoothing for 5 iterations
smoothing surface tessellation for 5 iterations...
smoothing complete - recomputing first and second fundamental forms...
writing smoothed curvature to ./rh.curv
writing smoothed area to ./rh.area

mris_convert ./skull_FS.fsmesh ./skull_FS.stl

/home/junhyuk/simnibs_2.1.2/bin/meshfix skull_FS.stl -a 2.0 -u 5 --vertices 60000 -q -o skull.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix skull.off -a 2.0 -q -o skull.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix skull.off -a 2.0 -u 1 -q -o skull.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix skull.off -a 2.0 -q -o skull.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix skull.off --stl -q -o /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/skull.stl

/home/junhyuk/simnibs_2.1.2/bin/meshfix /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/skull.stl --no-clean --fsmesh -o skull.fsmesh

mris_transform --dst ../ref_FS.nii.gz --src ../ref_FS.nii.gz ./skull.fsmesh ../unity.xfm ./skull.fsmesh
Reading dst volume...
Reading src volume...

mris_fill -r 0.5 -c ./skull.fsmesh /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/skull.nii.gz
reading surface from ./skull.fsmesh...
writing filled volume to /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/skull.nii.gz...

fslswapdim /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/skull.nii.gz x z -y /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/skull.nii.gz
 
==============================
==> Get skin mask from T1 and T2 ...
==============================

mv csf_raw_outskin_mask.nii.gz skin_raw.nii.gz

fslmaths skin_raw -sub /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/skull -bin -mul /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/T1fs_nu_conform skin_estimate

echo Threshold for skin 20.000000

fslmaths /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/skull.nii.gz -dilM -bin skull_large.nii.gz

fslmaths /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/T1fs_nu_conform -s 1 -thr 20.000000 -add skin_raw.nii.gz -add skull_large.nii.gz -bin skin_raw.nii.gz

fslmaths skin_raw -ero -ero skin_raw_ero

cluster --in=skin_raw_ero --thresh=0.5 --no_table --osize=skin_raw_ero

fslmaths skin_raw_ero -thr 2888298.000000 -bin skin_raw_ero

fslmaths skin_raw_ero -dilM -dilM -dilM -dilM -mul skin_raw -bin -fillh skin_raw

fslmaths /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/T1fs_nu_conform -edge T1fs_nu_edge

imcp skin_raw skin_tmp_it1

fslmaths skin_tmp_it1 -s 1 -thr 0.7 -bin skin_tmp_small

fslmaths skin_tmp_it1 -sub skin_tmp_small -mul T1fs_nu_edge skin_tmp_strength

immv skin_tmp_small skin_tmp_it2

fslmaths skin_tmp_it2 -s 1 -thr 0.7 -bin skin_tmp_small

fslmaths skin_tmp_it2 -sub skin_tmp_small -mul T1fs_nu_edge skin_tmp_strength

immv skin_tmp_small skin_tmp_it3

fslmaths skin_tmp_it3 -s 1 -thr 0.7 -bin skin_tmp_small

fslmaths skin_tmp_it3 -sub skin_tmp_small -mul T1fs_nu_edge skin_tmp_strength

immv skin_tmp_small skin_tmp_it4

fslmaths skin_tmp_it4 -s 1 -thr 0.7 -bin skin_tmp_small

fslmaths skin_tmp_it4 -sub skin_tmp_small -mul T1fs_nu_edge skin_tmp_strength

immv skin_tmp_small skin_tmp_it5

fslmaths skin_tmp_it5 -s 1 -thr 0.7 -bin skin_tmp_small

fslmaths skin_tmp_it5 -sub skin_tmp_small -mul T1fs_nu_edge skin_tmp_strength

immv skin_tmp_small skin_tmp_it6

fslmaths skin_tmp_it2 -add skull_large -bin skin_raw

imcp skin_raw /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/mask_prep/skin_raw

fslswapdim skin_raw.nii.gz x -z y skin_FS.nii.gz

mri_convert -odt uchar ./skin_FS.nii.gz ./skin_FS.nii.gz

mri_tessellate ./skin_FS.nii.gz 255 ./skin_FS.fsmesh

mris_smooth -n 5 ./skin_FS.fsmesh ./skin_FS.fsmesh
smoothing for 5 iterations
smoothing surface tessellation for 5 iterations...
smoothing complete - recomputing first and second fundamental forms...
writing smoothed curvature to ./rh.curv
writing smoothed area to ./rh.area

mris_convert ./skin_FS.fsmesh ./skin_FS.stl

/home/junhyuk/simnibs_2.1.2/bin/meshfix skin_FS.stl -q --stl -o skin_FS.stl

/home/junhyuk/simnibs_2.1.2/bin/meshfix skin_FS.stl -a 2.0 -u 5 --vertices 60000 -q -o skin.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix skin.off -a 2.0 -q -o skin.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix skin.off -a 2.0 -u 1 -q -o skin.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix skin.off -a 2.0 -q -o skin.off

/home/junhyuk/simnibs_2.1.2/bin/meshfix skin.off --stl -q -o /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/skin.stl

/home/junhyuk/simnibs_2.1.2/bin/meshfix /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/skin.stl --no-clean --fsmesh -o skin.fsmesh

mris_transform --dst ../ref_FS.nii.gz --src ../ref_FS.nii.gz ./skin.fsmesh ../unity.xfm ./skin.fsmesh
Reading dst volume...
Reading src volume...

mris_fill -r 0.5 -c ./skin.fsmesh /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/skin.nii.gz
reading surface from ./skin.fsmesh...
writing filled volume to /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/skin.nii.gz...

fslswapdim /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/skin.nii.gz x z -y /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/skin.nii.gz

cd /mnt/Research/simnibs/test2/SPR06
 
==============================
==> Cleanup: deleting intermediate files ...
==============================

rm /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/CC.nii.gz /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/CC_filt.nii.gz /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/CC_filterkernel.nii.gz /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/CC_final.nii.gz /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/CSFslab.nii.gz /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/CSFslab_shift.nii.gz /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/Conform2MNI.mat /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/MNI2conform_forbet.mat /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/MNIfs_reg.nii.gz /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/T1fs_conform_betted.nii.gz /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/T1fs_conform_betted_mask.nii.gz /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/T1fs_conform_betted_mesh.vtk /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/T1fs_nu_edge.nii.gz /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/T1fs_nu_roi.nii.gz /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/T1fs_roi-mask.nii.gz /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/T1fs_roi_FS.nii.gz /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/brain_large.nii.gz /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/cerebellum.fsmesh /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/cerebellum.off /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/cerebellum_FS.fsmesh /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/cerebellum_FS.nii.gz /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/cerebellum_FS.stl /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/cerebellum_raw.nii.gz /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/csf.fsmesh /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/csf.off /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/csf_FS.fsmesh /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/csf_FS.nii.gz /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/csf_FS.stl /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/csf_large.nii.gz /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/csf_raw.nii.gz /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/csf_raw_inskull_mesh.nii.gz /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/csf_raw_inskull_mesh.off /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/csf_raw_outskin_mesh.nii.gz /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/csf_raw_outskin_mesh.off /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/csf_raw_outskull_mesh.nii.gz /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/csf_raw_outskull_mesh.off /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/gm.fsmesh /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/gm.lh.stl /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/gm.lh_fixed.off /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/gm.rh.stl /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/gm.rh_fixed.off /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/gm.rh_fixed2.off /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/gm_fixed.off /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/gm_fixed2.off /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/gm_fixed3.off /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/gm_large.nii.gz /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/meshfix_log.txt /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/mri_nu_correct.mni.log /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/mri_nu_correct.mni.log.bak /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/opticrad.nii.gz /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/opticrad.off /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/opticrad_FS.fsmesh /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/opticrad_FS.nii.gz /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/opticrad_FS.stl /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/opticrad_large.off /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/rh.area /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/rh.curv /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/segmentation-mask.nii.gz /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/skin.fsmesh /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/skin.off /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/skin_FS.fsmesh /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/skin_FS.nii.gz /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/skin_FS.stl /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/skin_estimate.nii.gz /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/skin_raw.nii.gz /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/skin_raw_ero.nii.gz /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/skin_tmp_it1.nii.gz /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/skin_tmp_it2.nii.gz /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/skin_tmp_it3.nii.gz /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/skin_tmp_it4.nii.gz /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/skin_tmp_it5.nii.gz /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/skin_tmp_it6.nii.gz /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/skin_tmp_strength.nii.gz /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/skull.fsmesh /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/skull.off /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/skull_FS.fsmesh /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/skull_FS.nii.gz /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/skull_FS.stl /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/skull_large.nii.gz /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/skull_raw.nii.gz /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/subcortical.nii.gz /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/subcortical.off /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/subcortical_FS.fsmesh /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/subcortical_FS.nii.gz /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/subcortical_FS.stl /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/subcortical_large.off /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/subcortical_small.off /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/subcortical_small_small.off /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/unity.xfm /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/ventricles.fsmesh /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/ventricles.off /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/ventricles_FS.fsmesh /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/ventricles_FS.nii.gz /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/ventricles_FS.stl /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/ventricles_raw.nii.gz /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/wm.fsmesh /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/wm.lh.stl /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/wm.lh_fixed.off /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/wm.rh.stl /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/wm.rh_fixed.off /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/wm.rh_fixed2.off /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/wm_fixed.off /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/wm_fixed2.off /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/wm_fixed3.off /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/wm_small.nii.gz /mnt/Research/simnibs/test2/SPR06/m2m_SPR06/tmp/yshift.mat

echo ==> mri2mesh finished 2019. 12. 10. (화) 12:57:09 KST.

echo Duration: 0:21:7 (hours:minutes:seconds)
</pre></BODY></HTML>
<HTML><HEAD><TITLE>mri2mesh report</TITLE></HEAD><BODY><pre>
 
==============================
==> mri2mesh started  2019. 12. 10. (화) 12:57:35 KST ...
==============================
command line options: --volumemesh SPR06 SPR06_T1.nii.gz
 
==============================
==> --vol: Volume meshing ...
==============================

cat

/home/junhyuk/simnibs_2.1.2/bin/gmsh -3 -bin -o SPR06.msh SPR06.geo
error code 139
exiting mri2mesh
</pre></BODY></HTML>