loading transformation with pyAnatomist

Questions about Anatomist manipulation

Moderators: riviere, denghien

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

Postby Olivier Coulon » Tue Feb 26, 2019 7:36 pm

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/sphinx/pyanatomist_tutorial_nb.html#Load-a-transformation
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: 1351
Joined: Tue Jan 06, 2004 12:21 pm
Location: CEA NeuroSpin, Saint Aubin, France
Contact:

Re: loading transformation with pyAnatomist

Postby riviere » Mon Mar 04, 2019 10:36 am

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

Postby Olivier Coulon » Tue Mar 05, 2019 9:04 am

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: 1351
Joined: Tue Jan 06, 2004 12:21 pm
Location: CEA NeuroSpin, Saint Aubin, France
Contact:

Re: loading transformation with pyAnatomist

Postby riviere » Tue Mar 05, 2019 10:01 am

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

Postby Olivier Coulon » Tue Mar 05, 2019 5:21 pm

It works, thank you very much.

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


Return to “Anatomist”

Who is online

Users browsing this forum: No registered users and 2 guests