<br>Hi Yusuf,<br><br>It is great to see that you got it to work.<br><br>Now, typically, you should fine tune the "level" <br>parameter in the watershed until you obtain the<br>largest pieces of the anatomy that you are looking <br>
for.<br><br>At that point, you probably should use the<br>vtkContour filter in order to extract the iso-surface<br>surrounding that label of the output image.<br><br>Your previous use of volume rendering is probably<br>not a good approach for visualizing label images.<br>
<br><br><br> Regards,<br><br><br> Luis<br><br><br>-------------------------------------------------------------<br><div class="gmail_quote">On Mon, Jun 14, 2010 at 8:36 AM, Yusuf OEZBEK <span dir="ltr"><<a href="mailto:nasil122002@yahoo.de">nasil122002@yahoo.de</a>></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 style=""><div>Hello Luis,<b><span style="font-weight: bold;"><font size="2"><font face="Courier New, courier, monaco, monospace, sans-serif"><br>
</font></font></span></b><div><div class="im"><div><div><br></div><div>Ok, it worked. What should i do now as the next step?</div><br>Here is the screenshot:<font face="Tahoma" size="2"><b><span style="font-weight: bold;"><br>
</span></b></font></div></div><div><span><a rel="nofollow" href="http://www.wopsys.com/bilder/watershed_3dslicer.jpg" target="_blank">http://www.wopsys.com/bilder/watershed_3dslicer.jpg</a></span></div><div><br></div><div>
<br></div><div><br></div><div><br></div><div>Thank you.</div><div><font face="Tahoma" size="2"><b><span style="font-weight: bold;"><br></span></b></font></div><div><font face="Tahoma" size="2"><b><span style="font-weight: bold;"><br>
</span></b></font></div><div><font face="Tahoma" size="2"><b><span style="font-weight: bold;"><br></span></b></font></div><div><font face="Tahoma" size="2"><b><span style="font-weight: bold;"><br></span></b></font></div><div>
<font face="Tahoma" size="2"><b><span style="font-weight: bold;"><br></span></b></font></div><div><font face="Tahoma" size="2"><div class="im"><b><span style="font-weight: bold;">Von:</span></b> Luis Ibanez <<a href="mailto:luis.ibanez@kitware.com" target="_blank">luis.ibanez@kitware.com</a>><br>
<b><span style="font-weight: bold;">An:</span></b> Yusuf OEZBEK <<a href="mailto:nasil122002@yahoo.de" target="_blank">nasil122002@yahoo.de</a>><br><b><span style="font-weight: bold;">CC:</span></b> ITK Mailinglist <<a href="mailto:insight-users@itk.org" target="_blank">insight-users@itk.org</a>>; VTK Mailinglist <<a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a>>; <a href="mailto:nasil122002@gmail.com" target="_blank">nasil122002@gmail.com</a><br>
</div><b><span style="font-weight: bold;">Gesendet:</span></b> Freitag, den 28. Mai 2010, 16:52:20 Uhr<div class="im"><br><b><span style="font-weight: bold;">Betreff:</span></b> Re: [Insight-users]
visualization-problem after segmentation and cropping</div></font><br>Hi Yusuf,<br><div class="im"><br>You can convert the pixel type of the Watershed output<br>by using the filter:<br><br> RelabelComponentImageFilter<br>
<br><span><a rel="nofollow" href="http://www.itk.org/Doxygen/html/classitk_1_1RelabelComponentImageFilter.html" target="_blank">http://www.itk.org/Doxygen/html/classitk_1_1RelabelComponentImageFilter.html</a></span><br><br>
See comments below....<br><br>---------------------------------------------------------------------------------------<br></div><div class="im">On Fri, May 28, 2010 at 2:43 PM, Yusuf OEZBEK <<a href="mailto:nasil122002@yahoo.de" target="_blank">nasil122002@yahoo.de</a>> wrote:<br>
Hello Luis,<br></div><div><div></div><div class="h5">I'm sorry, I have understood you wrong. Change of pixel-type in code does not work. I always get MET_ULONG_LONG. Also, Yes, I work with 64-bit machine.<br>Am I doing something wrong in code?<br>
<br> <br> typedef itk::WatershedImageFilter<InternalImageType> WatershedFilterType;<br>
WatershedFilterType::Pointer
watershedFilter = WatershedFilterType::New();<br> watershedFilter->SetInput(gradienMagnitudeFilter->GetOutput());<br> watershedFilter->SetThreshold(this->sliderThresholdWatershed->value());<br> watershedFilter->SetLevel(this->sliderLevelWatershed->value());<br>
// typedef WatershedFilterType::OutputImageType LabeledImageType;<br> <br> typedef itk::ImageFileWriter< OutputImageType > WriterType;<br> WriterType::Pointer writer = WriterType::New();<br> writer->SetInput( watershedFilter->GetOutput() );<br>
writer->SetFileName("Watershed.mhd");<br> writer->Write();<br><br>------------------------------------------------------------------------<br><br>// Add the following<br>typedef itk::Image< unsigned short, Dimension > ShortImageType;<br>
<br>typedef itk::RelabelComponentImageFilter< <br> LabeledImageType, ShortImageType > RelabelFilterType;<br><br>RelabelFilterType::Pointer relabelFilter =
RelabelFilterType::New();<br><br>relabelFilter->SetInput( watershedFilter->GetOutput() );<br><br><br>....<br><br>Then use the output of the relabelFilter, instead<br>of using the output of the watershedFilter.<br>
<br>In this way, the pixel type of the image will become 16 bits,<br>the labels will be mapped into that numerical range, and<br>you should then be able to use that image in VTK.<br><br><br> Regards,<br><br><br> Luis<br>
</div></div></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"><b><span style="font-weight: bold;"><br>
</span></b></font></div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><font face="Tahoma" size="2"><div class="im"><b><span style="font-weight: bold;">Von:</span></b> Luis Ibanez <<a href="mailto:luis.ibanez@kitware.com" target="_blank">luis.ibanez@kitware.com</a>><br>
<b><span style="font-weight: bold;">An:</span></b> Yusuf OEZBEK <<a href="mailto:nasil122002@yahoo.de" target="_blank">nasil122002@yahoo.de</a>><br><b><span style="font-weight: bold;">CC:</span></b> ITK Mailinglist <<a href="mailto:insight-users@itk.org" target="_blank">insight-users@itk.org</a>>; VTK Mailinglist <<a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a>>; <a href="mailto:nasil122002@gmail.com" target="_blank">nasil122002@gmail.com</a><br>
</div><b><span style="font-weight: bold;">Gesendet:</span></b> Freitag, den 28. Mai 2010, 16:52:20 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><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'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"><<a rel="nofollow" href="mailto:nasil122002@yahoo.de" target="_blank">nasil122002@yahoo.de</a>></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 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 rel="nofollow" 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 rel="nofollow" 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 rel="nofollow" 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><hr size="1"><b><span style="font-weight: bold;">Von:</span></b> Luis Ibanez <<a rel="nofollow" href="mailto:luis.ibanez@kitware.com" target="_blank">luis.ibanez@kitware.com</a>><br>
<b><span style="font-weight: bold;">An:</span></b> Yusuf OEZBEK <<a rel="nofollow" href="mailto:nasil122002@yahoo.de" target="_blank">nasil122002@yahoo.de</a>><br>
<b><span style="font-weight: bold;">CC:</span></b> ITK Mailinglist <<a rel="nofollow" href="mailto:insight-users@itk.org" target="_blank">insight-users@itk.org</a>>; VTK Mailinglist <<a rel="nofollow" href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a>>; <a rel="nofollow" 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><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><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 "unsigned long" and <br>making sure that it doesn't turn into "long long"<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"><<a rel="nofollow" href="mailto:nasil122002@yahoo.de" target="_blank">nasil122002@yahoo.de</a>></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 <<a rel="nofollow" href="mailto:luis.ibanez@kitware.com" target="_blank">luis.ibanez@kitware.com</a>><br><b><span style="font-weight: bold;">An:</span></b> Yusuf OEZBEK <<a rel="nofollow" href="mailto:nasil122002@yahoo.de" target="_blank">nasil122002@yahoo.de</a>><br>
</div><b><span style="font-weight: bold;">CC:</span></b> ITK Mailinglist <<a rel="nofollow" href="mailto:insight-users@itk.org" target="_blank">insight-users@itk.org</a>>; VTK Mailinglist <<a rel="nofollow" href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a>>; <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 <<a rel="nofollow" href="mailto:nasil122002@yahoo.de" target="_blank">nasil122002@yahoo.de</a>> wrote:<br>
> Hello,<br>><br>> I have a problem with cut (cropping) and visualization a 3D image, which I<br>> produced by the segmentation-method “watershed and region
growing”. In the<br>> beginning I read the DICOM images with itkImageSeriesReader, then I run<br>> watershed or region growing algorithm, in order to connect itk with vtk and<br>> a 3D image produce and for the displaying of segmentation I use<br>
> vtkContourFilter. After segmentation for cropping the images I use<br>> vtkBoxClipDataSet and vtkDataSetSurfaceFilter, but the result is a black<br>> screen. When I read the images with vtkDICOMImageReader or<br>
> itkImageSeriesReader and then segmented with volume rendering, marching<br>> cubes watershed and region growing, then it works completely well. The<br>> problem arises only when cut for watershed and region growing algorithm.<br>
> What am I doing wrong?<br>><br>> To understand my problem better, please see my screenshots on the following<br>> link.<br>><br>><br>><br>> <a rel="nofollow" href="http://www.wopsys.com/bilder/segmentation.html" target="_blank">http://www.wopsys.com/bilder/segmentation.html</a><br>
><br>><br>><br>> To determine whether there missing of any geometrical informations. I had<br>> sent the following outputs of tests.<br>><br>> <a rel="nofollow" href="http://www.wopsys.com/Outputs/Output_MarchingCubes.txt" target="_blank">http://www.wopsys.com/Outputs/Output_MarchingCubes.txt</a><br>
> <a rel="nofollow" href="http://www.wopsys.com/Outputs/Output_VolumeRendering.txt" target="_blank">http://www.wopsys.com/Outputs/Output_VolumeRendering.txt</a><br>> <a rel="nofollow" href="http://www.wopsys.com/Outputs/Output_Watershed.txt" target="_blank">http://www.wopsys.com/Outputs/Output_Watershed.txt</a><br>
> <a rel="nofollow" href="http://www.wopsys.com/Outputs/Output_RegionGrowing.txt" target="_blank">http://www.wopsys.com/Outputs/Output_RegionGrowing.txt</a><br>><br>> Thanks.<br>><br>><br>> ________________________________<br>
> Von: Luis Ibanez <<a rel="nofollow" href="mailto:luis.ibanez@kitware.com" target="_blank">luis.ibanez@kitware.com</a>><br>> An: Yusuf OEZBEK <<a rel="nofollow" href="mailto:nasil122002@yahoo.de" target="_blank">nasil122002@yahoo.de</a>><br>
> CC: ITK Mailinglist <<a rel="nofollow" href="mailto:insight-users@itk.org" target="_blank">insight-users@itk.org</a>>; VTK Mailinglist<br>> <<a rel="nofollow" href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a>>; <a rel="nofollow" href="mailto:nasil122002@gmail.com" target="_blank">nasil122002@gmail.com</a><br>
> Gesendet: Sonntag, den 18. April 2010, 1:12:33 Uhr<br>> Betreff: Re: [Insight-users] Cropping Problem<br>><br>><br>> Hi Yusuf,<br>><br>><br>> You should start by separating the segmentation<br>> problem from the visualization problem.<br>
><br>><br>> Please do the following:<br>><br>> 0) Just after you call:<br>><br>>
reader->SetFileNames( fileNames );<br>> reader->Update();<br>><br>> add<br>><br>> reader->GetOutput()->Print( std::cout );<br>><br>> then<br>><br>> 1) Run the ITK segmentation pipeline until you<br>
> get the segmented image, and save it as a<br>> MetaImage file (with extension .mhd)<br>><br>><br>> 2) Post the content of the resulting .mhd file<br>> back to the list, as well as the print out of<br>
> the statement:<br>><br>> reader->GetOutput()->Print( std::cout );<br>><br>><br><span>> 3) Use Paraview (<a rel="nofollow" href="http://www.paraview.org" target="_blank">www.paraview.org</a>) to load the</span><br>
> resulting image and extracting an iso-surface.<br>> Compare that iso-surface with the one that<br>> you get by directly from the DICOM image.<br>> (and let us know what you
find).<br>><br>><br>> With the information from (2) we should be<br>> able to identify if any geometrical information<br>> is missing from the ITK processing pipeline.<br>><br>><br>> Thanks<br>
><br>><br>> Luis<br>><br>><br>><br>><br>><br>> _____________________________________<br><span>> Powered by <a rel="nofollow" href="http://www.kitware.com" target="_blank">www.kitware.com</a></span><br>
><br>> Visit other Kitware open-source projects at<br>> <a rel="nofollow" href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>><br>
> Kitware offers ITK Training Courses, for more information visit:<br>
> <a rel="nofollow" href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</a><br>><br>> Please keep messages on-topic and check the ITK FAQ at:<br>
> <a rel="nofollow" href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
><br>> Follow this link to subscribe/unsubscribe:<br>> <a rel="nofollow" href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>><br>
><br></div></div>
</div></div>
</div><br></div></blockquote></div><br>
</div></div></div></div>
</div><br></div></blockquote></div><br>
</div></div></div></div>
</div><br></div>
</div><br></div></blockquote></div><br>