combine two volumes into one using python

Katya_Stansfield
Wed, 27 Apr 2022 15:05:41 +0000
Support

Hi, I need to automate combining two volumes into one. I have DICOM files of whole body CT scans of a body, split into parts. The parts overlap slightly. My aim is to be able to quickly merge the torso and legs to obtain one volume for segmentation. Manually, slicer provides a chance to ‘add’ two volumes arithmetically, as long as one of the volumes has been extended to include the size of the other.

Following this logic, I need to script:

a. ‘cropping’ the torso volume to a larger region of interest so that it includes legs,
b. cropping the leg volume to the lowest point of the Z coordinates in the torso volume to avoid overlap,
c. adding two cropped volumes to make one,
d. pushing the new volume to the slicer.

Thanks to discussions here and to previously published code, the problem does not seem impossible to solve. However, I cannot see an answer for defining XYZ boundaries of my regions of interest. Can you help, please?

9 posts - 4 participants