[vtkusers] dimensions of image
Renaud Isabelle
renauisa at yahoo.fr
Thu Jul 7 11:03:44 EDT 2005
Hi,
I'm reading a jpeg image with vtkJPEGReader and visualize it as usual with vtkActor, vtkRenderer, vtkRenderWindow....
To scale and position correctly my image, I need to set up camera parameters, as I forgot yesterday.
My image is 640*470 pixels. However, as I'm trying to retrieve its dimensions , I got something wrong.
//pipeline
void ExecutePipeline()
{
shiftscale->SetInput( reader->GetOutput(); //vtkImageShiftScale
actor->SetInput( shiftscale->GetOutput(); //vtkImageActor
renderer->AddActor( actor ); //vtkRenderer
renderWindow->AddRenderer( renderer ); //vtkRenderWindow
SetupCamera();
}
void SetupCamera()
{
vtkImageData* image = reader->GetOutput();
int dimension[2]; image->GetDimensions(dimension); --> 106200544, 0 ???????????????
float spacing[2]; image->GetSpacing(spacing); --> 1,1
float origin[2]; image->GetOrigin(origin); --> 0,0
}
here is how I call my functions:
reader->SetFileName("image.jpg"); //vtkJPEGReader
ExecutePipeline();
What did I miss? Plese help me
Isabelle
---------------------------------
Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger
Téléchargez le ici !
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20050707/4da25106/attachment.htm>
More information about the vtkusers
mailing list