From ef75986eb20173c84bc919ec4cb5a95aa5f51a00 Mon Sep 17 00:00:00 2001 From: tbaudier Date: Mon, 8 Feb 2016 16:28:44 +0100 Subject: [PATCH] Change voxel position into double --- tools/clitkProfileImage.ggo | 4 ++-- vv/vvToolProfile.cxx | 12 ++++++------ vv/vvToolProfile.h | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tools/clitkProfileImage.ggo b/tools/clitkProfileImage.ggo index 7714e18..773790d 100644 --- a/tools/clitkProfileImage.ggo +++ b/tools/clitkProfileImage.ggo @@ -9,8 +9,8 @@ option "imagetypes" - "Display allowed image types" flag off option "input" i "Input image filename" string yes option "output" o "Output texte filename" string yes -option "point1" f "First point (mm)" int yes multiple(-4) -option "point2" s "Second point (mm)" int yes multiple(-4) +option "point1" f "First point (mm)" double yes multiple(-4) +option "point2" s "Second point (mm)" double yes multiple(-4) diff --git a/vv/vvToolProfile.cxx b/vv/vvToolProfile.cxx index e269fff..eab2fa3 100644 --- a/vv/vvToolProfile.cxx +++ b/vv/vvToolProfile.cxx @@ -153,13 +153,13 @@ void vvToolProfile::selectPoint1() while (iGetImage()->GetNumberOfDimensions() && i<3) { pos[i] = mCurrentSlicerManager->GetSlicer(mCurrentSlicerManager->GetSelectedSlicer())->GetCursorPosition()[i]; position += QString::number(pos[i],'f',1) + " "; - mPoint1[i] = round((pos[i] - mCurrentSlicerManager->GetSlicer(mCurrentSlicerManager->GetSelectedSlicer())->GetInput()->GetOrigin()[i])/mCurrentSlicerManager->GetSlicer(mCurrentSlicerManager->GetSelectedSlicer())->GetInput()->GetSpacing()[i]); + mPoint1[i] = (pos[i] - mCurrentSlicerManager->GetSlicer(mCurrentSlicerManager->GetSelectedSlicer())->GetInput()->GetOrigin()[i])/mCurrentSlicerManager->GetSlicer(mCurrentSlicerManager->GetSelectedSlicer())->GetInput()->GetSpacing()[i]; ++i; } if (mCurrentSlicerManager->GetImage()->GetNumberOfDimensions() == 4) { pos[3] = mCurrentSlicerManager->GetSlicer(mCurrentSlicerManager->GetSelectedSlicer())->GetTSlice(); position += QString::number(pos[3],'f',1) + " "; - mPoint1[3] = round(pos[3]); + mPoint1[3] = pos[3]; } mPoint1Selected = true; mCurrentSlicerManager->AddLandmarkProfile(pos[0], pos[1], pos[2], pos[3]); @@ -204,13 +204,13 @@ void vvToolProfile::selectPoint2() while (iGetImage()->GetNumberOfDimensions() &&i<3) { pos[i] = mCurrentSlicerManager->GetSlicer(mCurrentSlicerManager->GetSelectedSlicer())->GetCursorPosition()[i]; position += QString::number(pos[i],'f',1) + " "; - mPoint2[i] = round((pos[i] - mCurrentSlicerManager->GetSlicer(mCurrentSlicerManager->GetSelectedSlicer())->GetInput()->GetOrigin()[i])/mCurrentSlicerManager->GetSlicer(mCurrentSlicerManager->GetSelectedSlicer())->GetInput()->GetSpacing()[i]); + mPoint2[i] = (pos[i] - mCurrentSlicerManager->GetSlicer(mCurrentSlicerManager->GetSelectedSlicer())->GetInput()->GetOrigin()[i])/mCurrentSlicerManager->GetSlicer(mCurrentSlicerManager->GetSelectedSlicer())->GetInput()->GetSpacing()[i]; ++i; } if (mCurrentSlicerManager->GetImage()->GetNumberOfDimensions() == 4) { pos[3] = mCurrentSlicerManager->GetSlicer(mCurrentSlicerManager->GetSelectedSlicer())->GetTSlice(); position += QString::number(pos[3],'f',1) + " "; - mPoint2[3] = round(pos[3]); + mPoint2[3] = pos[3]; } mPoint2Selected = true; mCurrentSlicerManager->AddLandmarkProfile(pos[0], pos[1], pos[2], pos[3]); @@ -387,9 +387,9 @@ void vvToolProfile::InputIsSelected(vvSlicerManager * m) { mCurrentSlicerManager = m; - mPoint1 = new int[4]; + mPoint1 = new double[4]; mPoint1[0] = mPoint1[1] = mPoint1[2] = mPoint1[3] = 0; - mPoint2 = new int[4]; + mPoint2 = new double[4]; mPoint2[0] = mPoint2[1] = mPoint2[2] = mPoint2[3] = 0; mSaveProfileButton->setEnabled(false); diff --git a/vv/vvToolProfile.h b/vv/vvToolProfile.h index 7faf803..03fcd0c 100644 --- a/vv/vvToolProfile.h +++ b/vv/vvToolProfile.h @@ -78,8 +78,8 @@ class vvToolProfile: Ui::vvToolProfile ui; args_info_clitkProfileImage mArgsInfo; - int* mPoint1; - int* mPoint2; + double* mPoint1; + double* mPoint2; bool mPoint1Selected; bool mPoint2Selected; vtkSmartPointer mView; -- 2.47.1