예제 #1
0
        public static DicomFile CreateRandomDicomFileWithInvalidVr(
            string studyInstanceUid  = null,
            string seriesInstanceUid = null,
            string sopInstanceUid    = null)
        {
            var file = new DicomFile(CreateRandomInstanceDataset(studyInstanceUid, seriesInstanceUid, sopInstanceUid));

            DicomValidationBuilderExtension.SkipValidation(null);

            file.Dataset.Add(GenerateNewDataSetWithInvalidVr());

            DicomValidationBuilderExtension.DoValidation(null);

            return(file);
        }
예제 #2
0
        public static IServiceCollection AddFellowOakDicomServices(this IServiceCollection services, bool skipValidation = false)
        {
            if (skipValidation)
            {
                // Note: this is an extension method, but it isn't stateful.
                // Instead it modifies a static property, so we'll change the invocation to look more appropriate
                DicomValidationBuilderExtension.SkipValidation(null);
            }

            services
            .AddFellowOakDicom()
            .AddTranscoderManager <NativeTranscoderManager>()
            .AddLogManager <FellowOakDecoratorLogManager>();

            return(services);
        }