<DIV>Hello Luis,<BR></DIV>
<DIV>The problem is solved. The problem was due to the way I was reading <BR>the input image. Now instead of directly using watershedsegmentation1.cxx, I have written another program which reads raw images with MetaImage format, I read them as float and then pass the output of reader to smoothing filter, then to Gradient Magnitude filter, then to Watershed, and then write the result of watershed as RGB image using </DIV>
<DIV>ScalarToRGBPixelFunctor and UnaryFunctorImageFilter.</DIV>
<DIV> </DIV>
<DIV>Thanks for all your help,<BR>Neha<BR><BR><B><I>Luis Ibanez <luis.ibanez@kitware.com></I></B> wrote:</DIV>
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid"><BR>Hi Neha,<BR><BR><BR>Thanks for posting your images and the description of your problem.<BR><BR>We tried passing your image as input to the Watershed example, but it<BR>happens that your tumor58.raw image has a *constant zero value* in all<BR>pixels.<BR><BR><BR>Please verify the source where you obtained this image.<BR><BR><BR>---<BR><BR>Regarding the error message that you got,<BR>it is clearly indicating that your threshold value is *too high*:<BR><BR>><BR>> itk::watershed::SegmentTreeGenerator::MergeSegments::<BR>> An unexpected and fatal error has occurred. This is probably the<BR>> result of overthresholding of the input image.<BR>><BR><BR>You are setting a threshold value that is HIGHER than that water level,<BR>this is incorrect. The threshold value should be lower than the water<BR>level.<BR><BR>Please try values like<BR><BR><BR>Threshold = 0.01<BR>Water
level = 0.05 to 0.2<BR><BR><BR>Please read the description of this example in the<BR>ITK Software Guide<BR><BR>http://www.itk.org/ItkSoftwareGuide.pdf<BR><BR>Section 9.2, pdf-page 356.<BR><BR><BR><BR>Regards,<BR><BR><BR>Luis<BR><BR><BR>=================<BR><BR>neha k wrote:<BR><BR>> Hello Luis,<BR>> <BR>> Can I use watershed example (from ITK1.8\Examples) with Brain MRIs (Raw <BR>> format)? When I try to use Watershed example on Brain MRI with tumour, <BR>> with following parameters range- <BR>> <BR>> Conductance Term -> 1-4, No. of Iterations - 3 - 10, Threshold (%) - 0.0 <BR>> - 0.3, Level Of Watershed 0.01 - 0.05,<BR>> Principle Componenet Analysys - On. I am not sure if I need to use <BR>> Principle Componenet Analysys.<BR>> <BR>> I get following error: ------><BR>> <BR>> itk::ExceptionObject (0104F288)<BR>> Location: "Unknown"<BR>> File: <BR>>
C:\ITK_1.8\InsightToolkit-1.8.0\Code\Algorithms\itkWatershedSegmentTreeGen<BR>> erator.txx<BR>> Line: 436<BR>> Description: itk::ERROR: <BR>> itk::watershed::SegmentTreeGenerator::MergeSegments:: A<BR>> n unexpected and fatal error has occurred. This is probably the result <BR>> of overth<BR>> resholding of the input image.<BR>> <BR>> Do you have any suggestions? I have attached the image. <BR>> <BR>> Thanks.<BR>> <BR><BR><BR><BR><BR></BLOCKQUOTE><p>
        
                <hr size=1>Do you Yahoo!?<br>
Check out the new Yahoo! Front Page. <a href="http://www.yahoo.com">www.yahoo.com</a>