<div>You can directly feed your input image to the </div><div>BinaryStatisticsOpeningImageFilter. Just set </div><div>your BackgroundValue respectively and you </div><div>are done. </div><div><br></div><div>I have created an example on the wiki on how to use </div>
<div>this filter. </div><a href="http://www.itk.org/Wiki/ITK/Examples/ImageProcessing/StatisticsOpeningLabelMapFilter" target="_blank">http://www.itk.org/Wiki/ITK/Examples/ImageProcessing/StatisticsOpeningLabelMapFilter</a><br>
<br>Cagatay<div><br><div>
-- <br><span style="font-size:13px;color:rgb(136,136,136);font-family:arial,sans-serif">Cemal Cagatay Bilgin</span><br style="font-size:13px;color:rgb(136,136,136);font-family:arial,sans-serif"><span style="font-size:13px;color:rgb(136,136,136);font-family:arial,sans-serif">Life Sciences Division</span><br style="font-size:13px;color:rgb(136,136,136);font-family:arial,sans-serif">
<span style="font-size:13px;color:rgb(136,136,136);font-family:arial,sans-serif">Lawrence Berkeley National Lab</span><br style="font-size:13px;color:rgb(136,136,136);font-family:arial,sans-serif"><span style="font-size:13px;color:rgb(136,136,136);font-family:arial,sans-serif">MS977, One Cyclotron Road</span><br style="font-size:13px;color:rgb(136,136,136);font-family:arial,sans-serif">
<span style="font-size:13px;color:rgb(136,136,136);font-family:arial,sans-serif">Berkeley, CA 94720, USA</span><br style="font-size:13px;color:rgb(136,136,136);font-family:arial,sans-serif"><span style="font-size:13px;color:rgb(136,136,136);font-family:arial,sans-serif">Email: ccbilgin</span><a href="mailto:hchang@lbl.gov" target="_blank" style="font-size:13px;color:rgb(17,85,204);font-family:arial,sans-serif">@lbl.gov</a></div>
<div><br><div class="gmail_quote">On Tue, Aug 21, 2012 at 6:29 PM, kumis <span dir="ltr"><<a href="mailto:kkumis@gmail.com" target="_blank">kkumis@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Thanks for Your replies.<br>
<br>
I have finally managed to put data into the StatisticsOpeningLabelMapFilter<br>
using following filters:<br>
<br>
typedef<br>
itk::LabelImageToStatisticsLabelMapFilter<LabelMapToLabelImageFilterType::OutputImageType,<br>
SSImageType> LabelImageToStatisticsLabelMapFilterType;<br>
LabelImageToStatisticsLabelMapFilterType::Pointer li2sli =<br>
LabelImageToStatisticsLabelMapFilterType::New();<br>
li2sli->SetInput(labelMapToLabelImageFilter->GetOutput());<br>
li2sli->SetFeatureImage(inputImage);<br>
li2sli->Update();<br>
<br>
typedef<br>
itk::StatisticsOpeningLabelMapFilter<LabelImageToStatisticsLabelMapFilterType::OutputImageType><br>
<div>StatisticsOpeningLabelMapFilterType;<br>
StatisticsOpeningLabelMapFilterType::Pointer statisticsOpening =<br>
StatisticsOpeningLabelMapFilterType::New();<br>
</div>statisticsOpening->SetAttribute(StatisticsOpeningLabelMapFilterType::LabelObjectType::MEAN);<br>
statisticsOpening->SetInput(li2sli->GetOutput());<br>
statisticsOpening->SetLambda(-500);<br>
statisticsOpening->Update();<br>
<br>
and it compiles without any errors. As I understand<br>
LabelImageToStatisticsLabelMapFilter has 2 inputs:<br>
-feature image (setfeatureimage())- my signed short 2-d image (SSImageType),<br>
I store my initial dicom image here<br>
-input (setinput()) is a label image I got from previous operations (in my<br>
case: binarisation of initial dicom, a bit of morphological filtering,<br>
labeling objects on binary image and finally converting labelMap to<br>
labelImage )<br>
<br>
StatisticsOpeningLabelMapFilter has typical arguments for "opening" (not<br>
morphological operation but removing labeled objects based on values of<br>
chosen attributes) and the input in my case (I am not sure if I do this<br>
correct) is a statistics label map.<br>
<br>
I must admit that this statistics opening filters are a mystery to me -<br>
though I have ussed simillar (?) shape opening filters with success before.<br>
Am I setting all inputs correctly? What is the output of<br>
StatisticsOpeningLabelMapFilter ? Is it statistics label map that needs<br>
convertion to label image? I found myself without idea how this filter<br>
works.<br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://itk-insight-users.2283740.n2.nabble.com/Question-about-StatisticsOpeningLabelMapFilter-tp7580805p7580814.html" target="_blank">http://itk-insight-users.2283740.n2.nabble.com/Question-about-StatisticsOpeningLabelMapFilter-tp7580805p7580814.html</a><br>
<div><div>Sent from the ITK Insight Users mailing list archive at Nabble.com.<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.php" target="_blank">http://www.kitware.com/products/protraining.php</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>
</div></div></blockquote></div><br><br>
</div>
</div>