I am currently working with MR Images which are in '.mha' format. I am looking for a package in Matlab which enables me to read and write these type of files. I understand that you have a piece of code 'writemhafile.m' and 'writemetafile.m' which can write mha files. I tired to use them I got error . this is how I approached it.
I read the mha file using 'mha_read_volume.m' Which I found on the internet
V = mha_read_volume(filepath);
I then do some processing and I use your function to save it
WriteMetaFile('foo.mha', V, [160,216,176],'uint8')
but then I get error in line 62 of writemetafile.m
later I came to know that there is another m file writemetaimagefile.m which can produce an mha file directly . so im using that now. Is this the way to go or am I missing a step here?
Thank you