- guess what it does...
#include <sys/stat.h>
#include <errno.h>
-typedef enum {O_BASE,O_OVERLAY,O_FUSION,O_VF,O_CONTOUR} OpenModeType;
+typedef enum {O_BASE,O_OVERLAY,O_FUSION,O_VF,O_CONTOUR,O_LANDMARKS} OpenModeType;
typedef enum {P_NORMAL,P_SEQUENCE,P_WINDOW,P_LEVEL} ParseModeType;
void load_image_first_error()
} else if (current=="--fusion") {
if (!n_image_loaded) load_image_first_error();
open_mode = O_FUSION;
+ } else if (current=="--landmarks") {
+ if (!n_image_loaded) load_image_first_error();
+ open_mode = O_LANDMARKS;
} else if (current == "--sequence") {
if(open_mode==O_BASE) n_image_loaded++; //count only one for the whole sequence
parse_mode=P_SEQUENCE;
window.AddDCStructContour(n_image_loaded-1,current.c_str());
else if (open_mode==O_FUSION)
window.AddFusionImage(n_image_loaded-1,current.c_str());
+ else if (open_mode==O_LANDMARKS)
+ window.AddLandmarks(n_image_loaded-1,current.c_str());
open_mode = O_BASE;
}
}
QString file = QFileDialog::getOpenFileName(this,tr("Load Landmarks"),
mCurrentPath.c_str(),tr("Landmarks ( *.txt *.pts)"));
if (!file.isEmpty())
- mCurrentLandmarks->LoadFile(file.toStdString());
+ LoadFromFile(file.toStdString());
+}
+
+void vvLandmarksPanel::LoadFromFile(std::string file)
+{
+ mCurrentLandmarks->LoadFile(file);
SetCurrentLandmarks(mCurrentLandmarks,2);
emit UpdateRenderWindows();
}
public slots:
void Load();
+ void LoadFromFile(std::string file);
void Save();
void RemoveSelectedPoints();
void AddPoint();
QMessageBox::information(this,tr("Problem reading Fusion !"),"File doesn't exist!");
}
//------------------------------------------------------------------------------
-
+//------------------------------------------------------------------------------
+void vvMainWindow::AddLandmarks(int index, QString file)
+{
+ if (QFile::exists(file))
+ {
+ landmarksPanel->LoadFromFile(file.toStdString());
+ landmarksPanel->SetCurrentPath(mInputPathName.toStdString());
+ landmarksPanel->SetCurrentImage(mSlicerManagers[index]->GetFileName().c_str());
+ }
+ else
+ QMessageBox::information(this,tr("Problem reading Landmarks !"),"File doesn't exist!");
+}
//------------------------------------------------------------------------------
void vvMainWindow::OpenField()
void AddOverlayImage(int index, std::vector<std::string> fileNames, vvImageReader::LoadedImageType type);
void AddFusionImage(int index, QString filename);
void AddROI(int index, QString filename);
- ///Adds a mesh to a SlicerManager, with optional warping by vector field
+ void AddLandmarks(int index, QString file);
+///Adds a mesh to a SlicerManager, with optional warping by vector field
void AddContour(int image_index, vvMesh::Pointer contour, bool propagation);
///This is used to show an image when opened or computed
void ShowLastImage();