[slicer-users] How to merge 3D models

Daniel Haehn haehn at bwh.harvard.edu
Tue Feb 23 12:48:58 EST 2010


Hi Jiajia,

if you want to use code, you could use the Python console to do the
following:

from Slicer import slicer
model1 = slicer.MRMLScene.GetNodeByID('vtkMRMLModelNode1')
model2 = slicer.MRMLScene.GetNodeByID('vtkMRMLModelNode2')
add = slicer.vtkAppendPolyData()
add.AddInput(model1.GetPolyData())
add.AddInput(model2.GetPolyData())
newmodel = add.GetOutput()
model1.SetAndObservePolyData(newmodel)
model1.SetModifiedSinceRead(1)
model1.GetModelDisplayNode().SetPolyData(model1.GetPolyData())

After this, the first Model should be the merged version of the two.

HTH,
Daniel

On Mon, 22 Feb 2010 16:43:32 -0500, "Luo, Jiajia" <jiajialuo2000 at gmail.com>
wrote:
> Hi all,
> 
> A qucik question for merging two 3D models:
> 
> I generated two 3D models, one from axial and another from coronal. Is
> there
> a good way to merge the two 3D model into one model?
> 
> I have tried some ways to do that, one is ModelIntoLabelVolume which
> created
> a label map in axial view using the model generated from the coronal
> slices.
> But this one finally worked not well.
> 
> Jiajia




More information about the slicer-users mailing list