[vtkusers] blending DICOM images

Sam Raby rabysam28 at gmail.com
Tue Feb 18 19:36:12 EST 2014


I guess I would like to know if there is any trivial error in my code. I
have seen usage of vtkBlendImage for 2D images [1]. but what I have done in
my code is that I am blending the whole 3D volume of the two DICOM series,
as I did not find any other way.

The code does not have compilation error, but the result seems sort of
random; sometimes it jumps to another slice when I change the blending
ratio, while I have already verified that image dimension, image spacing
and image origin of both volumes are equal.

[1] http://www.vtk.org/Wiki/VTK/Examples/Cxx/Images/CombineImages


On Tue, Feb 18, 2014 at 6:21 PM, Bill Lorensen <bill.lorensen at gmail.com>wrote:

> Does not work, does not help.
> On Feb 18, 2014 6:52 PM, "Sam Raby" <rabysam28 at gmail.com> wrote:
>
>>  Hello,
>>
>> I am using vtkBlendImage to overlay two DICOM images. The two images are
>> already perfectly co-registered.
>>
>> To overlay them, I am using the following code, but it does not work
>> well. Would you advice if there is any problem with the code? Thanks!
>>
>>     reader1->SetDirectoryName("/home/dicomDIR1");
>>
>>     reader1->Update();
>>
>>
>>     reader2->SetDirectoryName("/home/dicomDIR2");
>>
>>     reader2->Update();
>>
>>
>>     blend->AddInputConnection(reader1->GetOutputPort());
>>
>>     blend->AddInputConnection(reader2->GetOutputPort());
>>
>>
>>     blend->SetOpacity(0,0.5);
>>
>>     blend->SetOpacity(1,0.5);
>>
>>     imageViewer->SetInputConnection(blend->GetOutputPort());
>>
>>     imageViewer->SetSlice(oneSlice);
>>
>>
>>
>>
>>
>>
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20140218/3cc1789f/attachment.html>


More information about the vtkusers mailing list