Skip to content

Commit

Permalink
Added vertebral labeling and warping of segs
Browse files Browse the repository at this point in the history
  • Loading branch information
jcohenadad committed Dec 23, 2023
1 parent b39f85e commit 10251de
Showing 1 changed file with 54 additions and 2 deletions.
56 changes: 54 additions & 2 deletions data_processing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,24 @@
"id": "aac9d889",
"metadata": {},
"source": [
"## Verify quality control (QC) report\n",
"## Verify QC report (GRE segmentation)\n",
"\n",
"Open the QC report located under `ds004906/qc/index.html`. Make sure the segmentations and registrations are correct before resuming the analysis."
"Open the quality control (QC) report located under `ds004906/qc/index.html`. Make sure the spinal cord segmentations are correct before resuming the analysis."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "34fd14bc",
"metadata": {},
"outputs": [],
"source": [
"# Label vertebrae on GRE scan\n",
"\n",
"# Given the low resolution of the GRE scan, the automatic detection of C2-C3 disc is unreliable. Therefore we need to use the manual disc labels that are part of the dataset.\n",
"for subject in subjects:\n",
" os.chdir(os.path.join(path_data, subject, \"anat\"))\n",
"# !sct_label_vertebrae -i {subject}_acq-CoV_T2starw.nii.gz -s {subject}_acq-CoV_T2starw_seg.nii.gz -c t2 -initz -qc {path_qc}"
]
},
{
Expand Down Expand Up @@ -170,6 +185,43 @@
" for shim_mode in shim_modes:\n",
" !sct_register_multimodal -i {subject}_acq-anat{shim_mode}_TB1TFL.nii.gz -d ../anat/{subject}_acq-CoV_T2starw_crop.nii.gz -dseg ../anat/{subject}_acq-CoV_T2starw_crop_seg.nii.gz -param step=1,type=im,algo=slicereg,metric=CC -qc {path_qc}"
]
},
{
"cell_type": "markdown",
"id": "4952bdfa",
"metadata": {},
"source": [
"## Verify QC report (B1maps to GRE registration)\n",
"\n",
"Open the QC report located under `ds004906/qc/index.html`. Make sure the registration are correct before resuming the analysis."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "5fb3101a",
"metadata": {},
"outputs": [],
"source": [
"# Warping spinal cord segmentation to each B1 map\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_apply_transfo -i ../anat/{subject}_acq-CoV_T2starw_crop_seg.nii.gz -d {subject}_acq-anat{shim_mode}_TB1TFL.nii.gz -w warp_{subject}_acq-CoV_T2starw_crop2{subject}_acq-anat{shim_mode}_TB1TFL.nii.gz -x linear"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "f476b7ac",
"metadata": {},
"outputs": [],
"source": [
"# Extract B1+ value along the spinal cord\n",
"\n",
"# TODO"
]
}
],
"metadata": {
Expand Down

0 comments on commit 10251de

Please sign in to comment.