<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt">Thanks Matt for your awnser but I finally solved it.<br>However I have another question.<br><br>I'm actually doing some segmentation so I started apllying a median filter and a threshold on my image made of 'unsigned short'.<br>The probleme now is that when I want to apply th morphological filters nothing happens unless If I use an 'unsigned char' image data from the begining wich mess up all the threshold filter.<br><br>Is there any way to convert an unsigned short image data to an unsigned char?<br><br>Thank you guys<br><div><span><br></span></div><div style="display: block;" class="yahoo_quoted"> <br> <br> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 12pt;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica,
Arial, Lucida Grande, sans-serif; font-size: 12pt;"> <div dir="ltr"> <font face="Arial" size="2"> Le Mercredi 26 février 2014 1h17, Matt McCormick <matt.mccormick@kitware.com> a écrit :<br> </font> </div> <div class="y_msg_container">Hi Anna,<br clear="none"><br clear="none">What is the complete code?<br clear="none"><br clear="none">Thanks,<br clear="none">Matt<br clear="none"><div class="yqt2845317828" id="yqtfd09958"><br clear="none">On Tue, Feb 25, 2014 at 4:55 AM, Annabelle Dupuis<br clear="none"><<a shape="rect" ymailto="mailto:dupuis.annabelle@yahoo.fr" href="mailto:dupuis.annabelle@yahoo.fr">dupuis.annabelle@yahoo.fr</a>> wrote:<br clear="none">> Hi guys, I'm a newbie in ITK and I would like to make some changes on an<br clear="none">> image<br clear="none">> that I read from a file and then check it on Quickview.<br clear="none">> So I use<br clear="none">> itk::Image<signed short, 2 >
ImageType;<br clear="none">> itk::ImageFileReader<ImageType> ReaderType;<br clear="none">> ReaderType::Pointer reader = ReaderType::New();<br clear="none">> reader->SetFileName( inputFilename );<br clear="none">><br clear="none">> THe probleme is that when I use<br clear="none">><br clear="none">> ImageType::RegionType region;<br clear="none">> ImageType::IndexType start;<br clear="none">> start[0] = 0;<br clear="none">> start[1] = 0;<br clear="none">><br clear="none">> ImageType::SizeType size;<br clear="none">> size[0] = 200;<br clear="none">> size[1] = 300;<br clear="none">><br clear="none">> region.SetSize(size);<br clear="none">> region.SetIndex(start);<br clear="none">><br clear="none">> ImageType::Pointer reader =
ImageType::New();<br clear="none">> reader->SetRegions(region);<br clear="none">> reader->Allocate();<br clear="none">><br clear="none">> for(unsigned int r = 20; r < 80; r++)<br clear="none">> {<br clear="none">> for(unsigned int c = 30; c < 100; c++)<br clear="none">> {<br clear="none">> ImageType::IndexType pixelIndex;<br clear="none">> pixelIndex[0] = r;<br clear="none">> pixelIndex[1] = c;<br clear="none">><br clear="none">> reader->SetPixel(pixelIndex, 255);<br clear="none">> }<br clear="none">> }<br clear="none">><br clear="none">> well nothing happen to the loaded image.<br clear="none">> I'm sure I'm missing something basic but I just started coding
with this<br clear="none">> tool.<br clear="none">> Thanks for your help.<br clear="none">><br clear="none">> Anna<br clear="none">><br clear="none">> _______________________________________________<br clear="none">> Community mailing list<br clear="none">> <a shape="rect" ymailto="mailto:Community@itk.org" href="mailto:Community@itk.org">Community@itk.org</a><br clear="none">> <a shape="rect" href="http://public.kitware.com/cgi-bin/mailman/listinfo/community" target="_blank">http://public.kitware.com/cgi-bin/mailman/listinfo/community</a><br clear="none">><br clear="none"></div><br><br></div> </div> </div> </div> </div></body></html>