How to use command BrainVISA onto a script shell?

Questions about BrainVisa usage and installation

Moderators: denghien, riviere

Post Reply
clairec
Posts: 5
Joined: Wed May 16, 2012 4:41 pm

How to use command BrainVISA onto a script shell?

Post by clairec »

Hello,

I need to use the importT1MRI process and (after some other processing) the Morphologist process.
I would like to have just one script to run, so I wonder if there is a command line to run these process. Something like "brainvisa -r ...", but I don't know how to use this command: Which format for the parameters?

Regards,
Claire C.
Dominique Geffroy
Site Admin
Posts: 161
Joined: Thu Mar 01, 2007 4:22 pm
Location: IFR 49 - Neurospin, Gif-sur-Yvette, France
Contact:

Re: How to use command BrainVISA onto a script shell?

Post by Dominique Geffroy »

Hello,

If you want to run several processes via a script, it is better to use the command

Code: Select all

brainvisa -b -e myscript.py
, with the code to run Brainvisa processes in a python script (myscript.py in the example).

In this script, you can use brainvisa python API to run processes. Here is an example of script that runs Import T1 MRI process :

Code: Select all

import neuroProcesses
context = neuroProcesses.defaultContext()
context.runProcess( 'importt1mri',
    input = <file to import>,
    output = {'protocol' : 'myprotocol', 'subject' : 'mysubject'} )
The runProcess function needs the identifier of the process (you can find it in the documentation of the process) and the value for each mandatory parameters.

You may find more example in these posts:
http://brainvisa.info/forum/viewtopic.php?f=2&t=1296
http://brainvisa.info/forum/viewtopic.php?f=10&t=1608

Dominique
clairec
Posts: 5
Joined: Wed May 16, 2012 4:41 pm

Re: How to use command BrainVISA onto a script shell?

Post by clairec »

Hi,

Thank you, I will do some tests, but a don't have access to the second link.

Regards,
Claire.
Post Reply