morphologist after freesurfer import

Questions about BrainVisa usage and installation

Moderators: denghien, riviere

Post Reply
SylvainT
Posts: 73
Joined: Mon Feb 13, 2006 6:37 pm
Location: INT, Marseille, France

morphologist after freesurfer import

Post by SylvainT »

Hi,

I'm trying to run Morphologist with the new BV 4.4 (to then run the Cortical Surface Toolbox's Hiphop process) on some data that has been processed with Freesurfer. I ran the "Import from Freesurfer to T1 Pipeline" successfully... And now, I'm wondering which option I'm supposed to choose in Morphologist for "Image Orientation Handling": I'm guessing I don't need to do a Normalization; if so, what "Normalised" choice should I use in "Prepare Subject for Anatomical Pipeline"?

Thanks,

Sylvain
SylvainT
Posts: 73
Joined: Mon Feb 13, 2006 6:37 pm
Location: INT, Marseille, France

Re: morphologist after freesurfer import

Post by SylvainT »

OK, I understood... The ACPC coordinates are "imported" from freesurfer, so we only have to say that the image is NOT normalized to "Prepare Subject for Anatomical Pipeline".

One question though: that gives some sort of warning because the "left hemisphere point" is not set... Should I worry about this? Or can I trust what comes out of freesurfer?

Cheers,

Sylvain

ps: in morphologist, we need to manually unselect all the steps for which the freesurfer results are used (which are locked) for morphologist to run; it'd be nice to have a version of morphologist for which those steps are already unselected
User avatar
riviere
Site Admin
Posts: 1361
Joined: Tue Jan 06, 2004 12:21 pm
Location: CEA NeuroSpin, Saint Aubin, France
Contact:

Re: morphologist after freesurfer import

Post by riviere »

Hi Sylvain,

Yes that's it. But normally the FS import pipeline already does it: it runs or opens the morphologist pipeline with unselected steps (depending on the choice for "use_t1pipeline"). Didn't it already do it ?

Yes the left hemisphere point is not recorded in the APC file, so it can not remember that it was OK, hence the warning, but wou can assume it's OK here.

Denis
f4bry
Posts: 29
Joined: Wed Mar 25, 2009 1:46 pm

Re: morphologist after freesurfer import

Post by f4bry »

Hi,

Is it possible to import the segmentation maps and bias corrected images from Freesurfer instead of running the bias correction and Grey White classification process of Morphologist?
(my main goal is the sulci labelling).

Now, I am importing T1_orig, ribbon_img and Talairach tranformation. How exactly this informations are used by Morphologist?

Thank you!
Fab
User avatar
riviere
Site Admin
Posts: 1361
Joined: Tue Jan 06, 2004 12:21 pm
Location: CEA NeuroSpin, Saint Aubin, France
Contact:

Re: morphologist after freesurfer import

Post by riviere »

Hi,
When importing Freesurfer data, some data are taken from FS segmentations, and completed with some of Morphologist processings. Basically, it takes the ribbon image of FS, and uses it (after changing labels) for both split_brain and grey_white images in Morphologist. Thus the grey/white classification is not done again in morphologist but taken from FS. The topological correction step, however, is still run to ensure that the segmented image has the topology expected by later steps of Morphologist. I don't exactly remember if running the bias correction of Morph. is necessary or if we could have reused data from FS after non-uniformities correction. But I guess it was at least to get the hfiltered and white_ridges images, before performing histogram analysis.
Now, rebuilding meshes was probably not necessary (or it could be an option), since we can convert those from FS.
Why, is is a problem ?
Denis
f4bry
Posts: 29
Joined: Wed Mar 25, 2009 1:46 pm

Re: morphologist after freesurfer import

Post by f4bry »

Hi Denis,

The problem was that we were not really using the FS ribbon. But then, we figured out that after deleting the .lock files (an operation that we did), BrianVISA recomputes the segmentation.

Do we need the T1 if we convert the meshes from FS?

Thank you!
Fab
f4bry
Posts: 29
Joined: Wed Mar 25, 2009 1:46 pm

Re: morphologist after freesurfer import

Post by f4bry »

Hi Denis,

Actually, using my local pc (Mac OS X 10.11.3) and BrainVISA 4.5 ( thank you for the new release! ) I get the following error when I try to import grey/white segmentation from FS:

Code: Select all

Process Import FreeSurfer grey/white segmentation to Morphologist started on 2016/04/04 11:15
Convert .mgz to .nii with FreeSurfer
Import data into database with brainvisa ontology

dyld: Library not loaded: libaimsdata.4.5.0.dylib Referenced from: /Applications/brainvisa-4.5/bin/real-bin/AimsFileConvert Reason: image not found 

in Aims Converter 1 System call crashed 

SignalException
processes.py (2725) in _processExecution: 
result = process.execution( self )
AimsConverter.py (121) in execution: 
if apply( context.system, command ):
neuroProcessesGUI.py (2907) in system: 
ret = apply( ExecutionContextGUI.system, (self,) + args, kwargs )
processes.py (2877) in system: 
nativeEnv=nativeEnv)
processes.py (3010) in _system: 
result = c.wait()
command.py (139) in wait: 
raise self.SignalException( _t_( 'System call crashed' ) )

in ImportData 1 System call crashed 

SignalException
processes.py (2725) in _processExecution: 
result = process.execution( self )
ImportData.py (149) in execution: 
context.runProcess( converter, input, self.output )
processes.py (2483) in runProcess: 
result = self._processExecution( _process, None )
processes.py (2725) in _processExecution: 
result = process.execution( self )
AimsConverter.py (121) in execution: 
if apply( context.system, command ):
neuroProcessesGUI.py (2907) in system: 
ret = apply( ExecutionContextGUI.system, (self,) + args, kwargs )
processes.py (2877) in system: 
nativeEnv=nativeEnv)
processes.py (3010) in _system: 
result = c.wait()
command.py (139) in wait: 
raise self.SignalException( _t_( 'System call crashed' ) )


in Import FreeSurfer grey/white segmentation to Morphologist 1 System call crashed 


SignalException
processes.py (2725) in _processExecution: 
result = process.execution( self )
Import_FROM_FreeSurfer_TO_Morpho.py (180) in execution: 
context.runProcess('ImportData', tmp_ribbon , self.split_brain_output)
processes.py (2483) in runProcess: 
result = self._processExecution( _process, None )
processes.py (2725) in _processExecution: 
result = process.execution( self )
ImportData.py (149) in execution: 
context.runProcess( converter, input, self.output )
processes.py (2483) in runProcess: 
result = self._processExecution( _process, None )
processes.py (2725) in _processExecution: 
result = process.execution( self )
AimsConverter.py (121) in execution: 
if apply( context.system, command ):
neuroProcessesGUI.py (2907) in system: 
ret = apply( ExecutionContextGUI.system, (self,) + args, kwargs )
processes.py (2877) in system: 
nativeEnv=nativeEnv)
processes.py (3010) in _system: 
result = c.wait()
command.py (139) in wait: 
raise self.SignalException( _t_( 'System call crashed' ) )


Process Import FreeSurfer grey/white segmentation to Morphologist finished on 2016/04/04 11:15 (9 seconds)
...and I have the same issue on virtualbox with ubuntu installed.
Do you have any advice to fix this?
Thank you!
Fab
f4bry
Posts: 29
Joined: Wed Mar 25, 2009 1:46 pm

Re: morphologist after freesurfer import

Post by f4bry »

Hi,

I solved the .dylib issue by setting:
export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:/Applications/brainvisa/lib

Thanks! :)
Fab
User avatar
riviere
Site Admin
Posts: 1361
Joined: Tue Jan 06, 2004 12:21 pm
Location: CEA NeuroSpin, Saint Aubin, France
Contact:

Re: morphologist after freesurfer import

Post by riviere »

I think I have not understood your problem with the ribbon image of Freesurfer: do you want to import it or re-do the segmentation with morphologist ?
If you are interested in sulci, importing just the meshes is not enough.
Denis
User avatar
riviere
Site Admin
Posts: 1361
Joined: Tue Jan 06, 2004 12:21 pm
Location: CEA NeuroSpin, Saint Aubin, France
Contact:

Re: morphologist after freesurfer import

Post by riviere »

(the problem with Mac is a different topic...)
Normally the DYLD_LIBRARY_PATH is setup by the scripts running the programs, so you should not have to set it up yourself. How are you running brainvisa ?
Denis
f4bry
Posts: 29
Joined: Wed Mar 25, 2009 1:46 pm

Re: morphologist after freesurfer import

Post by f4bry »

Hi Denis,

Yes, I am interested in sulci and I would like to import the FS ribbon.
I think I didn't setup the scripts correctly and I was computing the segmentation using Morphologist.
My initial steps were like:
1) Import from Freesurfer
2) Removing *.lock
3) Morphologist - Sulci recognition

...and removing the .lock has been not a good idea.
Now it seems I am using the FS ribbon in the good way.

Thank you!
Fab
f4bry
Posts: 29
Joined: Wed Mar 25, 2009 1:46 pm

Re: morphologist after freesurfer import

Post by f4bry »

For the DYLD_LIBRARY_PATH issue,:

I am running brainvisa from the terminal, setting the variables:

brainvisa/bin/python bv_env.py

and then running the GUI:

brainvisa/bin/./brainvisa

or the scripts:
brainvisa/bin/brainvisa -r *.bvproc

Thanks!
Fab
User avatar
riviere
Site Admin
Posts: 1361
Joined: Tue Jan 06, 2004 12:21 pm
Location: CEA NeuroSpin, Saint Aubin, France
Contact:

Re: morphologist after freesurfer import

Post by riviere »

Hi,
Import from Freesurfer already runs the needed Morphologist steps using FS imported data, so you should not need to run Morphologist after it.
The locks are set precisely to ensure that data imported from FS are not computed again and erased by a later run of Morphologist - what you are doing here by removing the locks and re-running a complete Morphologist is erasing all that has been imported from FS and you just get pure Morphologist results. So it's definitely not what you want.
Denis
User avatar
riviere
Site Admin
Posts: 1361
Joined: Tue Jan 06, 2004 12:21 pm
Location: CEA NeuroSpin, Saint Aubin, France
Contact:

Re: morphologist after freesurfer import

Post by riviere »

I am running brainvisa from the terminal, setting the variables:

brainvisa/bin/python bv_env.py
Here you are basically doing nothing: you run python, set variables in python, then quit. It has no effect afterwards... If you want to setup the variables in a terminal, you should do:

Code: Select all

. brainvisa/bin/bv_env.sh
(note the ". " at the beginning - or you may use "source brainvisa/bin/bv_env.sh" instead)

Now that doesn't explain the problem because brainvisa/bin/brainvisa as you are using it should setup the variables for itself.
I can't check on our Mac today, I hope I can try it tomorrow, but I have made some tests and I really think we did not have such path problems...

Denis
Post Reply