Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 90 additions & 24 deletions EPI_voxel_shift.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 30,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -49,12 +49,18 @@
" _, y_AP, _, _ = AP.affine @ AP_center\n",
" _, y_PA, _ , _= PA.affine @ PA_center\n",
" shifts.append(abs(y_AP - y_PA))\n",
" \n",
" else:\n",
" shifts.append(np.nan)\n",
"\n",
" print(f\"number of slices with mask in AP: {number_slices_AP}\")\n",
" print(f\"number of slices with mask in PA: {number_slices_PA}\")\n",
" print(f\"number of pixels in AP: {nb_pixels_AP}\")\n",
" print(f\"number of pixels in PA: {nb_pixels_PA}\")\n",
" print(f\"mean shift: {np.mean(shifts)}\")"
" print(f\"mean shift: {np.nanmean(shifts)}\")\n",
" \n",
" for i, shift in enumerate(shifts):\n",
" print(f\"slice {i+1}: {shift}\")"
]
},
{
Expand All @@ -66,18 +72,33 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 31,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"number of slices with mask in AP: 11\n",
"number of slices with mask in PA: 11\n",
"number of pixels in AP: 749.0\n",
"number of pixels in PA: 775.0\n",
"mean shift: 3.9807847795918736\n"
"number of slices with mask in AP: 13\n",
"number of slices with mask in PA: 13\n",
"number of pixels in AP: 805.0\n",
"number of pixels in PA: 819.0\n",
"mean shift: 4.403227149593286\n",
"slice 1: nan\n",
"slice 2: nan\n",
"slice 3: 3.459289659772601\n",
"slice 4: 6.8753930965391525\n",
"slice 5: 10.779171466827393\n",
"slice 6: 8.887372434139252\n",
"slice 7: 7.886060510362899\n",
"slice 8: 5.357269762993489\n",
"slice 9: 4.739796834841272\n",
"slice 10: 2.8452743047241498\n",
"slice 11: 1.090708704261509\n",
"slice 12: 1.3967108246568003\n",
"slice 13: 0.6001472286739151\n",
"slice 14: 0.741037568049645\n",
"slice 15: 2.583720548870648\n"
]
}
],
Expand All @@ -97,7 +118,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 32,
"metadata": {},
"outputs": [
{
Expand All @@ -106,9 +127,24 @@
"text": [
"number of slices with mask in AP: 13\n",
"number of slices with mask in PA: 13\n",
"number of pixels in AP: 711.0\n",
"number of pixels in PA: 862.0\n",
"mean shift: 5.539231485758297\n"
"number of pixels in AP: 849.0\n",
"number of pixels in PA: 876.0\n",
"mean shift: 5.111890294531884\n",
"slice 1: nan\n",
"slice 2: nan\n",
"slice 3: 6.742460469085653\n",
"slice 4: 7.9247696562246865\n",
"slice 5: 10.286327992950252\n",
"slice 6: 6.790706107490944\n",
"slice 7: 4.937285813035409\n",
"slice 8: 3.434184109463409\n",
"slice 9: 2.274467921352887\n",
"slice 10: 1.3046958675856288\n",
"slice 11: 0.8610260039908084\n",
"slice 12: 2.6364640167781275\n",
"slice 13: 3.931505036641312\n",
"slice 14: 4.496688406436096\n",
"slice 15: 10.83399242787928\n"
]
}
],
Expand All @@ -128,18 +164,33 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 33,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"number of slices with mask in AP: 13\n",
"number of slices with mask in PA: 13\n",
"number of pixels in AP: 803.0\n",
"number of pixels in PA: 904.0\n",
"mean shift: 2.101966181237038\n"
"number of slices with mask in AP: 15\n",
"number of slices with mask in PA: 15\n",
"number of pixels in AP: 820.0\n",
"number of pixels in PA: 783.0\n",
"mean shift: 3.0445504886387735\n",
"slice 1: 9.59101279377937\n",
"slice 2: 6.079096371043814\n",
"slice 3: 1.6616114118824825\n",
"slice 4: 2.1331588610123617\n",
"slice 5: 4.6092753410339355\n",
"slice 6: 2.6050749051276867\n",
"slice 7: 2.1473026108385938\n",
"slice 8: 1.0086152570272233\n",
"slice 9: 1.5678794860839815\n",
"slice 10: 2.637978437222529\n",
"slice 11: 1.7728752234886471\n",
"slice 12: 3.9833301878594725\n",
"slice 13: 2.308267021179205\n",
"slice 14: 1.3092882513999982\n",
"slice 15: 2.2534911706023024\n"
]
}
],
Expand All @@ -160,18 +211,33 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 34,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"number of slices with mask in AP: 15\n",
"number of slices with mask in PA: 13\n",
"number of pixels in AP: 880.0\n",
"number of pixels in PA: 878.0\n",
"mean shift: 2.3297521315992045\n"
"number of slices with mask in PA: 15\n",
"number of pixels in AP: 796.0\n",
"number of pixels in PA: 746.0\n",
"mean shift: 2.6118755420771302\n",
"slice 1: 5.041267052130262\n",
"slice 2: 5.100633584536041\n",
"slice 3: 1.130213070401517\n",
"slice 4: 1.4838859421866282\n",
"slice 5: 2.9440719516653715\n",
"slice 6: 2.888957508946355\n",
"slice 7: 2.694792866706848\n",
"slice 8: 2.5471559746902415\n",
"slice 9: 3.3119593217097645\n",
"slice 10: 2.997592203599858\n",
"slice 11: 2.2765323330716356\n",
"slice 12: 3.1917546680995343\n",
"slice 13: 0.7590251761899509\n",
"slice 14: 1.0739337130290671\n",
"slice 15: 1.7363577641938868\n"
]
}
],
Expand Down Expand Up @@ -199,7 +265,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.8"
"version": "3.12.0"
}
},
"nbformat": 4,
Expand Down
Binary file modified data/acdc_226/012/nnUNet_preds/ood_epi_012_AP_mean.nii.gz
100755 → 100644
Binary file not shown.
Binary file modified data/acdc_226/012/nnUNet_preds/ood_epi_012_PA_mean.nii.gz
100755 → 100644
Binary file not shown.
Binary file modified data/acdc_226/012_coil/nnUnet_preds/ood_epi_012_coil_AP_mean.nii.gz
100755 → 100644
Binary file not shown.
Binary file modified data/acdc_226/012_coil/nnUnet_preds/ood_epi_012_coil_PA_mean.nii.gz
100755 → 100644
Binary file not shown.
Binary file modified data/acdc_226/012_coil_dyn/nnUNet_preds/ood_epi_012_coil_dyn_AP_mean.nii.gz
100755 → 100644
Binary file not shown.
Binary file modified data/acdc_226/012_coil_dyn/nnUNet_preds/ood_epi_012_coil_dyn_PA_mean.nii.gz
100755 → 100644
Binary file not shown.
Binary file modified data/acdc_226/baseline/nnUNet_preds/ood_epi_baseline_AP_mean.nii.gz
100755 → 100644
Binary file not shown.
Binary file modified data/acdc_226/baseline/nnUNet_preds/ood_epi_baseline_PA_mean.nii.gz
100755 → 100644
Binary file not shown.