help > Remove smoothing effect after loading an overlay
Showing 1-4 of 4 posts
Results per page:
Feb 4, 2021  11:02 AM | makis
Remove smoothing effect after loading an overlay
I am using mricrogl to overlay a brain map onto the spm152 volume.

When I load my map, there is a weird smoothing effect that cannot be removed. Why is that? How to solve this?

Using other software the map looks fine..
Feb 4, 2021  11:02 AM | Chris Rorden
RE: Remove smoothing effect after loading an overlay
When an overlay does not match the resolution of a background image it must be resliced to match the background image using an interpolation function. MRIcroGL can either load an overlay as smooth (linear interpolation) or jagged (nearest neighbor interpolation). Ideally, you should reslice data BEFORE thresholding the data. These issues are discussed in the manual.

With the user interface, the behavior is controlled with the "Load Smooth Overlays" menu item in the "Options" drop down menu of the Layers panel. Toggling this menu's checkbox on or off determines how future overlays are loaded.

The Scripting/Templates/jagged shows how one controls this behavior with a script. This script loads two overlays, one smooth and one jagged. The behavior is controlled by the function gl.overlayloadsmooth()

If you want to change the default behavior, you can click the "Advanced" button in the preferences menu and edit the preferences file to either load the overlays as jagged (0) or smooth(0) based on the value set for "LoadSmoothOverlays", e.g.
Feb 4, 2021  12:02 PM | makis
RE: Remove smoothing effect after loading an overlay
Thank a lot. Setting Load Smooth Overlays to off worked.

One last thing. I am using the mosaic view style with A L+ H -0.1 V -0.1 -52 -32 -12 8; 28 48 66 S X 10.
How can I get the last subplot to be like this ? (see attachment)

Feb 4, 2021  02:02 PM | Chris Rorden
RE: Remove smoothing effect after loading an overlay
This question is underspecified. I am not sure what you would like the last subplot to look like. Your last subplot looks like you ran a script like this:

import gl
gl.minmax(1, 4, 4)
gl.mosaic("A 48 56 S X 0");

You could REMOVE the cross slice subplot with
 gl.mosaic("A 48 56");

You could REMOVE the lines from the last plot with
 gl.mosaic("A 48 56 S 0");

You could make the last subplot a rendering with:
 gl.mosaic("A 48 56 S R X 0");

I also note in your script you are asking for the cross slice to be a Y=10mm (10mm right from anterior commissure), but your screenshot shows Y = 0mm (midline). So perhaps you want to change
 A L+ H -0.1 V -0.1 -52 -32 -12 8; 28 48 66 S X 10
to read 
 A L+ H -0.1 V -0.1 -52 -32 -12 8; 28 48 66 S X 0
For publications, I would leave the labels off ("L-") and describe them in the Figure legend or use a vector tool to add text. Bitmap fonts never look very crisp.