Perivascular Spaces (PVS) are a recently recognised feature of Small Vessel Disease (SVD), also indicating neuroinflammation, and are an important part of the brains circulation and glymphatic drainage system. Quantitative analysis of PVS on Magnetic Resonance Images (MRI) is important for understanding their relationship with neurological diseases. In this work, we propose a segmentation technique based on the 3D Frangi filtering for extraction of PVS from MRI. Based on prior knowledge from neuroradiological ratings of PVS, we used ordered logit models to optimise Frangi filter parameters in response to the variability in the scanners parameters and study protocols. We optimized and validated our proposed models on two independent cohorts, a dementia sample (N=20) and patients who previously had mild to moderate stroke (N=48). Results demonstrate the robustness and generalisability of our segmentation method. Segmentation-based PVS burden estimates correlated with neuroradiological assessments (Spearmans $rho$ = 0.74, p $<$ 0.001), suggesting the great potential of our proposed method