[vtkusers] vtkImageWriter

Naveen Kumar Polapally naveenpkumar at hotmail.com
Wed Jan 24 23:39:20 EST 2001


hi,

I am trying to use vtkImageWriter to write the output to the
file.but i can't get the image that i usually get after the gradient filter.

    vtkImageReader *reader = vtkImageReader::New();
      reader->SetDataByteOrderToBigEndian();
      reader->SetDataExtent(0,511,0,511,1,1);
      reader->SetFileName("/home/devel/vtk/vtkdata/jeeli/c_v.10");
      reader->SetDataMask(0x7fff);
      reader->ReleaseDataFlagOn();
      reader->Update();

      vtkImageGradient *gradient=vtkImageGradient::New();
      gradient->SetInput(reader->GetOutput());
      gradient->SetDimensionality(3);
      gradient->Update();
      gradient->ReleaseDataFlagOn();

      vtkImageWriter *writer=vtkImageWriter::New();
      writer->SetInput(gradient->GetOutput());
      writer->SetFileName("output");
      writer->SetFileDimensionality(2);
      writer->Write();

      vtkImageReader *reader1 = vtkImageReader::New();
      reader1->SetDataByteOrderToBigEndian();
      reader1->SetDataExtent(0,511,0,511,1,1);
      reader1->SetFileName("output");
      reader1->SetDataMask(0x7fff);
      reader1->ReleaseDataFlagOn();
      reader1->Update();

      vtkImageViewer *viewer=vtkImageViewer::New();
      viewer->SetInput(reader1->GetOutput());
      viewer->SetColorWindow(255);
      viewer->SetColorLevel(127);
      viewer->Render();




_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.





More information about the vtkusers mailing list