[vtkusers] Modifying Medical1.cxx to use images already in memory

Kalpathi R Subramanian krs at uncc.edu
Sat Oct 14 14:46:39 EDT 2006


Very likely, no geometry is being generated for this threshold value.. 
try values you know for sure
will generate some polygonal data..

    == krs

Norman Young wrote:

> Hi,
>
> I'm new to VTK and have what seems to be a pretty basic question.  I'm
> trying to modify the Medical1.cxx sample so that instead of reading
> from disk using vtkVolume16Reader, it uses pixel data that I already
> have in memory in my application. What might be the best way of doing
> that?
>
> So far, I've created (I think) a volume with vtkImageData, then tried
> to set the input on the vtkContourFilter to the volume.  It looks
> something like this (BTW, I'm using C#):
>
> vtkImageData volumeData = new vtkImageData();
>
> [fill volumeData with some data here]
>
> vtkContourFilter skinExtractor = new vtk.vtkContourFilter();
> skinExtractor.SetInput(volumeData);
> skinExtractor.SetValue(0, 500);
> vtkPolyDataNormals skinNormals = new vtk.vtkPolyDataNormals();
> skinNormals.SetInputConnection(skinExtractor.GetOutputPort());
>
> [rest of the sample code here]
>
> When I run this, I get this error:
>
> ERROR: In ..\..\vtk\Graphics\vtkPolyDataNormals.cxx, line 94
> vtkPolyDataNormals (060B7520): No data to generate normals for!
>
> I assume this is related to not setting the input to the contour
> filter correctly.  My very vague understanding of the pipeline is that
> I should be using vtkAlgorithm and input/output ports, but I'm rather
> confused at how that might work with vtkImageData.
>
> Thanks in advance for any help anyone might be able to provide!
>
> Norman
> _______________________________________________
> This is the private VTK discussion list. Please keep messages 
> on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers



-- 
K.R.Subramanian                        Phone: (704) 687-8579
Department of Computer Science         FAX:   (704) 687-3516
UNC Charlotte, Woodward 435E           Email: krs at uncc.edu
Charlotte, NC 28223-0001               Web: http://www.cs.uncc.edu/~krs  




More information about the vtkusers mailing list