vtkImageAppend and image origin

Hi Teams,

I want to stack different 3d-images together. I understand that this class cannot support images with different spacing, but I found that it also does not support the origin of images.

The z-order of the images is in accordance with the order of adding these images (and there will be no padding on the other two axes).

So I want to ask how to implement this function in vtk?
That is, make multiple different 3d-images stacked together according to their origin and padding automatically.

Do I need to create a new vtkImageData and fill them in by coordinates?
I think slicer has such a function, but I have checked the source code for a long time and I can’t find how it is implemented.

Thank you!

Best regards.