]> Creatis software - clitk.git/commitdiff
Change voxel position into double
authortbaudier <thomas.baudier@creatis.insa-lyon.fr>
Mon, 8 Feb 2016 15:28:44 +0000 (16:28 +0100)
committertbaudier <thomas.baudier@creatis.insa-lyon.fr>
Mon, 8 Feb 2016 15:28:44 +0000 (16:28 +0100)
tools/clitkProfileImage.ggo
vv/vvToolProfile.cxx
vv/vvToolProfile.h

index 7714e1833d82356fbb0325f7183dd9b6e728c6f1..773790dcf0a13a195bd813d238d89a51734af086 100644 (file)
@@ -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)
 
 
 
index e269fff7aeacbd9f65c1a8fd259a747ee37650d8..eab2fa311c70b3e871d208d1abb9528e46a6b397 100644 (file)
@@ -153,13 +153,13 @@ void vvToolProfile::selectPoint1()
           while (i<mCurrentSlicerManager->GetImage()->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 (i<mCurrentSlicerManager->GetImage()->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);
index 7faf8035618e8744d5520c655bece0e9c9576608..03fcd0c0a730fd637b481be83d217dfff046fbc5 100644 (file)
@@ -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<vtkContextView> mView;