netplotbrain icon indicating copy to clipboard operation
netplotbrain copied to clipboard

Roadmap

Open wiheto opened this issue 2 years ago • 4 comments

This is a collection of the long term roadmap (will start to use projects if more people contribute to this)

Released in #60

  • [x] Improve svg saving for all templates (ensure all template backgrounds are rasteriszed)
  • [x] More legend freedom (increase sizes) (see #57) -> currently on develop branch
  • [x] Link published article in docs
  • [x] Plot from bids
  • [x] Include connectivity matrices (like spring plots) that can be specified in views
  • [x] Experienced some a bug with pybids layout.get_entities() sometimes failing. Need to investigate/create minimal example of to report/find workaround. -> unsure why but was caused but getting unique entities from the main folder and not the derivative folder was causing the error

Bug fixes

  • [ ] #52 Parcel plots with single hemisphere ... And any others found

Enhancements

  • [ ] Better arrows for directions. Consider no arrows but just lines or lines with sphere (see #7)
  • [ ] Improve gif plots (see #29)
  • [ ] Improve continuous colorbar use/flexibility (specify cbar tick range instead of just being extremes).
  • [x] If node_color organizes connectivity matrix, then add color lines to connectivity matrix diagonal

New features

  • [ ] Include surface plots - no reasons they can't be included #49
  • [ ] Allow to shuffle parcel id numbers to improve colorbar distirbution (e.g. sequential)
  • [ ] More BIDSoperations

Improved Documentation

  • [ ] Add BIDS and CM feature in README/Main page as a major feature.
  • [ ] Tutorial: BIDS
  • [ ] Gallery example of BIDS
  • [ ] Gallery example of legend_span
  • [x] Gallery example, rotated cm

wiheto avatar Mar 02 '23 14:03 wiheto

Plot from bids

@deve now has obtaining edges from BIDS derivatives with "average" and "average and subtract" operations and can be grouped by tasks, sessions or a column of data in participants.tsv.

Added onto to do list

wiheto avatar Mar 20 '23 20:03 wiheto

Is there a way to directly increase the brain size or add related functionalities?

Currently, I'm using the following code:

figpick, ax = netplotbrain.plot(template='MNI152NLin2009cAsym',
                                fig=figpick,
                                view=['LAR'])

# Set figure size
figpick.set_size_inches(20, 8)

# Save as an SVG file
figpick.savefig('/home/jade/app/edu/brain_plot.svg', format='svg', dpi=500)

to increase the image size, but this method also significantly increases the whitespace between the brains.

Is there a more effective way to enlarge the brains without increasing the surrounding whitespace?

hasibagen avatar Sep 03 '24 08:09 hasibagen

The simple answer is: no. The longer answer is: yes but you have to do it manually and it could distort the figure so do it with care. The ax object is a list of three axis objects. and you can manually scale the xlim, ylim, zlim. ax[0].get_xlim() . Here is a quickly generated code of how you could do that

# Get current limits
current_xlim = ax[0].get_xlim()
current_ylim = ax[0].get_ylim()
current_zlim = ax[0].get_zlim()

# look at xlim to see its range
print(current_xlim)

# Calculate ranges
xlim_range = current_xlim[1] - current_xlim[0]
ylim_range = current_ylim[1] - current_ylim[0]
zlim_range = current_zlim[1] - current_zlim[0]

# Calculate the aspect ratios
xy_aspect_ratio = ylim_range / xlim_range
xz_aspect_ratio = zlim_range / xlim_range

# Change xlim to [-1, 1]
new_xlim = (-1, 1)
new_xlim_range = new_xlim[1] - new_xlim[0]

# Adjust ylim and zlim proportionally based on the aspect ratios
new_ylim_range = new_xlim_range * xy_aspect_ratio
new_ylim = (current_ylim[0], current_ylim[0] + new_ylim_range)

new_zlim_range = new_xlim_range * xz_aspect_ratio
new_zlim = (current_zlim[0], current_zlim[0] + new_zlim_range)

# Set the new limits
ax[0].set_xlim(new_xlim)
ax[0].set_ylim(new_ylim)
ax[0].set_zlim(new_zlim)

wiheto avatar Sep 05 '24 06:09 wiheto

The simple answer is: no. The longer answer is: yes but you have to do it manually and it could distort the figure so do it with care. The ax object is a list of three axis objects. and you can manually scale the xlim, ylim, zlim. ax[0].get_xlim() . Here is a quickly generated code of how you could do that

# Get current limits
current_xlim = ax[0].get_xlim()
current_ylim = ax[0].get_ylim()
current_zlim = ax[0].get_zlim()

# look at xlim to see its range
print(current_xlim)

# Calculate ranges
xlim_range = current_xlim[1] - current_xlim[0]
ylim_range = current_ylim[1] - current_ylim[0]
zlim_range = current_zlim[1] - current_zlim[0]

# Calculate the aspect ratios
xy_aspect_ratio = ylim_range / xlim_range
xz_aspect_ratio = zlim_range / xlim_range

# Change xlim to [-1, 1]
new_xlim = (-1, 1)
new_xlim_range = new_xlim[1] - new_xlim[0]

# Adjust ylim and zlim proportionally based on the aspect ratios
new_ylim_range = new_xlim_range * xy_aspect_ratio
new_ylim = (current_ylim[0], current_ylim[0] + new_ylim_range)

new_zlim_range = new_xlim_range * xz_aspect_ratio
new_zlim = (current_zlim[0], current_zlim[0] + new_zlim_range)

# Set the new limits
ax[0].set_xlim(new_xlim)
ax[0].set_ylim(new_ylim)
ax[0].set_zlim(new_zlim)

I will give this a try, thanks for your work.

hasibagen avatar Sep 05 '24 07:09 hasibagen