Exemplo n.º 1
0
        public void PerformCanTranscode(string name)
        {
            const BindingFlags binding = BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy;
            var ts = (DicomTransferSyntax)typeof(DicomTransferSyntax).GetField(name, binding).GetValue(0);

            Assert.IsTrue(TranscoderManager.CanTranscode(DicomTransferSyntax.ExplicitVRLittleEndian, ts));
            Assert.IsTrue(TranscoderManager.CanTranscode(ts, DicomTransferSyntax.ExplicitVRLittleEndian));
        }
Exemplo n.º 2
0
        public Transcoder(RecyclableMemoryStreamManager recyclableMemoryStreamManager, ILogger <Transcoder> logger)
        {
            EnsureArg.IsNotNull(recyclableMemoryStreamManager, nameof(recyclableMemoryStreamManager));
            EnsureArg.IsNotNull(logger, nameof(logger));
            _recyclableMemoryStreamManager = recyclableMemoryStreamManager;
            _logger = logger;

            // Use Efferent transcoder
            TranscoderManager.SetImplementation(new NativeTranscoderManager());
        }
Exemplo n.º 3
0
        /// <summary>
        /// Registers DICOM implementations
        /// </summary>
        static void RegisterDicomImplementations()
        {
            // Register the custom JPEG-LS decoders
            TranscoderManager.SetImplementation(DicomJpegLsTranscoderManager.Instance);

            // Register the default desktop IO implementation
            IOManager.SetImplementation(DesktopIOManager.Instance);

            // Register the NLog-based logging implementation
            Dicom.Log.LogManager.SetImplementation(NLogManager.Instance);
        }
Exemplo n.º 4
0
        public void Clone_DeflateFile_NewTransferSyntaxPixelDataMaintained()
        {
            var deflated = DicomFile.Open(@"Test Data\GH227.dcm");

            Assert.True(TranscoderManager.CanTranscode(DicomTransferSyntax.DeflatedExplicitVRLittleEndian,
                                                       DicomTransferSyntax.ExplicitVRLittleEndian));

            var clone = deflated.Clone(DicomTransferSyntax.ExplicitVRLittleEndian);

            Assert.True(clone.Dataset.Contains(DicomTag.PixelData));
        }
Exemplo n.º 5
0
        static void Main(string[] args)
        {
            TranscoderManager.SetImplementation(new Efferent.Native.Codec.NativeTranscoderManager());

            var path = @"1.3.6.1.4.1.41327.1412220253660.4803989431405291768.dcm";

            var dcm           = DicomFile.Open(path);
            var convertedFile = dcm.Clone(DicomTransferSyntax.DeflatedExplicitVRLittleEndian);
            var pixelData     = convertedFile.Dataset.GetValues <byte>(DicomTag.PixelData);

            Console.ReadKey();
        }
Exemplo n.º 6
0
        public static void Initialization(TestContext context)
        {
            TranscoderManager.SetImplementation(new Efferent.Native.Codec.NativeTranscoderManager());
            resultsPerform = new string[filenames.Length][];
            resultsInverse = new string[filenames.Length][];

            for (int i = 0; i < filenames.Length; i++)
            {
                resultsPerform[i] = new string[transferSyntaxes.Length];
                resultsInverse[i] = new string[transferSyntaxes.Length];
            }

            Directory.CreateDirectory("out");
        }
Exemplo n.º 7
0
 public void Initialization()
 {
     TranscoderManager.SetImplementation(new Efferent.Native.Codec.NativeTranscoderManager());
 }
 /// <summary>
 /// Initializes the static fields of <see cref="DicomJpegLsTranscoderManager"/>
 /// </summary>
 static DicomJpegLsTranscoderManager()
 {
     Instance = new DicomJpegLsTranscoderManager();
 }
        public void Initialization()
        {
            TranscoderManager.SetImplementation(new Efferent.Native.Codec.NativeTranscoderManager());

            Directory.CreateDirectory("out");
        }
 /// <summary>
 /// Initializes the static fields of <see cref="NativeTranscodeManager"/>.
 /// </summary>
 static NativeTranscoderManager()
 {
     Instance = new NativeTranscoderManager();
 }