private void SetStudyTags() { StudyInstanceUid = DicomUid.GenerateUid().UID; _theFile.DataSet[DicomTags.StudyInstanceUid].SetStringValue(StudyInstanceUid); _theFile.DataSet[DicomTags.StudyDate].SetStringValue(DateParser.ToDicomString(StudyDate)); _theFile.DataSet[DicomTags.StudyTime].SetStringValue(TimeParser.ToDicomString(DateTime.Now)); _theFile.DataSet[DicomTags.PerformedProcedureStepStartDate].SetStringValue(DateParser.ToDicomString(StudyDate)); _theFile.DataSet[DicomTags.PerformedProcedureStepStartTime].SetStringValue(TimeParser.ToDicomString(DateTime.Now)); _theFile.DataSet[DicomTags.AccessionNumber].SetStringValue(ModalityHospital.GetNextAccession()); _studyNumber++; _theFile.DataSet[DicomTags.StudyId].SetStringValue(string.Format("S{0:0000}", _studyNumber)); _theFile.DataSet[DicomTags.ReferringPhysiciansName].SetStringValue(GetPatient()); string name = GetPatient(); _theFile.DataSet[DicomTags.PatientsName].SetStringValue(name); _theFile.DataSet[DicomTags.PatientId].SetStringValue(string.Format("{0} {1}", Math.Abs(name.GetHashCode()), ModalityHospital.Name)); _theFile.DataSet[DicomTags.IssuerOfPatientId].SetStringValue(ModalityHospital.Name); DateTime birthdate = GetBirthdate(name); TimeSpan age = StudyDate.Subtract(birthdate); _theFile.DataSet[DicomTags.PatientsBirthDate].SetStringValue(DateParser.ToDicomString(birthdate)); _theFile.DataSet[DicomTags.PatientsAge].SetStringValue(String.Format("{0:000}Y", age.Days / 365)); _theFile.DataSet[DicomTags.PatientsSex].SetStringValue("M"); _theFile.DataSet[DicomTags.StudyDescription].SetStringValue(_studyDescription[Rand.Next(_studyDescription.Count)]); }
private void SetSeriesTags() { _theFile.DataSet[DicomTags.SeriesInstanceUid].SetStringValue(DicomUid.GenerateUid().UID); _theFile.DataSet[DicomTags.SeriesDate].SetStringValue(DateParser.ToDicomString(StudyDate)); _theFile.DataSet[DicomTags.SeriesTime].SetStringValue(TimeParser.ToDicomString(DateTime.Now)); _theFile.DataSet[DicomTags.Modality].SetStringValue(Modality); DicomSequenceItem item = new DicomSequenceItem(); _theFile.DataSet[DicomTags.RequestAttributesSequence].AddSequenceItem(item); item[DicomTags.RequestedProcedureId].SetStringValue(ModalityHospital.GetNextRequestedProcedureStepId()); item[DicomTags.ScheduledProcedureStepId].SetStringValue(ModalityHospital.GetNextScheduledProcedureStepId()); _theFile.DataSet[DicomTags.SeriesDescription].SetStringValue(_seriesDescription[Rand.Next(_seriesDescription.Count)]); _seriesNumber++; _theFile.DataSet[DicomTags.SeriesNumber].AppendInt32(_seriesNumber); }
public void SetupMultiframeXA(DicomAttributeCollection theSet, uint rows, uint columns, uint frames) { DateTime studyTime = DateTime.Now; theSet[DicomTags.SpecificCharacterSet].SetStringValue("ISO_IR 100"); theSet[DicomTags.ImageType].SetStringValue("DERIVED\\SECONDARY\\SINGLE PLANE\\SINGLE A"); theSet[DicomTags.InstanceCreationDate].SetStringValue(DateParser.ToDicomString(DateTime.Now)); theSet[DicomTags.InstanceCreationTime].SetStringValue(TimeParser.ToDicomString(DateTime.Now)); theSet[DicomTags.SopClassUid].SetStringValue(SopClass.XRayAngiographicImageStorageUid); theSet[DicomTags.SopInstanceUid].SetStringValue(DicomUid.GenerateUid().UID); theSet[DicomTags.StudyDate].SetStringValue(DateParser.ToDicomString(studyTime)); theSet[DicomTags.StudyTime].SetStringValue(TimeParser.ToDicomString(studyTime)); theSet[DicomTags.SeriesDate].SetStringValue(DateParser.ToDicomString(studyTime)); theSet[DicomTags.SeriesTime].SetStringValue(TimeParser.ToDicomString(studyTime)); theSet[DicomTags.AccessionNumber].SetStringValue("A4567"); theSet[DicomTags.Modality].SetStringValue("XA"); theSet[DicomTags.Manufacturer].SetStringValue("ClearCanvas"); theSet[DicomTags.InstitutionName].SetStringValue("KardiologieUniklinikHeidelberg"); theSet[DicomTags.ReferringPhysiciansName].SetStringValue("Last^First"); theSet[DicomTags.StudyDescription].SetStringValue("HEART"); theSet[DicomTags.SeriesDescription].SetStringValue("Heart 2D EPI BH TRA"); theSet[DicomTags.PatientsName].SetStringValue("Patient^Test"); theSet[DicomTags.PatientId].SetStringValue("ID123-45-9999"); theSet[DicomTags.PatientsBirthDate].SetStringValue("19600101"); theSet[DicomTags.PatientsSex].SetStringValue("M"); theSet[DicomTags.PatientsWeight].SetStringValue("80"); theSet[DicomTags.PatientsSize].SetStringValue("10.000244140625"); theSet[DicomTags.Kvp].SetStringValue("80"); theSet[DicomTags.ProtocolName].SetStringValue("25 FPS Koronarien"); theSet[DicomTags.FrameTime].SetStringValue("40"); theSet[DicomTags.FrameDelay].SetStringValue("0"); theSet[DicomTags.DistanceSourceToDetector].SetStringValue("1018"); theSet[DicomTags.ExposureTime].SetStringValue("7"); theSet[DicomTags.XRayTubeCurrent].SetStringValue("815"); theSet[DicomTags.RadiationSetting].SetStringValue("GR"); theSet[DicomTags.IntensifierSize].SetStringValue("169.99998"); theSet[DicomTags.PositionerMotion].SetStringValue("STATIC"); theSet[DicomTags.PositionerPrimaryAngle].SetStringValue("-40.2999999"); theSet[DicomTags.PositionerSecondaryAngle].SetStringValue("-15.5"); theSet[DicomTags.DeviceSerialNumber].SetStringValue("1234"); theSet[DicomTags.SoftwareVersions].SetStringValue("V1.0"); theSet[DicomTags.StudyInstanceUid].SetStringValue(DicomUid.GenerateUid().UID); theSet[DicomTags.SeriesInstanceUid].SetStringValue(DicomUid.GenerateUid().UID); theSet[DicomTags.StudyId].SetStringValue("20021208125233"); theSet[DicomTags.SeriesNumber].SetStringValue("1"); theSet[DicomTags.AcquisitionNumber].SetStringValue("3"); theSet[DicomTags.InstanceNumber].SetStringValue("13"); theSet[DicomTags.PatientOrientation].SetNullValue(); theSet[DicomTags.ImagesInAcquisition].SetStringValue("1"); theSet[DicomTags.SamplesPerPixel].SetStringValue("1"); theSet[DicomTags.PhotometricInterpretation].SetStringValue("MONOCHROME2"); theSet[DicomTags.NumberOfFrames].SetUInt32(0, frames); theSet[DicomTags.Rows].SetUInt32(0, rows); theSet[DicomTags.Columns].SetUInt32(0, columns); theSet[DicomTags.FrameIncrementPointer].SetUInt32(0, DicomTags.FrameTime); theSet[DicomTags.BitsAllocated].SetStringValue("8"); theSet[DicomTags.BitsStored].SetStringValue("8"); theSet[DicomTags.HighBit].SetStringValue("7"); theSet[DicomTags.PixelRepresentation].SetStringValue("0"); theSet[DicomTags.WindowCenter].SetStringValue("128"); theSet[DicomTags.WindowWidth].SetStringValue("204.8"); theSet[DicomTags.PerformedProcedureStepStartDate].SetStringValue("20080219"); theSet[DicomTags.PerformedProcedureStepStartTime].SetStringValue("143600"); theSet[DicomTags.PerformedProcedureStepId].SetStringValue("UNKNOWN"); // Null SQ Test theSet[DicomTags.ReferencedStudySequence].SetNullValue(); // FL & FD tags for testing theSet[DicomTags.SlabThickness].SetFloat64(0, 0.1234567d); theSet[DicomTags.CalciumScoringMassFactorPatient].SetFloat32(0, 0.7654321f); uint length = rows * columns * frames; if (length % 2 == 1) { length++; } DicomAttributeOW pixels = new DicomAttributeOW(DicomTags.PixelData); byte[] pixelArray = new byte[length]; pixelArray[length - 1] = 0x00; // Padding char for (uint frameCount = 0; frameCount < frames; frameCount++) { for (uint i = frameCount * rows * columns, val = frameCount + 1; i < (frameCount + 1) * rows * columns; i++, val++) { pixelArray[i] = (byte)(val % 255); } } pixels.Values = pixelArray; theSet[DicomTags.PixelData] = pixels; DicomSequenceItem item = new DicomSequenceItem(); theSet[DicomTags.RequestAttributesSequence].AddSequenceItem(item); item[DicomTags.RequestedProcedureId].SetStringValue("XA123"); item[DicomTags.ScheduledProcedureStepId].SetStringValue("XA1234"); item = new DicomSequenceItem(); theSet[DicomTags.RequestAttributesSequence].AddSequenceItem(item); item[DicomTags.RequestedProcedureId].SetStringValue("XA567"); item[DicomTags.ScheduledProcedureStepId].SetStringValue("XA5678"); }
public void SetupSecondaryCapture(DicomAttributeCollection theSet) { DateTime studyTime = DateTime.Now; theSet[DicomTags.SpecificCharacterSet].SetStringValue("ISO_IR 100"); theSet[DicomTags.ImageType].SetStringValue("ORIGINAL\\PRIMARY\\OTHER\\"); theSet[DicomTags.InstanceCreationDate].SetStringValue(DateParser.ToDicomString(DateTime.Now)); theSet[DicomTags.InstanceCreationTime].SetStringValue(TimeParser.ToDicomString(DateTime.Now)); theSet[DicomTags.SopClassUid].SetStringValue(SopClass.SecondaryCaptureImageStorageUid); theSet[DicomTags.SopInstanceUid].SetStringValue(DicomUid.GenerateUid().UID); theSet[DicomTags.StudyDate].SetStringValue(DateParser.ToDicomString(studyTime)); theSet[DicomTags.StudyTime].SetStringValue(TimeParser.ToDicomString(studyTime)); theSet[DicomTags.SeriesDate].SetStringValue(DateParser.ToDicomString(studyTime)); theSet[DicomTags.SeriesTime].SetStringValue(TimeParser.ToDicomString(studyTime)); theSet[DicomTags.AccessionNumber].SetStringValue("A1234"); theSet[DicomTags.Modality].SetStringValue("MR"); theSet[DicomTags.Manufacturer].SetStringValue("ClearCanvas"); theSet[DicomTags.ManufacturersModelName].SetNullValue(); theSet[DicomTags.InstitutionName].SetStringValue("Toronto General Hospital"); theSet[DicomTags.ReferringPhysiciansName].SetStringValue("Last^First"); theSet[DicomTags.StudyDescription].SetStringValue("TEST"); theSet[DicomTags.SeriesDescription].SetStringValue("TEST"); theSet[DicomTags.PatientsName].SetStringValue("Patient^Test"); theSet[DicomTags.PatientId].SetStringValue("ID123-45-9999"); theSet[DicomTags.PatientsBirthDate].SetStringValue("19600102"); theSet[DicomTags.PatientsSize].SetStringValue("10.000244140625"); theSet[DicomTags.SequenceVariant].SetStringValue("OTHER"); theSet[DicomTags.DeviceSerialNumber].SetStringValue("1234"); theSet[DicomTags.SoftwareVersions].SetStringValue("V1.0"); theSet[DicomTags.PatientPosition].SetStringValue("HFS"); theSet[DicomTags.StudyInstanceUid].SetStringValue(DicomUid.GenerateUid().UID); theSet[DicomTags.SeriesInstanceUid].SetStringValue(DicomUid.GenerateUid().UID); theSet[DicomTags.StudyId].SetStringValue("1933"); theSet[DicomTags.SeriesNumber].SetStringValue("1"); theSet[DicomTags.InstanceNumber].SetStringValue("1"); theSet[DicomTags.ImageComments].SetStringValue("Test SC Image"); theSet[DicomTags.SamplesPerPixel].SetStringValue("1"); theSet[DicomTags.PhotometricInterpretation].SetStringValue("MONOCHROME2"); theSet[DicomTags.Rows].SetStringValue("256"); theSet[DicomTags.Columns].SetStringValue("256"); theSet[DicomTags.BitsAllocated].SetStringValue("16"); theSet[DicomTags.BitsStored].SetStringValue("12"); theSet[DicomTags.HighBit].SetStringValue("11"); theSet[DicomTags.PixelRepresentation].SetStringValue("0"); uint length = 256 * 256 * 2; DicomAttributeOW pixels = new DicomAttributeOW(DicomTags.PixelData); byte[] pixelArray = new byte[length]; for (uint i = 0; i < length; i += 2) { pixelArray[i] = (byte)(i % 255); } pixels.Values = pixelArray; theSet[DicomTags.PixelData] = pixels; DicomSequenceItem item = new DicomSequenceItem(); theSet[DicomTags.RequestAttributesSequence].AddSequenceItem(item); item[DicomTags.RequestedProcedureId].SetStringValue("MRR1234"); item[DicomTags.ScheduledProcedureStepId].SetStringValue("MRS1234"); item = new DicomSequenceItem(); theSet[DicomTags.RequestAttributesSequence].AddSequenceItem(item); item[DicomTags.RequestedProcedureId].SetStringValue("MR2R1234"); item[DicomTags.ScheduledProcedureStepId].SetStringValue("MR2S1234"); DicomSequenceItem studyItem = new DicomSequenceItem(); item[DicomTags.ReferencedStudySequence].AddSequenceItem(studyItem); studyItem[DicomTags.ReferencedSopClassUid].SetStringValue(SopClass.SecondaryCaptureImageStorageUid); studyItem[DicomTags.ReferencedSopInstanceUid].SetStringValue("1.2.3.4.5.6.7.8.9"); }
public void SetupMR(DicomAttributeCollection theSet) { DateTime studyTime = DateTime.Now; theSet[DicomTags.SpecificCharacterSet].SetStringValue("ISO_IR 100"); theSet[DicomTags.ImageType].SetStringValue("ORIGINAL\\PRIMARY\\OTHER\\M\\FFE"); theSet[DicomTags.InstanceCreationDate].SetStringValue(DateParser.ToDicomString(DateTime.Now)); theSet[DicomTags.InstanceCreationTime].SetStringValue(TimeParser.ToDicomString(DateTime.Now)); theSet[DicomTags.AcquisitionDatetime].SetDateTime(0, DateTime.Now); theSet[DicomTags.SopClassUid].SetStringValue(SopClass.MrImageStorageUid); theSet[DicomTags.SopInstanceUid].SetStringValue(DicomUid.GenerateUid().UID); theSet[DicomTags.StudyDate].SetStringValue(DateParser.ToDicomString(studyTime)); theSet[DicomTags.StudyTime].SetStringValue(TimeParser.ToDicomString(studyTime)); theSet[DicomTags.SeriesDate].SetStringValue(DateParser.ToDicomString(studyTime)); theSet[DicomTags.SeriesTime].SetStringValue(TimeParser.ToDicomString(studyTime)); theSet[DicomTags.AccessionNumber].SetStringValue("A1234"); theSet[DicomTags.Modality].SetStringValue("MR"); theSet[DicomTags.Manufacturer].SetStringValue("ClearCanvas"); theSet[DicomTags.ManufacturersModelName].SetNullValue(); theSet[DicomTags.InstitutionName].SetStringValue("Mount Sinai Hospital"); theSet[DicomTags.ReferringPhysiciansName].SetStringValue("Last^First"); theSet[DicomTags.StudyDescription].SetStringValue("HEART"); theSet[DicomTags.SeriesDescription].SetStringValue("Heart 2D EPI BH TRA"); theSet[DicomTags.PatientsName].SetStringValue("Patient^Test"); theSet[DicomTags.PatientId].SetStringValue("ID123-45-9999"); theSet[DicomTags.PatientsBirthDate].SetStringValue("19600101"); theSet[DicomTags.PatientsSex].SetStringValue("M"); theSet[DicomTags.PatientsWeight].SetStringValue("70"); theSet[DicomTags.PatientsSize].SetStringValue("10.000244140625"); theSet[DicomTags.PatientsAge].SetStringValue("035Y"); theSet[DicomTags.SequenceVariant].SetStringValue("OTHER"); theSet[DicomTags.ScanOptions].SetStringValue("CG"); theSet[DicomTags.MrAcquisitionType].SetStringValue("2D"); theSet[DicomTags.SliceThickness].SetStringValue("10.000000"); theSet[DicomTags.RepetitionTime].SetStringValue("857.142883"); theSet[DicomTags.EchoTime].SetStringValue("8.712100"); theSet[DicomTags.NumberOfAverages].SetStringValue("1"); theSet[DicomTags.ImagingFrequency].SetStringValue("63.901150"); theSet[DicomTags.ImagedNucleus].SetStringValue("1H"); theSet[DicomTags.EchoNumbers].SetStringValue("1"); theSet[DicomTags.MagneticFieldStrength].SetStringValue("1.500000"); theSet[DicomTags.SpacingBetweenSlices].SetStringValue("10.00000"); theSet[DicomTags.NumberOfPhaseEncodingSteps].SetStringValue("81"); theSet[DicomTags.EchoTrainLength].SetStringValue("0"); theSet[DicomTags.PercentSampling].SetStringValue("63.281250"); theSet[DicomTags.PercentPhaseFieldOfView].SetStringValue("68.75000"); theSet[DicomTags.DeviceSerialNumber].SetStringValue("1234"); theSet[DicomTags.SoftwareVersions].SetStringValue("V1.0"); theSet[DicomTags.ProtocolName].SetStringValue("2D EPI BH"); theSet[DicomTags.TriggerTime].SetStringValue("14.000000"); theSet[DicomTags.LowRRValue].SetStringValue("948"); theSet[DicomTags.HighRRValue].SetStringValue("1178"); theSet[DicomTags.IntervalsAcquired].SetStringValue("102"); theSet[DicomTags.IntervalsRejected].SetStringValue("0"); theSet[DicomTags.HeartRate].SetStringValue("56"); theSet[DicomTags.ReceiveCoilName].SetStringValue("B"); theSet[DicomTags.TransmitCoilName].SetStringValue("B"); theSet[DicomTags.InPlanePhaseEncodingDirection].SetStringValue("COL"); theSet[DicomTags.FlipAngle].SetStringValue("50.000000"); theSet[DicomTags.PatientPosition].SetStringValue("HFS"); theSet[DicomTags.StudyInstanceUid].SetStringValue(DicomUid.GenerateUid().UID); theSet[DicomTags.SeriesInstanceUid].SetStringValue(DicomUid.GenerateUid().UID); theSet[DicomTags.StudyId].SetStringValue("1933"); theSet[DicomTags.SeriesNumber].SetStringValue("1"); theSet[DicomTags.AcquisitionNumber].SetStringValue("7"); theSet[DicomTags.InstanceNumber].SetStringValue("1"); theSet[DicomTags.ImagePositionPatient].SetStringValue("-61.7564\\-212.04848\\-99.6208"); theSet[DicomTags.ImageOrientationPatient].SetStringValue("0.861\\0.492\\0.126\\-0.2965"); theSet[DicomTags.FrameOfReferenceUid].SetStringValue(DicomUid.GenerateUid().UID); theSet[DicomTags.PositionReferenceIndicator].SetStringValue(null); theSet[DicomTags.ImageComments].SetStringValue("Test MR Image"); theSet[DicomTags.SamplesPerPixel].SetStringValue("1"); theSet[DicomTags.PhotometricInterpretation].SetStringValue("MONOCHROME2"); theSet[DicomTags.Rows].SetStringValue("256"); theSet[DicomTags.Columns].SetStringValue("256"); theSet[DicomTags.PixelSpacing].SetStringValue("1.367188\\1.367188"); theSet[DicomTags.BitsAllocated].SetStringValue("16"); theSet[DicomTags.BitsStored].SetStringValue("12"); theSet[DicomTags.HighBit].SetStringValue("11"); theSet[DicomTags.PixelRepresentation].SetStringValue("0"); theSet[DicomTags.WindowCenter].SetStringValue("238"); theSet[DicomTags.WindowWidth].SetStringValue("471"); theSet[DicomTags.RescaleSlope].SetStringValue("1.1234567890123"); theSet[DicomTags.RescaleIntercept].SetStringValue("0.0123456789012"); uint length = 256 * 256 * 2; DicomAttributeOW pixels = new DicomAttributeOW(DicomTags.PixelData); byte[] pixelArray = new byte[length]; for (uint i = 0; i < length; i += 2) { pixelArray[i] = (byte)(i % 255); } pixels.Values = pixelArray; theSet[DicomTags.PixelData] = pixels; DicomSequenceItem item = new DicomSequenceItem(); theSet[DicomTags.RequestAttributesSequence].AddSequenceItem(item); item[DicomTags.RequestedProcedureId].SetStringValue("MRR1234"); item[DicomTags.ScheduledProcedureStepId].SetStringValue("MRS1234"); item = new DicomSequenceItem(); theSet[DicomTags.RequestAttributesSequence].AddSequenceItem(item); item[DicomTags.RequestedProcedureId].SetStringValue("MR2R1234"); item[DicomTags.ScheduledProcedureStepId].SetStringValue("MR2S1234"); DicomSequenceItem studyItem = new DicomSequenceItem(); item[DicomTags.ReferencedStudySequence].AddSequenceItem(studyItem); studyItem[DicomTags.ReferencedSopClassUid].SetStringValue(SopClass.MrImageStorageUid); studyItem[DicomTags.ReferencedSopInstanceUid].SetStringValue("1.2.3.4.5.6.7.8.9"); }
public void SetupKoForImage(DicomAttributeCollection theSet, DicomAttributeCollection source) { theSet[DicomTags.SpecificCharacterSet] = source[DicomTags.SpecificCharacterSet].Copy(); theSet[DicomTags.ImageType].SetStringValue("ORIGINAL\\PRIMARY\\OTHER\\M\\FFE"); theSet[DicomTags.InstanceCreationDate].SetStringValue(DateParser.ToDicomString(DateTime.Now)); theSet[DicomTags.InstanceCreationTime].SetStringValue(TimeParser.ToDicomString(DateTime.Now)); theSet[DicomTags.SopClassUid].SetStringValue(SopClass.KeyObjectSelectionDocumentStorageUid); theSet[DicomTags.SopInstanceUid].SetStringValue(DicomUid.GenerateUid().UID); theSet[DicomTags.StudyDate] = source[DicomTags.StudyDate].Copy(); theSet[DicomTags.StudyTime] = source[DicomTags.StudyTime].Copy(); theSet[DicomTags.SeriesDate].SetStringValue(DateParser.ToDicomString(DateTime.Now)); theSet[DicomTags.SeriesTime].SetStringValue(TimeParser.ToDicomString(DateTime.Now)); theSet[DicomTags.ContentDate].SetStringValue(DateParser.ToDicomString(DateTime.Now)); theSet[DicomTags.ContentTime].SetStringValue(TimeParser.ToDicomString(DateTime.Now)); theSet[DicomTags.AccessionNumber] = source[DicomTags.AccessionNumber].Copy(); theSet[DicomTags.Modality].SetStringValue("KO"); theSet[DicomTags.Manufacturer].SetStringValue("ClearCanvas"); theSet[DicomTags.ManufacturersModelName].SetNullValue(); theSet[DicomTags.InstitutionName] = source[DicomTags.InstitutionName].Copy(); theSet[DicomTags.ReferringPhysiciansName] = source[DicomTags.ReferringPhysiciansName].Copy(); theSet[DicomTags.StudyDescription] = source[DicomTags.StudyDescription].Copy(); theSet[DicomTags.SeriesDescription].SetStringValue("Teaching Series"); theSet[DicomTags.PatientsName] = source[DicomTags.PatientsName].Copy(); theSet[DicomTags.PatientId] = source[DicomTags.PatientId].Copy(); theSet[DicomTags.PatientsBirthDate] = source[DicomTags.PatientsBirthDate].Copy(); theSet[DicomTags.PatientsSex] = source[DicomTags.PatientsSex].Copy(); theSet[DicomTags.PatientsWeight] = source[DicomTags.PatientsWeight].Copy(); theSet[DicomTags.StudyInstanceUid] = source[DicomTags.StudyInstanceUid].Copy(); theSet[DicomTags.SeriesInstanceUid].SetStringValue(DicomUid.GenerateUid().UID); theSet[DicomTags.StudyId] = source[DicomTags.StudyId].Copy(); theSet[DicomTags.SeriesNumber].SetStringValue("99"); theSet[DicomTags.InstanceNumber].SetStringValue("1"); theSet[DicomTags.ValueType].SetStringValue("CONTAINER"); DicomSequenceItem item = new DicomSequenceItem(); theSet[DicomTags.ConceptNameCodeSequence].AddSequenceItem(item); item[DicomTags.CodeValue].SetStringValue("113004"); item[DicomTags.CodingSchemeDesignator].SetStringValue("DCM"); item[DicomTags.CodeMeaning].SetStringValue("For Teaching"); theSet[DicomTags.ContinuityOfContent].SetStringValue("SEPARATE"); item = new DicomSequenceItem(); theSet[DicomTags.CurrentRequestedProcedureEvidenceSequence].AddSequenceItem(item); DicomSequenceItem refSeriesItem = new DicomSequenceItem(); item[DicomTags.ReferencedSeriesSequence].AddSequenceItem(refSeriesItem); refSeriesItem[DicomTags.SeriesInstanceUid] = source[DicomTags.SeriesInstanceUid].Copy(); DicomSequenceItem refSopItem = new DicomSequenceItem(); refSeriesItem[DicomTags.ReferencedSopSequence].AddSequenceItem(refSopItem); refSopItem[DicomTags.ReferencedSopClassUid].SetStringValue(source[DicomTags.SopClassUid].ToString()); refSopItem[DicomTags.ReferencedSopInstanceUid].SetStringValue(source[DicomTags.SopInstanceUid].ToString()); item[DicomTags.StudyInstanceUid] = source[DicomTags.StudyInstanceUid].Copy(); item[DicomTags.RequestedProcedureId].SetStringValue("MR2R1234"); item[DicomTags.ScheduledProcedureStepId].SetStringValue("MR2S1234"); theSet[DicomTags.IdenticalDocumentsSequence].AddSequenceItem(new DicomSequenceItem(item.Copy(), true, true, true)); DicomSequenceItem contentItem = new DicomSequenceItem(); theSet[DicomTags.ContentSequence].AddSequenceItem(contentItem); contentItem[DicomTags.RelationshipType].SetStringValue("CONTAINS"); contentItem[DicomTags.ValueType].SetStringValue("IMAGE"); refSopItem = new DicomSequenceItem(); contentItem[DicomTags.ReferencedSopSequence].AddSequenceItem(refSopItem); refSopItem[DicomTags.ReferencedSopClassUid].SetStringValue(source[DicomTags.SopClassUid].ToString()); refSopItem[DicomTags.ReferencedSopInstanceUid].SetStringValue(source[DicomTags.SopInstanceUid].ToString()); if (source.Contains(DicomTags.NumberOfFrames)) { refSopItem[DicomTags.ReferencedFrameNumber].SetStringValue("1"); } else { refSopItem[DicomTags.ReferencedFrameNumber].SetNullValue(); } refSopItem[DicomTags.ReferencedSegmentNumber].SetNullValue(); contentItem = new DicomSequenceItem(); theSet[DicomTags.ContentSequence].AddSequenceItem(contentItem); contentItem[DicomTags.RelationshipType].SetStringValue("CONTAINS"); contentItem[DicomTags.TextValue].SetStringValue("Teaching Images"); item = new DicomSequenceItem(); contentItem[DicomTags.ConceptNameCodeSequence].AddSequenceItem(item); item[DicomTags.CodeValue].SetStringValue("113012"); item[DicomTags.CodingSchemeDesignator].SetStringValue("DCM"); item[DicomTags.CodeMeaning].SetStringValue("Key Object Description"); }