Try changing:<br>  blend-&gt;SetInput(0,connector_ITK_to_VTK_alpha_data2-&gt;GetOutput());<br><div id=":1pc">to<br>  blend-&gt;SetInput(1,connector_ITK_to_VTK_alpha_data2-&gt;GetOutput());<br></div><br><br><div class="gmail_quote">
On Mon, Apr 11, 2011 at 10:15 AM, Michal Srna <span dir="ltr">&lt;<a href="mailto:kositch@seznam.cz">kositch@seznam.cz</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hello dear VTK users,<br>
<br>
I would like to connect two 3D images from ITK (same dimensions) to VTK and blend them using vtkImageBlend. The problem is, that when I run the code, it crashes on this part of the code of vtkImageImport.cxx<br>
<br>
  if (this-&gt;WholeExtentCallback)<br>
    {<br>
    tryCatchMacro(<br>
      this-&gt;SetWholeExtent(<br>
-&gt;        (this-&gt;WholeExtentCallback)(this-&gt;CallbackUserData)),<br>
      &quot;Calling WholeExtentCallback: &quot;);<br>
    }<br>
<br>
Here is my corresponding code.  &quot;TransformedImportFilter&quot; and  &quot;FixedImportFilter&quot; are outputs of ITKImageFilter, which connects my image data from memory into the ITK pipeline:<br>
<br>
                          /*connecting ITK to VTK*/<br>
                                typedef itk::ImageToVTKImageFilter&lt; TransformedImageType &gt; ITK_to_VTK_ConnectorType;<br>
<br>
                                ITK_to_VTK_ConnectorType::Pointer connector_ITK_to_VTK_alpha_data1 = ITK_to_VTK_ConnectorType::New();<br>
                                ITK_to_VTK_ConnectorType::Pointer connector_ITK_to_VTK_alpha_data2 = ITK_to_VTK_ConnectorType::New();<br>
<br>
                                connector_ITK_to_VTK_alpha_data1-&gt;SetInput( TransformedImportFilter-&gt;GetOutput() );<br>
                                connector_ITK_to_VTK_alpha_data2-&gt;SetInput( FixedImportFilter-&gt;GetOutput() );<br>
<br>
                        /*blending image data*/<br>
                                vtkSmartPointer&lt;vtkImageBlend&gt; blend = vtkSmartPointer&lt;vtkImageBlend&gt;::New();<br>
                                blend-&gt;SetOpacity(0, 0.5);<br>
                                blend-&gt;SetOpacity(1, 0.5);<br>
                                blend-&gt;SetInput(0,connector_ITK_to_VTK_alpha_data1-&gt;GetOutput());<br>
                                blend-&gt;SetInput(0,connector_ITK_to_VTK_alpha_data2-&gt;GetOutput());<br>
<br>
                        /*connecting VTK to ITK*/<br>
                                typedef itk::VTKImageToImageFilter&lt; TransformedImageType &gt; VTK_to_ITK_ConnectorType;<br>
<br>
                                VTK_to_ITK_ConnectorType::Pointer connector_VTK_to_ITK = VTK_to_ITK_ConnectorType::New();<br>
<br>
                                connector_VTK_to_ITK-&gt;SetInput( blend-&gt;GetOutput() );<br>
<br>
                        /*writing the data into DICOM*/<br>
                                typedef itk::ImageFileWriter&lt; TransformedImageType &gt; WriterType;<br>
                                WriterType::Pointer writer = WriterType::New();<br>
                                writer-&gt;SetFileName(output_alpha_visualization);<br>
                                writer-&gt;SetInput(connector_VTK_to_ITK-&gt;GetOutput() );<br>
                                writer-&gt;Update();<br>
<br>
I think the problem is already in process of importing data from ITK to VTK. I am using ITKv4 and VTK 5.6.1 on Windows platform with MVSC++.<br>
<br>
I will be happy, if someone will help me.<br>
<br>
Best regards,<br>
<br>
Pavli<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" 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" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</blockquote></div><br>