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

How to make split view's image closer to each other? #314

Open
yusaiwen opened this issue Mar 8, 2022 · 0 comments
Open

How to make split view's image closer to each other? #314

yusaiwen opened this issue Mar 8, 2022 · 0 comments

Comments

@yusaiwen
Copy link

yusaiwen commented Mar 8, 2022

Hi.

When I drew brain of split view for lateral and medial views, the horizontal spacing is pretty large after save the image. Is there any method to reduce it?

code:

this_dir = opj(desc_dir, 'indvar')
for i in [1, 2, 3, 4, 5, 'all']:
    brain = Brain('fsaverage', 'split', 'inflated', background='white', size=600, views=['lat', 'med'], offscreen=True)

    lh_tmp = nib.load(opj(this_dir, 'lh'+str(i)+'.indvar.nii.gz')).get_fdata()
    lh = np.squeeze(lh_tmp)

    rh_tmp = nib.load(opj(this_dir, 'rh'+str(i)+'.indvar.nii.gz')).get_fdata()
    rh = np.squeeze(rh_tmp)

    brain.add_morphometry("curv", colormap="binary", min=-.8, max=.8, colorbar=False)
    brain.add_data(lh, hemi='lh', max=4, min=min, name='lh', transparent=True, colormap = 'PuRd', colorbar=False)
    brain.add_data(rh, hemi='rh', max=4, min=min, name='rh', transparent=True, colormap = 'PuRd', colorbar=False)
    desc_fname = opj(this_dir, 'indvar'+str(i)+'.png')
    brain.save_image(desc_fname)
    brain.close()

Image:
image

Many thanks
Saiwen Yu

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