Closed jizhang02 closed 1 year ago
Thanks for the bug report @jizhang02. Yeah these tables are a little tricky to position in matplotlib. For this particular visualisation we will run into problems either way when we want to visualise many structures (table rows) and many metrics (table columns).
One thing you could test is to see if reducing the dose metrics to plot fixes the rendering of the plot. E.g:
fig, df_metrics = visualise_dose(
ct_image,
dose,
structures,
dvh=dvh,
d_points=[0, 95],
v_points=[],
d_cc_points=[],
structure_for_limits=dose>5,
expansion_for_limits=40,
contour_cmap=plt.cm.get_cmap("rainbow"),
dose_cmap=plt.cm.get_cmap("inferno"),
title="TCGA_CV_5977 Dose Metrics")
To support plotting more structures/columns I will need to make the code in the visualise_dose
function more robust, where the table is generated: https://github.com/pyplati/platipy/blob/c145f586169f6a08f7d3c7cb07b73e2e64e7dbd0/platipy/imaging/visualisation/dose.py#L204
Unfortunately I won't have time to look at this over the next month or two. But in case this is something you are working on resolving I'd be curious to hear what you find.
hello,
This problem is solved by adding the code below:
fig, df_metrics = visualise_dose(
...)
figname = '/home/jing/python_code/DeepRT/00data-analysis/dvh.pdf'
plt.show() # this sentence is necessary, otherwise the saved figure has proportion problem.
fig.savefig(figname, dpi=150, orientation='portrait', format='pdf', bbox_inches='tight', pad_inches=0.3) # if need to save
Hello,
When I run the DVH example, the saved figure has an incongruous proportion.![dvh_proportion](https://github.com/pyplati/platipy/assets/46089068/6a24c3c6-c10b-45c6-b85f-c4acd3c8ddce)
I would like to know how to adjust the width of this color bar or the size of the whole figure. Thank you!