Problem in slicing a stl file to tiff/PNG/jpeg stack

Dear Support Team,

I have stl file of packing of angular particles. The cubic packing size is 400 voxels and the voxel size is 0.03111 mm. I need to convert the stl file to the tiff stack with 400 slices and a pixel size of 0.03111 mm. I have tried the python script provided by the team in 3d slicer (Convert STL file to high-resolution TIFF stack - #8 by lassoan) but didn’t get the correct result. It just gave 2 slices after 1 hour and the slices just include a single black point.
I need to know what values should I use in the following parts:
outputVolumeLabelValue, inPlaneResolutionDpi, planeThicknessMm, outputVolumeMarginMm

How would you calculate 25.4 in the following part? What values should I use for my packing?
imageSpacingMm = [25.4/inPlaneResolutionDpi, 25.4/inPlaneResolutionDpi, planeThicknessMm]

I look forward to hearing back from you.

Kind regards,
Mehrdad

If you have your image spacing defined as mm/pixel instead of inches/pixel (DPI) then you can set that directly in imageSpacingMm. 0.03111mm/pixel = 0.0012248 in/pixel => 816 pixel/in (DPI), so the default 400 DPI should be OK, but just for initial testing you can try lower resolution (40DPI).

How many points does your STL file contain? Can you share the file so that I can test it?

Hi Lassoan,

Thanks for your advice. What value should I use for outputVolumeLabelValue and outputVolumeMarginMm?

Should imageSpacingMm be [0.03111, 0.03111, 0.03111] in my case?
planeThicknessMm=0.03111?
inPlaneResolutionDpi=400?

How should I share the stl file? I could not attach the stl file.

Thanks for your help. I look forward to hearing back from you.

Kind regards,
Mehrdad

Whatever non-zero value you would like to see in the image inside the model.

Yes, set imageSpacingMm=[0.03111, 0.03111, 0.03111] directly and remove the now redundant planeThicknessMm and inPlaneResolutionDpi variables.

Upload to somewhere (dropbox, onedrive, google drive, …) and post the link here.