[vtkusers] IMAGE filters perform no filtering at all?

dean.inglis at camris.ca dean.inglis at camris.ca
Sat Jan 31 17:43:42 EST 2004


you need to understand the basics of vtk's pipeline mechanism:

  vtk_some_image_reader* reader =  vtk_some_image_reader::New();
  reader->Set_some_properties_about_your_data();  // eg SetDimensions(), SetDataOrigin(), SetDataSpacing(), SetDataExtent() etc.
  reader->SetFileName("a_file_name");
  reader->Update();

  
  vtk_some_image_filter* filter =  vtk_some_image_filter::New();
  filter->Set_some_filter_parameters();
  filter->SetInput(reader->GetOutput());
  filter->Update();

    
  vtk_some_image_writer* writer =  vtk_some_image_writer::New();
  writer->SetInput(filter->GetOutput());
  writer->SetFileName("another_file_name");
  writer->Write();

there is generally no need to grab pointers to the
image data: ie. Don't do this:


    id->SetDimensions(256,256,0);
	id->SetSpacing(0.78,0.78,0);
	id->SetOrigin(0,0,0);
	id->SetScalarType(VTK_SHORT);
	id->SetNumberOfScalarComponents(1);
	id->AllocateScalars();
	id=pr->GetOutput();
	f->SetInput(id);


spend some time looking at .tcl or .cxx examples and tests
in VTK/Imaging

Dean  




More information about the vtkusers mailing list