Scale all images in a window to the same "z" scale.

This will give all images in a graph window the same range of colors, i.e. the same values will map onto the same colors for each image:

function scaleAllImages(low,high[,colors])
    variable low,high
        string colors
       
        colors=selectstring(paramisdefault(colors),colors,"Grays")
    variable i
    for(i=0;i<itemsinlist(imagenamelist("",";"));i+=1)
        modifyimage $"''#"+num2str(i) ctab={low,high,$colors,0}
    endfor
end


Note that the part following the $ sign is double quote, single quote, single quote, pound, double quote. The single quote, single quote, pound part is analogous to the use or brackets in ModifyGraph to identify the Nth trace on a normal graph. To avoid that confusion, you can also just use:

function scaleAllImages(low,high[,colors])
    variable low,high
        string colors
       
        colors=selectstring(paramisdefault(colors),colors,"Grays")
    variable i
        string images=imagenamelist("",";")
    for(i=0;i<itemsinlist(images);i+=1)
        string image=stringfromlist(i,images)
                modifyimage $image ctab={low,high,Grays,0}
    endfor
end

Forum

Support

Gallery

Igor Pro 9

Learn More

Igor XOP Toolkit

Learn More

Igor NIDAQ Tools MX

Learn More