If your Spritesheet has sprites of the same size, you can just set the quantity of sprites horizontally or vertically using set_hframes() or set_vframes(). If your sprite sheet (for example) has 10 columns of sprites callset_hframes(10)and the Sprite node will calculate the frames. After that, just use the method set_frame(n) to tell the Sprite node which one to show. Notice that n goes from 0 to your number of sprites ordered by columns.
Then your dictionary will be:
var textures = {
rock = 0,
tree = 1
}
func _ready()
set_frame(textures.rock)