open-discussion > Bitmap-saving and image smoothing options
Showing 1-3 of 3 posts
Display:
Results per page:
Jun 15, 2017  08:06 AM | Lars Kasper - Translational Neuromodeling Unit, IBT, University of Zurich and ETH Zurich
Bitmap-saving and image smoothing options
Dear Chris,

I am a big fan of the whole MRIcro*-series - which for my purposes provide the best available viewers. Thank you for making this available to us. Recently, I became very interested in the scripting functionality of MRIcroGL.

I encountered two issues/questions lately:

1) When I choose one axial slice for plotting, use File -> Save or SAVEBMP('filename'), while the Preferences -> Bitmap Zoom is greater than one, I get horizontal black bars in the exported png. E.g., 1 in the center for zoom 2, but 5 parallel ones for zoom 10. My workaround is to set the bitmap zoom level to 1 in mricrogl.ini (or can I change it via scripting?).

2) Compared to other viewers, my 2D axial slices look somehow smoothed (the underlay, not the overlays), i.e. I cannot distinguish the pixels any more. Is there an implicit smoothing performed in 2D as well that I can adjust and switch off via a script?

Thank you very much for your help and once more for this great contribution to the community!

Below you find my system specs and the script, attached the bitmaps I am referring to.

Kind regards,
Lars 

Here are my system specs:

Mac OS Sierra 10.12.5
MRIcroGL, May 5, 2016
MacBook Air 2013 with one external monitor connected (1680x1050)


And here the generating script:

begin
RESETDEFAULTS; SHADERQUALITY1TO10(10); LOADIMAGE('meanaspOutFmri1.nii');
CONTRASTMINMAX(0.1,1.1);OVERLAYLOADSMOOTH(false);OVERLAYTRANSPARENCYONOVERLAY(0);
OVERLAYTRANSPARENCYONBACKGROUND(0);OVERLAYCOLORFROMZERO(false);SHADERNAME('minimal'); COLORBARVISIBLE(false);OVERLAYLOAD('spmT_0001.nii');OVERLAYMINMAX(1, 3.7, 5);
OVERLAYLOAD('spmT_0001.nii');OVERLAYMINMAX(2, -5, -3.7);
OVERLAYLOAD('../edge0.10_MultiechoUmpire1mm.nii');OVERLAYMINMAX(3, 0, 2);
OVERLAYLOAD('edge0.10_MultiechoUmpire1mm.nii');OVERLAYMINMAX(4, 0, 2);
OVERLAYLOAD('../edge0.10_MultiechoUmpire1mm.nii');OVERLAYMINMAX(5, 0, 1.5);
OVERLAYLOAD('../edge0.10_MultiechoUmpire1mm.nii');OVERLAYMINMAX(6, 0, 2);
OVERLAYVISIBLE(1, true); OVERLAYVISIBLE(2, true);OVERLAYVISIBLE(3, false);
OVERLAYVISIBLE(4, false);OVERLAYVISIBLE(5, true);OVERLAYVISIBLE(6, false);
OVERLAYMASKEDBYBACKGROUND(false);MOSAIC('L- H -0.1 V 0 A 0.39');SAVEBMP('spOutFmri1_overlay1_preproc1_slicepack3_withEdge.png');
end.
Attachment: test2.png
Jun 18, 2017  01:06 AM | Lars Kasper - Translational Neuromodeling Unit, IBT, University of Zurich and ETH Zurich
RE: Bitmap-saving and image smoothing options
Dear Chris,

I just tried the new version you sent me. It works perfectly, thank you so much. Will this be in an upcoming release of MRICroGL?
- Images are in native resolution
- BMPZOOM scales them correctly, no black bars any more!
- SHARPEN works in a script
- The exported pngs look much crisper, even without sharpen!
- Retina-Display option does not alter the images (I guess because I don't have a retina screen :-))

All the best, and thank you again, this boosts my workflow,
Lars
Jun 22, 2017  10:06 AM | Chris Rorden
RE: Bitmap-saving and image smoothing options
These features are all included in the 21 June 2017 release now available on NITRC. The specific changes for your situation:
 1.) When you save or copy MOSAIC images, the image resolution is based on the voxel size of your images, not the resolution of your screen. Therefore, BMPZOOM=1 has precisely the dimensions of your background image whil BMPZOOM=2 double it. This reduces blurring common with non-integer scaling.
 2.) BMPZOOM and SHARPEN functions added to the scripting language. In the past you could only choose BMPZOOM through the GUI Preferences panel and SHARPEN with the View/Sharpen menu item. The sharpen command can increase the definition of edges (it is an unsharp mask), at the cost of increasing noise.
 3.) For MacOS users, images now use Retina settings by default (go to Preferences to switch this off).