[vtkusers] [Insight-users] visualization-problem after segmentation and cropping

Yusuf OEZBEK nasil122002 at yahoo.de
Wed Jun 2 19:03:07 EDT 2010


Hello Luis,



Ok, it worked. What should i do now as the next step?
Here is the screenshot:

http://www.wopsys.com/bilder/watershed_3dslicer.jpg




Thank you.





Von: Luis Ibanez <luis.ibanez at kitware.com>
An: Yusuf OEZBEK <nasil122002 at yahoo.de>
CC: ITK Mailinglist <insight-users at itk.org>; VTK Mailinglist <vtkusers at vtk.org>; nasil122002 at gmail.com
Gesendet: Freitag, den 28. Mai 2010, 16:52:20 Uhr
Betreff: Re: [Insight-users] visualization-problem after segmentation and  cropping
Hi Yusuf,

You can convert the pixel type of the Watershed output
by using the filter:

RelabelComponentImageFilter

http://www.itk.org/Doxygen/html/classitk_1_1RelabelComponentImageFilter.html

See comments below....

---------------------------------------------------------------------------------------
On Fri, May 28, 2010 at 2:43 PM, Yusuf OEZBEK <nasil122002 at yahoo.de> wrote:
Hello Luis,
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.
Am I doing something wrong in code?


typedef itk::WatershedImageFilter<InternalImageType> WatershedFilterType;
WatershedFilterType::Pointer watershedFilter = WatershedFilterType::New();
watershedFilter->SetInput(gradienMagnitudeFilter->GetOutput());
watershedFilter->SetThreshold(this->sliderThresholdWatershed->value());
watershedFilter->SetLevel(this->sliderLevelWatershed->value());
// typedef WatershedFilterType::OutputImageType LabeledImageType;

typedef itk::ImageFileWriter< OutputImageType > WriterType;
WriterType::Pointer writer = WriterType::New();
writer->SetInput( watershedFilter->GetOutput() );
writer->SetFileName("Watershed.mhd");
writer->Write();

------------------------------------------------------------------------

// Add the following
typedef itk::Image< unsigned short, Dimension > ShortImageType;

typedef itk::RelabelComponentImageFilter< 
LabeledImageType, ShortImageType > RelabelFilterType;

RelabelFilterType::Pointer relabelFilter = RelabelFilterType::New();

relabelFilter->SetInput( watershedFilter->GetOutput() );


....

Then use the output of the relabelFilter, instead
of using the output of the watershedFilter.

In this way, the pixel type of the image will become 16 bits,
the labels will be mapped into that numerical range, and
you should then be able to use that image in VTK.


Regards,


Luis




Von: Luis Ibanez <luis.ibanez at kitware.com>
An: Yusuf OEZBEK <nasil122002 at yahoo.de>
CC: ITK Mailinglist <insight-users at itk.org>; VTK Mailinglist <vtkusers at vtk.org>; nasil122002 at gmail.com
Gesendet: Freitag, den 28. Mai 2010, 16:52:20 Uhr
Betreff: Re: [Insight-users] visualization-problem after segmentation and  cropping


Hi Yusuf,


   Manually modifying the pixel type tag in the 
   metaimage header  will not do the trick.

   (in your modified image, the pixel type doesn't
   match the content of the pixel buffer, which 
   explains the distorted appearance of the image).


   My apologies if my instructions were not clear.



   What I suggested you to do, was to change
   the pixel type in your code, and then to run
   the code again.


   Please do so, 
   and let us know what you find.


       Thanks


           Luis   



--------------------------------------------------

On Wed, May 26, 2010 at 9:10 PM, Yusuf OEZBEK <nasil122002 at yahoo.de> wrote:

Hello Luis,
>
>
>
>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.
>
>
>
>
>
>
>Here are the screenshots:
>
>
>Output-Image of watershed on my program (visualized with vtkContourFilter):
>http://www.wopsys.com/bilder/watershed_visualizedwithvtk.png
>
>
>
>
>>Output-Image of watershed on 3DSlicer:
>http://www.wopsys.com/bilder/watershed.JPG
>
>
>
>
>>Output-Image of DicomSeriesReadImageWrite2,
> so before segmentation:
>http://www.wopsys.com/bilder/before_segmentation.png
>
>
>
>
>
>
>Thank you.
>
>
>
________________________________
Von: Luis Ibanez <luis.ibanez at kitware.com>
>An: Yusuf OEZBEK <nasil122002 at yahoo.de>
>CC: ITK Mailinglist <insight-users at itk.org>; VTK Mailinglist <vtkusers at vtk.org>; nasil122002 at gmail.com
>Gesendet: Mittwoch, den 26. Mai 2010, 19:56:18 Uhr
>
>Betreff: Re: [Insight-users] visualization-problem after segmentation and  cropping
>
>
>
>Hi Yusuf,
>
>Excellent.
>
>Thanks for posting the screenshots.
>
>
>They illustrate that the pipeline is working correctly
>up to the output of the region growing filter.
>
>
>You can now focus on getting the Watershed 
>>filter to work correctly by using as output image
>an image of pixel type "unsigned long" and 
>making sure that it doesn't turn into "long long"
>in your 64 bits machine.
>
>Please post the screenshot of the Watershed
>>
>output once you get it to work.
>
>
>    Thanks
>
>
>           Luis
>
>
>-------------------------------------------------------------------
>
>On Tue, May 25, 2010 at 4:14 PM, Yusuf OEZBEK <nasil122002 at yahoo.de> wrote:
>
>Hello Luis,
>>
>>
>>
>>I have the.mhd files loaded with 3DSlicer. Here are the screenshots:
>>
>>
>>Output-Image of Region Growing:
>>http://www.wopsys.com/bilder/regiongrowing_notcropped.JPG
>>http://www.wopsys.com/bilder/regiongrowing_cropped.JPG
>>
>>
>>
>>
>>Output-Image of DicomSeriesReadImageWrite2:
>>http://www.wopsys.com/bilder/DicomSeriesReadImageWrite2.JPG
>>
>>
>>
>>
>>
>>
>>
>>
>>Thanks.
>>
>>
________________________________
 >>Von: Luis Ibanez <luis.ibanez at kitware.com>
>>An: Yusuf OEZBEK <nasil122002 at yahoo.de>
>>CC: ITK Mailinglist <insight-users at itk.org>; VTK Mailinglist <vtkusers at vtk.org>; vtkusers-request at vtk.org; nasil122002 at gmail.com
>>Gesendet: Dienstag, den 25. Mai 2010, 17:00:30 Uhr
>>Betreff: Re: [Insight-users]
>> visualization-problem after segmentation and  cropping
>>
>>
>>Hi Yusuf,
>>
>>
>>When you are debugging a pipeline you should
>>start by verifying that the data has been properly
>>>>loaded in memory, and then you should proceed
>>to check out the output of every intermediate filter
>>in order: from source to final output.
>>
>>
>>Please start by doing the following:
>>
>>
>>    Verify that you succeeded reading the DICOM series.
>>
>>    Simply write the output of the Series reader to
>>    an output file.
>>
>>    This essentially the code that you will see in
>>    the example:
>>
>>
>>    Insight/Examples/IO/
>>        DicomSeriesReadImageWrite2.cxx
>>
>>
>>    Open that file with any visualization software
>>
>>    For example:
>>
>>    1) Paraview. (http://www.paraview.org)  or
>>    2) Slicer, (http://www.slicer.org)  or
>>>>
>>    3) SNAP, (http://sourceforge.net/projects/itk-snap/)  or
>>    4) VV (http://www.creatis.insa-lyon.fr/rio/vv)
>>
>>
>>Please let us know if you manage to do that initial
>>test, (it will be great if you post a screen shot of
>>that output image)
>>
>>and then we will guide you to the next step.
>>
>>
>>
>>    Regards,
>>
>>
>>         Luis
>>
>>
>>--------------------------------------------------
>>On Mon, May 24, 2010 at 10:26 PM, Yusuf OEZBEK <nasil122002 at yahoo.de> wrote:
>>>>
>>> Hello,
>>>
>>>  I have a problem with cut (cropping) and visualization a 3D image, which I
>>> produced by the segmentation-method “watershed and region
>> growing”. In the
>>> beginning I read the DICOM images with itkImageSeriesReader, then I run
>>> watershed or region growing algorithm, in order to connect itk with vtk and
>>> a 3D image produce and for the displaying of segmentation I use
>>>>
>>> vtkContourFilter. After segmentation for cropping the images I use
>>> vtkBoxClipDataSet and vtkDataSetSurfaceFilter, but the result is a black
>>> screen.  When I read the images with vtkDICOMImageReader or
>>>>
>>> itkImageSeriesReader and then segmented with volume rendering, marching
>>> cubes watershed and region growing, then it works completely well. The
>>> problem arises only when cut for watershed and region growing algorithm.
>>>>
>>> What am I doing wrong?
>>>
>>> To understand my problem better, please see my screenshots on the following
>>> link.
>>>
>>>
>>>
>>> http://www.wopsys.com/bilder/segmentation.html
>>>>
>>>
>>>
>>>
>>> To determine whether there missing of any geometrical informations. I had
>>> sent the following outputs of tests.
>>>
>>> http://www.wopsys.com/Outputs/Output_MarchingCubes.txt
>>>>
>>> http://www.wopsys.com/Outputs/Output_VolumeRendering.txt
>>> http://www.wopsys.com/Outputs/Output_Watershed.txt
>>>>
>>> http://www.wopsys.com/Outputs/Output_RegionGrowing.txt
>>>
>>> Thanks.
>>>
>>>
>>> ________________________________
>>>>
>>> Von: Luis Ibanez <luis.ibanez at kitware.com>
>>> An: Yusuf OEZBEK <nasil122002 at yahoo.de>
>>>>
>>> CC: ITK Mailinglist <insight-users at itk.org>; VTK Mailinglist
>>> <vtkusers at vtk.org>; nasil122002 at gmail.com
>>>>
>>> Gesendet: Sonntag, den 18. April 2010, 1:12:33 Uhr
>>> Betreff: Re: [Insight-users] Cropping Problem
>>>
>>>
>>> Hi Yusuf,
>>>
>>>
>>> You should start by separating the segmentation
>>> problem from the visualization problem.
>>>>
>>>
>>>
>>> Please do the following:
>>>
>>> 0) Just after you call:
>>>
>>>   
>> reader->SetFileNames( fileNames );
>>>    reader->Update();
>>>
>>>    add
>>>
>>>    reader->GetOutput()->Print( std::cout );
>>>
>>>    then
>>>
>>> 1) Run the ITK segmentation pipeline until you
>>>>
>>>     get the segmented image, and save it as a
>>>     MetaImage file (with extension .mhd)
>>>
>>>
>>> 2) Post the content of the resulting .mhd file
>>>     back to the list, as well as the print out of
>>>>
>>>     the statement:
>>>
>>>    reader->GetOutput()->Print( std::cout );
>>>
>>>
>>> 3) Use Paraview (www.paraview.org) to load the
>>>>
>>>     resulting image and extracting an iso-surface.
>>>     Compare that iso-surface with the one that
>>>     you get by directly from the DICOM image.
>>>     (and let us know what you
>> find).
>>>
>>>
>>> With the information from (2) we should be
>>> able to identify if any geometrical information
>>> is missing from the ITK processing pipeline.
>>>
>>>
>>>    Thanks
>>>>
>>>
>>>
>>>          Luis
>>>
>>>
>>>
>>>
>>>
>>> _____________________________________
>>> Powered by www.kitware.com
>>>>
>>>
>>> Visit other Kitware open-source projects at
>>> http://www.kitware.com/opensource/opensource.html
>>>
>>>>> Kitware offers ITK Training Courses, for more information visit:
>>>>> http://www.kitware.com/products/protraining.html
>>>
>>> Please keep messages on-topic and check the ITK FAQ at:
>>>>> http://www.itk.org/Wiki/ITK_FAQ
>>>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://www.itk.org/mailman/listinfo/insight-users
>>>
>>>>>
>>
>>
>
>


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100602/26f2d15d/attachment.htm>


More information about the vtkusers mailing list