[vtkusers] vtkImagePermute doesn't set dimensions?

Edward Bachta ebachta at ncsa.uiuc.edu
Tue Feb 4 14:48:51 EST 2003


It seems to be the case that vtkImagePermute doesn't set the dimensions of 
the output image dataset. For example, I have to resort to this:

  int dims[3];
  imgsrc->GetOutput()->GetDimensions(dims);
  //printf("dims: %i %i %i\n", dims[0], dims[1], dims[2]);
  img_permuter = vtkImagePermute::New();
  img_permuter->SetInput(imgsrc->GetOutput());
  img_permuter->SetFilteredAxes(axes);
  img_permuter->GetOutput()->SetDimensions(dims[axes[0]],
					   dims[axes[1]],
					   dims[axes[2]]);

to get the dimensions set properly in img_permuter->GetOutput(), otherwise
it's dimensions are (0,0,0). 

I also have to do this:

  int dims[3];
  //img_permuter->GetOutput()->SetDimensions(512, 256, 40);
  img_permuter->GetOutput()->GetDimensions(dims);
  printf("dims: %i %i %i\n", dims[0],dims[1],dims[2]);
  img_viewer->SetSize(dims[0], dims[1]);

to set the window size properly for offscreen rendering, otherwise 
vtkImageData defaults it's window size to 300x300.

Is this proper behavior? I expected the dimensions to be set 
automatically. Could there be something I missed?

-- 
Ed Bachta




More information about the vtkusers mailing list