Print

Print


Dear Saad,


Ok, then I think I should go to matlab to do this. I previously thought that if I could do the add up operation in shell or fsl, then I would not need to copy data and change to use another software. But thanks anyway for your kind help. :)


Best regards,
Xinyang



At 2018-04-10 20:11:32, "Saad Jbabdi" <[log in to unmask]> wrote:
Oh I see, I am sorry I thought you wanted to add up matrices from e.g. matrix2 mode (which are sparse-coded). 


If you just want to add up the matrices from the network mode (simple ascii files) then it is easiest to just load them in matlab with the ¡°load¡± command and add them there.


Cheers
Saad



On 10 Apr 2018, at 13:07, Xinyang Liu <[log in to unmask]> wrote:


Dear Saad,


Ok, I see. Then here is the attached file which I pasted the output information. The matrices are 90*90 size. :)


Best,
Xinyang



At 2018-04-10 19:57:56, "Saad Jbabdi" <[log in to unmask]> wrote:
I am afraid you can¡¯t do that. The matrix ouput format of probtrackx2 is quite specific - you can run head/tail on large matrix files that should not be a problem.


On 10 Apr 2018, at 12:53, Xinyang Liu <[log in to unmask]> wrote:


Dear Saad,


Thanks for your reply.
Since my matrices are very large, I self created three 3*3 matrices for a test, which had the same error information when doing fdt_matrix_merge as the large matrices. I input the information of their routes in a file called "list_new".


The script is:
#!/bin/bash

cat list_new

for i in `cat list_new`;
do
     echo $i;
     head $i;
     tail $i;
done



The output is:

/home/lxy/HCP_Data_test/operation/output_fdt/100206/network_matrix/matrix1
/home/lxy/HCP_Data_test/operation/output_fdt/100206/network_matrix/matrix2
/home/lxy/HCP_Data_test/operation/output_fdt/100206/network_matrix/matrix3
/home/lxy/HCP_Data_test/operation/output_fdt/100206/network_matrix/matrix1
1 2 3
4 5 6
1 3 3
1 2 3
4 5 6
1 3 3
/home/lxy/HCP_Data_test/operation/output_fdt/100206/network_matrix/matrix2
2 4 6
1 3 4
6 7 4
2 4 6
1 3 4
6 7 4
/home/lxy/HCP_Data_test/operation/output_fdt/100206/network_matrix/matrix3
3 5 6
1 2 5
65 3 2
3 5 6
1 2 5
65 3 2


The error information is:
[lxy@blade02 network_matrix]$ /u1/local/fsl/bin/fdt_matrix_merge list_new output
merge 3 files
terminate called after throwing an instance of 'MISCMATHS::SpMatException'
  what():  SpMat::SpMat::SpMat(string& fname): Last row must have zero value and indicate matrix size
Aborted





Best,
Xinyang



At 2018-04-10 16:42:17, "Saad Jbabdi" <[log in to unmask]> wrote:

Hi
Can you type the following into your shell and send the output:


cat list_matrix
for i in `cat list_matrix`;do echo $i; head $i; tail $i;done




Cheers
Saad




On 10 Apr 2018, at 07:49, Xinyang Liu <[log in to unmask]> wrote:


Dear Saad, dear experts,


Hi, sorry to repost my question again, since it has not been solved yet. Could you please take a look? Thanks. :)


Best regards,
Xinyang


Details are as below in my last email.



At 2018-04-08 21:38:20, "Xinyang Liu" <[log in to unmask]> wrote:

Dear Saad,


I ran the fdt_matrix merge with the list of matrix full paths but it could not run successfully. The command and information were as follows.


$ /u1/local/fsl/bin/fdt_matrix_merge list_matrix output
merge 3 files
terminate called after throwing an instance of 'MISCMATHS::SpMatException'
  what():  SpMat::SpMat::SpMat(string& fname): Last row must have zero value and indicate matrix size
Aborted


Could you please tell where is the problem?
Thanks a lot!


Best regards,
Xinyang






At 2018-04-08 18:59:17, "Saad Jbabdi" <[log in to unmask]> wrote:
The input should be a text that contains a list of file names (one per matrix that you want to add) with the full path to the file location.


Cheers
Saad


On 6 Apr 2018, at 10:00, Xinyang Liu <[log in to unmask]> wrote:


Dear Saad,


Hi, thanks a lot for your reply.


I put all the matrix file directory into a txt file and ran but failed. The information says, "terminate called after throwing an instance of 'MISCMATHS::SpMatException'" and "Last row must have zero value and indicate the matrix size".


Could you please provide more detailed information about this command? How should I produce the AsciiListOfMatrixFiles with the matrices?
Thanks.


Best regards,
Xinyang




At 2018-04-06 16:47:20, "Saad Jbabdi" <[log in to unmask]> wrote:
Hi - you can use
 fdt_matrix_merge <AsciiListOfMatrixFiles> <outputMatrixFile>


Cheers
Saad





On 6 Apr 2018, at 09:33, Xinyang Liu <[log in to unmask]> wrote:


Dear FSL experts,


Hi, is there any FSL command to sum up a group of 2D fdt_network_matrix which came out from multiple parallel runs of probtrackx2? Thanks!


Best regards,
Xinyang




 






 






 




 






 






 

<output_FSL>