Errors with Sulci Recognition in Morphologist Pipeline

Questions about BrainVisa usage and installation

Moderators: riviere, denghien

Posts: 11
Joined: Tue Jun 05, 2018 6:34 pm

Errors with Sulci Recognition in Morphologist Pipeline

Postby willsnyder12 » Wed Jun 27, 2018 9:29 pm


I am trying to use the Morphologist Pipeline (non-UI) (from BrainVISA version 4.5) on a Mac (OSX 10.9), and I am running into a few errors. I am not using the UI because the T1MRI's I have are already preprocessed/masked/skull stripped, and the UI procedure applies another brain mask that causes some sulci to not be traced (namely the Orbitfrontal Sulci, which are the sulci I am interested in--the additional brain mask does not encompass the full orbitofrontal cortex). However if there is a way to customize the UI procedure and avoid the creation of a new brain mask, please let me know.

In the non-UI version, I have been using the different models/approaches but have not had luck with any of them. The ANN model will run to completion, but will throw a warning saying that the 3.0 version is being used and isn't completely compatible with the 3.1 version. I tried to use the 3.1 discriminative models but the pipeline throws an error saying the 3.1 model's .dat file has no value. The Global Registration appears to allow for correct labeling of sulci, but takes up to 50 minutes to run, which is especially long compared to how the full pipeline can be run in the UI on a brain on my computer within 6 minutes. The Talairach model will run quickly, but incorrectly labels all the sulci, and when I use the Talairach/Global models with local/markovian models (or with local/markovian on their own without Talairach/global registration), the program doesn't run to completion. With local, the error output is:

Traceback (most recent call last): File "/brainvisa-4.5.0/scripts/sigraph/sulci_registration/", line 473, in <module> if __name__ == '__main__' : main() File "/brainvisa-4.5.0/scripts/sigraph/sulci_registration/", line 441, in main elif model_type == 'spam' : d = SpamTagger(*tagger_opt) File "/brainvisa-4.5.0/scripts/sigraph/sulci_registration/", line 258, in __init__ Tagger.__init__(self, *args, **kwargs) File "/brainvisa-4.5.0/scripts/sigraph/sulci_registration/", line 66, in __init__ gd = gaussians_distrib['vertices'][label] KeyError: 'F.C.L.a._left'

With Markovian, it runs to completion but gives these warnings, and does not properly label the sulci:

/brainvisa-4.5.0/lib/python2.6/site-packages/scipy/stats/ RuntimeWarning: divide by zero encountered in log return (a-1)*log(x) - x - gamln(a)
/brainvisa-4.5.0/python/sulci/models/ RuntimeWarning: divide by zero encountered in log 0, self._scale))
/brainvisa-4.5.0/lib/python2.6/site-packages/scipy/stats/ RuntimeWarning: invalid value encountered in multiply return (a-1)*log(x) - x - gamln(a)

Also, I tried to use the Simplified Morphologist pipeline, but even after I entered in all the parameters, it tells me "transformation_information" has no value. I tried to edit the .bvproc file to enter a value for it, but the resulting .bvproc file will not open in brainvisa after.

I've been using Morphologist 2015 for all of these, but the older pipelines are also behaving the same for me.

In summary, I have not been able to use the Morphologist Pipeline's sulci labeling except for when I wait 50 minutes with the global registration model. The previous parts of the pipeline/segmentations have all been working well and have a good output (except for some issues in the split brain mask creation, which only runs when I uncheck the "use template" option, but still has generally good segmentation). The subject.arg sulci maps have resulted very well, only they cannot be labeled efficiently as I have described above.

I can avoid all these problems by just using the UI instead and using raw data (with skull intact), but if anyone can give me advice for how to use the non-ui pipeline I would greatly appreciate it as I hope to create a bash script that automates the pipeline's execution and orbit frontal sulcus isolation (with create sulcus label volume) altogether so I can run it on many subjects who already have had skull-stripping/preprocessing.

Thank you!
Will Snyder

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

Re: Errors with Sulci Recognition in Morphologist Pipeline

Postby riviere » Tue Jul 10, 2018 2:49 pm

Hi Will,
Sorry I missed the notificatioin for your message and I had not seen it before today...

First the Mac version is definitely not optimal: we use an old Mac system (10.5) featuring an old compiler, an old python language version, and old libraries. We have seen that some programs run in a reasonable time (pure image processing) but some kinds of algorithms are really slow. We (actually I) kind of struggle to maintain the Mac version of BrainVisa: Mac systems behave "differently" as other systems, and change a lot from one version to another, making transitions to newer MacOS versions really difficult and time consuming. I'm in the process of building on MacOS 10.11 but it's already outdated, and there are new problems that I haven't been able to solve yet. So in the meantime the old 10.5 version is the only one, and our old Mac machine is dying, so I cannot guarantee there will actually be a Mac version next time... However solving the performance issues has a "quick answer": use a Linux machine, at least when you have large datasets to process... (maybe a virtual machine on Mac would do the job).

Morphologist-ui and masking:
Morphologist-UI normally does exactly the same thing as the non-UI pipeline, the processing routines are the same, it's just a different presentation. I have just found a bug recently in normalization sub-pipeline selection (a mess-up between SPM8 and SPM12). But as it is a simplified presentation, and we wanted it to stay simple, we don't provide all options, parameters and step selections in this interface. So it's "normal" to go back to the ol brainvisa pipeline Morphologist 2015.
So did you disable the brain mask step ?

The ANN sulcal recognition models:
As the warning states, the models have been trained on the 3.0 variants of sulcal graphs, which used to have one buggy morphometric descriptor, fixed in 3.1 but with values which could differ. That's why we issue this warning. However in practice it works quite normally and (as many things) I did not get/take time to train the model again with newer sulcal graphs. There are no trained 3.1 models for ANN, the 3.1 models are only for morphometric measurements (and should not be visible in the selection interface in the ANN recognition).

The SPAM models:
The Talairach model is the simplest and fastest, but of course the worse... The standard procedure is to use global registration first at least, and then a 2nd pass with local registration, which refines the results, starting from a good enough initialization from global registration. The Markovian model has never been used in a large scale because it did not get better results than local registration, was slower, and more difficult to explain. I must admit that it's a long time since I last tried it, and I'm not 100% certain it is still working... Anyway local registration and Markovian steps should come after a first one based on Talairach or global registration, but as you have seen Talairach is often not good. So as costly as it is, I really recommend local+global mode.

The simplified Morphologist pipeline is a "one process" version (not pipelined) with few/no options, designed to run on large datasets (it's lighter and avoids a large part of the slow database queries in brainvisa which are really a bottleneck to run large iterations). I've just tried it on linux and it worked correctly. I haven't tested it on Mac right now.


Posts: 11
Joined: Tue Jun 05, 2018 6:34 pm

Re: Errors with Sulci Recognition in Morphologist Pipeline

Postby willsnyder12 » Wed Jul 11, 2018 3:30 pm

Hi Denis,

Thank you for the thorough response!
I had unchecked a few steps before the brain mask step and also unchecked the brain mask step in BrainVISA Morphologist 2015. I was able to successfully use my own brain mask which helped increase presence of orbitofrontal sulcus tracings. I will likely be looking into using Linux/running Linux virtual machine to see if that helps me avoid some of these sulcus identification issues in my next steps.

Thanks again,
Will Snyder

Return to “BrainVISA”

Who is online

Users browsing this forum: No registered users and 2 guests