daducci / COMMIT

Linear framework to combine tractography and tissue micro-structure estimation with diffusion MRI
Other
45 stars 33 forks source link

From what I see there is no difference between outputs of COMMIT1 and COMMIT2 #113

Closed komabso closed 2 years ago

komabso commented 2 years ago

Hello.

Before processing all the data using COMMIT2, I tried to compare several values to determine which regularization lambda and fiber shift to use.

However, even if the value of Lambda is changed (applying anatomic priors), the results of the binary connectome of COMMIT1 and COMMIT2 seemed to be almost no difference, so I am inquiring about it.

The code What I used is below. test_lambda.txt

The first two pictures below are the binary connectome of COMMIT1 and COMMIT2 with fiber shift of 0.5 and lambda of 0.5 using one of the data I will process. The upper is COMMIT1 and the lower is COMMIT2.

The next two pictures are duplications that I followed the COMMIT2 tutorial that you wrote. The upper is COMMIT1 and the lower is COMMIT2.

image image

image image

From what I see, the results of your tutorial have difference (COMMIT2 is sparser) but the results of my data don't.

Could you give me some advices? It will be helpful! And I'm sorry to bother you again 😭

Best, Joseph.

daducci commented 2 years ago

Hi Joseph,

do not worry, we are here to help! Ok, first of all, also the last two images don't look too much different from one another (but they do look quite different if you look at the demo). It looks like the lambdas you use is too small and the regularization might not have any effect; could you try changing your line#51 from x_nnls, _, _ = mit.get_coeffs() to x_nnls, _, _ = mit.get_coeffs( get_normalized=False ) as it is in the COMMIT2 tutorial? This could explain your strange behavior.

Let us know, Ale

komabso commented 2 years ago

Thanks, Ale!

  1. I subtracted mit.get_coeffs( get_normalized=False ), because the error below.

image

Could you give me a way to solve it?

  1. You said that "the value for reg_lambda used in this example is only an empirical value for the purpose of this demo" in your COMMIT2 tutorial. How did you decide the empirical value? Could you tell me your know-how?

Although the questions are stupid somewhat, cut me some slack 🙇

Best, Joseph.

daducci commented 2 years ago
  1. Which version of COMMIT are you using? I suspect you are on an old one.
  2. We usually increase lambda until we see that the density of the resulting connectome actually decreases, and we stop when we notice that too many bundles are remove (I mean, by inspecting the resulting tractograms with the help of an expert neurologist).
komabso commented 2 years ago

Hello, Ale!

I used 1.4.6 version. I upgraded commit to latest version, then I could use mit.get_coeffs( get_normalized=False ).

However, the result is the same even if lambda is 1. (COMMIT2 and COMMIT1's connectomes look like same.) 😢 Is maximum of lambda 1, isn't it?

Best, Joseph.

daducci commented 2 years ago

Lambda can take any value >= 0, and the higher it is, the sparser the matrices should be. Do you get meaningful results when running the COMMIT2 demo (using same data and code)?

komabso commented 2 years ago

When I re-run the COMMIT2 demo using latest commit version, the result of commit2 is sparser than commit1's. The binary connectomes are below.

Commit1 -> image

Commit2 -> image

Best, Joseph.

daducci commented 2 years ago

Dear Joseph,

I just repeated the COMMIT2 tutorial from scratch and I obtain the following connectomes:

connectome_RAW

connectome_COMMIT

connectome_COMMIT2

whose density are, respectively, 0.66, 0.54 and 0.35. I suspect you have a problem in your installation, can you check on another computer/python installation if you can replicate the results of the tutorial?

komabso commented 2 years ago

Dear Ale.

Although I changed a server and installed commit at that place, the result looked like not meaningful... 😞

I might have made a wrong connectome matrix because I'm a newbie, so could you tell me the code for making the connectome? 🙏

Best, Joseph.

daducci commented 2 years ago

You can compute the connectomes and consider the weights estimated with COMMIT and COMMIT2 by using, for instance, the MRtrix command tck2connectome (as done at the beginning of the tutorial in case of the raw tractogram) but using the option -tck_weights_in to feed the streamline_weights.txt estimated by COMMIT and COMMIT2, as follows:

os.system( 'tck2connectome -force -nthreads 0 -assignment_radial_search 2 -out_assignments COMMIT/Results_StickZeppelinBall_COMMIT1/fibers_assignment.txt -tck_weights_in COMMIT/Results_StickZeppelinBall_COMMIT1/streamline_weights.txt demo01_fibers_connecting.tck GM_1x1x1.nii.gz COMMIT/Results_StickZeppelinBall_COMMIT1/connectome.csv' )

and

os.system( 'tck2connectome -force -nthreads 0 -assignment_radial_search 2 -out_assignments COMMIT/Results_StickZeppelinBall_COMMIT2/fibers_assignment.txt -tck_weights_in COMMIT/Results_StickZeppelinBall_COMMIT2/streamline_weights.txt demo01_fibers_connecting.tck GM_1x1x1.nii.gz COMMIT/Results_StickZeppelinBall_COMMIT2/connectome.csv' )

komabso commented 2 years ago

I appreciate Ale!

Thanks to you, I found the difference between us. When I ran tck2connectome, I used demo01_fibers.tck. However, you used demo01_fibers_connecting.tck. When I used demo01_fibers_connecting.tck, I got same results as your demo. 😄

Because demo01_fibers.tck and demo01_fibers_connecting.tck look same in appearance, I was totally confused about what I have to use.

Thank you very much for your help. 👍

Best, Joseph.

komabso commented 2 years ago

Hi, @daducci . I'm sorry to bother you agian.

Unlike your demo (already mentioned, I duplicated it), when I applied commit2 to my data, it seemed that commit2 has no effect. According to your advice, I used connected_fibers.tck, but the binary connectomes looks like same. Left is commit1 and right is commit2.

image

The code which I used is below.

test_commit2.txt

Could you see where the problem is?

Best, Joseph.

daducci commented 2 years ago

Hi Joseph,

no worries, happy to help! Did you try changing the lambda for the regularization during the COMMIT2 call?

komabso commented 2 years ago

Yes. To decide proper lambda, I had a test where lambdas are [0, 5e-1, 5e-2, 5e-3, 5e-4, 5e-5, 5e-6].

But all connectomes looked like same.

image

As the figure is from 1 to 7, the lambda becomes smaller.

Best, Joseph.

daducci commented 2 years ago

Could you perform a last test using a very large lambda, for instance lambda=1e2or lambda=1e5?

Otherwise, the problem could be that you have a very high number of ROIs in your parcellation (around 400), and thus the regularization on bundles might not be very effective? Let's see the results of this test.

PS: in case, would it be possible for you to share (privately) your data so that we can perform some tests and understand better what is going on?

komabso commented 2 years ago

Okay. 👍

At first, I will do the test on your advice.

And then if there are same results, I will send my data to you. Please give me any contact way. (e.g. email, and so forth...)

Best, Joseph.

komabso commented 2 years ago

Hi!

Even though I ran the last test using very large lambdas (100, 1000, 10000), the results were same (no effect).

Here is the data file link. https://drive.google.com/drive/folders/1T2W9mWxjXZdCPPp3KhsSlfwMoQsj3qf2?usp=sharing

Could you check it out?

Best, Joseph.

MarioOcampo commented 2 years ago

Dear @komabso

I did a test using your dataset, the results of COMMIT2 and COMMIT1 are different, but similar.

Some notes that can explain the similitude of the results.

I am not familiar with the parcellation you are using, and I do not know if the density of the original connectome has to be reduced more than that.

Best regards Mario

komabso commented 2 years ago

Thank you for helping me even though you are busy!👍 It helped me a lot.

Best regards Joseph.