public ColorSoftcopyPresentationStateIod(IDicomElementProvider provider) { _dicomElementProvider = provider; this.Patient = new PatientModuleIod(_dicomElementProvider); this.ClinicalTrialSubject = new ClinicalTrialSubjectModuleIod(_dicomElementProvider); this.GeneralStudy = new GeneralStudyModuleIod(_dicomElementProvider); this.PatientStudy = new PatientStudyModuleIod(_dicomElementProvider); this.ClinicalTrialStudy = new ClinicalTrialStudyModuleIod(_dicomElementProvider); this.GeneralSeries = new GeneralSeriesModuleIod(_dicomElementProvider); this.ClinicalTrialSeries = new ClinicalTrialSeriesModuleIod(_dicomElementProvider); this.PresentationSeries = new PresentationSeriesModuleIod(_dicomElementProvider); this.GeneralEquipment = new GeneralEquipmentModuleIod(_dicomElementProvider); this.PresentationStateIdentification = new PresentationStateIdentificationModuleIod(_dicomElementProvider); this.PresentationStateRelationship = new PresentationStateRelationshipModuleIod(_dicomElementProvider); this.PresentationStateShutter = new PresentationStateShutterModuleIod(_dicomElementProvider); this.DisplayShutter = new DisplayShutterModuleIod(_dicomElementProvider); this.BitmapDisplayShutter = new BitmapDisplayShutterModuleIod(_dicomElementProvider); this.OverlayPlane = new OverlayPlaneModuleIod(_dicomElementProvider); this.OverlayActivation = new OverlayActivationModuleIod(_dicomElementProvider); this.DisplayedArea = new DisplayedAreaModuleIod(_dicomElementProvider); this.GraphicAnnotation = new GraphicAnnotationModuleIod(_dicomElementProvider); this.SpatialTransform = new SpatialTransformModuleIod(_dicomElementProvider); this.GraphicLayer = new GraphicLayerModuleIod(_dicomElementProvider); this.IccProfile = new IccProfileModuleIod(_dicomElementProvider); this.SopCommon = new SopCommonModuleIod(_dicomElementProvider); }
public static ModalityDataLut Create(IDicomElementProvider dicomElementProvider) { DicomElementSq modalityLutSequence = (DicomElementSq)dicomElementProvider[DicomTags.ModalityLutSequence]; int pixelRepresentation = GetPixelRepresentation(dicomElementProvider); return(Create(modalityLutSequence, pixelRepresentation)); }
public static List <Window> GetWindowCenterAndWidth(IDicomElementProvider provider) { List <Window> windowValues = new List <Window>(); DicomElement windowWidthElement; DicomElement windowCenterElement; if (!provider.TryGetAttribute(DicomTags.WindowCenter, out windowCenterElement)) { return(windowValues); } if (windowCenterElement.IsNull || windowCenterElement.IsEmpty) { return(windowValues); } windowWidthElement = provider[DicomTags.WindowWidth]; if (windowWidthElement.IsNull || windowWidthElement.IsEmpty) { throw new DicomDataException("Window Center exists without Window Width."); } if (windowWidthElement.Count != windowCenterElement.Count) { throw new DicomDataException("Number of Window Center and Width entries differ."); } for (int i = 0; i < windowCenterElement.Count; i++) { windowValues.Add(new Window(windowWidthElement.GetFloat64(i, 0), windowCenterElement.GetFloat64(i, 0))); } return(windowValues); }
public static void SetWindowCenterAndWidth(IDicomElementProvider provider, IEnumerable <Window> windowValues) { StringBuilder widthValues = new StringBuilder(); StringBuilder centerValues = new StringBuilder(); foreach (Window value in windowValues) { if (widthValues.Length > 0) { widthValues.Append("\\"); } widthValues.AppendFormat("{0:G12}", value.Width); if (centerValues.Length > 0) { centerValues.Append("\\"); } centerValues.AppendFormat("{0:G12}", value.Center); } if (centerValues.Length != 0 && widthValues.Length != 0) { provider[DicomTags.WindowCenter].SetStringValue(centerValues.ToString()); provider[DicomTags.WindowWidth].SetStringValue(widthValues.ToString()); } else { // Remove the value from the dataset entirely provider[DicomTags.WindowCenter] = null; provider[DicomTags.WindowWidth] = null; } }
public static List <VoiDataLut> Create(IDicomElementProvider elementProvider) { if (elementProvider == null) { throw new ArgumentNullException("elementProvider"); } DicomElementSq voiLutSequence = elementProvider[DicomTags.VoiLutSequence] as DicomElementSq; if (voiLutSequence == null) { return(new List <VoiDataLut>()); } DicomElementSq modalityLutSequence = elementProvider[DicomTags.ModalityLutSequence] as DicomElementSq; int pixelRepresentation = GetPixelRepresentation(elementProvider); if (IsValidAttribute(modalityLutSequence)) { return(Create(voiLutSequence, modalityLutSequence, pixelRepresentation)); } DicomElement rescaleInterceptElement = elementProvider[DicomTags.RescaleIntercept]; if (IsValidAttribute(rescaleInterceptElement)) { double rescaleSlope = GetRescaleSlope(elementProvider); double rescaleIntercept = rescaleInterceptElement.GetFloat64(0, 0); int bitsStored = GetBitsStored(elementProvider); return(Create(voiLutSequence, bitsStored, pixelRepresentation, rescaleSlope, rescaleIntercept)); } return(Create(voiLutSequence, pixelRepresentation)); }
protected static int GetPixelRepresentation(IDicomElementProvider dicomElementProvider) { DicomElement pixelRepresentationElement = dicomElementProvider[DicomTags.PixelRepresentation]; if (pixelRepresentationElement == null) return 0; else return pixelRepresentationElement.GetInt32(0, 0); }
protected static int GetBitsStored(IDicomElementProvider elementProvider) { DicomElement bitsStoredElement = elementProvider[DicomTags.BitsStored]; if (!IsValidAttribute(bitsStoredElement)) throw new DicomDataException("Bits Stored must exist and have a valid value."); return bitsStoredElement.GetInt32(0, 0); }
/// <summary> /// Gets the institution defined in the General Equipment Module of the given <paramref name="dicomElementProvider">dataset</paramref>. /// </summary> public static Institution GetInstitution(IDicomElementProvider dicomElementProvider) { var institution = new Institution(); var iod = new GeneralEquipmentModuleIod(dicomElementProvider); institution.Name = iod.InstitutionName ?? string.Empty; institution.Address = iod.InstitutionAddress ?? string.Empty; institution.DepartmentName = iod.InstitutionalDepartmentName ?? string.Empty; return(institution); }
private static double GetRescaleSlope(IDicomElementProvider elementProvider) { DicomElement rescaleSlopeElement = elementProvider[DicomTags.RescaleSlope]; if (rescaleSlopeElement == null) { return(1.0); } else { return(rescaleSlopeElement.GetFloat64(0, 1)); } }
/// <summary> /// Parses the date and time. Gets the values for each tag from the element colllection. The <paramref name="dicomDateTime"/> would be a DateTime tag value - such as AcquisitionDatetime, /// the <paramref name="dicomDate"/> would be just a Date tag value - such as AcquisitionDate; and <paramref name="dicomTime"/> would /// be just the Time tag value - such as AcquisitionTime. So, this method will parse the <paramref name="dicomDateTime"/> if it is not empty, /// otherwise it will parse the <paramref name="dicomDate"/> and <paramref name="dicomTime"/> together. /// </summary> /// <param name="dicomAttributeCollection">The dicom element collection.</param> /// <param name="dicomDateTimeTag">The dicom date time tag.</param> /// <param name="dicomDateTag">The dicom date tag.</param> /// <param name="dicomTimeTag">The dicom time tag.</param> /// <returns></returns> public static DateTime?ParseDateAndTime(IDicomElementProvider dicomElementProvider, uint dicomDateTimeTag, uint dicomDateTag, uint dicomTimeTag) { if (dicomElementProvider == null) { throw new ArgumentNullException("dicomElementProvider"); } string dicomDateTime = dicomDateTimeTag == 0 ? String.Empty : dicomElementProvider[dicomDateTimeTag].GetString(0, String.Empty); string dicomDate = dicomDateTag == 0 ? String.Empty : dicomElementProvider[dicomDateTag].GetString(0, String.Empty); string dicomTime = dicomTimeTag == 0 ? String.Empty : dicomElementProvider[dicomTimeTag].GetString(0, String.Empty); return(ParseDateAndTime(dicomDateTime, dicomDate, dicomTime)); }
/// <summary> /// Sets the common tags for a patient query retrieve request. /// </summary> public static void SetCommonTags(IDicomElementProvider dicomElementProvider) { SetAttributeFromEnum(dicomElementProvider[DicomTags.QueryRetrieveLevel], QueryRetrieveLevel.Patient); // Always set the Patient dicomElementProvider[DicomTags.PatientsName].SetString(0, "*"); dicomElementProvider[DicomTags.PatientId].SetNullValue(); dicomElementProvider[DicomTags.PatientsBirthDate].SetNullValue(); dicomElementProvider[DicomTags.PatientsBirthTime].SetNullValue(); dicomElementProvider[DicomTags.PatientsSex].SetNullValue(); dicomElementProvider[DicomTags.NumberOfPatientRelatedStudies].SetNullValue(); dicomElementProvider[DicomTags.NumberOfPatientRelatedSeries].SetNullValue(); dicomElementProvider[DicomTags.NumberOfPatientRelatedInstances].SetNullValue(); }
/// <summary> /// Sets the commonly used tags in the specified dicom attribute collection. /// </summary> public static void SetCommonTags(IDicomElementProvider dicomElementProvider) { if (dicomElementProvider == null) { throw new ArgumentNullException("dicomElementProvider"); } dicomElementProvider[DicomTags.CreationDate].SetNullValue(); dicomElementProvider[DicomTags.PrinterName].SetNullValue(); dicomElementProvider[DicomTags.Originator].SetNullValue(); dicomElementProvider[DicomTags.PrintPriority].SetNullValue(); dicomElementProvider[DicomTags.ExecutionStatus].SetNullValue(); dicomElementProvider[DicomTags.ExecutionStatusInfo].SetNullValue(); }
public static void SetCommonTags(IDicomElementProvider dicomElementProvider) { SetAttributeFromEnum(dicomElementProvider[DicomTags.QueryRetrieveLevel], QueryRetrieveLevel.Series); dicomElementProvider[DicomTags.SeriesInstanceUid].SetNullValue(); dicomElementProvider[DicomTags.Modality].SetNullValue(); dicomElementProvider[DicomTags.SeriesDescription].SetNullValue(); dicomElementProvider[DicomTags.NumberOfSeriesRelatedInstances].SetNullValue(); dicomElementProvider[DicomTags.SeriesNumber].SetNullValue(); dicomElementProvider[DicomTags.SeriesDate].SetNullValue(); dicomElementProvider[DicomTags.SeriesTime].SetNullValue(); dicomElementProvider[DicomTags.RequestAttributesSequence].SetNullValue(); dicomElementProvider[DicomTags.PerformedProcedureStepStartDate].SetNullValue(); dicomElementProvider[DicomTags.PerformedProcedureStepStartTime].SetNullValue(); }
/// <summary> /// Sets the commonly used tags in the specified dicom element collection. /// </summary> public static void SetCommonTags(IDicomElementProvider dicomElementProvider) { if (dicomElementProvider == null) { throw new ArgumentNullException("dicomElementProvider"); } dicomElementProvider[DicomTags.NumberOfCopies].SetNullValue(); dicomElementProvider[DicomTags.PrintPriority].SetNullValue(); dicomElementProvider[DicomTags.MediumType].SetNullValue(); dicomElementProvider[DicomTags.FilmDestination].SetNullValue(); dicomElementProvider[DicomTags.FilmSessionLabel].SetNullValue(); dicomElementProvider[DicomTags.MemoryAllocation].SetNullValue(); dicomElementProvider[DicomTags.OwnerId].SetNullValue(); }
/// <summary> /// Initializes a new instance of the <see cref="EncapsulatedPdfIod"/> class. /// </summary> /// <param name="dicomElementProvider">The DICOM attribute provider.</param> public EncapsulatedPdfIod(IDicomElementProvider dicomElementProvider) { _dicomElementProvider = dicomElementProvider; _patientModule = new PatientModuleIod(_dicomElementProvider); _clinicalTrialSubjectModule = new ClinicalTrialSubjectModuleIod(_dicomElementProvider); _generalStudyModule = new GeneralStudyModuleIod(_dicomElementProvider); _patientStudyModule = new PatientStudyModuleIod(_dicomElementProvider); _clinicalTrialStudyModule = new ClinicalTrialStudyModuleIod(_dicomElementProvider); _encapsulatedDocumentSeriesModule = new EncapsulatedDocumentSeriesModuleIod(_dicomElementProvider); _clinicalTrialSeriesModule = new ClinicalTrialSeriesModuleIod(_dicomElementProvider); _generalEquipmentModule = new GeneralEquipmentModuleIod(_dicomElementProvider); _scEquipmentModule = new ScEquipmentModuleIod(_dicomElementProvider); _encapsulatedDocumentModule = new EncapsulatedDocumentModuleIod(_dicomElementProvider); _sopCommonModule = new SopCommonModuleIod(_dicomElementProvider); }
public KeyObjectSelectionDocumentIod(IDicomElementProvider dicomElementProvider) { _dicomElementProvider = dicomElementProvider; _patientModule = new PatientModuleIod(_dicomElementProvider); _specimenIdentificationModule = new SpecimenIdentificationModuleIod(_dicomElementProvider); _clinicalTrialSubjectModule = new ClinicalTrialSubjectModuleIod(_dicomElementProvider); _generalStudyModule = new GeneralStudyModuleIod(_dicomElementProvider); _patientStudyModule = new PatientStudyModuleIod(_dicomElementProvider); _clinicalTrialStudyModule = new ClinicalTrialStudyModuleIod(_dicomElementProvider); _keyObjectDocumentSeriesModule = new KeyObjectDocumentSeriesModuleIod(_dicomElementProvider); _clinicalTrialSeriesModule = new ClinicalTrialSeriesModuleIod(_dicomElementProvider); _generalEquipmentModule = new GeneralEquipmentModuleIod(_dicomElementProvider); _keyObjectDocumentModule = new KeyObjectDocumentModuleIod(_dicomElementProvider); _srDocumentContentModule = new SrDocumentContentModuleIod(_dicomElementProvider); _sopCommonModule = new SopCommonModuleIod(_dicomElementProvider); }
/// <summary> /// Sets the commonly used tags in the specified dicom attribute collection. /// </summary> public static void SetCommonTags(IDicomElementProvider dicomElementProvider) { if (dicomElementProvider == null) { throw new ArgumentNullException("dicomElementProvider"); } dicomElementProvider[DicomTags.PrinterStatus].SetNullValue(); dicomElementProvider[DicomTags.PrinterStatusInfo].SetNullValue(); dicomElementProvider[DicomTags.PrinterName].SetNullValue(); dicomElementProvider[DicomTags.Manufacturer].SetNullValue(); dicomElementProvider[DicomTags.ManufacturersModelName].SetNullValue(); dicomElementProvider[DicomTags.DeviceSerialNumber].SetNullValue(); dicomElementProvider[DicomTags.SoftwareVersions].SetNullValue(); dicomElementProvider[DicomTags.DateOfLastCalibration].SetNullValue(); dicomElementProvider[DicomTags.TimeOfLastCalibration].SetNullValue(); }
/// <summary> /// Sets the common tags for a typical Modality Worklist Request. /// </summary> public static void SetCommonTags(IDicomElementProvider dicomElementProvider) { ModalityWorklistIod iod = new ModalityWorklistIod(dicomElementProvider); //iod.PatientIdentificationModule.PatientsName.FirstName = "*"; iod.DicomElementProvider[DicomTags.PatientsName].SetStringValue("*"); iod.SetAttributeNull(DicomTags.PatientId); iod.SetAttributeNull(DicomTags.PatientsBirthDate); iod.SetAttributeNull(DicomTags.PatientsBirthTime); iod.SetAttributeNull(DicomTags.PatientsWeight); iod.SetAttributeNull(DicomTags.RequestedProcedureId); iod.SetAttributeNull(DicomTags.RequestedProcedureDescription); iod.SetAttributeNull(DicomTags.StudyInstanceUid); iod.SetAttributeNull(DicomTags.ReasonForTheRequestedProcedure); iod.SetAttributeNull(DicomTags.RequestedProcedureComments); iod.SetAttributeNull(DicomTags.RequestedProcedurePriority); iod.SetAttributeNull(DicomTags.ImagingServiceRequestComments); iod.SetAttributeNull(DicomTags.RequestingPhysician); iod.SetAttributeNull(DicomTags.ReferringPhysiciansName); iod.SetAttributeNull(DicomTags.RequestedProcedureLocation); iod.SetAttributeNull(DicomTags.AccessionNumber); iod.SetAttributeNull(DicomTags.PatientsSex); ScheduledProcedureStepSequenceIod scheduledProcedureStepSequenceIod = new ScheduledProcedureStepSequenceIod(); scheduledProcedureStepSequenceIod.SetCommonTags(); iod.ScheduledProcedureStepModule.ScheduledProcedureStepSequenceList.Add(scheduledProcedureStepSequenceIod); //// TODO: this better and easier... //DicomElementSq DicomElementSq = dicomElementProvider[DicomTags.ScheduledProcedureStepSequence] as DicomElementSq; //DicomSequenceItem dicomSequenceItem = new DicomSequenceItem(); //DicomElementSq.Values = dicomSequenceItem; //dicomSequenceItem[DicomTags.Modality].SetNullValue(); //dicomSequenceItem[DicomTags.ScheduledProcedureStepId].SetNullValue(); //dicomSequenceItem[DicomTags.ScheduledProcedureStepDescription].SetNullValue(); //dicomSequenceItem[DicomTags.ScheduledStationAeTitle].SetNullValue(); //dicomSequenceItem[DicomTags.ScheduledProcedureStepStartDate].SetNullValue(); //dicomSequenceItem[DicomTags.ScheduledProcedureStepStartTime].SetNullValue(); //dicomSequenceItem[DicomTags.ScheduledPerformingPhysiciansName].SetNullValue(); //dicomSequenceItem[DicomTags.ScheduledProcedureStepLocation].SetNullValue(); //dicomSequenceItem[DicomTags.ScheduledProcedureStepStatus].SetNullValue(); //dicomSequenceItem[DicomTags.CommentsOnTheScheduledProcedureStep].SetNullValue(); }
public static void SetCommonTags(IDicomElementProvider dicomElementProvider) { Platform.CheckForNullReference(dicomElementProvider, "dicomElementProvider"); PatientQueryIod.SetCommonTags(dicomElementProvider); SetAttributeFromEnum(dicomElementProvider[DicomTags.QueryRetrieveLevel], QueryRetrieveLevel.Study); dicomElementProvider[DicomTags.StudyInstanceUid].SetNullValue(); dicomElementProvider[DicomTags.StudyId].SetNullValue(); dicomElementProvider[DicomTags.StudyDate].SetNullValue(); dicomElementProvider[DicomTags.StudyTime].SetNullValue(); dicomElementProvider[DicomTags.StudyDescription].SetNullValue(); dicomElementProvider[DicomTags.AccessionNumber].SetNullValue(); dicomElementProvider[DicomTags.NumberOfStudyRelatedInstances].SetNullValue(); dicomElementProvider[DicomTags.NumberOfStudyRelatedSeries].SetNullValue(); dicomElementProvider[DicomTags.ModalitiesInStudy].SetNullValue(); dicomElementProvider[DicomTags.RequestingPhysician].SetNullValue(); dicomElementProvider[DicomTags.ReferringPhysiciansName].SetNullValue(); }
public void AddDicomFileValues(IDicomElementProvider dicomElements) { uint[] dicomTags = new uint[] { DicomTags.ImageType, DicomTags.SopClassUid, DicomTags.SopInstanceUid, DicomTags.StudyInstanceUid, DicomTags.SamplesPerPixel, DicomTags.PhotometricInterpretation, DicomTags.NumberOfFrames, DicomTags.Rows, DicomTags.Columns, DicomTags.BitsAllocated, DicomTags.BitsStored, DicomTags.HighBit, DicomTags.PixelRepresentation, DicomTags.SmallestImagePixelValue, DicomTags.LargestImagePixelValue, DicomTags.WindowCenter, DicomTags.WindowWidth, DicomTags.PixelData }; foreach (uint dicomTag in dicomTags) { try { DicomElement dicomElement; if (dicomElements.TryGetAttribute(dicomTag, out dicomElement)) { DicomElementProvider[dicomTag].Values = dicomElement.Values; } } catch (Exception ex) { LogAdapter.Logger.TraceException(ex); throw; } } }
/// <summary> /// Sets the date time element values for the specified attributes in the specified <paramref name="dicomAttributeCollection"/>. /// Will first attempt to write to the <paramref name="dicomDateTimeTag"/> if it is non zero, otherwise /// it will write the values to the separate date and time tags. /// </summary> /// <param name="value">The value.</param> /// <param name="dicomElementProvider">The dicom element provider.</param> /// <param name="dicomDateTimeTag">The dicom date time tag.</param> /// <param name="dicomDateTag">The dicom date tag.</param> /// <param name="dicomTimeTag">The dicom time tag.</param> public static void SetDateTimeAttributeValues(DateTime?value, IDicomElementProvider dicomElementProvider, uint dicomDateTimeTag, uint dicomDateTag, uint dicomTimeTag) { if (dicomElementProvider == null) { throw new ArgumentNullException("dicomElementProvider"); } if (dicomDateTimeTag != 0) { DicomElement dateTimeElement = dicomElementProvider[dicomDateTimeTag]; SetDateTimeAttributeValues(value, dateTimeElement, null, null); } else { if (dicomTimeTag == 0) { SetDateAttributeValues(value, dicomElementProvider[dicomDateTag]); } else { SetDateTimeAttributeValues(value, dicomElementProvider[dicomDateTag], dicomElementProvider[dicomTimeTag]); } } }
/// <summary> /// Sets the common tags for a typical request. /// </summary> public static void SetCommonTags(IDicomElementProvider dicomElementProvider) { //dicomElementProvider[DicomTags.PatientsName].SetString(0, "*"); //dicomElementProvider[DicomTags.PatientId].SetNullValue(); //dicomElementProvider[DicomTags.PatientsBirthDate].SetNullValue(); //dicomElementProvider[DicomTags.PatientsBirthTime].SetNullValue(); //dicomElementProvider[DicomTags.PatientsWeight].SetNullValue(); //dicomElementProvider[DicomTags.RequestedProcedureId].SetNullValue(); //dicomElementProvider[DicomTags.RequestedProcedureDescription].SetNullValue(); //dicomElementProvider[DicomTags.StudyInstanceUid].SetNullValue(); //dicomElementProvider[DicomTags.ReasonForTheRequestedProcedure].SetNullValue(); //dicomElementProvider[DicomTags.RequestedProcedureComments].SetNullValue(); //dicomElementProvider[DicomTags.RequestedProcedurePriority].SetNullValue(); //dicomElementProvider[DicomTags.ImagingServiceRequestComments].SetNullValue(); //dicomElementProvider[DicomTags.RequestingPhysician].SetNullValue(); //dicomElementProvider[DicomTags.ReferringPhysiciansName].SetNullValue(); //dicomElementProvider[DicomTags.RequestedProcedureLocation].SetNullValue(); //dicomElementProvider[DicomTags.AccessionNumber].SetNullValue(); //// TODO: this better and easier... //DicomElementSq DicomElementSq = dicomElementProvider[DicomTags.ScheduledProcedureStepSequence] as DicomElementSq; //DicomSequenceItem dicomSequenceItem = new DicomSequenceItem(); //DicomElementSq.Values = dicomSequenceItem; //dicomSequenceItem[DicomTags.Modality].SetNullValue(); //dicomSequenceItem[DicomTags.ScheduledProcedureStepId].SetNullValue(); //dicomSequenceItem[DicomTags.ScheduledProcedureStepDescription].SetNullValue(); //dicomSequenceItem[DicomTags.ScheduledStationAeTitle].SetNullValue(); //dicomSequenceItem[DicomTags.ScheduledProcedureStepStartDate].SetNullValue(); //dicomSequenceItem[DicomTags.ScheduledProcedureStepStartTime].SetNullValue(); //dicomSequenceItem[DicomTags.ScheduledPerformingPhysiciansName].SetNullValue(); //dicomSequenceItem[DicomTags.ScheduledProcedureStepLocation].SetNullValue(); //dicomSequenceItem[DicomTags.ScheduledProcedureStepStatus].SetNullValue(); //dicomSequenceItem[DicomTags.CommentsOnTheScheduledProcedureStep].SetNullValue(); }
public static void SetCommonTags(IDicomElementProvider dicomElementProvider) { SetAttributeFromEnum(dicomElementProvider[DicomTags.QueryRetrieveLevel], QueryRetrieveLevel.Image); // Set image level.. dicomElementProvider[DicomTags.SopInstanceUid].SetNullValue(); dicomElementProvider[DicomTags.InstanceNumber].SetNullValue(); dicomElementProvider[DicomTags.SopClassUid].SetNullValue(); // IHE specified Image Query Keys dicomElementProvider[DicomTags.Rows].SetNullValue(); dicomElementProvider[DicomTags.Columns].SetNullValue(); dicomElementProvider[DicomTags.BitsAllocated].SetNullValue(); dicomElementProvider[DicomTags.NumberOfFrames].SetNullValue(); // IHE specified Presentation State Query Keys dicomElementProvider[DicomTags.ContentLabel].SetNullValue(); dicomElementProvider[DicomTags.ContentDescription].SetNullValue(); dicomElementProvider[DicomTags.PresentationCreationDate].SetNullValue(); dicomElementProvider[DicomTags.PresentationCreationTime].SetNullValue(); // IHE specified Report Query Keys dicomElementProvider[DicomTags.ReferencedRequestSequence].SetNullValue(); dicomElementProvider[DicomTags.ContentDate].SetNullValue(); dicomElementProvider[DicomTags.ContentTime].SetNullValue(); dicomElementProvider[DicomTags.ConceptNameCodeSequence].SetNullValue(); }
/// <summary> /// Initializes a new instance of the <see cref="RadiationDoseModuleIod"/> class. /// </summary> public RadiationDoseModuleIod(IDicomElementProvider dicomElementProvider) : base(dicomElementProvider) { }
/// <summary> /// Initializes a new instance of the Iod class. /// </summary> /// <param name="_dicomAttributeCollection"></param> public StudyModuleIod(IDicomElementProvider dicomElementProvider) : base(dicomElementProvider) { }
/// <summary> /// Initializes a new instance of the <see cref="BillingAndMaterialManagementCodesModuleIod"/> class. /// </summary> public BillingAndMaterialManagementCodesModuleIod(IDicomElementProvider dicomElementProvider) : base(dicomElementProvider) { }
/// <summary> /// Initializes a new instance of the <see cref="PerformedProcedureStepSummaryMacro"/> class. /// </summary> /// <param name="dicomSequenceItem">The DICOM attribute provider.</param> public PerformedProcedureStepSummaryMacro(IDicomElementProvider dicomSequenceItem) : base(dicomSequenceItem) { }
/// <summary> /// Initializes a new instance of the <see cref="SopCommonModuleIod"/> class. /// </summary> /// <param name="dicomElementProvider">The DICOM attribute provider.</param> public SopCommonModuleIod(IDicomElementProvider dicomElementProvider) : base(dicomElementProvider) { }
/// <summary> /// Initializes a new instance of the <see cref="BasicPixelSpacingCalibrationMacro"/> class. /// </summary> /// <param name="dicomElementProvider">The <see cref="IDicomElementProvider"/>.</param> public BasicPixelSpacingCalibrationMacro(IDicomElementProvider dicomElementProvider) : base(dicomElementProvider) { }
public static PaletteColorLut Create(IDicomElementProvider dataSource) { int lutSize, firstMappedPixel, bitsPerLutEntry; string sourceSopInstanceUid; DicomElement attribDescriptor = dataSource[DicomTags.RedPaletteColorLookupTableDescriptor]; bool tagExists = attribDescriptor.TryGetInt32(0, out lutSize); if (!tagExists) { throw new Exception("LUT Size missing."); } tagExists = attribDescriptor.TryGetInt32(1, out firstMappedPixel); if (!tagExists) { throw new Exception("First Mapped Pixel missing."); } tagExists = attribDescriptor.TryGetInt32(2, out bitsPerLutEntry); if (!tagExists) { throw new Exception("Bits Per Entry missing."); } byte[] redLut = dataSource[DicomTags.RedPaletteColorLookupTableData].Values as byte[]; if (redLut == null) { throw new Exception("Red Palette Color LUT missing."); } byte[] greenLut = dataSource[DicomTags.GreenPaletteColorLookupTableData].Values as byte[]; if (greenLut == null) { throw new Exception("Green Palette Color LUT missing."); } byte[] blueLut = dataSource[DicomTags.BluePaletteColorLookupTableData].Values as byte[]; if (blueLut == null) { throw new Exception("Blue Palette Color LUT missing."); } // The DICOM standard says that if the LUT size is 0, it means that it's 65536 in size. if (lutSize == 0) { lutSize = 65536; } //TODO (CR Sept 2010): just leave it blank? There are plenty of use cases for this class without need of a source sop instance uid if (!dataSource[DicomTags.SopInstanceUid].TryGetString(0, out sourceSopInstanceUid)) { sourceSopInstanceUid = DicomUid.GenerateUid().UID; } return(new PaletteColorLut( sourceSopInstanceUid, lutSize, firstMappedPixel, bitsPerLutEntry, redLut, greenLut, blueLut)); }