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

add vmin, vmax, cmap options to plotting functions #378

Open
jcheong0428 opened this issue Mar 16, 2021 · 0 comments
Open

add vmin, vmax, cmap options to plotting functions #378

jcheong0428 opened this issue Mar 16, 2021 · 0 comments

Comments

@jcheong0428
Copy link
Member

jcheong0428 commented Mar 16, 2021

Current plot uses a cmap where the extreme values are white. For example:
image

Fix would be to allow passing a vmin, vmax, or cmap to _viewer brain or plot brain, so that it plots like this using cmap="RdBu_r":
image

For example, change the cmap to RdBu_r in _viewer

def _viewer(brain, thresh, idx, percentile_threshold, surface, anatomical, **kwargs):

at

b, bg_img=bg_img, threshold=thresh, cut_coords=cut_coords, **kwargs

like so.

    if thresh == 0:
        thresh = 1e-6
    else:
        if percentile_threshold:
            thresh = str(thresh) + "%"
    if isinstance(idx, int):
        b = brain[idx].to_nifti()
    else:
        b = brain.to_nifti()
    if anatomical:
        bg_img = anatomical
    else:
        bg_img = "MNI152"
    cut_coords = kwargs.get("cut_coords", [0, 0, 0])

    if surface:
        return view_img_on_surf(b, threshold=thresh, **kwargs)
    else:
        return view_img(
            b, bg_img=bg_img, threshold=thresh, cut_coords=cut_coords, cmap='RdBu_r', **kwargs
        )```
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

1 participant