Hi Denis,
I have written a pyanatomist script in order to create many fusions between anatomy and map activation.
It works but :
1) I have a problem with the settings of palette. The value min and max (set in the script) are not the same
when the GUI of Anatomist is launched, I suppose that Anatomist set again the min and the max.
How can I keep the intial values ?
In the script, I use this line :
#palette and options
map_activation.setPalette("tvalues100-100-100", minVal=0.35, maxVal=0.65)
2) Data are in the "Talairach-MNI template-SPM". So I use the loadReferentialFromHeader() function, I'm looking for the ref of
Talairach-MNI template-SPM, then I load manually an identity tranformation between both referentials. I don't know wholly the API,
so is there a best way to do that ?
Thanks,
Isa
pyanatomist / palette / load transformation
- riviere
- Site Admin
- Posts: 1361
- Joined: Tue Jan 06, 2004 12:21 pm
- Location: CEA NeuroSpin, Saint Aubin, France
- Contact:
Re: pyanatomist / palette / load transformation
Hi Isa,
1) By default setPalette() interprets minVal and maxVal parameters as relative values, which are mapped to the whole range of values of the object it is used for, so here it is 35% and 65% of the image min/max. But maybe you meant "absolute" values corresponding directly to image values. In this case you just have to add the additional optional parameter absoluteMode=True:
2) I don't know what you exactly load manually, but it depends wheter referential information is actually present in the image file or not. For instance if the image file (NIFTI file for instance) has the MNI referential code in its transforms, loadReferentialFromHeader() should be enough and you should not have anything to set manually. If the info is not present, you have to know that one of the referentials is actually the MNI one. You can set referentials and transformations in pyanatomist (using assignReferential(), mniTemplateRef, createTransformation() etc). If it's not enough you may show me your problem.
Denis
1) By default setPalette() interprets minVal and maxVal parameters as relative values, which are mapped to the whole range of values of the object it is used for, so here it is 35% and 65% of the image min/max. But maybe you meant "absolute" values corresponding directly to image values. In this case you just have to add the additional optional parameter absoluteMode=True:
Code: Select all
map_activation.setPalette("tvalues100-100-100", minVal=0.35, maxVal=0.65, absoluteMode=True)
Denis
Re: pyanatomist / palette / load transformation
Thanks Denis,
1) It's exactly what I need.
2) My user case is the second. I want to load an identity transformation between 2 referentials as in the anatomist GUI by using "Ctrl + left button". So I wonder if there
is a magic parameter or function instead of using something like
Isa
1) It's exactly what I need.
2) My user case is the second. I want to load an identity transformation between 2 referentials as in the anatomist GUI by using "Ctrl + left button". So I wonder if there
is a magic parameter or function instead of using something like
Code: Select all
a.loadTransformation([0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1], ref_template, a.mniTemplateRef)