[Insight-users] BinaryImageToStatisticsLabelMapFilter

Bradley Lowekamp blowekamp at mail.nih.gov
Tue Mar 4 12:59:23 EST 2014


I don't see why that is surprising.

If you have a mean of  -791 and a sum of -1.67e7, then then number of voxels is -1.67e6/-791= 35316. That seems reasonable to me...

Brad

On Mar 4, 2014, at 12:08 PM, Kent Ogden <ogdenk at upstate.edu> wrote:

> Thanks Brad, that solved my problem.  I didn't understand that you don't need to include the output type in the parameter list.  It is all working now.
>  
> I do have one strange result when I apply this filter to lung regions in a CT scan.  Everything looks fine, I get mean values of -791 and -838 for the two lungs, the min and max look good etc.  The sum is a negative number, though.  I get -2.79352e+007 for one lung and -1.16737e+007 for the other, displayed using
>  
> std::cout << "Object" << i << " has sum " << StatLabelObject->GetSum() << std::endl;
>  
> I also tried
>  
> float sum = StatLabelObject->GetSum();
>  
> and verified that the result was the same, so it's not some conversion issue when sending to cout.
>  
> This isn't an issue, I don't care about the sum but it seems odd given that the other stats look accurate.
>  
> Thanks for your help.
>  
> Kent
>  
> 
> 
> >>> Bradley Lowekamp <blowekamp at mail.nih.gov> 3/4/2014 8:54 AM >>>
> Some times if there is not example look in the tests is a good place to start. Does this test help:
> 
> https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/Filtering/LabelMap/test/itkBinaryImageToStatisticsLabelMapFilterTest1.cxx
> 
> Brad
> 
> On Mar 2, 2014, at 5:45 PM, Kent Ogden <ogdenk at upstate.edu> wrote:
> 
>> Hi ITK experts,
>>  
>> Is there an example of how to use the BinaryImageToStatisticsLabelMapFilter, similar to the example for the BinaryImageToShapeLabelMapFilter?  I'm not sure how to define the type for the output image in the StatisticsLabelMap version, which the ShapeLabelMapFilter doesn't use.
>>  
>> Thanks for any suggestions.
>>  
>> Kent
>>  
>>  
>> _____________________________________
>> 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.php
>> 
>> 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
> 
> _____________________________________
> 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.php
> 
> 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.itk.org/pipermail/insight-users/attachments/20140304/34bb48d9/attachment.html>


More information about the Insight-users mailing list