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
running a .bvproc from the command line?
- 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?
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:
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:
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:
Denis
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
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
- 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
Re: running a .bvproc from the command line?
thanks, Denis!
-
- 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?
Hi Denis,
I tried running this command - as described by you :
.
I get the following error -
Can you let me know what is going on? I think morphologist needs at least 14 arguments.
Thank you,
Durai
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
Thank you,
Durai
- 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?
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
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