Skip to content

Commit

Permalink
Extract B1+ values along the cord
Browse files Browse the repository at this point in the history
  • Loading branch information
jcohenadad committed Dec 23, 2023
1 parent 5fdcfa9 commit 3c56ddb
Showing 1 changed file with 61 additions and 7 deletions.
68 changes: 61 additions & 7 deletions data_processing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"\n",
"For each subject:\n",
"\n",
"- Segment the SC on GRE scan\n",
"- Segment the spinal cord on GRE scan\n",
"- Label vertebral levels on GRE scan using existing manual disc labels\n",
"- Extract the signal intensity on the GRE scan within the spinal cord\n",
"- Register each B1 map (CP, CoV, etc.) to the GRE scan\n",
Expand Down Expand Up @@ -147,7 +147,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "ab6a7dbe",
"id": "95cafe0d",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -157,7 +157,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "4e1a6ae1",
"id": "6137bb2b",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -173,7 +173,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "90deb5e5",
"id": "862dc562",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -186,6 +186,33 @@
" !sct_crop_image -i {subject}_acq-CoV_T2starw_seg_labeled.nii.gz -m {subject}_acq-CoV_T2starw_seg.nii.gz -dilate 20x20x0 -o {subject}_acq-CoV_T2starw_crop_seg_labeled.nii.gz "
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "c46e8d9a",
"metadata": {},
"outputs": [],
"source": [
"# Register the other shim methods to the GRE CoV scan\n",
"\n",
"# TODO"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "90deb5e5",
"metadata": {},
"outputs": [],
"source": [
"# Extract the signal intensity on the GRE scan within the spinal cord\n",
"\n",
"for subject in subjects:\n",
" # TODO: loop across other shim methods \n",
" os.chdir(os.path.join(path_data, subject, \"anat\"))\n",
" !sct_extract_metric -i {subject}_acq-CoV_T2starw_crop.nii.gz -f {subject}_acq-CoV_T2starw_crop_seg.nii.gz -method wa -vert 1:9 -vertfile {subject}_acq-CoV_T2starw_crop_seg_labeled.nii.gz -append 1 -perslice 1 -o gre_CoV.csv\n"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -203,7 +230,7 @@
},
{
"cell_type": "markdown",
"id": "679f1193",
"id": "39de4623",
"metadata": {},
"source": [
"## Verify QC report (B1maps to GRE registration)\n",
Expand All @@ -214,7 +241,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "623c26cd",
"id": "6a6d7670",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -230,12 +257,39 @@
{
"cell_type": "code",
"execution_count": null,
"id": "ef34c2a1",
"id": "a835cdee",
"metadata": {},
"outputs": [],
"source": [
"# Convert the B1 map to nT/V units\n",
"\n",
"# TODO"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "740fda91",
"metadata": {},
"outputs": [],
"source": [
"# Extract B1+ value along the spinal cord\n",
"\n",
"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-famp{shim_mode}_TB1TFL.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 -append 1 -perslice 1 -o TB1TFL_{shim_mode}.csv"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "b0185bb0",
"metadata": {},
"outputs": [],
"source": [
"# Make figure of B1+ values along the spinal cord across shim methods\n",
"\n",
"# TODO"
]
}
Expand Down

0 comments on commit 3c56ddb

Please sign in to comment.