<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:"times new roman", "new york", "times", serif;font-size:12pt"><DIV><DIV>Hello, </DIV><DIV><BR>Okay, I have tried it with vtkContourFilter and it works, but still takes cropping problem. How can I be sure or determine the spatial coordinates that correct? What function in vtk should I use for cropping of the 3D-image? I think the problem lies not in the direction of the camera., but read with the pictures. Please help.<BR></DIV><DIV><BR>Thank you!<BR></DIV><DIV><BR></DIV><DIV><BR>typedef itk::OrientedImage&lt; InputPixelType, Dimension &gt;    ImageType;<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("0008|0021" );<BR>        nameGenerator-&gt;SetDirectory( selectedDirectory);<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>            seriesItr++;<BR>     }<BR> std::string seriesIdentifier;<BR>        seriesIdentifier = seriesUID.begin()-&gt;c_str();<BR><BR>        typedef std::vector&lt; std::string &gt;   FileNamesContainer;<BR> FileNamesContainer fileNames;<BR> fileNames = nameGenerator-&gt;GetFileNames( seriesIdentifier );</DIV><DIV><BR>
        reader-&gt;SetFileNames( fileNames );<BR>        reader-&gt;Update();<BR><BR>        typedef itk::Image&lt; InternalPixelType, Dimension &gt;  InternalImageType;<BR>        typedef itk::Image&lt;OutputPixelType, Dimension&gt; OutputImageType;<BR>        <BR>        typedef itk::ConfidenceConnectedImageFilter&lt;InternalImageType, OutputImageType&gt; ConnectedFilterType;<BR>        ConnectedFilterType::Pointer confidenceConnected = ConnectedFilterType::New();<BR>        <BR>confidenceConnected-&gt;SetInput(reader-&gt;GetOutput());<BR>confidenceConnected-&gt;SetMultiplier(2.5);<BR>        confidenceConnected-&gt;SetNumberOfIterations(2);<BR>         confidenceConnected-&gt;SetReplaceValue(255);<BR><BR>        InternalImageType::IndexType  index;<BR>        index[0] = (int)this-&gt;changeRegionGrowingInputX-&gt;value();<BR>        index[1] = (int)this-&gt;changeRegionGrowingInputY-&gt;value();<BR>        index[2] = (int)this-&gt;changeRegionGrowingInputZ-&gt;value();<BR>        confidenceConnected-&gt;AddSeed( index );<BR>        <BR>         typedef
 itk::VTKImageExport&lt; InternalImageType &gt; ExportFilter1Type;<BR>    typedef itk::VTKImageExport&lt; OutputImageType  &gt; ExportFilter2Type;<BR><BR>    ExportFilter1Type::Pointer itkExporter1 = ExportFilter1Type::New();<BR>    ExportFilter2Type::Pointer itkExporter2 = ExportFilter2Type::New();<BR>        <BR>            itkExporter1-&gt;SetInput( reader-&gt;GetOutput() );<BR>    itkExporter2-&gt;SetInput( confidenceConnected-&gt;GetOutput() );<BR>        <BR>        vtkImageImport* vtkImporter1 = vtkImageImport::New();  <BR>    ConnectPipelines(itkExporter1, vtkImporter1);<BR>    <BR>    vtkImageImport* vtkImporter2 = vtkImageImport::New();  <BR>ConnectPipelines(itkExporter2, vtkImporter2);<BR>    vtkImporter1-&gt;Update();<BR>    <BR>    mode3D = vtkInteractorStyleTrackballCamera::New();<BR><BR>        renderer3D = vtkRenderer::New();<BR><BR>        renderWindow3D = vtkRenderWindow::New();<BR>        renderWindow3D-&gt;AddRenderer(renderer3D);<BR><BR>    
        displayImage3D-&gt;SetRenderWindow(renderWindow3D);<BR>        displayImage3D-&gt;SetInteractorStyle(mode3D);<BR>            displayImage3D-&gt;Initialize();<BR><BR>contour = vtkContourFilter::New();<BR>     contour-&gt;SetInput( vtkImporter2-&gt;GetOutput() );<BR>       contour-&gt;ComputeNormalsOn();<BR>  contour-&gt;ComputeGradientsOn();<BR>  contour-&gt;ComputeScalarsOn();<BR>         contour-&gt;SetNumberOfContours(2);<BR>contour-&gt;SetValue(0, 255); <BR><BR>        polyMapper = vtkPolyDataMapper::New();</DIV><DIV>polyMapper-&gt;SetInput(contour-&gt;GetOutput());<BR>        polyMapper-&gt;ScalarVisibilityOff();</DIV><DIV><BR>polyActor = vtkActor::New();<BR>        polyActor-&gt;SetMapper(polyMapper);<BR> <BR>        propertyRegionGrowing = vtkProperty::New();<BR>        propertyRegionGrowing-&gt;SetAmbient(0.3);<BR>        propertyRegionGrowing-&gt;SetDiffuse(1.0);<BR>        propertyRegionGrowing-&gt;SetSpecular(0.2);<BR>
        propertyRegionGrowing-&gt;SetSpecularPower(10.0);<BR>propertyRegionGrowing-&gt;SetColor(1, 1, 1);<BR>        propertyRegionGrowing-&gt;SetRepresentationToSurface();<BR>        polyActor-&gt;SetProperty(propertyRegionGrowing);<BR>   <BR>          camera3D = vtkCamera::New();<BR>            camera3D-&gt;SetViewUp(0, 0, -1);<BR>            camera3D-&gt;SetPosition(0, 1, 0);<BR>            camera3D-&gt;SetFocalPoint(0, 0, 0);<BR>            camera3D-&gt;ComputeViewPlaneNormal();<BR>        camera3D-&gt;Azimuth(20);<BR></DIV><DIV><BR></DIV><DIV>renderer3D-&gt;AddActor(polyActor);<BR>          renderer3D-&gt;SetActiveCamera(camera3D);<BR>          renderer3D-&gt;ResetCamera();<BR>          camera3D-&gt;Dolly(1.3);<BR>          renderer3D-&gt;ResetCameraClippingRange();<BR>        </DIV><DIV><BR></DIV><BR><DIV style="font-family:arial, helvetica, sans-serif;font-size:10pt"><FONT size="2" face="Tahoma"><HR size="1"><B><SPAN style="font-weight: bold;">Von:</SPAN></B> Luis Ibanez &lt;luis.ibanez@kitware.com&gt;<BR><B><SPAN style="font-weight:
 bold;">An:</SPAN></B> Yusuf OEZBEK &lt;nasil122002@yahoo.de&gt;<BR><B><SPAN style="font-weight: bold;">CC:</SPAN></B> ITK Mailinglist &lt;insight-users@itk.org&gt;; VTK Mailinglist &lt;vtkusers@vtk.org&gt;; nasil122002@gmail.com<BR><B><SPAN style="font-weight: bold;">Gesendet:</SPAN></B> Dienstag, den 30. März 2010, 0:48:58 Uhr<BR><B><SPAN style="font-weight: bold;">Betreff:</SPAN></B> Re: [vtkusers] Region Growing (Volume Rendering) Cropping Problem<BR></FONT><BR>Hi Yusuf,<BR><BR>The output of the Region Growing filters in ITK are binary images.<BR><BR>The fist thing you should do is to make sure that your camera is<BR>looking in the right direction.<BR><BR>To this end, you could simply introduce first a surface-based visualization<BR>of the binary image, by passing it through the vtkContour filter, as illustrated<BR>in the examples :<BR><BR>           InsightApplications/Auxiliary/vtk/<BR>                    
 itkReadITKImage3DExtractContourVTK.cxx<BR>                     ExtractIsoSurface.cxx<BR>                     ScreenShotGenerator.cxx<BR><BR><A href="http://public.kitware.com/cgi-bin/viewcvs.cgi/Auxiliary/vtk/?root=InsightApplications" target="_blank">http://public.kitware.com/cgi-bin/viewcvs.cgi/Auxiliary/vtk/?root=InsightApplications</A><BR><BR><BR>Once you have made sure that your spatial coordinates are correct,<BR>you could proceed to setup a volume rendering visualization.<BR><BR>You should then make sure that you use a transfer function suitable<BR>for an image whose pixel values are only { 0, 255 }. The transfer<BR>function that you may have used for the original values of the DICOM<BR>image, will probably not be appropriate for the binary values of the<BR>segmented image.<BR><BR><BR>Also, please note that Volume Rendering (although it is an extremly<BR>useful visualization method) is not a substitute for image
 segmentation<BR>methods.<BR><BR><BR><BR>    Regards,<BR><BR><BR>         Luis<BR></DIV><DIV style="font-family:arial, helvetica, sans-serif;font-size:10pt"><BR></DIV><DIV style="font-family:arial, helvetica, sans-serif;font-size:10pt"><BR></DIV><DIV style="font-family:arial, helvetica, sans-serif;font-size:10pt"><BR>-----------------------------------------------------------------------------------------------<BR>On Mon, Mar 29, 2010 at 6:10 AM, Yusuf OEZBEK &lt;<A ymailto="mailto:nasil122002@yahoo.de" href="mailto:nasil122002@yahoo.de">nasil122002@yahoo.de</A>&gt; wrote:<BR>&gt; Hello All.<BR>&gt;<BR>&gt; I have a problem with to cut (cropping) a 3D object, which I produced by the<BR>&gt; segmentation-method “region growing”. In the beginning I read the DICOM (.<BR>&gt; dcm) images with itkImageSeriesReader then I run region growing -algorithm,<BR>&gt; in order to connect itk with vtk and a 3D object produce, I use<BR>&gt;
 ImageToVTKImageFilter and volume rendering (ray casting). And after<BR>&gt; segmentation of cutting the images I give below<BR>&gt; vtkFixedPointVolumeRayCastMapper (SetCroppingRegionPlanes) the Xmin, Xmax,<BR>&gt; Ymin, Ymax, Zmin and Zmax coordinates, but the result is a black screen. But<BR>&gt; when I read the images with vtkDICOMImageReader and then segmented with<BR>&gt; volume rendering, then it works completely well. The problem arises only for<BR>&gt; region growing -algorithm. Where is my mistake in the code? What should I<BR>&gt; do?<BR>&gt;<BR>&gt; Thank you.<BR>&gt;<BR>&gt;<BR>&gt;</DIV><BR></DIV><DIV><BR></DIV>


</div><br>__________________________________________________<br>Do You Yahoo!?<br>Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen Massenmails. <br>http://mail.yahoo.com </body></html>