Beispiel #1
0
 public DicomFileEqualityComparer(IEnumerable <DicomTag> ignoredTags)
 {
     EnsureArg.IsNotNull(ignoredTags, nameof(ignoredTags));
     _ignoredTags      = ignoredTags;
     _metadataComparer = new DicomItemCollectionEqualityComparer(_ignoredTags);
     _datasetComparer  = new DicomDatasetEqualityComparer(_ignoredTags);
 }
Beispiel #2
0
        bool IEqualityComparer <DicomFile> .Equals(DicomFile x, DicomFile y)
        {
            if (x == null || y == null)
            {
                return(object.ReferenceEquals(x, y));
            }

            IEqualityComparer <IEnumerable <DicomItem> > metadataComparer = new DicomItemCollectionEqualityComparer();

            if (!metadataComparer.Equals(x.FileMetaInfo, y.FileMetaInfo))
            {
                return(false);
            }

            IEqualityComparer <DicomDataset> dataSetComparer = new DicomDatasetEqualityComparer();

            return(dataSetComparer.Equals(x.Dataset, y.Dataset));
        }