## 4 Discussion  
The increasing importance of patient-specific models in the study of different pathologies reveals the need for simple and effective methods to generate inputs appropriate for these models. There is a wide range of software, both commercial and open-source, that can reconstruct surface meshes from segmentations, some of them providing tools to perform semi-automatic or automatic segmentations of a given set of images [20; 35; 36]. These programs and libraries, although powerful, cannot be easily included in automatic pipelines that aim to process large sets of cases to generate inputs for computational models, most of them lacking the modules needed to generate volumetric meshes. To the best of our knowledge, there is only one open-source library that performs the full reconstruction from imaging data to volumetric mesh: the _dicom2 fem_ library [37; 38]. It includes semi-automatic segmentation prior to reconstruction. However, it is limited to DICOM files, lacking the option to use other formats or already-segmented sets of images. Our library does not include a segmentation module as we consider that such a problem-specific task (e.g., hard vs. soft tissue, different image acquisition techniques, etc.) can be performed using more powerful tools (i.e., AI-based) nowadays in constant improvement and development. We believe that being able to easily blend with these tools as a piece of a grander scheme may be very useful in the near future of personalised medicine. For this reason, we have developed _im2 mesh_ putting together different functionalities based on open-source libraries with the aim of facilitating the process of input generation for computational models from segmented images. This out-of-the-box solution automatically creates the desired files without user intervention, making it ideal for its integration into complex workflows. We have shown the robustness of the tool as well as the potential and limitations of volume reconstruction from segmented slices. In fact, our methodology is able to reconstruct volumes almost identical to those obtained with the well-established and  
Figure 5: Application of the im2 mesh library to one of the cases from the PRIMAGE dataset; (**A**) reconstruction of the tumour and the abdominal region of the patient using 3D Slicer (whole stack of 50 slices); (**B**) surface mesh of the tumour generated using our library from the 17 slices containing the tumour. Through the semi-transparent surface, the mesenteric artery and some of its branches can be seen passing through the tumour; (**C**) volumetric mesh of the tumour with the aforementioned vessels highlighted in red; (**D**) normalized cellularity (left) and vascularization (right) maps interpolated from DWI and DCE sequences to the volumetric mesh presented in (**C**). powerful tool 3D Slicer. For now, _im2 mesh_ is limited to interpolation in the z-direction, which is the most common case in biomedical imaging, although interpolation in the other directions could be easily added in a future release. It is worth mentioning that slice interpolation is an ill-posed problem, firstly because there is no unique solution to it and secondly because there is no metric to quantify the accuracy of an interpolated sequence unless the objective volume is known beforehand, which would make the interpolation unnecessary. Nonetheless, the technique is very effective, especially when the anatomy change vs. slice density ratio is low (i.e., when adjacent slices are similar). In some instances where the geometry is extremely heterogeneous and the image resolution is limited (such as the NB tumour cases available within the PRIMAGE project), slice interpolation is the simplest and most practical solution.