Tuesday 3 January 2012

Segmentation in Freesurfer, Rest in Brain Voyager

      This method is an alternative way to improve segmentation quality in Brain Voyager,by completing following steps you'll be able to create an anatomical image with a labeled WM as a single  intensity value in Brain Voyager. Be sure you have freesurfer installed before starting these steps.

1) Go to the dicom directory where T1MPR images are and type the following command;

recon-all -subject burak -i filename01.dcm -autorecon1 -autorecon2

this will last 4-5 hours.

2)Go to freesurfer subject directory and under the subject you have analyzed there is a folder called "mri" , find wm.seg.mgz file under it and copy it somewhere else.

3)Go to that folder and run following command;

mri_convert --in_type mgz --out_type nii -input_volume wm.seg.mgz --output_volume wm.nii

this command will convert the mgz format to nii format which we can import to BV with nifti gifti plugin.

4) Open Brain Voyager go to plugins tab and choose "nifti gifti plugin" than run "NIFTI 1 converter"


select input type nifti then select wm.nii file, choose output volume type "vmr";
 while converting BV will ask -->
Adapt intensity Values : "Yes"
Labels                          : "No"
at this point you should have "wm.vmr"  which looks likes as follows;



5) Go to Brain Voyager 3D volume tools, choose "spatial transfer" card, than hit the "To Sag" button , it will ask to convert sagital orientation; say NO;
after that correct the orientation in BV's conventional way;

at this point you should get "wm_SAG.vmr"



6) Create subject.VMR in conventional way in BV than observe GM intensities over the ribbon (i.e.90-110)

7) Since WM data converted from many file formats, location of the WM may change , to correct this mismatch;

Open wm_SAG.vmr register it to subject.vmr, you will get .trf file after that transform wm_SAG.vmr to wm_SAG_TRF.vmr.


8) Open subject.vmr overlay the wm_SAG_TRF.vmr check the transformation quality.

9) Open wm_SAG_TRF.vmr , from contrast&brightness settings -->
set brightness level to maximum 100;


set contrast level 1-10; choose contrast level to adjust the intensity 40-50 higher than GM level

10) Apply your mask to original subject.vmr file  ;
From 3Dvolume tools --> Segmentation --> options --> masking
choose your wm_SAG_TRF_masked.vmr and set max - min values to cover the intesity value of your mask.


11) Save your new VMR file as white matter masked version, than you can AutoSegment this version using BV 3DvolumeTools.


If everything was fine you should be able to get good segmentation ...