loading transformation with pyAnatomist

Questions about Anatomist manipulation

Moderators: denghien, riviere

Post Reply
User avatar
Olivier Coulon
Posts: 176
Joined: Fri Feb 27, 2004 11:48 am
Location: MeCA research group, Institut de Neurosciences de La Timone, Marseille, France
Contact:

loading transformation with pyAnatomist

Post by Olivier Coulon »

Hello,
I am trying to display a set of volumes and meshes (from the same original T1 image) in the Talairach-ACPC referential within a python script, using pyAnatomist.
I used the online documentation:
http://brainvisa.info/pyanatomist-4.6/s ... sformation
and produced the code below. My objects are loaded in aMesh, aMRI and aSTS, and the path for the 'subject_default_acquisition_TO_Talairach-ACPC.trm' is in pathTalairach.

Code: Select all

 
source = a.createReferential()
target = a.createReferential()

 aMesh.assignReferential(source)
 aMRI.assignReferential(source)
 aSTS.assignReferential(source)

 a.loadTransformation(pathTalairach, source, target)
 
After this I add objects in several windows. The problem is that it has no effect whatsoever. If I comment the 'loadTransformation' line the result is the same.
I cannot figure out whatelse to do. Any idea ?
Thank you,

Olivier
Olivier Coulon
Institut de Neurosciences de La Timone,
Aix-Marseille Université,
Marseille, france
https://meca-brain.org
User avatar
riviere
Site Admin
Posts: 1361
Joined: Tue Jan 06, 2004 12:21 pm
Location: CEA NeuroSpin, Saint Aubin, France
Contact:

Re: loading transformation with pyAnatomist

Post by riviere »

Hi Olivier,
If you are running this exact code, then it's normal since all objects have been assigned the same referential (source), so whatever the transformations to other referentials (target), it doesn't change anything for them.
If one object (let's say aSTS) is assigned the target referential, then it should change the coordinates transformations between aSTS and the other objects, but this can only take place when the window(s) are in a referential which is also linked (by transformations, directly or indirectly) to one of the objects referentials, otherwise we cannot compute transformations between window coordinates and objects coordinates.
Denis
User avatar
Olivier Coulon
Posts: 176
Joined: Fri Feb 27, 2004 11:48 am
Location: MeCA research group, Institut de Neurosciences de La Timone, Marseille, France
Contact:

Re: loading transformation with pyAnatomist

Post by Olivier Coulon »

Thank you,
So basically what I want to do is not to transform one object into another one's referential, but instead display several objects in the Talairach-ACPC referential. I guess it just means that I need to specify that the window should be also in thtat referential ? (if so, how ?).

Olivier
Olivier Coulon
Institut de Neurosciences de La Timone,
Aix-Marseille Université,
Marseille, france
https://meca-brain.org
User avatar
riviere
Site Admin
Posts: 1361
Joined: Tue Jan 06, 2004 12:21 pm
Location: CEA NeuroSpin, Saint Aubin, France
Contact:

Re: loading transformation with pyAnatomist

Post by riviere »

In this case, the window should probably be set in the referential you consider to be Talairach (usually it's the default red one). You can assign a referential to a window just as to an object:

Code: Select all

window.assignReferential(target)
It doesn't need to be the referential of an object, but there has to be a transformations path between the window referential and the displayed objects one(s).
Denis
User avatar
Olivier Coulon
Posts: 176
Joined: Fri Feb 27, 2004 11:48 am
Location: MeCA research group, Institut de Neurosciences de La Timone, Marseille, France
Contact:

Re: loading transformation with pyAnatomist

Post by Olivier Coulon »

It works, thank you very much.

Olivier
Olivier Coulon
Institut de Neurosciences de La Timone,
Aix-Marseille Université,
Marseille, france
https://meca-brain.org
Post Reply