[Insight-users] 2D CT image visualization problem

Yusuf OEZBEK nasil122002 at yahoo.de
Wed Dec 15 16:15:18 EST 2010



Hello Yang,


I send you a example. Look at vtkLookupTable (SetTableRange()) for the change of 
threshold or Hounsfield units. 


//Display 2D-CT-Data (Axial)

this->displayImageAxial->show();  //FLTK Box
this->displayImageAxial->redraw();


vtkInteractorStyleTrackballCamera* modeAxial = 
vtkInteractorStyleTrackballCamera::New();

vtkRenderer* rendererAxial = vtkRenderer::New();

renderWindowAxial* renderWindowAxial = vtkRenderWindow::New();
renderWindowAxial->AddRenderer(rendererAxial);

displayImageAxial->SetRenderWindow(renderWindowAxial);
displayImageAxial->SetInteractorStyle(modeAxial);
displayImageAxial->Initialize();


vtkLookupTable* hueLut = vtkLookupTable::New();
    	hueLut->SetTableRange (-250,1200); // -250= L  1200= W 
 (http://en.wikipedia.org/wiki/Hounsfield_scale)
hueLut->SetSaturationRange (0, 0);
hueLut->SetHueRange (0, 0);
hueLut->SetValueRange (0, 2);
hueLut->Build(); //effective built

vtkImageMapToColors *colorsAxial = vtkImageMapToColors::New();
colorsAxial->SetInput(reader2D->GetOutput());
colorsAxial->SetLookupTable(hueLut);

vtkImageActor* actorAxial = vtkImageActor::New();
actorAxial->SetInput(colorsAxial->GetOutput());
actorAxial->SetOpacity(1.0);
actorAxial->SetDisplayExtent(0,reader2D->GetWidth()-1 , 
0,reader2D->GetHeight()-1, 
numberOfFilesOnSelectedFolder/2,numberOfFilesOnSelectedFolder/2); //0,511, 
0,511, 100, 100
 

vtkCamera* cameraAxial = vtkCamera::New();
cameraAxial->SetViewUp(0, 0, -1);
cameraAxial->SetPosition(0, 1, 0);
cameraAxial->SetFocalPoint(0, 0, 0);
cameraAxial->ComputeViewPlaneNormal(); 
cameraAxial->Roll(90);
cameraAxial->Azimuth(90);
cameraAxial->Roll(-90);

 
rendererAxial->AddActor(actorAxial);
rendererAxial->SetActiveCamera(cameraAxial);
rendererAxial->ResetCamera();
cameraAxial->Dolly(1.0);
rendererAxial->ResetCameraClippingRange();



 Mit freundlichen Grüßen
Yusuf ÖZBEK




________________________________
Von: Xiaopeng Yang <yxp233 at postech.ac.kr>
An: vtkusers at vtk.org; insight-users at itk.org
Gesendet: Mittwoch, den 15. Dezember 2010, 13:04:51 Uhr
Betreff: [Insight-users] 2D CT image visualization problem


Hello everyone,
 
I applied VTKimageViewer2 to visualize 2D CT images. And I succeeded. 
Furthermore, I would like to only show the pixels within a given gray scale 
threshold interval. But I have no idea how to do it. I would appreciate any 
help.
 
Thank you very much,
Xiaopeng

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20101215/7c30a5aa/attachment.htm>


More information about the Insight-users mailing list