Ejemplo n.º 1
0
 /// <summary>
 /// Initializes new Basic Film Box
 /// </summary>
 /// <param name="session">Basic Film Session</param>
 /// <param name="sopInstance">SOP Instance UID</param>
 public DcmFilmBox(DcmFilmSession session, DicomUID sopInstance)
 {
     _session = session;
     _sopInstance = sopInstance;
     _dataset = new DcmDataset(DicomTransferSyntax.ImplicitVRLittleEndian);
     _boxes = new List<DcmImageBox>();
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes new Basic Film Box
 /// </summary>
 /// <param name="session">Basic Film Session</param>
 /// <param name="sopInstance">SOP Instance UID</param>
 /// <param name="dataset">Dataset</param>
 public DcmFilmBox(DcmFilmSession session, DicomUID sopInstance, DcmDataset dataset)
 {
     _session = session;
     _sopInstance = sopInstance;
     _dataset = dataset;
     _boxes = new List<DcmImageBox>();
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Initializes new Basic Film Box
 /// </summary>
 /// <param name="session">Basic Film Session</param>
 /// <param name="sopInstance">SOP Instance UID</param>
 /// <param name="dataset">Dataset</param>
 public DcmFilmBox(DcmFilmSession session, DicomUID sopInstance, DcmDataset dataset)
 {
     _session     = session;
     _sopInstance = sopInstance;
     _dataset     = dataset;
     _boxes       = new List <DcmImageBox>();
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Initializes new Basic Film Box
 /// </summary>
 /// <param name="session">Basic Film Session</param>
 /// <param name="sopInstance">SOP Instance UID</param>
 public DcmFilmBox(DcmFilmSession session, DicomUID sopInstance)
 {
     _session     = session;
     _sopInstance = sopInstance;
     _dataset     = new DcmDataset(DicomTransferSyntax.ImplicitVRLittleEndian);
     _boxes       = new List <DcmImageBox>();
 }
Ejemplo n.º 5
0
        protected override void OnReceiveNDeleteRequest(byte presentationID, ushort messageID,
                                                        DicomUID requestedClass, DicomUID requestedInstance)
        {
            if (requestedClass == DicomUID.BasicFilmSessionSOPClass)
            {
                if (_session == null)
                {
                    Log.Error("{0} -> A Basic Film Session does not exist for this association", LogID);
                    SendAbort(DcmAbortSource.ServiceProvider, DcmAbortReason.NotSpecified);
                    return;
                }

                _session = null;

                SendNDeleteResponse(presentationID, messageID, requestedClass, requestedInstance, DcmStatus.Success);
                return;
            }

            if (requestedClass == DicomUID.BasicFilmBoxSOPClass)
            {
                if (_session == null)
                {
                    Log.Error("{0} -> A Basic Film Session does not exist for this association", LogID);
                    SendAbort(DcmAbortSource.ServiceProvider, DcmAbortReason.NotSpecified);
                    return;
                }

                _session.DeleteFilmBox(requestedInstance);

                SendNDeleteResponse(presentationID, messageID, requestedClass, requestedInstance, DcmStatus.Success);
                return;
            }

            SendAbort(DcmAbortSource.ServiceProvider, DcmAbortReason.NotSpecified);
        }
Ejemplo n.º 6
0
        protected override void OnReceiveNCreateRequest(byte presentationID, ushort messageID,
                                                        DicomUID affectedClass, DicomUID affectedInstance, DcmDataset dataset)
        {
            DicomUID sopClass = Associate.GetAbstractSyntax(presentationID);

            if (affectedClass == DicomUID.BasicFilmSessionSOPClass)
            {
                if (_session != null)
                {
                    Log.Error("{0} -> Attempted to create second Basic Film Session on association", LogID);
                    SendAbort(DcmAbortSource.ServiceProvider, DcmAbortReason.NotSpecified);
                    return;
                }

                _session = new DcmFilmSession(sopClass, affectedInstance, dataset);

                SendNCreateResponse(presentationID, messageID, affectedClass, _session.SOPInstanceUID, null, DcmStatus.Success);
                return;
            }

            if (affectedClass == DicomUID.BasicFilmBoxSOPClass)
            {
                if (_session == null)
                {
                    Log.Error("{0} -> A Basic Film Session does not exist for this association", LogID);
                    SendAbort(DcmAbortSource.ServiceProvider, DcmAbortReason.NotSpecified);
                    return;
                }

                DcmFilmBox box = _session.CreateFilmBox(affectedInstance, dataset);
                if (!box.Initialize())
                {
                    SendAbort(DcmAbortSource.ServiceProvider, DcmAbortReason.NotSpecified);
                    return;
                }

                SendNCreateResponse(presentationID, messageID, affectedClass, box.SOPInstanceUID, dataset, DcmStatus.Success);
                return;
            }

            SendAbort(DcmAbortSource.ServiceProvider, DcmAbortReason.NotSpecified);
        }
Ejemplo n.º 7
0
        protected override void OnReceiveNDeleteRequest(byte presentationID, ushort messageID, 
            DicomUID requestedClass, DicomUID requestedInstance)
        {
            if (requestedClass == DicomUID.BasicFilmSessionSOPClass) {
                if (_session == null) {
                    Log.Error("{0} -> A Basic Film Session does not exist for this association", LogID);
                    SendAbort(DcmAbortSource.ServiceProvider, DcmAbortReason.NotSpecified);
                    return;
                }

                _session = null;

                SendNDeleteResponse(presentationID, messageID, requestedClass, requestedInstance, DcmStatus.Success);
                return;
            }

            if (requestedClass == DicomUID.BasicFilmBoxSOPClass) {
                if (_session == null) {
                    Log.Error("{0} -> A Basic Film Session does not exist for this association", LogID);
                    SendAbort(DcmAbortSource.ServiceProvider, DcmAbortReason.NotSpecified);
                    return;
                }

                _session.DeleteFilmBox(requestedInstance);

                SendNDeleteResponse(presentationID, messageID, requestedClass, requestedInstance, DcmStatus.Success);
                return;
            }

            SendAbort(DcmAbortSource.ServiceProvider, DcmAbortReason.NotSpecified);
        }
Ejemplo n.º 8
0
        protected override void OnReceiveNCreateRequest(byte presentationID, ushort messageID, 
            DicomUID affectedClass, DicomUID affectedInstance, DcmDataset dataset)
        {
            DicomUID sopClass = Associate.GetAbstractSyntax(presentationID);

            if (affectedClass == DicomUID.BasicFilmSessionSOPClass) {
                if (_session != null) {
                    Log.Error("{0} -> Attempted to create second Basic Film Session on association", LogID);
                    SendAbort(DcmAbortSource.ServiceProvider, DcmAbortReason.NotSpecified);
                    return;
                }

                _session = new DcmFilmSession(sopClass, affectedInstance, dataset);

                SendNCreateResponse(presentationID, messageID, affectedClass, _session.SOPInstanceUID, null, DcmStatus.Success);
                return;
            }

            if (affectedClass == DicomUID.BasicFilmBoxSOPClass) {
                if (_session == null) {
                    Log.Error("{0} -> A Basic Film Session does not exist for this association", LogID);
                    SendAbort(DcmAbortSource.ServiceProvider, DcmAbortReason.NotSpecified);
                    return;
                }

                DcmFilmBox box = _session.CreateFilmBox(affectedInstance, dataset);
                if (!box.Initialize()) {
                    SendAbort(DcmAbortSource.ServiceProvider, DcmAbortReason.NotSpecified);
                    return;
                }

                SendNCreateResponse(presentationID, messageID, affectedClass, box.SOPInstanceUID, dataset, DcmStatus.Success);
                return;
            }

            SendAbort(DcmAbortSource.ServiceProvider, DcmAbortReason.NotSpecified);
        }
Ejemplo n.º 9
0
 public DcmPrintDocument(DicomPrintConfig config, DcmFilmSession session)
 {
     _session = session;
     _config = config;
     _filmBoxes = new List<DcmFilmBox>();
 }
Ejemplo n.º 10
0
 public DcmPrintDocument(DicomPrintConfig config, DcmFilmSession session)
 {
     _session   = session;
     _config    = config;
     _filmBoxes = new List <DcmFilmBox>();
 }