|
2428 | 2428 | ] |
2429 | 2429 | }, |
2430 | 2430 | { |
2431 | | - "cell_type": "code", |
2432 | | - "execution_count": 16, |
2433 | | - "id": "f4bf7ccc-2b80-4792-8379-408c3c65b4c3", |
2434 | 2431 | "metadata": {}, |
| 2432 | + "cell_type": "code", |
2435 | 2433 | "outputs": [], |
| 2434 | + "execution_count": null, |
2436 | 2435 | "source": [ |
2437 | 2436 | "import numpy as np\n", |
2438 | 2437 | "import pandas as pd\n", |
|
2447 | 2446 | " motion_parameters.append([tx, ty, tz, rx, ry, rz])\n", |
2448 | 2447 | "\n", |
2449 | 2448 | "motion_parameters = np.array(motion_parameters)\n", |
2450 | | - "estimated_fd = compute_fd_from_motion(motion_parameters)\n", |
2451 | | - "\n", |
2452 | | - "# Creating a DataFrame for better visualization\n", |
2453 | | - "df_motion = pd.DataFrame(\n", |
2454 | | - " {\n", |
2455 | | - " \"Frame\": np.arange(len(estimated_fd)),\n", |
2456 | | - " \"Translation X\": motion_parameters[:, 0],\n", |
2457 | | - " \"Translation Y\": motion_parameters[:, 1],\n", |
2458 | | - " \"Translation Z\": motion_parameters[:, 2],\n", |
2459 | | - " \"Rotation X\": motion_parameters[:, 3],\n", |
2460 | | - " \"Rotation Y\": motion_parameters[:, 4],\n", |
2461 | | - " \"Rotation Z\": motion_parameters[:, 5],\n", |
2462 | | - " \"Framewise Displacement (mm)\": estimated_fd,\n", |
2463 | | - " }\n", |
2464 | | - ")" |
2465 | | - ] |
| 2449 | + "estimated_fd = compute_fd_from_motion(motion_parameters)" |
| 2450 | + ], |
| 2451 | + "id": "d3627d44376b27f4" |
2466 | 2452 | }, |
2467 | 2453 | { |
2468 | | - "cell_type": "code", |
2469 | | - "execution_count": 19, |
2470 | | - "id": "92cceeda-6e40-4cdc-9129-5ffce477af84", |
2471 | 2454 | "metadata": {}, |
2472 | | - "outputs": [ |
2473 | | - { |
2474 | | - "name": "stderr", |
2475 | | - "output_type": "stream", |
2476 | | - "text": [ |
2477 | | - "/var/folders/0d/tx6_gy7951749z57rjjkkl_m0000gn/T/ipykernel_5538/1383021636.py:33: UserWarning: FigureCanvasAgg is non-interactive, and thus cannot be shown\n", |
2478 | | - " plt.show()\n" |
2479 | | - ] |
2480 | | - } |
2481 | | - ], |
| 2455 | + "cell_type": "code", |
| 2456 | + "outputs": [], |
| 2457 | + "execution_count": null, |
2482 | 2458 | "source": [ |
2483 | 2459 | "# Set up the matplotlib figure\n", |
2484 | 2460 | "import matplotlib.pyplot as plt\n", |
|
2490 | 2466 | "plot_volumewise_motion(np.arange(len(estimated_fd)), motion_parameters)\n", |
2491 | 2467 | "\n", |
2492 | 2468 | "plt.show()" |
2493 | | - ] |
| 2469 | + ], |
| 2470 | + "id": "4f141ebdb1643673" |
2494 | 2471 | }, |
2495 | 2472 | { |
2496 | 2473 | "metadata": {}, |
|
0 commit comments