From: tbaudier Date: Mon, 7 Dec 2015 12:16:30 +0000 (+0100) Subject: Landmark display debug X-Git-Tag: v1.4.0~89^2~1 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=a415e9ff5d968ac3ddcf820955f8a1f75bbde185;p=clitk.git Landmark display debug --- diff --git a/vv/vvLandmarksPanel.cxx b/vv/vvLandmarksPanel.cxx index 99d8628..1c6d84a 100644 --- a/vv/vvLandmarksPanel.cxx +++ b/vv/vvLandmarksPanel.cxx @@ -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 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 items = tableWidget->selectedItems(); if (!items.empty()) { @@ -100,7 +100,7 @@ void vvLandmarksPanel::SelectPoint() void vvLandmarksPanel::RemoveSelectedPoints() -{ +{ //out << __func__ << endl; if (tableWidget->rowCount() > 0) { QList 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 = "CurrentImage : "; 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(); diff --git a/vv/vvSlicer.cxx b/vv/vvSlicer.cxx index b6e343c..6c7dc7b 100644 --- a/vv/vvSlicer.cxx +++ b/vv/vvSlicer.cxx @@ -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); diff --git a/vv/vvSlicerManager.cxx b/vv/vvSlicerManager.cxx index d2bf5f2..f1ffcb7 100644 --- a/vv/vvSlicerManager.cxx +++ b/vv/vvSlicerManager.cxx @@ -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]; double y_index = (y - mSlicers[0]->GetInput()->GetOrigin()[1])/mSlicers[0]->GetInput()->GetSpacing()[1]; double z_index = (z - mSlicers[0]->GetInput()->GetOrigin()[2])/mSlicers[0]->GetInput()->GetSpacing()[2]; + cout << x_index << " " << y_index << " " << z_index << endl; #if VTK_MAJOR_VERSION <= 5 if (x_index >= mSlicers[0]->GetInput()->GetWholeExtent()[0]-0.5 && x_index <= mSlicers[0]->GetInput()->GetWholeExtent()[1]+0.5 && @@ -1704,7 +1705,7 @@ void vvSlicerManager::AddLandmark(float x,float y,float z,float t) y_index <= extentImageReslice[3]+0.5 && z_index >= extentImageReslice[4]-0.5 && z_index <= extentImageReslice[5]+0.5) { - double value = this->GetScalarComponentAsDouble(mSlicers[0]->GetInput(), x_index, y_index, z_index); + double value = this->GetScalarComponentAsDouble(mImage->GetVTKImages()[mSlicers[0]->GetTSlice()], x_index, y_index, z_index); this->GetLandmarks()->AddLandmark(x,y,z,t,value); emit LandmarkAdded(); }