[vtkusers] Data pipeline between vtkContourFilter and vtkImageMapToColors
Iyas Hamdan
iyas.hamdan at gmail.com
Tue Feb 3 11:21:26 EST 2015
Hello vtkusers,
I'm trying to visualize the RT dose on top of a CT image. To do so, I first
find the iso-dose lines using vktContourFilter which works just fine.
Then I want to add colors to those iso-lines depending on their value. So I
creat a lookup table and then ( I think ) I have to map my image through
this lookup table using vtkImageMapToColors.
Afterwards, I have to use vtkImageBlend with two mappers as inputs ( one
for iso-lines and one for the CT image).
So it goes something like this:
vtkSmartPointer<vtkImageMapToColors> DoseColorMapper =
vtkSmartPointer<vtkImageMapToColors>::New();
DoseColorMapper->SetInputData(contourFilter->GetOutput());
DoseColorMapper->SetLookupTable(l_lut);
DoseColorMapper->SetOutputFormatToRGB();
/// ... the same for the CT image
vtkSmartPointer<vtkImageBlend> imgBlender =
vtkSmartPointer<vtkImageBlend>::New();
imgBlender->SetOpacity(0, 0.5);
imgBlender->SetOpacity(1, 0.5);
imgBlender->AddInputConnection(CtColorMapper->GetOutputPort());
imgBlender->AddInputConnection(DoseColorMapper->GetOutputPort());
The problem is, when I trying doing passing the output of the ContourFilter
to the mapper I get this error :
vtkCompositeDataPipeline (037DBD78): Input for connection index 0 on input
port index 0 for algorithm vtkImageMapToColors(037DBC50) is of type
vtkPolyData, but a vtkImageData is required.
So my question is, do I have to convert the output of ContourFilter from
polydata to imagedata ?
or is there another way around this by giving the mapper an input of type
polydata ?
any help would be really appreciated.
Thanks in advance
Iyas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20150203/8ece24bb/attachment.html>
More information about the vtkusers
mailing list