Skip to content

Commit

Permalink
Renamed B1+ maps
Browse files Browse the repository at this point in the history
  • Loading branch information
jcohenadad committed Jan 9, 2024
1 parent 9f50c12 commit 733d6a9
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions data_processing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "87a06e2d",
"id": "97f53bfb",
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -330,7 +330,7 @@
" # Siemens maps are in units of flip angle * 10 (in degrees)\n",
" acquired_fa = acquired_fa / 10\n",
"\n",
" # Account for the power loss between the amplifier and the socket. That number was given by Siemens.\n",
" # Account for the power loss between the coil and the socket. That number was given by Siemens.\n",
" voltage_at_socket = ref_voltage * 10 ** -0.095\n",
"\n",
" # Compute B1 map in [T/V]\n",
Expand All @@ -341,7 +341,7 @@
"\n",
" # Save as NIfTI file\n",
" nii_b1 = nib.Nifti1Image(b1_map, nii.affine, nii.header)\n",
" nib.save(nii_b1, f\"{subject}_acq-{shim_mode}_B1plusmap.nii.gz\")"
" nib.save(nii_b1, f\"{subject}_acq-{shim_mode}_TB1map.nii.gz\")"
]
},
{
Expand All @@ -356,7 +356,7 @@
"for subject in subjects:\n",
" os.chdir(os.path.join(path_data, subject, \"fmap\"))\n",
" for shim_mode in shim_modes:\n",
" !sct_extract_metric -i {subject}_acq-{shim_mode}_b1plusmap.nii.gz -f {subject}_acq-anat{shim_mode}_TB1TFL_seg.nii.gz -method wa -vert 1:9 -vertfile {subject}_acq-anat{shim_mode}_TB1TFL_seg_labeled.nii.gz -perslice 1 -o TB1TFL_{shim_mode}.csv"
" !sct_extract_metric -i {subject}_acq-{shim_mode}_TB1map.nii.gz -f {subject}_acq-anat{shim_mode}_TB1TFL_seg.nii.gz -method wa -vert 1:9 -vertfile {subject}_acq-anat{shim_mode}_TB1TFL_seg_labeled.nii.gz -perslice 1 -o TB1map_{shim_mode}.csv"
]
},
{
Expand All @@ -367,7 +367,6 @@
"outputs": [],
"source": [
"# Make figure of B1+ values along the spinal cord across shim methods\n",
"# WIP\n",
"\n",
"import pandas as pd\n",
"import matplotlib.pyplot as plt\n",
Expand All @@ -377,8 +376,7 @@
"os.chdir(os.path.join(path_data, subject, \"fmap\"))\n",
"\n",
"# Pattern to match all files starting with 'TB1TFL_' and ending with '.csv'\n",
"file_pattern = f\"TB1TFL_*.csv\"\n",
"\n",
"file_pattern = f\"TB1map_*.csv\"\n",
"\n",
"# Initialize a matplotlib figure\n",
"plt.figure(figsize=(10, 6))\n",
Expand Down

0 comments on commit 733d6a9

Please sign in to comment.