<div><div dir="auto">Please provide a small compilable example that illustrates the problem.</div><br><div class="gmail_quote"><div>On Mon, Aug 14, 2017 at 10:43 AM kenichiro yoshimi <<a href="mailto:rccm.kyoshimi@gmail.com">rccm.kyoshimi@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Andaharoo,<br>
<br>
How about compiling with debug and using DebugOn member function on<br>
the blendFilter?<br>
  blendFilter->DebugOn();<br>
It may display additional information related to the problem.<br>
<br>
Regards,<br>
yoshimi<br>
<br>
2017-08-13 17:28 GMT+09:00 Andaharoo <<a href="mailto:Andx_roo@live.com" target="_blank">Andx_roo@live.com</a>>:<br>
> I have two 3d images that I'd like to blend and then display in imageViewer2.<br>
> Here's the code:<br>
> // Create the mask image based off input<br>
> maskImage = vtkSmartPointer<vtkImageData>::New();<br>
> maskImage->SetDimensions(inputImage->GetDimensions());<br>
> maskImage->SetSpacing(inputImage->GetSpacing());<br>
> maskImage->SetOrigin(inputImage->GetOrigin());<br>
> maskImage->AllocateScalars(VTK_UNSIGNED_CHAR, 3);<br>
> int* dim = maskImage->GetDimensions();<br>
> // Get pointer to beginning of image<br>
> unsigned char* ptr = static_cast<unsigned<br>
> char*>(maskImage->GetScalarPointer(0, 0, 0));<br>
> for (int i = 0; i < dim[0] * dim[1] * dim[2]; i++)<br>
> {<br>
>         // Set and advance the pixel<br>
>         *ptr++ = 255;<br>
>         *ptr++ = 0;<br>
>         *ptr++ = 0;<br>
> }<br>
> blendFilter = vtkSmartPointer<vtkImageBlend>::New();<br>
> blendFilter->AddInputData(inputImage);<br>
> blendFilter->AddInputData(maskImage);<br>
> blendFilter->SetOpacity(0, 1.0);<br>
> blendFilter->SetOpacity(1, 0.5);<br>
> blendFilter->Update();<br>
><br>
> Unfortunately my program just freezes and pulls up the vtkOutputWindow with<br>
> nothing in it.<br>
><br>
> Also does type matter when using these? I'm trying to blend a grayscale<br>
> (single float image) with an rgb image (uchar).<br>
><br>
><br>
><br>
> --<br>
> View this message in context: <a href="http://vtk.1045678.n5.nabble.com/Trouble-blending-two-3d-images-tp5744385.html" rel="noreferrer" target="_blank">http://vtk.1045678.n5.nabble.com/Trouble-blending-two-3d-images-tp5744385.html</a><br>
> Sent from the VTK - Users mailing list archive at Nabble.com.<br>
> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
><br>
> Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=vtkusers</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/vtkusers</a><br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/vtkusers</a><br>
</blockquote></div></div><div dir="ltr">-- <br></div><div class="gmail_signature" data-smartmail="gmail_signature">Unpaid intern in BillsBasement at noware dot com<br></div>