if(open_mode==O_BASE)
window.LoadImages(sequence_filenames, vvImageReader::MERGEDWITHTIME);
else if (open_mode==O_OVERLAY)
- window.AddOverlayImage(n_image_loaded-1,sequence_filenames);
- else{
+ window.AddOverlayImage(n_image_loaded-1,sequence_filenames,vvImageReader::IMAGE);
+ else {
std::cerr << "Sequences are not managed for opening " << open_mode_names[open_mode] << std::endl;
exit(1);
}
} else if (current == "--level") {
parse_mode=P_LEVEL;
} else if (current == "--linkall") {
- link_images = true;
- }
- else if (current == "--log") {
+ link_images = true;
+ }
+ else if (current == "--log") {
std::string log_dir = QDir::tempPath().toStdString() + std::string("/vv-log");
if(itksys::SystemTools::FileExists(log_dir.c_str()) &&
else if (open_mode==O_VF)
window.AddField(current.c_str(), n_image_loaded-1);
else if (open_mode==O_OVERLAY)
- window.AddOverlayImage(n_image_loaded-1,image);
+ window.AddOverlayImage(n_image_loaded-1,image,vvImageReader::IMAGE);
else if (open_mode==O_CONTOUR)
window.AddDCStructContour(n_image_loaded-1,current.c_str());
else if (open_mode==O_FUSION)
if(open_mode==O_BASE)
window.LoadImages(sequence_filenames, vvImageReader::MERGEDWITHTIME);
else if (open_mode==O_OVERLAY)
- window.AddOverlayImage(n_image_loaded-1,sequence_filenames);
- else{
+ window.AddOverlayImage(n_image_loaded-1,sequence_filenames, vvImageReader::MERGEDWITHTIME);
+ else {
std::cerr << "Sequences are not managed for opening " << open_mode_names[open_mode] << std::endl;
exit(1);
}
window.ApplyWindowLevelToAllImages();
}
- if (link_images)
- window.LinkAllImages();
+ if (link_images)
+ window.LinkAllImages();
int ret = app.exec();
for (int i = 0; i < files.size(); i++) {
vecFileNames.push_back(files[i].toStdString());
}
- AddOverlayImage(index,vecFileNames);
+ AddOverlayImage(index,vecFileNames,vvImageReader::IMAGE);
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
-void vvMainWindow::AddOverlayImage(int index, std::vector<std::string> fileNames)
+void vvMainWindow::AddOverlayImage(int index, std::vector<std::string> fileNames, vvImageReader::LoadedImageType type)
{
QString file(fileNames[0].c_str());
if (QFile::exists(file))
qApp->processEvents();
std::string filename = itksys::SystemTools::GetFilenameWithoutExtension(file.toStdString()).c_str();
- if (mSlicerManagers[index]->SetOverlay(fileNames,dimension, component)) {
+ if (mSlicerManagers[index]->SetOverlay(fileNames,dimension, component,type)) {
//create an item in the tree with good settings
QTreeWidgetItem *item = new QTreeWidgetItem();
item->setData(0,Qt::UserRole,file.toStdString().c_str());
void LoadImages(std::vector<std::string> filenames, vvImageReader::LoadedImageType type);
vvSlicerManager * AddImage(vvImage::Pointer image,std::string filename);
void AddField(QString file,int index);
- void AddOverlayImage(int index, std::vector<std::string> fileNames);
+ 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
// TODO: manage sequence of images
std::vector<std::string> vec;
vec.push_back(file.c_str());
- m_Window->AddOverlayImage(index, vec);
+ m_Window->AddOverlayImage(index, vec, vvImageReader::IMAGE);
}
}
if (value == "OverlayColorWindow") {
//----------------------------------------------------------------------------
-bool vvSlicerManager::SetOverlay(std::vector<std::string> filenames,int dim, std::string component)
+bool vvSlicerManager::SetOverlay(std::vector<std::string> filenames,int dim, std::string component, vvImageReader::LoadedImageType type)
{
mOverlayName = filenames[0];
mOverlayComponent = component;
if (dim > mImage->GetNumberOfDimensions()) {
- mLastError = " Overlay dimension cannot be greater then reference image!";
+ mLastError = " Overlay dimension cannot be greater than reference image!";
return false;
}
if (mOverlayReader.IsNull())
mOverlayReader = vvImageReader::New();
mOverlayReader->SetInputFilenames(filenames);
- mOverlayReader->Update(mImage->GetNumberOfDimensions(),component.c_str(),mType);
+ mOverlayReader->Update(type);
if (mOverlayReader->GetLastError().size() == 0) {
for ( unsigned int i = 0; i < mSlicers.size(); i++) {
mSlicers[i]->SetOverlay(mOverlayReader->GetOutput());
void SetImage(vvImage::Pointer image);
bool SetImages(std::vector<std::string> filenames, vvImageReader::LoadedImageType type, int n=0);
- bool SetOverlay(std::vector<std::string> filenames, int dim, std::string component);
+ bool SetOverlay(std::vector<std::string> filenames, int dim, std::string component, vvImageReader::LoadedImageType type);
bool SetFusion(std::string filename, int dim, std::string component);
///Set a VF by loading it from the disk
bool SetVF(std::string filename);