How to use 3dslicer software to accurately convert STL format files into nii format files

Dear teacher, hello, recently I am doing 3D reconstruction, and some STL files need to be converted into NII format files. I tried to convert them through 3Dslicer software, but the results were not satisfactory.
I would like to ask all teachers if there is a particularly good way to do this conversion accurately. Thank you.

Since STL files contain triangulated surfaces they can’t be exactly represented in nii format, which is voxel based. You can choose to rasterize at higher resolution by changing the geometry of the segmentation using the Segment Editor.