running a .bvproc from the command line?

Questions about BrainVisa usage and installation

Moderators: denghien, riviere

Post Reply
SylvainT
Posts: 73
Joined: Mon Feb 13, 2006 6:37 pm
Location: INT, Marseille, France

running a .bvproc from the command line?

Post by SylvainT »

Hi,

I'm wondering whether there's an option to launch a .bvproc from the command line (i.e without having to launch the brainvisa interface)... I've looked at the options (BrainVISA --help) but I didn't see anything to do this...

Thanks,

Sylvain
User avatar
riviere
Site Admin
Posts: 1361
Joined: Tue Jan 06, 2004 12:21 pm
Location: CEA NeuroSpin, Saint Aubin, France
Contact:

Re: running a .bvproc from the command line?

Post by riviere »

Hi Sylvain,
Oh, that's right the "-r" option is not documented... Thanks to point it out...
So, there are 3 ways to run a .bvproc in a commandline:
- The "old" way:

Code: Select all

brainvisa -r process.bvproc
If your process.bvproc has all parameters configured and the execution does not rely on databasing, you can add the -f option to start faster.
This method starts the full (or almost full) brainvisa infrastructure before running the process.[/*]
- The "new" way:

Code: Select all

python -m brainvisa.axon.runprocess process.bvproc
This methods tries to be more minimalist and thus faster to start. It disables databasing and other things by default (unless you pass the --enabledb option), and uses a "processes cache" to avoid reading them all.
- the convenience script axon-runprocess does the same as the "new way", through a script, which may (or may not) appear easier to run.

In all cases, a process can be specified either by a .bvproc file, or a process name and series of arguments, for instance:

Code: Select all

python -m brainvisa.axon.runprocess --enabledb morphologist t1mri=/home/someone/bv_database/subject/t1mri/default_acquisition/subject.nii.gz
Denis
SylvainT
Posts: 73
Joined: Mon Feb 13, 2006 6:37 pm
Location: INT, Marseille, France

Re: running a .bvproc from the command line?

Post by SylvainT »

thanks, Denis!
durai2323
Posts: 8
Joined: Thu Sep 13, 2018 8:53 am
Location: Forschungszentrum Jülich, Jülich, Germany

Re: running a .bvproc from the command line?

Post by durai2323 »

Hi Denis,

I tried running this command - as described by you :

Code: Select all

python -m brainvisa.axon.runprocess --enabledb morphologist ./100206_1-T1w_acpc_dc_restore_1mm.nii.gz
.

I get the following error -

Code: Select all

Loading toolbox cortical_surface
Loading toolbox data management
Loading toolbox datamind
Loading toolbox freesurfer
Loading toolbox morphologist
Loading toolbox spm
Loading toolbox structural_analysis
Loading toolbox tools
Loading toolbox viewers
Loading toolbox My processes
The log file for this session is '/home/arasan/.brainvisa/brainvisa3.log'
Headless Anatomist running in normal (non-headless) mode
exec: /home/arasan/brainvisa-4.6.0/brainvisa/toolboxes/morphologist/startup.py
/home/arasan/brainvisa_test/fsl/data: parse directories and insert items
/home/arasan/brainvisa_test/fsl/data: 1 files are stored as 1 DiskItems in 0
seconds
/home/arasan/brainvisa_test/spm8: parse directories and insert items
/home/arasan/brainvisa_test/spm8: 1 files are stored as 1 DiskItems in 0 seconds
Traceback (most recent call last):
  File "/home/arasan/brainvisa-4.6.0/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/home/arasan/brainvisa-4.6.0/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/arasan/brainvisa-4.6.0/python/brainvisa/axon/runprocess.py", line 404, in <module>
    process = get_process_with_params(process_name, iterated, *args, **kwargs)
  File "/home/arasan/brainvisa-4.6.0/python/brainvisa/axon/runprocess.py", line 131, in get_process_with_params
    context._setArguments(*(process,) + tuple(args), **kwargs)
  File "/home/arasan/brainvisa-4.6.0/python/brainvisa/processes.py", line 2854, in _setArguments
    _process.checkArguments()
  File "/home/arasan/brainvisa-4.6.0/python/brainvisa/processes.py", line 878, in checkArguments
    o.checkValue(p, getattr(self, p, None))
  File "/home/arasan/brainvisa-4.6.0/python/brainvisa/data/writediskitem.py", line 68, in checkValue
    Parameter.checkValue( self, name, value )
  File "/home/arasan/brainvisa-4.6.0/python/brainvisa/data/neuroData.py", line 209, in checkValue
    raise Exception( HTMLMessage(_t_('Mandatory argument <em>%s</em> has no value') % name) )
Exception: Mandatory argument <em>t1mri_nobias</em> has no value
Can you let me know what is going on? I think morphologist needs at least 14 arguments.

Thank you,
Durai
User avatar
riviere
Site Admin
Posts: 1361
Joined: Tue Jan 06, 2004 12:21 pm
Location: CEA NeuroSpin, Saint Aubin, France
Contact:

Re: running a .bvproc from the command line?

Post by riviere »

Hi,

The completion of output file names has not worked.
I see two possible reasons:
- maybe the relative file name is not supported with databasing (I haven't checked), you can try using an absolute path (since the databasing and completion system needs to identify databases by the beginning of the path.
- or you haven't setup a database and imported the raw MRI into it. From your example with a relative file name, I cannot see if the image is in a brainvisa/morphologist directory tree organization or not, here.

Denis
Post Reply