= T1-MRI Segmentation with BrainVISA = It is not the purpose of Brainstorm tutorials to teach you how to use BrainVISA. But many Brainstorm users are lost when it gets to the segmentation of the MRI. So here is a short introduction to the BrainVISA T1 MRI processing pipeline. To extract head and cortex meshes from a T1 MRI, you can also try to use: [[http://www.loni.ucla.edu/Software/BrainSuite|BrainSuite]] or [[http://surfer.nmr.mgh.harvard.edu/|FreeSurfer]]. We are going to illustrate the use of BrainVISA with the MRI from the CTF tutorials. You should already have those files on your computer, if you followed the basic tutorials. If it is not the case, go to the [[http://neuroimage.usc.edu/brainstorm3_register/download.php|Download page]], and get the file sample_ctf.zip. <New (summer 2012): The new version of the software offers a new interface, together with a detailed tutorial. You may refer to that documentation rather than this current page):)>>[[http://brainvisa.info/doc/axon/bv_training/en/html/index.html|BrainVISA tutorial pages]] == Installation == * Download the latest version of BrainVISA from http://brainvisa.info * Install it on your computer by following the instructions on the [[http://brainvisa.info/download.html#installation|download page]]. * Start BrainVISA * You have to create a database for storing your files: this will be either asked at startup, or you'll have to select the menu !BrainVISA menu > Preferences: {{attachment:database.gif||height="150px",width="383px"}} * Click on Add, and create a directory with is __not__ in any Brainstorm directory. For example: * '''Windows''': My Documents\brainvisa_db\ * '''Linux''': /home/username/brainvisa_db/ * '''MacOS''': Documents/brainvisa_db/ * Click on Ok. * Your are ready to import and process your MRI. == Import MRI == To process a MRI volume with BrainVISA, you have first to import it in the database. * Select the process: T1-MR1 > Import > Import T1 MRI, and click on Open button. . {{attachment:importMri.gif||height="282px",width="492px"}} * The following figure will appear. On the ''input ''line, click on the last button to select the file sample_ctf/Anatomy/'''01.nii''' . {{attachment:importMriForm.gif}} * On the output line: click on the last button (red thing), which means: select an output file from the database. In the file selection window, you have to type the name of a new protocol, because there are no existing protocol yet. Type "Segmentation" in the protocol text box. You should see the default filenames appearing in the list on the right of the window. Click on Ok.<
><
> {{attachment:output.gif}} * Click on Run, wait for the process to end. Then you can close this window.The MRI is imported in the database. == Configure T1 pipeline == Back to BrainVISA window, now select process T1 MRI > Segmentation Pipeline > T1 Pipeline. . {{attachment:selectT1Pipeline.gif||height="214px",width="485px"}} Click on open. . {{attachment:T1PipelinePrepare.gif}} How to fill all those fields: * '''Mri''': click on the green button, and select from the database the MRI you've just imported * '''Anterior commissure''': * Click on the "Anatomist" button (at the end of the line). This will start anatomist. * In Anatomist window, look for a view that gives you an axial view * Then place the cross on the anterior commissure (see page: CoordinateSystems) * Go back to the "T1 Pipeline" window again, and click again on "Anatomist" button for the anterior commissure. This should write the current position of the cursor in the "Anterior commissure" field. * '''Posterior commissure''': Same operation * '''Interhemispheric point''': Same operation, pick it on the top part of the brain. * '''Left hemisphere point''': Same, but be VERY carful with this. By default, contrary to Brainstorm, the view in Anatomist is in radiological convention. Which means that the left point you have to pick is shown '''on the right part on the axial slice'''. * If for some reason the MRI you are importing has the left and right flipped, you should click on the left part of the axial slice, and then set the option "allow_flip_initial_MRI" to "true" in the "AC/PC step". * '''Historgram analysis''': Select "2-Historgram analysis" instead of "Vip Histogram analysis" * '''Cortical Fold Graph''': Uncheck this step, we don't need that. Click on Run and pray hard. == What if it crashes? == Your first try might be a failure. Don't give up, it might be easy to fix. If the process that crashed has two option (like all the steps from "T1 Bias correction" to "Split brain mask"): * Select the other option (Example: "VIP bias correction" instead of "1 - T1 Bias correction") * Uncheck all the processes that were successful (indicated with a green arrow), so that the Pipeline do not have to start from the beginning again. * Click on Run again. If it still crashes: * Try to change other options (like the selections in the previous steps) * Post your anger about this absolute waste of time on BrainVISA forum * Try another software. == Import the MRI and surfaces in Brainstorm == If you see at some point green check marks in front of all the processes: you are done. Now you need to import the files BrainVISA produced in !BrainStorm. Here is are the path on my installation of BrainVISA, it can be slightly different on your computer: <
>'''brainvisa_db\Segmentation\01\t1mri\default_acquisition\default_analysis\''' * __MRI__: \'''nobias_01.nii.gz'''<
> * I'd recommend to use the BrainVISA nobias volume instead of your original MRI file, because it usually looks nicer, and you are sure that it will be correctly oriented in Brainstorm. * If Brainstorm still doesn't have a .nii.gz format in Import MRI window, you'll have to gunzip this file first. * __Scalp__: \segmentation\mesh\'''01_head.mesh''' * __Left hemisphere__: \segmentation\mesh\'''01_Lhemi.mesh''' * __Right hemisphere__: \segmentation\mesh\'''01_Rhemi.mesh''' Never forget to check the final surfaces in Brainstorm, they still might be completely wrong. Here is what your supposed to get after importing the MRI and the surfaces (see tutorial #2). . {{attachment:result.gif}} Have fun...