X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=vtk%2FvtkgdcmViewer.cxx;h=ce5afd62a67c1d0bfcf2ba5033c2e9b3df13df04;hb=cb4151f6e62f04656d529d3298757f11be09caaf;hp=97f305cec343c08b892460214ca0898efa9fd1a1;hpb=20098f1879eb5fb475a5cf7e9dd02b70d6893738;p=gdcm.git diff --git a/vtk/vtkgdcmViewer.cxx b/vtk/vtkgdcmViewer.cxx index 97f305ce..ce5afd62 100644 --- a/vtk/vtkgdcmViewer.cxx +++ b/vtk/vtkgdcmViewer.cxx @@ -4,6 +4,8 @@ #include #include #include +#include +#include #include "vtkGdcmReader.h" @@ -59,7 +61,20 @@ int main(int argc, char *argv[]) vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New(); vtkImageViewer2 *viewer = vtkImageViewer2::New(); - viewer->SetInput ( reader->GetOutput() ); + if( reader->GetLookupTable() ) + { + //convert to color: + vtkImageMapToColors *map = vtkImageMapToColors::New (); + map->SetInput (reader->GetOutput()); + map->SetLookupTable (reader->GetLookupTable()); + map->SetOutputFormatToRGB(); + viewer->SetInput ( map->GetOutput() ); + map->Delete(); + } + else + { + viewer->SetInput ( reader->GetOutput() ); + } viewer->SetupInteractor (iren); // float *range = reader->GetOutput()->GetScalarRange();