[vtkusers] vtkAppendPolydata - Can you mend my broken heart :)

Ravi Gupta rgupta at irus.rri.ca
Thu Jun 20 13:13:23 EDT 2002


Method
------
I cut my image data into 4 sections along the z-axis, translated each 
section appropriately, generated an iso surface, used vtkPolyData append 
to join the iso surfaces back into one surface.

Problem
-------
Each section when rendered independently looks great. After appending 
them together it looks like some one dropped it and stuck it back 
together. The severity and location seems to differ depending on the 
translation values I use. I'm not worried about the crack that is 
present at the section borders.

Please see attached image.

Please comment.

Thanks
Ravi

# Cut up the image volume into 4 sections
#########################################
section1 = vtkImageClip()
etc.
section1.SetInput(imageData)
etc.
overlap=8
z11 = z1
z12 = (z2/4)+overlap
z21 = (z2/4)-overlap
z22 = (z2*2/4)+overlap
z31 = (z2*2/4)-overlap
z32 = (z2*3/4)+overlap
z41 = (z2*3/4)-overlap
z42 = z2
section1.SetOutputWholeExtent(x1,x2,y1,y2,z11,z12)
etc.
section1.ClipDataOn()
etc.
# Translate the image sections
##############################
translateSection1 = vtkImageTranslateExtent()
etc.

translateSection1.SetInput(section1.GetOutput())
etc.
zTranslation1 = z11 - z11
zTranslation2 = z11 - z21
zTranslation3 = z11 - z31
zTranslation4 = z11 - z41
translateSection1.SetTranslation(0,0,zTranslation1)
etc.
# Generate an ISO surface for each section
##########################################
iso1 = vtkMarchingCubes()
etc.
iso1.SetInput(translateSection1.GetOutput())
etc.
iso1.SetValue(0,200)
etc.
iso1.ComputeNormalsOn()
etc.
# Collect and join the polydata sections
########################################
appendIso = vtkAppendPolyData()
appendIso.AddInput(iso1.GetOutput())
etc.
etc.

-- 
Ravi Gupta

Programmer


#################################################
The John P. 			| P.O. Box 5015
Robarts Research Institute	| 100 Perth Drive
Imaging Research Laboratories	| London
Tel: (519) 663-5777 ext. 1-34077| Ontario
Fax: (519) 663-3403		| Canada
E-Mail: rgupta at irus.rri.ca	| N6A 5K8
#################################################

#################################################
http://www.irus.rri.ca/igns 

http://www.irus.rri.ca/~rgupta 

#################################################

"Be the change you wish to see in the world."
-Mohandas Karamchand Gandhi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: brokenHeart4colours.gif
Type: image/gif
Size: 4927 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20020620/94097f08/attachment.gif>


More information about the vtkusers mailing list