[vtkusers] vtkContourFilters

Mohamed Ben Reguiga breguiga_mh at yahoo.fr
Fri Feb 2 09:03:28 EST 2007


hello,
thak you for your help,
with some changes it works like you've mentionned!

thanks!


----- Message d'origine ----
De : Michael Knopke <Michael.Knopke at gmx.de>
À : vtkusers at vtk.org
Envoyé le : Vendredi, 2 Février 2007, 10h35mn 26s
Objet : [vtkusers] vtkContourFilters

Hi,
If you have your data already, this shouldn't be hard. 
Just build vtkImageData from it and feed it to the filter:


 vtkImageData *imageData = vtkImageData::New();

      imageData->SetScalarTypeToUnsignedChar();
      imageData->SetSpacing(3.2, 3.2, 20); // use correct spacing here
      imageData->SetOrigin(0.,0.,0.); //
      imageData->SetNumberOfScalarComponents(1); //depends on your data
      imageData->SetDimensions(512,512,58); set correct dimension
      imageData->AllocateScalars();

      unsigned char *ptrData = (unsigned char*)imageData->GetScalarPointer();

  for (int x=0; x<512; x++)
        for (int y=0; y<512; y++)
                for (int z=0; z<58; z++)
                {
                 *ptrData++ = x+y+z; // fill in the array here
                }

Then just connect this to your ContourFilter->SetInput(imageData);
This should work.

Michael
-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
_______________________________________________
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







	

	
		
___________________________________________________________________________ 
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions ! 
Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses 
http://fr.answers.yahoo.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070202/896f678f/attachment.htm>


More information about the vtkusers mailing list