//==================================================================
void Descriptor::CreateLevel0Descriptor()
{
- GetLevelDescriptorList().push_back(LevelDescriptor("Root"));
+ Add(LevelDescriptor("Root"));
}
//==================================================================
void Descriptor::CreateDefault()
{
// clears the existing one
- GetLevelDescriptorList().clear();
+ Clear();
// Creates the level 0 descriptor
CreateLevel0Descriptor();
// Creates the attribute "Name"
- GetLevelDescriptor(0).Add(AttributeDescriptor("Name","Name",
- AttributeDescriptor::LABEL));
+ Add(AttributeDescriptor("Name","Name",
+ AttributeDescriptor::LABEL),0);
// Patient level
- GetLevelDescriptorList().push_back(LevelDescriptor("Patient"));
- GetLevelDescriptor(1).Add(AttributeDescriptor(0x0010,0x0010, // Patient name
- AttributeDescriptor::LABEL));
- GetLevelDescriptor(1).Add(AttributeDescriptor(0x0010,0x0040)); // Patient sex
- GetLevelDescriptor(1).Add(AttributeDescriptor(0x0010,0x0030)); // Patient birthday
- GetLevelDescriptor(1).Add(AttributeDescriptor(0x0010,0x0020, // Patient ID
- AttributeDescriptor::IDENTIFIER));
+ Add(LevelDescriptor("Patient"));
+ Add(AttributeDescriptor(0x0010,0x0010, // Patient name
+ AttributeDescriptor::LABEL),1);
+ Add(AttributeDescriptor(0x0010,0x0040),1); // Patient sex
+ Add(AttributeDescriptor(0x0010,0x0030),1); // Patient birthday
+ Add(AttributeDescriptor(0x0010,0x0020, // Patient ID
+ AttributeDescriptor::IDENTIFIER),1);
// Study-series level
- GetLevelDescriptorList().push_back(LevelDescriptor("Series"));
- GetLevelDescriptor(2).Add(AttributeDescriptor(0x0008,0x0060, // Modality
- AttributeDescriptor::LABEL));
- GetLevelDescriptor(2).Add(AttributeDescriptor(0x0008,0x1030)); // Study Description
- GetLevelDescriptor(2).Add(AttributeDescriptor(0x0008,0x103E)); // Description
- GetLevelDescriptor(2).Add(AttributeDescriptor(0x0008,0x0080)); // Institution Name
- GetLevelDescriptor(2).Add(AttributeDescriptor(0x0008,0x0081)); // Institution Adress
- GetLevelDescriptor(2).Add(AttributeDescriptor(0x0008,0x1010)); // Station Name
- GetLevelDescriptor(2).Add(AttributeDescriptor(0x0008,0x1048)); // Physician of Record
- GetLevelDescriptor(2).Add(AttributeDescriptor(0x0008,0x1050)); // Performing Physician's Name
- GetLevelDescriptor(2).Add(AttributeDescriptor(0x0018,0x1030)); // Protocol Name
-
- GetLevelDescriptor(2).Add(AttributeDescriptor(0x0020,0x0010)); // Study ID
- GetLevelDescriptor(2).Add(AttributeDescriptor(0x0008,0x0020)); // Study Date
- GetLevelDescriptor(2).Add(AttributeDescriptor(0x0008,0x0030)); // Study Time
- GetLevelDescriptor(2).Add(AttributeDescriptor(0x0008,0x0050)); // Study Accession Number
- GetLevelDescriptor(2).Add(AttributeDescriptor(0x0008,0x0005)); // Specific character set
- GetLevelDescriptor(2).Add(AttributeDescriptor(0x0008,0x0021)); // Series Date
- GetLevelDescriptor(2).Add(AttributeDescriptor(0x0008,0x0031)); // Series time
-
- GetLevelDescriptor(2).Add(AttributeDescriptor(0x0020,0x000D // Study Instance UID
- ));//AttributeDescriptor::IDENTIFIER));
- GetLevelDescriptor(2).Add(AttributeDescriptor(0x0020,0x000E, // Series Instance UID
- AttributeDescriptor::IDENTIFIER));
+ Add(LevelDescriptor("Series"));
+ Add(AttributeDescriptor(0x0008,0x0060, // Modality
+ AttributeDescriptor::LABEL),2);
+ Add(AttributeDescriptor(0x0008,0x1030),2); // Study Description
+ Add(AttributeDescriptor(0x0008,0x103E),2); // Description
+ Add(AttributeDescriptor(0x0008,0x0080),2); // Institution Name
+ Add(AttributeDescriptor(0x0008,0x0081),2); // Institution Adress
+ Add(AttributeDescriptor(0x0008,0x1010),2); // Station Name
+ Add(AttributeDescriptor(0x0008,0x1048),2); // Physician of Record
+ Add(AttributeDescriptor(0x0008,0x1050),2); // Performing Physician's Name
+ Add(AttributeDescriptor(0x0018,0x1030),2); // Protocol Name
+
+ Add(AttributeDescriptor(0x0020,0x0010),2); // Study ID
+ Add(AttributeDescriptor(0x0008,0x0020),2); // Study Date
+ Add(AttributeDescriptor(0x0008,0x0030),2); // Study Time
+ Add(AttributeDescriptor(0x0008,0x0050),2); // Study Accession Number
+ Add(AttributeDescriptor(0x0008,0x0005),2); // Specific character set
+ Add(AttributeDescriptor(0x0008,0x0021),2); // Series Date
+ Add(AttributeDescriptor(0x0008,0x0031),2); // Series time
+
+ Add(AttributeDescriptor(0x0020,0x000D // Study Instance UID
+ ),2);//AttributeDescriptor::IDENTIFIER),2);
+ Add(AttributeDescriptor(0x0020,0x000E, // Series Instance UID
+ AttributeDescriptor::IDENTIFIER),2);
// |
- // AttributeDescriptor::LABEL));
+ // AttributeDescriptor::LABEL),2);
// Image level
- GetLevelDescriptorList().push_back(LevelDescriptor("Image"));
+ Add(LevelDescriptor("Image"));
- GetLevelDescriptor(3).Add(AttributeDescriptor(0x0020,0x0013)); // Image Number
+ Add(AttributeDescriptor(0x0020,0x0013),3); // Image Number
- GetLevelDescriptor(3).Add(AttributeDescriptor(0x0028,0x0010)); // Rows
- GetLevelDescriptor(3).Add(AttributeDescriptor(0x0028,0x0011)); // Columns
- GetLevelDescriptor(3).Add(AttributeDescriptor(0x0028,0x0012)); // Planes
- GetLevelDescriptor(3).Add(AttributeDescriptor(0x0028,0x0002)); // Sample per pixels
- GetLevelDescriptor(3).Add(AttributeDescriptor(0x0028,0x0008)); // Number of Frames
- GetLevelDescriptor(3).Add(AttributeDescriptor(0x0028,0x0004)); // Photometric Interpretation
- GetLevelDescriptor(3).Add(AttributeDescriptor(0x0028,0x0103)); // Pixel Representation
+ Add(AttributeDescriptor(0x0028,0x0010),3); // Rows
+ Add(AttributeDescriptor(0x0028,0x0011),3); // Columns
+ Add(AttributeDescriptor(0x0028,0x0012),3); // Planes
+ Add(AttributeDescriptor(0x0028,0x0002),3); // Sample per pixels
+ Add(AttributeDescriptor(0x0028,0x0008),3); // Number of Frames
+ Add(AttributeDescriptor(0x0028,0x0004),3); // Photometric Interpretation
+ Add(AttributeDescriptor(0x0028,0x0103),3); // Pixel Representation
- GetLevelDescriptor(3).Add(AttributeDescriptor(0x0020,0x0032)); // Image Position Patient
- GetLevelDescriptor(3).Add(AttributeDescriptor(0x0020,0x0037)); // Image Orientation Patient
- GetLevelDescriptor(3).Add(AttributeDescriptor(0x0020,0x1041)); // Slice Location
- GetLevelDescriptor(3).Add(AttributeDescriptor(0x0028,0x0006)); // Planar Configuration
+ Add(AttributeDescriptor(0x0020,0x0032),3); // Image Position Patient
+ Add(AttributeDescriptor(0x0020,0x0037),3); // Image Orientation Patient
+ Add(AttributeDescriptor(0x0020,0x1041),3); // Slice Location
+ Add(AttributeDescriptor(0x0028,0x0006),3); // Planar Configuration
- GetLevelDescriptor(3).Add(AttributeDescriptor(0x0028,0x0030)); // Pixel Spacing
- GetLevelDescriptor(3).Add(AttributeDescriptor(0x0028,0x0100)); // AlocatedBits
- GetLevelDescriptor(3).Add(AttributeDescriptor(0x0028,0x0101)); // StoredBits
+ Add(AttributeDescriptor(0x0028,0x0030),3); // Pixel Spacing
+ Add(AttributeDescriptor(0x0028,0x0100),3); // AlocatedBits
+ Add(AttributeDescriptor(0x0028,0x0101),3); // StoredBits
- GetLevelDescriptor(3).Add(AttributeDescriptor(0x0008,0x0008)); // Image Type
- GetLevelDescriptor(3).Add(AttributeDescriptor(0x0008,0x0023)); // Content Date
- GetLevelDescriptor(3).Add(AttributeDescriptor(0x0008,0x0033)); // Content Time
+ Add(AttributeDescriptor(0x0008,0x0008),3); // Image Type
+ Add(AttributeDescriptor(0x0008,0x0023),3); // Content Date
+ Add(AttributeDescriptor(0x0008,0x0033),3); // Content Time
- GetLevelDescriptor(3).Add(AttributeDescriptor(0x0020,0x4000)); // Image Comments
+ Add(AttributeDescriptor(0x0020,0x4000),3); // Image Comments
- GetLevelDescriptor(3).Add(AttributeDescriptor(0x0004,0x1500, // File Name
- AttributeDescriptor::LABEL));
- GetLevelDescriptor(3).Add(AttributeDescriptor(0x0028,0x1052)); // Rescale Intercept
- GetLevelDescriptor(3).Add(AttributeDescriptor(0x0028,0x1053)); // Rescale Slope
+ Add(AttributeDescriptor(0x0004,0x1500, // File Name
+ AttributeDescriptor::LABEL),3);
+ Add(AttributeDescriptor(0x0028,0x1052),3); // Rescale Intercept
+ Add(AttributeDescriptor(0x0028,0x1053),3); // Rescale Slope
- GetLevelDescriptor(3).Add(AttributeDescriptor(0x0050,0x0004)); // Calibration Image
+ Add(AttributeDescriptor(0x0050,0x0004),3); // Calibration Image
- GetLevelDescriptor(3).Add(AttributeDescriptor(0x0020,0x0052 // Frame Reference UID
- ));
- GetLevelDescriptor(3).Add(AttributeDescriptor(0x0008,0x0016)); // SOP Class UID
- GetLevelDescriptor(3).Add(AttributeDescriptor("FullFileName", // Full file name
+ Add(AttributeDescriptor(0x0020,0x0052 // Frame Reference UID
+ ),3);
+ Add(AttributeDescriptor(0x0008,0x0016),3); // SOP Class UID
+ Add(AttributeDescriptor("FullFileName", // Full file name
"Full file name",
- AttributeDescriptor::IDENTIFIER));
+ AttributeDescriptor::IDENTIFIER),3);
}
//==================================================================
+ //==================================================================
+ /// Adds a LevelDescriptor at the end of the list
+ void Descriptor::Add(const LevelDescriptor& d)
+ {
+ mLevelDescriptorList.push_back(d);
+ }
+ //==================================================================
+
+ //==================================================================
+ /// Adds an AttributeDescriptor to level l
+ void Descriptor::Add(const AttributeDescriptor& d, int l)
+ {
+ mLevelDescriptorList[l].Add(d);
+ // TO DO : update DicomTagToName and NameToDicomTag map
+ }
+ //==================================================================
+
+ //==================================================================
+ /// Clears the Descriptor
+ void Descriptor::Clear()
+ {
+ mLevelDescriptorList.clear();
+ }
+ //==================================================================
+
//==================================================================
/// Builds the key to value map of all the attributes of the tree
void Descriptor::BuildAttributeMap( std::map<std::string,std::string>& map ) const