Registration issue

Questions about Anatomist manipulation

Moderators: riviere, denghien

francois
Posts: 61
Joined: Tue Jul 25, 2017 9:37 am

Registration issue

Postby francois » Mon May 28, 2018 11:37 am

Hello,

I have a non-isotropic volume (t1pre.nii) that I have processed with FreeSurfer.
I have imported the FreeSurfer output back to my BrainVISA database with the "Freesurfer outputs To BrainVisa conversion pipeline".
I want to display the FreeSurfer/MarsAtlas parcellation together with the other volumes I had in my BrainVISA database but I can't understand how to do so with Anatomist.

In the this example I included the original t1pre.nii, together with the freesurfer orig.mgz imported back into the BrainVISA database (freesurfer.nii):
https://www.dropbox.com/s/0ecl6g4wcztxv ... v.zip?dl=0

The two volumes have different voxel sizes but are correctly registered: if I open the two volumes together in MRIcron, BrainSuite, SPM or Brainstorm, they appear correctly aligned. But if I load the two volumes in Anatomist, no matter which referential I select for one or the other volume, I cannot get the linked cursor to point at the same location in the two windows (see screen capture in the .zip file).

How do I get to see the two volumes aligned in Anatomist?
(it's not my primary objective: I have other volumes in my BrainVISA database that I need to display in the same coordinate system as the MarsAtlas parcels computed from the BrainVISA+FreeSurfer pipeline - the issue with the coordinate system is the same for all the volumes and meshes coming from FreeSurfer)

I'm sorry if there is something obvious I'm missing in the way Anatomist handles the transformations between volumes, I'm not very familiar with the software yet.

Thanks for your help
François

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

Re: Registration issue

Postby riviere » Mon May 28, 2018 1:11 pm

Hi,

Welcome to the amazing world of coordinates transformations :)

If you go in Anatomist preferences, "volumes" tab, and check both options "use referential/transformation information from header" and "assume all 'scanner-based' referentials are the same", then load the images again, both images will be registered, provided they are viewed in a window set in a referential compatible with them (a transformation path should exist between the window ref and the objects ref).

Now I explain:
Most neuroimaging software assume the hypothesis that transformations stored in image files, go from the image space to a "common space". But this assumption is sometimes wrong: scanner-based referentials of two different subjects, or not acquired during the same scanning session, are not the same and do not ensure correct registration of images. Co-registration may also use other intermediate referentials (different subjects, modalities, time points etc). Anatomist does not want to make hazardous assumptions by default, that's why registration is not handled by default, unless you select the options above to make these assumptions (the first option "load information from header" should probably be done by default now, we should consider changing the default behavior).
You can also do the same by hand (or by a script), by first using the option (right click menu option on object) "referential/load header information", then open the referentials/transformations window, and drag an "identity transform" line (ctrl+left mouse drag) between the two target referentials ("scanner-based" ones) created for both images. Remember to set the viewing window in one of these referentials, because the default one (red) has no transform to them.

Is it OK ?
Denis

francois
Posts: 61
Joined: Tue Jul 25, 2017 9:37 am

Re: Registration issue

Postby francois » Mon May 28, 2018 2:40 pm

It looks like it's working when I do it when starting anatomist from the command line.
But I haven't managed to make it work yet when starting anatomist from a python script.

These two preferences to change are not saved from one session to the next.
How do I set this programmatically? (after calling anatomist.Anatomist('-b') )

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

Re: Registration issue

Postby riviere » Mon May 28, 2018 6:17 pm

Preferences are not saved automatically, we consider it's a deliberate user action, especially if they have been modified by a script.
You can change them this way:

Code: Select all

import anatomist.api as ana
a = ana.Anatomist()
a.config()['setAutomaticReferential'] = 1
a.config()['commonScannerBasedReferential'] = 1

See also: http://brainvisa.info/pyanatomist/sphin ... howto.html and http://brainvisa.info/anatomist/user_do ... _file.html
(this makes me realize that there are dead links and missing options in the docs, I will also fix them).
Otherwise you can also load headers referentials on a case-by-case basis:

Code: Select all

obj = a.loadObject(filename)
a.execute('ApplyBuiltinReferential', objects=[obj])

Manually linking scanner-based referentials from a script is a bit more tricky, it would require to follow the transformations graph from loaded objects and add new transformations. It's still possible if needed.
Denis


Return to “Anatomist”

Who is online

Users browsing this forum: No registered users and 2 guests