Page 1 of 1

BrainVISA crashes while doing the Sulcus Parameterization2015 in iteration mode

Posted: Wed Jun 14, 2017 10:59 am
by jstropel
Hello,

I am trying to do the Sulcus Parameterization 2015 on a bunch of subjects. Unfortunately, whenever I try to analyze more than 6 or 7 subjects the whole program crashes saying that python is not working anymore. In the console I get the following error lots of time before it crashes:

Code: Select all

QThread::start: Failed to create thread (The access code is invalid.)
I am trying to setup a batch script that loops through the subjects without the brainvisa iteration mode but I get different errors so before I continue trying to solve the problem with a batch script can anyone describe another way to solve this?

Thank you

Re: BrainVISA crashes while doing the Sulcus Parameterization2015 in iteration mode

Posted: Wed Jun 14, 2017 11:21 am
by Olivier Coulon
Hello,
are you running all these subjects iteratively or in the 'run in parallel' mode ?

Olivier

Re: BrainVISA crashes while doing the Sulcus Parameterization2015 in iteration mode

Posted: Mon Jun 19, 2017 7:46 am
by jstropel
Hello Olivier,

I am running these subjects iteratively, not using multithreading.

Julius

Edit: And I am using two different Windows machines, I get these errors on both.

Re: BrainVISA crashes while doing the Sulcus Parameterization2015 in iteration mode

Posted: Mon Jun 19, 2017 8:26 am
by Olivier Coulon
Hello,
my guess is that the problem is unrelated to the process, it is more general. Would it be possible for you to try with the same data on another system (Linux or Mac) ?

Olivier

Re: BrainVISA crashes while doing the Sulcus Parameterization2015 in iteration mode

Posted: Tue Jun 20, 2017 6:33 am
by jstropel
We tried to run BrainVisa on several Linux machines but got OpenGL errors, so this is not an option.

I tried to run the script in a python loop so it shuts down everytime after completing a hemisphere but I got stuck at the point where the process shows an error that a certain module cannot be loaded. Here in the forum I found that I need to start BrainVisa in a certain mode so that it loads more modules (not just batch mode) but starting BrainVisa in this mode did not work, I can give more details later but maybe you already know what I mean.

And by the way: Please, please make this site use https. A website that handles login data and does not use an encrypted connection is not something I expect to encounter in 2017, especially on a website that deals with scientific problems. If you are looking for a free and easy to implement service I can really recommend https://letsencrypt.org/. I encrypted the connection of my web app within minutes.

Best regards,

Julius

Re: BrainVISA crashes while doing the Sulcus Parameterization2015 in iteration mode

Posted: Tue Jun 20, 2017 5:56 pm
by riviere
Hi,
We tried to run BrainVisa on several Linux machines but got OpenGL errors, so this is not an option.
Were you running in a virtual machine ? Or through a remote connection ? OpenGL on Linux works generally well nowadays, and there are probably ways to fix it when it does not.
I tried to run the script in a python loop so it shuts down everytime after completing a hemisphere but I got stuck at the point where the process shows an error that a certain module cannot be loaded. Here in the forum I found that I need to start BrainVisa in a certain mode so that it loads more modules (not just batch mode) but starting BrainVisa in this mode did not work, I can give more details later but maybe you already know what I mean.
There are several ways to run brainvisa in batch:
  • the "old" way: "brainvisa -b" should load everything except the GUI (if I remember) unless the -f or -r options are used
  • using the command "axon-runprocess": GUI is disabled, and also databases, and processes are loaded from a cache file so the "full" brainvisa should have been opened once before, unless the option --enabledb is used.
  • in a python script:

    Code: Select all

    import brainvisa.axon.processes
    brainvisa.axon.processes.initializeProcesses()
    from brainvisa import processes
    context = processes.defaultContext()
    context.runProcess('morphologist', t1mri="/some/image.nii")
    
    In this situation only the GUI is disabled, unless brainvisa.axon.processes.neuroConfig.fastStart is set to True before initializeProcesses() is called.
Which modules are missing for you ?
And by the way: Please, please make this site use https. A website that handles login data and does not use an encrypted connection is not something I expect to encounter in 2017, especially on a website that deals with scientific problems. If you are looking for a free and easy to implement service I can really recommend https://letsencrypt.org/. I encrypted the connection of my web app within minutes.
Well, yes I know and you're right; but it has become really too much work to maintain everything and make things evolve, I won't say I'm alone for all the maintenance but we are just 2 or 3 and we have many many other jobs to do, so things are going slowly... in the meantime you'd better avoid setting the same password for this forum and for your bank account, of course...

Denis

Re: BrainVISA crashes while doing the Sulcus Parameterization2015 in iteration mode

Posted: Thu Jun 22, 2017 7:18 am
by jstropel
Hi Denis,

thank you for providing so much detailed information. I used the python code you gave me and it seems to work, I will now try to a) iterate within that python script but I think I will get the same errors that I got before as this procedure should not be very different from the "iterate" function and if this does not work b) execute the whole script file in a loop with changing arguments. I think if a) doesn't work b) should defenitely work as it is like opening bv and closing it from the gui for every subject.

I can understand that you do not have much free time for the https thing but keep in mind that with letsencrypt it is very easy and fast, just saying.

Another thing I wanted to mention is that the iterate function of the Sulcus Parameterization 2015 has a bug that causes the program to use the same ouput file names over and over again without adding some subject identifier (after the iteration process you only have ouputs for 1 subject no matter how many iteration processes were made). This is something I had to fix right at the beginning before the other error occured. I wonder if no one ever mentioned that problem.

Best regards from Germany

Julius

Edit: Is it possible to pass parameters to the script that is being run by using

Code: Select all

brainvisa -b -e **path**
?[/b]

Re: BrainVISA crashes while doing the Sulcus Parameterization2015 in iteration mode

Posted: Thu Jun 22, 2017 10:46 am
by riviere
Hi,

The initial problem you have seems to be in allocating Qt threads. In BV each process execution is run in its own thread, but they are python threads, not QThread, so I don't really understand then QThreads are allocated. The Windows version of brainvisa has problems within Qt, and I don't know if your problem is linked to the ones we met. Just to tell news, we have now switched to a cross-compilation system to build the Windows version from Linux, and (by chance?) we do not have any longer the problems we had before, so I don't know if it would solve your problem.
Anyway it would be interesting to know if it happens only on Windows.

Now, if you iterate in your own loop (case a) maybe it will avoid the thead allocation part in brainvisa processing infrastructure, so maybe it could help in your situation.
Otherwise, have you tried the "run in parallel" mode ? in this case iterations are run in separate processes, so it would be similar to your solution b) in addition to using multiple core/processors.

For the bug in sulcus parameterization, I let Olivier handle it (I hope he reads your message). But in any iteration you can specify lists of filenames in the iteration dialog, so you can work around the problem (even if it is maybe not very convenient to build the list of filenames externally and copy/paste it to BV iteration interface).
Is it possible to pass parameters to the script that is being run by using brainvisa -b -e **path**
No actually, this option is very simplistic, it just runs the (single) argument of the -e option through excecfile(). But using a small python script like the snippet in my last message, it is easy to do.

Denis

Re: BrainVISA crashes while doing the Sulcus Parameterization2015 in iteration mode

Posted: Thu Jun 22, 2017 3:45 pm
by jstropel
Hi,

I have done some testing an solution b) is working. I did some workaround to avoid using parameters and there are no problems anymore. I will now let it run for quite a few subjects.

As I expected solution a) has caused the same problem that existed before.

I tried to use the "run in parallel" mode but it did not work due to some errors I cannot remember right now but these errors were different from the ones I faced during the "normal" mode.

Thank you for your help

Julius

Re: BrainVISA crashes while doing the Sulcus Parameterization2015 in iteration mode

Posted: Mon Jun 26, 2017 2:16 pm
by riviere
It could help to have the error message for the parallel execution (one day).
Denis

Re: BrainVISA crashes while doing the Sulcus Parameterization2015 in iteration mode

Posted: Fri Jun 30, 2017 12:46 pm
by Olivier Coulon
Hello,
concerning this issue:
Sulcus Parameterization 2015 has a bug that causes the program to use the same ouput file names over and over again without adding some subject identifier (after the iteration process you only have ouputs for 1 subject no matter how many iteration processes were made).
I am aware of this. It is not possible to generate directly the output file namles from the list of subjects because there is an interaction with the sulcus name and I could not handle this properly when making the process. Anyway, there is a workaround, which involves haveing a list of your subject names ready in an editor.
The following video shows how to do this:

https://mycore.core-cloud.net/public.ph ... ee61f0f6c7

I hope it helps,

Olivier