diff --git a/data_processing.ipynb b/data_processing.ipynb index 70c24b9..02c19b7 100644 --- a/data_processing.ipynb +++ b/data_processing.ipynb @@ -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}" ] }, { @@ -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": {