help > Specify window/image size
Showing 1-4 of 4 posts
Nov 21, 2019 02:11 PM | jadecci
Specify window/image size
Dear experts,
I'm visualising some data in MNI space and saving the images using the savebmp function (automated with a Python script). Is it actually possible to resize the image window or specify the size of the image? Right now if I restart the programme, the images saved will be of a different size, making cropping very hard to automate later on.
Thank you!
I'm visualising some data in MNI space and saving the images using the savebmp function (automated with a Python script). Is it actually possible to resize the image window or specify the size of the image? Right now if I restart the programme, the images saved will be of a different size, making cropping very hard to automate later on.
Thank you!
Dec 11, 2019 04:12 PM | Peter Jones - University of cambridge
RE: Specify window/image size
I too have this issue. I made some scripts to create image scenes
with the excellent Surfice. I used the 2 February 2019 development
version that was the only one that had the features I was looking
for. This saves png images with size 1840x1992, at least in Windows
10. As I could not see a way to change the aspect ratio I decided
to work within the image sizes created by Surfice. The version now
released available from 2 September 2019 saves images with size
1228x1482. However, when I call Surfice from scripts it opens with
a narrow view and images are saved with the size 772X1482. This
makes the actual brain images small in the scenes I create because
the top and bottom of the images is mostly white space. I can
chamge the pixel count using the Bitmap Zoom but this does not
change the aspect ratio. Is there a way to make the image size
squarer?
Thanks for your help.
Simon
Thanks for your help.
Simon
Dec 11, 2019 04:12 PM | Chris Rorden
RE: Specify window/image size
Have you tried the savebmpxy() function, e.g. try this script:
import gl
gl.resetdefaults()
gl.azimuthelevation(70, 15)
gl.meshload('BrainMesh_ICBM152Right.mz3')
gl.overlayload('motor_4t95vol.nii.gz')
gl.overlayminmax(1,2,12)
gl.overlayload('motor_4t95vol.nii.gz')
gl.overlayminmax(2,-1,-2)
gl.colorbarvisible(1)
gl.overlaytransparencyonbackground(25)
gl.meshcurv()
gl.savebmpxy('square', 480, 480)
import gl
gl.resetdefaults()
gl.azimuthelevation(70, 15)
gl.meshload('BrainMesh_ICBM152Right.mz3')
gl.overlayload('motor_4t95vol.nii.gz')
gl.overlayminmax(1,2,12)
gl.overlayload('motor_4t95vol.nii.gz')
gl.overlayminmax(2,-1,-2)
gl.colorbarvisible(1)
gl.overlaytransparencyonbackground(25)
gl.meshcurv()
gl.savebmpxy('square', 480, 480)
Dec 11, 2019 05:12 PM | Peter Jones - University of cambridge
RE: Specify window/image size
No I hadn't. That worked!
Thanks
Thanks