+ }
+}
+//------------------------------------------------------------------------------
+
+
+//------------------------------------------------------------------------------
+void vvToolStructureSetManager::AddImage(vvImage * binaryImage, std::string filename,
+ double BG, bool m_modeBG)
+{
+ // Check current structure set
+ int index;
+ if (mCurrentStructureSet == NULL) {
+ if (mStructureSetsList.size() == 0) { // Create a default SS
+ clitk::DicomRT_StructureSet::Pointer mStructureSet = clitk::DicomRT_StructureSet::New();
+ index = AddStructureSet(mStructureSet);
+ }
+ else { // Get first SS
+ index = 0;
+ }
+ } else {
+ index = mCurrentStructureSetIndex;
+ }
+ mCurrentStructureSet = mStructureSetsList[index];
+ mCurrentStructureSetActor = mStructureSetActorsList[index].data();
+ mCurrentStructureSetIndex = index;
+
+ // Check Dimension
+ int dim = mCurrentImage->GetNumberOfDimensions();
+ int bin_dim = binaryImage->GetNumberOfDimensions();
+ if (dim < bin_dim) { ////////// TO CHANGE FOR 3D/4D
+ std::ostringstream os;
+ os << "Error. Loaded binary image is " << bin_dim
+ << "D while selected image is " << dim << "D" << std::endl;
+ QMessageBox::information(this,tr("Reading problem"),os.str().c_str());
+ return;