[vtkusers] MRI DICOM image black and white display???

kidane hiliwi.leake at gmail.com
Tue Feb 25 03:53:19 EST 2014


I able to adjust it using lookuptable for a single dicom image. But when I
tried to read and display a series of Dicom images I could't able to
integrate the lookuptable. 

could anyone help me please??? the code is down.

    reader = vtkSmartPointer<vtkDICOMImageReader>::New();
    imageViewer = vtkSmartPointer<vtkImageViewer2>::New();
	
	///////////////////
    
    reader->SetDirectoryName(folderDCM.c_str());
    reader->Update();  
     
	vtkSmartPointer<vtkLookupTable> table =
vtkSmartPointer<vtkLookupTable>::New();
        table->SetRange(-600,900); // image intensity range
        table->SetValueRange(0.0, 1.0); // from black to white
        table->SetSaturationRange(0.0, 0.0); // no color saturation
        table->SetRampToLinear();
        table->Build();
         // Map the image through the lookup table
        vtkSmartPointer<vtkImageMapToColors> color =
vtkSmartPointer<vtkImageMapToColors>::New();
        color->SetLookupTable(table);
///////////////////////////////////////////////////////////////////////////	
        //color->SetInput(reader->GetOutput());		
         // Set the image                                      "here is the
problem. I couldn't link it"
         //reader->SetInput(color->GetOutput());
///////////////////////////////////////////////////////////////////////////
    imageViewer->SetInputConnection(reader->GetOutputPort());

    imageViewer->SetRenderWindow(ui->qVTK1->GetRenderWindow());

kind rgards,
	



--
View this message in context: http://vtk.1045678.n5.nabble.com/MRI-DICOM-image-black-and-white-display-tp5726091p5726102.html
Sent from the VTK - Users mailing list archive at Nabble.com.


More information about the vtkusers mailing list