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); }
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); }