示例#1
0
        /// <summary>
        /// Find study series (only one) that match the selection critera and add details to the study
        /// </summary>
        /// <param name="study"></param>
        /// <param name="criteria"></param>
        /// <param name="localNode"></param>
        /// <param name="sourceNode"></param>
        /// <returns></returns>
        private IDicomStudy AddMatchingSeriesToStudy(
            IDicomStudy study, IEnumerable <SeriesSelectionCriteria> criteria, DicomService dicomSource)
        {
            var allSeries = dicomSource.GetSeriesForStudy(study.StudyInstanceUid);
            var criterion = criteria.FirstOrDefault(c => !string.IsNullOrEmpty(c.SeriesDescription));

            if (criterion == null)
            {
                study.Series.ToList().AddRange(allSeries);
            }
            else
            {
                var matchedSeries = allSeries.FirstOrDefault(series =>
                                                             _valueComparer.CompareStrings(
                                                                 series.SeriesDescription, criterion.SeriesDescription,
                                                                 criterion.SeriesDescriptionOperand, criterion.SeriesDescriptionDelimiter));

                if (matchedSeries != null)
                {
                    study.Series.Add(matchedSeries);
                }
            }

            return(study);
        }
示例#2
0
        private string SaveDicomFilesToFilesystem(
            IDicomStudy dicomStudy, string jobProcessingFolder, string studyName, DicomService dicomSource)
        {
            var series = dicomStudy.Series.FirstOrDefault();

            var folderPath = Path.GetFullPath(Path.Combine(jobProcessingFolder, studyName, Dicom));

            dicomSource.SaveSeriesToLocalDisk(series, folderPath);

            CopyDicomFilesToRootFolder(folderPath);

            return(Path.GetFullPath(folderPath));
        }