<br>Hi Yusuf,<br><br><br>   Manually modifying the pixel type tag in the <br>   metaimage header  will not do the trick.<br><br>   (in your modified image, the pixel type doesn&#39;t<br>   match the content of the pixel buffer, which <br>
   explains the distorted appearance of the image).<br><br><br>   My apologies if my instructions were not clear.<br><br><br><br>   What I suggested you to do, was to change<br>   the pixel type in your code, and then to run<br>
   the code again.<br><br><br>   Please do so, <br>   and let us know what you find.<br><br><br>       Thanks<br><br><br>           Luis   <br><br><br><br>--------------------------------------------------<br><div class="gmail_quote">
On Wed, May 26, 2010 at 9:10 PM, Yusuf OEZBEK <span dir="ltr">&lt;<a href="mailto:nasil122002@yahoo.de">nasil122002@yahoo.de</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;">
<div><div style=""><div>Hello Luis,<br></div><div><br></div><div>I have manually converted the pixel type to unsigned long (ElementType = MET_ULONG) in. mhd file and loaded with 3Dslicer. It works but the 3D-image is not correctly displayed. I get as 3D two axial-view side by side. If I visualize it in my program with vtk, then I get purposeful 3D-image.</div>
<div><br></div><div><br></div><div><br></div><div>Here are the screenshots:</div><div><br></div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">Output-Image of watershed on my program (visualized with vtkContourFilter):</div>
<div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><span><a href="http://www.wopsys.com/bilder/watershed_visualizedwithvtk.png" target="_blank">http://www.wopsys.com/bilder/watershed_visualizedwithvtk.png</a></span></div>
<div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><br></div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><br></div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">
Output-Image of watershed on 3DSlicer:</div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><span><a href="http://www.wopsys.com/bilder/watershed.JPG" target="_blank">http://www.wopsys.com/bilder/watershed.JPG</a></span></div>
<div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><br></div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><br></div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">
Output-Image of DicomSeriesReadImageWrite2,
 so before segmentation:</div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><span><a href="http://www.wopsys.com/bilder/before_segmentation.png" target="_blank">http://www.wopsys.com/bilder/before_segmentation.png</a></span></div>
<div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><br></div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><br></div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">
<br></div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">Thank you.</div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">
<font face="Tahoma" size="2"><div class="im"><hr size="1"><b><span style="font-weight: bold;">Von:</span></b> Luis Ibanez &lt;<a href="mailto:luis.ibanez@kitware.com" target="_blank">luis.ibanez@kitware.com</a>&gt;<br><b><span style="font-weight: bold;">An:</span></b> Yusuf OEZBEK &lt;<a href="mailto:nasil122002@yahoo.de" target="_blank">nasil122002@yahoo.de</a>&gt;<br>
<b><span style="font-weight: bold;">CC:</span></b> ITK Mailinglist &lt;<a href="mailto:insight-users@itk.org" target="_blank">insight-users@itk.org</a>&gt;; VTK Mailinglist &lt;<a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a>&gt;; <a href="mailto:nasil122002@gmail.com" target="_blank">nasil122002@gmail.com</a><br>
</div><b><span style="font-weight: bold;">Gesendet:</span></b> Mittwoch, den 26. Mai 2010, 19:56:18 Uhr<div><div></div><div class="h5"><br><b><span style="font-weight: bold;">Betreff:</span></b> Re: [Insight-users] visualization-problem after segmentation and  cropping<br>
</div></div></font><div><div></div><div class="h5"><br><br>Hi Yusuf,<br><br>Excellent.<br><br>Thanks for posting the screenshots.<br><br><br>They illustrate that the pipeline is working correctly<br>up to the output of the region growing filter.<br>
<br><br>You can now focus on getting the Watershed <br>
filter to work correctly by using as output image<br>an image of pixel type &quot;unsigned long&quot; and <br>making sure that it doesn&#39;t turn into &quot;long long&quot;<br>in your 64 bits machine.<br><br>Please post the screenshot of the Watershed<br>

output once you get it to work.<br><br><br>    Thanks<br><br><br>           Luis<br><br><br>-------------------------------------------------------------------<br><div class="gmail_quote">On Tue, May 25, 2010 at 4:14 PM, Yusuf OEZBEK <span dir="ltr">&lt;<a rel="nofollow" href="mailto:nasil122002@yahoo.de" target="_blank">nasil122002@yahoo.de</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div><div>Hello Luis,<br></div><div><br></div><div>I have the.mhd files loaded with 3DSlicer. Here are the screenshots:</div>

<div><br></div><div>Output-Image of Region Growing:</div><div><span><a rel="nofollow" href="http://www.wopsys.com/bilder/regiongrowing_notcropped.JPG" target="_blank">http://www.wopsys.com/bilder/regiongrowing_notcropped.JPG</a></span></div>

<div><span><a rel="nofollow" href="http://www.wopsys.com/bilder/regiongrowing_cropped.JPG" target="_blank">http://www.wopsys.com/bilder/regiongrowing_cropped.JPG</a></span></div><div><br></div><div><br></div><div>Output-Image of DicomSeriesReadImageWrite2:</div>

<div><span><a rel="nofollow" href="http://www.wopsys.com/bilder/DicomSeriesReadImageWrite2.JPG" target="_blank">http://www.wopsys.com/bilder/DicomSeriesReadImageWrite2.JPG</a></span></div><div><br></div><div><br></div><div>
<br></div><div>
<br></div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">Thanks.<br><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"><font face="Tahoma" size="2"><div><hr size="1">

<b><span style="font-weight: bold;">Von:</span></b> Luis Ibanez &lt;<a rel="nofollow" href="mailto:luis.ibanez@kitware.com" target="_blank">luis.ibanez@kitware.com</a>&gt;<br><b><span style="font-weight: bold;">An:</span></b> Yusuf OEZBEK &lt;<a rel="nofollow" href="mailto:nasil122002@yahoo.de" target="_blank">nasil122002@yahoo.de</a>&gt;<br>

</div><b><span style="font-weight: bold;">CC:</span></b> ITK Mailinglist &lt;<a rel="nofollow" href="mailto:insight-users@itk.org" target="_blank">insight-users@itk.org</a>&gt;; VTK Mailinglist &lt;<a rel="nofollow" href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a>&gt;; <a rel="nofollow" href="mailto:vtkusers-request@vtk.org" target="_blank">vtkusers-request@vtk.org</a>; <a rel="nofollow" href="mailto:nasil122002@gmail.com" target="_blank">nasil122002@gmail.com</a><br>

<b><span style="font-weight: bold;">Gesendet:</span></b> Dienstag, den 25. Mai 2010, 17:00:30 Uhr<br><b><span style="font-weight: bold;">Betreff:</span></b> Re: [Insight-users]
 visualization-problem after segmentation and  cropping<br></font><div><div><br>Hi Yusuf,<br><br><br>When you are debugging a pipeline you should<br>start by verifying that the data has been properly<br>
loaded in memory, and then you should proceed<br>to check out the output of every intermediate filter<br>in order: from source to final output.<br><br><br>Please start by doing the following:<br><br><br>    Verify that you succeeded reading the DICOM series.<br>

<br>    Simply write the output of the Series reader to<br>    an output file.<br><br>    This essentially the code that you will see in<br>    the example:<br><br><br>    Insight/Examples/IO/<br>        DicomSeriesReadImageWrite2.cxx<br>

<br><br>    Open that file with any visualization software<br><br>    For example:<br><br>    1) Paraview. (<a rel="nofollow" href="http://www.paraview.org" target="_blank">http://www.paraview.org</a>)  or<br>    2) Slicer, (<a rel="nofollow" href="http://www.slicer.org" target="_blank">http://www.slicer.org</a>)  or<br>

    3) SNAP, (<a rel="nofollow" href="http://sourceforge.net/projects/itk-snap/" target="_blank">http://sourceforge.net/projects/itk-snap/</a>)  or<br>    4) VV (<a rel="nofollow" href="http://www.creatis.insa-lyon.fr/rio/vv" target="_blank">http://www.creatis.insa-lyon.fr/rio/vv</a>)<br>

<br><br>Please let us know if you manage to do that initial<br>test, (it will be great if you post a screen shot of<br>that output image)<br><br>and then we will guide you to the next step.<br><br><br><br>    Regards,<br>

<br><br>         Luis<br><br><br>--------------------------------------------------<br>On Mon, May 24, 2010 at 10:26 PM, Yusuf OEZBEK &lt;<a rel="nofollow" href="mailto:nasil122002@yahoo.de" target="_blank">nasil122002@yahoo.de</a>&gt; wrote:<br>

&gt; Hello,<br>&gt;<br>&gt;  I have a problem with cut (cropping) and visualization a 3D image, which I<br>&gt; produced by the segmentation-method “watershed and region
 growing”. In the<br>&gt; beginning I read the DICOM images with itkImageSeriesReader, then I run<br>&gt; watershed or region growing algorithm, in order to connect itk with vtk and<br>&gt; a 3D image produce and for the displaying of segmentation I use<br>

&gt; vtkContourFilter. After segmentation for cropping the images I use<br>&gt; vtkBoxClipDataSet and vtkDataSetSurfaceFilter, but the result is a black<br>&gt; screen.  When I read the images with vtkDICOMImageReader or<br>

&gt; itkImageSeriesReader and then segmented with volume rendering, marching<br>&gt; cubes watershed and region growing, then it works completely well. The<br>&gt; problem arises only when cut for watershed and region growing algorithm.<br>

&gt; What am I doing wrong?<br>&gt;<br>&gt; To understand my problem better, please see my screenshots on the following<br>&gt; link.<br>&gt;<br>&gt;<br>&gt;<br>&gt; <a rel="nofollow" href="http://www.wopsys.com/bilder/segmentation.html" target="_blank">http://www.wopsys.com/bilder/segmentation.html</a><br>

&gt;<br>&gt;<br>&gt;<br>&gt; To determine whether there missing of any geometrical informations. I had<br>&gt; sent the following outputs of tests.<br>&gt;<br>&gt; <a rel="nofollow" href="http://www.wopsys.com/Outputs/Output_MarchingCubes.txt" target="_blank">http://www.wopsys.com/Outputs/Output_MarchingCubes.txt</a><br>

&gt; <a rel="nofollow" href="http://www.wopsys.com/Outputs/Output_VolumeRendering.txt" target="_blank">http://www.wopsys.com/Outputs/Output_VolumeRendering.txt</a><br>&gt; <a rel="nofollow" href="http://www.wopsys.com/Outputs/Output_Watershed.txt" target="_blank">http://www.wopsys.com/Outputs/Output_Watershed.txt</a><br>

&gt; <a rel="nofollow" href="http://www.wopsys.com/Outputs/Output_RegionGrowing.txt" target="_blank">http://www.wopsys.com/Outputs/Output_RegionGrowing.txt</a><br>&gt;<br>&gt; Thanks.<br>&gt;<br>&gt;<br>&gt; ________________________________<br>

&gt; Von: Luis Ibanez &lt;<a rel="nofollow" href="mailto:luis.ibanez@kitware.com" target="_blank">luis.ibanez@kitware.com</a>&gt;<br>&gt; An: Yusuf OEZBEK &lt;<a rel="nofollow" href="mailto:nasil122002@yahoo.de" target="_blank">nasil122002@yahoo.de</a>&gt;<br>

&gt; CC: ITK Mailinglist &lt;<a rel="nofollow" href="mailto:insight-users@itk.org" target="_blank">insight-users@itk.org</a>&gt;; VTK Mailinglist<br>&gt; &lt;<a rel="nofollow" href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a>&gt;; <a rel="nofollow" href="mailto:nasil122002@gmail.com" target="_blank">nasil122002@gmail.com</a><br>

&gt; Gesendet: Sonntag, den 18. April 2010, 1:12:33 Uhr<br>&gt; Betreff: Re: [Insight-users] Cropping Problem<br>&gt;<br>&gt;<br>&gt; Hi Yusuf,<br>&gt;<br>&gt;<br>&gt; You should start by separating the segmentation<br>&gt; problem from the visualization problem.<br>

&gt;<br>&gt;<br>&gt; Please do the following:<br>&gt;<br>&gt; 0) Just after you call:<br>&gt;<br>&gt;   
 reader-&gt;SetFileNames( fileNames );<br>&gt;    reader-&gt;Update();<br>&gt;<br>&gt;    add<br>&gt;<br>&gt;    reader-&gt;GetOutput()-&gt;Print( std::cout );<br>&gt;<br>&gt;    then<br>&gt;<br>&gt; 1) Run the ITK segmentation pipeline until you<br>

&gt;     get the segmented image, and save it as a<br>&gt;     MetaImage file (with extension .mhd)<br>&gt;<br>&gt;<br>&gt; 2) Post the content of the resulting .mhd file<br>&gt;     back to the list, as well as the print out of<br>

&gt;     the statement:<br>&gt;<br>&gt;    reader-&gt;GetOutput()-&gt;Print( std::cout );<br>&gt;<br>&gt;<br><span>&gt; 3) Use Paraview (<a rel="nofollow" href="http://www.paraview.org" target="_blank">www.paraview.org</a>) to load the</span><br>

&gt;     resulting image and extracting an iso-surface.<br>&gt;     Compare that iso-surface with the one that<br>&gt;     you get by directly from the DICOM image.<br>&gt;     (and let us know what you
 find).<br>&gt;<br>&gt;<br>&gt; With the information from (2) we should be<br>&gt; able to identify if any geometrical information<br>&gt; is missing from the ITK processing pipeline.<br>&gt;<br>&gt;<br>&gt;    Thanks<br>

&gt;<br>&gt;<br>&gt;          Luis<br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt; _____________________________________<br><span>&gt; Powered by <a rel="nofollow" href="http://www.kitware.com" target="_blank">www.kitware.com</a></span><br>

&gt;<br>&gt; Visit other Kitware open-source projects at<br>&gt; <a rel="nofollow" href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>&gt;<br>
&gt; Kitware offers ITK Training Courses, for more information visit:<br>
&gt; <a rel="nofollow" href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</a><br>&gt;<br>&gt; Please keep messages on-topic and check the ITK FAQ at:<br>
&gt; <a rel="nofollow" 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 rel="nofollow" href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>&gt;<br>
&gt;<br></div></div>
</div></div>


</div><br></div></blockquote></div><br>
</div></div></div></div>


</div><br></div></blockquote></div><br>