Page 1 of 1

running a .bvproc from the command line?

Posted: Fri Nov 22, 2013 2:21 pm
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

Re: running a .bvproc from the command line?

Posted: Fri Nov 22, 2013 2:54 pm
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

Re: running a .bvproc from the command line?

Posted: Mon Nov 25, 2013 10:20 am
by SylvainT
thanks, Denis!

Re: running a .bvproc from the command line?

Posted: Tue Nov 13, 2018 2:49 pm
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

Re: running a .bvproc from the command line?

Posted: Wed Nov 14, 2018 4:36 pm
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