The info struct is a collection of all the information in the PAR file. That's it!
11 Sep 2009
Draw smooth lines freehand on images or plots; return the handle and xy data of the line object.
Author: Brett Shoelson
Very nice work!
Noticed a small issue, which may only occur in recent (R2009a) releases: The DoubleBuffer property seems not always present in the oldvals structure at line 82. This could be solved by moving it to a separate line:
if isfield(oldvals, 'DoubleBuffer')
Nice function! I think there is a minor issue with the double backslash escaping. You can get rid of all the double backslashes by changing the fprintf-line from:
I would suggest adding the following code to mha_read_volume.m, near line 77, if working with vector data:
V = reshape(V,[info.Dimensions,str2double(info.ElementNumberOfChannels)]);
V = reshape(V,info.Dimensions);
Hi everyone. I found out how to freeze the colorbar as well. Actually, I got my answer from the test_main.m file of this submission. You should download cbfreeze.m and cbhandle.m (by Carlos Adrian Vargas Aguilera) and freeze your colorbar with these functions. Just make sure to download cbhandle.m as well or MATLAB will give you some handle errors.
I am using cbfreeze in conjunction with freezeColors on a multi-subplot figure to be able to use different colorbars in each subplot. My problem is that cbfreeze freezes the colorbar nicely, but it removes the order of magnitude for the ticks. Usually the order of magnitude appears as a small number on the top right of the colorbar (say, the ticks go from 10^5-10*10^5, then the tick marks are 1-10 and the 10^5 appears once on the top right of the colorbar for a vertical colorbar). Any suggestions on how I can get my order of magnitude back?
Thanks a lot!
You can use "load_untouch_nii / save_untouch_nii" pair. Here's an example:
nii = load_untouch_nii('avg152T1_LR_nifti.nii');
nii.hdr.hist.descrip = 'Mengye';
Unless you touch nii.img by yourself, e.g. nii.img(1)=0, it will not be changed, although it is also loaded and saved. Only the header (nii.hdr) is edited in the way you make the change.
In addition, if the input file is in Analyze 7.5 format, the output will be kept in Analyze 7.5 format. If the input is in NIfTI format, the output will be kept in NIfTI format.
That is why I have "load_untouch_" as well as "load_" feature. However, in most case, you want to use "load_" feature, since you don't want to interpret affine matrix in the header, and make all sorts of flipping and rotation by yourself, do you?