When I re-load images from the Screen Capture module back into Slicer, my volume appears flattened. Attached is an example using the MRHead sample data and generating 50 PNGs. All of the slices are generated but the volume rendering does not look correct
This is fixed by using a larger number of PNG’s, but I’m wondering if it’s possible to scale this automatically such that I can generate 50 PNG’s and just get a smaller but correctly-scaled model?
You lost the correct z spacing, when you saved the volume as PNG stack. PNG doesn’t retain this information. You can manually enter the correct spacing (I think it is 1.3mm for the original MRHead.NRRD) using the Volumes module
Note that screen capture is a lossy operation (you lose dynamic range, window/level settings are burnt in, etc), so do not use it for data export. It is for presentations, testing, etc.
Why aren’t you saving them NRRD? It is not clear to me what you are trying to accomplish. The cross-sections above seems like regular slices from the sample data, not an output SlicerFab. So, the best would be use the default volume format, NRRD which will retain slice spacing.
The application I’m working on creates voxel objects by loading in stacks of PNG’s. I have some segmentation files (NRRD) in Slicer and the goal is to export them to PNGs so I can load them into my application
I think all you need to do is to convert your segmentation to label map and then save it NRRD. I don’t think slicer output a volume as sequence of PNG files through the save dialog box, and using the screen capture has the potential issues @lassoan pointed out (although I am not sure how relevant they are for label maps). You can use Fiji to convert your NRRD to PNG sequence…
You can write out a 3D numpy array as a png sequence using a few lines of Python code (you can find examples by web search; you can use pip_install command in Slicer to install any additional packages for png writing).