|
111 | 111 | "import os\n", |
112 | 112 | "\n", |
113 | 113 | "import skimage.transform as skt\n", |
| 114 | + "\n", |
114 | 115 | "import viqa\n", |
115 | 116 | "from viqa import MultipleMetrics, load_data" |
116 | 117 | ] |
|
137 | 138 | "outputs": [], |
138 | 139 | "source": [ |
139 | 140 | "# Change the project name and results folder\n", |
140 | | - "results_path = \"/path/to/results\" # make sure this path exists before running the notebook\n", |
| 141 | + "results_path = (\n", |
| 142 | + " \"/path/to/results\" # make sure this path exists before running the notebook\n", |
| 143 | + ")\n", |
141 | 144 | "project_name = \"image_comparison\"\n", |
142 | 145 | "\n", |
143 | 146 | "# Choose the slice to visualize in the report, only one slice should be chosen\n", |
|
173 | 176 | ] |
174 | 177 | }, |
175 | 178 | { |
176 | | - "metadata": {}, |
177 | 179 | "cell_type": "markdown", |
178 | | - "source": "## Data Loading", |
179 | | - "id": "4fe1f2f0327339a1" |
| 180 | + "id": "4fe1f2f0327339a1", |
| 181 | + "metadata": {}, |
| 182 | + "source": "## Data Loading" |
180 | 183 | }, |
181 | 184 | { |
182 | 185 | "cell_type": "code", |
|
225 | 228 | ] |
226 | 229 | }, |
227 | 230 | { |
228 | | - "metadata": {}, |
229 | 231 | "cell_type": "markdown", |
230 | | - "source": "## Image Statistics", |
231 | | - "id": "4a434d2014297e90" |
| 232 | + "id": "4a434d2014297e90", |
| 233 | + "metadata": {}, |
| 234 | + "source": "## Image Statistics" |
232 | 235 | }, |
233 | 236 | { |
234 | | - "metadata": {}, |
235 | 237 | "cell_type": "markdown", |
236 | | - "source": "### Reference Image", |
237 | | - "id": "aa0db190908d6b4" |
| 238 | + "id": "aa0db190908d6b4", |
| 239 | + "metadata": {}, |
| 240 | + "source": "### Reference Image" |
238 | 241 | }, |
239 | 242 | { |
240 | | - "metadata": {}, |
241 | 243 | "cell_type": "code", |
242 | | - "outputs": [], |
243 | 244 | "execution_count": null, |
| 245 | + "id": "b487df468724b444", |
| 246 | + "metadata": {}, |
| 247 | + "outputs": [], |
244 | 248 | "source": [ |
245 | 249 | "# Calculate and print statistics for reference image\n", |
246 | 250 | "img_r.calculate_statistics()\n", |
247 | 251 | "img_r.describe()" |
248 | | - ], |
249 | | - "id": "b487df468724b444" |
| 252 | + ] |
250 | 253 | }, |
251 | 254 | { |
252 | | - "metadata": {}, |
253 | 255 | "cell_type": "markdown", |
254 | | - "source": "### Modified Image", |
255 | | - "id": "a4866d4774a074b3" |
| 256 | + "id": "a4866d4774a074b3", |
| 257 | + "metadata": {}, |
| 258 | + "source": "### Modified Image" |
256 | 259 | }, |
257 | 260 | { |
258 | | - "metadata": {}, |
259 | 261 | "cell_type": "code", |
260 | | - "outputs": [], |
261 | 262 | "execution_count": null, |
| 263 | + "id": "2938c602ee3be7ea", |
| 264 | + "metadata": {}, |
| 265 | + "outputs": [], |
262 | 266 | "source": [ |
263 | 267 | "# Calculate and print statistics for modified image\n", |
264 | 268 | "img_m.calculate_statistics()\n", |
265 | 269 | "img_m.describe()" |
266 | | - ], |
267 | | - "id": "2938c602ee3be7ea" |
| 270 | + ] |
268 | 271 | }, |
269 | 272 | { |
270 | 273 | "cell_type": "markdown", |
|
328 | 331 | "# Run this to visualize centers\n", |
329 | 332 | "if calc_cnr:\n", |
330 | 333 | " metric_cnr = viqa.CNR(**cnr_load_parameters)\n", |
331 | | - " metric_cnr.set_centers(img=img_m, signal_center=cnr_calc_parameters[\"signal_center\"], background_center=cnr_calc_parameters[\"background_center\"], radius=cnr_calc_parameters[\"radius\"])" |
| 334 | + " metric_cnr.set_centers(\n", |
| 335 | + " img=img_m,\n", |
| 336 | + " signal_center=cnr_calc_parameters[\"signal_center\"],\n", |
| 337 | + " background_center=cnr_calc_parameters[\"background_center\"],\n", |
| 338 | + " radius=cnr_calc_parameters[\"radius\"],\n", |
| 339 | + " )" |
332 | 340 | ] |
333 | 341 | }, |
334 | 342 | { |
|
370 | 378 | "# Run this to visualize center\n", |
371 | 379 | "if calc_snr:\n", |
372 | 380 | " metric_snr = viqa.SNR(**snr_load_parameters)\n", |
373 | | - " metric_snr.set_centers(img=img_m, signal_center=snr_calc_parameters[\"signal_center\"], radius=snr_calc_parameters[\"radius\"])" |
| 381 | + " metric_snr.set_centers(\n", |
| 382 | + " img=img_m,\n", |
| 383 | + " signal_center=snr_calc_parameters[\"signal_center\"],\n", |
| 384 | + " radius=snr_calc_parameters[\"radius\"],\n", |
| 385 | + " )" |
374 | 386 | ] |
375 | 387 | }, |
376 | 388 | { |
|
754 | 766 | "source": [ |
755 | 767 | "# Change types of reports you want to generate\n", |
756 | 768 | "# img_r, img_m are for parameter ``image``.\n", |
757 | | - "multiple.report(csv=True, metadata=True, text=True, image=True, file_path=results_path, project_name=project_name, export_image=True, img_r=img_r, img_m=img_m, **slice_vis)" |
| 769 | + "multiple.report(\n", |
| 770 | + " csv=True,\n", |
| 771 | + " metadata=True,\n", |
| 772 | + " text=True,\n", |
| 773 | + " image=True,\n", |
| 774 | + " file_path=results_path,\n", |
| 775 | + " project_name=project_name,\n", |
| 776 | + " export_image=True,\n", |
| 777 | + " img_r=img_r,\n", |
| 778 | + " img_m=img_m,\n", |
| 779 | + " **slice_vis,\n", |
| 780 | + ")" |
758 | 781 | ] |
759 | 782 | } |
760 | 783 | ], |
|
0 commit comments