AW: [Insight-users] MeanCalculator

Karthik Krishnan Karthik.Krishnan at kitware.com
Fri Aug 18 16:12:11 EDT 2006


Another update. Please update Code/Numerics/Statistics/itkListSample.h

That should fix your issue.

Thanks
-karthik

Buerger, Corinna (ext) wrote:

>Hi Karthik, 
>
>Thanks for your quick reply!
>I updated the code and it does throw and exception. Still, I don't understand what is wrong here. As mentioned earlier, when I output the size of my input sample on std::cout, the correct size is displayed. Thanks for your help.
>
>Bye, 
>
>Corinna
> 
>
>-----Ursprüngliche Nachricht-----
>Von: Karthik Krishnan [mailto:Karthik.Krishnan at kitware.com] 
>Gesendet: Montag, 14. August 2006 17:40
>An: Buerger, Corinna (ext)
>Cc: insight-users at itk.org
>Betreff: Re: [Insight-users] MeanCalculator
>
>Hi Corinna,
>
>I've added a safeguard to the itkMeanCalculator.txx, so it throws an 
>exception if the length of the output is 0. Please update  
>Code/Numerics/Statistics/itkMeanCalculator.txx and please let me know if 
>it throws an exception.
>
>If it doesn't, sample code would be appreciated.
>
>Thanks
>-karthik
>
>Buerger, Corinna (ext) wrote:
>
>  
>
>>Hi all,
>> 
>>I want to use the itk::Statistics::MeanCalculator.
>>The following lines are a code snippet of mine.
>> 
>>// start code snippet
>>MeanCalculatorType::Pointer meanCalculator = MeanCalculatorType::New();
>>meanCalculator->SetInputSample( dataSample );
>>meanCalculator->Update();
>>std::cout << "size of data sample: " << dataSample->Size() << 
>>std::endl;                                     // outputs 3 (which is 
>>correct)
>>std::cout << "size of mean: " << 
>>meanCalculator->GetOutput()->GetSize() << std::endl;                // 
>>outputs 0 (why???)
>>// end code snippet
>> 
>>dataSample is earlier defined as:
>>typedef itk::VariableLengthVector< double > DataType;
>>typedef itk::Statistics::ListSample< DataType > DataSampleType;
>>DataSampleType::Pointer dataSample;
>> 
>>Why do I get no output from the MeanCalculator?
>>Any help is appreciated.
>> 
>>Regards,
>> 
>>Corinna
>>
>>------------------------------------------------------------------------
>>
>>_______________________________________________
>>Insight-users mailing list
>>Insight-users at itk.org
>>http://www.itk.org/mailman/listinfo/insight-users
>> 
>>
>>    
>>
>_______________________________________________
>Insight-users mailing list
>Insight-users at itk.org
>http://www.itk.org/mailman/listinfo/insight-users
>
>  
>


More information about the Insight-users mailing list