]> Creatis software - clitk.git/commitdiff
Landmark display debug
authortbaudier <thomas.baudier@creatis.insa-lyon.fr>
Mon, 7 Dec 2015 12:16:30 +0000 (13:16 +0100)
committertbaudier <thomas.baudier@creatis.insa-lyon.fr>
Mon, 7 Dec 2015 12:16:30 +0000 (13:16 +0100)
vv/vvLandmarksPanel.cxx
vv/vvSlicer.cxx
vv/vvSlicerManager.cxx

index 99d8628b3e9f296cc7bcdba89c38c23bcbcef621..1c6d84a40976406d3e06312e37377cd8ff42deb2 100644 (file)
@@ -30,7 +30,7 @@
 
 //====================================================================
 vvLandmarksPanel::vvLandmarksPanel(QWidget * parent):QWidget(parent)
-{
+{ //out << __func__ << endl;
   setupUi(this);
 
   tableWidget->verticalHeader()->hide();
@@ -48,7 +48,7 @@ vvLandmarksPanel::vvLandmarksPanel(QWidget * parent):QWidget(parent)
 }
 
 void vvLandmarksPanel::Load()
-{
+{ //out << __func__ << endl;
   QString file = QFileDialog::getOpenFileName(this,tr("Load Landmarks"),
                  mCurrentPath.c_str(),tr("Landmarks ( *.txt *.pts)"));
   if (!file.isEmpty()) {
@@ -58,17 +58,17 @@ void vvLandmarksPanel::Load()
 }
 
 bool vvLandmarksPanel::LoadFromFile(std::vector<std::string> files)
-{
+{ //out << __func__ << endl;
   if (!mCurrentLandmarks->LoadFile(files))
     return false;
   
-  SetCurrentLandmarks(mCurrentLandmarks,2);
+  SetCurrentLandmarks(mCurrentLandmarks,0);
   emit UpdateRenderWindows();
   return true;
 }
 
 void vvLandmarksPanel::Save()
-{
+{ //out << __func__ << endl;
   QString file = QFileDialog::getSaveFileName(this,
                  tr("Save Landmarks"),
                  mCurrentPath.c_str(),tr("Landmarks ( *.txt)"));
@@ -81,7 +81,7 @@ void vvLandmarksPanel::Save()
 }
 
 void vvLandmarksPanel::SelectPoint()
-{
+{ //out << __func__ << endl;
   if (tableWidget->rowCount() > 0) {
     QList<QTableWidgetItem *> items = tableWidget->selectedItems();
     if (!items.empty()) {
@@ -100,7 +100,7 @@ void vvLandmarksPanel::SelectPoint()
 
 
 void vvLandmarksPanel::RemoveSelectedPoints()
-{
+{ //out << __func__ << endl;
   if (tableWidget->rowCount() > 0) {
     QList<QTableWidgetItem *> items = tableWidget->selectedItems();
     if (items.empty()) {
@@ -124,7 +124,7 @@ void vvLandmarksPanel::RemoveSelectedPoints()
 }
 
 void vvLandmarksPanel::RemoveAllPoints()
-{
+{ //out << __func__ << endl;
   mCurrentLandmarks->RemoveAll();
   tableWidget->clearContents();
   tableWidget->setRowCount(0);
@@ -132,12 +132,12 @@ void vvLandmarksPanel::RemoveAllPoints()
 }
 
 void vvLandmarksPanel::AddPoint()
-{
+{ //out << __func__ << endl;
   AddPoint(mCurrentLandmarks->GetNumberOfPoints()-1);
 }
 
 void vvLandmarksPanel::AddPoint(int landmarksIndex)
-{
+{ //out << __func__ << endl;
   int rowIndex = tableWidget->rowCount();
 //   DD(rowIndex);
   tableWidget->setRowCount(rowIndex+1);
@@ -176,10 +176,9 @@ void vvLandmarksPanel::AddPoint(int landmarksIndex)
 }
 
 void vvLandmarksPanel::SetCurrentLandmarks(vvLandmarks* lm,int time)
-{
+{ //out << __func__ << endl;
   if (time != lm->GetTime())
     return;
-  
   loadButton->setEnabled(1);
   saveButton->setEnabled(1);
   removeButton->setEnabled(1);
@@ -197,14 +196,14 @@ void vvLandmarksPanel::SetCurrentLandmarks(vvLandmarks* lm,int time)
 }
 
 void vvLandmarksPanel::SetCurrentImage(std::string filename)
-{
+{ //out << __func__ << endl;
   QString image = "<b>CurrentImage : </b>";
   image += vtksys::SystemTools::GetFilenameWithoutLastExtension(filename).c_str();
   nameLabel->setText(image);
 }
 
 void vvLandmarksPanel::CommentsChanged(int row, int column)
-{
+{ //out << __func__ << endl;
   if (column == 6) {
     mCurrentLandmarks->ChangeComments(row,std::string(tableWidget->item(row,column)->text().toStdString()));
     tableWidget->resizeColumnsToContents();
index b6e343cb8abaf8a16b60338bbb2819d197b2b563..6c7dc7b7c00e6876868328aa4351a523eccfc66a 100644 (file)
@@ -678,8 +678,8 @@ void vvSlicer::SetLandmarks(vvLandmarks* landmarks)
 #else
     mLandClipper->SetInputData(mLandmarks->GetOutput());
 
-    mLandGlyph->SetSourceData(mCross->GetOutput());
-    mLandGlyph->SetInputData(mLandClipper->GetOutput());
+    mLandGlyph->SetSourceConnection(mCross->GetOutputPort());
+    mLandGlyph->SetInputConnection(mLandClipper->GetOutputPort());
 #endif
     //mLandGlyph->SetIndexModeToScalar();
     //mLandGlyph->SetRange(0,1);
@@ -694,6 +694,7 @@ void vvSlicer::SetLandmarks(vvLandmarks* landmarks)
     //mLandMapper->ScalarVisibilityOff();
 
     mLandActor->SetMapper(mLandMapper);
+    mLandActor->GetProperty()->SetOpacity(0.995);
     mLandActor->GetProperty()->SetColor(255,10,212);
     mLandActor->SetPickable(0);
     mLandActor->SetVisibility(true);
index d2bf5f2fc3f4437c376d877bad4ced81b868831f..f1ffcb75f2e0795acd897e0bdf55dcfe90b6b9c7 100644 (file)
@@ -1684,6 +1684,7 @@ void vvSlicerManager::AddLandmark(float x,float y,float z,float t)
   double x_index = (x - mSlicers[0]->GetInput()->GetOrigin()[0])/mSlicers[0]->GetInput()->GetSpacing()[0];\r
   double y_index = (y - mSlicers[0]->GetInput()->GetOrigin()[1])/mSlicers[0]->GetInput()->GetSpacing()[1];\r
   double z_index = (z - mSlicers[0]->GetInput()->GetOrigin()[2])/mSlicers[0]->GetInput()->GetSpacing()[2];\r
+  cout << x_index << " " << y_index << " " << z_index << endl;\r
 #if VTK_MAJOR_VERSION <= 5\r
   if (x_index >= mSlicers[0]->GetInput()->GetWholeExtent()[0]-0.5 &&\r
       x_index <= mSlicers[0]->GetInput()->GetWholeExtent()[1]+0.5 &&\r
@@ -1704,7 +1705,7 @@ void vvSlicerManager::AddLandmark(float x,float y,float z,float t)
       y_index <= extentImageReslice[3]+0.5 &&\r
       z_index >= extentImageReslice[4]-0.5 &&\r
       z_index <= extentImageReslice[5]+0.5) {\r
-    double value = this->GetScalarComponentAsDouble(mSlicers[0]->GetInput(), x_index, y_index, z_index);\r
+    double value = this->GetScalarComponentAsDouble(mImage->GetVTKImages()[mSlicers[0]->GetTSlice()], x_index, y_index, z_index);\r
     this->GetLandmarks()->AddLandmark(x,y,z,t,value);\r
     emit LandmarkAdded();\r
   }\r