//--------------------------------------------------------------------
+//--------------------------------------------------------------------
+const std::string & clitk::DicomRT_ROI::GetFilename() const
+{
+ return mFilename;
+}
+//--------------------------------------------------------------------
+
+
//--------------------------------------------------------------------
const std::vector<double> & clitk::DicomRT_ROI::GetDisplayColor() const
{
//--------------------------------------------------------------------
+//--------------------------------------------------------------------
+void clitk::DicomRT_ROI::SetImage(vvImage * image)
+{
+ mImage = image;
+}
+//--------------------------------------------------------------------
+
+
//--------------------------------------------------------------------
vtkPolyData * clitk::DicomRT_ROI::GetMesh()
{
//--------------------------------------------------------------------
void clitk::DicomRT_ROI::SetFromBinaryImage(vvImage::Pointer image, int n,
- std::string name,
- std::vector<double> color)
+ std::string name,
+ std::vector<double> color,
+ std::string filename)
{
// ROI number [Referenced ROI Number]
// ROI Name
mName = name;
+ mFilename = filename;
// ROI Color [ROI Display Color]
mColor = color;
void Read(std::map<int, std::string> & rois, gdcm::SQItem * item);
void SetFromBinaryImage(vvImage::Pointer image, int n,
std::string name,
- std::vector<double> color);
+ std::vector<double> color,
+ std::string filename);
int GetROINumber() const;
const std::string & GetName() const;
+ const std::string & GetFilename() const;
const std::vector<double> & GetDisplayColor() const;
vtkPolyData * GetMesh();
const vvImage::Pointer GetImage() const;
double GetBackgroundValueLabelImage() const;
void SetBackgroundValueLabelImage(double bg);
+ void SetImage(vvImage * im);
+
protected:
void ComputeMesh();
std::string mName;
+ std::string mFilename;
int mNumber;
std::vector<double> mColor;
std::vector<DicomRT_Contour*> mListOfContours;
std::cerr << "No ROI number " << n << std::endl;
return NULL;
}
- DD(mListOfROI[mMapOfROIIndex[n]]->GetName());
- DD(mListOfROI[mMapOfROIIndex[n]]->GetROINumber());
+ // DD(mListOfROI[mMapOfROIIndex[n]]->GetName());
+ //DD(mListOfROI[mMapOfROIIndex[n]]->GetROINumber());
return mListOfROI[mMapOfROIIndex[n]];
}
//--------------------------------------------------------------------
//--------------------------------------------------------------------
int clitk::DicomRT_StructureSet::AddBinaryImageAsNewROI(vvImage::Pointer im, std::string n)
{
- DD("AddBinaryImageAsNewROI");
+ //DD("AddBinaryImageAsNewROI");
// Search max ROI number
int max = -1;
for(unsigned int i=0; i<mListOfROI.size(); i++) {
if (mListOfROI[i]->GetROINumber() > max)
max = mListOfROI[i]->GetROINumber();
}
- DD(max);
+ // DD(max);
++max;
- DD(max);
+ //DD(max);
// Compute name
std::ostringstream oss;
- oss << vtksys::SystemTools::GetFilenameName(vtksys::SystemTools::GetFilenameWithoutLastExtension(n))
- << "_roi_" << max << vtksys::SystemTools::GetFilenameLastExtension(n);
- DD(oss.str());
+ oss << vtksys::SystemTools::GetFilenameName(vtksys::SystemTools::GetFilenameWithoutLastExtension(n));
+ // << "_roi_" << max << vtksys::SystemTools::GetFilenameLastExtension(n);
+ //DD(oss.str());
mMapOfROIName[max] = oss.str();
// Set color
// Create ROI
DicomRT_ROI * roi = new DicomRT_ROI;
- roi->SetFromBinaryImage(im,
- max,
- oss.str(),
- color);
+ roi->SetFromBinaryImage(im, max, oss.str(), color, n);
mListOfROI.push_back(roi);
mMapOfROIIndex[mListOfROI.size()-1] = max;
- DD(mMapOfROIIndex[mListOfROI.size()-1]);
+ //DD(mMapOfROIIndex[mListOfROI.size()-1]);
return max;
}
//--------------------------------------------------------------------