Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weird fringing artifact with parcellation maps #39

Closed
chrisgorgo opened this issue Dec 10, 2015 · 3 comments
Closed

Weird fringing artifact with parcellation maps #39

chrisgorgo opened this issue Dec 10, 2015 · 3 comments

Comments

@chrisgorgo
Copy link
Contributor

I have problems displaying this map: https://www.dropbox.com/s/2ig8llrzo64xfrv/Screenshot%202015-12-10%2016.37.16.png?dl=0

screenshot 2015-12-10 16 37 16

There appear to be fringes/borders on edges of the parcels. However when I view the same map in mango it looks correct:

screenshot 2015-12-10 16 40 53

I've tried to turn off smoothing, but it did not change anything. You can download the map here:
http://neurovault.org/media/images/1003/brain_parcellation_mcinet_basc_asym_111clusters.nii.gz

PS other parcelation maps in NeuroVault are rendered correctly. For example: http://neurovault.org/images/1700/

@rii-mango
Copy link
Owner

Try again. It should be fixed now. The weird edges were caused by interpolation in the overlay. The intended behavior was for interpolation to be turned off when smoothing is off -- that's how Mango works. So that part has been fixed.

If you happen to want to leave smooth display on (e.g., for the underlay), you can also now specify 'interpolation' as true or false for that overlay.

I think the reason the other map you linked do didn't show the artifact is that the overlay dimensions were an exact multiple of the underlay, resulting in no interpolation.

A related item is that turning gradation off in the color tables is now supported. That is, you can now create a color table like this:

params["luts"] = [{"name": "Custom", "gradation":false, "data":[[0, 1, 0, 0], [.5, 1, 1, 0], [1, 1, 1, 1]]}];

Normally the space between the color table "knots" is interpolated, but when setting "gradation" to false, it remains a solid color. These types of color tables might be useful for segmented data.

@chrisgorgo
Copy link
Contributor Author

Great! Works! Thank you!

@pangyuteng
Copy link

pangyuteng commented Mar 14, 2023

Super helpful post! Thank you both!!

Took me a while to realize you can add interpolation within the lookup table.

--

Sample snippet for those that are visiting this page.

        var params = [];
        params["images"] = ["image.nii.gz","mask.nii.gz"];
        params["smoothDisplay"] = false;
        params["interpolation"] = false;
        params["worldSpace"] = false;
        params["kioskMode"] = false;
        params["luts"] = [{
            "name": "Custom",
            "interpolation": false,
            "gradation": true,
            "data": [[0, 1, 1, 1],[0.25, 1, 0, 0],[0.5, 0, 1, 0],[0.75, 0, 0, 1],[1, 1, 1, 0]],
        }];
        params["mask.nii.gz"] = {
            "lut": "Custom",
            "alpha": 0.5,
            "min": 0,
            "max": 4,
        };
        

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants