In the bowl of an electric mixer using the paddle attachment, cream the cream cheese and the butter until they are thoroughly blended.
On low speed, add the flour and blend until a soft dough forms.
Wrap the dough in plastic wrap and shape it into a rough rectangle.
Chill the dough until it becomes firm, approximately 1-2 hours and up to 3 days. Note: to speed this process along, the dough can be placed in the freezer for approximately 30 minutes.
Make the Filling:
In a food processor, pulse the granulated sugar and ½ cup pistachios until ground very fine.
Add the crumbled almond paste and pulse until very fine.
Add the egg, almond extract, pure vanilla extract and 4 tablespoons heavy cream and pulse until a wet mixture forms. Mixture should be loose enough to be spreadable over dough. If it is too thick, add additional 1 tablespoon heavy cream.
Assembly:
Preheat oven to 350° F. Line 2 large sheet pans with parchment paper and set aside.
Using a dough cutter, cut the dough into 4 equal pieces. Working with one piece of dough at a time, re-wrapping the remaining three pieces of dough. If kitchen is too warm, keep the remaining 3 pieces of dough in the refrigerator until needed.
Using a floured rolling pin on a lightly floured work surface, roll the dough into a 12-inch by 8-inch rectangle. Using two offset spatulas transfer the rectangle to a sheet pan covered with wax paper. Chill in the refrigerator.
Roll out the remaining 3 pieces of dough in the same manner placing each one on top of the original with pieces of wax paper in between each rectangle.
Take the wax paper with the first rectangle of dough out of the refrigerator and place it on a work surface. Cover the remaining rectangles with plastic wrap and keep chilled.
Using an offset spatula, spread 1/3 cup of pistachio almond mixture evenly over the rectangle.
Sprinkle 1/3 cup of the finely chopped pistachios evenly over the frangipane.
Press down gently on nuts so they stick into the filling.
Using the wax paper as a guide, tightly roll the dough into a cylinder rolling with the longest end of the dough closest to you.
Pick up and gently place the cylinder, seam side down, onto one of the prepared sheet pans lengthwise, towards one side of the sheet pan.
Using a sharp knife or a dough cutter, score the log by making cuts (not all the way through the dough) at approximately 1 inch intervals along the log. There should be approximately 10 cuts making 11 rugalach from each log.
Repeat filling, rolling and scoring the remaining rectangles of dough and place them onto the sheet pans leaving a space between the cylinders. There should be two logs per sheet pan.
Bake the rugalach for approximately 40 -50 minutes or until they are golden brown.
Cool the rugalach until they are room temperature. Using spatulas transfer the cylinders to a cutting board and using a long sharp knife, cut into the partially cut slices until individual cookies are formed.
Roll each rugalach in confectioners' sugar, if desired.
Store rugalach in an airtight container for up to a week at room temperature. They can also be frozen for up to 3 months.