Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add MPRAGE processing and visualisation #46

Merged
merged 11 commits into from
Jan 16, 2024
Merged

Add MPRAGE processing and visualisation #46

merged 11 commits into from
Jan 16, 2024

Conversation

dpapp86
Copy link
Collaborator

@dpapp86 dpapp86 commented Jan 11, 2024

Clarifies text wrt choice of CoV GRE and MPRAGE for segmentation

Fixes #37
Fixes #38
Fixes #39
Fixes #43
Fixes #45

Clarifies text wrt choice of CoV GRE and MPRAGE for segmentation

fixes #43 
fixes #45 

Various minor comments regarding definition of variables (hard to rerun)
@dpapp86
Copy link
Collaborator Author

dpapp86 commented Jan 11, 2024

@jcohenadad please review

This should contain everything needed to process MPRAGE scans and create the associated figure

@dpapp86
Copy link
Collaborator Author

dpapp86 commented Jan 11, 2024

also adresses #38

@dpapp86 dpapp86 changed the title Update data_processing.ipynb to include MPRAGE processing and visalusation Update data_processing.ipynb to include MPRAGE processing and visualisation Jan 11, 2024
@@ -163,13 +168,14 @@
"source": [
"# Define useful variables\n",
"\n",
"path_data = os.getcwd()\n",
"path_data = os.getcwd() #works if and only if this is run first and once. Otherwise it will pick up whatever the current directory is if someone wanted to rerun it\n",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the motivation for #33

No need to add a comment in the notebook (better to fix #33 instead)

"# shim_modes = [\"CP\", \"CoV\"] # debugging\n",
"print(f\"shim_modes: {shim_modes}\")\n",
"subjects = sorted(glob.glob(\"sub-*\"))\n",
"subjects = sorted(glob.glob(\"sub-*\")) #Same problem with rerunning it if the cwd is not the ds004906 root\n",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

data_processing.ipynb Outdated Show resolved Hide resolved
@@ -259,12 +269,12 @@
"metadata": {},
"outputs": [],
"source": [
"# Extract the signal intensity on the GRE scan within the spinal cord between levels C1 and T2 (included)\n",
"# Extract the signal intensity on the GRE scan within the spinal cord between levels C3 and T2 (included)\n",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is outside the scope of this PR.

@jcohenadad
Copy link
Member

also adresses #38

that should go in the PR body-- i've added it

Copy link
Member

@jcohenadad jcohenadad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on 36bb2d7 I'm getting:

---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
Cell In[9], line 8
      6 os.chdir(os.path.join(path_data, subject, "anat"))
      7 CoV_flatten=glob.glob(os.path.join(path_data, subject, "anat", f"{subject}_acq-CoV_T1w_crop_flatten.nii.gz"))
----> 8 CoV_flatten=CoV_flatten[0]
      9 CoV_flatten_data=nib.load(CoV_flatten).get_fdata()
     10 CP_flatten=glob.glob(os.path.join(path_data, subject, "anat", f"{subject}_acq-CP_T1w_reg_flatten.nii.gz"))

IndexError: list index out of range

False alarm: I forgot to run required cells before :🤦

Copy link
Member

@jcohenadad jcohenadad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vertebral labeling failing for sub-02 and sub-04:

Screenshot 2024-01-15 at 10 15 26 PM

Screenshot 2024-01-15 at 10 15 28 PM

@jcohenadad jcohenadad changed the title Update data_processing.ipynb to include MPRAGE processing and visualisation Add MPRAGE processing and visualisation Jan 16, 2024
@jcohenadad jcohenadad merged commit 30753b9 into main Jan 16, 2024
@jcohenadad jcohenadad deleted the dpapp86-patch-2 branch January 16, 2024 03:46
@jcohenadad jcohenadad mentioned this pull request Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants