I have been trying to use the avw_img_read function to read in the eigenvalues and eigenvectors from a Diffusion Tensor Image. I appended 12 of these files (3 files for eigenvalues, 9 for eigenvector components) into a single volume in Analyze before exporting it as a .hdr and .img file for use with this code. That is, there are 12 224x224x65 files appended into one. This code doesn't seem to recognize that--the result is instead just one 224x224x65 double (labeled 'img' by default) in the avw struct. How can I get the code to recognize the other 11 data files in that one .img/.hdr file?
I've found that
"hist.exp_time = sprintf('%2d-%2d-%2.0f',datime(4),datime(5),datime(6));"
doesn't make up the 10 bytes required, so I had to modify it to "%2.1f". But sometimes I still get a 347 byte hdr file. I'm not quite sure why that happens...
Thanks for these programs, I would never have been able to do this from scratch.