Skip to content

Commit

Permalink
more cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
skoudoro committed Sep 8, 2023
1 parent 30ee58f commit 88f5f3a
Show file tree
Hide file tree
Showing 53 changed files with 69 additions and 992 deletions.
24 changes: 1 addition & 23 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ help:

clean:
-rm -rf _build/*
-rm *-stamp

gitwash-update:
python ../tools/gitwash_dumper.py devel dipy --repo-name=dipy --github-user=dipy \
Expand Down Expand Up @@ -71,9 +70,7 @@ qthelp:
@echo "To view the help file:"
@echo "# assistant -collectionFile _build/qthelp/dipy.qhc"

latex: rstexamples latex-after-examples

latex-after-examples:
latex:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) _build/latex
@echo
@echo "Build finished; the LaTeX files are in _build/latex."
Expand All @@ -95,22 +92,3 @@ doctest:
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) _build/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in _build/doctest/output.txt."

rstexamples: rstexamples-stamp
rstexamples-stamp:
cd examples_built && ../../tools/make_examples.py
touch $@

pdf: pdf-stamp
pdf-stamp: latex
cd _build/latex && make all-pdf
touch $@

upload: html
./upload-gh-pages.sh _build/html/ dipy dipy

xvfb:
export TEST_WITH_XVFB=true && make html

memory_profile:
export TEST_WITH_MEMPROF=true && make html
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
14 changes: 0 additions & 14 deletions _templates/documentation.html

This file was deleted.

3 changes: 3 additions & 0 deletions blog.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
====
Blog
====
2 changes: 1 addition & 1 deletion conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
'github',
'ablog',
'jinja'
]
]

# ghissue config
github_project_url = "https://github.com/dipy/dipy.org"
Expand Down
19 changes: 0 additions & 19 deletions doc-requirements.txt

This file was deleted.

17 changes: 0 additions & 17 deletions documentation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,9 @@ Documentation
introduction
mission
installation
data
examples_built/index
interfaces/index
faq
developers
cite
devel/index
theory/index
reference/index
reference_cmd/index
api_changes

.. Main content will be displayed using the jinja template
..
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

2 changes: 1 addition & 1 deletion glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

Affine matrix
A matrix implementing an :term:`affine transformation` in
:term:`homogenous coordinates`. For a 3 dimensional transform, the
:term:`Homogeneous coordinates`. For a 3 dimensional transform, the
matrix is shape 4 by 4.

Affine transformation
Expand Down
2 changes: 1 addition & 1 deletion index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ As an exercise, you can try to calculate `color FA` with your datasets. You will
to replace the filepaths `fdwi`, `fbval` and `fbvec`. Here is what
a slice should look like.

.. image:: _static/colorfa.png
.. image:: _static/images/colorfa.png
:align: center

**********
Expand Down
2 changes: 1 addition & 1 deletion introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ guidelines and try the :ref:`examples`. Didn't find what you are looking for?
Then try :ref:`faq` and then if this doesn't help send an e-mail to our
e-mail list [email protected] with subject starting with ``[DIPY]``.

.. figure:: _static/pretty_tracks.png
.. figure:: _static/images/pretty_tracks.png
:align: center

This is a depiction of tractography created with DIPY.
Expand Down
34 changes: 20 additions & 14 deletions posts/2023/2023_05_29_Shilpi_Week_0_1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@ About Myself
~~~~~~~~~~~~

Hey there! I'm Shilpi, a Computer Science and Engineering undergrad at Dayananda Sagar College of Engineering, Bangalore. I'm on track to grab my degree in 2024.
My relationship with Python started just before I started college - got my hands dirty with this awesome Python Specialization course on Coursera.
My relationship with Python started just before I started college - got my hands dirty with this awesome Python Specialization course on Coursera.
When it comes to what makes me tick, it's all things tech. I mean, new technology always excites me. Ubuntu, with its fancy terminal and all, used to intimidate me at first, but now, I get a thrill out of using it to do even the simplest things.
Up until 2nd year I used to do competitive programming and a bit of ML. But from 3rd year I've been into ML very seriously, doing several courses on ML as well solving ML problems on kaggle. ML is very fun and I've done a few project on ML as well.
Coding? Absolutely love it. It's like, this is what I was meant to do, y'know? I got introduced to git and GitHub in my first year - was super curious about how the whole version control thing worked. And then, I stumbled upon the world of open source in my second year and made my first contribution to Tardis: (`https://github.com/tardis-sn/tardis/pull/1825`_)
Up until 2nd year I used to do competitive programming and a bit of ML. But from 3rd year I've been into ML very seriously, doing several courses on ML as well solving ML problems on kaggle. ML is very fun and I've done a few project on ML as well.
Coding? Absolutely love it. It's like, this is what I was meant to do, y'know? I got introduced to git and GitHub in my first year - was super curious about how the whole version control thing worked. And then, I stumbled upon the world of open source in my second year and made my first contribution to Tardis: (`<https://github.com/tardis-sn/tardis/pull/1825>`_)
Initially, I intended on doing GSoC during my second year but ended up stepping back for reasons. This time, though, I was fired up to send in a proposal to at least one organization in GSoC. And, well, here we are!

Intro to Open-Source and GSoC
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

So, I started off finding out about GSoC - how many hours do selected folks put in, the kind of projects people usually tackle, and all that stuff. To get a handle on what they want in a proposal, I turned to some successful ones from previous years. Really gave me an idea of the kind of stuff they expect you to bring to the table.
Trying to find the organization that'd go with my skill set, I stumbled upon Python Software Foundation, and I was like, "This is it!". And under PSF, there was DIPY.
Trying to find the organization that'd go with my skill set, I stumbled upon Python Software Foundation, and I was like, "This is it!". And under PSF, there was DIPY.
Diving into DIPY's docs was a breeze as they've got it so well put together that I managed to get my head around a completely new topic, "Diffusion MRI", just by going through their introductory docs and a bit of gpt.
While exploring DIPY, I noticed this issue that needed a new feature. It took a good bit of reading to really understand what they were looking for and how to actually build that feature. And then, I submitted my first PR (`check it out here: https://github.com/dipy/dipy/pull/2749`_)! Getting it merged wasn't exactly easy - there was a lot of room for improvement up in my code, but honestly, I feel like it's all part of the learning curve.
I was a bit of a latecomer to GSoC, so I didn't have much time to make up a ton of PRs. Plus, by the time I'd submitted my first PR, the proposal submission period had already begun. So, I focused all my energy on increasing my knowledge on the topic and polishing my proposal. Plus, I'd wanted to get my proposal reviewed at least once before I submitted it.
While exploring DIPY, I noticed this issue that needed a new feature. It took a good bit of reading to really understand what they were looking for and how to actually build that feature. And then, I submitted my first PR (`check it out here <https://github.com/dipy/dipy/pull/2749>`__)! Getting it merged wasn't exactly easy - there was a lot of room for improvement up in my code, but honestly, I feel like it's all part of the learning curve.
I was a bit of a latecomer to GSoC, so I didn't have much time to make up a ton of PRs. Plus, by the time I'd submitted my first PR, the proposal submission period had already begun. So, I focused all my energy on increasing my knowledge on the topic and polishing my proposal. Plus, I'd wanted to get my proposal reviewed at least once before I submitted it.

Code contributions:

Expand All @@ -38,16 +38,16 @@ I tried logging into Google to check, but couldn't. Too many people doing the sa
Fast forward to 1:30am - I figured by now, the log-in rush should have calmed down. I gave it another shot and... I got in! I clicked over to the dashboard, and there it was. My project. Right there, listed under the Projects section. I had heard that if you get selected, your proposal shows up there.
To confirm that it was actually happening, I picked my phone to check if I'd gotten any official email yet. And yes!! I'd gotten it at 12:49 am. I just hadn't checked.
I whooped, woke up my roomies, rushed to call my parents.
Honestly, words can't even begin to capture how I felt at that moment.
Pure, undiluted joy, that's what it was. My parents, surprisingly actually picked up my call. But the minute I told them I'd made the cut, they congratulated me. It was heck of a day, (^^).
Honestly, words can't even begin to capture how I felt at that moment.
Pure, undiluted joy, that's what it was. My parents, surprisingly actually picked up my call. But the minute I told them I'd made the cut, they congratulated me. It was heck of a day, (^^).

What I did this week
~~~~~~~~~~~~~~~~~~~~

As this was my first week I majorly spent a lot of time knowing about the codebase of the organization. I also went through a couple of research papers of projects which have already been implemented to get information related to my branch.
I'm currently in the middle of reading through the research paper, which is directly related to my project: `here <https://www.sciencedirect.com/science/article/pii/S1053811920300926>`_
I also went through some of the videos related to information on cti, a couple of them are: `this <https://www.youtube.com/watch?v=bTFLGdbSi9M>`_ and also, `this <https://www.youtube.com/watch?v=2WtGl3YQou8&list=PLRZ9VSqV-6srrTAcDh4JYwrlef2Zpjucw&index=16>`_
I also submitted `this <https://github.com/dipy/dipy/pull/2813>`_ PR. In this PR members of my organization are supposed to submit all the
I'm currently in the middle of reading through the research paper, which is directly related to my project: `here <https://www.sciencedirect.com/science/article/pii/S1053811920300926>`__
I also went through some of the videos related to information on cti, a couple of them are: `this <https://www.youtube.com/watch?v=bTFLGdbSi9M>`__ and also, `this <https://www.youtube.com/watch?v=2WtGl3YQou8&list=PLRZ9VSqV-6srrTAcDh4JYwrlef2Zpjucw&index=16>`__
I also submitted `this <https://github.com/dipy/dipy/pull/2813>`__ PR. In this PR members of my organization are supposed to submit all the
blogs.
But mostly I spent a lot of time in implementing the already existing MultiTensor Simulation on my local system , and also completing the assignment which my mentor gave me.
In this assignment, I was given a specific number of directions, 'n' and some steps on how to produce bvals and bvecs. I had to create ``gtab1`` and ``gtab2``. and then taking ``gtab1`` & ``gtab2`` as input, I was supposed to create a function which would give output btensor i.e btens.
Expand All @@ -60,17 +60,23 @@ These simulations were basically the first task of the proposal.
So after the btensor I intend on producing the synthetic signals using the qti model (hint on how
it is done in qti tests).
make a figure similar to figure 1 of the 2021 CTI paper:
`here <https://onlinelibrary.wiley.com/doi/full/10.1002/mrm.28938>`_
`here <https://onlinelibrary.wiley.com/doi/full/10.1002/mrm.28938>`__


Did I get stuck anywhere
~~~~~~~~~~~~~~~~~~~~~~~~

I got stuck while creating `this <https://github.com/dipy/dipy/pull/2813>`_ PR. I had to rebase a bunch of commits, and this was a new concept to me, so it took me a while to figure it out. Due to rebasing, I ended up creating a bunch of other commits, which made the commit history of this PR a mess. So, I had to learn about the concept of squashing the commits.
I got stuck while creating `this <https://github.com/dipy/dipy/pull/2813>`__ PR. I had to rebase a bunch of commits, and this was a new concept to me, so it took me a while to figure it out. Due to rebasing, I ended up creating a bunch of other commits, which made the commit history of this PR a mess. So, I had to learn about the concept of squashing the commits.

I also got stuck a lot while trying to find out the perpendicular directions to the vectors used in ``gtab1``. I was supposed to implement the following formula:

.. image:: https://github.com/dipy/dipy/blob/09a8c4f8436f995e55231fb3d11fbfe6749610a9/_static/images/formula_.png?raw=true
:width: 400
:alt: formula cti gtab

I also got stuck a lot while trying to find out the perpendicular directions to the vectors used in ``gtab1``. I was supposed to implement the formula in .. image:: https://github.com/dipy/dipy/blob/09a8c4f8436f995e55231fb3d11fbfe6749610a9/doc/_static/formula_.png?raw=true
I had to spend a lot of time figuring out how to combine 3 vectors of shape (81, 3) to get V. And also working on the function which would give me the perpendicular vector to the vector in ``gtab1``.

I got a bunch of ``ValueErrors`` saying: could not broadcast input array from shape (3,3,1) into shape (3,3) and some ``IndexError`` saying: shape mismatch: indexing arrays could not be broadcast together with shapes (81,) (3,1) (3,).

I also had to experiment on how to concatenate different vectors to get the vector of the right shape, since there are a bunch of possible options while stacking, such as vstack, hstack, stack, etc.

2 changes: 1 addition & 1 deletion posts/2023/2023_06_12_vara_week3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The official code in Keras uses a ``tfp.layers.DistributionLambda(tfp.distributi

Therefore, the autoregressive nature of PixelCNN combined with a sampling layer for every pixel delivers an effective generative model. The outputs for all my experiments are shown in the image below -

.. image:: /doc/_static/vq-vae-results.png
.. image:: /_static/images/vq-vae-results.png
:width: 800

Based on qualitative analysis, PixelCNN outputs may require some extra work. This leads me to the next step in my research - to explore Diffusion models. The first breakthrough paper on Diffusion models is by DDPM - Denoising Diffusion Probabilistic models. Inspired by previous work on nonequilibrium thermodynamics, they show that training diffusion models while maximizing the posterior likelihood in an image generation task is mathematically equivalent to denoising score matching.
Expand Down
10 changes: 5 additions & 5 deletions posts/2023/2023_06_13_Shipi_week3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ CTI Simulation and QTI tutorial : Week 3
:tags: google
:category: gsoc

What I did this week:
What I did this week:
_____________________

This week I worked on finishing the simulations with the appropriate documentation. I also worked on creating a general tutorial for CTI/ QTI as one doesn't already exist for QTI.
This week I worked on finishing the simulations with the appropriate documentation. I also worked on creating a general tutorial for CTI/ QTI as one doesn't already exist for QTI.
The idea behind this general tutorial was that there isn't any tutorial for advanced diffusion encoding. The closest documentation QTI has is :ref:`here <sphx_glr_examples_built_reconstruction_reconst_qti.py>`. However, there are several youtube videos. So, in this tutorial we started with simulating qti, and then we make things a little more complex by adding information on CTI as QTI can only handle a single Gradient Table whereas CTI can handle multiple Gradient Tables.
This week I also started by initializing ``cti_tests.py`` file by adding relevant simulations to it.
This week I also started by initializing ``cti_tests.py`` file by adding relevant simulations to it.


What Is coming up next week:
What Is coming up next week:
____________________________

I intend on finishing the simulations with appropriate documentation and theory lines. If time permits, I'll resume working on the ``cti.py`` file and it's tests section.
The work on creating simulations is not entirely complete as it requires conversion of all .py files into rst so that it could be generated by sphinx. I also intend on making the tutorial more complete by maybe adding some more detail to it.
The major thing I intend on working on is the construction of the design matrix for the CTI model.
The major thing I intend on working on is the construction of the design matrix for the CTI model.
In the context of diffusion MRI, a design matrix refers to a matrix that encodes the relationship between the data (diffusion-weighted signals) and the model parameters we want to estimate. It is essentially a way to map the model parameters to the observed data.
The design matrix in case of CTI captures more complex tissue microstructure information than either DTI or DKI or QTI.

Expand Down
6 changes: 3 additions & 3 deletions posts/2023/2023_06_19_Shilpi_week4.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ Re-Engineering Simulation Codes with the QTI Model and Design Matrix
What I did this week
~~~~~~~~~~~~~~~~~~~~

I had to change the ``cti_test.py`` file as the signals generated were not exactly correct. I was advised to follow the multiple gaussian signal generation method. While doing this I had to look closely at several already implemented methods and go in depth to understand how those functions were achieving the desired output.
I had to change the ``cti_test.py`` file as the signals generated were not exactly correct. I was advised to follow the multiple gaussian signal generation method. While doing this I had to look closely at several already implemented methods and go in depth to understand how those functions were achieving the desired output.
The multiple gaussian signal generation method is preferred because the CTI signal generation closely resembles the multiple gaussian signals. We're using the multiple gaussian signals so that we can have a priori of what to expect from the outcome, if we fit our model to this signal.
I also managed to implement the design matrix for the CTI tensor and managed to save it up in the ``utils.py`` file. The design matrix is a crucial component of the CTI tensor as it represents the relationships between the different variables in our model. By accurately modeling these relationships, we can generate more realistic simulations and gain a deeper understanding of the CTI tensor.
The link of my work: :ref:`Here<https://github.com/dipy/dipy/pull/2816>`
The link of my work: `Here <https://github.com/dipy/dipy/pull/2816>__`



Expand All @@ -26,4 +26,4 @@ This week I'll work on fitting CTI on multiple Gaussian simulations and see if i
Did I get stuck anywhere
~~~~~~~~~~~~~~~~~~~~~~~~

No, I didn't get stuck anywhere.
No, I didn't get stuck anywhere.
4 changes: 2 additions & 2 deletions posts/2023/2023_06_26_vara_week5.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ Continuing on my MNIST experiments, I ran into Multi Distribution issues while t
I followed the architecture described in my previous blog for the DM. I trained this on VQ-VAE latents of MNIST dataset for 200 diffusion steps, 2 Nvidia V100 GPUs, Adam Optimizer with 2e-4 learning rate, 200 batch size per GPU for 100+ epochs. For the generative process, I denoised random samples for 50, 100 and 200 steps on the best performing model(112 epochs). Here are the results I achieved -


.. image:: /doc/_static/DM-MNIST-112epoch.png
.. image:: /_static/images/DM-MNIST-112epoch.png
:width: 800


We see some resemblance of digit shapes in the generated outputs. On further training for 300 diffusion timesteps for the best performing model( 108 epochs) with least training loss, the visuals have improved drastically -


.. image:: /doc/_static/DM-MNIST-DDIM300-108epoch.png
.. image:: /_static/images/DM-MNIST-DDIM300-108epoch.png
:width: 800


Expand Down
Loading

0 comments on commit 88f5f3a

Please sign in to comment.