daducci / COMMIT

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

Index is out of bounds for axis 0 in iFOD2 algorithms. #119

Closed komabso closed 1 year ago

komabso commented 1 year ago

Hello, COMMIT2 experts! I'm sorry to bother you again. 😅

Thanks to your help in the past, I could apply COMMIT2 to my HCP data.

However, although I could run COMMIT2 in FACT and SD STREAM algorithms, the following error occurs for exactly the same data except for the iFOD2 algorithm in the tckgen command.

image

I tried the solutions you suggested in other people's same issues in the past, but it didn't work.

  1. https://github.com/daducci/COMMIT/issues/110

    • Matching the geometry of white matter mask and DWI data image
  2. https://github.com/daducci/COMMIT/issues/92

    • Using bStep parameter (bStep = 10)
    • When I called commit.Evaluation I specified the _STUDYpath and the _SUBJECTpath image

Is it because iFOD2 is probabilistic algorithm?

Do you have any idea to resolve this problem? Any comments will help me.

Thanks! Joseph.

fullbat commented 1 year ago

Hello @komabso, we did some tests and everything looks fine. Can you please share the whole script you are using to run COMMIT2?

Thanks, Matteo

komabso commented 1 year ago

Hello @fullbat, Thanks for testing and replying to me!

Here is code which I used. I don't know why, but "Add code" doesn't recognize the entire code, so I uploaded it as a text file.

practical_commit2.txt

Thanks, Joseph

fullbat commented 1 year ago

Hi @komabso, I've checked your script and I saw you have made some changes in the section where the connecting bundles are extracted and then merged together (see the attached screenshot). Looks like every 20k connections you are saving the bundles, which is not a problem per se, but in line 67 seems you are keeping overwriting the output tck. Can you please try to run the code using the same approach in the wiki and see if gives you the error? Otherwise, you have to ensure that the number of connecting streamlines you are giving as input to trk2dictionary.run is the same at the cumulative sum of the streamlines of each connection in the connectivity matrix.

Matteo

extract_connecting

komabso commented 1 year ago

Hi @fullbat ,

Running the code using the same approach in the wiki made an error "tckfile does not exist error". I think this error is caused by just skipping the line without running tckedit because it exceeds the maximum allowable command line length of the linux. (The number of parcels of the parcellation which I used is over 400, so over 160k tck files existed.) So I ran tckedit per every 20k. It was overwritten over the old tck file with the same name, so that it would continue to accumulate.

Because the computing server of our lab has a problem, I will try the second comment you told me in a few days and let you know.

Thanks for helping me!

Best regard, Joseph.

fullbat commented 1 year ago

Hi @komabso , we fixed the maximum line length issue last year. If you check, you can see that we are now saving a tck for each row of the connectivity matrix, so in your case means around 400 connections which shouldn't be a problem. Let me know if it fixes the problem.

Matteo

komabso commented 1 year ago

Hi @fullbat ,

I had no idea that you fixed the problem. Thanks to your advise, I resolve the problem.

Thank you very much for your help. Joseph.