[Insight-users] MeanCalculator
Karthik Krishnan
Karthik.Krishnan at kitware.com
Mon Aug 14 11:40:22 EDT 2006
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
>
>
More information about the Insight-users
mailing list