Articles on Shilpi06's Bloghttps://blogs.python-gsoc.orgUpdates on different articles published on Shilpi06's BlogenWed, 30 Aug 2023 08:11:38 +0000Week 14 - August 30th, 2023https://blogs.python-gsoc.org/en/shilpi06s-blog/week-14-august-30th-2023/<p><span style="font-size: 14px;"><u><strong>What I did this Week: </strong></u></span></p>
<p>This week I fixed the test for the isotropic source of kurtosis so now it's working for all DTDs. I also created tests for the ``K_micro`` function. Initially while running the test, I got some errors which made me look deeper into the actual function. The error was that I was doing sqrt of some elements when actually I was supposed to calculate square of them. Also I was using a '1/5' factor which was not actually required. On fixing these issues, the overall map image of ``K_micro`` improved significantly.<br>
Previously the multi-voxel test case was failing due to different eigenvalues in the isotropic total diffusion tensors simulations. Removing the eigenvalue assertion made the test pass, as verifying the kt, cvt, and evals values sufficed.<br>
I also provided documentation to some functions in the test file such as ``_perpendicular_directions_temp_`` and ``from_qte_to_cti`` etc. <br>
Also had to change the name of some functions to make it sound more relatable to what they were actually doing. <br>
This week I almost finished with the CTI tutorial. The only thing remaining is to create a fetcher for the data so that all the users can download the data and use it. Currently the path given for the data retrieval is of my local system. <br>
I also added some references and overall improved the wording and information in the tutorial. <br>
I also finished writing my final work report and got it reviewed by my mentors and then updated it.<br>
Finally, before pushing the file onto the main PR, I cleaned up the code by removing all the extra comments and some unnecessary code and overall made sure that the entire code was following the pep8 standard. </p>
<p><span style="font-size: 14px;"><u><strong>What is Coming Up Next: </strong></u></span></p>
<p>Now that almost everything is completed and all the unit tests are passing, I'll just focus on getting the PR merged.<br>
I will also aim to achieve a 100% coverage report, thereby ensuring that every line of code is thoroughly tested.<br>
At present, the merging of my PR is on hold as we're actively seeking a pair of reviewers who can conduct a thorough examination of the entire codebase and provide their expert feedback.<br>
Additionally, I'll try to get the QTI simulation merged as well .</p>shilpiprd@gmail.com (Shilpi06)Wed, 30 Aug 2023 08:11:38 +0000https://blogs.python-gsoc.org/en/shilpi06s-blog/week-14-august-30th-2023/Week 13- August 22nd, 2023https://blogs.python-gsoc.org/en/shilpi06s-blog/week-13-august-22nd-2023/<h2>What I did this week</h2>
<p>This week, I finished writing tests for the sources of kurtosis. While the isotropic source passed the test for the anisotropic DTD, the anisotropic source passed tests for all DTDs. As a result, I integrated the test for the anisotropic source within the test_cti_fits function, eliminating the need for a separate function. I also created tests for multi-voxel cases but the tests passed only for single voxel cases. One reason I think this might be happening is because of the way we're accessing the covariance and diffusion tensor elements. I intend to look further into this. I worked on the real life data, trying to plot maps, but it didn't work out because the problem was really related to the fact that the current kurtosis source implementations do not handle multiple voxel cases. I worked on real life data, attempting to plot maps. Even though I was not able to get the desired result, I'm sure I'll figure it out with further research and possible collaboration.</p>
<p><a></a></p>
<h2>What is coming up next Week</h2>
<p>As soon as mapping of the images is done, I'll finish with the documentation of my model. I also intend on adding some references to some of the important methods. If everything is done early, and time remains then I'll look into finishing the QTI simulation tutorial. I also intend on creating a final work report of my project and submit it to the GSoC dashboard.</p>shilpiprd@gmail.com (Shilpi06)Mon, 21 Aug 2023 20:41:22 +0000https://blogs.python-gsoc.org/en/shilpi06s-blog/week-13-august-22nd-2023/Week 12 - Aug 15th, 2023https://blogs.python-gsoc.org/en/shilpi06s-blog/week-12-aug-15th-2023/<p><span style="font-size: 14px;"><u><strong>What I did this week</strong></u></span></p>
<p>According to last week's situation, I was trying to make the ``test_cti_fits`` function work as well as the ``test_split_cti_params`` function. This week I figured out the problem with these functions and was able to fix it. The major problem was occurring while I was trying to compare the parameters. Firstly, I started by removing all the extra fit methods in common_fit_method list such as NLS, CLS and CWLS as I realized that we won't immediately be needing an extra multi_tensor_fit function in CTI.<br>
I also realized that our fit method needs to accommodate multiple voxels, so I had to add "@multi_voxel_fit" at the top of that function. <br>
Major fact that I realized was that the already implemented ``ls_fit_cti`` function was not implemented incorrectly. The cti_return (obtained directly from ``ls_fit_cti``) was not matching cti_params because of the eigen value decomposition. Since the total diffusion tensor in my test was isotropic, when the tensor was decomposed inside the function ``ls_fit_cti``, it created a different eigenvector due to floating point precision. So, I instead tried to compare the more broken down variables, hence I compared the evals from cti_params to evals of cti_return, and the same for covariance tensor elements and kurtosis tensor elements. And on doing this the variables matched perfectly.<br>
Also, last time I had the tests and functions for axial, radial, mean and apparent kurtosis which are basically different measures derived from the diffusion kurtosis tensor, and they help in providing different perspectives on the microstructural complexity of the tissue. So, since last time the fit function itself could not be tested, consequently I couldn't run tests for these functions as well. So, after the tests for the fit function were working, I ran tests for these functions and realized some errors. I fixed the errors by having to take care of the implementation part of these functions as well as changing direction assertion to np.allclose as we also need to take care of the floating point precision detail. <br>
However, for implementing tests for the sources of kurtosis, we'd previously decided that we'd take QTI tests into consideration as k_bulk appeared similar to k_iso and k_shear seemed similar to k_aniso, but upon careful examination we realized that this was not actually the case. This is because in case of QTI, when they're calculating D from self.params, they already have the top 6 elements in voigt notation. We can also observe that when they convert ``from_3x3_to_6x1``, they're multiplying some factors. So, the end point being that "D" in our case and the diffusion tensor "D" in their case is different. And this matters because they're using D to calculate k_bulk (line 1059 in QTI.py) and we're using it to calculate K_iso. Therefore I couldn't use their tests anymore. So, the only solution now in order to be able to implement tests for the sources of kurtosis is to look at the actual paper and implement their ground truth values. <br>
This week I also spent time creating a basic draft of the CTI simulation. </p>
<p><span style="font-size: 14px;"><u><strong>What is coming up Next Week</strong></u></span></p>
<p>This week I intend on making sure that the tests for the sources of kurtosis are implemented properly and they're working as expected. <br>
Also, the real life data when run on our model at the moment is giving some overflow errors. I intend on working towards this as well. <br>
I'm also going to make sure that at the end of this week, I'm able to create a good near finish draft of the CTI simulation. </p>shilpiprd@gmail.com (Shilpi06)Tue, 15 Aug 2023 19:48:46 +0000https://blogs.python-gsoc.org/en/shilpi06s-blog/week-12-aug-15th-2023/Week 11- Aug 8th, 2023https://blogs.python-gsoc.org/en/shilpi06s-blog/week-11-aug-8th-2023/<p><span style="font-size: 14px;"><u><strong>What I did this week</strong></u></span></p>
<p>Previously I had the function for different sources of kurtosis outside the Fit class. Then upon suggestion from my mentor, this week I put them inside the Fit class. This required me to make changes to how certain variables were being called inside those functions as well as what arguments needed to be passed to those functions. I also added documentation to those functions which included their basic information, as well as the math involved. I also wrote tests for those functions inside the test_cti_fits function. In order to implement this, I took help from QTI.py as our K_aniso resembles the QTI k_shear function, and K_iso resembles the QTI k_bulk function. Taking these points into consideration, my job of writing tests for them was made easier. Although while implementing the tests, I had to keep in mind the conversion factors. And every variable which involved conversion from a 6x6 to 21 x 1 matrix, required its own conversion function such as k_shear, k_bulk etc. <br>
I also implemented tests for the mean, axial, radial and apparent kurtosis functions which were already present in the CTI Fit class. These are the different measures derived from the diffusion kurtosis tensor. These measures provide different perspectives on the microstructural complexity of the tissue.<br>
This week I was also given some real time data in order to construct bvals, bvecs with files that had extension .bvals, .bvecs. I was able to run these files successfully on my computer and was able to make sure that the gtab created from these files were giving the expected signals.<br>
Majorly this week I worked on modifying the tests of the functions as required and tried to make them work. But while doing this, I realized that the 'fit' function inside the model class was not implemented properly and hence the test functions were not able to work as expected. <br>
I also started with the tutorial for CTI. </p>
<p><span style="font-size: 14px;"><u><strong>What is coming up next week </strong></u></span></p>
<p>This week I'll try to make sure that the test functions are able to work properly. I'll try to make sure that the function 'ls_fit_cti' in particular is giving the required output. And after this function works, I'll move on to implementing the 'fit' function which would later help in the testing of the Fit class. </p>
<p><span style="font-size: 14px;"><u><strong>Did I get stuck anywhere </strong></u></span></p>
<p>I didn't exactly get stuck as I kept learning new things while encountering problems in testing the function. But when I felt that I could not move forward with one tast, I immediately started with other tasks such as providing documentation to function as well as getting started with the tutorials. </p>shilpiprd@gmail.com (Shilpi06)Tue, 08 Aug 2023 18:33:46 +0000https://blogs.python-gsoc.org/en/shilpi06s-blog/week-11-aug-8th-2023/Week 10 - Aug 1st, 2023https://blogs.python-gsoc.org/en/shilpi06s-blog/week-10-aug-1st-2023/<p><span style="font-size: 14px;"><u><strong>What I did this week</strong></u></span></p>
<p>In the last week, we had decided to generate a DTD which would make the model more robust by accounting for situations where we had almost all the parameters as non zero, however in that situation the signals weren't matching exactly. So this week I fixed that issue, and so now we can safely say that all DTDs would match the ground truth signals, no matter which parameters are non zero and what changes we make. This was made possible because we were able to figure out the correct order of ccti parameters which is basically covariance parameters which takes the root2 and '2' factor into consideration.<br>
Also, I removed the mean, axial, radial and kurtosis functions from our CTI Fit method because I realized that while importing the DKI Fit class, we're also importing all the necessary features. But I still need to write tests for these methods to make sure that it's all working properly. <br>
The most important task this week has been the implementation of ls_fit_cti, cls_fit_cti and split_cti_params function as this is the most important function in CTI Fit class. I also wrote tests for this class. This involved me understanding the previously implemented similar functions and the parameters that these functions required. One such example is "data" which basically can be interpreted as the "cti_pred_signals". <br>
The importance of writing tests is to see if given the signals, gtab1 and gtab2 can we obtain the cti_parameters correctly or not. So, I'm still analyzing all the functions which have been implemented in DKI, and the tests that have been implemented for them.<br>
So, the important testing function in order to be able to is the test_fit function in CTI. <br>
Among all that, I also implemented the test_split_cti_params and test_cti_fits in the test_cti.py file.<br>
Also, in CTI, even though we're not implementing the radial, axial, anisotropic and mean kurtosis ourselves, we still need to implement tests for these. So in order to write tests for the radial, axial, anisotropic and mean kurtosis ground truth values would be when we call the functions individually, the ones which are outside the Fit class. I also implemented tests for these.<br>
One other point to note is that in DKI, we just needed to make sure that we've multiple b-values. But in case of CTI, we also need to have symmetric b1 and b2s and also parallel and perpendicular experiments. <br>
Now, in the case of CTI, we not only consider the different components of kurtosis, but we also pay attention to the sources of kurtosis. The three sources of kurtosis that we identify in CTI is isotropic kurtosis, anisotropic kurtosis and microscopic kurtosis. I managed to look through the formulas present in the original CTI paper, and implement functions for these.</p>
<p><br>
<u><strong><span style="font-size: 14px;">Things to do next week </span></strong></u></p>
<p>Even though I've implemented the function which could calculate the sources of kurtosis, it's still outside the CTI Fit class, and needs to be incorporated in the Fit class. I also need to write tests for these functions. In order to do this, I intend on referring to the QTI paper to look for similarities. <br>
Also, even though I've written tests for the ls_fit_cti and cls_fit_cti function, I still need to run these tests and make sure that it's working as expected. <br>
I also need to make sure that my model runs in case of given multi-voxels. A voxel in a 3D image which can be thought of as similar to a pixel in a 2D image in that both represent a discrete element of the image data. In DIPY, a voxel model refers to a representation of a 3D image volume as a collection of individual voxels, each of which represents a small volume element within the image.<br>
After I write tests for multi-voxel cases, and if my model is working on everything, then I'll move on to running my model on real-time data. <br>
If I get stuck anywhere, then I intend on writing a tutorial for the CTI implementation . </p>shilpiprd@gmail.com (Shilpi06)Tue, 01 Aug 2023 17:36:49 +0000https://blogs.python-gsoc.org/en/shilpi06s-blog/week-10-aug-1st-2023/Week 9- Jul 27th, 2023https://blogs.python-gsoc.org/en/shilpi06s-blog/week-9-jul-27th-2023/<p><span style="font-size: 14px;"><u><strong>What I did this week</strong></u></span></p>
<p>So, among several other things, this week I first started on figuring out how to run spyder on ubuntu as initially I couldn't make it run due to technical problems, but then there was this need to make sure that I'm able to edit my code while keeping the pep8 standards and the automatic formatting of my code wasn't working. So, after having done this, I made some changes in the utils.py file to make the design_matrix more readable. I also made changes in the B[:,3] and B[:, 4] which are the diffusion tensor elements as there was a typo in the sign because we realized that the diffusion tensor part should have a negative contribution as it represents a signal decay</p>
<p>One of the other tasks that I implemented was mapping all the covariance parameters from paper to its actual code implementation which created some confusion, as the conversion shown in the paper didn't quite match its implementation. This was what initially created the need to talk to the authors of the original paper. </p>
<p>The other more important work I did was trying to figure out the matching of the ground truth signal values in case of anisotropic and combined DTDs. This is because the isotropic DTD signals that were being generated matched exactly the QTI signals, as in case of isotropic we've 6 non zero elements, and the rest are 0s. However in anisotropic case we had more non-zero covariance parameters (9 non-zero), similarly as in the case of combined DTD. So we figured out that the non-zero elements are being multiplied to some value which isn't correct and that this needs modifying the ccti conversion.<br>
So, I worked on reading more about voigt notation, as the QTI parameters were implemented using that notation.<br>
Then we looked again into the QTI paper, and felt the need to contact their author and code implementer and realized that the coding was done while keeping in mind the voigt notation conversion as well as some other factors. At the end of this we figured out the correct conversion of the ccti parameters. We noticed that some factors needed the (root2) division, while some others needed (2). Therefore, we were able to successfully figure out the correct factors that needed to be multiplied/ divided to each of the covariance parameters. <br>
And hence, now the signal values of all the DTDs match as expected. <br>
Then the other major ongoing task this week has been the implementation of the Fit class in CTI. This required me to implement some functions which might've been implemented in DKI/ QTI. This is an ongoing task and would require more work. </p>
<p><span style="font-size: 14px;"><u><strong>What is coming up next week </strong></u></span></p>
<p>After the matching of the correct signals which matched the ground truth values, we realized that a DTD with more non-zero covariance parameters might make the ccti conversion more robust while taking all cases into consideration. So, we created a DTD with mevals, its angles and the fractions. However the signals didn't match exactly. But rather than being stuck on this case, we decided to move forward for the time being. So, I'll work on making sure that all the ground truth signals match. <br>
But the more important work I will be doing this coming week would be to implement all the required functions in the ccti module such as the different sources of kurtosis which hasn't been implemented before as this is one of the differentiating factors of CTI. And then hopefully move on to generating the tests for these functions. </p>
<p><span style="font-size: 14px;"><u><strong>Did i get stuck this week</strong></u></span></p>
<p>Not at all. Some things were kind of vexing, but I didn't get stuck as there was always something else that could be done. <br>
</p>shilpiprd@gmail.com (Shilpi06)Thu, 27 Jul 2023 04:46:56 +0000https://blogs.python-gsoc.org/en/shilpi06s-blog/week-9-jul-27th-2023/Week 8 Jul 21th, 2023https://blogs.python-gsoc.org/en/shilpi06s-blog/week-8-jul-21th-2023/<p>I was out this week as I had exams, I'll be working this coming week, and hence will submit a blog around 26th of July . </p>shilpiprd@gmail.com (Shilpi06)Fri, 21 Jul 2023 12:58:29 +0000https://blogs.python-gsoc.org/en/shilpi06s-blog/week-8-jul-21th-2023/Week 7 - Jul 12th, 2023https://blogs.python-gsoc.org/en/shilpi06s-blog/week-7-jul-12th-2023/<p><span style="font-size: 16px;"><u><strong>What I did this Week</strong></u></span></p>
<p>One of the tasks I did this week was modify the cti_design_matrix again, as asked by my mentor to make the code more readable. The initial code was following pep8 standard but it wasn't very easy to read, but now it is.<br>
Also, I realized that the main reason my signals weren't matching the ground truth values before at all was because the eigen values and eigenvectors of the diffusion tensor distribution were wrong. This was because, before I tried getting D_flat by doing: np.squeeze(from_3x3_to_6x1(D)) which returned a tensor of shape ( 6, ). But in this case, it returned the diffusion tensor elements in the order : Dxx, Dyy, Dzz and so on which isn't the correct format of input expected for "from_lower_triangular" function. So, initially, we were doing : evals, evecs = decompose_tensor(from_lower_triangular(D_flat)) where the from_lower_triangular function is returning a tensor of shape: (3,3). But then I realized that rather than calculating D_flat, we can simply do: evals, evecs = decompose_tensor(D_flat). Following this approach gave the correct value of evals and evecs. So, now we have the correct values of evals and evecs which made the signals come closer to the ground truth signals, but we still don't have the signals completely matching the ground truth signals.<br>
Another problem we realized was that while passing "C", covariance tensor parameters, we needed to make sure that we were passing the modified C parameters, that is "ccti". This again helped in bringing the signals to the expected values.<br>
So, after talking things through with my mentor, and analyzing the QTI paper, we came to a few conclusions which could be done to improve the signal values. </p>
<p><span style="font-size: 16px;"><u><strong>What is coming up next Week</strong></u></span></p>
<p>We realized that there might be a slight probability that there is a typo somewhere in the actual implementation of the QTI signals. So we decided to contact the original author and code implementer of QTI. <br>
Also, one important thing I intend on doing is check the papers, and see the conversions are being done correctly, that is we are taking into consideration the (root2) factor which is present for some covariance tensor elements in the original paper. This is because, for the isotropic case we observe that the signals are matching perfectly because in the isotropic case all the (root2) parameters of the original covariance elements are zero. <br>
Another thing that I intend on doing is to create a new test method which will have some similarities to the test method in dki_tests.</p>
<p><span style="font-size: 16px;"><u><strong>Did I get stuck anywhere</strong></u></span></p>
<p>I didn't get stuck anywhere, but trying to figure out the problem with the current signal generation did take some time and required looking into the research papers. </p>shilpiprd@gmail.com (Shilpi06)Wed, 12 Jul 2023 17:15:40 +0000https://blogs.python-gsoc.org/en/shilpi06s-blog/week-7-jul-12th-2023/Week 6 - Jul 06th, 2023https://blogs.python-gsoc.org/en/shilpi06s-blog/week-6-jul-06th-2023/<p><span style="font-size: 14px;"><u><em><strong>What I did this week</strong></em></u></span></p>
<p>This week, I worked together with my mentor to come up with a new way of arranging the elements of the design_matrix. So, first I rearranged all the parameters of the covariance parameters so that they'd match with the ones in QTI. So now, the order is: the diffusion tensor, the covariance tensor, and then the kurtosis tensors. But then we decided that it would be better to put the kurtosis tensors first because then we wouldn't have to re-implement all the kurtosis methods again. So, I changed the order of kurtosis and the covariance tensors. <br>
Also, in order to maintain the coding standards of the previously implemented models, we decided that the diffusion tensor should be divided into evals and evecs. <br>
Therefore, because of all these changes I had to re-implement a lot of already implemented functions in CTI which also required changing the description of those functions and not only the code.<br>
But my major time went towards writing tests for these modified codes. While writing codes, I realized that a lot of the functions needed to be modified a bit. Also, I had to import several new libraries in order for the functions to work. </p>
<p><span style="font-size: 14px;"><strong><em><u>What Is coming up next week</u></em></strong></span></p>
<p>The testing part for the implemented method is not yet done correctly, as the signals don't yet match the expected output. So, I intend on re-implementing them by taking into consideration the suggestions provided by my mentor. This would require modifying code of some already implemented functions as well as re-writing the tests, particularly the generation of the eigenvalues and the eigen vectors. </p>
<p><br>
<span style="font-size: 14px;"><u><em><strong>Did I get stuck anywhere</strong></em></u></span></p>
<p>I didn't exactly get stuck, but implementing the tests requires you to make sure that the shape of the tensors you're passing into a function is correct and is as expected. This took me a while to figure out. </p>shilpiprd@gmail.com (Shilpi06)Wed, 05 Jul 2023 20:05:39 +0000https://blogs.python-gsoc.org/en/shilpi06s-blog/week-6-jul-06th-2023/Week 5 - Jun 27th, 2023https://blogs.python-gsoc.org/en/shilpi06s-blog/week-5-jun-27th-2023/<p><strong>Design Matrix Implementation and Coding with PEP8: Week4<br>
=================================================</strong></p>
<p><u><strong>What I did this Week: </strong></u></p>
<p>This week I worked on improving the design_matrix that I'd previously created. It wasn't according to the PEP8 standards, I managed to modify it according to the appropriate format. <br>
I mostly spent a bunch of time implementing functions under the Fit class in CTI. In order to achieve this task I had to look into functions which had already been implemented in DKI and QTI, as CTI is an extension of DKI and has similarities with the QTI model. <br>
My procedure for this part was going through the 2 different modules and comparing the functions, and making note on functions which would have to be implemented in CTI as CTI has a very different design_matrix. <br>
Although this implementation is not completely done, I learnt a lot. </p>
<p><strong><u>What is coming up next Week</u></strong></p>
<p>This week I intend to further implement the Fit class and also generate tests for the already implemented functions under the Fit class. <br>
And also write tests to make sure that the signals generated in the QTI model are the same as the ones done in CTI_pred. <br>
I also intend on changing the order of parameters of covariance tensor as CTI has a lot of similarities with the QTI module, and in order to use QTI functions, we need to make sure that the order of parameters under covariance tensor in QTI is same as order of parameters in CTI. </p>
<p> </p>shilpiprd@gmail.com (Shilpi06)Tue, 27 Jun 2023 18:31:51 +0000https://blogs.python-gsoc.org/en/shilpi06s-blog/week-5-jun-27th-2023/Weekly BLog Post #4https://blogs.python-gsoc.org/en/shilpi06s-blog/weekly-blog-post-4-13/<p><u><strong>What I did this week: </strong></u></p>
<p>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. <br>
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.<br>
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.</p>
<p>The link of my work: https://github.com/dipy/dipy/pull/2816</p>
<p><u><strong>What is coming up next week: </strong></u></p>
<p>This week I'll work on fitting CTI on multiple Gaussian simulations and see if it produces the expected output. And therefore, work on improving it. This may require implementing a bunch of methods for the Fit class.</p>shilpiprd@gmail.com (Shilpi06)Wed, 21 Jun 2023 14:54:11 +0000https://blogs.python-gsoc.org/en/shilpi06s-blog/weekly-blog-post-4-13/Weekly Blog Post #3https://blogs.python-gsoc.org/en/shilpi06s-blog/weekly-blog-post-3-11/<p><u><strong>What I did this week: </strong></u></p>
<p>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. <br>
The idea behind this general tutorial was that there isn't any tutorial for advanced diffusion encoding.The closest documentation qti has is `here <https: 07_reconstruction="" 1.7.0="" dipy.org="" documentation="" examples_built="" reconst_qti="">`.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 gtab whereas cti can handle multiple gtabs.<br>
This week I also started by initializing cti_tests.py file by adding relevant simulations to it. </https:></p>
<p><br>
<u><strong>What Is coming up next week: </strong></u></p>
<p>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.<br>
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.<br>
The major thing I intend on working on is the construction of the design_matrix for the cti model. <br>
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.<br>
The design_matrix in case of cti captures more complex tissue microstructure information than either DTI or DKI or QTI.</p>
<p><u><strong>Did I get stuck anywhere</strong></u></p>
<p>No, I didn't get stuck. But implementing btensor value for cti simulation did require a bit of effort.</p>
<p> </p>shilpiprd@gmail.com (Shilpi06)Tue, 13 Jun 2023 18:25:39 +0000https://blogs.python-gsoc.org/en/shilpi06s-blog/weekly-blog-post-3-11/week2 Blog - 5thJunehttps://blogs.python-gsoc.org/en/shilpi06s-blog/week2-blog-5thjune/<p><u><strong>What I did this week: </strong></u></p>
<p>I worked through this research paper, and found some relevant facts to the tasks at hand, such as the different sources of kurtosis. One other important fact I found out was that, DDE comprises 2 diffusion encoding modules chracterized by differnet q-vectors (q1 and q2 ) and diffusion times. This fact is important because, CTI approach is based on DDE's cumulant expansion, and the signal is expressed in terms of 5 unique second and fourth-order tensors. I also found out about how the synthetic signals could be created using 2 different scenarios, which comprises of a mix of Gaussian components and a mix of Gaussian and/or restricted compartments. <br>
The major time I spent this week was in creating synthetic signals, and therefore in creating simulations.</p>
<p><u><strong>What's coming up next week:</strong></u></p>
<p>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.</p>
<p><u><strong>Did I get stuck: </strong></u></p>
<p>I didn't get stuck, however it did take me a while to go through all the code that I could possibly be needing in my simulations, and also in understanding the theory behind those codes.</p>shilpiprd@gmail.com (Shilpi06)Mon, 05 Jun 2023 18:28:35 +0000https://blogs.python-gsoc.org/en/shilpi06s-blog/week2-blog-5thjune/Community Bonding & Week1 Insights:https://blogs.python-gsoc.org/en/shilpi06s-blog/community-bonding-week1-insights/<h2>About Myself</h2>
<p>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. 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: (<a href="https://github.com/dipy/dipy/blob/fba5ea68b6f84b35a8b2d8f489efa3cf9b5e982f/doc/posts/2023/2023_05_29_Shilpi_Week_0_1.rst#id5">`https://github.com/tardis-sn/tardis/pull/1825`_</a>) 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!</p>
<p><a></a></p>
<h2>Intro to Open-Source and GSoC</h2>
<p>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. 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 (<a href="https://github.com/dipy/dipy/blob/fba5ea68b6f84b35a8b2d8f489efa3cf9b5e982f/doc/posts/2023/2023_05_29_Shilpi_Week_0_1.rst#id7">`check it out here: https://github.com/dipy/dipy/pull/2749`_</a>)! 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.</p>
<p>Code contributions:</p>
<ol>
<li>[<a href="https://github.com/dipy/dipy/pull/2749">#2749</a>]</li>
</ol>
<p><a></a></p>
<h2>The Day</h2>
<p>May 4th: I woke up feeling like a nervous wreck. That interview with my organization? Let's just say it didn't go very well. Yet, I couldn't help but hope for the best. The results were supposed to drop at 11:45pm, a moment I wasn't exactly looking forward to. I tried logging into Google to check, but couldn't. Too many people doing the same thing. I threw my hands up, gave up on the login battle, and got back to work, hoping to distract myself. 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, (^^).</p>
<p><a></a></p>
<h2>What I did this week</h2>
<p>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: <a href="https://www.sciencedirect.com/science/article/pii/S1053811920300926">here</a> I also went through some of the videos related to information on cti, a couple of them are: <a href="https://www.youtube.com/watch?v=bTFLGdbSi9M">this</a> and also, <a href="https://www.youtube.com/watch?v=2WtGl3YQou8&list=PLRZ9VSqV-6srrTAcDh4JYwrlef2Zpjucw&index=16">this</a> I also submitted <a href="https://github.com/dipy/dipy/pull/2813">this</a> 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. The purpose of this assignment was to strengthen my knowledge on concepts I've already read and also to give me some coding experience, as this is critical in order for me to be able to implement the rest of my project.</p>
<p><a></a></p>
<h2>What is coming up next Week</h2>
<p>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: <a href="https://onlinelibrary.wiley.com/doi/full/10.1002/mrm.28938">here</a></p>
<p><a></a></p>
<h2>Did I get stuck anywhere</h2>
<p>I got stuck while creating <a href="https://github.com/dipy/dipy/pull/2813">this</a> 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. And due to rebasing, I ended up creating a bunch of other commits because of which the commit history of this PR was a mess. So I again 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 formula in .. image:: <a href="https://raw.githubusercontent.com/dipy/dipy/b8035e263df203c164b76b9a5e644c590bd6fbf7/doc/posts/2023/">https://raw.githubusercontent.com/dipy/dipy/b8035e263df203c164b76b9a5e644c590bd6fbf7/doc/posts/2023/</a><a href="https://github.com/dipy/dipy/blob/fba5ea68b6f84b35a8b2d8f489efa3cf9b5e982f/doc/posts/2023/2023_05_29_Shilpi_Week_0_1.rst#id9">formula_</a>.png 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 right shape, since there are a bunch of possible options while stacking, such as vstack, hstack, stack etc</p>shilpiprd@gmail.com (Shilpi06)Mon, 29 May 2023 18:36:55 +0000https://blogs.python-gsoc.org/en/shilpi06s-blog/community-bonding-week1-insights/