<span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; ">Hi everyone,<div>I am trying to read some data using the ITK ImageFileReader, then after doing thresholding I am trying to import it into VTK and display it using VTK. If I use the itk image as input to the VTK importer then I don&#39;t have any problem. But if I threshold it first then VTK gives an error &quot;3D texture not supported&quot;. The code is like this:</div>
<div><br></div><div><div>  typedef itk::Image&lt; PixelT, 2&gt; ImageT;</div><div>  typedef itk::ImageFileReader&lt; ImageT &gt; ReaderT;</div><div>  typedef itk::Image&lt; unsigned char, 2 &gt; UCharImageT;</div><div>  typedef itk::BinaryThresholdImageFilter&lt; ImageT, UCharImageT &gt; ThresholdT;</div>
<div>  typedef itk::VTKImageExport&lt; UCharImageT &gt; ExportFilterT;</div><div><br></div><div>    ReaderT::Pointer reader = ReaderT::New();</div><div>    reader-&gt;SetFileName( fullFilePath.c_str());</div><div>    reader-&gt;Update();</div>
<div><br></div><div>    ThresholdT::Pointer thresholder = ThresholdT::New();</div><div>    thresholder-&gt;SetInput( reader-&gt;GetOutput() );</div><div>    thresholder-&gt;SetOutsideValue( 0 );</div><div>    thresholder-&gt;SetInsideValue( 255 );</div>
<div>    unsigned char component[3];</div><div>    component[0] = component[1] = component[2] = 0;</div><div>    thresholder-&gt;SetLowerThreshold( component );</div><div>    component[0] = component[1] = component[2] = 200;</div>
<div>    thresholder-&gt;SetUpperThreshold( component );</div><div><br></div><div>    ExportFilterT::Pointer itkExporter = ExportFilterT::New();</div><div>    itkExportFilters.push_back( itkExporter );</div><div>    itkExporter-&gt;SetInput( thresholder-&gt;GetOutput() );     // If instead I use reader-&gt;GetOutput() then there is no error.</div>
<div>    itkExporter-&gt;Update();</div><div><br></div><div>    vtkImageImport* vtkImporter = vtkImageImport::New();</div><div>    ConnectPipelines(itkExporter, vtkImporter);</div><div><br></div><div><div>  voi = vtkExtractVOI::New();</div>
<div>  voi-&gt;SetInput( vtkImporter-&gt;GetOutput() );</div><div>  voi-&gt;SetVOI( 0, 1023, 0, 1023, 0, 0);</div><div>  texture = vtkTexture::New();</div><div>  texture-&gt;SetInput( voi-&gt;GetOutput() );</div><div>  texture-&gt;InterpolateOn();</div>
<div>  texture-&gt;SetLookupTable( colorMap );</div><div>  </div><div>  map = vtkPolyDataMapper::New();</div><div>  map-&gt;SetInput( imagePlane-&gt;GetOutput() );</div><div>  </div><div>  actor = vtkActor::New();</div><div>
  actor-&gt;SetMapper( map );</div><div>  actor-&gt;SetTexture( texture );</div><div><br></div><div>  ren = vtkRenderer::New();</div><div>  ren-&gt;AddActor( actor );</div><div>  double x, y, z;</div><div>  x = y = z = 0.0;</div>
<div>  //ren-&gt;GetActiveCamera()-&gt;GetPosition(x, y, z);</div><div>  //std::cout &lt;&lt; &quot;Camera position: x = &quot; &lt;&lt; x &lt;&lt; &quot;, y = &quot; &lt;&lt; y &lt;&lt; &quot;, z = &quot; &lt;&lt; z &lt;&lt; std::endl;</div>
<div>  //ren-&gt;GetActiveCamera()-&gt;SetPosition(0.0, 0.0, 1.0);</div><div>  ren-&gt;SetBackground(0.0, 0.0, 0.0 );</div><div><br></div><div><br></div><div>I posted this in the VTK list because the error was being thrown by VTK. If this is not the best place for it please do tell me.</div>
<div><br></div><div><br></div><div>Cheers,</div><div>D</div></div><div><br></div></div></span>