Skip to content

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

@yusaiwen

Description

@yusaiwen

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions