| Does anyone have a C program which can be implemented within
| MATLAB or otherwise, which can read in an image in Analyze format,
| then multiplies each and every voxel by a user defined scale factor
| to produce a new 'scaled' image?
The easiest way is to change the scalefactors in the .hdr files,
which can be done something like:
V = spm_vol('imagename.img');
V.pinfo(1:2,:) = V.pinfo(1:2,:)*scalefactor;
spm_create_image(V);
Alternatively, the ImCalc button will do this. Select the image you
want to scale, then enter an output filename. The operation you want
to perform is then something like i1*scalefactor .
Best regards,
-John
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|