Hi,<br><br>Try<br><br>medianFilter->GetOutput()->SetRequestedRegion( wantedRegion3 )<br><br>before updating. The request must be done on the output, not in the input. The pipeline calculates which is the required input to generate the output, which in turn will be the output of the previous filter, and so on.<br>
<br>Best regards<br><br>Ivan<br><br><div class="gmail_quote">2010/2/5 steve harris <span dir="ltr"><<a href="mailto:steve.harris18@hotmail.com">steve.harris18@hotmail.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>
Hello again,<br><br>I open again this subject because of what Louis suggested.<div class="im"><br><br>> or even use the SetRequrestedRegion()<br>> of the Median filter directly. <br><br></div>I was also interested in this methods so I quickly tried it but without success..<br>
<br>I didn't manage to find how to set the SetRequrestedRegion of the median filter directly ? <br>That's what I tried:<br><br> start3[0] = 0;<br> start3[1] = 0;<br> start3[2] = 0;<br><br> size3[0] = 20;<br>
size3[1] = 20;<br> size3[2] = 20;<br> wantedRegion3.SetIndex(start3);<br> wantedRegion3.SetSize(size3);<br><br>mySimpleImage->SetRequestedRegion(wantedRegion3)<br>neighRadius2[0] = 1;<br>neighRadius2[1] = 1;<br>
neighRadius2[2] = 1;<br>median->SetRadius(neighRadius2);<br>median->SetInput(mySimpleImage);<br>median->Update();<br><br>But when I display median->GetOutput() all the image has been filtred and not only my requested region...<br>
<br>Do I'm missing something ?<br><br>Regards,<br>Steve<br><br><hr>From: <a href="mailto:steve.harris18@hotmail.com" target="_blank">steve.harris18@hotmail.com</a><br>To: <a href="mailto:imacia@vicomtech.org" target="_blank">imacia@vicomtech.org</a>; <a href="mailto:luis.ibanez@kitware.com" target="_blank">luis.ibanez@kitware.com</a><br>
Date: Tue, 26 Jan 2010 10:48:22 +0000<div class="im"><br>CC: <a href="mailto:insight-users@itk.org" target="_blank">insight-users@itk.org</a><br></div>Subject: Re: [Insight-users] Apply filter only on a specific region ?<div>
<div></div><div class="h5"><br><br>
Hello,<br><br>Just a word to say that using this pipeline<br><br>RegionOfInterestImageFilter<br>MedianImageFilter<br>PasteImageFilter<br><br>it works, I mean I quickly tried and I got a good visual result (only the part I chossed has been filtred) <br>
<br>Thanks,<br>Steve<br><br>> From: <a href="mailto:imacia@vicomtech.org" target="_blank">imacia@vicomtech.org</a><br>> To: <a href="mailto:luis.ibanez@kitware.com" target="_blank">luis.ibanez@kitware.com</a>; <a href="mailto:steve.harris18@hotmail.com" target="_blank">steve.harris18@hotmail.com</a><br>
> CC: <a href="mailto:insight-users@itk.org" target="_blank">insight-users@itk.org</a><br>> Subject: RE: [Insight-users] Apply filter only on a specific region ?<br>> Date: Mon, 25 Jan 2010 18:15:20 +0100<br>> <br>
> Hi Luis,<br>> <br>> Just a question. We were discussing here at work the meaning of the<br>> different regions (Largest vs Requested vs Buffered). One question we had is<br>> if you can process a part of the image only by setting the Requested Region<br>
> on the output, which seems quite straightforward and compatible with the ITK<br>> pipeline definition. What would you get here? An image whose Largest<br>> Possible Region is the same as the one you requested?<br>
> <br>> The idea I have is that the Requested Region is an important part of the ITK<br>> pipeline and is used by the filters, at least internally, so why is its use<br>> discouraged in this case?<br>> <br>
> Thanks in advance<br>> <br>> Iván<br>> <br>> PD: it is common the case in which we have to process only a certain part of<br>> the image in medical applications, for example when we have to calculate<br>
> statistics in a region of interest from a 3D image, as defined by the<br>> radiologist. It may be inconsistent from the point of view image processing<br>> but it works :) This is just an example but we have find many cases in which<br>
> we have had to restrict ourselves only to a certain part of the image as<br>> defined by the user, due to memory limitations or for a faster processing<br>> among other reasons.<br>> <br>> <br>> -----Mensaje original-----<br>
> De: <a href="mailto:insight-users-bounces@itk.org" target="_blank">insight-users-bounces@itk.org</a> [mailto:<a href="mailto:insight-users-bounces@itk.org" target="_blank">insight-users-bounces@itk.org</a>] En<br>> nombre de Luis Ibanez<br>
> Enviado el: domingo, 24 de enero de 2010 16:11<br>> Para: dsdfdff sfdsf<br>> CC: <a href="mailto:insight-users@itk.org" target="_blank">insight-users@itk.org</a><br>> Asunto: Re: [Insight-users] Apply filter only on a specific region ?<br>
> <br>> Hi Steve,<br>> <br>> It depends....<br>> <br>> What exactly do you want at the output ?<br>> <br>> A) The full input input with the subregion modified ?<br>> <br>> or<br>> <br>> B) only the modified subregion ?<br>
> <br>> ---<br>> <br>> If you want (A) you will have to use a pipeline<br>> such as:<br>> <br>> RegionOfInterestImageFilter<br>> MedianImageFilter<br>> PasteImageFilter<br>> <br>> If you want (B) you could use simply<br>
> <br>> <br>> RegionOfInterestImageFilter<br>> MedianImageFilter<br>> <br>> or even use the SetRequrestedRegion()<br>> of the Median filter directly. Although<br>> this last option is not a recommended<br>
> practice, unless you are very familiar<br>> with the inner-workings of the ITK pipeline.<br>> <br>> <br>> --<br>> <br>> On a side note:<br>> <br>> Why do you want to do such thing ? :-)<br>
> <br>> From the pure image processing point of view,<br>> it doesn't seem to be a good operation. You<br>> will end up with an inconsistent image...<br>> <br>> <br>> <br>> Regards,<br>> <br>
> <br>> Luis<br>> <br>> <br>> --------------------------------------<br>> On Fri, Jan 22, 2010 at 5:51 AM, dsdfdff sfdsf<br>> <<a href="mailto:steve.harris18@hotmail.com" target="_blank">steve.harris18@hotmail.com</a>> wrote:<br>
> > Hello itk user,<br>> ><br>> > I was wondering if it was possible to apply a filter only on a specific<br>> > region of an image (like setting a bundary region)?<br>> ><br>> > for example if I have a simple 3D image (let say 30x30x30) is it possible<br>
> > for example to apply the mean filter<br>> > only on the region (15x15x15)?<br>> ><br>> > regards,<br>> > Steve<br>> ><br>> > ________________________________<br>> > Faites une bonne action avec Bing Solidaire ! C'est ici !<br>
> > _____________________________________<br>> > Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>> ><br>> > Visit other Kitware open-source projects at<br>> > <a 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 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 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 href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>> ><br>> ><br>> _____________________________________<br>> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
> <br>> Visit other Kitware open-source projects at<br>> <a 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 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 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 href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>> <br>                                            <br>
<hr>Windows 7 : Trouvez le PC qui vous convient! <a href="http://clk.atdmt.com/FRM/go/181574577/direct/01/" target="_blank">Découvrez notre offre ! </a>                                            <br></div></div><div class="hm"><hr>Votre messagerie et bien plus où que vous soyez. Passez à Windows Live Hotmail, c'est gratuit ! <a href="https://signup.live.com/signup.aspx?id=60969" target="_blank">Inscrivez-vous</a></div>
</div>
</blockquote></div><br>