Difference between segmentation dimensions and original dimensions

I saved the labels I made in 3D Slicer with “Export to file…” by right-clicking in the “Data” section and selecting “Export visible segments to binary labelmap”. However, later I realized that the dimensions of the resulting labels and the original file did not match. The label files were saved to contain only the labeled region. How can I fix this with Python? Also, what should I do to avoid such a problem when saving the labels I made in 3DSlicer from now on?


Which version of Slicer are you using?