andersonwinkler / PALM

PALM: Permutation Analysis of Linear Models
69 stars 28 forks source link

error in using wb_command inside matlab #36

Open amirka1379 opened 2 years ago

amirka1379 commented 2 years ago

I want to do a palm analysis with -transposedata and etc but it keeps giving me 'Currently cannot read/write CIFTI files without the HCP Workbench' I tried some of the ways you have mentioned to how to fix this problem but it did not help I would appreciate it if you helped me how to use the hcp workbench inside Matlab and how to work with the wb_command function wb_view function is alright in Matlab but my windows Matlab can not recognize wb_command with the system('wb_command')

andersonwinkler commented 2 years ago

Hi Amirhosein,

PALM uses the command "which" to locate programs such as wb_command, but this only works on Linux and Mac.

For Windows you'd have to edit the palm_checkprogs.m to make PALM set "palm_extern.wb_command = true" always, and further, edit palm_ciftiread.m and palm_ciftiwrite.m such that the variable "wb_command" is set at the beginning to point to the location in your system where the actual wb_command is located.

It should work then, but you'll have to make these edits by hand.

All the best,

Anderson

amirka1379 commented 2 years ago

thanks a lot for your help i did succeed in running the command but I get this error after the first problem was solved ERROR: NAME OF FILE: results_Y4h4Ng.gii

Output stream for external file reports its status as bad.

Error using xml_parser The XML document was not valid

and when I do gii = gifti('results_Y4h4Ng.gii');

this error will pop up Error using xml_parser The XML document was not valid

Error in gifti_read (line 14) t = xml_parser(filename);

Error in gifti (line 105) this = gifti_read(varargin{1},giftistruct);

gllmflndn commented 2 years ago

Hello @amirka1379 Assuming the file is where it should be when read by the gifti library, could you attach file results_Y4h4Ng.gii to this issue so that I can have a look?

amirka1379 commented 2 years ago

results_Y4h4Ng.gii.zip Thanks for your precious help this is the zipped file of it

gllmflndn commented 2 years ago

Thank you, the XML file is indeed not valid, two end tags are missing at the end of the file:

</DataArray>
</GIFTI>

After adding them manually, the file is parsed correctly so it might be worth checking whether there is an issue upstream with wb_command: are you using the latest version? The data are stored in results_Y4h4Ng.gii.data: there might be further issues in reading the data but it would be good to clear the issue above first.

gllmflndn commented 2 years ago

I also notice the Data tag is missing so what actually needs to be added at the end of the file is:

  <Data/>
  </DataArray>
</GIFTI>