In a large mixing bowl, combine the flour, sugar, and salt. Add the cold butter cubes and use a pastry cutter or your hands to blend until the mixture resembles coarse crumbs.
Gradually add the ice water, one tablespoon at a time, until the dough begins to come together. Divide the dough in half, shape each half into a disk, wrap in plastic wrap, and refrigerate for at least 30 minutes.
In another mixing bowl, combine the pitted cherries, sugar, cornstarch, lemon juice, vanilla extract, and almond extract (if using). Toss until the cherries are evenly coated. Set aside.
Preheat your oven to 375°F (190°C).
On a lightly floured surface, roll out one of the dough disks to fit your 9-inch pie dish. Gently press the dough into the dish, leaving an overhang around the edges.
Pour the cherry filling into the crust, spreading it out evenly. Dot the filling with small pieces of butter.
Roll out the second dough disk and place it over the filling. Trim any excess dough, then crimp the edges to seal. Cut a few slits in the top crust to allow steam to escape.
Brush the top crust with the beaten egg and sprinkle with sugar.
Place the pie on a baking sheet to catch any drips, and bake for 45-50 minutes, or until the crust is golden brown and the filling is bubbling.
If the edges of the crust start to brown too quickly, cover them with aluminum foil.
Allow the pie to cool for at least 2 hours before slicing. This helps the filling to set.
Serve the pie warm or at room temperature, optionally with a scoop of vanilla ice cream.