//====================================================================
vvLandmarksPanel::vvLandmarksPanel(QWidget * parent):QWidget(parent)
-{
+{ //out << __func__ << endl;
setupUi(this);
tableWidget->verticalHeader()->hide();
}
void vvLandmarksPanel::Load()
-{
+{ //out << __func__ << endl;
QString file = QFileDialog::getOpenFileName(this,tr("Load Landmarks"),
mCurrentPath.c_str(),tr("Landmarks ( *.txt *.pts)"));
if (!file.isEmpty()) {
}
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)"));
}
void vvLandmarksPanel::SelectPoint()
-{
+{ //out << __func__ << endl;
if (tableWidget->rowCount() > 0) {
QList<QTableWidgetItem *> items = tableWidget->selectedItems();
if (!items.empty()) {
void vvLandmarksPanel::RemoveSelectedPoints()
-{
+{ //out << __func__ << endl;
if (tableWidget->rowCount() > 0) {
QList<QTableWidgetItem *> items = tableWidget->selectedItems();
if (items.empty()) {
}
void vvLandmarksPanel::RemoveAllPoints()
-{
+{ //out << __func__ << endl;
mCurrentLandmarks->RemoveAll();
tableWidget->clearContents();
tableWidget->setRowCount(0);
}
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);
}
void vvLandmarksPanel::SetCurrentLandmarks(vvLandmarks* lm,int time)
-{
+{ //out << __func__ << endl;
if (time != lm->GetTime())
return;
-
loadButton->setEnabled(1);
saveButton->setEnabled(1);
removeButton->setEnabled(1);
}
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();
#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);
//mLandMapper->ScalarVisibilityOff();
mLandActor->SetMapper(mLandMapper);
+ mLandActor->GetProperty()->SetOpacity(0.995);
mLandActor->GetProperty()->SetColor(255,10,212);
mLandActor->SetPickable(0);
mLandActor->SetVisibility(true);
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
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