courtois-neuromod / anat-processing-book

A notebook that describes the processing of anatomical data for the Courtois-Neuromod Project.
https://courtois-neuromod.github.io/anat-processing-book/
Creative Commons Zero v1.0 Universal
7 stars 2 forks source link

Version 2 - Itemized plan / to-do list #42

Closed mathieuboudreau closed 2 years ago

mathieuboudreau commented 2 years ago

branch: v2

This issue is to centralize the action plan for revamping this book (version 2), which we are doing from scratch.

It's mostly a list for myself, which I'll update as I go along, but writing it out here for transparency, feedback, and to follow progress.

Create new branch

Upgrade all frameworks and dependencies to latest versions

Create simple data plot that's generalizable when subjects are added

(Use brain WM T1 dataset)

(more items to be added)

mathieuboudreau commented 2 years ago

@jcohenadad I've made substantial progress, but there is still work to do, in particular with extending some of my new features to be compatible with the spine datasets.

Here are the major updates so far:

Note that I've not documented my classes yet, as it's still a WIP and might continue to change significantly until it's compatible with the spinal cord datasets.

Also note that the implementation I've done so far only aims to reproduce @zelenkastiot's original figures but with the new code. Once the implementation is complete and reproducible for both datasets, then it should be much easier to change some plot options or how we display the data.

The user-end experience should be much better now too. To compare the old vs new UX, see the book here and compare the old implementation code ("Legacy" section, brain data) vs. my [new implementation] (https://courtois-neuromod.github.io/anat-processing-book/1-brain-data-new.html) ("New pages" section, brain data). Note: if you want to run this in a Jupyter Notebok and see the plots, you'll need to change fig_gm.display('jupyter-book', tissue = 'GM') to fig_gm.display('notebook', tissue = 'GM').

p.s. One last note: MyBinder's been giving me a lot of trouble this year - today, I wasn't able to spin up this notebook on there. I'm not sure if NeuroLibre's servers are more stable at the moment (we lost our server support person a few weeks ago), so just an FYI if you wanted to try out any of this code above, for the moment, you might need to clone locally and install dependencies.

jcohenadad commented 2 years ago

@mathieuboudreau Thank you very much for this push. This is exactly what I had in mind in terms of refactoring (ie, limiting duplication, cleaner 'code' display on the book).

As you said, we can tweak the plots a bit more later (eg: the 'dot' and 'dashed lines' on the figure legend are wrong, because it should say 'Individual' and 'Mean').

jcohenadad commented 2 years ago

I tried loading the notebook into MyBinder and got this:

image

mathieuboudreau commented 2 years ago

I tried loading the notebook into MyBinder and got this:

image

Yes I'm aware – I wrote about it in the p.s. at the end of my post above. MyBinder's been very flaky these recent months, I'm going to look into if I can use NeuroLibre's servers prior to submission there and if they're currently more stable, I don't recall.

mathieuboudreau commented 2 years ago

Update: I've integrated and refactored a bit the spinal cord cross sectional WM T1w/T2w plots. The only plots missing to be reproduced are one of the spinal GM T1w/T2w plots, and the spinal cord qMRI plot (MTR, T1, etc). This should be straightforward though.

After those are made, I'll remove the old "Kiril" section in the book and will merge it as a first version.

Note however, that because of how Kiril had originally customized the brain vs spinal plots, there remains some code duplication in my refactoring (some if brain else spinal sections), which I think could be simplified with some planning, but this leads me to my next point.

At this point @jcohenadad , I think it would be good to know what is the highest priority to do next. Would it be 1) simplify the code even further to that it is more flexible and easier to create plots with new/different data, or 2) to start polishing the front-end and leaving some of the "spaghetti code" (if brain, else spine) to a lower priority? It might be that while working on 2), I can incrementally work on some parts of 1), but my feeling is that 2) is higher priority now right? Are there any deadlines/goals we're aiming at? Maybe now could be a good time to have a meeting if you want to discuss further.

mathieuboudreau commented 2 years ago

Resolved in #43