"Import FreeSurfer grey/white segmentation to Morphologist" issue

Questions about BrainVisa usage and installation

Moderators: denghien, riviere

Post Reply
gianluca.paolocci
Posts: 2
Joined: Thu Dec 08, 2016 3:52 pm

"Import FreeSurfer grey/white segmentation to Morphologist" issue

Post by gianluca.paolocci »

Hi all!

My name is Gianluca and I am working as master student in the Neurology department of the University Clinics of Tübingen.
I'm trying to run Brainvisa on an Ubuntu 64-bit system on a Virtualbox.
I started using Ubuntu just few months ago, so I'm facing some problems due to my inexperience.

My goal is to run the BrainVISA-Freesurfer pipeline, in order to perform the Hip-Hop parcellation of the brain. I've already run the recon-all pipeline on Freesurfer, so I would like to import those results in BrainVISA.

After the installation, I set the preferences according to instructions I found in this forum; the path to FreeSurfer_home and to the subjects folder was set automatically.

I added a line to execute 'bv_env' in the .bashrc file.

I don´t know if I'm still missing something important, but when I try to import data (Freesurfer -> Import FreeSurfer grey/white segmentation to Morphologist) I get this error:

http://imgur.com/a/hG3vm

It actually can import the .mgz files from the subjects folder to the 'tmp' folder, converted in .nii files (so it isn´t not a Freesurfer problem), but then it fails to run the "AimsFileConvert".

I tried to read almost every post on this forum about this concern without finding a solution, which is probably quite easy for someone more expert than me.

I hope someone could help me fixing this error,
Thanks in advance, Gianluca.
User avatar
riviere
Site Admin
Posts: 1361
Joined: Tue Jan 06, 2004 12:21 pm
Location: CEA NeuroSpin, Saint Aubin, France
Contact:

Re: "Import FreeSurfer grey/white segmentation to Morphologist" issue

Post by riviere »

Hi,
That's strange indeed, it seems to fail while converting .nii into .nii.gz which we do thousands of times per day...
Can you look in the log window (opened through the menu in BV, ot by typing Ctrl-L), there should be more precise messages about AimsFileInfo command execution and errors.
Which brainvisa package are you using ? The Ubuntu 12.04 (glib 2.15) one ? We found that some libs were missing in this one after all, but if you are using it in a VirtualBox running the same Ubuntu 12.04 and appripriate libraries installed, it should be OK. At least I would not expect a failure at this point.
Next you could try to get the temporary image converted by Freesurfer in /tmp. BV will normally remove it after execution of the process, but you can go in the preferences and un-check "removeTemporary" to disable temp files deletion, then run the process again, copy the .nii file in /tmp (and then you can re-unable removeTemporary). Then we can check if this nifti file is what we expect or not (you could maybe send it to me).

Maybe not related (but maybe yes also): you said you run the bv_env.sh from your .bashrc (you mean, really bv_env.sh, not just bv_env, which is a different non-shell variant and will just do nothing in a .bashrc): in general it can be dangerous to do so, because then all your shells will get the binary BV distribution libraries, which would then be used by all system commands, and this can introduce incompatibilities. So it could be that Freesurfer would not work properly after that.
It should be enough to set BV bin/ directory in the PATH environment variable, but leave the other ones unchanged: All programs in BV bin/ dir are scripts that actually use bv_env to setup their runtime environment, so you don't need to do it before.

Last point, Hip-Hop does not require Freesurfer segmentations to run, it can work using Morphologist segmentations and meshes also. Using FS allows to compare with FS parcellations and other tools, however, so it can make sense anyway.

Denis
gianluca.paolocci
Posts: 2
Joined: Thu Dec 08, 2016 3:52 pm

Re: "Import FreeSurfer grey/white segmentation to Morphologist" issue

Post by gianluca.paolocci »

Hi Denis,
Thank you for the quick answer.

- This is the error message in the log:

" <n name="when">1481297591.02</n>
<l length="1" name="children">
<f type="LogFile.Item">
<s name="what">Error</s>
<s name="html"><table border=0><tr><td width=50><img alt="ERROR" src="/home/freesurfer_mne/brainvisa-4.5.0/share/axon-4.5/icons/error.png"></td><td><font color=red> <b>The following command failed : &quot;AimsFileConvert&quot; &quot;-i&quot; &quot;/tmp/bv_3472_5.nii&quot; &quot;-o&quot; &quot;/home/freesurfer_mne/Desktop/Brainvisa_db/subjects/AaSo/t1mri/default_acquisition/AaSo.nii.gz&quot; &quot;-t&quot; &quot;S16&quot;</b> </font></td></tr></table><hr><font color=red><b>ImportationError</b><br>processes.py (2725) in _processExecution: <blockquote> result = process.execution( self )</blockquote>ImportT1MRI.py (79) in execution: <blockquote> self.output.fullPath())</blockquote>image_importation.py (81) in import_t1mri: <blockquote> .join(command_list))</blockquote></font></s>
<n name="when">1481297591.4</n>
<s name="icon">error.png</s>
</f>
</l>
<s name="icon">icon_process.png</s>
</f>
<f type="LogFile.Item">
<s name="what">Error</s>
<s name="html"><table border=0><tr><td width=50><img alt="ERROR" src="/home/freesurfer_mne/brainvisa-4.5.0/share/axon-4.5/icons/error.png"></td><td><font color=red> <b>The following command failed : &quot;AimsFileConvert&quot; &quot;-i&quot; &quot;/tmp/bv_3472_5.nii&quot; &quot;-o&quot; &quot;/home/freesurfer_mne/Desktop/Brainvisa_db/subjects/AaSo/t1mri/default_acquisition/AaSo.nii.gz&quot; &quot;-t&quot; &quot;S16&quot;</b> </font></td></tr></table><hr><font color=red><b>ImportationError</b><br>processes.py (2725) in _processExecution: <blockquote> result = process.execution( self )</blockquote>Import_FROM_FreeSurfer_TO_Morpho.py (168) in execution: <blockquote> context.runProcess('ImportT1MRI', input=tmp_ori, output=self.T1_output)</blockquote>processes.py (2483) in runProcess: <blockquote> result = self._processExecution( _process, None )</blockquote>processes.py (2725) in _processExecution: <blockquote> result = process.execution( self )</blockquote>ImportT1MRI.py (79) in execution: <blockquote> self.output.fullPath())</blockquote>image_importation.py (81) in import_t1mri: <blockquote> .join(command_list))</blockquote></font></s>
<n name="when">1481297591.4</n>
<s name="icon">error.png</s>
</f>
</l>
<s name="icon">icon_process.png</s>
</f> "

The previous part seems fine, concerns the "mri_import" command but there are no errors.

- I´m using the brainvisa package "Linux 64 bits (glibc 2.15) (built on Ubuntu 12.04)", but my Ubuntu version is 16.04, maybe this could be a source of errors.

- I´ll try this next, as long as I get something I´m updating the post.

- At first I was using the "bv_env" file, then I noticed that in the environment variables nothing was happening, so I just copied the content in the .bashrc file. Now I removed all those lines, replaced with:
" export PATH=$PATH:/home/freesurfer_mne/brainvisa-4.5.0/bin"
But apparently it isn´t the correct answer. (the log I reported is after this change).

- Eventually I could avoid the Freesurfer part, but I think the the problem right now is the way I installed BrainVISA or the whole OS on the VirtualBox.

Thanks for your help, I hope your advice could definetely solve this problem.
User avatar
riviere
Site Admin
Posts: 1361
Joined: Tue Jan 06, 2004 12:21 pm
Location: CEA NeuroSpin, Saint Aubin, France
Contact:

Re: "Import FreeSurfer grey/white segmentation to Morphologist" issue

Post by riviere »

Oh I did not mean cutting this chunk out of the log file manually: this bit is difficult to read, and does not seem to contain more useable information: there is not the output streams from the command here. I meant use the log view window in brainvisa interface, get the standard/error output streams of the command, and copy/paste it from the log window. Or send the entire log fire after closing brainvisa.
Denis
Post Reply