c3d
c3d copied to clipboard
-rms doesn't compute RMS
% c3d -help rms
-rms : Voxelwise vector norm
Syntax: `-rms`
Computes RMS (root mean square) of all images on the stack. The command takes the square of each image on the stack, adds all the squared images and takes the square root of the result. This is very useful for statistical operations. Images must have the same size.
c3d img1.img img2.img img3.img img4.img -rms -o rms.img
The equivalent of this command is
c3d img1.img img2.img img3.img img4.img -foreach -dup -times -endfor \
-accum -add -endaccum -sqrt -o rms.img
In the code, it appears that -rms
sets an option for an anti-aliasing filter. It doesn't actually compute the RMS.
The -alias
command for which -rms
sets the RMS option does appear in the documentation, so the risk of breaking existing code is minimal. I would recommend making -rms
behave as currently documented, and renaming the option to -alias-rms
PR in #29, I added -antialias-rms
.
@pyushkevich would it be better to make the parameter something general, like -rms-error
? I'm thinking it could be used in other commands, like -iterations
. Happy to update PR if needed.