MCPcopy Create free account
hub / github.com/MITK/MITK / itkProbabilityMap

Method itkProbabilityMap

Modules/Classification/CLUtilities/src/mitkCLUtil.cpp:164–188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

162
163template<typename TImageType>
164void mitk::CLUtil::itkProbabilityMap(const TImageType * sourceImage, double mean, double std_dev, mitk::Image::Pointer& resultImage)
165{
166 itk::Image<double, 3>::Pointer itk_img = itk::Image<double, 3>::New();
167 itk_img->SetRegions(sourceImage->GetLargestPossibleRegion());
168 itk_img->SetOrigin(sourceImage->GetOrigin());
169 itk_img->SetSpacing(sourceImage->GetSpacing());
170 itk_img->SetDirection(sourceImage->GetDirection());
171 itk_img->Allocate();
172
173
174 itk::ImageRegionConstIterator<TImageType> it(sourceImage,sourceImage->GetLargestPossibleRegion());
175 itk::ImageRegionIterator<itk::Image<double, 3> > outit(itk_img,itk_img->GetLargestPossibleRegion());
176
177 while(!it.IsAtEnd())
178 {
179 double x = it.Value();
180
181 double prob = (1.0/(std_dev*std::sqrt(2.0*itk::Math::pi))) * std::exp(-(((x-mean)*(x-mean))/(2.0*std_dev*std_dev)));
182 outit.Set(prob);
183 ++it;
184 ++outit;
185 }
186
187 mitk::CastToMitkImage(itk_img, resultImage);
188}
189
190template< typename TImageType >
191void mitk::CLUtil::itkInterpolateCheckerboardPrediction(TImageType * checkerboard_prediction, Image::Pointer &checkerboard_mask, mitk::Image::Pointer & outimage)

Callers

nothing calls this directly

Calls 9

CastToMitkImageFunction · 0.85
SetDirectionMethod · 0.80
ValueMethod · 0.80
NewFunction · 0.50
SetOriginMethod · 0.45
GetOriginMethod · 0.45
SetSpacingMethod · 0.45
GetSpacingMethod · 0.45
SetMethod · 0.45

Tested by

no test coverage detected