[vtkusers] one problem about 2D Image display
wjynyny
wjynyny at 126.com
Fri Jun 22 08:13:01 EDT 2007
Hello:
I wan't to display three 2D orthogonal planes in three windows belong to one dialog.Someone give me one section of code .But I don't know how to form three windows in one dialog and how to render orthogonal planes in three windows belong to one dialog.The examples are mostly in Tcl and Python language.Please give me detailed codes (in C++)and tell me where can i get the the related information.Thank you very much.
The gived codes are as follows:
vtkImageCast *readerImageCast = vtkImageCast::New();
readerImageCast->SetInputConnection(reader1->GetOutputPort());
readerImageCast->SetOutputScalarTypeToUnsignedInt();
readerImageCast->ClampOverflowOn();
vtkTransform *t1=vtkTransform::New();
t1->RotateX(x);
t1->RotateY(y);
t1->RotateZ(z);
vtkImageReslice *res=vtkImageReslice::New();
res->SetInputConnection(readerImageCast-> GetOutputPort());
res->SetResliceTransform (t1);
res->InterpolateOn();
res->SetInterpolationModeToCubic();
res->SetBackgroundLevel(1023);
vtkImageViewer *view =vtkImageViewer::New();
view->SetInputConnection(res-> GetOutputPort());
view->SetColorWindow(2000);
view->SetColorLevel(1000);
int max=view->GetWholeZMax ();
int min=view->GetWholeZMin ();
view->SetZSlice(max/2);
view->Render();
劲 爆 150 万 同 时 在 线,众 人 追 捧 梦 幻 西 游
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070622/6a984984/attachment.htm>
More information about the vtkusers
mailing list