Image Rotate

Hi
Why can't I use this format for rotating a bunch of images by the same angle

Function RotateLotsOfImages(wave1,wave2,...)
Wave wave1,wave2
Variable Angle
prompt Angle, "Angle of rotation: "
doPrompt "Image Rotate"
if (V_Flag)
    return -1
endif
ImageRotate/A=Angle/E=0 wave1
Duplicate/O M_RotatedImage wave1
ImageRotate/A=Angle/E=0 wave2
Duplicate/O M_RotatedImage wave2
...
end Function


I have tried converting the variable to a number with str2num(Angle), but that doesn't work. The help file for ImageRotate doesn't give much help on this one.

Thanks for the help,
Jason.
Hi Jason,

there is no need to use str2num here, because 'angle' is already a number. Also the Duplicate operation is redundant, use the /O flag instead:

Function RotateLotsOfImages(wave1,wave2)
    Wave wave1,wave2
    Variable Angle
    prompt Angle, "Angle of rotation: "
    doPrompt "Image Rotate",angle
    if (V_Flag)
        return -1
    endif
    ImageRotate/O/A=(Angle)/E=0 wave1
    ImageRotate/O/A=(Angle)/E=0 wave2
end
That did it exactly.
Thanks very much for the help.
Best Wishes,
Jason.