From: tbaudier Date: Fri, 5 Feb 2016 15:58:27 +0000 (+0100) Subject: Compute the distance from the first point in the Profile Tool and display it in the... X-Git-Tag: v1.4.0~70 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=569cd9585adece1054d93402a34151f4f40517e3;p=clitk.git Compute the distance from the first point in the Profile Tool and display it in the X-axis of the profile chart --- diff --git a/tools/clitkProfileImageGenericFilter.cxx b/tools/clitkProfileImageGenericFilter.cxx index 89edb0b..02394d3 100644 --- a/tools/clitkProfileImageGenericFilter.cxx +++ b/tools/clitkProfileImageGenericFilter.cxx @@ -31,6 +31,7 @@ // itk include #include +#include #include @@ -139,18 +140,29 @@ ProfileImageGenericFilter::UpdateWithInputImageType() itProfile.GoToBegin(); int lineNumber(1); double *tuple; + double distance; tuple = new double[InputImageType::ImageDimension]; + itk::Point transformedFirstPoint; + itk::Point transformedCurrentPoint; + + input->TransformIndexToPhysicalPoint(itProfile.GetIndex(), transformedFirstPoint); while (!itProfile.IsAtEnd()) { - // Fill in the table - mArrayX->InsertNextTuple1(lineNumber); + // Fill in the table the intensity value mArrayY->InsertNextTuple1(itProfile.Get()); for (int i=0; iTransformIndexToPhysicalPoint(itProfile.GetIndex(), transformedCurrentPoint); + distance = transformedFirstPoint.EuclideanDistanceTo(transformedCurrentPoint); + + // Fill in the table the distance value + mArrayX->InsertNextTuple1(distance); + // Fille in the table the voxel coordinate value mCoord->InsertNextTuple(tuple); ++lineNumber; ++itProfile;