Thanks Luis, here is the code:<br><br>#include &quot;itkOrientedImage.h&quot;<br>#include &quot;itkGDCMImageIO.h&quot;<br>#include &quot;itkGDCMSeriesFileNames.h&quot;<br>#include &quot;itkImageSeriesReader.h&quot;<br>#include &quot;itkImageFileWriter.h&quot;<br>
<br>#include &quot;itkImageToVTKImageFilter.h&quot;<br><br>#include &quot;vtkRenderer.h&quot;<br>#include &quot;vtkRenderWindow.h&quot;<br>#include &quot;vtkRenderWindowInteractor.h&quot;<br>#include &quot;vtkPolyDataMapper.h&quot;<br>
#include &quot;vtkActor.h&quot;<br>#include &quot;vtkCamera.h&quot;<br>#include &quot;vtkPolyDataNormals.h&quot;<br>#include &quot;vtkStructuredPointsReader.h&quot;<br>#include &quot;vtkMarchingCubes.h&quot;<br>#include &quot;vtkProperty.h&quot;<br>
#include &quot;vtkCleanPolyData.h&quot;<br><br><br><br>int main( int argc, char* argv[] )<br>{<br><br>long int size[3];<br>double IntesityLevel=atof(argv[2]);<br><br>  typedef signed short    PixelType;<br>  const unsigned int      Dimension = 3;<br>
<br>  typedef itk::OrientedImage&lt; PixelType, Dimension &gt;         ImageType;<br><br>  typedef itk::ImageSeriesReader&lt; ImageType &gt;        ReaderType;<br>  ReaderType::Pointer reader = ReaderType::New();<br><br>  typedef itk::GDCMImageIO       ImageIOType;<br>
  ImageIOType::Pointer dicomIO = ImageIOType::New();<br>  <br>  reader-&gt;SetImageIO( dicomIO );<br><br>  typedef itk::GDCMSeriesFileNames NamesGeneratorType;<br>  NamesGeneratorType::Pointer nameGenerator = NamesGeneratorType::New();<br>
<br>  nameGenerator-&gt;SetUseSeriesDetails( true );<br>  nameGenerator-&gt;AddSeriesRestriction(&quot;0008|0021&quot; );<br><br>  nameGenerator-&gt;SetDirectory( argv[1] );<br><br><br>  <br>    std::cout &lt;&lt; std::endl &lt;&lt; &quot;The directory: &quot; &lt;&lt; std::endl;<br>
    std::cout &lt;&lt; std::endl &lt;&lt; argv[1] &lt;&lt; std::endl &lt;&lt; std::endl;<br>    std::cout &lt;&lt; &quot;Contains the following DICOM Series: &quot;;<br>    std::cout &lt;&lt; std::endl &lt;&lt; std::endl;<br>
<br>    typedef std::vector&lt; std::string &gt;    SeriesIdContainer;<br>    <br>    const SeriesIdContainer &amp; seriesUID = nameGenerator-&gt;GetSeriesUIDs();<br>    <br>    SeriesIdContainer::const_iterator seriesItr = seriesUID.begin();<br>
    SeriesIdContainer::const_iterator seriesEnd = seriesUID.end();<br>    while( seriesItr != seriesEnd )<br>      {<br>      std::cout &lt;&lt; seriesItr-&gt;c_str() &lt;&lt; std::endl;<br>      seriesItr++;<br>      }<br>
<br>    std::string seriesIdentifier;<br><br>    <br>    seriesIdentifier = seriesUID.begin()-&gt;c_str();<br>      <br><br>    std::cout &lt;&lt; std::endl &lt;&lt; std::endl;<br>    std::cout &lt;&lt; &quot;Now reading series: &quot; &lt;&lt; std::endl &lt;&lt; std::endl;<br>
    std::cout &lt;&lt; seriesIdentifier &lt;&lt; std::endl;<br>    std::cout &lt;&lt; std::endl &lt;&lt; std::endl;<br><br><br>    typedef std::vector&lt; std::string &gt;   FileNamesContainer;<br>    FileNamesContainer fileNames;<br>
<br>    fileNames = nameGenerator-&gt;GetFileNames( seriesIdentifier );<br><br>    reader-&gt;SetFileNames( fileNames );<br><br>    try<br>      {<br>      reader-&gt;Update();<br>      }<br>    catch (itk::ExceptionObject &amp;ex)<br>
      {<br>      std::cout &lt;&lt; ex &lt;&lt; std::endl;<br>      return EXIT_FAILURE;<br>      }<br><br>size[0] = reader-&gt;GetOutput()-&gt;GetRequestedRegion().GetSize()[0] ;<br>size[1] = reader-&gt;GetOutput()-&gt;GetRequestedRegion().GetSize()[1] ;<br>
size[2] = reader-&gt;GetOutput()-&gt;GetRequestedRegion().GetSize()[2] ;<br>std::cout &lt;&lt; &quot;A térfogat méretei:&quot; &lt;&lt; std::endl;<br>std::cout &lt;&lt; &quot;x:&quot; &lt;&lt; size[0] &lt;&lt; std::endl;<br>
std::cout &lt;&lt; &quot;y:&quot; &lt;&lt; size[1] &lt;&lt; std::endl;<br>std::cout &lt;&lt; &quot;z:&quot; &lt;&lt; size[2] &lt;&lt; std::endl;<br><br>///////////////////////////////////////// ITK ///////////////////////////////////////////////////////////////////<br>
 <br>   typedef itk::ImageToVTKImageFilter&lt; ImageType&gt;   ConnectorType;<br>   ConnectorType::Pointer connector = ConnectorType::New();<br>   connector-&gt;SetInput( reader-&gt;GetOutput() );<br><br>///////////////////////////////////////// VTK  ////////////////////////////////////////////////////////////////////<br>
<br>    vtkRenderer *renderer = vtkRenderer::New();<br>    vtkRenderWindow *window = vtkRenderWindow::New();<br>    window-&gt;AddRenderer(renderer);<br>    vtkRenderWindowInteractor *interactor = vtkRenderWindowInteractor::New();<br>
    interactor-&gt;SetRenderWindow(window);<br><br>    <br>    <br>    vtkStructuredPointsReader *vreader = vtkStructuredPointsReader::New();    <br>    vreader-&gt;SetInputConnection( connector-&gt;GetOutput() );<br>    //reader-&gt;SetFileName(argv[1]);<br>
    <br>    vtkMarchingCubes *iso = vtkMarchingCubes::New();<br>    iso-&gt;SetInputConnection(vreader-&gt;GetOutputPort());<br>    iso-&gt;SetValue( 0, IntesityLevel);<br><br>    vtkCleanPolyData *clean = vtkCleanPolyData::New();<br>
    clean-&gt;SetInputConnection(iso-&gt;GetOutputPort());<br><br>    vtkPolyDataNormals *normal = vtkPolyDataNormals::New();<br>    normal-&gt;SetInputConnection(clean-&gt;GetOutputPort());<br>    normal-&gt;SetFeatureAngle(60.0);<br>
<br>    vtkPolyDataMapper *mapper = vtkPolyDataMapper::New();<br>    mapper-&gt;SetInputConnection(normal-&gt;GetOutputPort());<br>    mapper-&gt;ScalarVisibilityOff();<br><br>    vtkActor *isoactor =  vtkActor::New();<br>
    isoactor-&gt;SetMapper(mapper);<br>    isoactor-&gt;GetProperty()-&gt;SetColor(1,1,0);<br>        <br>    vtkCamera *camera = vtkCamera::New();<br>    camera-&gt;SetViewUp (0, 0, 1);<br>    camera-&gt;SetPosition (0, -1, 0);<br>
   /* camera-&gt;SetFocalPoint (0, 0, 0);*/<br>    camera-&gt;ComputeViewPlaneNormal();<br><br>  <br>    renderer-&gt;AddActor(isoactor);<br>    renderer-&gt;SetActiveCamera(camera);<br>    renderer-&gt;ResetCamera ();<br>
    camera-&gt;Dolly(1);<br><br>  <br>    renderer-&gt;SetBackground(1,1,1);<br>    window-&gt;SetSize(640, 480);<br><br> <br>    renderer-&gt;ResetCameraClippingRange ();<br><br>    interactor-&gt;Initialize();<br>    window-&gt;SetWindowName( &quot;Koponya&quot; );  //azert itt mert bugos<br>
    interactor-&gt;Start(); <br><br>    std::cout &lt;&lt; &quot;Kész&quot; &lt;&lt; std::endl;<br><br>    <br>    reader-&gt;Delete();<br>    dicomIO-&gt;Delete();<br>    nameGenerator-&gt;Delete();<br>    connector-&gt;Delete();<br>
    renderer-&gt;Delete();<br>    window-&gt;Delete();<br>    interactor-&gt;Delete();<br>    vreader-&gt;Delete();<br>    iso-&gt;Delete();<br>    clean-&gt;Delete();<br>    normal-&gt;Delete();<br>    mapper-&gt;Delete();<br>
    isoactor-&gt;Delete();<br>    camera-&gt;Delete();<br><br><br>  return EXIT_SUCCESS;<br><br>}<br><br><br><div class="gmail_quote">2009/3/22 Luis Ibanez <span dir="ltr">&lt;<a href="mailto:luis.ibanez@kitware.com">luis.ibanez@kitware.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi Arepi,<br>
<br>
Please post your code...<br>
<br>
It doesn&#39;t makes much sense to connect the output of an importer<br>
as the input of a reader.  (maybe you meant to say a &quot;writer&quot; ?).<br>
<br>
Source code will be better that a verbal description of the source code  :-)<br>
<br>
    Thanks<br>
<br>
        Luis<br>
<br>
<br>
------------------------------------------<br>
On Sun, Mar 22, 2009 at 11:07 AM, Arepi &lt;<a href="mailto:szamosi.arpad@gmail.com">szamosi.arpad@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt; Hi,<br>
&gt;<br>
&gt; I tried connect itk to vtk whit itkImageToVTKImageFilter. The first part is<br>
&gt; itk and  read a DICOM series(see<br>
&gt; Examples/IO/DicomSeriesReadImageWrite2.cxx.), but I would the reader input<br>
&gt; connect to vtk, instead write to a .vtk file. The second part is vtk and I<br>
&gt; tried connect the itkImageToVTKImageFilter output to en<br>
&gt; vtkStructuredPointsReader(and than MarchingCubes, DataNormal etc) but came<br>
&gt; back whit following error:<br>
&gt;<br>
&gt;  error C2664: &#39;void vtkAlgorithm::SetInputConnection(vtkAlgorithmOutput *)&#39;<br>
&gt; : cannot convert parameter 1 from &#39;vtkImageData *&#39; to &#39;vtkAlgorithmOutput *&#39;<br>
&gt;        Types pointed to are unrelated; conversion requires<br>
&gt; reinterpret_cast, C-style cast or function-style cast<br>
&gt;<br>
&gt; I choossed a wrong reader or what should I do to works it fine?<br>
&gt;<br>
&gt; Thanks!<br>
&gt;<br>
&gt; Arepi<br>
&gt; --<br>
&gt; View this message in context: <a href="http://www.nabble.com/itkImageToVTKImageFilter-tp22646859p22646859.html" target="_blank">http://www.nabble.com/itkImageToVTKImageFilter-tp22646859p22646859.html</a><br>
&gt; Sent from the ITK - Users mailing list archive at Nabble.com.<br>
&gt;<br>
&gt; _____________________________________<br>
&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;<br>
&gt; Visit other Kitware open-source projects at<br>
&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;<br>
&gt; Please keep messages on-topic and check the ITK FAQ at: <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
&gt;<br>
&gt; Follow this link to subscribe/unsubscribe:<br>
&gt; <a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
&gt;<br>
</blockquote></div><br>