Page 1 of 1

loading transformation with pyAnatomist

Posted: Tue Feb 26, 2019 7:36 pm
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

Re: loading transformation with pyAnatomist

Posted: Mon Mar 04, 2019 10:36 am
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

Re: loading transformation with pyAnatomist

Posted: Tue Mar 05, 2019 9:04 am
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

Re: loading transformation with pyAnatomist

Posted: Tue Mar 05, 2019 10:01 am
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

Re: loading transformation with pyAnatomist

Posted: Tue Mar 05, 2019 5:21 pm
by Olivier Coulon
It works, thank you very much.

Olivier