show table instead of showing 'closest cutout' in electron factor code
"import pandas as pd\n",
"import matplotlib.pyplot as plt\n",
"\n",
+ "from IPython import display\n",
+ "\n",
"import shapely"
]
},
"outputs": [],
"source": [
"rccc_string_search_pattern = (\n",
- " r'\\\\MONACODA\\FocalData\\RCCC\\1~Clinical\\*{}\\plan\\*\\*tel.1'.format(patientID))\n",
+ " r'\\\\monacoda\\FocalData\\RCCC\\1~Clinical\\*{}\\plan\\*\\*tel.1'.format(patientID))\n",
"rccc_filepath_list = glob(rccc_string_search_pattern)\n",
"\n",
"nbccc_string_search_pattern = (\n",
- " r'X:\\NBCCC\\1~Clinical\\*{}\\plan\\*\\*tel.1'.format(patientID))\n",
+ " r'\\\\tunnel-nbcc-monaco\\FOCALDATA\\NBCCC\\1~Clinical\\*{}\\plan\\*\\*tel.1'.format(patientID))\n",
"nbccc_filepath_list = glob(nbccc_string_search_pattern)\n",
"\n",
"sash_string_search_pattern = (\n",
- " r'W:\\SASH\\1~Clinical\\*{}\\plan\\*\\*tel.1'.format(patientID))\n",
+ " r'\\\\tunnel-sash-monaco\\Users\\Public\\Documents\\CMS\\FocalData\\SASH\\1~Clinical\\*{}\\plan\\*\\*tel.1'.format(patientID))\n",
"sash_filepath_list = glob(sash_string_search_pattern)\n",
"\n",
"\n",
" plot_model(\n",
" width_data[reference], length_data[reference], factor_data[reference])\n",
" \n",
+ " plt.show()\n",
" \n",
- " weighted_difference_squares = (\n",
- " (width_data[reference] - width) ** 2 + \n",
- " 0.5 * (length_data[reference] - length) ** 2\n",
- " )\n",
- " closest_cutout = np.argmin(weighted_difference_squares)\n",
- " closest_width = width_data[reference][closest_cutout]\n",
- " closest_length = length_data[reference][closest_cutout]\n",
- " closest_factor = factor_data[reference][closest_cutout]\n",
- " print('')\n",
- " print(\n",
- " \"Closest cutout within data\\n\"\n",
- " \" Width: {0:0.2f} cm\\n\"\n",
- " \" Length: {1:0.2f} cm\\n\"\n",
- " \" Factor: {2:0.3f}\".format(closest_width, closest_length, closest_factor)\n",
+ " reference_data_table = pd.concat(\n",
+ " [\n",
+ " width_data[reference],\n",
+ " length_data[reference],\n",
+ " factor_data[reference]\n",
+ " ],\n",
+ " axis=1 \n",
" )\n",
+ " reference_data_table.sort_values(\n",
+ " ['RCCC Inverse factor (dose open / dose cutout)'], \n",
+ " ascending=False, inplace=True)\n",
" \n",
- " plt.show()"
+ " display.display(reference_data_table) "
]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": []
}
],
"metadata": {
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
- "version": "3.7.5"
+ "version": "3.7.0"
}
},
"nbformat": 4,
