allow iCOM to be comparison to accept multiple records
"metadata": {},
"outputs": [],
"source": [
- "patient_id = '015139'"
+ "patient_id = '014495'"
]
},
{
"metadata": {},
"outputs": [],
"source": [
- "monaco_plan_and_file_name = 'DIBHLBREAST/rxB_tel.1' # plan directory and file name\n",
- "icom_delivery = '20200214_114704' # iCOM timestamp"
+ "monaco_plan_and_file_name = 'RAXILLARETREAT/tel.1' # plan directory and file name\n",
+ "icom_deliveries = ['20020101_054014'] # iCOM timestamps"
]
},
{
"metadata": {},
"outputs": [],
"source": [
- "icom_path = list(icom_directory.glob(f'{patient_id}_*/{icom_delivery}.xz'))[-1]\n",
- "icom_path"
+ "icom_paths = []\n",
+ "\n",
+ "for icom_delivery in icom_deliveries:\n",
+ " icom_paths += list(icom_directory.glob(f'{patient_id}_*/{icom_delivery}.xz'))\n",
+ "\n",
+ "icom_paths"
]
},
{
"metadata": {},
"outputs": [],
"source": [
+ "icom_streams = []\n",
+ "\n",
+ "for icom_path in icom_paths:\n",
" with lzma.open(icom_path, 'r') as f:\n",
- " icom_stream = f.read()"
+ " icom_streams += [f.read()]"
]
},
{
"metadata": {},
"outputs": [],
"source": [
- "delivery_icom = pymedphys.Delivery.from_icom(icom_stream)\n",
+ "deliveries_icom = []\n",
+ "\n",
+ "for icom_stream in icom_streams:\n",
+ " deliveries_icom += [pymedphys.Delivery.from_icom(icom_stream)]"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
"delivery_tel = pymedphys.Delivery.from_monaco(tel_path)"
]
},
"metadata": {},
"outputs": [],
"source": [
- "mudensity_icom = delivery_icom.mudensity()\n",
"mudensity_tel = delivery_tel.mudensity()"
]
},
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "mudensity_icom = np.zeros_like(mudensity_tel)\n",
+ "\n",
+ "for delivery_icom in deliveries_icom:\n",
+ " mudensity_icom = mudensity_icom + delivery_icom.mudensity()"
+ ]
+ },
{
"cell_type": "markdown",
"metadata": {},
" f\"Plan Name: {tel_path.parent.name}\\n\"\n",
")\n",
"\n",
+ "icom_path_strings = '\\n '.join([str(icom_path) for icom_path in icom_paths])\n",
+ "\n",
"footer_text = (\n",
" f\"tel.1 file path: {str(tel_path)}\\n\"\n",
- " f\"icom file path: {str(icom_path)}\\n\"\n",
+ " f\"icom file path: {icom_path_strings}\\n\"\n",
" f\"results path: {str(results_dir)}\"\n",
")\n",
"\n",
