Modeling of the blood flow in and around aneurysms with computational fluid dynamics (CFD) is important to better understand why aneurysms form and rupture. CFD modeling requires an accurate representation of the patient-specific arteries for simulations to be reproducible and reflect the reality. State-of-the-art methods use semi-manual tools to extract patient-specific geometries, which result in inconsistent results and a lot of tedious work. This limits the potential clinical impact of CFD-based aneurysm modeling. In this thesis, we develop an automated pipeline for extracting consistent patient-specific geometries. The pipeline consists of two parts: 1) Image restoration based on dictionary learning, and 2) vessel extraction by multiscale segmentation techniques. We show that dictionary learning based methods are able to restore (denoise and inpaint) 3D computed tomography (CT) images, and multiscale segmentation techniques can accurately extract both small and large arteries. Finally, we summarize the proposed pipeline and show its efficiency on a number of 3D CT images from the Aneurisk Project. The suggested pipeline is provided as a ready-to-use python library.