help > Changing coordinates(X,Y,Z) in a script
Showing 1-4 of 4 posts
Display:
Results per page:
Aug 26, 2022  02:08 PM | Mario Rossi
Changing coordinates(X,Y,Z) in a script
Dear All, I apologize for another silly question, but I can not find an example in the script or a direct pointer in the documentation.
I would like to include in a script a change of coordinates (in particular changing  he Z value) similar to what can be done
from the GUI. Basically I want automate what is shown in the attached screenshot
What is the primitive I need to use? Is the a full reference of the available primitives?
Thanks in advance,
Mario
Attachment: SetZ40.png
Aug 26, 2022  03:08 PM | Chris Rorden
RE: Changing coordinates(X,Y,Z) in a script
Choose Scripting/Templates/Help to see all details on all MRIcroGL specific functions. The orthoviewmm(x,y,z) allows you to set the MPR slice:

```
import gl
gl.resetdefaults()
gl.loadimage('spm152')
#open overlay: show positive regions
gl.overlayload('spmMotor')
gl.minmax(1, 4, 7)
gl.orthoviewmm(0,0,35)
```

Alternatively, you could use the mosaic option:

```
import gl
gl.resetdefaults()
gl.loadimage('spm152')
#open overlay: show positive regions
gl.overlayload('spmMotor')
gl.minmax(1, 4, 7)
gl.mosaic("C 0 S 0 A 35")
```
Aug 26, 2022  04:08 PM | Mario Rossi
RE: Changing coordinates(X,Y,Z) in a script
Thanks a lot Chris. you reply solves the specific issue and gives a straight pointer to the whole doc.
I will exploit your availability to ask another question.
Is it  correct that MRIcroGL does the overlay trying to align the background image and the overlay if they have different resolutions?
Thanks again!
Mario
Aug 26, 2022  05:08 PM | Chris Rorden
RE: Changing coordinates(X,Y,Z) in a script
Yes, MRIcroGL will use the spatial transform to reslice the overlay image to the resolution of the background image. The interpolation used is either nearest neighbor or trilinear, depending on whether 'Load smooth overlays' is selected in the 'Options' pulldown of the 'Layers' panel.