- Use vvSlicerManagers to Get/Set Overlay properties.
std::string vvReadState::ReadOverlay(int index)
{
std::string file, value;
+ int vali;
+ double vald;
+ vvSlicerManager* slicerManager = m_Window->GetSlicerManagers()[index];
while (!m_XmlReader->isEndElement() || value != "Overlay") {
m_XmlReader->readNext();
value = m_XmlReader->qualifiedName().toString().toStdString();
if (!m_XmlReader->hasError())
m_Window->AddOverlayImage(index, file.c_str());
}
+ if (value == "OverlayColorWindow") {
+ vald = m_XmlReader->readElementText().toDouble();
+ if (!m_XmlReader->hasError())
+ slicerManager->SetOverlayColorWindow(vald);
+ }
+ if (value == "OverlayColorLevel") {
+ vald = m_XmlReader->readElementText().toDouble();
+ if (!m_XmlReader->hasError())
+ slicerManager->SetOverlayColorLevel(vald);
+ }
+ if (value == "LinkOverlayWindowLevel") {
+ vali = m_XmlReader->readElementText().toInt();
+ if (!m_XmlReader->hasError())
+ slicerManager->SetLinkOverlayWindowLevel(vali);
+ }
+ if (value == "OverlayColor") {
+ vali = m_XmlReader->readElementText().toInt();
+ if (!m_XmlReader->hasError())
+ slicerManager->SetOverlayColor(vali);
+ }
}
}
+ m_Window->ImageInfoChanged();
return value;
}
if (role == "fusion")
SaveFusion(item_child, slicerManager);
else if (role == "overlay")
- SaveOverlay(item_child);
+ SaveOverlay(item_child, slicerManager);
else if (role == "vector")
SaveVector(item_child);
}
m_XmlWriter->writeEndElement();
}
-void vvSaveState::SaveOverlay(QTreeWidgetItem* item)
+void vvSaveState::SaveOverlay(const QTreeWidgetItem* item, const vvSlicerManager* vvManager)
{
m_XmlWriter->writeStartElement("Overlay");
std::string filename = item->data(0, Qt::UserRole).toString().toStdString();
m_XmlWriter->writeTextElement("FileName", QDir::current().absoluteFilePath(filename.c_str()));
+ m_XmlWriter->writeTextElement("OverlayColorWindow", QString::number(vvManager->GetOverlayColorWindow()));
+ m_XmlWriter->writeTextElement("OverlayColorLevel", QString::number(vvManager->GetOverlayColorLevel()));
+ m_XmlWriter->writeTextElement("LinkOverlayWindowLevel", QString::number(vvManager->GetLinkOverlayWindowLevel()));
+ m_XmlWriter->writeTextElement("OverlayColor", QString::number(vvManager->GetOverlayColor()));
m_XmlWriter->writeEndElement();
}
void SaveTree();
void SaveImage(const QTreeWidgetItem* item, int index);
void SaveFusion(const QTreeWidgetItem* item, const vvSlicerManager* slicerManager);
- void SaveOverlay(const QTreeWidgetItem* item);
+ void SaveOverlay(const QTreeWidgetItem* item, const vvSlicerManager* slicerManager);
void SaveVector(const QTreeWidgetItem* item);
std::auto_ptr<QXmlStreamWriter> m_XmlWriter;