Just as a response to the comment about using linear vs. cubic interpolation.
Technically it is not as good to use cubic interpolation when it comes to raw signal intensity images that will be later used for calculations (relaxation,etc...) because it can introduce values that do not exist.
The most true to form interpolation of medical imaging formats would actually be nearest neighbor because it does not introduce any new values at all. However, in the literature, it is accepted that a linear interpolation merely takes the average of neighboring pixels and thus has less potential for introducing completely spurious signal intensity values from trying to fit a bicubic model to the neighboring pixels.
I tried modifying it so it would work with other image file types, but ran into all sorts of problems because the code is so fragmented and duplicated. This is probably Guide's fault, and not the author's fault. But still, it's easier to write my own than trying to modify this one. I didn't understand how the interpolation rate is chosen.
Also, why do you say bilinear interpolation preserves texture properties? I think you would be much better of with cubic interpolation than with linear interpolation.
Comment only