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

Function ComputeIntensityProfile

Modules/ImageStatistics/src/mitkIntensityProfile.cpp:50–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48}
49
50static IntensityProfile::Pointer ComputeIntensityProfile(Image::Pointer image, itk::PolyLineParametricPath<3>::Pointer path)
51{
52 if (image->GetDimension() == 4)
53 {
54 mitkThrow() << "computation of intensity profiles not supported for 4D images";
55 }
56
57 IntensityProfile::Pointer intensityProfile = IntensityProfile::New();
58 itk::PolyLineParametricPath<3>::InputType input = path->StartOfInput();
59 BaseGeometry* imageGeometry = image->GetGeometry();
60 const PixelType pixelType = image->GetPixelType();
61
62 IntensityProfile::MeasurementVectorType measurementVector;
63 itk::PolyLineParametricPath<3>::OffsetType offset;
64 Point3D worldPoint;
65 itk::Index<3> index;
66
67 do
68 {
69 imageGeometry->IndexToWorld(path->Evaluate(input), worldPoint);
70 imageGeometry->WorldToIndex(worldPoint, index);
71
72 mitkPixelTypeMultiplex3(ReadPixel, pixelType, image, index, measurementVector.GetDataPointer());
73 intensityProfile->PushBack(measurementVector);
74
75 offset = path->IncrementInput(input);
76 } while ((offset[0] | offset[1] | offset[2]) != 0);
77
78 return intensityProfile;
79}
80
81template <class TInputImage>
82static typename itk::InterpolateImageFunction<TInputImage>::Pointer CreateInterpolateImageFunction(InterpolateImageFunction::Enum interpolator)

Callers 2

Calls 8

GetGeometryMethod · 0.80
SetInputImageMethod · 0.80
NewFunction · 0.50
GetDimensionMethod · 0.45
GetPixelTypeMethod · 0.45
IndexToWorldMethod · 0.45
EvaluateMethod · 0.45
WorldToIndexMethod · 0.45

Tested by

no test coverage detected