I have two Dicom volumes (Volume A, Volume B). The positions are exactly same.
I would like to create a new volume by performing calculations on each voxel value.
Specifically, I would like to perform the calculation α*A + (1-α)*B and create a new volume, but what function should I use to do this in 3D Slicer?
I have already tried the “Add Scalar Volume” function, but I couldn’t make it.
I can visualize the image, but I need a dicom volume data for the image.
I was managed to make a script to make a fusion of two volumes. Thanks, cpinter!
# name of volume data, BONE and VESSEL
# alfa-blending of BONE and VESSEL with a certain alfa value.
volumenode_A = slicer.util.getNode("BONE")
array_A = slicer.util.arrayFromVolume(volumenode_A)
volumenode_B = slicer.util.getNode("VESSEL")
array_B = slicer.util.arrayFromVolume(volumenode_B)
alfa = 0.05 # change this value as you like
array_C = array_A * (1 - alfa) + array_B * alfa
volumenode_C = slicer.modules.volumes.logic().CloneVolume(volumenode_A, "Calc")
slicer.util.updateVolumeFromArray(volumenode_C, array_C)