public GeneralStudyAnnotationItemProvider() : base("AnnotationItemProviders.Dicom.GeneralStudy", new AnnotationResourceResolver(typeof(GeneralStudyAnnotationItemProvider).Assembly)) { _annotationItems = new List <IAnnotationItem>(); AnnotationResourceResolver resolver = new AnnotationResourceResolver(this); _annotationItems.Add ( new DicomAnnotationItem <string> ( "Dicom.GeneralStudy.AccessionNumber", resolver, delegate(Frame frame) { return(frame.ParentImageSop.AccessionNumber); }, DicomDataFormatHelper.RawStringFormat ) ); _annotationItems.Add ( new DicomAnnotationItem <PersonName> ( "Dicom.GeneralStudy.ReferringPhysiciansName", resolver, delegate(Frame frame) { return(frame.ParentImageSop.ReferringPhysiciansName); }, DicomDataFormatHelper.PersonNameFormatter ) ); _annotationItems.Add ( new DicomAnnotationItem <string> ( "Dicom.GeneralStudy.StudyDate", resolver, delegate(Frame frame) { return(frame.ParentImageSop.StudyDate); }, DicomDataFormatHelper.DateFormat ) ); _annotationItems.Add ( new DicomAnnotationItem <string> ( "Dicom.GeneralStudy.StudyTime", resolver, delegate(Frame frame) { return(frame.ParentImageSop.StudyTime); }, DicomDataFormatHelper.TimeFormat ) ); _annotationItems.Add ( new DicomAnnotationItem <string> ( "Dicom.GeneralStudy.StudyDescription", resolver, delegate(Frame frame) { return(frame.ParentImageSop.StudyDescription); }, DicomDataFormatHelper.RawStringFormat ) ); _annotationItems.Add ( new DicomAnnotationItem <string> ( "Dicom.GeneralStudy.StudyId", resolver, FrameDataRetrieverFactory.GetStringRetriever(DicomTags.StudyId), DicomDataFormatHelper.RawStringFormat ) ); }
public GeneralImageAnnotationItemProvider() : base("AnnotationItemProviders.Dicom.GeneralImage", new AnnotationResourceResolver(typeof(GeneralImageAnnotationItemProvider).Assembly)) { _annotationItems = new List <IAnnotationItem>(); AnnotationResourceResolver resolver = new AnnotationResourceResolver(this); _annotationItems.Add ( new DicomAnnotationItem <string> ( "Dicom.GeneralImage.AcquisitionDate", resolver, delegate(Frame frame) { return(frame.AcquisitionDate); }, DicomDataFormatHelper.DateFormat ) ); _annotationItems.Add ( new DicomAnnotationItem <string> ( "Dicom.GeneralImage.AcquisitionTime", resolver, delegate(Frame frame) { return(frame.AcquisitionTime); }, delegate(string input) { if (String.IsNullOrEmpty(input)) { return(String.Empty); } DateTime time; if (!TimeParser.Parse(input, out time)) { return(input); } return(time.ToString("HH:mm:ss.FFFFFF")); } ) ); _annotationItems.Add ( new DicomAnnotationItem <string> ( "Dicom.GeneralImage.AcquisitionDateTime", resolver, delegate(Frame frame) { return(frame.AcquisitionDateTime); }, delegate(string input) { if (String.IsNullOrEmpty(input)) { return(String.Empty); } DateTime dateTime; if (!DateTimeParser.Parse(input, out dateTime)) { return(input); } return(String.Format("{0} {1}", dateTime.Date.ToString(Format.DateFormat), dateTime.ToString("HH:mm:ss.FFFFFF"))); } ) ); _annotationItems.Add ( new DicomAnnotationItem <string> ( "Dicom.GeneralImage.AcquisitionNumber", resolver, delegate(Frame frame) { return(frame.AcquisitionNumber.ToString()); }, DicomDataFormatHelper.RawStringFormat ) ); _annotationItems.Add ( new DicomAnnotationItem <string> ( "Dicom.GeneralImage.ContentDate", resolver, FrameDataRetrieverFactory.GetStringRetriever(DicomTags.ContentDate), DicomDataFormatHelper.DateFormat ) ); _annotationItems.Add ( new DicomAnnotationItem <string> ( "Dicom.GeneralImage.ContentTime", resolver, FrameDataRetrieverFactory.GetStringRetriever(DicomTags.ContentTime), DicomDataFormatHelper.TimeFormat ) ); _annotationItems.Add ( new DicomAnnotationItem <string> ( "Dicom.GeneralImage.DerivationDescription", resolver, FrameDataRetrieverFactory.GetStringRetriever(DicomTags.DerivationDescription), DicomDataFormatHelper.RawStringFormat ) ); _annotationItems.Add ( new DicomAnnotationItem <string> ( "Dicom.GeneralImage.ImageComments", resolver, delegate(Frame frame) { return(frame.ImageComments); }, DicomDataFormatHelper.RawStringFormat ) ); _annotationItems.Add ( new DicomAnnotationItem <string> ( "Dicom.GeneralImage.ImagesInAcquisition", resolver, delegate(Frame frame) { return(frame.ImagesInAcquisition.ToString()); }, DicomDataFormatHelper.RawStringFormat ) ); _annotationItems.Add ( new DicomAnnotationItem <string> ( "Dicom.GeneralImage.ImageType", resolver, delegate(Frame frame) { return(frame.ImageType); }, DicomDataFormatHelper.RawStringFormat ) ); _annotationItems.Add(new InstanceNumberAnnotationItem()); _annotationItems.Add ( new LossyImagePresentationAnnotationItem ( "Dicom.GeneralImage.LossyImageCompression", resolver ) ); _annotationItems.Add ( new DicomAnnotationItem <string> ( "Dicom.GeneralImage.QualityControlImage", resolver, FrameDataRetrieverFactory.GetStringRetriever(DicomTags.QualityControlImage), DicomDataFormatHelper.BooleanFormatter ) ); _annotationItems.Add ( new LateralityViewPositionAnnotationItem ( "Dicom.GeneralImage.ViewPosition", false, true ) ); _annotationItems.Add ( new LateralityViewPositionAnnotationItem ( "Dicom.GeneralImage.ImageLaterality", true, false ) ); _annotationItems.Add ( new LateralityViewPositionAnnotationItem ( "Dicom.GeneralImage.Composite.LateralityViewPosition", true, true ) ); }
public GeneralEquipmentAnnotationItemProvider() : base("AnnotationItemProviders.Dicom.GeneralEquipment", new AnnotationResourceResolver(typeof(GeneralEquipmentAnnotationItemProvider).Assembly)) { _annotationItems = new List <IAnnotationItem>(); AnnotationResourceResolver resolver = new AnnotationResourceResolver(this); _annotationItems.Add ( new DicomAnnotationItem <string> ( "Dicom.GeneralEquipment.DateOfLastCalibration", resolver, FrameDataRetrieverFactory.GetStringRetriever(DicomTags.DateOfLastCalibration), DicomDataFormatHelper.DateFormat ) ); _annotationItems.Add ( new DicomAnnotationItem <string> ( "Dicom.GeneralEquipment.TimeOfLastCalibration", resolver, FrameDataRetrieverFactory.GetStringRetriever(DicomTags.TimeOfLastCalibration), DicomDataFormatHelper.TimeFormat ) ); _annotationItems.Add ( new DicomAnnotationItem <string> ( "Dicom.GeneralEquipment.DeviceSerialNumber", resolver, FrameDataRetrieverFactory.GetStringRetriever(DicomTags.DeviceSerialNumber), DicomDataFormatHelper.RawStringFormat ) ); _annotationItems.Add ( new DicomAnnotationItem <string> ( "Dicom.GeneralEquipment.InstitutionAddress", resolver, FrameDataRetrieverFactory.GetStringRetriever(DicomTags.InstitutionAddress), SingleLineStringFormat ) ); _annotationItems.Add ( new DicomAnnotationItem <string> ( "Dicom.GeneralEquipment.InstitutionalDepartmentName", resolver, delegate(Frame frame) { return(frame.ParentImageSop.InstitutionalDepartmentName); }, SingleLineStringFormat ) ); _annotationItems.Add ( new DicomAnnotationItem <string> ( "Dicom.GeneralEquipment.InstitutionName", resolver, delegate(Frame frame) { return(frame.ParentImageSop.InstitutionName); }, SingleLineStringFormat ) ); _annotationItems.Add ( new DicomAnnotationItem <string> ( "Dicom.GeneralEquipment.Manufacturer", resolver, delegate(Frame frame) { return(frame.ParentImageSop.Manufacturer); }, DicomDataFormatHelper.RawStringFormat ) ); _annotationItems.Add ( new DicomAnnotationItem <string> ( "Dicom.GeneralEquipment.ManufacturersModelName", resolver, delegate(Frame frame) { return(frame.ParentImageSop.ManufacturersModelName); }, DicomDataFormatHelper.RawStringFormat ) ); _annotationItems.Add ( new DicomAnnotationItem <string> ( "Dicom.GeneralEquipment.StationName", resolver, delegate(Frame frame) { return(frame.ParentImageSop.StationName); }, DicomDataFormatHelper.RawStringFormat ) ); _annotationItems.Add ( new DicomAnnotationItem <string[]> ( "Dicom.GeneralEquipment.SoftwareVersions", resolver, FrameDataRetrieverFactory.GetStringArrayRetriever(DicomTags.SoftwareVersions), DicomDataFormatHelper.StringListFormat ) ); }
public PatientStudyAnnotationItemProvider() : base("AnnotationItemProviders.Dicom.PatientStudy", new AnnotationResourceResolver(typeof(PatientStudyAnnotationItemProvider).Assembly)) { _annotationItems = new List <IAnnotationItem>(); AnnotationResourceResolver resolver = new AnnotationResourceResolver(this); _annotationItems.Add ( new DicomAnnotationItem <string> ( "Dicom.PatientStudy.AdditionalPatientsHistory", resolver, delegate(Frame frame) { return(frame.ParentImageSop.AdditionalPatientsHistory); }, DicomDataFormatHelper.RawStringFormat ) ); _annotationItems.Add ( new DicomAnnotationItem <string> ( "Dicom.PatientStudy.Occupation", resolver, FrameDataRetrieverFactory.GetStringRetriever(DicomTags.Occupation), DicomDataFormatHelper.RawStringFormat ) ); _annotationItems.Add ( new DicomAnnotationItem <string> ( "Dicom.PatientStudy.PatientsAge", resolver, FrameDataRetrieverFactory.GetStringRetriever(DicomTags.PatientsAge), DicomDataFormatHelper.RawStringFormat ) ); _annotationItems.Add ( new DicomAnnotationItem <double> ( "Dicom.PatientStudy.PatientsSize", resolver, FrameDataRetrieverFactory.GetDoubleRetriever(DicomTags.PatientsSize), delegate(double input) { if (double.IsNaN(input) || input == 0) { return(""); } return(String.Format(SR.FormatMeters, input.ToString("F2"))); } ) ); _annotationItems.Add ( new DicomAnnotationItem <double> ( "Dicom.PatientStudy.PatientsWeight", resolver, FrameDataRetrieverFactory.GetDoubleRetriever(DicomTags.PatientsWeight), delegate(double input) { if (double.IsNaN(input) || input == 0) { return(""); } return(String.Format(SR.FormatKilograms, input.ToString("F2"))); } ) ); _annotationItems.Add ( new DicomAnnotationItem <string> ( "Dicom.PatientStudy.Composite.PatientsAgeSex", resolver, delegate(Frame frame) { var components = new List <string>(); if (!string.IsNullOrEmpty(frame.ParentImageSop.PatientsAge)) { components.Add(frame.ParentImageSop.PatientsAge); } if (!string.IsNullOrEmpty(frame.ParentImageSop.PatientsSex)) { components.Add(frame.ParentImageSop.PatientsSex); } return(string.Join(SR.SeparatorAgeSexBirthDate, components.ToArray())); }, DicomDataFormatHelper.RawStringFormat ) ); _annotationItems.Add ( new DicomAnnotationItem <string> ( "Dicom.PatientStudy.Composite.PatientsAgeSexBirthDate", resolver, delegate(Frame frame) { var components = new List <string>(); if (!string.IsNullOrEmpty(frame.ParentImageSop.PatientsAge)) { components.Add(frame.ParentImageSop.PatientsAge); } if (!string.IsNullOrEmpty(frame.ParentImageSop.PatientsSex)) { components.Add(frame.ParentImageSop.PatientsSex); } //luojiang //if (!string.IsNullOrEmpty(frame.ParentImageSop.PatientsBirthDate)) components.Add(DicomDataFormatHelper.DateFormat(frame.ParentImageSop.PatientsBirthDate)); return(string.Join(SR.SeparatorAgeSexBirthDate, components.ToArray())); }, DicomDataFormatHelper.RawStringFormat ) ); }
public GeneralSeriesAnnotationItemProvider() : base("AnnotationItemProviders.Dicom.GeneralSeries", new AnnotationResourceResolver(typeof(GeneralSeriesAnnotationItemProvider).Assembly)) { _annotationItems = new List <IAnnotationItem>(); AnnotationResourceResolver resolver = new AnnotationResourceResolver(this); _annotationItems.Add ( new DicomAnnotationItem <string> ( "Dicom.GeneralSeries.BodyPartExamined", resolver, delegate(Frame frame) { return(frame.ParentImageSop.BodyPartExamined); }, DicomDataFormatHelper.RawStringFormat ) ); _annotationItems.Add ( new DicomAnnotationItem <string> ( "Dicom.GeneralSeries.Laterality", resolver, delegate(Frame frame) { return(frame.ParentImageSop.Laterality); }, DicomDataFormatHelper.RawStringFormat ) ); _annotationItems.Add ( new DicomAnnotationItem <string> ( "Dicom.GeneralSeries.Modality", resolver, delegate(Frame frame) { return(frame.ParentImageSop.Modality); }, DicomDataFormatHelper.RawStringFormat ) ); _annotationItems.Add ( new DicomAnnotationItem <PersonName[]> ( "Dicom.GeneralSeries.OperatorsName", resolver, delegate(Frame frame) { return(frame.ParentImageSop.OperatorsName); }, DicomDataFormatHelper.PersonNameListFormatter ) ); _annotationItems.Add ( new DicomAnnotationItem <string> ( "Dicom.GeneralSeries.PerformedProcedureStepDescription", resolver, FrameDataRetrieverFactory.GetStringRetriever(DicomTags.PerformedProcedureStepDescription), DicomDataFormatHelper.RawStringFormat ) ); _annotationItems.Add ( new DicomAnnotationItem <PersonName[]> ( "Dicom.GeneralSeries.PerformingPhysiciansName", resolver, delegate(Frame frame) { return(frame.ParentImageSop.PerformingPhysiciansName); }, DicomDataFormatHelper.PersonNameListFormatter ) ); _annotationItems.Add ( new DicomAnnotationItem <string> ( "Dicom.GeneralSeries.ProtocolName", resolver, FrameDataRetrieverFactory.GetStringRetriever(DicomTags.ProtocolName), DicomDataFormatHelper.RawStringFormat ) ); _annotationItems.Add ( new DicomAnnotationItem <string> ( "Dicom.GeneralSeries.SeriesDate", resolver, delegate(Frame frame) { return(frame.ParentImageSop.SeriesDate); }, DicomDataFormatHelper.DateFormat ) ); _annotationItems.Add ( new DicomAnnotationItem <string> ( "Dicom.GeneralSeries.SeriesTime", resolver, delegate(Frame frame) { return(frame.ParentImageSop.SeriesTime); }, DicomDataFormatHelper.TimeFormat ) ); _annotationItems.Add ( new DicomAnnotationItem <string> ( "Dicom.GeneralSeries.SeriesDescription", resolver, delegate(Frame frame) { return(frame.ParentImageSop.SeriesDescription); }, DicomDataFormatHelper.RawStringFormat ) ); _annotationItems.Add ( new DicomAnnotationItem <string> ( "Dicom.GeneralSeries.SeriesNumber", resolver, delegate(Frame frame) { if (frame.ParentImageSop.ParentSeries != null) { return(String.Format(SR.FormatSeriesNumberAndCount, frame.ParentImageSop.SeriesNumber, frame.ParentImageSop.ParentSeries.ParentStudy.Series.Count)); } else { return(frame.ParentImageSop.SeriesNumber.ToString()); } }, DicomDataFormatHelper.RawStringFormat ) ); }
public PatientAnnotationItemProvider() : base("AnnotationItemProviders.Dicom.Patient", new AnnotationResourceResolver(typeof(PatientAnnotationItemProvider).Assembly)) { _annotationItems = new List <IAnnotationItem>(); AnnotationResourceResolver resolver = new AnnotationResourceResolver(this); _annotationItems.Add ( new DicomAnnotationItem <string> ( "Dicom.Patient.EthnicGroup", resolver, FrameDataRetrieverFactory.GetStringRetriever(DicomTags.EthnicGroup), DicomDataFormatHelper.RawStringFormat ) ); _annotationItems.Add ( new DicomAnnotationItem <string> ( "Dicom.Patient.PatientComments", resolver, FrameDataRetrieverFactory.GetStringRetriever(DicomTags.PatientComments), DicomDataFormatHelper.RawStringFormat ) ); _annotationItems.Add ( new DicomAnnotationItem <string> ( "Dicom.Patient.PatientId", resolver, delegate(Frame frame) { return(frame.ParentImageSop.PatientId); }, DicomDataFormatHelper.RawStringFormat ) ); _annotationItems.Add ( new DicomAnnotationItem <string> ( "Dicom.Patient.PatientsBirthDate", resolver, delegate(Frame frame) { return(frame.ParentImageSop.PatientsBirthDate); }, DicomDataFormatHelper.DateFormat ) ); _annotationItems.Add ( new DicomAnnotationItem <string> ( "Dicom.Patient.PatientsBirthTime", resolver, FrameDataRetrieverFactory.GetStringRetriever(DicomTags.PatientsBirthTime), DicomDataFormatHelper.TimeFormat ) ); _annotationItems.Add ( new DicomAnnotationItem <PersonName> ( "Dicom.Patient.PatientsName", resolver, delegate(Frame frame) { return(frame.ParentImageSop.PatientsName); }, DicomDataFormatHelper.PersonNameFormatter ) ); _annotationItems.Add ( new DicomAnnotationItem <string> ( "Dicom.Patient.PatientsSex", resolver, delegate(Frame frame) { return(frame.ParentImageSop.PatientsSex); }, DicomDataFormatHelper.RawStringFormat ) ); _annotationItems.Add ( new DicomAnnotationItem <PersonName> ( "Dicom.Patient.ResponsiblePerson", resolver, delegate(Frame frame) { return(frame.ParentImageSop.ResponsiblePerson); }, DicomDataFormatHelper.PersonNameFormatter ) ); _annotationItems.Add ( new DicomAnnotationItem <string> ( "Dicom.Patient.ResponsibleOrganization", resolver, delegate(Frame frame) { return(frame.ParentImageSop.ResponsibleOrganization); }, DicomDataFormatHelper.RawStringFormat ) ); _annotationItems.Add ( new CodeSequenceAnnotationItem ( "Dicom.Patient.PatientSpecies", resolver, DicomTags.PatientSpeciesCodeSequence, DicomTags.PatientSpeciesDescription ) ); _annotationItems.Add ( new CodeSequenceAnnotationItem ( "Dicom.Patient.PatientBreed", resolver, DicomTags.PatientBreedCodeSequence, DicomTags.PatientBreedDescription ) ); }
public PatientAnnotationItemProvider() : base("AnnotationItemProviders.Dicom.Patient", new AnnotationResourceResolver(typeof(PatientAnnotationItemProvider).Assembly)) { _annotationItems = new List <IAnnotationItem>(); AnnotationResourceResolver resolver = new AnnotationResourceResolver(this); _annotationItems.Add ( new DicomAnnotationItem <string> ( "Dicom.Patient.EthnicGroup", resolver, FrameDataRetrieverFactory.GetStringRetriever(DicomTags.EthnicGroup), DicomDataFormatHelper.RawStringFormat ) ); _annotationItems.Add ( new DicomAnnotationItem <string> ( "Dicom.Patient.PatientComments", resolver, FrameDataRetrieverFactory.GetStringRetriever(DicomTags.PatientComments), DicomDataFormatHelper.RawStringFormat ) ); _annotationItems.Add ( new DicomAnnotationItem <string> ( "Dicom.Patient.PatientId", resolver, delegate(Frame frame) { return(frame.ParentImageSop.PatientId); }, DicomDataFormatHelper.RawStringFormat ) ); _annotationItems.Add ( new DicomAnnotationItem <string> ( "Dicom.Patient.OtherPatientIds", resolver, delegate(Frame frame) { var patientIds = new List <string>(); DicomAttribute attribute; if (frame.ParentImageSop.TryGetAttribute(DicomTags.OtherPatientIds, out attribute)) { patientIds.AddRange(DicomStringHelper.GetStringArray(attribute)); } if (frame.ParentImageSop.TryGetAttribute(DicomTags.OtherPatientIdsSequence, out attribute) && !attribute.IsEmpty && !attribute.IsNull) { var sqAttr = (DicomAttributeSQ)attribute; for (var i = 0; i < sqAttr.Count; i++) { var attr = sqAttr[i][DicomTags.PatientId]; if (attr != null && !string.IsNullOrEmpty(attr)) { patientIds.Add(attr); } } } return(DicomStringHelper.GetDicomStringArray(patientIds.Distinct())); }, DicomDataFormatHelper.RawStringFormat ) ); _annotationItems.Add ( new DicomAnnotationItem <string> ( "Dicom.Patient.PatientsBirthDate", resolver, delegate(Frame frame) { return(frame.ParentImageSop.PatientsBirthDate); }, DicomDataFormatHelper.DateFormat ) ); _annotationItems.Add ( new DicomAnnotationItem <string> ( "Dicom.Patient.PatientsBirthTime", resolver, FrameDataRetrieverFactory.GetStringRetriever(DicomTags.PatientsBirthTime), DicomDataFormatHelper.TimeFormat ) ); _annotationItems.Add ( new DicomAnnotationItem <PersonName> ( "Dicom.Patient.PatientsName", resolver, delegate(Frame frame) { return(frame.ParentImageSop.PatientsName); }, DicomDataFormatHelper.PersonNameFormatter ) ); _annotationItems.Add ( new DicomAnnotationItem <string> ( "Dicom.Patient.PatientsSex", resolver, delegate(Frame frame) { return(frame.ParentImageSop.PatientsSex); }, DicomDataFormatHelper.RawStringFormat ) ); _annotationItems.Add ( new DicomAnnotationItem <PersonName> ( "Dicom.Patient.ResponsiblePerson", resolver, delegate(Frame frame) { return(frame.ParentImageSop.ResponsiblePerson); }, DicomDataFormatHelper.PersonNameFormatter ) ); _annotationItems.Add ( new DicomAnnotationItem <string> ( "Dicom.Patient.ResponsibleOrganization", resolver, delegate(Frame frame) { return(frame.ParentImageSop.ResponsibleOrganization); }, DicomDataFormatHelper.RawStringFormat ) ); _annotationItems.Add ( new CodeSequenceAnnotationItem ( "Dicom.Patient.PatientSpecies", resolver, DicomTags.PatientSpeciesCodeSequence, DicomTags.PatientSpeciesDescription ) ); _annotationItems.Add ( new CodeSequenceAnnotationItem ( "Dicom.Patient.PatientBreed", resolver, DicomTags.PatientBreedCodeSequence, DicomTags.PatientBreedDescription ) ); }