[vtkusers] [Help, please!] writer object not updating content of produced files

Jonathan Bailleul bailleul at greyc.ismra.fr
Fri Feb 7 12:28:00 EST 2003


Dear All,

Using procrustes analysis to align a set of polydataFiles of landmarks,
I'm in the need to save files to retrieve the result of procrustes.
Unfortunately, it appears that all resulting output files are identical
contrarily to input ones (diff)!!

Strangely, it seems that the writer used got its input from different
sources, which is not apparently the case of procrustes object as states
this Printself sample:

Debug: Off
Modified Time: 164
Reference Count: 5
Registered Events: (none)
Number Of Required Inputs: 0
Input 0: (0x22f40)
Input 1: (0x22f40)
Input 2: (0x22f40)
Input 3: (0x22f40)


Please, thanks in advance for your comments.
Please also keep in mind I'm not very familiar to vtk/C++!


Here is the (very simple code) code responsible for that disaster:



  int inputs = 4;
  
  vtkPolyDataReader *reader = vtkPolyDataReader::New();
  vtkProcrustesAlignmentFilter *procrustes =
vtkProcrustesAlignmentFilter::New();
  vtkDataSetWriter *writer = vtkDataSetWriter::New(); 

  
  procrustes -> SetNumberOfInputs(inputs);
  procrustes -> GetLandmarkTransform() -> SetModeToSimilarity();
  //   procrustes -> GetLandmarkTransform() -> SetModeToRigidBody();
  
  
  reader -> SetFileName("landmark00.vtk");
  reader -> Update();
  procrustes -> SetInput(0, reader -> GetOutput());

  reader -> SetFileName("landmark01.vtk");
  reader -> Update();
  procrustes -> SetInput(1, reader -> GetOutput());

  reader -> SetFileName("landmark02.vtk");
  reader -> Update();
  procrustes -> SetInput(2, reader -> GetOutput());

  reader -> SetFileName("landmark03.vtk");
  reader -> Update();
  procrustes -> SetInput(3, reader -> GetOutput());
    
  procrustes -> Update();  
  procrustes -> PrintSelf(cout, 0);



  cout << endl << endl << "Procrustes writer saving" << endl;

  writer -> SetInput(procrustes -> GetOutput(0));
  writer -> SetFileName("00aligned.vtk");
  writer -> Update();
  writer -> PrintSelf(cout, 0);

  cout << endl << "Second saving" << endl ;
  writer -> SetInput(procrustes -> GetOutput(1));
  writer -> SetFileName("01aligned.vtk");
  writer -> Update();
  writer -> PrintSelf(cout, 0);

  writer -> SetInput(procrustes -> GetOutput(2));
  writer -> SetFileName("02aligned.vtk");
  writer -> Update();
  
  writer -> SetInput(procrustes -> GetOutput(2));
  writer -> SetFileName("03aligned.vtk");
  writer -> Update();



-- 
--------------------------
Jonathan BAILLEUL
Doctorant au GREYC Image
ISMRA, Université de Caen



More information about the vtkusers mailing list