Pre heat the oven to 180C (160C fan). Grease and line a deep, 20cm springform baking tin.
Cover the filo pastry with a damp cloth while you work with one sheet at a time. Lay the sheet out flat, and brush it generously with melted butter. Spoon a line of marmalade in the middle of the pastry, lengthways, then take one long edge and fold it over the middle third. Then fold the other third over the top, like an envelope, so you have a long, thin strip.
Starting at the short end, roll the pastry up into a cigar shape, then put to one side and repeat with the rest of the filo pastry.
Carefully place as many pastry cigars as you can fit, standing up, in the baking tin. Brush the tops with melted butter then bake for 25 minutes.
Make the custard while the pastry is baking. Place the milk and 100g marmalade in a saucepan, bring to a simmer then switch off the heat and let it stand for 10 minutes.
Whisk together the eggs and cardamom. Pour in the milk and flour, and whisk to bring it all together.
Remove the pastry from the oven and pour the custard over the pastry and into the tin. Put it back in the oven for 30 minutes, then remove it and let it stand for 10 minutes.
Transfer the pie to a serving dish by putting a plate on top of it and turning it all over, so the cake is upside-down on the plate. Then put a serving dish on the top of this and turn it over again, to turn it the right way up, onto the serving dish.
Put the leftover butter and marmalade into a small pan and warm them gently, stirring to mix them together. Drizzle the marmalade butter over the still-warm pie, the scatter the slivered pistachios and dust with icing sugar. Serve warm.