Home
User`s Manual V5.1
Contents
1. ccecccceseeeeeeeeeeeeeeseaeeeeeeeeeneeeees 69 Preparing a Proposed Context List 0 ccceccceceeeeeeseeeeeeeseeeeeseaeeesaeeeeneeeaas 69 Using a Pre configured Proposed Context List cc ceccsseeeeessteeeeeesneeeeee 69 Creating Your Own Proposed Context LiSt 0 cccccccccesseeeseeseeeesssteeeessssaees 69 Using a Pre configured Transfer Syntax LiSt 0 cccceeseeeeeeeeeeeeeeseeeeeeeees 69 Creating Your Own Transfer Syntax LiSt cccccseeeeesceseeeeeceeeeeeeeeeeeeeeeeaees 70 Creating Your Own Proposed Context LiSt 0 ccccesceeeeeeeseeeeeeseeeeeeesaees 70 MCproposedContext properties cccccsceceeececeeeeeeeeeeeeeeeseeeeesaeeneeeeeeneess 70 MCproposedContextList properties c ccceecceceeeeeeeeeeeeeeeseeeeeseaeeeeeeeeeeeess 71 MCresultContext properties cecccccceeeeeeceeeeeceeeeeeeeeeeeeeeseaeeesaeeseaeeseeeees 72 MCtransferSyntax properties ccccccccceeeesceceeeeeeeeeeeeaeeeeeeeseteeesaeeseeeseeeeess 72 MCtransferSyntaxList properties c cecsceceeceeceeeeeeeeeeeeeeeseaeeeseaeeseeeeeeeeess 73 Using Extended Negotiation Information c cccccessceeeeseeeeeeeeeeeneeeeeeees 73 Starting an Association Requester ccccccceeeeeeeeceeseeceeeeeseaeeeeaeeeeneeeeaees 74 innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual Starting an Association ACCEptor cccccceccceceeeeeeeeeeeeeseeeeeseaeeesaeeeeneeeeae
2. 3 commands are referred to as DIMSE Services in the DICOM Standard innovative maging NET C User s Manual Merge DICOM Toolkit V 5 1 0 DICOM Commands Description C ECHO Verify end to end communications with a remote AE N EVENT REPORT Report an event to a remote AE N GET Retrieve attribute values from a remote AE Where your application These DICOM commands can be thought of as primitives that every networking takes over service is built from In the context of a particular Service these primitive actions translate to explicit real world activities on the part of an Application Entity Hence DICOM places requirements on an application implementing a DICOM service DICOM is careful to only express high level operational requirements and leaves the creative detail and look and feel of the application entity to the developer Request vs response For every command there is both a request and a response A command request indicates that a command should be performed and is usually sent to an SCP A command response indicates whether a command completed or its state of completion and is usually returned to an SCU Example request commands are C STORE RQ N GET RQ and N SET RQ Example response commands are C STORE RSP N GET RSP and N SET RSP IMPORTANT It is important to note that this service definition level is where the Merge DICOM Toolkit Library leaves off and your Application begins While Merge DICOM
3. Accept or Reject if lt the services negotiated are acceptable gt assoc accept else assoc reject catch MCassociationAbortedException e If you are rejecting the association DICOM allows you to specify the reason you are rejecting and what type of rejection it is If you specify no parameters to the reject method as in the example above it is assumed that the reject is permanent i e there is no need for the remote application to call later and no reason is provided If you wish to give a reason use this form of the reject method bool permanentReject false assoc reject permanentReject MCrejectReason TEMPORARY_CONGESTION The reason codes are defined in the MCrejectReason enumerated value These codes are available MCrejectReason NO_REASON_GIVEN MCrejectReason APPLICATION_CONTEXT_NAME_IS_NOT_SUPPORTED MCrejectReason CALLING_AF_TITLE_NOT_RECOGNIZED MCrejectReason CALLED_AE_ TITLE_NOT_RECOGNIZED MCrejectReason TEMPORARY_CONGESTION MCrejectReason LOCAL_LIMIT_EXCEEDED Requestor reacts The association requestor normally the client application must check for association rejection when it makes the association request Other exceptions also need to be checked please see to the MCaassocition class in the Assembly Windows Help File try innovative imaging NET C User s Manu
4. NET C User s Manual Merge DICOM Toolkit v 5 1 0 Service Class McstudyContentNotification s Study Content Service Notification Patient Management MCpatientManagement Service MCstudyManagement Service Study Management MCresultsManagement Results Service Management Services Printer Configuration Print Queue Management Pull Print Request Printer Referenced Image Box VOI LUT Box Presentation LUT Basic Annotation Box Basic Print Image Overlay Box SOP Class Print Job Image Overlay Retired Basic Grayscale Print Mgmt Meta Basic Color Print Mgmt Meta Pull Stored Print Mgmt Meta Ref Grayscale Print Mgmt Meta Ref Color Print Mgmt Meta Basic Study Content Notification Detached Patient Management Detached Visit Management Detached Patient Mgmt Meta Detached Study Management Study Component Management Modality Performed Procedure Step Modality Performed Procedure Step Notification Modality Performed Procedure Step Retrieve Detached Results Management Detached Interpretation Management Detached Results Mgmt Meta Information Model DICOM information model Description data to interchangeable media Allows one DICOM AE to notify another DICOM AE of the existence contents and source location of the images of a study Creation and tracking of the subset of patient and patient visit information that is required to aid in the management of
5. eiescesceeeeeeeeeeeeseneeeneesneeeneeenaee 183 IMCDicomRenderer Interface and Rendering DICOM Service Response 184 IMCHttpConverter Interface and Constructing HttpResponseMessage 184 Deploying Applications ccccccsceceeeeeceeeeeeeeceeeeeceaeeesaaeeseaeeseeeeesaeeesaeseeeeeeaas 185 Merge DICOM Required Files 2 0 eee eeseceeeceneeeeeeeeeeseeeeeeeeseeeeaeeeeeeaaeeaaee 185 Configuration Options sssrinin a i a 187 Appendix A Frequently Asked Questions seeeeeeeeeeerrereerrerrsrrerirrrerrrrsern 190 Appendix B Unique Identifiers UIDs 0 ecccceeeeeeseeeeeseeteeeeeeaeeeeeaeeneeeeeeaees 193 Summary of UID COMposSition ccceeeeeeeee cece cece cesses eeeeeeseeeesaeeeeaeeeeenee 193 Obtaining A UID neesenca eiae aiaee aa eiaa Naaa 194 Obtaining a UID From ANSI sssesssesseessesseesressreesrrssrnssrnssrnssrnssrnssrrssrrssrns 194 Appendix C Writing a DICOM Conformance Statement c ceeeeeeeeeeeees 195 Conformance Statement Sections cceccceceeeceeeeeeeeeeeeeeeeeseeeeseaeeeeeeeeenees 195 Application Data FlOW ia iseaniaisin iienaa iiinn aain atni aianei 195 Sequencing of Real World Activities ccccccceeeeeceeeeeceeeeeeeeeeeeeeeeeeeeeees 196 AE Specifications s satas annonsen anaana aie adaa aaa nat 196 SOP ClaSSOS sia ass sesecee sat cd beanie vedancstoeasa ss beanies eocdtea wate aiad Wisse arnai aani 197 Number of Associations ceccceceeeeeeeeeeeeeee cee eecaa
6. Do you want to set or add your value appendNullValue putNullValue Identifying the attribute Difference between setValue addValue and indexer The setValue methods first remove any existing values from the attribute and then append the new value The addValue method appends a value to the attribute The indexer can be used to set specific values if the attribute is multi valued The following example shows the user of the indexer and the setValue and addValue methods try MCtag tag new MCtag 0x000101001 MCattribute myAttr new MCattribute tag myAttr 0 new MCpersonName Smith John myAttr 1 new MCpersonName Smith Jonathan myAttr setValue new MCpersonName Smith John myAttr addValue new MCpersonName Smith Jonathan catch MCattributeNotFoundException e catch MCincompatibleValueException e catch MCvrAlreadyValidException e Assigning a NULL Attribute Value DICOM allows attributes to have a NULL value that is the value s length is zero You can use the set Value or addValue routines to assign a value to NULL MCattributeSet myAttrSet non null referenc myAttrSet addValue 0x00080010U null myAttrSet setValue 0x00080020U null Note Both of these methods may be used to set the first or only value of an attribute to NULL zero length The methods may be called to set subsequent values of multi valued att
7. Finally you create your own MCproposedContextList MCproposedContextList myContextList new MCproposedContextList MYLIST1 myCtxArray MCproposedContext properties The MCproposedContext class provides properties for the proposed context The Abst ractSyntax property retrieves the abstract syntax name associated innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual with this proposed service Note that this is equivalent to the SOP Class UID used to identify the DICOM service The SCProle property retrieves a code defining whether or not the application is willing to perform the SCP role and the SCUrole property retrieves a code defining whether or not the application is willing to perform the SCU role The ServiceName property retrieves the name associated with this proposed service This is the name configured in the mergecom srv file The TransferSyntaxList property returns the MCtransferSyntaxList object which is a list of proposed transfer syntaxes for this service MCproposedContextList properties clearNegotiationInfo setNegotiationInfo The MCproposedContextList class provides methods to retrieve properties of the contains proposed context list The clearNegotiationInfo method clears any getContext nae i ListName negotiation information that may have been set for a service As a result no GetEnumerator negotiation information will be used for this service when the library attempt
8. The following abbreviations are used e XOR Exclusive OR One and only one row shall be selected from mutually exclusive options Note For example if one of rows 1 2 3 or 4 may be included then for row 2 the abbreviation XOR rows 1 3 4 is specified for the condition e IF Shall be present if the condition is TRUE may be present otherwise e IFF If and only if Shall be present if the condition is TRUE shall not be present otherwise e CV Code Value e CSD Coding Scheme Designator e CM Code Meaning e CSV Coding Scheme Version Value Set Constraint Value Set Constraints if any are specified in this field as defined or enumerated coded entries or as baseline or defined context groups The Value Set Constraint column may specify a default value for the Content Item if the Content Item is not present either as a fixed value or by reference to another Content Item or by reference to an Attribute from the dataset other than within the Content Sequence 0040 A730 Inclusion of Templates A Template may include another Template by specifying INCLUDE in the Value Type field and the identifier of the included Template in the Concept Name field All of the rows of the specified Template are in included in the invoking Template effectively substituting the specified template for the row where the inclusion is invoked Whether or not the inclusion is user optional mandatory or conditio
9. a non null file reference StreamWriter writer new StreamWriter myFile convert DICOM file to a JSON file myFile writeToJSON writer writer Close The DICOM JSON Model provisions that bulk data can be replaced by a URI string instead of the actual data To allow the substitution at run time a new interface MCbulkDataUriHandler is introduced public interface MCbulkUriHandler object provideData MCattributeSet attrSet unit tag MCvr vr string uri string provideUri MCattributeSet attrSet unit tag MCvr vr Following example shows how to implement this interface and calling an overloaded method of writeTOJSON to accomplish the task class BulkDataUriHandler MCbulkUriHandler public string provideUri MCattributeSet attrSet unit tag MCvr vr innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual if tag MCdicom PIXEL_DATA return http xyz net pixeldatalocation return your URI string call an overloaded method of writeToJSON myFile writeToJSON writer new BulkDataUriHandler By default if no bulk URI handler is supplied the toolkit will write out all bulk data to the JSON file using based 64 encoded string DICOM JSON Model to Message Conversion Converting a JSON string The MCabstractMessage provides a readFromJSON method that can be utilized into a message to read attribute values from a DICOM JSON Model string into readF
10. Merge DICOM Toolkit calls to provide the attribute s data length Writing the receiveDataLength method The receiveDataLength method is called by the library to provide the callback class with the data length dataLength parameter of the attribute identified by the attribSet and tag parameters The library calls this method before calling the receiveData method If the method cannot comply with the request it must throw an MCcallbackCannotComplyException If the exception is thrown Merge DICOM will make no further calls for this instance of the attribute public void receiveDataLength MCattributeSet attribSet MCtag tag uint dataLength if dataLengthUnacceptable throw new MCcallbackCannotComplyException mYlocalLength dataLength Writing the receiveData method The receiveData method is called by the library to provide the callback with some or all of the attribute s value The library has set the data field of the MCdata object to a byte array containing all or a portion of the attribute s value isFirst will be true if the library is presenting the first portion of the attribute s value If this is the last portion of the value that the library will present the IsLast property of the MCdata object will be t rue The data buffer in the MCdata object may have a length of zero if this is the last portion of the data i e MCdata IsLast true Note that this method is not called when processing th
11. MyFileName or MCfile myFile new MCfile The filename parameter if used provides the name of the operating system file to be associated with this MCfile object Just as when you construct an empty MCdimseMessage object for networking when you construct an empty MCfile object the message info and data dictionary files are not accessed This object contains no pre allocated attributes in the contained MCfileMetalnfo and MCdataSet objects and the setServiceCommand method must be called to set the service and command for this file before it can be written to the file set As in the case of networking this approach is more efficient but penalizes you in the area of run time error checking Convert an MCdimseMessage object to an MCfile object Another form of the constructor converts a network message object into a file object associated with a specified file system file MCdimseMessage message a non null referenc MCfile myFile MCfile message MyFileName The data set contained in message will be used in this object Note The original MCdimseMessage and the new MCfile objects will be sharing the same MCdataSet object The filename parameter provides the name of the operating system file to be associated with the MCfile object Accessing the service and command properties It the service and command for the MCfile object were not specified when the object was constructed they can be provided later us
12. Table 21 SR Content Item Types Item Type TEXT CODE DATETIME DATE TIME UIDREF PNAME COMPOSIT E Merge DICOM Toolkit Class MCtextltem MCcodeltem MCdateTimeltem MCdateltem MCuidReferenceltem MCpersonNameltem MCcompositeltem Concept Name Type of text e g Findings or name of identifier e g Lesion ID Type of numeric value or measurement e g BPD Type of code e g Findings Type of DateTime e g Date Time of onset Type of Date e g Birth Date Type of Time e g Start Time Type of UID e g Study Instance UID Role of person e g Recording Observer Purpose of Reference Description Free text narrative description of unlimited length May also be used to provide a label or identifier value Numeric value fully qualified by coded representation of the measurement name and unit of measurement Categorical coded value Representation of nominal or non numeric ordinal values Date and time of occurrence of the type of event denoted by the Concept Name Date of occurrence of the type of event denoted by the Concept Name Time of occurrence of the type of event denoted by the Concept Name Unique Identifier UID of the entity identified by the Concept Name Person name of the person whose role is described by the Concept Name A reference to one Composite SOP Instance which is not an Image or Waveform
13. XML to Attribute set conversion readFromXMLNative public interface MCbulkUriHandler object provideData MCattributeSet attrSet unit tag MCvr vr string uri string provideUri MCattributeSet attrSet unit tag MCvr vr Following example shows how to implement this interface and calling an overloaded method of writeToXMLNative to accomplish the task class BulkDataUriHandler MCbulkUriHandler public string provideUri MCattributeSet attrSet unit tag MCvr vr if tag MCdicom PIXEL_DATA return http xyz net pixeldatalocation return your URI string call an overloaded method of writeToXMLNative ds writeToxMLNative writer xmlOptions new BulkDataUriHandler By default if no bulk URI handler is supplied the toolkit will write out all bulk data to the XML file using based 64 encoded string Converting a Native DICOM Model XML String into an Attribute Set You can read attribute values from an XML string into an attribute set by using the readFromXMLNative method of the MCattributeSet The content of the attribute set is not cleared before processing XML attributes The existing attributes in the attribute set will be overridden if they are present in the XML string The following example shows how the readFromXMLNative method is utilized at a high level StreamReader reader new StreamReader myXMLFile MCdataSet ds new MCdataSet convert an XML file into an
14. HAS CONCEPT MOD TEXT Further Explanation Chest X Ray Two Views Posteroanterior and Lateral HAS PROPERTIES HAS PROPERTIES Description of properties of the Source Content Item e g CODE Mass HAS PROPERTIES CODE anatomic location HAS PROPERTIES CODE diameter HAS PROPERTIES CODE margin innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual Relationship Type Merge DICOM Toolkit Definition HAS ACQ CONTEXT INFERRED FROM SELECTED FROM SELECTED_FROM Content Item Identifier HAS_ACQ_CONTEX T INFERRED_FROM Description Has Acquisition Context The Target Content Item describes the conditions present during data acquisition of the Source Content Item e g IMAGE 36 HAS ACQ CONTEXT CODE contrast agent HAS ACQ CONTEXT CODE position of imaging subject Source Content Item conveys a measurement or other inference made from the Target Content Items Denotes the supporting evidence for a measurement or judgment e g CODE Malignancy INFERRED FROM CODE Mass INFERRED FROM CODE Lymphadenopathy e g NUM BPD 5mm INFERRED FROM SCOORD Source Content Item conveys spatial or temporal coordinates selected from the Target Content Item s e g SCOORD CLOSED 1 1 5 10 SELECTED FROM IMAGE 36 e g TCOORD SEGMENT 60 200mS SELECTED FROM WAVEFORM Content Items are identified
15. STUDY COMPONENT PRIVATE PRINT QUEUE FILM SESSION PRIVATE FILM SESSION FILM BOX PRIVATE FILM BOX BASIC IMAGE BOX PRIVATE BASIC IMAGE BOX PRIVATE PRIVATE PRIVATE MRDR Not applicable The first row of this table specifies the directory records that can be contained within the Root Directory Entity innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual File Management Roles and Services File Management Services Part 10 of the DICOM Standard specifies a set of file management roles and services There are five DICOM File Services that describe the entire set of DICOM file operation primitives Table 7 DICOM File Services DICOM File Services Description M WRITE Create new files in a file set and assign them a file ID M READ Read existing files based on their file ID M INQUIRE FILE SET Inquire free space available for creating new files within a file set M DELETE Delete existing files based on their file ID M INQUIRE FILE Inquire date and time of file creation or last update if applicable for any file within a file set The Merge DICOM Toolkit supplies the MCmediaStorageService that performs the first two underlined file services That class also implements enhanced read and write functionality for the creation and maintenance of DICOMDIR files and its hierarchy of directory entities and directory records The remaining three file services are best implemented by the applicati
16. gt object lt param gt lt param name studyInstanceUid gt StudyInstanceUID parameter lt param gt lt param name seriesInstanceUid gt SeriesInstanceUID parameter lt param gt lt returns gt lt see cref HttpResponseMessage gt object lt returns gt ActionName series public HttpResponseMessage Get HttpRequestMessage request String studyInstanceUid String seriesInstanceUid List lt MCrequestParameter gt parms new List lt MCrequestParameter gt string keyword MCwado DicomKeywords MCdicom STUDY_INSTANCE_UID MCrequestAttribute attr new MCrequestAttribute Item keyword Tag MCdicom STUDY_INSTANCE_UID Keyword keyword Values new string studyInstanceUid parms Add new MCrequestParameter Name keyword innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual RequestRequirement MCrequestParameter Requirements REQUIRED Attributes new List lt MCrequestAttribute gt attr H keyword MCwado DicomKeywords MCdicom SERIES_INSTANCE_UID attr new MCrequestAttribute Item keyword Tag MCdicom SERIES_INSTANCE_UID Keyword keyword Values new string seriesInstanceUid parms Add new MCrequestParameter Name keyword RequestRequirement MCrequestParameter Requirements REQUIRED Attributes new List lt MCrequestAttribute gt attr 3 3 return new MCrequest request MCrequestType WadoRS parms ToArray lt MC
17. innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual Item Type Merge DICOM Toolkit Concept Name Description Class IMAGE MCimageltem Purpose of A reference to one Reference Image IMAGE Content Item may convey a reference to a Softcopy Presentation State associated with the Image WAVEFOR MCwaveformltem Purpose of A reference to one M Reference Waveform SCOORD MCspatialCoordinates Purpose of Spatial coordinates of a Item Reference geometric region of interest in the DICOM image coordinate system The IMAGE Content Item from which spatial coordinates are selected is denoted by a SELECTED FROM relationship TCOORD MCtemporalCoordDate Purpose of Temporal Coordinates Timeltem Reference i e time or event based coordinates of a region ee of interest in the DICOM Offsetsltem waveform coordinate system The MCtemporalCoord WAVEFORM or IMAGE Positionsltem or SCOORD Content Item from which Temporal Coordinates are selected is denoted by a SELECTED FROM relationship MCcontainerltem CONTAINE R Document Title or document section heading Concept Name conveys the Document Title if the ONTAINER is the Document Root Content Item or the category of observation CONTAINER groups Content Items and defines the heading or category of observation that applies to that content The heading describes the content of the CONTAINER Content Item and may map to a document section hea
18. store in a frame buffer filter through decompression hardware write to disk without any overhead introduced by the MCdimseMessage object Using an Attribute Container in a Client Application A client SCU application can register a MCattributeContainer object that will be called repetitively as the attribute s value is transmitted over an association during an MCdimseService class sendRequestMessage or sendResponseMessage Call During either of these calls the attribute value will be handled by your registered MCattributeContainer object before these calls can return to your application The MCattributeContainer class can also be used by the client to specially manage OB OW OF data e g read from a frame buffer filter through compression hardware or software read from disk without any overhead introduced by the MCdimseMessage object Client callbacks Declaring an MCattributeContainer and MCattributeContainerEx Classes ee ee The MCattributeContainer interface requires that your container class provide MCattributeContainer five methods that will be called by the Merge DICOM library at different times A class sample class declaration follows public class MyContainer MCattributeContainer public uint provideDataLength MCattributeSet attribSet Ctag tag public MCdata provideData MCattributeSet attribSet Ctag tag bool isFirst public void receiveDataLength MCattributeSet attribSet Ctag tag uint dataLengt
19. string provideUri MCattributeSet attrSet unit tag MCvr vr Following example shows how to implement this interface and calling an overloaded method of writeToXMLNative to accomplish the task class BulkDataUriHandler MCbulkUriHandler public string provideUri MCattributeSet attrSet unit tag MCvr vr if tag MCdicom PIXEL_DATA return http xyz net pixeldatalocation return your URI string call an overloaded method of writeToXMLNative myFile writeToXMLNative writer xmlOptions new BulkDataUriHandler By default if no bulk URI handler is supplied the toolkit will write out all bulk data to the XML file using based 64 encoded string Native DICOM Model XML to Message Conversion The MCabstractMessage provides a readFromXMLNative method that can be utilized to read attribute values from a Native DICOM Model XML string into MCabstractMessage s derived classes MCfile and MCdimseMessage The content of the message is not cleared before processing XML attributes The existing attributes in the message are overridden if they are present in the XML string The following example shows how the readFromXMLNative method is utilized at a high level StreamReader reader new StreamReader myXMLFile MCfile file new MCfile file readFromxMLNative reader reader Close To handle bulk URI from a Native DICOM Model XML file the MCbulkDataUriHandler interface is used Fol
20. 04C6H d Fragment E000 024AH d EODD 0000H Fragment 4 bytes 4 bytes 04C6H 4 bytes 4 bytes 024A H 4 bytes 4 bytes bytes bytes When encoding encapsulated data each compressed fragment shown in Table 13 is set with the addEncapsulatedValue method of MCattribute This routine supplies an MCdataSource which contains the encapsulated pixel data When needed Merge DICOM will retrieve data from the source and encapsulate In this case it is assumed that the MCdataSource is supplying already compressed data addEncapsulatedValue can be called multiple times to add additional compressed frames to an attribute When decoding encapsulated data the getEncapsulatedFrame or getFrame methods of MCattribute are used These methods can be repeatedly called to retrieve each encapsulated frame Note that the compressed data is returned unless the decompressor is registered using registerCompressor method for the given DICOM message Working with MCabstractMessage Derived Classes The MCabstractMessage class is an abstract class that implements several routines that are common between DIMSE messages MCdimseMessage and DICOM files MCfile These routines include compression and validation of attribute sets Compression and Decompression The MCabstractMessage derived classes MCfile and MCdimseMessage provide a duplicate method which can be utilized to do compression decompression or both The duplicate method will create a copy of the
21. DEFAULT MEM This parameter specifies the name path of the DICOM dictionary An absolute or relative path may be specified Note This parameter is ignored if the dictionary has been pre compiled DEFAULT mc3msg mrgcom3 dct When duplicating to an encapsulated transfer syntax this configuration value specifies whether an ICON IMAGE SEQUENCE should also be encapsulated DEFAULT NO This parameter specifies the behavior of the message item file handling functions MC_Free_Message MC_Empty_Message MC_Free_Item MC_Empty_Item MC_Free_File and MC_Empty_File If this parameter is set to YES the above functions will search for references in every currently open object to delete when they encounter an item to free within an object DEFAULT NO If set to NO private creator codes contained in messages are not emptied when the MC_Empty_Message or MC_Empty_File function calls are made DEFAULT YES If set to NO it prevents the toolkit from exporting private creator data elements which don t have any private attributes in the private block If set to YES exporting private creator data elements with empty private blocks is allowed DEFAULT YES innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual EXPORT_GROUP_LENGTHS_TO_NETWORK EXPORT_PRIVATE_ATTRIBUTES_TO_NETWORK EXPORT_UN_VR_TO_NETWORK EXPORT_UNDEFINED_LENGTH_SQ FLATE_GROW_OUTPUT_BUF_
22. For Processing Digital Mammography Image Storage For Presentation Digital Mammography Image Storage For Processing Parametric Map Storage Raw Data Storage RT Beams Delivery Instruction Storage RT Beams Treatment Record Storage RT Brachy Treatment Record Storage RT Dose Storage RT Plan Storage RT Image Storage RT Structure Set Storage RT Treatment Summary Record Storage innovative Imaging NET C User s Manual Merge DICOM Toolkit v 5 1 0 Service Class Services Description RT lon Beams Treatment Record Storage RT lon Plan Storage VL Endoscopic Image Storage VL Microscopic Image Storage VL Photographic Image Storage VL Slide Coordinates Microscopic Image Storage VL Whole Slide Microscopy Image Storage Video Endoscopic Image Storage Video Microscopic Image Storage Video Photographic Image Storage XA XRF Grayscale Softcopy Presentation State Storage X Ray Angiographic Image Storage X Ray Radiofluoroscopic Storage X Ray 3D Angiographic Image Storage X Ray 3D Craniographic Image Storage Enhanced XA Image Storage Enhanced XRF Image Storage Secondary Capture Image Storage Autorefraction Measurements Storage Keratometry Measurements Storage Lensometry Measurements Storage Ophthalmic Axial Measurements Storage Ophthalmic Visual Field Static Perimetry Measurements Storage Subjective Refraction Measurements Storage Visual Acuity Measurements Storage Multi frame Graysc
23. IMCcache is used to store and retrieve DICOM objects to from the user cache storage IMCDicomRenderer interface is used to render DICOM service messages into different format or TransferSyntax and IMCHttpConverter provides a way to convert a DICOM service response to a HttpResponseMessage The MCwado Settings property is a Dictionary lt String String gt hosting the configuration settings of the WADO framework Constructing an MCrequest MCrequest is a base class which is used to instantiate a DICOM service request Its constructor takes an HttpResponseMessage object a request type and a list of DICOM request parameters as constructor parameters lt summary gt Class constructor lt summary gt lt param name httpRequestMessage gt lt see cref HttpRequestMessage gt object lt param gt lt param name requestType gt lt see cref MCrequestType gt of current request lt param gt lt param name parms gt List of lt see cref MCrequestParameter gt of current request lt param gt public MCrequest HttpRequestMessage httpRequestMessage MCrequestType requestType MCrequestParameter parms HttpRequestMessage httpRequestMessage innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 RequestType requestType Parameters parms There are five types of MCrequest which are used for DICOM services WadoURI WadoRS WadoWS Stow and Qido lt summary gt WadoURI lt see
24. MCdimseMessage requestMsg MCdimseMessage responseMsg short statusCode This sendResponseMessage method allows you to respond to a message received from the remote application It is called after a successful MCassociation read call The requestMsg parameter identifies which DICOM message is being responded to The statusCode parameter provides the status of the requested operation and must be a valid response code for the service involved Response codes are defined in MCdimseSerivce Many DICOM services do not require a response of more than just a status Others however e g C_FIND_RSP require the setting of several message attributes innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 Merge DICOM Toolkit handles the command set for you Attribute values can be stored in your own container class MCattributeContainer The responseMsg parameter if provided must have been constructed for the same service as the requestMsg and for an appropriate command For example if responding to a C STORE request message the resoonseMsg would be constructed as follows responseMsg new MCdimseMessage MCdimseService C_STORE_RSP requestMsg ServiceName Response codes for specifiC C DICOM commands are described in the Assembly Windows Help File and in Part 4 of the DICOM Standard Constants for the various request and response codes are defined in the MCdimseService cl
25. Merge DICOM Toolkit Service Parameter PERFORMED_PROCEDURE_STEP_NOTIFY PERFORMED_PROCEDURE_STEP_RETR PRESENTATION_LUT PRINT JOB PRINT_QUEUE_MANAGEMENT PRINTER PRINTER_CONFIGURATION PROCEDURAL_EVENT_LOGGING PROCEDURE_LOG PRODUCT_CHARACTERISTICS_ QUERY PULL_PRINT_REQUEST RAW_DATA REAL_WORLD_VALUE_MAPPING REFERENCED_IMAGE_BOX RESPIRATORY_WAVEFORM RT_BEAMS_DELIVERY_INSTR_RET RT_BEAMS_DELIVERY_INSTRUCTION RT_CONV_MACHINE_VERIF_RET RT_CONVENTIONAL_MACHINE_VERIF RT_ION_MACHINE_VERIF RT_ION_MACHINE_VERIF_RET SC_MULTIFRAME_GRAYSCALE_BYTE SC_MULTIFRAME_GRAYSCALE_WORD SC_MULTIFRAME_SINGLE_BIT SC_MULTIFRAME_TRUE_COLOR SEGMENTATION DICOM Service Class Study Management Study Management Print Management Print Management Print Management Print Management Print Management Application Event Logging Storage Query Retrieve Print Management Storage Storage Print Management Storage Storage Storage Verification Verification Verification Verification Storage Storage Storage Storage Storage innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 Merge DICOM Toolkit Service Parameter SPATIAL_FIDUCIALS SPATIAL_REGISTRATION SPECTACLE_PRESCRIPTION_REPORT STANDARD_BASIC_TEXT_SR STANDARD_BLENDING_SOFTCOPY_PS STANDARD_COLOR_SOFTCOPY_PS STANDARD_COMPREHENSIVE_SR STANDARD_CR STANDARD_CT STANDARD_CURVE STANDARD_DX_PRESENT STANDARD_DX_PROCESS STANDARD_ECHO STANDARD_ENCA
26. Pass OB OW OD data offset and length only to registered callbacks if any readFileBypassLarqeDat Read only up to the Pixel Data readFileUpToTag service readFile fileObj source catch Exception e readFileBypassLargeData This method reads the file just as the readFile method does with one exception If the stream contains an attribute for which an MCattributeContainer instance has been registered the attribute s value is NOT passed on to the MCattributeContainer but instead the values length and offset into the file is passed to the receiveMediaDataLength method of the MCattributeContainer This provides the opportunity for substantial performance improvement Note that if no MCattributeContainer is registered for the OB OW OD OF attribute the attribute s value will be stored by Merge DICOM Toolkit as usual Capplication myApp non null referenc Cfile fileObj new MCfile FileName CdataSource source new MCfileDataSource fileObj FileName CmediaStorageService service new MCmediaStorageService myApp try service readFileBypassLargeData fileObj source catch Exception e readFileUpToTag This method retrieves the values of the file stream just as the readFile method does but it will stop requesting data when it has processed the last attribute whose tag is lt the last tag parameter It will return the file offset to the first byte of
27. Print Management Point to Point Communication Support retired Part 14 Grayscale Standard Display Function Part 15 Security Profiles Part 16 DICOM Content Mapping Resource Part 17 Explanatory Information Part 18 Web Services Part 19 Application Hosting Part 20 Transformation of DICOM to and from HL7 Standards Part 1 of the standard gives an overview of the standard Since this part was approved before most of the other parts were completed it is already somewhat outdated and can be confusing Part 2 describes DICOM conformance and how to write a conformance statement A conformance statement is important because it allows a network administrator to plan or coordinate a network of DICOM applications For an application to claim DICOM conformance it must have an accurate conformance statement Parts 3 and 4 define the types of services and information that can be exchanged using DICOM Parts 5 and 6 describe how commands and data shall be encoded so that decoding devices can interpret them Part 7 describes the structure of the DICOM commands that along with related data make up a DICOM message This part also describes the association negotiation process whereby two DICOM applications mutually agree upon the services they will perform over the network Part 8 describes how the DICOM messages are exchanged over the network using two prominent transport layer protocols TCP IP and OSI Note that IPv4 and IPv6 are suppor
28. Samples Per Pixel The MCtransferSyntax JpegExtended2_4 transfer syntax is UID 1 2 840 10008 1 2 4 51 JPEG Extended Process 2 amp 4 Default Transfer Syntax for Lossy JPEG 12 Bit Image Compression Process 4 only and uses innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 Pegasus libraries 6420 6520 Table 16 details the photometric interpretation and bit depths supported by the standard compressor and decompressor for this transfer syntax When lossy compressing RGB data the standard compressor by default compresses the data into YBR_FULL_422 format The compressor can also compress in YBR_FULL format if the COMPRESSION_RGB_TRANSFORM_FORMAT configuration option is set to YBR_FULL The Photometric Interpretation tag must be changed by the application after compressing RGB data Similarly the Photometric Interpretation tag should be changed back to RGB before decompressing YBR_FULL or YBR_FULL_422 data Table 16 JPEG Extended Supported Photometric Interpretations and Bit Depths JPEG Extended Process 2 amp 4 Photometric MONOCHROME 1 RGB YBR_FULL_422 Interpretation MONOCHROME2 YBR_FULL fesse e gt 2 Is mae CCC Serer e The MCtransferSyntax JpegLosslesHier14 transfer syntax is UID 1 2 840 10008 1 2 4 70 JPEG Lossless Non Hierarchical First Order Prediction Process 14 Selection Value 1 Default Transfer Syntax for Lossless JPEG Image Compression a
29. The library will call this method before it begins calling the provideData method This method is required to return the length of the attribute s value The returned data length must be an even number The hex value Oxffffffff which means undefined length in DICOM may be returned if the attribute contains encapsulated data If the method cannot comply with the request it must throw an MCcallbackCannotComplyException If the exception is thrown Merge DICOM will make no further calls for this instance of the attribute public uint provideDataLength MCattributeSet attribSet MCtag tag uint length innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual Merge DICOM Toolkit calls for the attribute s data value If unable to get the attribute value s length throw new MCcallbackCannotComplyException Set length to the number of bytes contained in the attribute s value return length Writing the provideData method The provideData method is called by the library to request a portion of the attribute s value If an offset is given the provideData method should use this offset to read from a data stream The attribute is identified by the attribSet and tag parameters The value is returned in an MCdata object that contains the data buffer managed or unmanaged the Length property giving the amount of data in the buffer and a bool indicator IsLast The buffer
30. Use the default settings XmlOptDefault 0x0 Store bulk attributes VR is OB or OW in the XML XmlOptIncludeBulks 0x1 Store Pixel Data buffer in the XML XmlOptIncludePixelData 0x2 Do not store Sequence attributes in the XML XmlOptExcludeSequences 0x4 Do not store Private attributes in the XML XmlOptExcludePrivateAttributes 0x8 Use Base64 encoding for bulks and UN VR attributes XmlOptBase64Binary 0x10 innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 XML to Attribute set conversion readFromXML Attribute set to XML conversion writeTOXMLNative method Converting a Proprietary Schema XML String into an Attribute Set You can read attribute values from a proprietary schema XML string into an attribute set by using the readFromXML method of the MCattributeSet The content of the attribute set is not cleared before processing XML attributes The existing attributes in the attribute set will be overridden if they are present in the XML string The following example shows how the readFromXML method is utilized at a high level StreamReader reader new StreamReader myXMLFile MCdataSet ds new MCdataSet convert an XML file into an attribute set ds readFromxML reader reader Close Converting an Attribute Set into a Native DICOM Model XML String You can convert a list of attributes of an attribute set along with their valu
31. Using the MCsopClass ClaSS ccc ccccccceeeeeceeeeeeeeeeeeaeeeeaeeseeeeesaeeesaeeeeneeeeaees 85 Using the MCvr Class 2 2 2 nadis dete tinties aot dlemetee aiT 86 Using the MCtag Clas sci sscsiutssecnevesdedenebieccnesleaueliteascenvstadvbuerhd deetesdeaeetih aa 87 Constructing non private taQS cccccesseceeceeceeeeeeeaeeeeaeeseneeeseaeeesaeeeeneeeeaees 88 Constructing private taQS cccecccecceeeeeseeceeeeeceeeesaaeeeeaeeseeeeseaeeeeaaeeseneeeeaees 88 Using the MCdataElement class c cccccceeeeeeeeeeeeeeaeeeeaeeseeeeeseaeeesaeeeeneeesaees 88 Constructing standard data elements cccccceceescecesseneeeeseeeeeesseeeessseeaees 88 Constructing non standard data CleMent cc ccccceessecesseseeesseteeeeseeaees 89 Working With Attribute Sets 0 ccecececeeeeeeeeeeeeeeeceeeeeeeaeeeeaeeseeeeesaeeeseaeeeeneeeaas 90 Constructing Message ODjeCtS cccccceeeceeceeeeeeeeeeeeneeseeeeeseaeeesaeeeeneeeeaees 90 Construct a message using a pre populated data Set cccceesseeeeereees 90 Construct a message with an empty data Set cscceeeesseeeeeteeeeeneeeeeees 91 Construct a message using an existing data Set c cccesseessssteeeeeeeeees 91 Convert an MCfile object eeeececceeeeseeeeeee eee eeeeaeeeeaeeseeeeeaeeesaeeseneeeeaees 91 MCdimseMessage Properties ccccceceeseeceeeeeceeeeeeeeeeeeeeeseeeeesaeeneeeseeneess 92 Transfer Syntax USEC issii aiaa aaia d
32. and Service Class Providers SCP s An application entity is an SCU when it requests DICOM services over a network and an SCP when it provides DICOM services over a network We will more often refer to the SCU as a Client and the SCP asa Server A single DICOM application entity can act as both a client and a server This client server model is a powerful and omnipresent one in the world of distributed network computing Services and Meta Services DICOM is formed around the concepts of Services and Service Classes The DICOM Standard specifies a set of services that can be performed over a network Some of the services can also be stored to interchangeable media these are italicized in Table 1 As new services are introduced the standard will be further expanded The standard also groups related services into a service class Table 1 lists the DICOM standard service classes and their component services The DICOM Standard actually refers to services as Service Object Pairs SOP s and meta services as Meta SOPs When a particular collection of services in a service class implies a higher level of service this collection is combined by the standard into a Meta Service Specifying that your application supports a specific meta service is a useful shorthand for explicitly listing out the collection of services that make up that meta service innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual Table 1 DIC
33. attribute properties attribute The ValueRepresentation property retrieves the attribute s value representation the Count property returns the number of values assigned to the attribute and the ValueLength property returns the length in bytes of this value if it were encoded in a DICOM stream or file try MCattribute myAttr non null referenc int count myAttr Count MCvr vr myAttr ValueRepresentation int length myAttr ValueLength catch MCattributeNotFoundException e catch MCincompatibleValueException e catch MCvrAlreadyValidException e Assigning Attribute Values from MCattribute Filling an attribute set Each DICOM attribute may have zero or more values assigned to it based on with values via the Value Multiplicity assigned to the attribute You have several methods MCattribute available to assign values to attributes in an MCattribute object e setValue and addValue e MCattribute index e addEncapsulatedFrame Assigning Attribute Values from MCattributeSet Filling an attribute set The MCattributeSet class also has several convenience methods for assigning with values via values to specific attributes These routines ensure an attribute has been added MCattributeSet into the attribute set and then set or append the value There are setValue and addValue routines similar to the MCattribute class innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0
34. e g G0020 G0022 4 All private as PRIVATE All ranges are inclusive meaning that G0020 G0022 will filter groups 20 and 22 DEFAULT empty Allows deflate to flush data occasionally to limit buffering DEFAULT Yes Allows the compression level of deflate to be specified when using deflated explicit VR little endian transfer syntax 0 is no compression 1 is fastest and 9 compresses best DEFAULT 1 innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 DESIRED_LAST_PDU_SIZE DICTIONARY_ACCESS DICTIONARY_FILE DUPLICATE_ENCAPSULATED_ICON ELIMINATE_ITEM REFERENCES EMPTY_PRIVATE_CREATOR_CODES EXPORT_EMPTY_PRIVATE_CREATOR_CODES Description This parameter allows the user to configure the length of the last PDU sent This allows for interoperability with other DICOM implementations that may be intolerant with either a zero or two byte final PDU length The default value used is 8 Note Starting with release 3 5 1 this configuration option has a limited effect This parameter specifies whether or not the DICOM dictionary is to be loaded into memory or accessed from the dictionary file FILE means access information directly from the dictionary file MEM means load the dictionary into memory and access it there Note Starting with the 3 5 1 Merge DICOM Toolkit release dictionary access is always memory based and can no longer be file based This option is now ignored
35. for explicit big endian t2 lt syntax gt Optional specify transfer syntax of file2 message where lt syntax gt il for implicit little endian default el for explicit little endian eb for explicit big endian e lt file gt Optional exception file of all tags to ignore in comparison o Compare OB OW OF e g binary pixel data ml Compare filel in DICOM 3 file format m2 Compare file2 in DICOM 3 file format h Show these options filel DICOM SOP Instance message fil file2 Another DICOM SOP Instance message fil Example mc3comp t1 il m2 o l img 1 dcm mc3conv Convert Image Formats The mc3conv utility can be used to convert a DICOM object between various transfer syntaxes and formats The utility will read an input file and then write the output file in the transfer syntax specified in the command line The utility can also convert between DICOM stream format and the DICOM file format The syntax for the mc3conv utility is the following mc3conv input_file output_file t lt syntax gt m tag lt tag gt lt new value gt input_file DICOM SOP Instance message fil output_file Output DICOM SOP Instance message fil t Specify transfer syntax for output_file where lt syntax gt il for implicit little endian default el for explicit little endian eb for explicit big endian m Specify format of output_file
36. innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 How to release an MCattributeContainer object releaseAttributeContainer Values for SQ attributes MCitem Items in a message stream Releasing Your MCattributeContainer To de register your attribute container class use the releaseAttributeContainer method of the MCapplication class The method releases the callback object that was registered for the attribute identified by the MCtag parameter The callback s methods will no longer be called when the attribute s value is being received or when the attribute s value is required The callback s methods will still be called however for MCdimseMessage objects or MCfile objects that were created before this method call was made Sequences of Items The DICOM Value Representation SQ is used to indicate a DICOM attribute that contains a value that is a sequence of items Each item in the sequence is an attribute set MCitem class Each of the attribute sets can also contain attributes that have a VR of SQ This powerful capability allows the nesting of attribute sets or the definition of container objects such as folders film boxes directories etc Figure 15 shows a DICOM message containing a sequence of items running two levels deep Note that these nested sequences are contained within the same Message Stream Sequences of items can also be contained in a DICOM file and
37. lt see cref HttpRequestMessage gt object lt param gt lt returns gt lt see cref HttpResponseMessage gt object lt returns gt HttpGet public HttpResponseMessage Get HttpRequestMessage request Name MCcontroller MCWADORSCONTROLLER return new MCrequest request MCrequestType WadoRS Submit lt summary gt Http Get method lt summary gt lt param name request gt lt see cref HttpRequestMessage gt object lt param gt lt param name studyInstanceUid gt StudyInstanceUID parameter lt param gt lt returns gt lt see cref HttpResponseMessage gt object lt returns gt ActionName study public HttpResponseMessage Get HttpRequestMessage request String studyInstanceUid List lt MCrequestParameter gt parms new List lt MCrequestParameter gt string keyword MCwado DicomKeywords MCdicom STUDY_INSTANCE_UID MCrequestAttribute attr new MCrequestAttribute Item keyword Tag MCdicom STUDY_INSTANCE_UID Keyword keyword Values new string studyInstanceUid parms Add new MCrequestParameter Name keyword RequestRequirement MCrequestParameter Requirements REQUIRED Attributes new List lt MCrequestAttribute gt attr H return new MCrequest request MCrequestType WadoRS parms ToArray lt MCrequestParameter gt Submit lt summary gt Http Get method lt summary gt lt param name request gt lt see cref HttpRequestMessage
38. one second Subsequently any value greater than 1000 is rounded to the nearest thousand second Releasing or Aborting the Association The DICOM standard requires the association requester to release the association when no further processing is required This is done using the release method of the MCassociation class assoc release At any time either association partner may abort the association This is used only in abnormal situations assoc abort After calling release or abort no other methods should be called for the association object innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual When the network partner releases or aborts the association the other application is notified by an exception thrown by the read method MCdimseMessage dm try long timeout 30000 30 second timeout dm assoc read timeout if dm null Timeout The MCdimseMessage just sent is returned catch MCassociationReleasedStatus e catch MCassociationAbortedException e catch MCexception e Association Properties The MCassociation class contains several properties that can be used to retrieve information about the association Application Context Name The ApplicationContextName property contains the name of the application context in use by the local and remote applications on this association connection It is in the form of a DICOM Unique Identifi
39. radiographic studies Creation scheduling performance and tracking of imaging studies Creation and tracking of results and associated diagnostic interpretations The DICOM Standard includes the specification of a DICOM Information Model A detailed entity relationship diagram of this model is included in both parts 3 and 4 of the standard This model specifies the relationship between the different types of objects also called entities managed in DICOM For example a Patient has one or more Studies each of which are composed of one or more Series and zero or more Results etc innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual Objects vs Most of DICOM s services perform actions on or with object instances An object instances object can be thought of as a class of data CT Image Film Box etc while an object instance is an actual occurrence of an object a particular CT Image a populated Film Box etc Normalized vs composite There are two types of objects and hence object instances defined in DICOM Normalized objects are objects consisting of a single entity in the DICOM information model e g a Film Box Composite objects are composed of several related entities e g an MR Image When possible it is preferable to deal with normalized object instances over the network because they contain less redundant data and can be more efficiently managed by an application Mos
40. supplies running sample applications source code for your platform they are only supplied as an example They clearly explain the requirements that implementing certain DICOM services places on your application and provide worthwhile but primitive examples of how to approach your application with the toolkit While you will see that the toolkit saves you a great deal of DICOM work it does not implement your end application for you Association Negotiation MCassciation One of the areas where Merge DICOM Toolkit does a great deal of the DICOM work for you is in opening an association session with another DICOM AE over the network DICOM application entities need to agree on certain things before they operate with one another open an association these include e the services that can be performed between the two devices which also impacts the commands and object instances that can be exchanged e the transfer syntax that shall be used in the network communication The transfer syntax defines how the commands and object instances are encoded on the wire innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual The exchange of DICOM commands and object instances can only occur over an open association DICOM defines an association negotiation protocol see Figure 5 in which an association requester application proposes a connection with an association acceptor application In the most common
41. to be DICOM 3 media Part 10 format tag Change value for this tag in output_file where lt tag gt the tag that is to be changed in hex Ox lt new value gt the value for the tag in quotes W h Show these options Example mc3conv in img out dcm t el m innovative maging NET C User s Manual Merge DICOM Toolkit V 5 1 0 mc3echo Do a DICOM ping The mc3echo utility validates application level communication between two DICOM AE s An echo test is the equivalent of a network ping operation but at the DICOM application level rather than the TCP IP transport level All server SCP applications built with the DICOM Toolkit also have built in support of the Verification Service Class and the C ECHO command The command syntax follows mc3echo c count r remote_host 1 local_app_title p remote_port remote_app_title ce count Integer number specifying the number of echoes to send to the remote host If c is not specified one echo will be performed r remote_host Host name of the remote computer If r is not specified the default value for remote_host is configured in the Application Profile 1 local_app_title Application title of this program If l is not specified the default value for local_app_title is MERGE_ECHO_SCU p remote port Port number the remote computer is listening on If p is not specified the default value for remote_host is configured in the A
42. 20 20 20 20 20 30y lt Attribute gt E Name Source Name Referenced innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 lt Attribute Tag 7FE00010 VR OW Name Pixel Data Encoding Base64 Length 262144 gt 06 00 04 00 04 00 02 00 0 3 lt Attribute gt lt DataSet gt lt DomFile gt innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual Appendix F Mergecom ApiController Classes Mergecom WADO controller classes are derived from System Web Http ApiController and implement the Http Get and Post methods following the specifications of the DICOM standard MCcontroller using System using System Collections Generic using System Ling using System Text using System Threading Tasks using System Web Http namespace Mergecomws Web lt summary gt Abstract class inherited from lt see cref ApiController gt lt summary gt public abstract class MCcontroller ApiController lt summary gt MCCONTROLLER lt summary gt public static readonly String MCCONTROLLER MCCONTROLLER lt summary gt MCQIDOCONTROLLER lt summary gt public static readonly String MCQIDOCONTROLLER MCQIDOCONTROLLER lt summary gt MCSTOWCONTROLLER lt summary gt public static readonly String MCSTOWCONTROLLER MCSTOWCONTROLLER lt su
43. 5 1 0 NET C User s Manual Appendix G Json NET License The Merge DICOM Toolkit supports conversion from an attribute set to a DICOM JSON Model and vice versa by using an open source library Json NET The original copyright notice of the Json NET software is below The MIT License MIT Copyright c 2007 James Newton King Permission is hereby granted free of charge to any person obtaining a copy of this software and associated documentation files the Software to deal in the Software without restriction including without limitation the rights to use copy modify merge publish distribute sublicense and or sell copies of the Software and to permit persons to whom the Software is furnished to do so subject to the following conditions The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software THE SOFTWARE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND EXPRESS OR IMPLIED INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM DAMAGES OR OTHER LIABILITY WHETHER IN AN ACTION OF CONTRACT TORT OR OTHERWISE ARISING FROM OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE innovative imaging
44. ANERER 54 DE ae N e D E cvs leeds E E T A T 55 SE aS i a AAE T AE E E A A T excsnatecade 55 AAEL e ale a cat E E T EAE 56 MUNG SUSU A ET dy E T N E T E 56 aaea e E E A AE T E desameatvende 57 MESTE aaa aE E AEE aAa a aaaea 58 Developing DICOM Applications ccccccececeeeeeeeeeeeeaeeeeaeeseeeeeseaeeesaeeeeeeeeaees 60 Library IMpOorE iriran oeii ier ieee det eden skh A E ERNES 62 Library Constants sinesine ia aia 62 Exception Handling cccccceeeeeeeeeeeeeeeeeeeeeeeeeeeeaeeeeesaeeeeeseeeeeeseneeeeeseneaeeeeeenaees 62 Library Initialization 2 2c 2 ciee eecisii divi seit aae a needed 65 Releasing the liIDrary ec ccceeecseecesceeeeeeeeeeeeeeeeeeeeeeaaeeeseeaaeeeseeaaeeeseegeneeeeeseneees 66 Getting the Assembly Version ccccsceeecceceeeeeceneeeeeaeeeeeeeeeeeeesaeeeeaaeeeeeeeeaas 66 Releasing Native Memory c ccececceeeeeeeeeeeeeeneeeeeeeneeeeeseeeeeeseneeeeeseneaeeeteenaees 66 Using the Merge DICOM log file eccceeeeeceeeeeeeeeeeeeeeeeeseeeeeeeesaeeesaaeeeeneeeeaees 67 Capturing Log Messages in Your Application 0 ccccccceceeeeeeseeeeeteeeeeeeees 67 Registering Your Application ccccccceceeeseeceeeeceeeeeeeeeeeeeeseaeeesaeeseneeseneee 68 MCapplication objects can be disposed cccccceeseeeeeeeseeeeeeenteeeeesnteeeene 68 The Application Entity AE Title cc cecceeeeeeeeceeeeeeeeseeeeeeeaeeeeaeeeeaeeeeeeeeeeas 68 Association Management Network Onlly
45. CONCEPT MOD CODE JEV 113011 DCM 1 UC IF Row 1 Concept DCID Document Title Name 113001 7011 Modifier DCM Rejected for Quality Reasons or 113010 DCM Quality Issue 4 gt HAS CONCEPT MOD CODE EV 113011 DCM 1 MC IF Row 1 Concept DCID Document Title Name 113013 7012 Modifier DCM Best In Set 5 gt HAS CONCEPT MOD INCLUD DTID 1204 Language of 1 U E Content Item and Descendants 6 gt HAS OBS CONTEXT INCLUD DTID 1002 Observer 1 n U E Context 7 gt CONTAINS TEXT EV 113012 DCM Key 1 U Object Description 8 gt CONTAINS IMAGE Purpose of Reference 1 n MC At least one of shall not be present Rows 8 9 and 10 shall be present 9 gt CONTAINS WAVEF Purpose of Reference 1 n MC At least one of ORM shall not be present Rows 8 9 and 10 shall be present 10 gt CONTAINS COMPO Purpose of Reference 1 n MC At least one of SITE shall not be present Rows 8 9 and 10 shall be present innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 The code below generates a valid DICOM KO object and illustrates how the template is encoded using the Merge DICOM Toolkit functions private MCdataSet CreateKO MCcontentItem item Create a KEY OBJECT DOCUMENT The template ID is 2010 and we used the Best in Set context ID from the CID 7010 MCsructuredReport sr new
46. Color Secondary Capture Image Storage Nuclear Medicine Image Storage Ophthalmic 8 bit Photography Image Storage Ophthalmic 16 bit Photography Image Storage Ophthalmic Axial Measurements Storage Ophthalmic Tomography Image Storage Ophthalmic Visual Field Static Perimetry Measurements Storage Parametric Map Storage Positron Emission Tomography Image Storage Procedure Log Pseudo Color Softcopy Presentation State Storage Raw Data Storage Real World Value Mapping Storage Respiratory Waveform Storage RT Beams Delivery Instruction Storage RT Beams Treatment Record Storage RT Brachy Treatment Record Storage RT Dose Storage RT lon Beams Treatment Record Storage Command C STORE C STORE C STORE C STORE C STORE C STORE C STORE C STORE C STORE C STORE C STORE C STORE C STORE C STORE C STORE C STORE C STORE C STORE C STORE C STORE C STORE C STORE C STORE C STORE C STORE C STORE C STORE innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 Service Command RT lon Plan Storage C STORE RT Plan Storage C STORE RT Image Storage C STORE RT Structure Set Storage C STORE RT Treatment Summary Record Storage C STORE Secondary Capture Image Storage C STORE Segmentation Storage C STORE Subjective Refraction Measurements Storage C STORE Surface Segmentation Storage C STORE Spatial Registration Storage C STORE Spatial Fiducials Storage
47. DICOM services a client application entity SCU proposes an association with a server AE SCP However some services define a mechanism where the client can be the SCP which opens an association with the SCU This is used when an SCP sends asynchronous event reports to an SCU through the N EVENT REPORT command This is done when DICOM role negotiation is used during standard association negotiation For the sake of simplicity the remainder of this manual refers to the client as the SCU and the server as the SCP MCnegotiationInfo MCproposedContext The association request proposal contains the set of services the client would MCproposedContextList like to perform and the transfer syntaxes it understands The server then MCresultContext responds to the client with a subset of the services and transfer syntaxes MCsopClass proposed by the client If this subset is empty the server has rejected the MCtransferSyntax association If the subset is not empty the server has accepted the association MCtransferSyntaxList and the agreed upon services may be performed The client is responsible for releasing the association when it is finished performing its network operations Either the client or the server can also abort the association in the case of some catastrophic failure e g disk full out of memory 1 un Association Requested sn 2 Association Accepted sw 3 ASSOCIATION 4 Association Released Figure 5 A Success
48. Full Progression Non Hierarchical Process 11 amp 13 transfer syntax DEFAULT 1 2 840 10008 1 2 4 56 This value defines the UID for JPEG Lossless Non Hierarchical First Order Prediction Process 14 Selection Value 1 transfer syntax DEFAULT 1 2 840 10008 1 2 4 70 This value defines the UID for JPEG Lossless Hierarchical Process 28 transfer syntax DEFAULT 1 2 840 10008 1 2 4 65 This value defines the UID for JPEG Lossless Hierarchical Process 29 transfer syntax DEFAULT 1 2 840 10008 1 2 4 66 This value defines the UID for JPEG Lossless Non Hierarchical Process 14 transfer syntax DEFAULT 1 2 840 10008 1 2 4 57 This value defines the UID for JPEG Lossless Non Hierarchical Process 15 transfer syntax DEFAULT 1 2 840 10008 1 2 4 58 This value defines the UID for JPEG LS Lossless transfer syntax DEFAULT 1 2 840 10008 1 2 4 80 This value defines the UID for JPEG LS Lossy Near Lossless transfer syntax DEFAULT 1 2 840 10008 1 2 4 81 This value defines the UID for JPEG Spectral Selection Hierarchical Process 20 amp 22 transfer syntax DEFAULT 1 2 840 10008 1 2 4 61 This value defines the UID for JPEG Spectral Selection Hierarchical Process 21 amp 23 transfer syntax DEFAULT 1 2 840 10008 1 2 4 62 innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual Description JPEG_SPEC_NON_HIER_6_8_ SYNTAX This value defines the UID for JPEG Spectral Selection Non
49. Hierarchical Process 6 amp 8 transfer syntax DEFAULT 1 2 840 10008 1 2 4 53 JPEG_SPEC_NON_HIER_7_9_ SYNTAX This value defines the UID for JPEG Spectral Selection Non Hierarchical Process 7 amp 9 transfer syntax DEFAULT 1 2 840 10008 1 2 4 54 JPIP_REFERENCED_DEFLATE_SYNTAX This value defines the UID for JPIP Referenced Deflate transfer syntax DEFAULT 1 2 840 10008 1 2 4 95 JPIP_REFERENCED_SYNTAX This value defines the UID for JPIP Referenced transfer syntax DEFAULT 1 2 840 10008 1 2 4 94 LICENSE The Merge DICOM Toolkit license number that was supplied when the toolkit was purchased LOCAL_APPL_CONTEXT_NAME The DICOM Application Context Name UID as specified in the DICOM Standard DEFAULT 1 2 840 10008 3 1 1 1 MPEG2_MPHL_ SYNTAX This value defines the UID for MPEG2 Main Profile High Level transfer syntax DEFAULT 1 2 840 10008 1 2 4 101 MPEG2_MPML_SYNTAX This value defines the UID for MPEG2 Main Profile Main Level transfer syntax DEFAULT 1 2 840 10008 1 2 4 100 This value defines the UID for MPEG 4 AVC H 264 BD compatible High Profile Level 4 1 transfer syntax DEFAULT 1 2 840 10008 1 2 4 103 This value defines the UID for MPEG 4 AVC H 264 High Profile Level 4 1 transfer syntax DEFAULT 1 2 840 10008 1 2 4 102 MPEG4 AVC_H264 BDC_HP LEVEL 4 1_ SYNTAX MPEG4 AVC_H264 HP LEVEL 4 1_ SYNTAX innovative imaging NET C User s Manual Merge DICOM Toolkit v 5 1 0 PDU
50. MCdimseMessage IMChttpConverter IMCdicomRenderer IMCDicomRenderer Interface and Rendering DICOM Service Response DICOM service response could be rendered to the different binary format or Transfer Syntax using IMCdicomRenderer interface innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 lt summary gt Defines the conversion operation of DICOM Service response to an array of lt see cref Stream gt objects lt summary gt public interface IMCdicomRenderer lt summary gt Renders DICOM service response into lt see cref Stream gt object using an array of lt see cref MCparameter gt lt summary gt lt param name response gt DICOM service response encoded as an array of of lt see cref MCabstractMessage gt lt param gt lt param name xmlRequestParameters gt XML string of lt see cref MCparameter gt used for WADO request lt param gt lt param name xmlResponseParameters gt XML string of lt see cref MCparameter gt returned from DICOM service lt param gt lt returns gt An array of lt see cref Stream gt objects generated from DICOM service response lt returns gt Stream Render MCabstractMessage response String xmlRequestParameters ref String xmlResponseParameters The Render method takes an array of MCabstractMessage objects from DICOM service as a parameter and returns an arrays of binary Stream data which are used as an
51. MCdimseMessage object you can use the indexer for MCattributeSet to retrieve values Note that you can also use a different form of the indexer to retrieve MCattribute objects which in turn have an indexer to retrieve values The indexers have the following forms Indexers public Object this uint tag int index public Object this MCtag tag int index public Object this uint tag int index Object defaultValue public Object this MCtag tag int index Object defaultValue Each of these methods return an Object representing the value The tag to retrieve can be specified as an MCtag instance or a uint containing the tag The index parameter allows the user to specify the specific value to get if the attribute has a value of multiplicity greater than one The index is zero based Two final forms are added as a convenience and allow a default value to be specified if the attribute does not have a value or it is missing in the attribute set Each method returns an Object representing the value the type of object returned is determined by value representation of the attribute that is being retrieved The methods return nu11 if the attribute s value was a DICOM NULL value i e its value length was zero Table 12 below shows the data types that are returned for each DICOM Value Representation Table 12 Valid value type parameters for the various Value Representations Data Types Value Representations Returned MCdate D MCda
52. MCfile or MCdimseMessage that is encoded in a new transfer syntax If the transfer syntax of the source message is compressed a decompressor must be supplied to the duplicate method If the result transfer syntax is compressed a compressor must be supplied innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 MCcompression The MCcompression interface defines an interface for compressors and decompressors utilized by Merge DICOM NET Merge DICOM supplies a number of compressors and decompressors that implement this interface and are defined in the following sections The duplicate method of MCabstractMessage requires that the compressor and decompressor supplied to it implement the MCcompression interface The following example shows how the duplicate method is utilized at a high level MCdimseMessage msg A non null uncompressed message MCdimseMessage resultMsg resultMsg msg duplicate MCtransferSyntax Rle null new MCrleCompressor MCdimseMessage resultMsg2 resultMsg2 resultMsg duplicate MCtransferSyntax JpegBaseline new MCrleDecompressor new MCstandardCompressor j The example starts with an uncompressed image and creates a new message that is RLE compressed with the duplicate method It then calls duplicate again to decompress the RLE image and recompress the image as JPEG Baseline The following section describes the compressors and decompressor supplied by Merge DICO
53. MCstructuredReport 2010 MCcontainerItem Continuity SEPARATE new MCbasicCodedEntry 113013 DCM Best In Set Skipping Row 2 and 3 of the template and encoding Row 4 The code is taken from the CID 7012 y item new MCcodeItem new MCbasicCodedEntry 113015 DCM Series new MCbasicCodedEntry 113011 DCM Document Title Modifier sr RootItem AddChild item MCrelationshipType HAS_CONCEPT_MOD Skipping Row 5 and 6 of the template and encoding Row 7 The code is taken from the CID 7012 The text value shall describe the image selection z item new MCtextItem Doctor s comments on selection new MCbasicCodedEntry 113012 DCM Key Object Description sr RootItem AddChild item MCrelationshipType CONTAINS Adding an IMAGE from Row 8 The values 1 2 3 4 1 1 2 3 4 5 1 suppose to be an image SOP Class and SOP Instance y item new MCimageItem new MCsopInstanceReference 1 2 3 4 1 aaee EE E el 2 sr RootItem AddChild item MCrelationshipType CONTAINS Creating a new DataSet MCdataSet dataSet new MCdataSet MCdimseService C_STORE_RQ KEY OBJECT_SELECTION_DOC Saving SR Document contentent into the DataSet sr Write dataSet fF Adding other root lvel attributes R dataSet setValue MCdicom SOP_CLASS_UID 1 2 840 10008 5 1 4 1 1 88 59 dataSet setValue MCdicom SOP_INSTANCE_UID 1 2 3 4 5 6 7 300 dataSet setValue MCdi
54. MERGECOM_3_SERVICES parameter of the MergeCOM3 section of the MERGE INT file Remember the Service Profile is GENERATED by the Merge DICOM Profile Database Utilities at Merge OEM Unless you are absolutely confident about changes being made DO NOT CHANGE THE CONTENTS OF THIS FILE The Service Profile contains the following sections innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual Table 39 Service profile parameters SERVICE_TABLE lt service_number gt ITEM_TABLE Description List of service names and numbers This list registers every service available to an Application Entity The parameters associated with SERVICE_LIST are NUMBER_OF_SERVICES_ SUPPORTED the number of service names that will be listed immediately following NUMBER_OF_SERVICES_ SUPPORTED and one entry for each supported service One section number for each of the above services registered in SERVICE_TABLE Each section contains a Service Name a DICOM SOP Class UID for the Service a flag that tells whether it is a BASE or META Service SOP and a list of commands supported for that service One item name and number for each DICOM item that can be encoded in an attribute of Value representation SQ Sequence of Items innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 Appendix E Proprietary Schema XML structure The Merge DICOM Toolkit provides an API to co
55. Media App l Q R App Sample Store App o DICOM Application ome Merge DICOM Toolkit Advanced NET Library Message Info Database and Data Dictionary optional Merge DICOM Database Component Maintenance Y Component XN y Da Figure 3 Merge DICOM Toolkit Library Organization Merge DICOM C C Toolkit Dynamic Library The Merge DICOM C C Toolkit Dynamic Library usually named Mergecom Native dll for the Merge DICOM NET C Toolkit contains the core DICOM functionality required by the NET toolkit This library services many of the methods of the NET DICOM Toolkit The Merge DICOM NET C Toolkit Assembly and the Merge DICOM C C Toolkit run time library shipped with it have been carefully designed to be re entrant and have been validated to be thread safe The Merge DICOM innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 qe e Performance Tuning The sample applications can be a big help Assembly automatically performs all DICOM network activity for each association instance in its own thread When a Merge DICOM Toolkit Application is first run it reads in its configuration files usually named merge ini mergecom app mergecom pro and mergecom srv Toolkit configuration is described later in this document These configurable parameters are maintained in ASCII files for easy modification When modifying your configuration files your appli
56. Reporting c cccccceeeeeeceeeeceeeeeeaeeeeeeeseeeesaeeesaeseeneeeaas 160 Structured Report Structure and Modules cccceecceeeeeeeeeeeeeeseeeeeeeeees 160 Content Item Types ccccceeececeeeceeeeeeeeeeeeeeeeeceaeeeeaaesneneeseeeeesaaeseeaaeeseneeeaas 164 Relationship Types between Content IteMS ccecceeeeeeeeseeeeeteeteeeeees 166 Content Item Identifier cee cceccececseneeeeseeaeeeeeesaeeeseeeaeeeseeaeeeeeeaeeeeeeaas 167 Observation Context 0 cccccceeececeeeeeeeeeeeeeeeeeeeeeeeaeeeeaeeseeeeeseaeeesaeeseaeeseeneess 168 Structured Reporting Templates c ccceccceceeeeeeseeceeeeseeeeeseaeeeseeeeeeeeeeas 169 Overview of the Merge DICOM Toolkit SR Classes 0 ccsccccssseeeeees 173 Encoding SR DOCUMENIS ceccceceeeeeeeeeeeeeeeeeaeeeeaaeeeeeeeseaeeesaeeeeaeeseenees 174 Reading SR Documents cceccceceeeeeeeeeceeeeeeeeeesaaeeeeneeseeeesaeeeeeeseenees 177 innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 Working with Mergecom WADO ClaSSE6S cccccceseeceeseeceeeeeseeeeeaeeeeeeeenaees 178 Configuring Wado Http Controllers and MCwado ServiceS e0 178 Constructing an MCrequest ccccceeeseeeeeeeeceeeeeeaeeeeeeeceaeeeseaeeeeaaeeeeeeeeaas 179 Using MCrequestParameter and MCrequstAttribute Classes 08 180 Implementing IMCservice and IMCcache Interfaces senene 181 Using MCdicomResponse Class
57. The nesting level of Content Items is denoted by gt symbols one per level of nesting below the initial Source Content Item of the Template in a manner similar to the depiction of nested Sequences of Items in Modules Tables in Part 3 of the DICOM When it is necessary to specify the Target Content Item s of a relationship they are specified in the row s immediately following the corresponding Source Content Item The Merge DICOM Toolkit provides functions to add nested child Content Items to the parent Content Item node The following function shall be used to add a child node with relationship public void AddChild MCcontentItem childItem MCrelationshipType relationshipType Relationship with Source Content Item Parent Relationship Type and Mode are specified for each row that specifies a target content item The Relationship Types are enumerated in the Table 22 innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 Abbreviations used in templates Relationship Type and Mode may also be specified when another Template is included either top down or bottom up or both i e in the INCLUDE Template row of the calling Template or in all rows of the included Template or in both places There shall be no conflict between the Relationship Type and Mode of a row that includes another Template and the Relationship Type and Mode of the rows of the included Template When the r
58. V 5 1 0 Swapping pixel data bytes Swap Method Handling Compressed Data 8 bit Pixel Data For DICOM s Implicit VR Little Endian transfer syntax the pixel data attribute s 7fe0 0010 VR is specified as being OW independent of what the bits allocated and bits stored attributes are set to To reduce confusion Merge DICOM Toolkit sets the VR of pixel data for the other non encapsulated transfer syntaxes to OW When retrieving or setting pixel data with aMCdataSink or MCdataSource class the toolkit assumes that the OW pixel data is encoded in the host system s native endian format as defined by DICOM Figure 12 describes how 8 bit pixel data is encoded in an OW buffer for both big and little endian formats 7 0 7 0 Byte 0 Byte 0 MSb Pi Byte 1 Byte Byte 2 Byte 2 Byte 3 Byte 3 Byte 4 Byte 4 ByteS MSb_ Pixel5 Lsb ByteS Msb Pixel6 Lsb e e e Big Endian Machines Little Endian Machines Figure 12 Sample Pixel Data Byte Stream for 8 bits Allocated 8 bits Stored High bit of 7 VR OW The DICOM standard specifies that the first pixel byte should be set to the least significant byte of the OW value The next pixel byte should be set to the most significant byte of the OW value This implies that on big endian machines 8 bit pixel data is byte swapped from the OB encoding method Note that NET and Windows is in Little Endian format Encapsulated Pixel Data Merge DICOM Toolkit supports the DICOM
59. a value A message is constructed of attributes with each attribute identified by a tag An attribute is a unit of data e g Patient s Name Scheduled Discharge Date A tag is a 4 byte number identifying an attribute e g 00100010H for Patient s Name 0038001CH for Scheduled Discharge Date A tag is usually written as an ordered pair of two byte numbers The first two bytes are sometimes called a group number with the last two bytes being called an element number e g 0010 0010 0038 001C This terminology is partly a remnant of the ACR NEMA Standard where elements within a group were related in some manner This can no longer be depended on in DICOM but the ordered pair notation is still useful and often easier to read Also the ordered pair notation is important when defining a Tag for a private attribute We will see later that all private attributes must have an odd group number Each attribute identified by a Tag Command Object Instance a Command Attribute Figure 6 A DICOM Message Object Instance Attribute DICOM Data Dictionary Attributes have certain characteristics that apply to them no matter what message they are used in These characteristics are specified in the DICOM innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual Data Dictionary Part 6 of DICOM and are Value Representation VR and Value Multiplicity VM Value Representation c
60. an attribute according to the rules defined in DICOM A number of other properties are also defined for MCvr that describe the properties of a VR These properties are detailed in the Windows Help file Using the MCtag class MCtag An MCtag object identifies a DICOM attribute All class methods that require an attribute identifier use the MCtag object for that identification Note that in most cases these routines also allow the use of uint values to represent a DICOM tag As mentioned before a DICOM tag is usually written as an ordered pair of two byte numbers The first two bytes are sometimes called a group number with the last two bytes being called an element number e g 0010 0010 0038 001C The MCtag class addresses the fact that DICOM allows both private and non private attributes The group number for private attributes must always be odd while the group number for non private attributes must always be even Private attributes belong to a private group identified by a private code string and private groups may only have 254 elements numbered 1 through 255 innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 Constructing non private tags Non Private Tags Non private tags may be constructed using a 32 bit integer number or using a 16 bit group number plus a 16 bit element number MCtag tag try tag new MCtag 0x00080010 catch MCillegalArgumentException e o
61. be listed Each sequence of items is indented in the listing four spaces to the right of its owning message or items MCattributeSet as a non null referenc as list 0 list to the standard output stream System 10 StreamWriter writer new StreamWriter myFile as list writer list to myFile Converting an Attribute Set into a Proprietary Schema XML Attribute set to XML String conversion You can convert a list of attributes of an attribute set along with their values into writeTOXML method proprietary schema XML string by using the writeToXML method of the MCattributeSet The writeTOXML method creates an XML string describing the contents of the MCattributeSet The XML buffer is written to the stream identified by the stream object provided Note If the object contains an attribute with a Value Representation of SQ sequence of items each item in the sequence will be converted into its XML representation The following example shows how the writeTOXML method is utilized at a high level MCdataSet ds a non null referenc MCxmlOptions xmlOptions MCxmlOptions XmlOptIncludeBulks XmlOptExcludeSequences StreamWriter writer new StreamWriter myXMLFile convert DICOM DataSet to an XML file ds writeToxML writer xmlOptions writer Close The following configuration flags are defined in the MCxmlOptions enumeration and are available for the Attribute Set to XML conversion
62. below is a guideline for writing a DICOM conformance statement for your application Since the Toolkit is not an application this section only gives an outline of the DICOM services it supports Responsibility for full DICOM conformance to particular SOP classes rests with the application developer since many of the requirements for such conformance lie outside the realm of the Toolkit For example the high level behavior of Query Retrieve service class SCUs and SCPs as defined in Part 4 of the DICOM standard is implemented by the application developer in conjunction with the toolkit functionality Conformance Statement Sections Implementation Model The Implementation model consists of three sections e the Application Data Flow Diagram which specifyies the relationship between the Application Entities and the external world or Real World activities e a functional description of each Application Entity and e the sequencing constraints among them Application Data Flow As part of the Implementation model an Application Data Flow Diagram is included This diagram represents all of the Application Entities present in an implementation and graphically depicts the relationship of the AE s use of DICOM to Real World Activities as well as any applicable user interaction The Merge DICOM Toolkit provides the core functionality required to facilitate data flow between SCUs and SCPs Application conformance statements include a data
63. coded in the tree The initial Observation Context from outside the tree can be explicitly replaced If a Content Item in the SR Document Content tree has Observation Context different from the context already encoded elsewhere in the IOD the context information of that Content Item shall be encoded as child nodes of the Content Item in the tree using the HAS OBS CONTEXT relationship i e Observation Context is a property of its parent Content Item The context information specified in the Observation Context child nodes i e target of the HAS OBS CONTEXT relationship adds to the Observation Context of their parent node Content item and shall apply to all by value descendant nodes of that parent node regardless of the relationship type between the parent and the descendant nodes Observation Context is encoded in the same manner as any other Content Item Observation Context shall not be inherited across by reference relationships Observation DateTime is not included as part of the HAS OBS CONTEXT relationship and therefore is not inherited along with other Observation Context The Observation DateTime Attribute is included in each Content Item which allows different observation dates and times to be attached to different Content Items The IOD may specify restrictions on Content Items and Relationship Types that also constrain the flexibility with which Observation Context may be described innovative imaging Merge DICOM Toolki
64. constrains on the Content Item Types and their relationships Figure 18 illustrates the typical SR Document structure The top level header is similar to the DICOM image IODs and consists of the same Patient Study and Series modules The main difference from other IODs is the SR Document Content Module The attributes in this Module convey the content of an SR Document innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 Patient Module Patient Name Patient ID Patient Sex Patient Date Of Birth General Study Module Study Instance UID Accession Number SR Document Series Module Modality SR Document General Module Referenced Request Sequence gt Requested Procedure ID gt Requested Procedure Description SR Document Content Module Node 1 Contains Node 2 Has Obs Ctx ooi lt n gt Node C1 Node C2 Node 3 Node 4 Figure 18 SR Document Structure example The Document Content Module has a tree structure and consists of a single root Content Item Node 1 that is the root of the SR Document tree The root Content Item conveys either directly or indirectly all of the other nested Content The SR Document Hierarchy Items in the document The hierarchical structuring of the Content Tree is provided by recursively nesting Content Items A parent or source Content Item has an explic
65. container for a specific attribute s value and calls methods of the class to get or set the attribute s value Such container classes are registered only for attribute s that have values of great length such as pixel data The methods of the MCattributeContainer class exhibit one significant difference from the methods used in the MCdataSink and MCdataSource interfaces described earlier MCattributeContainer classes throttle the data flow as the message object is communicated over the network Rather than storing innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual attributes with large OB OW OF values within the message object itself your application is responsible for maintaining the value of these attributes We will also see that MCattributeContainer objects affect accessing media files See the discussion of this in the DICOM Files section later in this manual Using an Attribute Container in a Server Application Server callbacks A server SCP application can register a MCattributeContainer object that will be called repetitively as the attribute s value arrives on an association during a MCassociation read call By the time the read method returns to the application the attribute value will already have been handled by your MCattributeContainer class The MCattributeContainer class could be used by the server to treat this large block of OB OW OF data usually pixel data specially e g
66. cref MCrequestType gt lt summary gt public static MCrequestType WadoURI new MCrequestType Name WADOURI lt summary gt WadoRS lt see cref MCrequestType gt lt summary gt public static MCrequestType WadoRS new MCrequestType Name WADORS lt summary gt WadoWS lt see cref MCrequestType gt lt summary gt public static MCrequestType WadoWS new MCrequestType Name WADOWS lt summary gt Stow lt see cref MCrequestType gt lt summary gt public static MCrequestType Stow new MCrequestType Name STOW lt summary gt Qido lt see cref MCrequestType gt lt summary gt public static MCrequestType Qido new MCrequestType Name QIDO lt summary gt Unknown lt see cref MCrequestType gt lt summary gt public static MCrequestType Unknown new MCrequestType Name UNKNOWN The list of MCrequestParameter consists of WADO request parameters for that specific request which might include DICOM attributes as well Examples of MCrequest for different WADO request types are given in Appendix F MCrequest class implements MCrequest Submit method to send a request to the DICOM service which returns an HttpResponseMessage object as a result of the request Internally MCrequest object accesses an MCwado singleton object to get a registered IMCservice and an IMCcache interfaces for storing or retrieving DICOM objects an IMCdicomRenderer interface to render DICO
67. data source that reads from a file A file name is supplied to the constructor and the class will automatically supply the contents of this file The MCstreamDataSource class implements a data source that reads from a System 10 Stream derived instance For example an instance of the System IO FileStream class can be used to read the file Finally the MCmemoryDataSink class also implements the MCdataSource interface This class also implements the MCdataSink interface which is described in a subsequent section The MCmemoryDataSink class implements a data source where the data is supplied from memory The MCmemoryDataSink class constructor takes an MCdata instance in the constructor which contains the actual data being supplied innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual Retrieving Attribute Values When your AE receives a DICOM message it will most often need to examine the values contained in the message attributes to perform an action e g store an image print a film change state If your application is a server the message conveys the operation your server should perform and the data associated with the operation If your application is a client the message may be a response message from a server on the network resulting from a previous request message to that same server Retrieving values Once you have received an MCattributeSet object probably one contained in an from an attribute set
68. file using based 64 encoded string Converting a DICOM JSON Model String into an Attribute Set Array of JSON objects to artayof Attribute set You can read attribute values from a DICOM JSON Model string that containing conversion multiple JSON objects into an array of attribute set objects by using the readDataSetsFromJSON method of the MCattributeSet readDataSetsFromJSON The following example shows how the readDataSetsFromJSON method is utilized at a high level StreamReader reader new StreamReader myXMLFile MCdataSet dsa ds readDataSetsFromJSON reader To handle bulk URI from a DICOM JSON Model file the MCbulkDataUriHandler interface is used Following shows how to implement this task class BulkDataUriHandler MCbulkUriHandler public object provideData MCattributeSet attrSet unit tag MCvr vr string uri if tag MCdicom PIXEL_DATA use parameter uri to retrieve your data based on your data create an array of datasize byte data new byte datasize populate your data array return data call an overloaded method of readFromXMLNative dsa readDataSetsFromJSON reader new BulkDataUriHandler By default if no bulk URI handler is supplied and a bulk URI attribute is encountered in the JSON file the toolkit will generate an empty attribute tag with zero length for the encountered tag innovative Imaging NET C User s Manual Merge DICOM Toolkit
69. flow diagram An example is shown below for a simple Storage Service Class SCP Local Remote Remote Storage Service Class user Write received images to disk j ____ MERGE_STORE_SCP Association Acceptance DICOM Standard Interface Figure C 1 MERGE_STORE_SCP application data flow diagram innovative Imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 Functional Definition of Application Entities AE This section contains a functional definition for each individual local Application Entity It describes in general terms the functions that are performed by the AE and the DICOM services used to accomplish these functions In this sense DICOM services refers not only to DICOM Service Classes but also to lower level DICOM services such as Association Services Application conformance statements are described in this section with a general specification of functions to be performed by SCU or SCP Sequencing of Real World Activities If applicable this section will contain a description of sequencing as well as potential constraints on real world activities These include any applicable user interaction as performed by all the AEs A UML sequence diagram that depicts the real world activities as vertical bars and shows events exchanged between them as arrows is strongly recommended Application conformance statements are included in this section along with any associated sequence of
70. for the current association The ResultCode property retrieves the result reason code returned by the remote DICOM system for this context The RoleNegot iated property retrieves the role negotiated for the association requestor for this service During association negotiation for each proposed service the association requestor proposes that it serve as an SCU service class user and or an SCP service class provider An association acceptor can accept or reject the proposal The ServiceName property retrieves the Merge DICOM service name of this service which has been successfully negotiated between two DICOM application entities The TransferSyntax property retrieves a MCtransferSyntax object that contains the Merge DICOM id for the negotiated transfer syntax as well as its DICOM Transfer Syntax UID MCtransferSyntax properties The MCtransferSyntax class provides methods to retrieve properties of the DICOM transfer syntax encapsulated by class instances Since the only instances are those defined by the static fields of the MCtransferSyntax class the operator can be used to check two transfer syntax references for equality The Name property retrieves the transfer syntax name provided by Merge DICOM for the transfer syntax The Uid property retrieves the DICOM Transfer Syntax UID associated with the transfer syntax The BigEndian property determines if the transfer syntax uses big endian encoding or not and the Li
71. gt Implements Http Get methods for DICOM QIDO RS requests lt summary gt public class MCgidoController MCcontroller lt summary gt Class constructor lt summary gt innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual public MCqidoController base lt summary gt Http Get method lt summary gt lt param name request gt lt see cref HttpRequestMessage gt object lt param gt lt returns gt lt see cref HttpResponseMessage gt object lt returns gt HttpGet public HttpResponseMessage Get HttpRequestMessage request Name MCcontroller MCQIDOCONTROLLER return new MCrequest request MCrequestType Qido Submit lt summary gt Http Get method lt summary gt lt param name request gt lt see cref HttpRequestMessage gt object lt param gt lt param name studyInstanceUid gt StudyInstanceUID parameter lt param gt lt returns gt lt see cref HttpResponseMessage gt object lt returns gt ActionName studyinstanceuid public HttpResponseMessage Get HttpRequestMessage request String studyInstanceUid List lt MCrequestParameter gt parms new List lt MCrequestParameter gt string keyword MCwado DicomKeywords MCdicom STUDY_INSTANCE_UID MCrequestAttribute attr new MCrequestAttribute Item keyword Tag MCdicom STUDY_INSTANCE_UID Keyword keyword Values new string studyInstanceUid parms Add n
72. hooks to your applications underlying file system DICOM Application Entity Service Classes Association Part4 Negotiation Part 7 Annex D Information Objects Part 3 Data Dictionary Part 6 Upper Layer Data Structures and Encoding Part 5 Association Services DICOM Message Services DICOM Storage M edia Element DIM SE and File Format Part 7 Part 10 Upper Layer Presentation Data Service DICOM Media Formats Part 8 and Physical M edia Part 12 Key Merge Your ey Functionality Functionality Figure 2 The DICOM Application Layer innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 The DICOM Toolkit also supplies useful utility programs for testing a DICOM network connection creating sample DICOM messages and writing them to a file and for validating and listing the contents of DICOM messages Finally sample application along with sample working source code give you valuable examples to work from when developing your own DICOM applications The DICOM Standard and the Merge Healthcare DICOM Toolkits allow applications to add private information to a DICOM message or file For most application developers this is more than sufficient For applications that need to define their own non standard private network or file services an optional Merge DICOM Database Manual is available which describes the use of additional tools to extend the data dictionary Development Platfo
73. interface The following namespaces are utilized by the Merge DICOM NET assembly using Mergecom using Mergecom Exceptions using Mergecom Gen using Mergecom Logging Library Constants The MCdicom interface is generated from the Merge DICOM dictionary and contains constant values for all of the attributes defined by the DICOM standard A copy of the interface source file is included with the library although you will never have a need to actually compile the file Exception Handling Each of the Toolkit classes is documented in the Merge DICOM NET Assembly Help File The exceptions that each class may throw are documented there Merge DICOM methods throw exceptions derived from MCexception class that extend the System ApplicationException class A special group of exceptions is MCruntimeException derived exception classes that are thrown for serious problems within the Assembly or when untenable conditions have been detected Most applications would not catch these exceptions When an instance of MCexception is thrown a message is logged to the Merge DICOM log file if the severity level of the exception is enabled in the merge ini file Most exceptions have a severity level of error and are always logged Each MCexception object has a public exceptionNumber field that identifies the exception If desired you may simply catch MCexception and then interrogate the exceptionNumber property to determine which spe
74. known or if there is no need to validate that values will be set only for attributes pati to validate the data assigned to a given service command pair It creates an empty MCdataSet object The MCfile object is not associated with any particular DICOM service or command If the validate method is to be called the setServiceCommand method must be called first to associate this file object with a given DICOM service and command MCfile myFile new MCfile or String file MyFileName MCfile myFile new MCfile file Convert an MCdimseMessage object to an MCfile object When you want One form of the constructor converts an MCdimseMessage object message to save a network message into a file object associated with the specified file system file The data set ina contained in message will be used in this object DICOM media file String fileName MyFileName MCdimseMessage message a non null referenc myFile new MCfile message fileName Note The original MCdimseMessage and the new MCfile objects will be sharing the same MCdataSet object Setting data set values If the command and serviceName parameters are not provided it is not necessary to add attributes to the data set before setting attribute values If one of the set value methods of the contained MCdataSet object is used for an attribute the attribute will automatically be added to the data set before the value is set This is NOT TH
75. lt param gt lt returns gt lt see cref HttpResponseMessage gt object lt returns gt ActionName metadata public HttpResponseMessage Get HttpRequestMessage request String studyInstanceUid object metadata List lt MCrequestParameter gt parms new List lt MCrequestParameter gt string keyword MCwado DicomKeywords MCdicom STUDY_INSTANCE_UID MCrequestAttribute attr new MCrequestAttribute Item keyword Tag MCdicom STUDY_INSTANCE_UID Keyword keyword Values new string studyInstanceUid parms Add new MCrequestParameter Name keyword RequestRequirement MCrequestParameter Requirements REQUIRED Attributes new List lt MCrequestAttribute gt attr 3 3 return new MCrequest request MCrequestType WadoRS parms ToArray lt MCrequestParameter gt Submit lt summary gt Http Get method lt summary gt lt param name request gt lt see cref MCrequest gt oject lt param gt lt returns gt lt see cref HttpResponseMessage gt object lt returns gt ActionName bind public HttpResponseMessage Get ModelBinder typeof MCrequestBinder MCrequest request return request Submit MCwadoRsController URI route templates HttpConfiguration config new HttpConfiguration config Routes MapHttpRoute name MCwadoRsBulkdata routeTemplate api controller bulkdata uri innovative imaging NET C User s Manual Merge DICOM To
76. made Many times the validate method is selectively used in an application as a runtime option or conditionally compiled into the source code Validation might only be used during integration testing or in the field for diagnostic purposes Reasons for this include performance since the overhead associated with message validation may be an issue especially for larger messages having many attributes or on lower end platforms Also validation can clutter the message log with warnings and errors that may not be desirable in a production environment Performance issues related to message handling are discussed further under Message Exchange later in this document innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 validateAttribute Message stream defined Streaming methods streamOut streamIn streamLength MCstreamOffset Validating a Single Attribute If you wish to validate only a single attribute you may use the validateAttribute method of the MCdimseMessage MCfile or MCdataSet class The validateAttribute method works exactly as the validate method with the exception that you provide a tag parameter to identify the attribute use wish to have validated MCdimseMessage msg non null referenc bool validates validates msg validateAttribute 0x00100010 MCvalidateLevel Errors_Only if validates MCvalidationError err msg getNextValidationError j while err n
77. mergecom app specifies the characteristics of your own application entity and the AE s your application will connect with over a network The name and location of this file is specified in the MergeCOM3 section of the Merge DICOM initialization file When your application acts as a client SCU you must specify in the Application Profile the network address of the server SCP Application Entities you wish to connect open an association with Your client refers to the application entity by a DICOM Application Entity Title and this is the same way it is referred to in the application profile The AE title consists of a string of characters containing no spaces and having a length of 16 characters or less A section of the profile exists for each Server AE you wish to connect with innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual For example if your application is an image source and also performs query and retrieval of images from two separate DICOM AE s it might contain sections like the following Acme_Store_SCP PORT_NUMBER 104 HOST_NAME acme_sunl SERVICE_LIST Storage_Service_List Acme_QR_SCP PORT_NUMBER 104 HOST_NAME acme_hp2 SERVICE_LIST Query_Service_List Acme_Store_SCP and Acme_QR_SCP are the AE titles for the applications you wish to connect with The storage server runs on a Sun computer having the host name acme_su
78. presentation contexts the client SCU must use the TransferSyntax property of the MCdimseMessage class to specify which presentation context to send a message over as follows A DICOM message ready to send MCtransferSyntax JpegBaseline MCdimseMessage dm dm TransferSyntax Server SCP applications are configured differently than client SCU applications An SCP should include all of the transfer syntaxes a service supports in a single transfer syntax list If more than one transfer syntax list is used for a service server SCP applications will only support the transfer syntaxes contained in the first transfer syntax list The following is an example configuration for a server SCP Storage_Service_List SERVICES SUPPORTED SERVICE_1 SYNTAX_LIST_1 1 Number of Services STANDARD_CT CT_Syntax_List_SCP CT_Syntax_List_SCP SYNTAXES_ SUPPORTED SYNTAX_1 4 JP Number of Syntaxes EG BASELINE innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 A brief review MCdataElement MCtag MCattribute MCvr MCdimseMessage contains an MCcommandSet and optionally an MCdataSet SQ attributes have MCitem objects as values SYNTAX_2 EXPLICIT _LITTLE_ENDIAN SYNTAX_3 IMPLICIT _LITTLE_ENDIAN SYNTAX_4 EXPLICIT_BIG_ENDIAN As discussed previously for server SCP applications the order in which t
79. properties Normally you will only deal with the data set and the command set attributes will be set automatically by Merge DICOM Toolkit MCdimseMessage dm uhort command MCdimseService C_STORE_RQ String serviceName STANDARD_CT dm new MCdimseMessage command serviceName The library uses the serviceName parameter to reference the proper message info file along with the data dictionary and builds a MCdataSet object containing all of the attributes that may be used for that the service class innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual The command parameter is used to inform Merge DICOM what values must be placed in the MCcommandcSet it constructs for you Exceptions will be thrown if either of the parameters in invalid Construct a message with an empty data set A second form of the constructor is used if the service and command are not yet known or if there is no need to validate the values that will be set It creates an empty MCdataSet object as well as the MCcommandSet object The MCdimseMessage object is not associated with any particular DICOM service or command If the object is to be used to send a message to a network partner or if the validate method is to be called the setServiceCommand method must be called first to associate this message object with a given DICOM service and command MCdimseMessage dm dm new MCdimseMessage Construct a message usi
80. provided If no stream object is specified the report will be written to the system s standard output stdout list If the object contains an attribute with a Value Representation of SQ sequence of items each item in the sequence will be listed Each sequence of items is indented in the listing four spaces to the right of its owning message or items System 10 StreamWriter writer new StreamWriter myFile myFile list writer list to myFile myFile list list to stdout Using the MCmediaStorageService Class DICOM Analogous to the MCdimseService class that handles DICOM network message File Service Classes exchange the MCmediaStorageService class handles services dealing with DICOM media files The MCmediaStorageService provides methods to read and MCfileService write DICOM files MCmediaStorageService All the media interchange functionality of the DICOM Toolkit relies on methods that you supply to interface with the particular physical medium and file system format on your target device This approach was chosen because of the wide variety of media and file system configurations allowed by the DICOM Standard and the potentially unlimited combination of media devices device drivers and file system combinations for which DICOM media interchange applications may be developed You must interface with the Similar to working with streams if your application will read DICOM files you selected media device mu
81. removable media This file format is a logical extension of the networking portion of the standard When an object instance that was communicated over a network would also be of value when communicated via removable media DICOM specifies the encapsulation of these object instances in a DICOM file DICOM Files DICOM File Structure A DICOM File is the encapsulation of a DICOM object instance along with File Meta Information File meta information is stored in the header of every DICOM MCfile file and includes important identifying information about the encapsulated object MCfileMetalnfo instance and its encoding within the file see Figure 7 innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 File Preamble 128 byte optional extra padding attribute FFFC FFFC Four byte DICOM Prefix DICM Each attribute identified by a Tag Dsi EEEN L__ File Meta _L__ Object Instance 7 AF Byte Stream N Optional Padding Attribute File Meta Info Attribute Object Instance Attribute Figure 7 A DICOM File The file meta information begins with a 128 byte buffer available for application profile or implementation specific use Application Profiles standardize a number of choices related to a specific clinical need modality or application and are specified in Part 11 of the DICOM Standard The next four bytes of the meta information contain the DICOM prefix which is always D
82. the ItemName property of the MCitem class to set or get the item name Constructing MCdataSet Objects DICOM network services MCdimseService classes and file service MCmediaStorageService class each deal with information objects These objects are sets of attributes that provide information about the real world entities being acted upon by the service The MCdataSet class encapsulates such an information object The DICOM messages used in DIMSE services MCdimseMessage class contain a command set object MCcommandSet and an MCdataSet object The DICOM media storage service deals with file objects MCfile that contains a set of file meta information MCfileMetalnfo class and an MCdataSet object MCdataSet objects are related to specifiC C DICOM service command pairs i e SOP classes Normally you construct new instances by providing the service name that identifies the DICOM information object and the DIMSE command that will be used with the information object By providing the service and command Merge DICOM can retrieve all of the attributes used for the service and pre populate the data set with those attributes Of course no values are assigned to the attributes yet that is your job ushort command MCdimseService C_STORE_RQ String serviceName STANDARD_CT MCdataSet ds new MCdataSet command serviceName The command can be any of the valid constant values defined in the MCdimseService class Please r
83. the first attribute whose tag is gt the last tag parameter This method can be used to increase performance for handling attributes of Value Representations OB OW OD or OF It is most useful when a file contains pixel data 7FEO 0010 as its last attribute and this pixel data is very large In these instances you may wish to ignore the pixel data read it in later using the returned file offset or process it directly from the file using your own special filters or hardware This can be done by specifying MCdicom PIXEL_DATA for last tag parameter Capplication myApp non null referenc Cfile fileObj new MCfile FileName CdataSource source new MCfileDataSource fileObj FileName CmediaStorageService service new MCmediaStorageService myApp try service readFileUpToTag fileObj MCdicom PIXEL_DATA 1 source catch Exception e The other way to handle the large pixel data 7FE0 0010 is to use overloaded readFileUpToTag method defined with parameter bypassOBOW If bypassOBOW is set to true than the attribute will be read innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 writeFile DICOM allows you to pad the file Merge DICOM Toolkit assures accurate group lengths You control the endian used in the file stream Merge DICOM Toolkit automatically sets fields in the File Meta Information but its attributes value igno
84. toolkit will abort associations when these values do not match DEFAULT NO If set to NO the remote system must specify the local IMPLEMENTATION_CLASS_UID when requesting an association If set to YES a different implementation class UID may be used DEFAULT YES If set to NO the remote system must specify the local IMPLEMENTATION_VERSION when requesting an association If set to YES a different implementation version may be used DEFAULT YES If set to YES SCP applications will allow multiple presentation contexts to be negotiated for a single DICOM service If set to NO an SCP will only accept a single presentation context for a DICOM service DEFAULT YES innovative imaging NET C User s Manual Merge DICOM Toolkit v 5 1 0 ACCEPT_RELATED_GENERAL_SERVICES ACCEPT_STORAGE_SERVICE_CONTEXTS AUTO_ECHO_SUPPORT DEFLATED_EXPLICIT_LITTLE_ENDIAN_ SYNTAX EXPLICIT_BIG_ENDIAN_SYNTAX EXPLICIT_LITTLE_ENDIAN_SYNTAX HARD_CLOSE_TCP_IP_CONNECTION IMPLEMENTATION_CLASS UID IMPLEMENTATION_VERSION Description This parameter sets the Merge DICOM Toolkit behavior in regards to support for DICOM Supplement 90 Supplement 90 defines a method for association requestors to specify the generalized version of a SOP Class When set to YES Merge DICOM Toolkit will allow association acceptors to accept a presentation context whose generalized SOP Class is supported however the customized SOP Class is not specific
85. used to report both firstError warnings and errors while MCvalidationLevel Ful1 could be used to report nextError errors warnings and informational messages If MCdimseMessage validate returns false your application can use the getNext ValidationError method to retrieve MCvalidationError objects that describe the error Each MCvalidationError instance has these public properties e Tag A uint identifying the DICOM tag in error e AttributeSet the MCattributeSet derived class containing the attribute in error e ValueNumber specifies which of the attribute s values was in error e ErrorDescription a String describing the error e ErrorNumber a number identifying the error Refer to the MCvalidationError class in the Assembly Windows Help File for the error numbers that may be returned The ToSitring method in the MCvalidationError class provides a convenient way to display a validation error A sample string that includes imbedded line feeds follows Attribute tag 0x00100010 Patient s Name Example Output Dataset Mergecom MCdataSet Value Number 0 Description Invalid value for this tag s VR Error Number 28 It is on the initial call to the validate method that all the validation takes place and that the results of the validation for the entire message are logged to the message log file Subsequent calls to the getNext ValidationError method simply steps through the results of the validation passing
86. we will see that they are contained in DICOMDIPR s An attribute whose value is a sequence of items is simply an attribute that has a potentially large and complex value Fortunately Merge DICOM Toolkit allows your application to deal with sequences of items an item at a time and hierarchically as pictured in Figure 15 and takes care of the encoding of the sequence within the DICOM message stream SQ Attribute Command Object Instance o DICOM Message SQ Attribute a ee Ree Item 1 Sequence of Ite Item 1 Item 2 Item 1 Sequence of Items Sequence of Items D Command Attribute Object Instance Attribute innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual Figure 15 A DICOM Message containing doubly nested sequences of items Encoding and decoding Each item in a sequence is handled as a special derived sub class of the attributes in an item MCattributeSet class called MCitem All the MCattributeSet methods are inherited by the MCitem class Similar to the constructors for MCdataSet objects there are two variations of the MCitem constructor You can create an empty item attribute set by providing no parameter to the constructor If you wish to have the item populated by Merge DICOM with specific attributes you supply an itemName parameter used to identify the item If the itemName is unknown to Merge DICOM a warning message is logged and an empty MCitem object is constru
87. with potential UN VR problems The following sections describe these issues in further detail Merge DICOM Required Files There are a number of files required by Merge DICOM applications These files are described in Table 25 Table 25 Files needed when deploying an application File Description and Use Mergecom dll NET Merge DICOM library wrapper This library services your calls to the Native Merge DICOM Toolkit Library Mergecom Native dll Native Merge DICOM Toolkit library required for deployments on 32 bit platforms Mergecom Native64 dll Native Merge DICOM Toolkit library for 64 bit processes required for deployments on 64 bit platforms Mergecomws dll NET Mergecom DICOM WADO library wrapper This library services your calls to DICOM WADO Only present in the edition for 64 bit platforms innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 Description and Use Picn20 dll Pegasus libraries used for compression Picn6220 dll Pegasus Imaging Corporation Hwww jpg comH Picn6320 dll required for deployments on 32 bit platforms Picn6420 dll Picn6520 dll Picn6820 dll Picn6920 dll picx20 dll 64 bit Pegasus libraries used for compression picx6220 ssm Pegasus Imaging Corporation Hwww jpg comH picx6320 ssm required for deployments on 64 bit platforms picx6420 ssm picx6520 ssm picx6820 ssm picx6920 ssm Merge DICOM initialization file This file contains logging conf
88. with the toolkit as follows MCapplication myAE myAE MCapplication getApplication ACME_Query_SCP MCapplication objects can be disposed If you wish to disable your application and free up its resources to the system you must release it using the Dispose method This is necessary to free the resources used by the underlying native dynamic library myAE dispose The Application Entity AE Title Current and potentially future DICOM service classes assume that Application Entity Titles on a DICOM network are unique For instance the retrieve portion of the Query Retrieve service class specifies that an image be moved to a specific Application Entity Title and not to a specific hostname and listen port If two identical Application Entity Titles existed on a network a server application can only be configured to move images to one of these applications For this reason the DICOM Application Entity Title for your applications should be configurable You can use the ApplicationTitle property to retrieve the Application Entity Title of the MCapplication object innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual Association Management Network Only Once you have registered one or more networking applications you will probably want to initiate an association if you are a client or wait for an association if you are aserver Clients will use the requestAssociation method of th
89. 032 Patient s Birth Time TM 3 0010 0040 Patient s Sex CS 2 Enumerated Values M F O 0010 0050 Patient s Insurance Plan Code Sequence SQ 3 Item Name s PATIENTS _INSURANCE_PLAN CODE 0010 1000 Other Patient IDs LO 3 0010 1001 Other Patient Names PN 3 0010 1005 Patient s Birth Name PN 3 0010 1020 Patient s Size DS 3 0010 1040 Patient s Address LO 3 0010 1060 Patient s Mother s Birth Name PN 3 0010 1080 ilitary Rank LO 3 0010 1081 Branch of Service LO 3 0010 1090 edical Record Locator LO 3 0010 2000 edical Alerts LO 3 0010 2110 Contrast Allergies LO 3 0010 2150 Country of Residence LO 3 0010 2152 Region of Residence LO 3 0010 2154 Patient s Telephone Numbers SH 3 0010 2160 Ethnic Group SH 3 0010 21A0 Smoking Status cs 3 Enumerated Values YES NO UNKNOWN 0010 21B0 Additional Patient History LT 3 0010 21C0 Pregnancy Status US 3 Enumerated Values 0001 0002 0003 0004 0010 21D0 Last Menstrual Date DA 3 0010 21F0 Patient s Religious Preference LO 3 0010 4000 Patient Comments LT 3 0038 0004 Referenced Patient Alias Sequence SQ 2 Item Name s REF_PATIENT_ALIAS 0038 0050 Special Needs LO 3 0038 0500 Patient State LO 3 What validation can do for While Merge DICOM validation is not foolproof it is very useful and will catch yous many standard violations It validates the following e That the value assigned to an attribute is appropriate for that attributes VR e That all value type 1 attributes have a val
90. 16 MAXIMUM 254 LOG_FILE_SIZE MergeCOM83 This is the number of 80 byte records which will be created for the log file i e the number of 80 character lines in the log file If BLANK_FILL_LOG_FILE is set to YES the file is initialized to all binary zeros before the first message is logged DEFAULT 1000 LOG_MEMORY_SIZE MergeCOM3 This is the number of 80 byte records which will be created for the memory log i e the number of 80 character lines in the memory file Note that this option is ignored when using the NET Assembly DEFAULT 1024 MERGECOM_3_ APPLICATIONS MergeCOMsS File containing the Merge DICOM application configurations MERGECOM_3_PROFILE MergeCOM3 File containing the Merge DICOM system profile parameters MERGECOM_3_SERVICES MergeCOM3 File containing the Merge DICOM system service and message definitions NUM_HISTORICAL_LOG_FILES MergeCOMS This parameter informs the toolkit of the number of historical log files to keep The valid range of number for this parameter is 1 99 The historical log files are named basename L01 to basename LXxX where basename LXxX is the latest log file The basename is determined by the LOG_FILE parameter When the maximum number of historical log files is met the oldest log file is deleted and the log files are renamed Note that a new log file is created each time the library is initialized This parameter is only used when LOG_FILE_BACKUFP is set to YES i
91. 5 1 0 MCdir The DICOMDIR The DICOM Directory File or DICOMDIR is a special type of a DICOM File A single DICOMDIR must exist within each DICOM file set and is always given the file ID DICOMDIR It is the DICOMDIR file that contains identifying information about the entire file set and usually dependent on the Application Profile a directory of the file set s contents Figure 8 shows a graphical representation of a DICOMDIR file and its central role within a DICOM File Set DICOMDIR File DICOM File Set DICOM Image Files Figure 8 A DICOM Directory File DICOMDIR within a DICOM File Set innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual The DICOMDIR hierarchy If the DICOMDIR file contains directory information it is composed of a hierarchy of directory records with the top most directory record being the root directory record A Directory Record identifies a DICOM File by summarizing key attributes and their values in the file and specifying the file ID of the corresponding file The file ID can then be used in the context of the native file system to access the corresponding DICOM file Each directory record can in turn point down the hierarchy to one or more related directory records Part 3 of the DICOM Standard specifies the allowed relationships between directory records in the section defining the Basic Directory IOD We reproduce this table here See Table 6 for
92. 8 1060 VW Invalid attribute for service 0l 3 52 09 00 7919 MC3 T5 0018 1250 VW Invalid attribute for service innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 01 13 52 09 00 7919 MC3 T5 0018 5101 VE Required attribute has no value gl 13 52 09 00 7919 MC3 T5 0020 0032 VW Invalid attribute for service 01l 3 52 09 00 7919 MC3 T5 0020 0037 VW Invalid attribute for service 01 3 52 09 00 7919 MC3 T5 0020 0052 VW Invalid attribute for service 01l 3 52 09 00 7919 MC3 T5 0020 0060 VI Unable to check condition 0l 3 52 09 00 7919 MC3 T5 0020 1040 VW Invalid attribute for service 01 13 52 09 00 7919 MC3 T5 0020 1041 VW Invalid attribute for service O1 13 52 09 00 7919 MC3 T5 0028 0006 VI Unable to check condition 01 13 52 09 00 7919 MC3 T5 0028 0030 VW Invalid attribute for service 01 13 52 09 00 7919 MC3 T5 0028 0034 VI Unable to check condition 0l 3 52 09 00 7919 MC3 T5 0028 1101 VI Unable to check condition 0l 3 52 09 00 7919 MC3 T5 0028 1102 VI Unable to check condition O1 3 52 09 00 7919 MC3 T5 0028 1103 VI Unable to check condition 01l 3 52 09 00 7919 MC3 T5 0028 1201 VI Unable to check condition Notice in this log file that all warnings and informational messages are also logged This is always the case although the first violation returned to the application was an error because M
93. AGCS E E E T E E E A AE 28 DICOM Data Dictionary cccccccecceeeceeeeeeeeeeeee eae eeeaaeeeeeeeseaeeesaeeteaeeeeeeees 28 Message Handling cccccesecceceeeeeeceeeeeeeeceeeeeseaeeeeaaeseeneeseaeeseaaeseeaeeeeeeeess 29 Private AttriDUtes sinisiin ccc ceenee cece ee ceeeeeeaaeeeeneeceaeeeeaaeseeaeeseeeeesaesseaaeeseneeeaas 31 Media Interchange cisiccade dads iets anise laid ante eivdnnine dais 31 DICOM Fila Sirianni anina anaa delet eters 31 File Sets earrannan dais nie dais adie aees 37 The DICOMDIR w2i teicierni dena daicienl dail d aint 38 File Management Roles and Services ccceccceeeeeeeeneeseeeeeeeeeeenaeeeeneeeaas 41 letolni ol dga 101e PEN E E E TT 42 Using the Merge DICOM ToolKit ccccccceseeceeeeeceeeeeeeaeeeeaeeseeeeeseaeeesaeeeeneeenaees 43 Config ralo iiaiai a aaa e aa a aa aE E a ence 43 initialization File cecseciecevess tenance cedetendccecealecaseaeedsncevanscededsssanneevvadaaeaged cane eevee debts 44 Application Profile cccccceceeeecceeeeseeeeeneeceeeeeeaaeeeeaaeeeeeeeseaeeesaaeseenaeeseneesaas 44 innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 System Profile sesecscdeseceneecesdl bbs iarann aaa aaaea aas aas 51 Service Profile esses ceca cii ve ceed lived aa cdees ces cidbeaadiewyaned Aki aaa a aaar 53 Message Logging iiaiicccect c cnaciv deste aentdhanbtee iaia aia 53 Wily Progr ais tes ieestescebteceeeeieeeeeiceee eh Anaa E eNEAN
94. B vrOW vrOL vrSQ e The data element s Value Multiplicity is specified by the n and m parameters The following table describes the effect of specifying zero one or both of the nand mparameters n specified m specified Value Multiplicity is 1 many no upper limit must have exactly n values e p yes yes n m at least n values no more than m values Use Short MAX_VALUE to specify no upper limit Non standard data elements are built using the following constructor MCdataElement de MCvr vr vrDT ushort n 1 minimum number of values allowed ushort m 5 maximum number of values allowed String name My Private Data Element try MCtag tagl new MCtag 0x8014 0x0010 de new MCdataElement vr tagl n m name catch MCillegalArgumentException e innovative Imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 Merge DICOM Toolkit attribute sets Messages and files Contain attribute sets MCdimseMessage Constructing a message to use with the MCdimseService base class An MCillegalArgumentException will be thrown if vr parameter was not a valid MCvr reference An MCillegalArgumentException will be thrown if n or m is less than 1 or if n gt m Working With Attribute Sets As mentioned above the MCattributeSet class encapsulates different types of attribute sets used by DICOM Sub classes of MCattributeSet are used to define t
95. BER_OF_CAP_ FILES EWRITE_CAPTURE_FILES Service Profile Items The Service Profile usually called mergecom srv informs the toolkit what MCKem types of services and commands it supports and what the corresponding message info files are This file also lists the meta services and items supported by the toolkit Items are the nested sub messages contained within attributes of a message having the VR Sequence of Item SQ and will be discussed in greater detail later The name and location of the service profile are specified in the MergeCOM3 section of the Merge DICOM initialization file The service profile along with the data dictionary and message info files is generated from the Merge DICOM Database and should be modified by other means only by very experienced or specialized users Additional information about the service profile can be found in System Profile Appendix D Configuration Parameters Message Logging Merge DICOM Toolkit supplies a message logging facility whereby three primary classes of messages can be logged to a specified file and or standard output e Errors e Warnings e Status Error messages include unrecoverable errors such as association aborted or failure to connect to remote application Other error messages may be catastrophic but it is left to the application to determine whether or not to abort an innovative imaging NET C User s Manual Merge D
96. C STORE Spectacle Prescription Report Storage C STORE Standalone Overlay Storage C STORE Standalone Curve Storage C STORE Standalone Modality LUT Storage C STORE Standalone VOI LUT Storage C STORE Stereometric Relationship Storage C STORE Ultrasound Image Storage C STORE Ultrasound Multi frame Image Storage C STORE Video Endoscopic Image Storage C STORE Video Microscopic Image Storage C STORE Video Photographic Image Storage C STORE Visual Acuity Measurements Storage C STORE VL Endoscopic Image Storage C STORE VL Microscopic Image Storage C STORE VL Photographic Image Storage C STORE VL Slide Coordinates Microscopic Image Storage C STORE innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual MCfile Naming DICOM File Sets and File ID s Service Command VL Whole Slide Microscopy Image Storage C STORE Wide Field Ophthalmic Photography 3D Coordinates Image Storage C STORE Wide Field Ophthalmic Photography Stereographic Projection Image C STORE Storage XA XRF Grayscale Softcopy Presentation State Storage C STORE X Ray Angiographic Image Storage C STORE X Ray Radiofluoroscopic Image Storage C STORE X Ray Radiation Dose SR Storage C STORE X Ray 3D Angiographic Image Storage C STORE X Ray 3D Craniofacial Image Storage C STORE 12 lead ECG Waveform Storage C STORE Merge DICOM Toolkit defines a C STORE command for the Media Storage Directory DICOMDIR service even though it does not formally e
97. Cfile MCdataSet and MCdimseMessage objects by not specifying any service or Performance Tuning command parameters These constructors reduce memory by not reading in innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual all of the information needed for validation of messages and files respectively This approach will also improve performance There are several configuration values that reduce Merge DICOM Toolkit s memory requirements The following describes each of these options FORCE_OPEN_EMPTY_ITEM This configuration option performs the same function as constructing empty MCdimseMessage objects except that it is for items It is especially useful for reducing the amount of memory used when creating large DICOMDIRs LARGE_DATA_STORE and LARGE_DATA_SIZE These options control the ability of Merge DICOM to store pixel data in temporary files instead of RAM This functionality is enabled by setting LARGE_DATA_STORE to FILE and adjusting LARGE_DATA_SIZE to the size of data element that you want spooled to temporary file Note however that this will decrease performance What can be done to increase the performance of the Merge DICOM Toolkit There are several Merge DICOM configuration values that impact performance in different ways The following is a summary of these options ELIMINATE_ITEM_ REFERENCES This option improves the performance of removeMessageValues mthod in MCdimseMessa
98. ConceptNameValue ConceptNameSheme ConceptNameMeaning For example EV T 04000 SNM3 Breast would mean that hardcoded values shall be used for that Concept Name Some template items don t have DT or EV abbreviation and just specify the hardcoded values The following abbreviations are used in template definitions e EV Enumerated Value values for are provided in the brackets e DT Defined Term values are provided in the brackets e BCID Baseline Context Group ID identifier that specifies the suggested Context Group The suggested values can be found in the DICOM Part 16 and identified by a Context ID provided in the brackets innovative Imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual e DCID Defined Context Group ID identifier that specifies the Context Group for a Coded Value that shall be used The values can be found in the DICOM Part 16 and identified by a Context ID provided in the brackets e BTID Baseline Template ID identifier that specifies a template suggested to be used in the creation of a set of Content Items The referenced template can be found in the DICOM Part 16 and identified by a Template ID provided in the brackets e DTID Defined Template ID identifier that specifies a template that shall be used in the creation of a set of Content Items The referenced template can be found in the DICOM Part 16 and identified by a Template ID provided in the b
99. CvalidationLevel Full was specified The message log agrees in that the first VE Validation Error logged is for the attribute Patient s Age 0010 1010 The log states that the message contains 41y as the value for this attribute Part 6 of DICOM clearly states that this attribute has a value representation of AS Age String and part 5 states that for this VR the value should have a leading zero and be represented as 041Y There is also one other error flagged in this message The required attribute View Position 0018 5101 had no value The Overhead of Validation te DICOM attribute set validation does involve processing overhead The most Ey significant overhead is in the accessing of the message info files and significantly less overhead is involved in actually validating the contents of the message structure It is important to understand that depending on the way in which your MCdimseMessage MCfile or MCdataSet object was created this validation overhead can occur at different points in your application see Table 20 Performance Tuning Table 20 Point of performance overhead associated with attribute set validation Message Object Construction Method Point at which file access overhead for validation occurs new MCdimseMessage new MCdimseMessage if command service supplied new MCdimseMessage MCdimseMessage validate if no command service supplied Note You must use setServiceCommand method before validating
100. DICOM Model XML String into an Attribute Set 111 Converting an Attribute Set into a DICOM JSON Model String 112 Converting a DICOM JSON Model String into an Attribute Set 113 B bit Pixel Data iienaa E A alongs seri atonecaeees 114 Encapsulated Pixel Data misnica nean iiid 114 Working with MCabstractMessage Derived Classes cccceseeeeteeeeeees 115 Compression and Decompression sssesssesseeereeesrrresrrerisrrerinrinrrnrresrn 115 Merge DICOM Supplied Compressors and DecompressSO s c008 116 Validating Attribute Sets cccccceceeeceeeeeeeceeeeeaeeeeeeeseeeeeseaeeesaeeseaeeseeneees 120 The Overhead of Validation 0 c ceceeceeeeeeeeceeeeeeeeeeseeeeeseaeeeseaeeseaeeseeneess 124 Validating a Single Attribute sesseesseeeseeeee eeen eeerresrnssrrernssrnssrnssrnssrnssrns 126 Streaming Attribute Sets ccecccecceeeeseeceeeeeceeeeeeaaeeeeeeeseeeesaeeeeaaeeeeeeeeaas 126 Message to Proprietary Schema XML Conversion cc ccccseesseeeeeteees 129 Proprietary Schema XML to Message ConverSiON cccccesseeeeeesteeeeees 129 Message to Native DICOM Model XML Conversion cere 130 Native DICOM Model XML to Message Conversion ccccseeeeeeeeees 131 Message to DICOM JSON Model Conversion ccccceeeceeeeseseeeeeeeeees 132 DICOM JSON Model to Message Conversion cccccceeeeeeeeeeeteeteeeeees 133 Message Exchang
101. DICOM Toolkit registering users DICOM services as well as conversion methods and WADO framework configuration settings To initialize Mergcom DICOM Toolkit one of the overloaded Init static methods should be called at application bootstrap lt summary gt Initializes lt see cref MCwado gt singleton instance lt summary gt public static void Init lt summary gt Initializes lt see cref MCwado gt singleton instance lt summary gt lt param name mergeInifile gt lt see cref FileInfo gt of MERGE INI file lt param gt public static void Init FileInfo mergeInifile lt summary gt Initializes lt see cref MCwado gt singleton instance lt summary gt lt param name mergeInifile gt lt see cref FileInfo gt of MERGE INI file lt param gt lt param name license gt Mergecom Toolkit license lt param gt public static void Init FileInfo mergeInifile string license MCwado class provides a set of static properties for registering user DICOM services to handle DICOM WADO requests responses IMCservice Service IMCcache Cache IMCdicomRenderer DicomRenderer and IMCdicomRenderer HttpConverter public static IMCservice Service get set public static IMCcache Cache get set public static IMCDicomRenderer DicomRenderer get set public static IMCHttpConverter HttpConverter get set The IMCservice interface is used to access the DICOM service for storing and retrieving DICOM objects
102. D_PET_IMAGE DICOM Service Class Storage Relevant Patient Information Query Storage Storage Query Retrieve Query Retrieve Query Retrieve Storage Query Retrieve Query Retrieve Query Retrieve Storage Storage Storage Results Management Patient Management Results Management Study Management Patient Management Media Storage Storage Storage Storage Storage Storage innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual Merge DICOM Toolkit Service Parameter ENHANCED_US_VOLUME ENHANCED_XA_IMAGE ENHANCED_XRF_IMAGE G_P_PERFORMED_PROCEDURE_STEP G_P_SCHEDULED_PROCEDURE_STEP G_P_WORKLIST GENERAL_AUDIO_WAVEFORM GENERAL_RPI_QUERY GENERIC_IMPLANT_TEMPLATE GENERIC_IMPLANT_TEMPLATE_FIND GENERIC_IMPLANT_TEMPLATE_GET GENERIC_IMPLANT_TEMPLATE_MOVE HANGING_PROTOCOL HANGING_PROTOCOL_FIND HANGING_PROTOCOL_GET HANGING_PROTOCOL_MOVE IMAGE_OVERLAY_BOX_RETIRED IMPLANT_ASSEMBLY_TEMPLATE IMPLANT_ASSEMBLY_TEMPLATE_FIND IMPLANT_ASSEMBLY_TEMPLATE_GET IMPLANT_ASSEMBLY_TEMPLATE_MOVE IMPLANT_TEMPLATE_GROUP IMPLANT_TEMPLATE_GROUP_FIND IMPLANT_TEMPLATE_GROUP_GET Class Storage DICOM Service Storage Study Management Study Management Basic Worklist Management Storage Relevant Patient Information Query Storage Query Retrieve Query Retrieve Query Retrieve Hanging Protocol Storage Hanging Protocol Query Retrieve Hanging Protocol Query Retriev
103. E CASE if the MCfile object is built when the command and service are known In that case the message IS associated with a given service command pair and attributes other than those associated with that service and command must be explicitly added to the message before setting values for the added attributes Specifying the file name The fileName parameter specifies an operating system file that is related to this MCfile object If the fileName parameter is not specified the File property defaults to UNSPECIFIED innovative Imaging NET C User s Manual Merge DICOM Toolkit v 5 1 0 ItemName Constructing Item Objects MCitem objects describe DICOM items used normally in sequence of items SQ attributes They are identified in Merge DICOM Toolkit by specific configured item names MCitem item new MCitem OL String itemName Configured_Item_Name MCitem item new MCitem itemName If the first form of the constructor is used an empty MCitem object will be created The attribute list for the MCitem will initially be empty The second constructor form populates the MCitem s attribute list with attributes defined by the itemName parameter The itemName is used to access configuration information that describes the attributes of the message If the itemName is unknown to Merge DICOM an empty attribute list is created and a warning message is logged Get Set item name You can use
104. E titles should be Unique on a network Refer to the description of addHandler in the NET Assembly Windows Help File for more detailed information about controlling which messages will reach your handler If a log handler is registered the Library calls receiveLogMessage in the thread that generated the message but the calls are synchronized by the Library so the log handler does not have to deal with synchronization Registering Your Application Before performing any network or media activity your application must register its DICOM Application Title with the Merge DICOM Toolkit This is done by calling the getApplication factory method of the MCapplication class The getApplication method returns an MCapplication object that represents your DICOM Application Entity Note that if the getApplication method is called more than once with the same argument the same MCapplication instance is returned This DICOM Application Title is equivalent to the DICOM Application Entity Title defined earlier If your application is a server this application title must be made known to any client application that wishes to connect to you If your application is aclient your application title may need to be made known to any server you wish to connect to depending on whether the server is configured to act as a server SCP only to particular clients for security reasons For example if your application title is ACME_Query_SCP you would register
105. Fields 2 Fields it Fields 3 Properties isla amaia opata ContentitemType 2 ContentitemType 3 ContentitemType gt ContentitemType z Tooni amp F UidRef 3 Personvame F Date i Methads E Methods Methods E Methods Nested Types Mctextttem Class MCcontantitam F Fields 5 Properties F ContenthtemT F Text Methods MCtimeltem Class Cass MCcontantitam D MCcontent item D NCcontentttem D MCcontentttem Fields 5 Fields Fields Fields zj Properties i Properties i Properties i Properties ype F ContenttemType SP RangeType OF Code AT ContenthtemType oF ContentltemType oF Time 8S RangeTypestring OF ContentitemType Qualifier OF SopReterence Methods 2i Methods SF Units Methods i A Values Methods ti Fields MctemporalCoordPositionsit 4 MCtemporalCoordTimeOffsat 2 MCtemporalCoordDateTimelt 2 MCimagertem a Mewaveformitem a Class Chas Cass Chass Cass b MOtemporalCoordnatesitem gt MCtenporaKCoordinatesitem gt MCtemporsiCoordinstesiten MCcompasiteltem b HCcompasitelten it Fields ti Fields iti Fields ti Fields Properties iz Properties Properties izi Properties Properties gt Contentitemtype gt ContentitemType SF ContentitemType gt ContentitemType S Channels amp gt ReferencedSamplePositions amp gt ReferencedTimedffsets SF Referenced
106. ICM in a DICOM file and can be used as an identifying characteristic for all DICOM files The remainder of the file preamble and object instance is encoded using tagged attributes as ina DICOM Message DICOM objects that canbe The object instances that can be stored within the DICOM file are equivalent to a written to media subset of the object instances that can be transmitted in network messages The services that can be performed to interchangeable media are italicized in Table 1 The Media Storage Service Class in Part 4 of the DICOM standard specifies which service command pairs can be performed to media Remember it is the service command pair that identifies the object instance portion of the message and it is only the object instance portion of the message that is stored in a DICOM file The command attributes associated with a network message are never stored in a DICOM File only the data set The service command pairs whose corresponding object instances can be stored to media are summarized in Error Reference source not found Note that the Media Storage Directory Service is not performed over a network and the single object specified in the Basic Directory Information Object Definition Part 3 is used Table 5 Service Command Pairs Specifying Objects that can be Stored in a DICOM File Service Command Ambulatory ECG Waveform Storage C STORE Arterial Pulse Waveform Storage C STORE Autorefraction Measurement
107. ICOM Toolkit V 5 1 0 association such as an invalid attribute value or missing attribute value in a DICOM message Warnings are meant to alert toolkit users to unusual conditions such as missing parameters that are defaulted or attributes having values that are not one of the defined terms in the standard Status messages give high level messages describing the opening of associations and exchanging of messages over open associations As discussed earlier other more detailed logging can be obtained by using the T1_MESSAGE through T9_MESSAGE logging levels For example the T5_MESSAGE logging level can be used to log the results of validate or validateAttribute methods of the MCdimseMessage class An excerpt from a Merge DICOM Toolkit message log file is included below that contains all three classes of messages errors warnings and informational Message Log Example 03 29 21 14 54 77 MC3 W 0010 1010 Value from stream had problem 03 29 21 14 54 78 MC3 W Invalid value for this tag s VR 03 29 21 14 56 41 MC3 Read_PDU_Head E Error on Read_Transport call 03 29 21 14 56 41 MC3 MCI_nextPDUtype E Error on Read_PDU_Head call 6196 03 29 21 14 56 41 MC3 Transport_Conn_Closed_Event E Transport unexpectedly closed 6196 03 29 21 14 56 41 MC3 MCI_ReadNextPDV I DUL_read_pdvs error UL Provider aborted the association The first column contains the ID of the thread where the message was generated The
108. ICOM Toolkit will use to identify private transfer syntax 1 When this value is set to lt none gt private transfer syntax support is shut off DEFAULT lt none gt When set to YES Merge DICOM Toolkit will interpret private transfer syntax 2 as having its pixel data tag 7fe0 0010 being encoded as undefined length in the same manner as the JPEG and RLE transfer syntaxes are encoded DEFAULT NO When set to YES Merge DICOM Toolkit will interpret private transfer syntax 2 as being encoded in explicit VR format DEFAULT YES When set to YES Merge DICOM Toolkit will interpret private transfer syntax 2 as being encoded in little endian format DEFAULT YES innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual Description PRIVATE_SYNTAX_2_ SYNTAX The unique identifier UID Merge DICOM Toolkit will use to identify private transfer syntax 2 When this value is set to lt none gt private transfer syntax support is shut off DEFAULT lt none gt This value defines the UID of the RLE Lossless transfer syntax DEFAULT 1 2 840 10008 1 2 5 t These options allow for non standard DICOM operations Such exceptions if used should be noted in your DICOM conformance statement Performance tuning Table 34 DIMSE_PARMS section of system profile parameters Name Description INITIATOR_NAME The DICOM standard has retired the old ACR NEMA Initiator Name attribute in command mess
109. ICOM Transfer Syntax Parameter IMPLICIT_LITTLE_ENDIAN JPEG_BASELINE JPEG_EXTENDED_2 4 JPEG_EXTENDED 3 5 Description Implicit VR Little Endian Default Transfer Syntax for DICOM Implicit VR Big Endian Explicit VR Little Endian Explicit VR Big Endian Run length Encoding Deflated Explicit VR Little Endian JPEG Baseline Process 1 Default Transfer Syntax for Lossy JPEG 8 Bit Image Compression JPEG Extended Process 2 amp 4 Default Transfer Syntax for Lossy JPEG 12 Bit Image Compression Process 4 only JPEG Extended Process 3 amp 5 JPEG Spectral Selection Non Hierarchical Process 6 amp 8 JPEG Spectral Selection Non Hierarchical Process 7 amp 9 JPEG Full Progression Non Hierarchical Process 10 amp 12 JPEG Full Progression Non Hierarchical Process 11 amp 13 JPEG Lossless Non Hierarchical Process 14 innovative Imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual Merge DICOM Transfer Syntax Parameter JPEG_LOSSLESS_NON_HIER_15 JPEG_EXTENDED_HIER_16_18 JPEG_EXTENDED_HIER_17_19 JPEG_SPEC_HIER_20_22 JPEG_SPEC_HIER_21_23 JPEG_FULL_PROG_HIER_24_26 JPEG_FULL_PROG_HIER_25_27 JPEG_LOSSLESS_HIER_28 JPEG_LOSSLESS_HIER_29 JPEG_LOSSLESS_HIER_14 JPEG_2000_LOSSLESS_ONLY JPEG_2000 JPEG_LS_LOSSLESS JPEG_LS_LOSSY JPEG_2000_MC_LOSSLESS_ONLY JPEG_2000_MC JPIP_REFERENCED JPIP_REFERENCED_DEFLATE MPEG2_MPHL MPEG2_MPML MPEG4_AVC_H264
110. ID The lt root gt portion of the UID should be registered by an organization that guarantees global uniqueness The American National Standards Institute ANSI is the registration authority for the United States Other national registration authorities exist for nations throughout the world such as IBN in Belgium AFNOR in France BSI in Great Britain DIN in Germany and COSIRA in Canada Obtaining a UID From ANSI ANSI is the registration authority for the US for organization names i e lt root gt under the global registration process established by the International Standards Organization ISO and the International Telegraph and Telephone Consultative Committee CCITT ANSI s registration service conforms with CCITT X 660 and ISO IEC 9834 1 The ANSI organization name registration service assigns one name component to the hierarchy defined by CCITT and ISO IEC An organization seeking registration may do so by submitting a Request for Registration application form along with a fee as of August 1996 the fee is 1 000 to the Registration Coordinator The Request for Registration application form can be obtained from ANSI by use of the following information American National Standards Institute 11 West 42 Street New York New York 10036 TEL 212 642 4900 FAX 212 398 0023 innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual Appendix C Writing a DICOM Conformance Statement Detailed
111. If the values of these options are set too high a message will be logged to the toolkit s log files although no errors will be returned through the toolkit s API Larger values for these constants will greatly improve network performance on networks with minimal network activity Note that for optimum performance these values should be at least slightly larger than the PDU_MAXIMUM_LENGTH configuration value Note also that setting these values to an even multiple of the TCP IP MSS Maximum Segment Size of 1460 bytes can help increase performance Note also that some operating systems such as Linux have auto tuning of TCP IP buffer sizes implemented when an explicit TCP IP Send and Receive buffer size are not set These options can be set to zero to disable Merge DICOM Toolkit s setting of each buffer size DEFAULT 131400 MAXIMUM Operating System dependent innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 Description TCPIP_SEND_BUFFER_SIZE This parameter specifies the TCP IP send buffer size for each connection Note that the maximum values for this constant and TCPIP_RECEIVE_BUFFER_SIZE are operating system dependent If the values of these options are set too high a message will be logged to the toolkit s log files although no errors will be returned through the toolkit s API Larger values for these constants will greatly improve network performance on networks with minimal network a
112. M service response and an IMCHttpConverter interface to convert a DICOM service response to an HttpResponseMessage object Using MCrequestParameter and MCrequstAttribute Classes The MCrequestParameter Class is used to describe a WADO request parameter and populate the internal data of WADO framework structures It has the properties String Name get set String RequestRequirement get set where the latter defines if the WADO parameter is REQUIRED or OPTIONAL The property IEnumerable lt String gt Values get set contains a list of strings which are a multi string representation of the WADO parameter value Some of the WADO parameters for instance StudyInstanceUID PatientName etc in QIDO RS request could be presented as DICOM attributes For that purpose CrequestParameter implements a property IEnumerable lt MCrequestAttribute gt Attributes get set innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual which is a list of MCrequestAttribute objects Each MCrequestAttribute instance describes a single DICOM attribute using properties public uint Tag get set public String Item get set public String Keyword get set public IEnumerable lt string gt Values public List lt MCrequestAttribute gt Children where Tag is a DICOM attribute tag Item is a user defined alias Keyword is a DICOM keyword Values represents multiple values encoded as string and C
113. M and how they must be utilized with MCabstractMessage duplicate Merge DICOM Supplied Compressors and Decompressors MCstandardCompressor Merge DICOM supplies several implementations of compressors and MCstandardDecompressor decompressors Table 14 lists each of the Merge DICOM classes if they MCrleCompressor MCrleDecompressor Hohe compression or decompression and what transfer syntaxes they support Table 14 Merge DICOM Supplied Compressor and Decompressors Merge DICOM Class Type DICOM Transfer Syntaxes Supported MCstandardCompressor Compressor JPEG Baseline JPEG Extended Process 2 amp 4 JPEG Lossless Non Hierarchical Process 14 JPEG 2000 JPEG 2000 Lossless Only MCrleCompressor RLE MCstandardDecompressor Decompressor JPEG Baseline JPEG Extended Process 2 amp 4 JPEG Lossless Non Hierarchical Process 14 innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual Merge DICOM Class Type DICOM Transfer Syntaxes Supported JPEG 2000 JPEG 2000 Lossless Only For the JPEG Baseline Jpeg Extended Process 2 amp 4 JPEG Lossless Non Hierarchical Process 14 JPEG 2000 and JPEG 2000 Lossless Only transfer syntaxes Merge DICOM utilizes libraries from Pegasus Imaging to do compression and decompression The RLE transfer syntax is supported directly in Merge DICOM Toolkit Pegasus Licenses are JPEG Baseline JPEG Extended Process 2 amp 4 and JPEG Lossless Non required to re
114. M toolkit These strings are defined in detail in message txt This file is located in the mc3msg directory of your distribution The following is a list of currently supported services Table 31 Application profile parameters Merge DICOM Toolkit Service Parameter DICOM Service Class Print Management ARTERIAL_PULSE_WAVEFORM AUTOREFRACTION_MEASUREMENTS BASIC_ANNOTATION_BOX BASIC_COLOR_IMAGE_BOX Print Management BASIC_FILM_BOX BASIC_FILM_SESSION BASIC_GRAYSCALE_IMAGE_BOX BASIC_PRINT_IMAGE_OVERLAY_BOX BASIC_STRUCTURED_DISPLAY BREAST_IMAGING_RPI_QUERY BREAST_PROJ_PRESENT BREAST_PROJ_PROCESS Print Management Print Management Print Management Print Management Storage Relevant Patient Information Query Storage Storage innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 Merge DICOM Toolkit Service Parameter BREAST_TOMO_IMAGE_STORAGE CARDIAC_RPI_QUERY CHEST_CAD_SR COLON_CAD_SR COLOR_PALETTE_FIND COLOR_PALETTE_GET COLOR_PALETTE_MOVE COLOR_PALETTE_STORAGE COMPOSITE_INST_RET_NO_BULK_GET COMPOSITE_INSTANCE_ROOT_RET_GET COMPOSITE_INSTANCE_ROOT_RET_MOVE COMPREHENSIVE_3D_SR CORNEAL_TOPOGRAPHY_MAP DEFORMABLE_SPATIAL_REGISTRATION DETACHED_INTERP_MANAGEMENT DETACHED_PATIENT_MANAGEMENT DETACHED_RESULTS_MANAGEMENT DETACHED_STUDY_MANAGEMENT DETACHED_VISIT_MANAGEMENT DICOMDIR ENCAPSULATED_CDA ENHANCED_CT_IMAGE ENHANCED_MR_COLOR_IMAGE ENHANCED_MR_IMAGE ENHANCE
115. MCitem e MCproposedContextList e MCproposedContext e MCtransferSyntaxList e MCdata innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual Using the Merge DICOM log file The Mergecom Logging namespace contains definitions for utilizing the Merge DICOM log file usually merge log The Merge DICOM logging mechanism MClog allows logging at several different logging levels Error Warning Info and nine trace logging levels are allowed The MClog class contains methods for logging to these various log levels The method prototypes to log to several of these levels are Logging a message public static void error System String msg public static void warning System String msg public static void info System String msg public static void tl System String msg public static void t9 System String msg Each of these methods writes an entry into the Merge DICOM log file containing msg The entry will be logged only if messages of specific type have been enabled in the merge ini file The Merge DICOM log file is defined by the LOG_FILE parameter in the MergeCOM3 section of the merge ini file To enable logging of specific types of messages enter one or more of these parameters in the merge ini file ERROR_MESSAGE lt destinations gt WARNING_MESSAGE lt destinations gt INFO_MESSAGE lt destinations gt lt destinations gt may be one or both of these values separ
116. MENTATION_VERSION This UID must follow the syntax rules specified in Part 5 of the DICOM standard Proposed or Accepted Presentation Contexts Application conformance statements specify all presentation contexts that are used for association negotiation A presentation context consists of e an Abstract Syntax which is a DICOM service class name and unique identifier UID e atransfer syntax name and UID A transfer syntax represents a set of data encoding rules that are specified in the mergecom pro file Please see the System Profile section in Appendix B Configuration Parameters e the role that the application will perform within the service class The roles associated with a particular service class are discussed in Part 4 of the DICOM standard innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 e any extended negotiation information used when creating associations See the MC_Get_Negotiation_Info function in the Merge DICOM Reference Manual and and e any rules that govern the acceptance of presentation contexts for the AE This includes rules for which combinations of Abstract Transfer Syntaxes are acceptable and rules for prioritization of presentation contexts Rules that govern selection of transfer syntax within a presentation context are stated here Please see the Application Profile section in the Appendix B Configuration Parameters Also see the MC_G
117. ML XmlOptExcludePrivateAttributes 0x8 Use Base64 encoding for bulks and UN VR attributes XmlOptBase64Binary 0x10 Proprietary Schema XML to Message Conversion Converting an XML string The MCabstractMessage provides a readFromXML method that can be utilized into a message to read attribute values from a proprietary schema XML string into readFromXML method MCabstractMessage s derived classes MCfile and MCdimseMessage The content of the message is not cleared before processing XML attributes The existing attributes in the message are overridden if they are present in the XML string innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 The following example shows how the readFromXML method is utilized at a high level StreamReader reader new StreamReader myXMLFile MCfile file new MCfile file readFromxML reader reader Close toon XML siting Message to Native DICOM Model XML Conversion The MCabstractMessage provides a writeTOXMLNative method which can be utilized to convert its derived classes MCfile and MCdimseMessage to a Native DICOM Model XML string PS3 19 writeTOXMLNative method You can convert a list of attributes of an MCfile or MCdimseMessage along with their values into an XML string by using the writeTOXMLNative method of the MCabstractMessage The writeToXMLNative method creates an XML string describing the contents of the MCfile or MCdimseMessa
118. OFFSET_TABLE DECODER_TAG_ FILTER DEFLATE_ALLOW_FLUSH DEFLATE_COMPRESSION_LEVEL Description This parameter allows the user to select the output format when doing Lossy JPEG compression of RGB images The value can be set to YBR_FULL or YBR_FULL_422 to specifiy what photometric interpretion Merge DICOM Toolkit should compress into when compressing RGB images DEFAULT YBR_FULL_422 If set to YES it instructs the toolkit to give precedence to the image parameters rows columns etc from the JPEG header in case disagreement is suspected between the the DICOM header the JPEG header If set to NO the DICOM header will be used DEFAULT NO Configuration Parameter for MC_Standard_Compressor When JPEG_2000 is used as a transfer syntax this could mean either lossy or lossless compression This parameter specifies the intended syntax DEFAULT No This parameter specifies if an offset table is created when MC_Duplicate_Message is used to compress a DICOM message or file It also specifies if an offset table is created when the MC_Set_Encapsulated_Value_From_Function and MC_Set_Next_Encapsulated_Value_From_Function routines are used DEFAULT Yes Specifies the list of tags to be ignored when reading DICOM files or messages The values are separated by commas and can be specified in different formats Single tag e g 00080020 Tag range e g 00080020 000800FF Single group e g G0020 Group range
119. OKED and MAX_OPERATIONS_PERFORMED are not included in the service list asynchronous communications are not negotiated See a subsequent section for details on implementing DICOM asynchronous communications with Merge DICOM Toolkit Extended Negotiation Merge DICOM optionally supports configuration of DICOM Extended Negotiation information in service lists Currently the DICOM standard allows extended negotiation information for the Storage and Query Retrieve Service classes as defined in PS3 4 of the standard The extended negotiation information can be set for only the client SCU Server applications utilizing extended negotiation must set this information at run time through the NET Assembly SCU_Service_List SERVICES_SUPPORTED 2 Number of Services SERVICE_1 STUDY_ROOT_OQR_FIND EXT_NEG_INFO_1 0x01 SERVICE_2 STUDY_ROOT_QR_MOVE EXT_NEG_INFO_2 0x01 In this case the SCU_Service_List supports the Study Root Q R Find and Move services Both services have set a single byte of extended negotiation information set to hexadecimal 0x01 In this case this implies the Client supports relational Queries and Moves Multiple hexadecimal bytes can be set in the service list by listing each byte in the format 0x00 0x01 0x02 Related General SOP Classes and Service Classes DICOM Supplement 90 defines a mechanism in association negotiation to identify when a SOP Class is
120. OM Services Classes and their Component Services Service Class Services Description MCverificationService Verification Verification Verifies application level communication between DICOM application entities AE s MCstorageService Storage Computed Radiography Image Storage Transfer of medical CT Image Storage images and related Enhanced CT Image Storage standalone data between MR Image Storage DICOM application Enhanced MR Image Storage entities either over a MR Spectroscopy Storage network or using Enhanced MR Color Image Storage interchangeable media Spatial Fiducials Storage Spatial Registration Storage Deformable Spatial Registration Storage Ultrasound Image Storage Ultrasound Multi frame Image Storage Enhanced US Volume Storage Generic implant Template Storage Implant Assembly Template Storage Implant Template Group Storage Implantation Plan SR Document Storage Intraocular Lens Calculations Storage Macular Grid Thickness and Volume Report Nuclear Medicine Image Storage Positron Emission Tomography Image Storage Enhanced PET Image Storage Breast Tomosynthesis Image Storage Intravascular Optical Coherence Tomography Image Storage For Presentation Intravascular Optical Coherence Tomography Image Storage For Processing Digital X Ray Image Storage For Presentation Digital X Ray Image Storage For Processing Digital Intra oral X Ray Image Storage For Presentation Digital Intra oral X Ray Image Storage
121. ONS contain relative paths with a prefix MC3INIDIR or MC3INIDIR the toolkit considers the path relative to the location of the merge ini file For example MERGECOM_3_PROFILE MC3INIDIR config mergecom pro The path of the profile file is config mergecom pro relative to the location of the merge ini file 2 lam testing the sample applications for the first time and cannot get the client SCU application to connect to the server SCP for any of the sample applications The MCapplication requestAssociation method is throwing an exception It appears as though the connection is opening but it is quickly dropped Why is this happening As a security measure the MCassociation startListening method used in SCPs attempts to determine the hostname of SCUs connecting to it If it cannot determine the remote hostname it will drop the connection The startListening method uses the local system s host file or its configured domain name server to translate the SCU s IP address into its hostname By configuring the SCU s hostname in your local hosts file this problem will be eliminated Also the ACCEPT_ANY_HOSTNAME configuration value in the mergecom pro file disables this checking 3 What can be done to reduce the memory requirements of the Merge DICOM Toolkit se There are several methods for reducing the memory requirements of Merge DICOM Toolkit The first approach is to construct empty M
122. ORE_RQ STANDARD_CR encode the ds String affectedSopClassUid 1 2 840 10008 5 1 4 1 1 1 MCdimseMessage dm try This call creates a new McdimseMessage using the MCdataSet ds provided It then sends the message to the network partner dm myService sendStoreRequest ds affectedSopClassUid catch Exception e Send messages using MCstorageService might be used to send a request message provided by an ara apie and instance of a data source class which implements MCdataSource interface such ie tai as MCfileDataSource for instance MCstorageService myService new MCstorageService assoc MCfileDataSource fs new MCfileDataSource filename try This call send a request message from a file to the network partner myService sendStoreRequest fs filename catch Exception e Internally the message contents are obtained as blocks of data through repeated calls to the provideData method of MCdataSource interface This method is especially useful for transfering large data and decreasing the application memory footprint Note The example above is just a sample of the methods available with the MCstorageService class Refer to the Assembly Windows Help File for complete details on using the mentioned classes innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 Read messages using MCassociation read
123. OateTime ReferencedFrames S Contentitemtype Methods S Methods E Methods H ReferencedRealWorkivm Methods ReferencedSegments amp ReferencedSps mene Ts IH Methods Figure 21 SR Class Diagram innovative Imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 Extending Toolkit Classes In Figure 21 there are two top level classes e MCsiructuredReport This class is encapsulating the Structured Report Content Module and has utility functions for reading and writing content tree from DICOM datasets e MCcontentltem This is a base class for all content item classes and encapsulates common functionality for all of them Each Content Item type is implemented as a separate class with the specific data exposed as public properties All Content Item classes are implementing the MCserializableToDataSet interface that is used by the Toolkit to read and write individual Content Items The Merge DICOM Toolkit allows you to extend existing Content Item classes by providing your own derived classes from existing types For example if you want to store the Content Item data in your own format or save extra DICOM attributes that are not covered by the Toolkit classes Once you created your own extended class you need to register it with the class factory that is responsible for creating classes during reading data from DICOM datasets By default Toolkit will create a known class per each Content Item Type accordi
124. PSULATED_PDF STANDARD_ENHANCED_SR STANDARD_GRAYSCALE_SOFTCOPY_PS STANDARD_HARDCOPY_COLOR STANDARD_HARDCOPY_GRAYSCALE STANDARD_IO_PRESENT STANDARD_IO_PROCESS STANDARD_IVOCT_PRESENT STANDARD_IVOCT_PROCESS STANDARD_MG_PRESENT STANDARD_MG_PROCESS STANDARD_MODALITY_LUT STANDARD_MR STANDARD_NM DICOM Service Class Storage Storage Storage Storage Storage Storage Storage Storage Storage Storage Storage Storage Verification Storage Storage Storage Storage Storage Storage Storage Storage Storage Storage Storage Storage Storage Storage innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual Merge DICOM Toolkit Service Parameter DICOM Service Class STANDARD_NM_RETIRED Storage STANDARD_OPHTHALMIC_16_BIT Storage STANDARD_OPHTHALMIC_8_BIT Storage STANDARD_OVERLAY Storage STANDARD_PET Storage STANDARD_PET_CURVE Storage STANDARD_PRINT_STORAGE Storage STANDARD_PSEUDOCOLOR_SOFTCOPY_PS Storage STANDARD_RT_BEAMS_TREAT Storage STANDARD_RT_BRACHY_TREAT Storage STANDARD_RT_DOSE Storage STANDARD_RT_IMAGE Storage STANDARD_RT_ION_BEAMS_TREAT Storage STANDARD_RT_ION_PLAN Storage STANDARD_RT_PLAN Storage STANDARD_RT_STRUCTURE_SET Storage STANDARD_RT_TREAT_SUM Storage STANDARD_SEC_CAPTURE Storage STANDARD_US Storage STANDARD_US_ MF Storage STANDARD_US_MF_RETIRED Storage STANDARD_US_RETIRED Storage STANDARD_VIDEO_ENDOSCOPIC Storage STANDARD_VIDEO_MICROSCOPIC Storage STANDARD_VIDEO_PHOTOGRAPHIC
125. RIAL_RETIRED UPS_WATCH_SOP UPS_WATCH_SOP_TRIAL_RETIRED VISUAL_ACUITY_MEASUREMENTS VL_WHOLE_SLIDE_MICROSCOPY_IMAGE VOI_LUT_BOX XA_XRF_GRAYSCALE_SOFTCOPY_PS XRAY_3D_ANGIO_IMAGE XRAY_3D_CRANIO_IMAGE XRAY_RADATION_DOSE_SR BASIC_COLOR_PRINT_MANAGEMENT META_SOP BASIC_GRAYSCALE_PRINT_MANAGEMENT META_SOP DETACHED_PATIENT_MANAGEMENT_META META_SOP DETACHED_RESULTS_ MANAGEMENT META META_SOP G_P_WORKLIST_MANAGMENT_META META_SOP Class Unified Procedure Step Management DICOM Service Unified Procedure Step Management Unified Procedure Step Management Unified Procedure Step Management Unified Procedure Step Management Unified Procedure Step Management Unified Procedure Step Management Unified Procedure Step Management Storage Storage Print Management Storage Storage Storage Storage Print Management Print Management Patient Management Results Management Basic Worklist Management innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 Merge DICOM Toolkit Service Parameter DICOM Service Class PULL_STORED_PRINT_MANAGEMENT META_SOP REF_COLOR_PRINT_MANAGEMENT META_SOP REF_GRAYSCALE_PRINT_MANAGEMENT META_SOP STUDY_MANAGEMENT META_SOP Study Management Transfer syntax lists are contained in the service lists The following is a list of the currently supported transfer syntaxes Table 32 Transfer Syntax List Parameters Merge D
126. ROLLER action 3 get config Routes MapHttpRoute name MCwadoRsBind routeTemplate api controller bind wadors defaults new controller MCcontroller MCWADORSCONTROLLER action bind 3 config Services Add typeof ModelBinderProvider new MCrequestBinderProvider MCwadoUriController using System using System Net Http using System Text using System Threading Tasks using System Web Http using System Web Http ModelBinding using Mergecomws Dicom namespace Mergecomws Web lt summary gt Implements Http Get methods for DICOM WADO URI requests lt summary gt public class MCwadoUriController MCcontroller innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual lt summary gt Class constructor lt summary gt public MCwadoUriController base lt summary gt Http Get method lt summary gt lt param name request gt lt see cref HttpRequestMessage gt object lt param gt lt returns gt lt see cref HttpResponseMessage gt object lt returns gt HttpGet public HttpResponseMessage Get HttpRequestMessage request lt summary gt Http Get method lt summary gt lt param name request gt lt see cref MCrequest gt oject lt param gt lt returns gt lt see cref HttpResponseMessage gt object lt returns gt ActionName bind public HttpResponseMessage Get ModelBinder typeof MCreques
127. Read messages using MCassociation readToStream The MCassociation read method retrieves the next message sent by the network partner The read method returns an instance of the MCdimseMessage class See the section Negotiated Transfer Syntaxes Note that DICOM requires that one or more reply message be sent in response to all DIMSE messages received depending on the DICOM service being performed MCdimseMessage dm try long timeout 30000 30 second timeout dm assoc read timeout if dm null Timeout The MCdimseMessage just sent is returned catch Exception e n The MCassociation readToSt ream method retrieves the next message sent by the network partner and stores it with the instance of class implementing MCdataSink interface The readToSt ream method returns MCReadError status as a result of read operation MCfileDataSink fs new MCfileDataSink filename MCReadError rs try long timeout 30000 30 second timeout rs assoc readToStream fs timeout filename catch Exception e The received message is read and stored through repeated calls of the recieveData method of MCdataSink interafce This method allows to handle the large data without affecting the application memory footprint The current implementation of read method does not support timeout values that are less than one second Any value that is less than 1000 and greater than zero will be rounded to 1000
128. RequestedSopInstanceUid ResponseStatus WarningSubOperations MCfile Get the contained attribute sets with getDataSet getMetalnfo The DIMSE services that use C GET or C MOVE operations place the number of C STORE sub operations remaining to be sent in their response messages The RemainingSubOperations property sets or gets that value from attribute 0000 1020 Normalized DIMSE services provide the SOP Class UID associated with a particular operation in the request and response messages The RequestedSopClassUid property sets or gets this Requested SOP Class UID from attribute 0000 0003 Normalized DIMSE services provide the SOP Instance UID for which a given operation occurred The RequestedSopInstanceUid property sets or gets this Requested SOP Instance UID from attribute 0000 1001 The ResponseStatus property gets the Response Status Code 0000 0900 from the message command set The DIMSE services that use C GET or C MOVE operations place the number of C STORE sub operations that generated warnings in their response messages The WarningSubOperat ions property sets or gets that value from attribute 0000 1023 Constructing File Objects Before you can use the DICOM media storage services provided by the MCmediaStorageService class you must construct an MCfile object that will encapsulate the DICOM file that will be read or written As discussed above each instance of the MCfile object contains an MCda
129. ResponseParameters gt XML lt see cref string gt encoded from the list of lt see cref MCparameter gt of STOW RS response lt param gt lt returns gt Returns lt c gt True lt c gt if store operation succeeded lt returns gt bool Store MCabstractMessage request String xmlRequestParameters out MCabstractMessage response out String xmlResponseParameters lt summary gt Defines the cache operations to store and retrieve the results of lt see cref MCabstractMessage requests lt summary gt public interface IMCcache lt summary gt Checks if WADO request exists in the cache storage lt summary gt lt param name request gt lt see cref MCabstractMessage gt WADO request encoded as an array of lt see cref MCabstractMessage gt lt param gt lt returns gt Returns lt c gt True lt c gt if the request exists lt returns gt bool Exists MCabstractMessage request lt summary gt Removes WADO request from the cache storage lt summary gt lt param name request gt lt see cref MCabstractMessage gt WADO request encoded as an array of lt see cref MCabstractMessage gt lt param gt lt returns gt Returns lt c gt True lt c gt if remove operation was successful lt returns gt bool Remove MCabstractMessage request lt summary gt Add WADO request and DICOM service response to the cache storage lt summary gt lt param name request gt WADO request encoded as an array
130. SIZE FORCE_OPEN_EMPTY_ITEM IGNORE_JPEG_BAD_ SUFFIX Description When set to NO do not export group length attributes when using the MC_Send_Request_Message MC_Send_Request MC_Send_Response_Message and MC_Send_Response functions DEFAULT YES When set to NO disable the exporting of private attributes in messages written to the network with the MC_Send_Request_Message MC_Send_Request MC_Send_Response_Message and MC_Send_Response functions DEFAULT YES When set to NO disable the exporting of attributes with a VR of UN in messages written to the network with the MC_Send_Request_Message MC_Send_Request MC_Send_Response_Message and MC_Send_Response functions DEFAULT YES If YES messages transferred over the network or written to disk have their sequence attributes encoded as undefined length This increases performance of the library DEFAULT NO The size that the output buffer of deflate or inflate should grow to when its size is insufficient An Info message is logged each time the buffer grows DEFAULT 1024 When set to YES the MC_Open_Item function will act similar to the MC_Open_Empty_Message function The up front performance cost of the MC_Open_Item function will be reduced but the amount of validation done when adding tags to the item is reduced Setting this value to YES will also improve the performance of the DICOMDIR directory functions This
131. SON buffer is written to the stream identified by the stream object provided writeDataSetsToJSON method The following example shows how the writeTOJSON method is utilized at a high level MCdataSet dsa a non null reference array of MCdataSet StreamWriter writer new StreamWriter myXMLFile convert DICOM DataSet s to an JSON file dsa writeDataSetsToJSON writer writer Close The DICOM JSON Model provisions that bulk data can be replaced by a URI string instead of the actual data To allow the substitution at run time a new interface MCbulkDataUriHandler is introduced public interface MCbulkUriHandler object provideData MCattributeSet attrSet unit tag MCvr vr string uri string provideUri MCattributeSet attrSet unit tag MCvr vr Following example shows how to implement this interface and calling an overloaded method of writeDataSetsTOJSON to accomplish the task innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual class BulkDataUriHandler MCbulkUriHandler public string provideUri MCattributeSet attrSet unit tag MCvr vr if tag MCdicom PIXEL_DATA return http xyz net pixeldatalocation return your URI string call an overloaded method of writeDataSetsToJSON ds writeDataSetsToJSON writer new BulkDataUriHandler By default if no bulk URI handler is supplied the toolkit will write out all bulk data to the JSON
132. Set a type of MCattributeSet a type of MCattributeSet MCattributeSet MCattribute PN MCattribute SQ Value Doe John value 3 items MCitem MCattribute MCattribute MCitem MCattribute MCattribute MCitem MCattribute MCattribute Figure 11 DIMSE messages and attribute sets innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual Association Message Handling Once an association has been negotiated the two cooperating applications the Service Class Provider SCP and the Service Class User SCU exchange DICOM messages on the association network connection These messages are encapsulated in MCdimseMessage objects Applications use instances of the MCdimseService class or one of its sub classes to send request and reply messages and use the read method of the MCassociation class to retrieve the messages sent by the network partner Send messages using one For example if an application is using the DICOM Storage Service it would ita alegre construct an instance of the MCstorageService and then use its MC diniseSarvice clase sendStoreRequest method to send a request message and use for example itself its sendSuccessResponse method to reply to a received DIMSE message When you construct a new MCdimseService class you provide the MCassociation object that the service is to operate on MCstorageService myService new MCstorageService assoc MCdataSet ds new MCdataSet C_ST
133. Sink Get a value s length MCattribute ValueLength Get a count of values MCattribute Count Attribute set report list method If your application runs on a resource rich system you should set LARGE_DATA_STORE to the value MEM in the Service Profile and Merge DICOM Toolkit will keep the pixel data values in the attribute set stored in memory rather than using temporary files This should improve performance Also in this case you may want your callback class to store the Pixel Data in fewer big blocks or one large block and keep them in primary memory for rapid access Merge DICOM provides a number of implementations to the MCdataSink interface The MCfileDataSink class implements a data sink that writes to a file A file name is supplied to the constructor and the class will automatically write the supplied data to this file The MCstreamDataSink class implements a data sink that writes to a System 10 Stream derived instance For example an instance of the System IO FileStream class can be used to write to a file Finally the MCmemoryDataSink class also implements the MCdataSink interface This class implements a data sink where the data is stored in memory Retrieving an Attribute Value s Properties You can obtain the length of an attribute s value by using the ValueLength property of the MCattribute class The length returned is the stream length of the attribute It is the sum of all lengths of all values if the attri
134. Storage STANDARD_VL_ENDOSCOPIC Storage STANDARD_VL_MICROSCOPIC Storage innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 Merge DICOM Toolkit Service Parameter STANDARD_VL_PHOTOGRAPHIC STANDARD_VL_SLIDE_MICROSCOPIC STANDARD_ VOI_LUT STANDARD_WAVEFORM_12_LEAD_ ECG STANDARD_WAVEFORM_AMBULATORY_ECG STANDARD_WAVEFORM_BASIC_VOICE_AU STANDARD_WAVEFORM_CARDIAC_EP STANDARD_WAVEFORM_GENERAL_ECG STANDARD_WAVEFORM_HEMODYNAMIC STANDARD_XRAY_ANGIO STANDARD_XRAY_ANGIO_BIPLANE STANDARD_XRAY_RF STEREOMETRIC_RELATIONSHIP STORAGE_COMMITMENT_PULL STORAGE_COMMITMENT_PUSH STUDY_COMPONENT_MANAGEMENT STUDY_CONTENT_NOTIFICATION STUDY_ROOT_QR_FIND STUDY_ROOT_QR_GET STUDY_ROOT_QR_MOVE SUBJ_REFRACTION_MEASUREMENTS SUBSTANCE_ADMIN_LOGGING SUBSTANCE_APPROVAL_QUERY SURFACE_SCAN_MESH SURFACE_SCAN_POINT_CLOUD DICOM Service Class Storage Storage Storage Storage Storage Storage Storage Storage Storage Storage Storage Storage Storage Storage Commitment Storage Commitment Study Management Study Content Notification Query Retrieve Query Retrieve Query Retrieve Storage Storage Storage Storage Storage innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual Merge DICOM Toolkit Service Parameter SURFACE_SEGMENTATION UPS_EVENT_SOP UPS_EVENT_SOP_TRIAL_RETIRED UPS_PULL_SOP UPS_PULL_SOP_TRIAL_RETIRED UPS_PUSH_SOP UPS_PUSH_SOP_T
135. TEMP_FILE_DIRECTORY you specify Large data that is of value representation OB Other string of Bytes or OW Other string of 16 bit Words or OD Other A string of 64 bit IEEE 754 1985 floating point words or OF Other string of 32 bit IEEE 754 1985 floating point words is treated specially by the toolkit Pixel Data Curves and Overlays are composed of this type of data You can let the toolkit manage OB OW OF data for you like any other large data or register your own Callback Class in your applications to deal with such data as it is being received or transmitted over the network The use of Callbacks will be covered later when we discuss developing DICOM applications with the toolkit The OBOW_BUFFER_S1ZE is used to tell the toolkit what size chunks in bytes of OB OW OF data it should read in before either writing the data to a temporary file or passing it to your Callback Class Choosing a large number for OBOW_BUFFER_SIZE means less time spent by your application process writing to temporary files or making callbacks but results in a larger process size If you need to use temporary files or callbacks you should tune this parameter to maximize performance within the constraints of your runtime environment Another binary file supplied with the toolkit is the message info file This file contains binary encoded message objects and is accessed when an application opens a message Once open these objects reside in memory ar
136. TE_NOT_FOUND CALLBACK_CANNOT_COMPLY CALLBACK_INVALID_ ARGUMENT CONFIGURATION _ERROR innovative imaging NET C User s Manual Merge DICOM Toolkit v 5 1 0 MCexception subclass MCdisposedException Mi Mi CincompatibleValueException CinvalidEncodingWarning Mi M M CinvalidEncodingException Mi Mi CillegalArgumentException CinactivityTimeoutException CinvalidMessageReceivedException Mi Mi CinvalidDirRecordTypeException CinvalidLicenseInfoError CnoSuchRecordException MClostConnectionException MCmaxOperationsExceededWarning MCnoSuchValueException a MCnegotiationAbortedException MCnetworkShutdownException MCnoAttributesException Mi CinvalidTransferSyntaxException MCtimeoutException MCunacceptableServiceException MCunknownHostNameException exceptionNumber property OBJECT_DISPOSED ILLEGAL_ARGUMENT_EXCEPTION NETWORK_INACTIVITY_TIMEOUT INCOMPATIBLE_VALUE INVALID_CHARS_IN_VALUE INVALID_DIMSE_COMMAND INVALID_DIR_RECORD_ TYPE INVALID_LICENSE INVALID_MESSAGE_RECEIVED INVALID_TRANSFER_SYNTAX LOST_CONNECTION MAX_OPERATIONS_EXCEEDED NEGOTIATION_ABORTED NETWORK_SHUTDOWN NO_ATTRIBUTES NO_SUCH_RECORD NO_SUCH_VALUE NOT_FOUND NOT_INITIALIZED_ EXCEPTION NOT_A_STANDARD_DATA_ELEMENT OPERATION_NOT_ALLOWED REQUIRED_ATTRIBUTE_MISSING TIMEOUT UNNACCEPTABLE_SERVICE UNKNOWN_HOST innovative imaging Merge DICOM To
137. The name and location of this file are specified in the MergeCOM3 section of the Merge DICOM initialization file Many of these parameters should never need to be modified by the user including low level protocol settings such as time outs Only the parameters that should be understood by every user of the toolkit are discussed here fora discussion of all parameters see System Profile in Appendix D Configuration Parameters Nothing works without the Most importantly you must place the license number you received when you license number purchased the toolkit in the ASSOC_PARMS section of the system profile If the license you received with your toolkit was 83F3 3F26 FD6E you would need to set it in the ASSOC_PARMS section as follows ASSOC_PARMS LICENSE IMPLEMENTATION_CLASS_UID IMPLEMENTATION_VERSION ACCEPT _MUTLPLE PRES CONTEXTS 83F3 3F26 FD6E 2 16 840 1 113669 2 1 2 MergeCOM3_361 Yes The toolkit sample applications and your own applications that use the DICOM Toolkit Library will not work without a valid license number The above example of the ASSOC_PARMS section of the system profile also contains example implementation class UID and implementation version configuration values The implementation class UID is intended by the DICOM standard to be unique for major revisions of an application entity The implementation version is intended to be unique for the mino
138. U applications using Merge DICOM are also defined through the Merge DICOM Application Profile The following is a typical client s SCU configuration innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual Transfer Syntax Lists for SCPs Acme_Store_SCP PORT_NUMBER 104 HOST_NAME acme_sunl SERVICE_LIST Storage_Service_List Storage_Service_List SERVICES SUPPORTED SERVICE_1 1 Number of Services STANDARD_CT In this case the client SCU would propose the CT Image Storage service in a single presentation context The transfer syntaxes for each service are the three standard non encapsulated DICOM transfer syntaxes The following example is the configuration for a client SCU that supports more than one presentation context for a service Acme_Store_SCP PORT_NUMBER 104 HOST_NAME acme_sunl SERVICE_LIST Storage_Service_List Storage_Service_List SERVICES_SUPPORTED 2 Number of Services SERVICE_1 STANDARD _CT SYNTAX_LIST_1 CT_Syntax_List_l SERVICE_2 STANDARD _CT SYNTAX_LIST_2 CT_Syntax_List_2 CT_Syntax_List_1 SYNTAXES_SUPPORTED 1 Number of Syntaxes SYNTAX_1 JPEG BASELINE CT_Syntax_List_2 SYNTAXES_SUPPORTED 1 Number of Syntaxes SYNTAX_1 IMPLICIT LITTLE _ENDIAN If a server SCP accepts both of these
139. VATE_ATTRIBUTES_TO_ When set to NO disable the exporting of private attributes in files MEDIA written with the MC_Write_File and MC_Write_File_By_Callback functions DEFAULT YES EXPORT_UN_VR_TO_MEDIA When set to NO disable the exporting of attributes with a VR of UN in files written with the McC_Write_File and MC_Write_File_By_Callback functions DEFAULT YES EXPORT_UNDEFINED_LENGTH_SQ_IN_ When set to NO DICOMDIRs written with MC_Write_File are DICOMDIR created with their sequence attributes having defined lengths Setting this option to Yes will increase performance DEFAULT YES Performance tuning Table 37 MESSAGE_PARMS section of system profile parameters Description ALLOW_COMMA_IN_DS_ FL FD STRINGS When set to Yes a comma or a period will be allowed in the value passed to MC_Set_Value_From_String for attributes with a VR of DS FL or FD When set to No only a period will be acceptable as a decimal separator Note that the toolkit will always ensure that DS attributes use a period decimal separator when streaming to the network or to a file regardless of current locale settings DEFAULT NO innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual ALLOW_INVALID_PRIVATE_ATTRIBUTES ALLOW_INVALID_PRIVATE_CREATOR_CODES ATT_00081190_USE_UT_VR ATT_00287FE0O_USE_UT_VR ATT_0040E010_USE_UT_VR ATT_0074100A_USE_ST_VR CALLBACK _MIN_DATA_ SIZE Descripti
140. _HP_LEVEL_4 1 Description JPEG Lossless Non Hierarchical Process 15 JPEG Extended Hierarchical Process 16 amp 18 JPEG Extended Hierarchical Process 17 amp 19 JPEG Spectral Selection Hierarchical Process 20 amp 22 JPEG Spectral Selection Hierarchical Process 21 amp 23 JPEG Full Progression Hierarchical Process 24 amp 26 JPEG Full Progression Hierarchical Process 25 amp 27 JPEG Lossless Hierarchical Process 28 JPEG Lossless Hierarchical Process 29 JPEG Lossless Hierarchical First Order Prediction Process 14 Selection Value 1 Default Transfer Syntax for Lossless JPEG Image Compression JPEG 2000 Lossless JPEG 2000 Lossless or Lossy JPEG LS Lossless JPEG LS Lossy Near Lossless JPEG 2000 Part 2 Multi component Image Compression Lossless Only JPEG 2000 Part 2 Multi component Image Compression JPIP Referenced JPIP Referenced Deflate MPEG2 Main Profile High Level MPEG2 Main Profile Main Level MPEG 4 AVC H 264 High Profile Level 4 1 innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 Merge DICOM Transfer Syntax Parameter MPEG4_AVC_H264_BDC_HP_LEVEL_4_1 Description MPEG 4 AVC H 264 BDcompatible High Profile Level 4 1 PRIVATE_SYNTAX_1 Private transfer syntax 1 with the characteristics specified by the PRIVATE_SYNTAX_1_LITTLE_ENDIAN PRIVATE_SYNTAX_1_EXPLICIT_VR and PRIVATE_SYNTAX_1_ENCAPSULATED confi
141. _INFO_FILE parameters in the System Profile mergecom pro When this exception is thrown further information on the reason for the exception may be contained in the merge log file Then the license key you specified in the System Profile mergecom pro is checked for validity If the key validation fails or the license key is not in the System Profile an MCinvalidLicenseInfoError exception is thrown Any further Library calls will result in an MCnotInitializedError runtime exception You must be licensed isinitialized At any time you can check to see if the Library has been initialized by using the static mcIsInitialized method of the MC class The method returns true if the mcInitialization method has already been called successfully Application Domains Note that the Library can not be used from different application domains at the same time In order to use it from a different application domain the Library must be released first in the application domain that initialized it innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 mcLibraryRelease mcGetVersionString Dispose Releasing the library The static mcLibraryRelease method of the MC class is used to release the resources used by the Merge DICOM library The method performs a graceful shutdown of the library mcInitialization must be called again before using the library This method is normally called before exiting a Merge DICOM applic
142. _MAXIMUM_LENGTH PRIVATE_SYNTAX_1_ ENCAPSULATED PRIVATE_SYNTAX_1_ EXPLICIT_VR PRIVATE_SYNTAX_1_LITTLE_ENDIAN PRIVATE_SYNTAX_1_ SYNTAX PRIVATE_SYNTAX_2_ ENCAPSULATED PRIVATE_SYNTAX_2_EXPLICIT_VR PRIVATE_SYNTAX_2_LITTLE_ENDIAN Description The maximum size of Protocol Data Units that can be received by this Merge DICOM Toolkit implementation This value will also place a limit on how large PDU values being sent can be Setting this so that a PDU fits within an even multiple of the default TCP IP MSS Maximum Segment Size of 1460 will optimize network performance Note that 6 bytes for the PDU header must be added to the configured maximum PDU size when calculating a multiple of the MSS Note also to see the TCPIP_SEND_BUFFER_SIZE and TCPIP_RECEIVE_BUFFER_SIZE configuration values for improving performance Example 1460 44 6 64234 PDU Size DEFAULT 64234 MINIMUM 4K MAXIMUM NONE When set to YES Merge DICOM Toolkit will interpret private transfer syntax 1 as having its pixel data tag 7fe0 0010 being encoded as undefined length in the same manner as the JPEG and RLE transfer syntaxes are encoded DEFAULT NO When set to YES Merge DICOM Toolkit will interpret private transfer syntax 1 as being encoded in explicit VR format DEFAULT YES When set to YES Merge DICOM Toolkit will interpret private transfer syntax 1 as being encoded in little endian format DEFAULT YES The unique identifier UID Merge D
143. a customization of a generalized SOP Class It also defines a method to identify the service class of a SOP Class that is proposed by an SCU This allows flexibility in an SCP to support service classes for which it supports the generalized version of a SOP Class but does not explicitly support the customized SOP Class It also allows a mechanism to easily make an SCP that supports all storage service class SOP Classes that are proposed to it innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 Related General SOP Classes can be supported in the application profile by defining a service list containing the related general SOP Classes for a given SOP class and then assigning the service list to the SOP Class The following example shows how this is done SCU_SR_General SERVICES_SUPPORTED 2 SERVICE_1 SERVICE_2 n TANDARD_ENHANCED_SR TANDARD_COMPREHENSIVE_SR n SCU_DX_General SERVICES_SUPPORTED SERVICE 1 1 STANDARD_DX_PRESENT SCU_Service_List SERVICES_SUPPORTED 3 SERVICE_1 STANDARD_BASIC_TEXT_SR REL_GENERAL_1 SCU_SR_General SERVICE_CLASS_1 1 2 840 10008 4 2 SERVICE_2 STANDARD_IO_PRESENT REL_GENERAL_2 SCU_DX_General SERVICE_CLASS_2 1 2 840 10008 4 2 SERVICE_3 STANDARD_CT SERVICE_CLASS_3 1 2 840 10008 4 2 I
144. aInfo metaInfo myFile MetalInfo Retrieve the attributes of the file meta info foreach MCattribute attr in metaInfo Attributes Use MCtag toString method to list each tag System Console Out WriteLine attr Tag ToString Accessing the File Preamble The Preamble property is provided to access the preamble portion of the file meta info The property can be used to get or set the preamble This property is available in both the MCfile container class and the MCfileMetalnfo class byte preamble myFile MetaInfo Preamble The same could be accomplished as follows byte preamble myFile Preamble Working with the contained data set The data set MCdataSet encapsulated in the MCfile class contains the DICOM information object associated with the file You can retrieve a reference to the contained MCdataSet object with the DataSet property Using that reference you can call the methods it inherits from MCattributeSet Get the data set attribute set MCdataSet ds myFile DataSet Retrieve the attributes of the data set foreach MCattribute attr in ds Attributes Use MCtag toString method to list each tag System Console Out WriteLine attr Tag ToString Resetting the MCfile object You can use the removeFileValues method to remove the values of each attribute in the file s data set and meta info set This is equivalent to calling the MCattributeSet removeValues method for each attribu
145. ad of Validation on page 124 The MCfile stream Merge DICOM concatenates the contents of the MCfileMetalnfo object and the MCdataSet object when streaming the MCfile object We will discuss later how to use the MCmediaStorageService to read and write the DICOM file streams You may need to know ahead of time how large the streamed file object will be before writing the object to media The stream s size can be obtained using the streamLength method uint length myFile streamLength Setting the file transfer syntax UID You can use the TransferSyntax property to set the value of the DICOM Transfer Syntax UID associated with this file It is sets attribute 0002 0010 in the file s file meta information to the UID string you provide myFile MetaInfo TransferSyntax MCtransferSyntax ExplicitLittleEndian Setting the file system file associated with the MCfile object Whether or not you specify a file system file name when constructing the MCfile object you can set or get the name at any time using the FileName property myFile FileName FileName String file myFile FileName innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual Listing the file s attributes Listing the file The list method produces a report describing the contents of the File Meta Info and Dataset contained in this MCfile The report will be written to the stream identified by the stream object
146. additional errors found back to the application A sample log file report follows Example Log File 01 13 52 09 00 7919 MC3 T5 0008 0005 VI Unable to check condition 01l 3 52 09 00 7919 MC3 T5 0008 0023 VI Unable to check condition 0i 3 52 09 00 7919 MC3 T5 0008 0033 VI Unable to check condition 0l 3 52 09 00 7919 MC3 T5 0010 1010 VE 41Y Invalid value for this tag s VR O1 13 52 09 00 7919 MC3 T5 0018 0010 VW Invalid attribute for service O1 13 52 09 00 7919 MC3 T5 0018 0015 VE Required attribute has no value 01 13 52 09 00 7919 MC3 T5 0018 0020 VW Invalid attribute for service 01 13 52 09 00 7919 MC3 T5 0018 0021 VW Invalid attribute for service 01l 13 52 09 00 7919 MC3 T5 0018 0022 VW Invalid attribute for service 01 3 52 09 00 7919 MC3 T5 0018 0023 VW Invalid attribute for service 01l 3 52 09 00 7919 MC3 T5 0018 0050 VW Invalid attribute for service 01 3 52 09 00 7919 MC3 T5 0018 0080 VW Invalid attribute for service O1 3 52 09 00 7919 MC3 T5 0018 0081 VW Invalid attribute for service 01 13 52 09 00 7919 MC3 T5 0018 0082 VW Invalid attribute for service 01 13 52 09 00 7919 MC3 T5 0018 0084 VW Invalid attribute for service ol 13 52 09 00 7919 MC3 T5 0018 0085 VW Invalid attribute for service gJ 13 52 09 00 7919 MC3 T5 0018 0091 VW Invalid attribute for service 0l 3 52 09 00 7919 MC3 T5 0018 1041 VW Invalid attribute for service 0l 3 52 09 00 7919 MC3 T5 001
147. ag 00080030 VR TM Name Study Time Length 6 gt 123429 lt Attribute gt lt Attribute Tag 00080060 VR CS Name Modality Length 2 gt 0T lt Attribute gt lt Attribute Tag 00081111 VR SQ Name Referenced Performed Procedure Step Sequence Length 1 gt lt Item gt lt Attribute Tag 00081150 VR UI Name Referenced SOP Class UID Length 23 gt 1 2 840 10008 3 1 2 3 3 lt Attribute gt lt Attribute Tag 00081155 VR UI Name Referenced SOP Instance UID Length 44 gt 2 16 840 1 113669 4 960070 844 1026926027 44 lt Attribute gt lt Item gt lt Attribute gt lt Attribute Tag 00090010 VR LO Name Private Creator Code PCode PrivateCode Length 11 gt SAMPLE PCODE lt Attribute gt innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual lt Attribute Tag 00091010 VR LO Name Private PCode SAMPLE PCODE Length 6 gt Valuel lt Attribute gt lt Attribute Tag 00091015 VR UN Name Private PCode SAMPLE PCODE Length 6 gt INAgNAEy lt Attribute gt lt Attribute Tag 00100010 VR PN Name Patient s Name Length 28 gt Last First lt Attribute gt lt Attribute Tag 7FE00010 VR OW Encoding Base64 Length 262144 gt HQAABgMAAAIHBAM lt Attribute gt lt DataSet gt lt DemFile gt Name Pixel Data The default encoding of bulks and attributes with VR UN
148. ages To generate such an attribute in command messages specify an initiator name lt none gt means do not put initiator name in messages DEFAULT lt none gt RECEIVER_NAME The DICOM standard has retired the old ACR NEMA Receiver Name attribute in command messages To generate such an attribute in command messages specify a receiver name lt none gt means do not put receiver name in messages DEFAULT lt none gt SEND_ECHO_PRIORITY The DICOM standard has retired the message priority attribute in echo command messages To generate such an attribute in command messages specify YES To NOT use message priority in echo messages specify NO DEFAULT NO SEND_LENGTH_TO_END The DICOM standard has retired the old Group Length To End attribute in command messages To generate such an attribute in command messages specify YES If you do not want to generate Group Length To End specify NO DEFAULT NO SEND_MSG_ID_RESPONSE The DICOM standard has retired the message ID attribute in response command messages To generate such an attribute in command messages specify YES To NOT use message ID in response messages specify NO DEFAULT NO innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 Description SEND_RECOGNITION_CODE The DICOM standard has retired the old Recognition Code attribute in command messages To generate such an attribute in command messages specify YES If you do n
149. aia ina iaaa 92 Contained attribute sets eecceececceeceeeeeceeeeeceaeeeeaaeseeneeseeeesaeeeesaeseeneeesaees 92 The service and command used by the message eeeeeeeeeeeteeeeeeneeeeeeaes 92 MCdimseMessage Command Set Properties ccecceeeeeeeeeeeeeeteeteeeeees 92 Constructing File ODj Cts cc cccceeeeeseeceeeeeeeeeeeeeaeeeeaeeseeeeeseaeeesaeeeeneeseaees 94 Construct with a pre populated data Set ccccesccessessecesseseeeesseeeeesseeaees 94 Construct with an empty data Set ceceecsceceeeeeeeeeeeeeeseeeeeseaeeeeaeeeeeeeesaees 95 Convert an MCdimseMessage object to an MCfile object cceeees 95 Setting data Set values 0 eeccecesceseeeeeeneeeeeeeeceaeeeeaaeeeeaeeseeeeeseaeeesaeeeeneeeeaees 95 Specifying the file NAMEC cceeececeeeeeeeeceeeeeceaeeeeaaeeeeaeeseeeeeseaeessaeeeeneeeeaees 95 Constructing Item Objects eccecceeeeeceeeeeee cent eeeeaeeeeneeseeeeesaeeesaaeeeeneeeeaees 96 Get Set item NaMe eciic cscs eee eel cect ele ceeded dat dep rae teesteed ties snandnaeaetiede 96 Constructing MCdataSet Objects cccceecceeeeeeeeeeeeeeeeeceeeeeseaeeeeaeeeeneeeeaees 96 Retrieving Contained Attribute Sets ceccceceeeeeeeeeeeeneeceeeeeeeeeeeeeeeeeeeeeaas 97 innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 Using the MCattribute ClaSS ccecccecceeeeeeeceeeee cee eeeeaeeeeeeeseeeesaeeseaeeseeeeess 97 Adding Attri
150. al Merge DICOM Toolkit V 5 1 0 Dealing with transfer syntaxes Transfer Syntax Lists for SCUs myAssoc MCassociation requestAssociation myAE remoteApp catch MCassociationRejectedException e catch MCconnectionFailedException e catch MCnegotiationAbortedException e catch MCunknownHostNameException e catch Exception e Negotiated Transfer Syntaxes Merge DICOM Toolkit supports all currently approved standard and encapsulated DICOM transfer syntaxes Encapsulated transfer syntaxes require compression of the pixel data contained in the message These messages can be sent and received by the toolkit A subsequent section describes how compression and decompression can be done with the library Encoding of this pixel data is also discussed below For DICOM Toolkit users the toolkit allows for the negotiation of more than one transfer syntax for a given DICOM service This functionality is of most use for applications supporting encapsulated transfer syntaxes This functionality may be disabled by use of the ACCEPT_MUTLPLE_PRES_CONTEXTS configuration value In order to understand how it is implemented a more in depth description of DICOM association negotiation is required During association negotiation a client SCU application will propose a set of presentation contexts over which DICOM communication can take place Each presentation context consists o
151. ale Byte Secondary Capture Image Storage Multi frame Grayscale Word Secondary Capture Image storage Multi frame Single Bit Secondary Capture Image Storage Multi frame True Color Secondary Capture Image Storage Segmentation Storage Surface Segmentation Storage Basic Structured Display Storage Basic Text Structured Reporting Comprehensive Structured Reporting Enhanced Structured Reporting Key Object Selection Chest CAD SR Colon CAD SR Mammography CAD SR X Ray Radiation Dose SR Encapsulated CDA Storage Encapsulated PDF Storage Procedure Log Blending Softcopy Presentation State Storage Color Softcopy Presentation State Storage Grayscale Softcopy Presentation State Storage Pseudo Color Softcopy Presentation State Storage innovative Imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual MCstorageCommitment Service MCmediaStorageService MCqueryRetrieveService MCbasicWorklist ManagementService MCprintManagement Service Service Class Storage Commitment Media Storage Query Retrieve Basic Worklist Management Print Management Services 12 lead ECG Waveform Storage Ambulatory ECG Waveform Storage Arterial Pulse Waveform Storage Basic Voice Audio Waveform Storage Cardiac Electrophysiology Waveform Storage General Audio Waveform Storage General ECG Waveform Storage Hemodynamic Waveform Storage Ophthalmic 8 bit Photography Image Storage Ophthalmic 16 bit Pho
152. ally supported DEFAULT NO This parameter sets the Merge DICOM Toolkit behavior in regards to support for DICOM Supplement 90 When set to YES Merge DICOM Toolkit will accept any presentation context which is defined as a Storage Service Class SOP Class DEFAULT NO If set to YES the toolkit automatically handles C ECHO requests when the application doesn t explicitly include STANDARD_ECHO in its supported service list If set to NO the toolkit rejects C ECHO requests when the application doesn t explicitly include STANDARD_ECHO in its supported service list DEFAULT YES This value defines the UID of the Deflated explicit VR little endian transfer syntax DEFAULT 1 2 840 10008 1 2 1 99 This value defines the UID of the explicit VR big endian transfer syntax DEFAULT 1 2 840 10008 1 2 2 This value defines the UID of the explicit VR little endian transfer syntax DEFAULT 1 2 840 10008 1 2 1 This parameter specifies how TCP IP connections are closed by the toolkit When set to YES TCP IP connections are instantaneously closed with an RST packet When set to NO TCP IP connections are closed gracefully with a FIN packet Note that in the NO case the toolkit must wait for an operating system dependent amount of time for the response to the FIN packet DEFAULT YES The DICOM Implementation Class UID as specified in your DICOM conformance statement The Implementation Version Number as specified in your DICOM co
153. ally you will only deal with the data set and the file meta information attributes will be set automatically by Merge DICOM Toolkit MCfile myFile new MCfile command serviceName MyFileName or MCfile myFile new MCfile command serviceName serviceName and command are used to access configuration information that describes the attributes of the message If such configuration information is not available an empty file object is created and a warning message is logged The filename parameter if used provides the name of the operating system file to be associated with this MCfile object innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 Constructing an empty file object Performance Tuning Preparing to save a network message to file Service and Command Properties setServiceCommand ServiceName Command Construct an MCfile object with an empty data set Two forms of the constructor are used if the service and command are not yet known or if there is no need to validate that values will be set only for attributes assigned to a given service command pair It creates an empty MCdataSet object The resulting MCfile object is not associated with any particular DICOM service or command If the validate method is to be called the setServiceCommand method must be called first to associate this file object with a given DICOM service and command MCfile myFile MCfile
154. am name request gt WADO QIDO request encoded as an array of lt see cref MCabstractMessage gt lt param gt lt param name xmlRequestParameters gt XML lt see cref string gt encoded from the list of lt see cref MCparameter gt of WADO QIDO request lt param gt lt param name response gt DICOM service response encoded as an array of lt see cref MCabstractMessage gt lt param gt lt param name xmlResponseParameters gt XML lt see cref string gt encoded from the list of lt see cref MCparameter gt of WADO QIDO response lt param gt lt returns gt Returns lt c gt True lt c gt if lt c gt Retrieve lt c gt operation succeeded lt returns gt bool Retrieve MCabstractMessage request String xmlRequestParameters out MCabstractMessage innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 response out String xmlResponseParameters lt summary gt Stores DICOM objects of STOW RS request into DICOM service storage lt summary gt lt param name request gt STOW RS request encoded as an array of lt see cref MCabstractMessage gt lt param gt lt param name xmlRequestParameters gt XML lt see cref string gt encoded from the list of lt see cref MCparameter gt of STOW RS request lt param gt lt param name response gt DICOM service response encoded as an array of lt see cref MCabstractMessage gt lt param gt lt param name xml
155. ameter Requirements REQUIRED Attributes new List lt MCrequestAttribute gt attr H keyword MCwado DicomKeywords MCdicom SOP_INSTANCE_UID attr new MCrequestAttribute Item keyword Tag MCdicom SOP_INSTANCE_UID Keyword keyword Values new string sopInstanceUid parms Add new MCrequestParameter Name keyword RequestRequirement MCrequestParameter Requirements REQUIRED Attributes new List lt MCrequestAttribute gt attr return new MCrequest request MCrequestType WadoRS parms ToArray lt MCrequestParameter gt Submit innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 lt summary gt Http Get method lt summary gt lt param name request gt lt see cref HttpRequestMessage gt object lt param gt lt param name studyInstanceUid gt StudyInstanceUID parameter lt param gt lt param name seriesInstanceUid gt SeriesInstanceUID parameter lt param gt lt param name sopInstanceUid gt SopInstanceUID parameter lt param gt lt param name frameList gt SimpleFrameList parameter lt param gt lt returns gt lt see cref HttpResponseMessage gt object lt returns gt ActionName frames public HttpResponseMessage Get HttpRequestMessage request String studyInstanceUid String seriesInstanceUid String sopInstanceUid String frameList List lt MCrequestParameter gt parms new List lt MCrequestParamete
156. ameter name to the left of an equal sign and its initial value to the right Zero of more spaces may precede and follow the equal sign Figure 9 illustrates the format of an ini file Notice that parameter names are relative to their header sections For example PARAMETER_1 and PARAMETER_2 are defined twice in the above example ini file But since each is defined in a different section they are considered different entities Each of the four configuration files are discussed separately below Only the key configurable parameters are summarized here For detailed descriptions of all configuration files and their parameters see Appendix D Configuration Parameters innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 MERGE_INI environmental variable needed only by utility programs Use MC mclnitialization to provide Initialization File location DICOM AE Title Initialization File The Merge DICOM Initialization File usually called merge ini provides the DICOM Toolkit with its top level configuration It specifies the location of the other three configuration files along with message and error logging characteristics All Merge DICOM applications require access to the Initialization File Your NET programs access the Initialization File differently than do C applications such as the utility programs distributed with the Merge DICOM Toolkit The C utility programs access the merge
157. an be thought of as the type specifier for the values that can be assigned to an attribute This includes the data type as well as its format The VR s defined by DICOM are listed in Table 3 You should refer to Part 5 of the standard for a detailed description of their legal values and formats Table 3 DICOM Value Representations VR s VR Name VR Name AE OW Other Word String AS PN Person Name at SH Short Sing CS SL Signed Long DA SQ Sequence of Items DS SS Signed Short DT ST Short Text FD UI Unique Identifier IS UL Unsigned Long LO UN Unknown LT US Unsigned Short OB UT Unlimited Text o o Value Multiplicity A single attribute can have multiple values Value Multiplicity defines the number of values an attribute can have VM can be specified as 1 k 1 k or 1 n where k is some integer value and n represents many For example Part 6 specifies the VM of Scheduled Discharge Time 0038 001D as 1 while the VM of Referenced Overlay Plane Groups 2040 0011 is 1 99 Message Handling MCattributeSet Given the number of services and commands specified in Table 7 and Table 2 it is clear that there are a great deal of messages to manage in DICOM Remember each service command pair implies a different message Fortunately you will innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 see later that Merge DICOM Toolkit saves the application developer a great deal of work in the mes
158. an be used to save an image to disk as it is received over the network Replacing Merge DICOM Toolkit s Memory Management Functions When using registerAttributeContainer to replace Merge DICOM Toolkits memory management functions the user would still use the MCattribute This can be tricky E readBulkData and setValue methods to access the image When requested Merge DICOM will receive or supply the attribute s value to the attribute container Performance Tuning E EE EE Accessing Data When Needed setValueFromMethod When dealing with large multi frame images it is sometimes impractical to load the entire image into memory at once registerAttributeContainer can be used to access image data only when needed The memory requirements of an application can be greatly reduced by using this functionality Se When reading messages from the network the MCassociation read method supplies the user s registered callback class with the image data If the data does not need to be byte swapped into the system s native endian the amount of data supplied with each call is dictated by the PDU size of the data received When the data is byte swapped the length of data is specified by the read WORK_BUFFER_SIZE configuration value As the data is received it would Senne Uva Sede typically be written to disk in this scenario When the read method returns the user is given the message read from the network encapsulated in an MCdimseMes
159. and or sending a message created in this manner new MCdimseMessage MCdataSet new MCdataSet if command service supplied when constructing MCdataSet innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual Performance Tuning Message Object Construction Method new MCdimseMessage MCdataSet if no command service supplied when constructing MCdataSet MCdimseMessage read MCassociation new MCfile if command service supplied new MCfile if no command service supplied new MCfile MCdimseMessage if command service supplied when constructing MCdimseMessage new MCfile MCdimseMessage if no command service supplied when constructing MCdataSet new MCdataSet If command service supplied new MCdataSet If no command service supplied Point at which file access overhead for validation occurs MCdimseMessage validate MCdimseMessage validate new MCfile MCfile validate Note You must use setServiceCommand method before validating and or sending a message created in this manner new MCdimseMessage MCfile validate new MCdataSet MCdataSet validate When the attribute set is constructed by providing the service and command to be used there is an up front performance cost but it provides additional validation as you set the value of attributes in the message object When the service and command are not known at construction time the cost occurs when the validate call is
160. andard requires that RemotelmplementationVersion association requestors and acceptors notify each other of their respective innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 LocalMaxPDUsize RemoteMaxPDUsize ProposedContextList NumberOf ProposedContexts ReadTimeout RemoteHostName RemotelpAddress RemotePort Acceptor Requester Implementation Class UID The LocalImplementationClassUid property returns the Implementation Class UID of the local application and the LocalImplementationVersion property returns the Implementation Version of the local application The RemoteImplementat ionClassUid property returns the Implementation Class UID of the remote application and the RemoteImplementationVersion property returns the Implementation Version of the remote application Maximum PDU Sizes During association negotiation Merge DICOM and the remote DICOM system exchanged the maximum size of Protocol Data Units that each is willing to receive Each system commits to send TCP IP data no larger than that negotiated for the receiver The LocalMaxPDUsize property returns the size of the largest PDU that the local system is willing to receive The Remot eMaxPDUsize property returns the size of the largest PDU that the remote system is willing to receive The Proposed Context List When an MCassociation object is constructed an MCproposedContextList object is usually provided to define the services tha
161. andling Mcexception MCruntimeException and their sub classes Compression related o Compression Interface _MCcompression RLE Compressor MCrleCompressor RLE Decompressor MCrleDecompressor JPEG and JPEG2000 Compressor MCstandardCompressor JPEG and JPEG2000 Decompressor MCstandardDecompressor C Ww C Ww C Ww e innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 Visibility Constant values for DICOM tags Errors Happen Exception Numbers This section of the User s Manual attempts to present the highlights of the Merge DICOM Toolkit Assembly in a logical manner as it might be used in real DICOM applications The classes are presented in the context of example C source code snippets and alternative approaches are presented that tradeoff certain features for the benefits of increased performance Most of the discussions that follow pertain both to networking and media interchange applications only the Association Management Negotiated Transfer Syntaxes and Message Exchange sections are networking specific The last two sections DICOM Files and DICOMDIR are media interchange specific Library Import In order to access the classes of the Merge DICOM Toolkit you should use the mergecom namespaces in your applications This gives you visibility not only to the public and protected classes but it also provides visibility to the constants contained in the MCdicom
162. arameter Section Description PORT_NUMBER lt remote_application_title gt This parameter is the TCP IP port on which the remote DICOM system listens for connections The commonly used port number is 104 This default value may be overridden by the requestAssociation method of the MCassociation class HOST_NAME lt remote_application_title gt This parameter is the name of the remote host as it is known to your TCP IP system This default value may be overridden by the requestAssociation method of the MCassociation class The parameters value must be 1 to 19 bytes in length with no embedded spaces NOTE that a numeric internet address may be used e g 192 204 32 1 innovative Imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual Parameter Section Description SERVICE_LIST lt remote_application_title gt This parameter is the name of a section in the application profile which provides a list of services for which local applications will negotiate when attempting to establish an association This is a default list another list may be specified in the requestAssociation method of the MCassociation class The parameters value names must be 1 to 33 bytes in length with no embedded spaces The SERVICE_LIST section of the Application Profile is used to describe the DICOM services that will be negotiated by the listed Application Entity The parameter values are text strings recognizable by the Merge DICO
163. ass If responseMsg is not provided Merge DICOM will create one automatically Some DICOM services require that values for certain command set attributes i e group 0 attributes be set Merge DICOM automatically adds command set attributes when an MCdimseMessage is constructed With the exceptions listed below you must set any command set attribute values before sending the message However this method will set the following attribute values for you if you have not set them e The group length attribute 0000 0000 value is always set by Merge DICOM Toolkit e Ifthe message command requires it the Affected SOP Class UID attribute 0000 0002 value is set to the service s abstract syntax UID e The command attribute 0000 0100 value is always set by Merge DICOM Toolkit e The Response Message ID attribute 0000 0120 value is set to the message ID of the last received Request message for this association e The Data Set Type attribute 0000 0800 value is always set by Merge DICOM Toolkit Using Attribute Containers The MCaitributeContainer and MCatiributeContainerEx interfaces referenced MCattributeContainer for breivity are the interfaces for classes that will provide methods for the library to get and set a given attribute s value A class which implements this interface is registered with the library using the registerAttributeContainer method of the MCapplication class The library considers this interface a
164. ated by commas File to request that the messages be written to the LOG_FILE Screen to request that the messages be written to the system s standard out Memory to request that the messages be written to system memory This option is useful if the application registers a custom log handler and no other destination is selected Please note that Error_Msg type messages are always written to the LOG_FILE Capturing Log Messages in Your Application Log Callback You may want to capture log messages yourself for example to integrate Merge usanier DICOM log messages into your application s logging scheme removeHandler MClogHandler To do this create a new class that implements the MClogHandler interface MClogInfo That interface requires you to provide a receiveLogMessage method that will be called by Merge DICOM whenever it is logging a message Information about the logged message is passed to the receiveLogMessage method in an instance of the MClogInfo class You must register your log handler using the addHandler method of the MClog class Once registered your MClogHandler class will be notified as messages are logged Multiple handlers can be registered at any given time You can de register a handler by calling the removeHandler method of the MClog class innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 Create an application object MCapplication getApplication A
165. ated roles Note that in some cases a service will be rejected because the roles being negotiated do not match Table 9 Negotiated Roles Requestor s Acceptor s Requestor s Acceptor s Configured Role Configured Role ALEG Mm ao Negotiated Role SCU SCP SCU SCU Rejected SCP Rejected SCU SCP NOT DEFINED Rejected Rejected SCP SCU SCU SCP NOT DEFINED SCP SCU SCU Rejected For detailed information about the content of the Application Profile see Application Profile in Appendix D Configuration Parameters innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual Configuring Asynchronous Communications Support Configuring Extended Negotiation for Clients DICOM Asynchronous Communication Merge DICOM also optionally supports DICOM Asynchronous Operations Window Negotiation through service lists The same service list can be used in this case for both the client SCU and server SCP The following is an example service list that configures DICOM asynchronous communication negotiation SCU_Or_SCP_Service_List SERVICES_SUPPORTED 1 Number of Services MAX_OPERATIONS_INVOKED 10 MAX OPERATIONS PERFORMED 10 SERVICE_1 STANDARD_MR In this case the SCU_Or_SCP_Service_List supports the Standard MR SOP Class For all services it supports 10 maximum operations invoked and 10 maximum operations performed When MAX_OPERATIONS_INV
166. ated to characteristics of your own application entity A detailed description of the application profile can be found in Merge DICOM Toolkit Users Manual This section will define how each parameter should be defined within the application profile Sections The application profile contains the following sections innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 Table 29 Application profile section headings Section Description lt remote_application_title gt Section describing a remote DICOM Application Entity title s The remote Application Entity titles listed here must be 1 to 16 bytes in length with no embedded spaces Simply this section is where you list the DICOM applications you want to communicate with lt service_list_name gt List s of DICOM services that will be provided by the Application Entities listed in the lt remote_application_title gt sections The service names listed here must be 1 to 33 bytes in length with no embedded spaces Simply this section is where you list the services that are provided by the remote DICOM applications lt syntax_list_name gt List s of DICOM transfer syntaxes that will be supported by the services listed in the lt service_list_name gt sections The transfer syntaxes must be one of those listed in Table 32 Parameters The application profile contains the following parameters Table 30 Application profile section headers P
167. ation This method will release all resources allocated by the Merge DICOM C C Toolkit dynamic link library mcLibraryRelease must be called in the same application domain in which the mcInitialization call was made After the Library is successfully released it can be re initialized in either the same application domain or a new one Getting the Assembly Version You can use the static mcGetVersionString method of the MC class to retrieve the string identifying the Merge DICOM Library version The library version number string is of the form n m v where n is major version number m is minor version number and v is an interim release number Releasing Native Memory The Merge DICOM NET Classes call a number of routines in the C Merge DICOM toolkit that allocate memory The NET classes have been written so native resources associated with a NET class are automatically freed when the NET CLR garbage collector cleans up the managed memory in the class Note however that a number of classes implement the dispose method that an application can use if it wants greater control over when native memory is freed Note that after this method is called for a specific instance that instance can no longer be utilized by your application Here is a list of the classes that can be disposed explicitly e MCapplication e MCassociation e MCdataSet e MCdimseMessage contains a MCdataSet reference e MCfile contains a MCdataSet reference e
168. attribute set ds readFromxXML reader reader Close To handle bulk Uri from a Native DICOM Model XML file the MCbulkDataUriHandler interface is used Following shows how to implement this task innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 class BulkDataUriHandler MCbulkUriHandler public object provideData MCattributeSet attrSet unit tag MCvr vr string uri if tag MCdicom PIXEL_DATA use parameter uri to retrieve your data based on your data create an array of datasize byte data new byte datasize populate your data array return data call an overloaded method of readFromXMLNative ds readFromxMLNative reader new BulkDataUriHandler By default if no Bulk URI handler is supplied and a bulk URI attribute is encountered in the XML file the toolkit will generate an empty attribute tag with zero length for the encountered tag Converting an Attribute Set into a DICOM JSON Model String Array of Attribute setto YOU can convert a list of attributes of an array of attribute set along with their array of JSON objects values into DICOM JSON Model string by using the writeDataSetsToJSON conversion method of the MCattributeSet The writeDataSetsTOJSON method creates a DICOM JSON Model PS3 18 string describing the contents of the MCattributeSet The API helps converting an array of data sets to a JSON file containing an array of JSON objects The J
169. attributes contained in MCfile objects it accesses the contained MCfileMetalnfo or MCdataSet objects using the MCattributeSet methods inherited by those classes Both MCdimseMessage and MCfile classes provide DataSet properties to retrieve the contained data set object The MCdimseMessage provides a CommandSet property to retrieve the contained command set and the MCfile class provides a Metalnfo property to retrieve the contained file meta info MERENN Using the MCattribute class New DICOM attributes can be defined by constructing a new MCattribute class object An MCdataElement object is used to construct the MCattribute de new MCdataElement new MCtag 0x00080010 MCattribute myAttr new MCattribute de The MCattribute class exists primarily to contain the properties of the DICOM attributes they encapsulate Properties of the MCattribute class allow you to retrieve the following properties e The number of values currently stored for the attribute the Count property e The tag that identifies the attribute the Tag property e The DICOM Value Representation for the attribute the ValueRepresentation property e The values of the attribute innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 Adding attributes to the set Getting an MCattribute from an attribute set e The keyword of the attribute int count myAttr Count MCtag tag myAttr Tag MCvr vr myAttr ValueRep
170. be properly written to handle future VRs The need for this supplement is mainly for use in archive systems An archive will typically want to preserve the private attributes contained within a message for later use There also may be a need to add support for new image objects with new VRs to an archive system without having to change the software Unfortunately the method that Supplement 14 specifies for encoding UN value representation attributes is in some cases not compatible with older DICOM implementations Versions previous to 2 2 2 of the Merge DICOM toolkit do not parse these attributes properly The MCassociation read method will fail and the association will be aborted if a UN VR attribute is received This has obviously caused a variety of interoperability problems in the field The typical DICOM scenario where UN VR can cause a DICOM communication failure is the following a modality exports a series of images to a PACS or innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual archive system via the DICOM storage service class The images were encoded in the implicit VR little endian transfer syntax and contain multiple private attributes Later a DICOM workstation decided to retrieve the images from the archive or PACS system The workstation does not yet support UN VR however the PACS or archive system does The workstation uses the DICOM query retrieve service c
171. ber of bytes read in size int size set isLast to true if this is last of the data bool isLast MCdata data new MCdata chunk size data IsLast isLast prevData data remember the current MCdata object return data public void Dispose if prevData null prevData Dispose prevData null The MCdataSource class is called by Merge DICOM only when triggered by the application For example the application might use MyPDSupplyCallback to set the value of the MCdicom PIXEL_DATA attribute 7FEO 0010 as follows MCattributeSet as non null referenc uint length MyPDSupplyCallback cb new MyPDSupplyCallback cb file MypixelDataFile MCattribute attrib as MCdicom PIXEL_DATA attrib setValue cb length after stream out or write out your pixel data cb Dispose this will dispose last used MCdata innovative imaging NET C User s Manual Merge DICOM Toolkit v 5 1 0 Performance Tuning MCfileDataSource MCstreamDataSource MCmemoryDataSink On making this call the toolkit library will keep a reference to the MCdataSource instance When the data is required by the toolkit if the attribute set is written to a file or to the network it will repeatedly call the provideData method of the callback class until it indicates that all of the pixel data has been read in without any errors If your callback class throws MCcallbackCann
172. bject Each MCmediaStorageService instance is associated with an application entity It is necessary to provide a reference to your AE s MCapplication object when constructing an instance of the MCmediaStorageService MCapplication myApp non null referenc MCmediaStorageService myMediaService new MCmediaStorageService myApp Reading Files To read in the contents of a DICOM file for analysis or parsing you use one or three methods available in the MCmediaStorageService class for reading DICOM files Each of the methods passes a reference to a class that implements the MCdataSource interface The callback class will actually read the file stream from media The three methods are e readFile This method calls your MCdataSource to retrieve the DICOM file stream It decodes the stream and populates the MCfileMetalnfo and MCdataSet attribute sets that are contained in your MCfile object If the stream contains an attribute for which an MCattributeContainer instance has been registered the attribute s value is passed on to the MCattributeContainer rather than having Merge DICOM store the value Capplication myApp non null referenc Cfile fileObj new MCfile FileName CdataSource source new MCfileDataSource fileObj FileName CmediaStorageService service new MCmediaStorageService myApp try innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual
173. bject represents an acceptor association and the Requester innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual Active All about SOP classes getSopClassByName getSopClassByUid BaseClasses Commands Name Number Uid BaseClass MetaClass Equals property returns t rue if this MCassociation object represents an requester association Association State For a DICOM association requester application an association is considered active from the moment the requester receives a successful return from the MCapplication requestAssociation call until it calls the MCassociation release method or until the association is aborted by either the local requester or remote acceptor application For a DICOM association acceptor application an association is considered active from the moment the acceptor calls its accept method until the association is released by the remote requester or until the association is aborted by either the local acceptor or remote requester application The Active property returns true if the association is currently active Refer to the MCassociation Active property description in the Assembly Windows Help File for more detailed information about association states Using the MCsopClass class The MCsopClass class encapsulates the properties of a DICOM service Merge DICOM manages instances of the MCsopClass for each service defined in the System Profile mergecom srv MCsopClass c
174. ble 11 Permissible data types per Value Representation of the attribute Data Type May be used to set attributes with these VRs AE DS IS Ul CS LO LT SH ST UT DA DT TM AS PN FL FD AT UL SL SS US e mo o ssum OO eo o psss O MCattributeSet myAttrSet non null referenc MCtag tagl new MCtag 0x00080020 MCtag tag2 new MCtag 0x00080030 MCtag tag3 new MCtag 0x00080052 MCtag tag4 new MCtag 0x00280010 the value can be any of the types shown in Table 11 String value my value myAttrSet setValue myAttrSet setValue myAttrSet putValue myAttrSet setValue tagl new MCdate 20051109 tag2 new MCtime 081401 tag3 PATIENT tag4 ushort 256 innovative Imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 Values are converted to the proper Value Representation Using alternate character sets Supplying pixel data MCdataSource provideData method MCdata class MCcallbackCannotComply Exception setValue Merge DICOM will perform any reasonable conversion from the types listed in Table 11 to the form necessary to encode it in the Value Representation of the attribute If a type conversion is not reasonable e g from short to LT then an MCincompatibleValueException will be thrown An MCinvalidEncodingWarning will be thrown if the value is invalid according to the rules for the value representation Note that this is j
175. bute is multi valued If the VR is a text VR and the attribute is multi valued the length also includes the numbers of separators If the attribute s value is a DICOM NULL zero is returned If an attribute has a value representation of SQ the number of items in the sequence is returned MCattributeSet as non null referenc MCtag tag new MCtag 0x0008 0x0010 uint length as tag ValueLength Please refer to the Assembly Windows Help File for the exceptions that may be thrown You can use the Count property of the MCattribute class to retrieve the number of values that are currently stored for an attribute If no values are stored for the attribute zero will be returned If the attribute contains one NULL value 1 will be returned MCattributeSet as non null referenc MCtag tag new MCtag 0x0008 0x0010 int values as tag Count Listing an Attribute Set You can create a formatted list of the attributes of an attribute set along with their values by using the List method of the MCattributeSet The 1ist method produces a report describing the contents of the MCattributeSet or one of its sub classes The report will be written to the TextWriter provided or to stdout if a file is not provided innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual Note If the object contains an attribute with a Value Representation of SQ sequence of items each item in the sequence will
176. butes to an Attribute Set cccceccccseeeeeseeeeeseseeesseneeeeseaas 98 Using the MCattributeSet indexer to access MCattribute instances 98 Removing Attributes from an Attribute Set cc ccccecsseeeesseeeeeesseeeesenes 99 AttriDute POP Ortles saiie cee cece decent ep asececes hte esadeaceies deeb ends ceeded eevetendeeeeeneaeetaes 99 Assigning Attribute Values from MCattribute cccccsseeeeessteeeeeesteeeeeeees 99 Assigning Attribute Values from MCattributeSet ceecsseeeeessteeeeeeees 99 Difference between setValue addValue and indexer ccccccceeeeeeeeees 100 Assigning a NULL Attribute Value eee reser ae eneeeeneeeee 100 Assigning a Non NULL Attribute eer rene ernie erent 100 Using an MCdataSource Class to Assign an Attribute Value 08 102 Retrieving Attribute Values 00 eee eeceeeeeenneeeeeeeneeeeesaeeeeetaeeeeeeaeeeettaeeeene 105 Using a Callback Class to Retrieve an Attribute s Value 0 eeeeeee 106 Retrieving an Attribute Value s Properties eececeeeesteeeeeeeneeeeeeneeeeees 108 Listing an Attribute Set ccceccceceeeeeseeeeeeeeceeeeeseaeeeenaeseeeeeseaeeesaaesneneeeeaees 108 Converting an Attribute Set into a Proprietary Schema XML String 109 Converting a Proprietary Schema XML String into an Attribute Set 110 Converting an Attribute Set into a Native DICOM Model XML String 110 Converting a Native
177. by their position in the Content Item tree They have an implicit order as defined by the order of the Sequence Items When a Content Item is the target of a by reference relationship its position is specified as the Referenced Content Item Identifier in the source Content Item Figure 20 illustrates an SR content tree and identifiers associated with each Content Item The MCitemldentifer class encapsulates the Content Item Identifer innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 Root Content Item ID 01 Seq __ _ Content Item ID 01 02 Content Item ID 010102 Content Item ID 0101 Seq __ __ Content Item ID 0101 01 Figure 20 SR Item Identifier Observation Context Observation Context describes who or what is performing the interpretation whether the examination of evidence is direct or quoted what procedure generated the evidence that is being interpreted and who or what is the subject of the evidence that is being interpreted Initial Observation Context is defined outside the SR Document Content tree by other modules in the SR IOD i e Patient Module Specimen Identification General Study Patient Study SR Document Series Frame of Reference Synchronization General Equipment and SR Document General modules Observation Context defined by attributes in these modules applies to all Content Items in the SR Document Content tree and need not be explicitly
178. cation must be re run or the library reinitialized for those changes to take effect Binary Message Information and Data Dictionary Files A great deal of the power of Merge DICOM Toolkit lies in its message handling and message validation capabilities Message Objects are what is communicated between DICOM Application Entities When your application creates a DICOM message object the library accesses a binary message info file with information about that class of message This info file describes to the library what attributes to expect as part of that message and each attribute s characteristics Value Type Conditions and Enumerated or Defined Terms Another binary file containing the data dictionary is also accessed by the library The data dictionary contains other characteristics of attributes Name Value Representation and Value Multiplicity Merge DICOM Toolkit gives you added flexibility by not requiring your application to make use of the message info file Certain API calls allow you to open messages without accessing the info files This means that the toolkit cannot validate your message against the DICOM standard but this may not always be necessary once an application becomes stable These options are discussed in detail in the Developing DICOM Applications section of this document Sample Applications Included with the toolkit are sample C applications and Visual Studio 2005 project files that compile the sample appl
179. cific exception was thrown The exception numbers are defined by constants in the MCexception class and listed in Table 10 The following for example may be used to check exception after a network read innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual try msg assoc read 30000 catch MCassociationReleasedStatus e Normal association completion System Console Out WriteLine Association Released catch MCexception e Association is no longer active if e exceptionNumber NETWORK_SHUTDOWN System Console Out WriteLine Network dropped lse if e exceptionNumber ASSOCIATION_ABORTED System Console Out WriteLine Assoc abort else if e exceptionNumber INVALID_MESSAGE_RECEIVED System Console Out WriteLine Invalid msg lse if e exceptionNumber NETWORK_INACTIVITY_TIMEOUT System Console Out WriteLine Network stopped else System Console Out WriteLine MCexception break catch System Exception e System Console Out WriteLine Error on network read assoc abort break You could of course have separate catch clauses for each exception Table 10 exceptionNumber property for each MCexception class MCexception subclass exceptionNumber property ALREADY_INITIALIZED_ EXCEPTION ASSOCIATION_ABORTED ASSOCIATION REJECTED ASSOCIATION_RELEASED ATTRIBU
180. cified alone in the command line the complete list of pairs is printed out without pausing m This option allows the user to generate a DICOM file When generating the file object mc3fil ncodes the Fil Meta Information q This option prevents mc3file from prompting the user for correct service command pairs It is a useful option when running the program from a batch file This option specifies the transfer syntax the DICOM message generated is stored in The default transfer syntax is implicit little endian The possible values for lt syntax gt are il for implicit little endian el for explicit little endian and eb for explicit big endian f lt file gt This option allows the user to specify the first eight characters of the names of the DICOM message files being generated mc3file will then append a unique count to the end of the filename for each messag being generated The default value is file when creating a DICOM file and message when creating the format that DICOM messages send over a network t lt syntax gt MC3File retrieves default values for attributes from the text file default pfl Unlike the info pfl and diction pfl files which are converted into binary files default pfl is used as a text file It will first be searched for in the current directory and then in the message information directory This file contains d
181. coding of conventional textual reports as SR Documents as well as their rendering e Enhanced SR Information Object Definition The Enhanced Structured Report SR IOD is a superset of the Basic Text SR IOD It is also intended for the representation of reports with minimal usage of coded entries typically Document Title and headings and a hierarchical tree of headings under which may appear text and subheadings In addition it supports the use of numeric measurements with coded measurement names and units Reference to SOP Instances e g images or waveforms or SR Documents are restricted to display at the leaf level of this primarily textual tree The Enhanced Structured Report SR IOD enhances references to SOP Instances with spatial regions of interest points lines circle ellipse etc and temporal regions of interest e Comprehensive SR Information Object Definition The Comprehensive SR IOD is a superset of the Basic Text SR IOD and the Enhanced SR IOD which specifies a class of documents the content of which may include textual and a variety of coded information numeric measurement values references to the SOP Instances and spatial or temporal regions of interest within such SOP Instances Relationships by reference are enabled between Content Items There are more specific SR IODs defined in the DICOM like Key Object Selection Document and Mammography CAD SR These IODs use the same method to encode data but differ in
182. com STUDY_DATE 19991029 dataSet setValue MCdicom CONTENT_DATE 19991029 dataSet setValue MCdicom STUDY_TIME 154500 dataSet setValue MCdicom CONTENT_TIME 154510 dataSet setValue MCdicom ACCESSION_NUMBER 123456 dataSet setValue MCdicom MODALITY KO dataSet setValue MCdicom MANUFACTURER MERGE dataSet setValue MCdicom REFERRING_PHYSICIANS_NAME Luke wili adr MD innovative Im ya a Merge DICOM Toolkit V 5 1 0 NET C User s Manual dataSet setValue MCdicom REFERENCED_PERFORMED_PROCEDURE_STEP_SEQUENCE null dataSet setValue MCdicom PATIENTS_NAME Jane Doo dataSet setValue MCdicom PATIENT_ID 234567 dataSet setValue MCdicom PATIENTS_BIRTH_DATE 19991109 dataSet setValue MCdicom PATIENTS_SEX F dataSet setValue MCdicom STUDY_INSTANCE_UID 1 2 3 4 5 6 7 100 dataSet setValue MCdicom SERIES_INSTANCE_UID 1 2 3 4 5 6 7 200 dataSet setValue MCdicom STUDY_ID 345678 dataSet setValue MCdicom SERIES_NUMBER 1 dataSet setValue MCdicom INSTANCE_NUMBER 1 dataSet setValue MCdicom PERFORMED_PROCEDURE_CODE_SEQUENCE null MCitem iteml new MCitem HIERARCHICAL _SOP_INST_REF_MACRO iteml setValue MCdicom STUDY_INSTANCE_UID 1 2 3 4 5 6 7 100 MCitem item2 new MCitem HIERARCHICAL_SERIES_REF_MACRO item2 setValue MCdicom SERIES_INSTANCE_UID 1 2 3 4 5 6 7 200 MCitem item3 new MCitem REF_SOP following UIDs are the same as used i
183. configuration value does not have any effect on embedded platforms DEFAULT NO Configuration Parameter for MC_Standard_Decompressor to deal with lossless JPEG images whose suffix have been invalidly written according to the JPEG specification These images have a 16 zero bit suffix following a 32768 prefix where the JPEG spec says the suffix is omitted following a 32768 prefix The following are the valid settings 1 Default fail on these images 0 Ignore when user detects such images 1 Let the toolkit detect and ignore automatically innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 Name LARGE_DATA_SIZE LARGE_DATA_STORE LIST_SQ DEPTH_LIMIT LIST_UN_ATTRIBUTES LIST_VALUE_LIMIT MSG_FILE_ITEM_OBJ_TRACE MSG_INFO_FILE NULL_TYPE3_VALIDATION OBOW_BUFFER_SIZE PEGASUS_DISP_REG_ NAME Description Defines Large Data to the toolkit Large Data is defined as an attribute value which has a length of LARGE_DATA_SIZE or more DEFAULT 200 This parameter specifies where Large Data values should be stored FILE means store the values in temporary files MEM means store the values in memory Note Embedded systems should ignore this parameter and always use MEM DEFAULT MEM Limit the depth of sequences listing This parameter should be set to the maximum number of levels any sequence should be listed DEFAULT is 0 means do not limit the listi
184. cted MCitem emptyItem new MCitem MCitem myItem new MCitem REF_FILM_BOX Available item names are listed in the message txt file for attributes in messages having a VR of SQ The contents of each item are also listed in the message txt file Below are two excerpts of message txt one showing a reference to the Referenced Film Box Item and the other the contents of that item BASIC_FILM SESSION N_SET_ROQ 0008 0005 Specific Character set cs 3 Defined Terms ISO IR 100 ISO IR 101 ISO IR 109 ISO IR 110 ISO IR144 ISO IR 127 ISO IR 126 ISO IR 138 ISO IR 148 0008 0012 Instance Creation Date DA 3 0008 0013 Instance Creation Time TM 3 0008 0014 Instance Creator UID UI 3 0008 0016 SOP Class UID UI 3 0008 0018 SOP Instance UID UI 3 2000 0010 Number of Copies Is 3 2000 0020 Print Priority cs 3 Enumerated Values HIGH MED LOW 2000 0030 edium Type CS 3 Defined Terms PAPER CLEAR FILM BLUE FILM 2000 0040 Film Destination cS 3 Enumerated Values MAGAZINE PROCESSOR 2000 0050 Film Session Label LO 3 2000 0060 emory Allocation ES 3 2000 0500 Referenced Film Box Sequence SQ 3 Item Name s REF_FILM BOX Item Name REF_FILM_BOX 0008 1150 Referenced SOP Class UID UL 1 0008 1155 Referenced SOP Instance UID UL 1 Encoding items in a To encode an item into an attribute of Value Representation SQ treat the sequence attribute as a multi valu
185. ctivity Note that for optimum performance these values should be at least slightly larger than the PDU_MAXIMUM_LENGTH configuration value Note also that setting these values to an even multiple of the TCP IP MSS Maximum Segment Size of 1460 bytes can help increase performance Note also that some operating systems such as Linux have auto tuning of TCP IP buffer sizes implemented when an explicit TCP IP Send and Receive buffer size are not set These options can be set to zero to disable Merge DICOM Toolkit s setting of each buffer size DEFAULT 131400 MAXIMUM Operating System dependent Performance tuning Service Profile The Service Profile is generated by Merge OEM and contains DICOM standard services and commands and is a useful reference along with the message txt file mentioned previously to find the Merge DICOM names for the standard DICOM services and items It is used by the library to negotiate the proper SOP Class UIDs and to access the binary dictionary and message information files when creating instances of message objects and validating messages In most cases it will not be necessary to modify the Service Profile However if you are using an extended toolkit to create your own private services you will need to add specifications for these private services to the Service Profile See the Merge DICOM Toolkit Extended Toolkit Manual for further details The location of the Service Profile is provided by the
186. ctor lt summary gt public MCstowController lt summary gt Http Post method lt summary gt lt param name request gt lt see cref HttpRequestMessage gt object lt param gt lt returns gt lt see cref HttpResponseMessage gt object lt returns gt HttpPost public HttpResponseMessage Post HttpRequestMessage request Name MCcontroller MCSTOWCONTROLLER return new MCrequest request MCrequestType Stow Submit lt summary gt Http Post method lt summary gt lt param name request gt lt see cref HttpRequestMessage gt object lt param gt lt param name studyInstanceUid gt StudyInstanceUID parameter lt param gt lt returns gt lt see cref HttpResponseMessage gt object lt returns gt ActionName studyinstanceuid public HttpResponseMessage Post HttpRequestMessage request String studyInstanceUid List lt MCrequestParameter gt parms new List lt MCrequestParameter gt string keyword MCwado DicomKeywords MCdicom STUDY_INSTANCE_UID MCrequestAttribute attr new MCrequestAttribute Item keyword Tag MCdicom STUDY_INSTANCE_UID Keyword keyword Values new string studyInstanceUid parms Add new MCrequestParameter Name keyword RequestRequirement MCrequestParameter Requirements REQUIRED Attributes new List lt MCrequestAttribute gt attr return new MCrequest request MCrequestType Stow parms ToArray lt MCrequestParamet
187. d you cannot find what you are looking for in that part you probably need to get the proper supplement from NEMA Other additions to the Standard e g new image objects or documents will also be published as supplements NEMA also makes all supplements to the standard freely available on their ftp server You can reference these supplements at ftp medical nema org medical Dicom Final innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual The Merge DICOM Toolkit Merge DICOM Toolkit provides a generalized implementation of DICOM in a NET Assembly that you can use with your application This NET version of Merge DICOM makes use of the run time library of the Merge DICOM C C Toolkit As such it benefits from the power of that library while providing a complete NET Assembly interface You use methods of the Assembly to open connections with other DICOM devices on a network and to build and exchange DICOM messages or DICOM files The NET Assembly is written in C and all examples are supplied in C although it can be utilized from other NET languages Figure 2 presents a pictorial representation of a DICOM Application Entity Merge DICOM Toolkit implements for you everything in Parts 5 6 7 8 and 10 of the DICOM Standard It also makes it much easier for your application to implement according to Parts 3 and 4 by supplying many tools for the management of DICOM messages and to Part 12 by supplying
188. dateTime Time MCtime Person Name MCpersonName UID MCinstanceUID Patient Name Component Group MCpnComponentGroup o String Encoding MCstringEncoder o Attribute Collections MCattributeSet MCcommandSet MCdataSet ooo 00000 innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual MCitem MCfileMetalnfo DICOM message handling callbacks o Data Sinks MCdataSink interface MCfileDataSink MCmemoryDataSink MCstreamDataSink o Data Sources MCdataSource interface MCfileDataSource MCmemoryDataSink MCmemoryDataSink implements the MCdataSink and MCdataSource interfaces MCstreamDataSource DICOM message validation o MCvalidationError o validate and validateAttribute methods of MCdataSet MCfile and MCdimseMessage classes DICOM Service class Information o MCsopClass o MCfailedSopInfo o MCrefSopinfo o MCrefStudyinfo DICOM Network Service classes MCdimseService o MCbasicWorklistManagementService MCpatientManagementService MCprintManagementService MCqueryRetrieveService MCqueueManagementService MCresultsManagementService MCstorageService MCstorageCommitmentService MCstudyContentNotificationService MCstudyManagementService o MCverificationService DICOM media services and objects e oocooooo0oo0oo0oo0 o Files MCabstractMessage e MCfile DICOMDIR MCdir DICOMDIR record MCdirRecord o DICOM files service MCmediaStorageService Exception h
189. dimseMessage dm innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 Constructing a message to use with the MCdimseService derived classes TransferSyntax Command ServiceName setServiceCommand ActionTypeld AffectedSopClassUid AffectedSopInstanceUid Attributeldentifiers MCfile file A non null referenc dm new MCdimseMessage file If you will be using one of the sub classes of the MCdimseService class to send network messages you will not be required to construct a MCdimseMessage object Typically those DICOM service class specific classes require that your provide a data set MCdataSet object only MCdimseMessage Properties The MCdimseMessage class contains several methods that can be used to retrieve properties of the DIMSE message Transfer Syntax Used The TransferSyntax property returns an MCtransferSyntax object that identifies the transfer syntax used to encode this message Contained attribute sets MCdimseMessage objects contain references to MCcommandSet and MCdataSet objects The CommandSet property returns the MCcommandSet reference and the DataSet property returns the MCdataSet reference The service and command used by the message The Command property returns the command currently assigned to this message and the ServiceName property returns the current DICOM service name The setServiceCommand method is used to assign a specifiC C DICOM service a
190. ding ina printed or displayed document innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 Relationship Types between Content Items Table 22 describes the Relationship Types between Source Content Items and the Target Content Items The choice of which may be constrained by the IOD in which this Module is contained The Merge DICOM Toolkit Definition column specifies the enumerated value used in the Toolkit to identify the Content Item Relationship Table 22 SR Relationship Types Relationship Type Merge DICOM Description Toolkit Definition CONTAINS CONTAINS Source Item contains Target Content Item e g CONTAINER History CONTAINS TEXT mother had breast cancer CONTAINS IMAGE 36 HAS OBS HAS_OBS_CONTEX Has Observation Context Target CONTEXT T Content Items shall convey any specialization of Observation Context needed for unambiguous documentation of the Source Content Item e g CONTAINER Report HAS OBS CONTEXT PNAME Recording Observer Smith John Dr HAS CONCEPT HAS _CONCEPT_MO Has Concept Modifier Used to qualify MOD D or describe the Concept Name of the Source Content item such as to create a post coordinated description of a concept or to further describe a concept e g CODE Chest X Ray HAS CONCEPT MOD CODE View PA and Lateral e g CODE Breast HAS CONCEPT MOD TEXT French Translation Sein e g CODE 2VCXRPALAT
191. ditional attributes are always specified along with a condition The value types defined by DICOM are listed in Table 4 Note that a null valued attribute has a value that value being null zero length Table 4 DICOM Value Types VT s Value Type Description VT The attribute must have a value and be included in the message The value cannot be null empty The attribute must have a value and be included in the message only under a specified condition The value cannot be null If that condition is not met the attribute shall not be included in the message The attribute must have a value and be included in the message If the value for the attribute is unknown and cannot be specified its value shall be null The attribute must have a value and be included in the message only under a specified condition If the value for the attribute is unknown and cannot be specified its value shall be null If that condition is not met the attribute shall not be included in the message The attribute is optional It may or may not be included in the message If included the attribute may or may not have a null value innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual Private Attributes MCfile The DICOM Standard allows application developers to add their own private MCfileMetalnfo attributes to a message as long as they are careful to follow certain rules A private attribute is identified diff
192. dress and port number to listen on This form also allows starting a dual mode listener that accepts both IPv4 and IPv6 connections if the operating system supports such listeners Note that a given Application Entity may only make this call one time for a given address port combination without first calling stopListening see below It is possible though to start listeners on the same address and port for different application objects in this case the toolkit will attach the existing listener to the second application Merge DICOM starts a separate thread for each listener In addition to the previous parametes you must specify an MCproposedContextList object that describes the services your Application Entity is willing to support class MyAssocHandler MCacceptor void start MCassociation assoc innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 STOP stopListening MCresultContext NumberOfAcceptable Contexts FirstAcceptableContext NextAcceptableContext MCassociation accept reject MCresultContext MyAssocHandler myHandler new MyAssocHandler MCapplication myAE MCapplication getApplication ACME_Query_SCP MCproposedContextList myContext MCproposedContextList getObject service_list_name int port the port that is being listened on To use the port number configured in mergecom pro or the default port 104 port MCassoc
193. e Hanging Protocol Query Retrieve Print Management Storage Query Retrieve Query Retrieve Query Retrieve Storage Query Retrieve Query Retrieve innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 Merge DICOM Toolkit Service Parameter IMPLANT_TEMPLATE_GROUP_MOVE IMPLANTATION_PLAN_SR_DOCUMENT INSTANCE_AVAIL_NOTIFICATION INTRAOCULAR_LENS_CALCULATIONS KERATOMETRY_MEASUREMENTS KEY_OBJECT_SELECTION_DOC LEGACY_CONVERTED_ENHANCED_CT_IMAGE LEGACY_CONVERTED_ENHANCED_MR_IMAGE LEGACY_CONVERTED_ENHANCED_PET_IMAGE LENSOMETRY_MEASUREMENTS MACULAR_GRID_THIICKNESS_VOLUME MAMMOGRAPHY_CAD_SR MEDIA_CREATION_MANAGEMENT MODALITY_WORKLIST_FIND MR_SPECTROSCOPY OPHT_VIS_FIELD_STATIC_PERIM MEAS OPHTHALMIC_AXIAL_MEASUREMENTS OPHTHALMIC_TOMOGRAPHY_IMAGE OPM_THICKNESS_MAP PATIENT_ROOT_QR_FIND PATIENT_ROOT_QR_GET PATIENT_ROOT_QR_MOVE PATIENT _STUDY_ONLY_QR_FIND PATIENT_STUDY_ONLY_QR_GET PATIENT_STUDY_ONLY_QR_MOVE PERFORMED_PROCEDURE_STEP DICOM Service Class Query Retrieve Storage Instance Availability Notification Storage Storage Storage Storage Storage Storage Storage Storage Storage Media Creation Management Modality Work list Storage Storage Storage Storage Storage Query Retrieve Query Retrieve Query Retrieve Query Retrieve Query Retrieve Query Retrieve Study Management innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual
194. e filled in by your application and become a message object instance that can be exchanged over the network The message info file along with the data dictionary file also make possible the powerful message validation capabilities of the DICOM innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual Toolkit The message info file is a binary file supplied with your toolkit with the default name of mrgcom3 msg You also specify the location and name of the message info file using the MSG_INFO_FILE parameter Capturing Network It is often useful to capture the raw data that is transmitted across the network to Data help determine exactly what each side of an association is sending Network sniffer programs are often used to capture this data but they are often not useful when the data is being transmitted over a secure network connection as the data is often encrypted Merge DICOM provides a network capture facility that will capture network data as it is sent or received The data that is captured to one or more files and is formatted such that it can be analyzed using the MergeDPM utility Refer to Appendix D for a discussion of the following configuration parameters that are used to configure the network capture facility They are encoded in the TRANSPORT_PARMS section of the System Profile mergecom pro NETWORK_CAPTURE CAPTURE_FILE CAPTURE_FILE_SIZE N R UM
195. e MCassociation class and servers will use the startListening method of that class Preparing a Proposed Context List MCproposedContextList Before you establish an association connection you must determine what DICOM MCproposedContext services you are prepared to handle and perhaps create an MCproposedConitextList object to encapsulate the service information Using a Pre configured Proposed Context List Use a pre configured If you wish to propose the services that are configured in a lt service_list_name gt service list section of the Application Profile mergecom app file you can use the MCproposedContextList getObject factory method to retrieve an MCproposedContextList object based on the configured services MCproposedContextList myContext MCproposedContextList getObject service_list_name Creating Your Own Proposed Context List or build your own You also have the option of creating your own proposed context list at run time oo An MCproposedContextList object represents a collection of MCproposedConitext objects Each MCproposedContext object represents e one DICOM service SOP class e a set of transfer syntaxes you can support for the service e a declaration of the roles you will play SCU and or SCP MCtransferSyntaxList Before you can create an MCproposedContext object you must create one or MCtransferSyntax more MCtransferSyntaxList objects representing the transfer syntaxes you want to use
196. e Network Onlly ccescceeeeeeeeeeeeeeeeeseeeeeseaeeeseaeseeeeeeaas 134 Reading Network MessageS ssssssesesrresssrneseennesrnnnentenneennnnnneenneennnnnnennne 134 Using the MCdimseService s ssssesesesessussrsrinenerensnnenurenenusencensrunenanenennennna 134 Using the sendRequestMessage Method eecceeeeeeeeeeeeeeeeeeseeeeeeeeeneeees 135 Using the sendResponseMessage Mmethod ceecceeeeeeeeeeeeeteeeeeeeeeees 135 Using Attribute Containers eee cece eene eens eens ener seer eeeeeseeeeneeetaeesaeesaeeaaee 136 Using an Attribute Container in a Server Application 0 cseeeeeeeees 137 Using an Attribute Container in a Client Application c ceeeeeeeees 137 Declaring an MCattributeContainer and MCattributeContainerEx Classes 137 Writing the provideDataLength Method cc ceeeseceeeenneeeceeneeeeeeaeeeeeeaas 138 Writing the provideData method eee cece cette reese eee aeeneeeeeeeeee 139 Writing the receiveDataLength method eee ee eee eee sees teen 140 Writing the receiveData method cece eee eet cere eee eee aeeteeee enna 140 innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual Writing the receiveMediaDataLength method ccccceeeeteeeeeteeteeeeees 141 Registering Your MCattributeContainer cccccccsceeeeeseeceeessteeeeessteeeeess 141 Releasing Your MCattributeContainer c ccceccceee
197. e MCmediaStorageService readFileBypassLargeData call because the OB OW OF data is left on the media Instead the library calls the receiveMediaDataLength method see below If the method cannot comply with the request it must throw an MCcallbackCannotComplyException If the exception is thrown Merge DICOM will make no further calls for this instance of the attribute public void receiveData MCattributeSet attribSet MCtag tag MCdata data bool isFirst if anyProblemOccurs throw new MCcallbackCannotComplyException if isFirst Perhaps open an output data sink Save the data if data IsLast perhaps close the data sink innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual Merge DICOM Toolkit Writing the receiveMediaDataLength method calls to provide the The receiveMediaDataLength method is called by the library when it is Sa S Aara length reading a file from media while it is processing an MCmediaStorageService and data offset readFileBypassLargeData call This method provides the total size of the attribute s value and the byte offset of the attribute s value from the beginning of the media file Note The library calls this method instead of calling the receiveData method when it is processing the MCmediaStorageService readFileBypassLargeData call If the method cannot comply with the request it must throw an MCcallbackCannotComplyException If the excepti
198. e before the read call times out and returns control to your application code The thread handling your association will be blocked during this waiting period and the system processor will be available for other threads Setting timeout to 0 is equivalent to polling since read returns immediately whether a message has been received or not A timeout of 1 indicates wait forever or until a message arrives before returning An MCtimeoutException will be thrown if the time expires before a message arrives Using the MCdimseService To send request messages you use the sendRequestMessage method of the MCdimseService class and to send response messages you use the sendResponseMessage method You should note however that you will probably be using a sub class of the MCdimseService class and those derived classes usually provide other methods to send messages This section describes the use of the MCdimseService class directly innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual You must relate each instance of the MCdimseService class with a specific association by passing an MCassociation reference as a parameter to the class constructor MCassociation myAssoc a non null referenc MCdimseService myService new MCdimseService myAssoc Using the sendRequestMessage method Requesting There are four forms of the MCdimseService sendRequestMessage method a DICOM service public void sendRequestMessa
199. e name of DICOMDIR and uses C_STORE_RQ for the command see Error Reference source not found The MCdirRecord class Directory record properties The MCdirRecord class represents a DICOMDIR record and is simply a MCdirRecord container for a number of public properties and methods e Parent A property that returns the MCdirRecord instance for the parent record of this directory record e RecordName This property gets a String name assigned to the requested DICOMDIR record e Directory This property returns the MCdir that this directory record is contained within e IsLast a Boolean that is true if the record is the last child record of the parent record This property is not updated when new child records are added or removed to from the parent record e RecordItem This property is the MCitem instance for the directory record e getChildCount This method returns a count of the number of child records e getFirstChild This method returns the MCdirRecord for the first child of this directory record e getNextChild This method can be called repeatedly to get subsequent child directory records innovative maging NET C User s Manual Merge DICOM Toolkit v 5 1 0 navigating through a DICOMDIR MCdirRecord MCdir Root e getReferencedRecordCount This method traverses all child directory records and returns a count of these records e addChildRecord String newIt
200. e used for the off line validation of the DICOM messages your application generates or receives The command syntax follows mc3valid lt filename gt w i s lt serv gt c lt cmd gt 1 m q t lt syntax gt lt filename gt Filename containing message to validate e Display error messages only w Display error and warning messages default I Display informational error and warning messages s lt serv gt Optional force the message to be validated against service name serv used along with c lt cmd gt Optional force the message to be validated against command name cmd used along with Yig ne Optional list and select possible service command pairs m Optional specify the input file as being a DICOM file object q Optional disable prompting for correct service command pairs Specify transfer syntax of message where syntax il implicit little endian el explicit little endian or eb explicit big endian This command validates the specified message file printing errors warnings and information generated to standard output The user can force the message to be validated against a specified DICOM service command pair if the message does not already contain this information If the service command pair is not contained in the message the program will list the possible service command pairs and the user can select one of them When using this p
201. eItem Code CodeMeaning innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 Reading the next children as a TEXT item if sr RootItem Children 1 is MCtextItem MCtextItem textItem sr RootItem Children 1 as MCtextItem Console Write textItem ContentItemType Console WriteLine textItem ConceptName CodeMeaning textItem Text Reading the next children as a IMAGE item if sr RootItem Children 2 is MCimageItem MCimageItem imageItem sr RootItem Children 2 as MCimagelItem Console Write imageItem ContentItemType Console WriteLine Sop Class imageItem SopReference ReferencedSopClassUid Ww Sop Instance imageItem SopReference ReferencedSopInstanceUid Working with Mergecom WADO Classes DICOM standard introduces the mechanisms and specifications for Web services to access and present DICOM objects through Http Https protocols Web Access of DICOM Persistent Objects WADO see PS3 18 DICOM PS3 18 2015a Web Services The Merge DICOM Toolkit provides a flexible framework to handle WADO requests and DICOM service responses for the Web clients This functionality gives to the user a simple way to parse a complex DICOM Http request into a set of Mergecom Toolkit DIMSE messages for DICOM service and then convert DICOM service response into Http response message Mergecom WADO framework supports WADO RS WADO URI WADO WS QIDO RS and STOW RS sta
202. ec RecordItem Access patient directory record tags here curRec rootRec getNextChild In the above example the directory records below the root record could be traversed by calling the getFirstChild and getNextChild routines Please refer to the MCdirRecord and MCdir classes in the Assembly Windows Help File for further details on traversing a DICOMDIR innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual Adding and deleting directory records dirAddRecord dirDeleteRecord Automatic deletion of referenced items Make sure you are committed Performance Tuning Really It s not a memory leak Adding and Deleting DICOMDIR Records The addition and deletion of directory records are handled using the addChildRecord deleteChild and delete methods These calls are prototyped as follows public MCdirRecord addChildRecord String newItemName public void deleteChildren public void delete When adding a directory record you must supply a string identifying the directory record item type newItemName For example if you wished to adda Study record newItemName would be a string containing DIR_STUDY The method returns an MCdirRecord object encapsulating the newly created directory record When deleting records using deleteChildren or delete no parameters are required When a directory record is deleted all lower level directory entities and the di
203. ed attribute where each value is an MCitem object This means using an MCitem reference with the MCattributeSet addValue setValue innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 or indexer Similarly the MCattributeSet indexer methods return MCitem objects when you request the value of a sequence attribute The following sample code fragment gives an example of encoding a Pre formatted Grayscale Image Item into a sequence MCitem myItem new MCitem PREFORMATTED_GRAYSCALE_IMAGE MCdataSet ds non null reference to th data set we are building myItem MCdicom PIXEL_ASPECT_RATIO 0 myItem MCdicom PIXEL_ASPECT_RATIO 1 i r g i encode other item attributes here now add the item to the sequence ds MCdicom PREFORMATTED_GRAYSCALE_IMAGE_SEQUENCE 0 myItem DICOM Files Maintaining a DICOM file set is a matter of maintaining various DICOM files and DICOM bject message Sa single DICOM directory file DICOMDIR MCfile MCdir DICOM media files are encapsulated in the MCfile class A sub class of the MCfileMetalnfo MCfile class the MCdir class encapsulates a special DICOM directory file called the DICOMDIR Just as DICOM network messages the MCdimseMessage class contain a command set MCcommandSet and a data set MCdataSet so the MCfile class contai
204. eeeeaaeseeeeesaeeesaaeeseneeeeaees 197 Asynchronous Nature cccccceeceeeeeeeeceeeeeceeeeeeeaeeeeaeeeeeeeesaeeeeaaeseeaeeseeneees 197 Implementation Identifying Information cccccceceeeeseseeeeeeeteeeeneeteeeeees 197 SOP Specific Conformance cccccceeeseeceeeeeceeeeeeaeeeeeeeseeeeeseaeeesaeeeeeeeeaas 198 Transfer Syntax Selection Policies ccccccceeeeeeeseeeeeeeeseteeeeeaeeeeneeteeeees 198 Physical Network Interface ec ceeeeeeeeeeeeeeeeeeeeeesaeeeeessaesnaeeeaeesaeeseees 199 IPv4 and IPV6 SUDpOrt c ce eeececeeeeeceeeeeeeeeeeeee eae eesaaeeeeaeeseeeeeaeeeeaeeseenees 199 AE Title Presentation Address Mapping ceeesseceeeesneeeseeneeeeeenaeeeeeeaas 199 Configurable Parameter ccccccccceeeseeceeeeeceeeeeeaeeeeeeeseeeeesaeeesaeeeeneeeaas 199 PD S120 tana lezal aeaii ienai aa iaae aaaea el a ea a 200 Standard Extended Specialized Private SOPS ccsscccsesseeeessteeeeeenes 200 Private Transfer Syntaxe cccecccecceeceeeeeeeeeeeeeeeeeeaeeeeeeeseeeesaeeeeeeseeeees 200 Appendix D Configuration Parameters cc ccccccceeseeeeeeeeseeeeeceeeeeeaeeeeeeeenaees 201 Initialization File iss ceecctacteseeste weacesds evi eae a Gia ian 201 Application Profiles cstiec ee He fetees nies linet aai ea 203 innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual SECTIONE ac ceicasdevvedesativasadeavecsaacs Wavdadevyededscivavadtarecd s
205. eeeeeneeseeeeeeeeeeeeeseeeeees 142 SEQUENCES Of EMS vs Hisiccicrasteechesieecactvides i EEA AE AANE REEE 142 DIG OMI FIGS sieceisvecsscy deca sue cuate lt a cesiee s atvnnes siesta dy Aaeseenedeial naaanadedaeds evened 144 Constructing a new MCfile Instance ccccecceeeeeeeceeeeeeeeeeeseaeeeeeeeeeeeeeees 145 Construct an MCfile object with a pre populated data Set ceee 145 Construct an MCfile object with an empty data Set cceceseeeereeeee 146 Convert an MCdimseMessage object to an MCfile object eee 146 Accessing the service and Command properties s s s 146 Working with the contained file meta information cccccsseceeessteeeeeees 147 Accessing the File Preamble ceeecsceeeeesneeeeeeneeeeeeaeeeseeaaeeeeeeaaeeeeneaas 147 Working with the Contained data Set eeesceeeeesneeeeeeneeeeeeenaeeeeeenaeeeeeeaas 147 Resetting the MCfile ODj Ct ecccecceeeeeeeeeeeeeeeeeeeeeaeeeeeeeseeeesaeeeeeeeeeeees 147 File validation siiicar naan aa aa iaaa aa eaaa aaaeaii 148 The MCGfile StrO AIM s cesinsdcrccanseacteasseccccaesoactanes dedevenseaceaabenscetasesactazeesedexssaeseds 148 Setting the file transfer syntax UID cceeeececeeeeeceeeeeeeeeeeeeeesaeeeeeaeeeeneeeaes 148 Setting the file system file associated with the MCfile object 148 Listing the file s attributes cccceceeeeeeeeeeeeceeeeeceaeeeeaeeseeeeesaeeesaeeneneeeeaees 149 Using the MCmed
206. efault values for all messages and for specific service command pairs This file can be innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 modified to contain defaults specific for the user although it is recommended that a backup of the original be kept If this file is modified there are no guarantees that the messages generated will validate properly Developing DICOM Applications The Merge DICOM The Merge DICOM Toolkit NET Assembly provides classes and interfaces that pita represent all of the major components of the DICOM standard ssembly Utility and Initialization methods MC DICOM constants o MCdicom DICOM Applications o Local applications MCapplication o Remote applications MCremoteApplication Merge DICOM Logging o MClog o MClogHandler o MClogInfo o MClogTime DICOM Associations MCassociation o Association acceptors MCacceptor o Association requesters MCrequester o Association negotiation MCnegotiationInfo McstorageNegotiation MCqueryRetrieveNegotiation MCproposedContext MCproposedContextList MCresultContext MCtransferSyntax o MCtransferSyntaxList DICOM Messages and Message Elements o DIMSE messages MCabstractMessage MCdimseMessage Data Elements MCdataElement Data element identifiers MCtag DICOM Value Representation MCvr Attributes MCattribute Attribute representations Age String MCage Date MCdate DateTime MC
207. efer to the Assembly Windows Help File The service name must be one of the services defined in the Services Profile normally mergecom srv file if not a warning message will be logged innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual An MCillegalArumentException will be thrown if the command value is invalid An MCconfigurationError runtime error will be thrown if the library cannot access the configuration files Acommon programming technique is to construct an empty MCdataSet object s that initially contains no attributes MCdataSet ds new MCdataSet empty data set Eeriatana TONNY In this case the message info and data dictionary files are not accessed when the MCdataSet object is constructed The MCdataSet object contains no attributes and the setServiceCommand method must be called to set the service and command for this data set before it can be used in a message sent over the network Since this approach avoids accessing the message info files it is more efficient However this approach also penalizes you in terms of runtime error checking Retrieving Contained Attribute Sets DataSet When your application needs to build or parse the attributes contained in CommandSet MCdimseMessage objects it accesses the contained MCcommandSet or Metalnfo MCdataSet objects using the MCattributeSet methods inherited by those classes Similarly When your application needs to build or parse the
208. egotiated When this parameter is not set the default non compressed transfers syntaxes implicit VR little endian explicit VR little endian and explicit VR big endian are negotiated The MR_Syntax_List US_Syntax_List and CT_Syntax_List sections each define a separate transfer syntax list for the MR US and CT services respectively Merge DICOM Toolkit currently supports all transfer syntaxes specified in the DICOM standard The names used for these transfer syntaxes are defined in Table 33 in Appendix D Configuration Parameters MCtransferSyntax As mentioned earlier Merge DICOM supports the dynamic creation of service MCtransferSyntaxList lists at runtime The Assembly also provides the MCtransferSyntaxList getObject factory method to construct an MCtransferSyntaxList object from information in the configuration files This will be discussed in more detail in the DEVELOPING DICOM APPLICATIONS section below Transfer syntax priority For server SCP applications the order in which transfer syntaxes are specified during association in a transfer syntax list dictates the priority Merge DICOM places on them during negotanon association negotiation For example in the US_Syntax_List specified above if a client SCU proposed the Ultrasound storage service with the RLE compressed transfer syntax and the implicit VR little endian transfer syntax Merge DICOM would select the RLE transfer syntax because it was listed first in the tran
209. elationship is defined in a form as R RTYPE it means that Relationship Mode is By reference and Relationship Type is RTYPE For example R INFERRED FROM Merge DICOM Toolkit provides following functions to encode decode references public void AddReference MCitemRelationship reference public void RemoveReference MCcontentItem targetItem public void RemoveReference MCitemRelationship reference public ReadOnlyCollection lt MCitemRelationship gt References Value Type VT The Value Type field specifies the SR Value Type of the Content Item or conveys the word INCLUDE to indicate that another Template is to be included substituted for the row The Merge DICOM Toolkit provides specific classes for each Content Item Type as it described above Concept Name Any constraints on Concept Name are specified in this field as defined or enumerated coded entries or as baseline or defined context groups Alternatively when the VT field is INCLUDE the Concept Name field specifies the template to be included The Merge DICOM Toolkit uses the MCbasicCodedEntry class to specify the Concept Name You will find that some of the Content Item types require Concep Name in the constructor and some are not because it is optional for those Content Item Types In that case the Concept Name can be set by using the public property Templates define References to coded concepts take the following form EV or DT
210. emName This method adds a child record e delete This method deletes the current directory record within the DICOMDIR e deleteChildren This method deletes all the child directory records below this record The following sections describe these methods and properties in further detail Navigating the DICOMDIR The MCdirRecord class provides routines for traversing the DICOMDIR The MCdir class has a property Root which returns an MCdirRecord instance which is a placeholder for the parent of the root directory records within the DICOMDIR This directory record in turn can be used to navigate through the root records of the DICOMDIR and the remainder of the DICOMDIR The first step in navigating a DICOMDIR usually involves getting the Root property root of the DICOMDIR From there the getFirstChild and getNextChild are used to traverse lower level records referenced by a particular record When working with a specific directory record the RecordItem property can be used to get the MCitem associated with a specific directory record This MCitem instance can be used to access the attributes within the directory record The following code sample shows the use of these routines MCdir dir Non null referenc MCdirRecord rootRec dir Root MCdirRecord curRec curRec rootRec getFirstChild while curRec null if curRec RecordName Equals DIR_REC_PATIENT MCitem item curR
211. encapsulated transfer syntaxes The method for compression and decompression JPEG RLE etc of encapsulated pixel data is specified in part 5 of the DICOM standard Merge DICOM also supports compression and decompression for several specific transfer syntaxes The methods for this are discussed in subsequent section Besides this support the MCattribute class also has several methods for dealing with encapsulated transfer syntaxes There are several classes that can be used for compressing or decompressing data See Compression and decompression section for further details Encapsulated pixel data is dealt with in a similar manner as standard pixel data MCdataSink and MCdataSource classes are used Merge DICOM NET has the capability of encapsulating each frame of data according to the encoding innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual Abstract Message Routines MCabstractMessage specified in Part 5 of the DICOM standard Table 13 contains a sample encoding of frames Table 13 Sample Encapsulated Pixel Data Pixel Data Element Basic Offset First Fragment Single Second Fragment Single Sequence Table with NO Frame of Pixel Data Frame of Pixel Data Delimiter Item Item Value Item Item Item Item Value Item Item Item Value Sequenc Item Length Tag Length Tag Length e Delim Length Tag FFFE 0000 FFFE 0000 Compresse FFFE 0000 Compresse FFFE 0000 E000
212. ent the elements in the order they were presented when this object was created The Size property contains the number of elements in the MCproposedContextList object The toArray method returns a reference to an array of MCproposedContext items that represent the proposed contexts used in the proposed context list innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 getNegotiationInfo PresentationContextID ResultCode RoleNegotiated ServiceName TransferSyntax Name Uid BigEndian LittleEndian Encapsulated ExplicitVR MCresultContext properties The MCresultContext class contains the properties of a service that has been accepted by both sides of a DICOM association Instances of this class are returned by the FirstAcceptableContext and NextAcceptableContext properties of the MCassociation class The NextAcceptableContext property is repeatedly accessed until it returns null siginaling the end of the result context list The getNegotiationInfo method retrieves any extended negotiation information that may have been received for the service If none was received the method returns false If extended negotiation information was received for this service the method returns true and calls the decode method of MCnegotiationInfo instance provided to provide the negotiation information The PresentationContextID property retrieves the DICOM Presentation Context ID assigned to this context s service
213. ents Standard Standard data elements are built using the following constructor Data Elements MCdataElement de try innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual MCtag tag new MCtag 0x0008 0x0010 de new MCdataElement tag catch MCnotStandardElementException e An MCnotStandardElementException will be thrown if the data element is not defined in the data dictionary Non standard Constructing non standard data elements Data Elements Since non standard data elements are by definition not in the data dictionary you must supply the properties of data elements that are not recorded in the data dictionary These properties must be defined e The name of the data element If name is not provided the attribute will be named lt UNKNOWN gt by the library If provided name must not be null and must have a length between 0 and 30 If longer than 30 it will be truncated If O i e the name will be reported as blank in reports e The vr parameter specifies the Value Representation of the data element It must be one of the MCvr instances that are static members of the MCvr class An exception will be thrown if an invalid MCvr reference is provided These pre defined MCvr object references are available to use vrAE vrAS vrCS vrDA vrDS vrDT vrlS vrLO vrLT vrPN vrSH vrST vrTM vrUT vrUl vrSS vrUS vrAT vrSL vrUL vrFL vrFD vrUN vrO
214. equested These service names are the strings used in Merge DICOM Toolkit to identify standard DICOM services Any services listed must be defined in the Service Profile discussed below Dynamic Service Lists You may also dynamically create service lists at run time using the methods of MCproposedContextList the MCproposedContext and MCproposedContextList classes as well as the constructors for the MCproposedContextList class This will be discussed in more detail in the DEVELOPING DICOM APPLICATIONS section below innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 Acme_Store_SCP Your Application Acme_QR_SCP Figure 10 An example configuration of DICOM applications Don t forget A service list also needs to be defined for each of your own server AE s Even though you do not need a section for your server AE Title since it is running on your local machine you do need to specify a service list that your application supports as an SCP If your application also acts as a storage server for example it could use Storage_Service_List You also need to specify a listen port for your server AE in the System Profile which is discussed below Transfer Syntax List For DICOM Toolkit users Merge DICOM allows for the defining of the transfer syntaxes supported for each service in a service list This functionality is implemented through the use of transfer syntax lists The basic service lists discus
215. er ApplicationContextName An application context is an explicitly defined set of application service elements related options and any other information necessary for the interworking of application entities over the association Currently there is only one DICOM Application Context Name that is defined for the DICOM standard 1 2 840 10008 3 1 1 1 Refer to Annex A in Part 7 of the DICOM standard for more information TCP IP Listen Port ListenPort The ListenPort property retrieves the port number that the association is using to listen for TCP IP connection requests MCapplication object of the local AE LocalApplication The LocalApplication property retrieves the MCapplication object identifying the DICOM application responsible for this MCassociation object Application Entity Title LocalApplicationTitle Each DICOM application is assigned a application entity ID known also as the RemoteApplicationTitle application title The LocalApplicationTitle property retrieves the application title of the local application and the RemoteApplicationTitle property retrieves the application title of the remote application Implementation Class UID and Implementation Version iepenens The identification of an implementation of the DICOM standard relies on two LocallmplementationVersion pieces of information the Implementation Class UID required and the RemotelmplementationClassUid Implementation Version Name optional The DICOM st
216. er gt Submit lt summary gt Http Post method lt summary gt lt param name request gt lt see cref MCrequest gt oject lt param gt lt returns gt lt see cref HttpResponseMessage gt object lt returns gt ActionName bind public HttpResponseMessage Post ModelBinder typeof MCrequestBinder MCrequest request return request Submit MCstowController URI route templates HttpConfiguration config new HttpConfiguration config Routes MapHttpRoute innovative Imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 name MCstowRoute routeTemplate api controller defaults new controller MCcontroller MCSTOWCONTROLLER action post 3 config Routes MapHttpRoute name MCstowStudy routeTemplate api controller studies defaults new controller MCcontroller MCSTOWCONTROLLER action post 3 config Routes MapHttpRoute name MCstowStudyInstance routeTemplate api controller studies studyInstanceUid defaults new controller MCcontroller MCSTOWCONTROLLER action studyinstanceuid 3 config Routes MapHttpRoute name MCstowBind routeTemplate api controller bind stow defaults new controller MCcontroller MCSTOWCONTROLLER action bind 3 config Services Add typeof ModelBinderProvider new MCrequestBinderProvider innovative imaging Merge DICOM Toolkit V
217. erently than are standard attributes Its tag is composed of an odd group number a private identification code string and a single byte element number For example ACME Imaging Inc might define a private attribute to hold the name of the field engineer that last serviced their equipment They could assign this attribute to private attribute tag 1455 ACME_IMG_INC 00 This attribute has group number 1455 a private identification code string of ACME_IMG_INC and a single byte element number of 00 ACME could assign up 255 other private attributes to private group 1455 by using the other element numbers 01 FF Part 5 of DICOM explains how these private tags are translated to standard group and element numbers and encoded into a message while avoiding collisions Merge DICOM Toolkit handles these details for you DICOM makes a couple of rules that must be followed when using private attributes e Private attributes shall not be used in place of required Value Type 1 1C 2 or 2C attributes e The possible value representations VR s used for private attributes shall be only those specified by the standard see Table 3 The way you use private attributes in your application can also greatly affect your conformance statement DICOM conformance is discussed in greater detail later Media Interchange MCmediaStorageService The DICOM Standard specifies a DICOM file format for the interchange of medical information on
218. es 75 Accepting or Rejecting the ASSOCIATION eee ceeeneeeeeeneeeeeeaeeeeeeaeeeeeeaas 76 Negotiated Transfer Syntaxe cc cccceeeeseeceeeeeceeeeeeeaeeeeeeeseeeesaeeeeaeeseeeeess 78 Merge DICOM Message Classes cccsceceeceeseeeeeeeeeeeeeeeeeeeeeseaeeteaeeeeeeeess 80 Association Message Handling ccccecececeeeeeeeeeeeeeeeeeeaeeeseeaaeeeeeeaeeeeseaas 81 Releasing or Aborting the Association cececeeeeeeeeteeteeeeeeeaeeetaeeeeneeeaes 82 Association Properties cee eeeceeeeeeeceeeeeeeeeeeeeeeeeeeeseeeseeneeaeeeeneeeeeeeneeeeeeenaees 83 Application Context Name ccccccceeseceeeeeeeeeeeeeaeeeeaaeseneeeseaeeesaaeeeeaeeseeneeeaas 83 TCP IP Listen POM sci ieicestceetncdeatiades doit wacrce estes dein aa Gagne 83 MCapplication object of the local AE cceccceseeceeeeeeeeeeeeeeeeeseaeeteeeeeeeeee 83 Application Entity Tithe ea 83 Implementation Class UID and Implementation Version cseeeee 83 Maximum PDU SIZES isc ciieseciedduasccntdine caceuacececsudsecaeradsd ccccaueacdrtiasccesamiecaecaae 84 The Proposed Context List 0 ccccceceeeceeeeeeeeeeeeeaeeeeeeeseeeeeseaeeesaeeeeaeeseeeeeseas 84 The Read Timeout Valt ceric aA 84 The Remote Host s Name and Address c ccceeeeeeeeeeeeeeeeeeeaeeeeeenaeeeeeeaas 84 PASSOCIAUION PRONG io ssre ss oo athens cates cae a Ata va op scdues eaedeevavegdaueesaedavh eeastumeeketees 84 Association Stali nea en aaa a aeaaee a aaa 85
219. es into XML string by using the writeTOoXMLNative method of the MCattributeSet The writeTOXMLNative method creates a Native DICOM Model PS3 19 XML string describing the contents of the MCattributeSet The XML buffer is written to the stream identified by the stream object provided The following example shows how the writeToXMLNative method is utilized at a high level MCdataSet ds a non null referenc MCxmlOptions xmlOptions MCxmlOptions XmlOptIncludeBulks XmlOptExcludeSequences StreamWriter writer new StreamWriter myXMLFile convert DICOM DataSet to an XML file ds writeToXMLNative writer xmlOptions writer Close The following configuration flags are defined in the MCxmlOptions enumeration and are available for the Attribute Set to XML conversion Use the default settings XmlOptDefault 0x0 Store bulk attributes VR is OB or OW in the XML XmlOptIncludeBulks 0x1 Store Pixel Data buffer in the XML XmlOpt IncludePixelData 0x2 Do not store Sequence attributes in the XML XmLOptExcludeSequences 0x4 Do not store Private attributes in the XML XmlOptExcludePrivateAttributes 0x8 The Native DICOM Model provisions that bulk data can be replaced by a URI string instead of the actual data To allow the substitution at run time a new interface MCbulkDataUriHandler is introduced innovative maging Merge DICOM Toolkit V 5 1 0 NET C User s Manual
220. es that the Application Entity title sent in an association request match one of the registered application titles for the SCP When there is no match the association will be automatically rejected Setting this option to YES will eliminate some association negotiation problems in the field for SCP applications ACCEPT_ANY_HOSTNAME When set to NO Merge DICOM will attempt to resolve the IP address of the SCU application into a hostname If this resolution cannot be done the association will automatically be rejected Setting this option to YES will reduce configuration problems in the field for SCP applications EXPORT_UN_VR_TO_MEDIA Setting this option to NO will cause UN VR attributes to not be exported when writing DICOM Part 10 format files with the writeFile or writeFileByCallback methods of the MCmediaStorageService class See the following sections for a further discussion of UN VR EXPORT_UN_VR_TO_NETWORK Setting this option to NO will cause UN VR attributes to not be exported over the network when sending messages using the MCdimseService class See the following sections for a further discussion of UN VR innovative imaging NET C User s Manual Merge DICOM Toolkit v 5 1 0 What to do when all network partners are not aware of the UN VR Configuration Option Description IMPLEMENTATION_CLASS_UID The Implementation Class UID is used to identify in a unique manner a specific class of implementatio
221. essage stream using the explicit VR little endian transfer syntax The message stream will be encoded using the explicit VR little endian transfer syntax streamHandler is an instance of MyStreamHandler a class that implements the MCdataSink interface The MCdataSink interface requires a receiveData method that receives and manages the stream data a block at atime See the API description in the Assembly Windows Help File for further details innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 Retrieving message data from a message stream MCstreamInCallback MCdata provideData method Performance Tuning Why use message streams Once your application has done the above and stored the stream somewhere you could later rebuild a message object containing only group 0008 using class MyStreamHandler MCdataSource public MCdata provideData bool isFirst Object origin Retrieve a portion or all of the stream and return it as an MCdata object if errorOccured throw new MCcallbackCannotComplyException MCdimseMessage msg non null referenc MyStreamHandler streamHandler new MyStreamHandler try msg streamIn 0x00080000 OxO0008FFFF MCtransferSyntax ExplicitLittleEndian streamHandler catch MCexception e streamHandler is an instance of MyStreamHandler a class that implements the MCdataSource interface The MCdataSource interface re
222. et_Association_Info function in the Merge DICOM Reference Manual to learn about the presentation contexts that are queryable by an application program Refer to Table 27 for an example Table 27 Example Presentation Context Presentation Context Table Abstract Syntax Transfer Syntax Role Extended Name List UID List Negotiation Computed 1 2 840 10008 DICOM 1 2 840 1000 SCP None Radiography 5 1 4 1 1 1 Implicit VR Image Little Endian Storage DICOM 1 2 840 1000 Explicit VR 8 1 2 1 Little Endian DICOM 1 2 840 1000 Explicit VR Big 8 1 2 2 Endian Merge DICOM Toolkit uses mergecom app configuration settings to specify presentation contexts shown above SOP Specific Conformance This section includes the SOP specific behavior i e error codes error and exception handling and time outs etc The information is described in the SOP specific Conformance Statement section of PS 3 4 or relevant private SOP definition Transfer Syntax Selection Policies Merge DICOM Toolkit uses the following policy when selecting a transfer syntax e An SCU offers any transfer syntaxes which are defined in it s mergecom pro file innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual e The SCP prefers it s native byte ordering and will prefer explicit over implicit VR Network Interfaces Physical Network Interface Merge DICOM Toolkit runs over the TCP IP protocol s
223. ew MCrequestParameter Name keyword Attributes new List lt MCrequestAttribute gt attr return new MCrequest request MCrequestType Qido parms ToArray lt MCrequestParameter gt Submit lt summary gt Http Get method lt summary gt lt param name request gt lt see cref HttpRequestMessage gt object lt param gt lt param name studyInstanceUid gt StudyInstanceUID parameter lt param gt lt param name seriesInstanceUid gt SeriesInstanceUID parameter lt param gt lt returns gt lt see cref HttpResponseMessage gt object lt returns gt ActionName seriesinstanceuid public HttpResponseMessage Get HttpRequestMessage request String studyInstanceUid String seriesInstanceUid List lt MCrequestParameter gt parms new List lt MCrequestParameter gt string keyword MCwado DicomKeywords MCdicom STUDY_INSTANCE_UID MCrequestAttribute attr new MCrequestAttribute Item keyword Tag MCdicom STUDY_INSTANCE_UID Keyword keyword Values new string studyInstanceUid parms Add new MCrequestParameter Name keyword Attributes new List lt MCrequestAttribute gt attr keyword MCwado DicomKeywords MCdicom SERIES_INSTANCE_UID attr new MCrequestAttribute Item keyword Tag MCdicom SERIES_INSTANCE_UID Keyword keyword Values new string seriesInstanceUid parms Add new MCrequestParameter Name keyword Attributes new List lt MC
224. f an abstract syntax DICOM service and a set of transfer syntaxes that the client SCU understands The server SCP will typically accept a presentation context if it supports the abstract syntax and one of the proposed transfer syntaxes As previously discussed the abstract and transfer syntaxes supported by a server SCP are defined through a service list contained in the Merge DICOM Application Profile When support within a server SCP is limited to the three non encapsulated DICOM transfer syntaxes the toolkit will transparently handle the use of multiple presentation contexts for a DICOM service However when encapsulated DICOM transfer syntaxes are used the server SCP must be able to determine the transfer syntax of messages it receives so that it can properly parse the pixel data contained in them When a single presentation context is negotiated for a DICOM service the FirstAcceptableContext and NextAcceptableContext MCassociation properties can be used to determine the transfer syntax for a service When more than one presentation context is negotiated for a service the TransferSyntax property of the MCdimseMessage class must be used to set or get this transfer syntax The following is a typical call to this method MCdimseMessage dm A DICOM message just received MCtransferSyntax ts dm TransferSyntax Exchange of messages over the network is discussed further below The presentation contexts supported for client SC
225. for the services The MCtransferSyntaxList class represents a collection of MCtransferSyntax objects Using a Pre configured Transfer Syntax List MCtransferSyntaxList Again you have the option of creating an MCtransferSyntaxList object based on getObject configuration information or you can create a new transfer syntax list at run time To create an MCtransferSyntaxList object from transfer syntaxes configured in a lt syntax_list_name gt section of the Application Profile mergecom app file use the getObject factory method of the MCtransferSyntaxList class MCtransferSyntaxList mySyntaxes MCtransferSyntaxList getObject syntax_list_name name innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 MCsopClass AbstractSyntax SCProle SCUrole ServiceName TransferSyntaxList Creating Your Own Transfer Syntax List To create your own transfer syntax list you must create an array containing the predefined instances of the MCtransferSyntax objects you want to support and call the constructor for the MCtransferSyntaxList class The MCtransferSyntax class contains a number of static properties which return MCtransferSyntax instances for each of the defined DICOM transfer syntaxes MCtransferSyntax mySynArray new MCtransferSyntax 2 mySynArray 0 mySynArray 1 MCtransferSyntax ExplicitBigEndian MCtransferSyntax JpegBaseline MCtransferSyntaxList myTSL new MCtransferSy
226. from ST to the newly introduced UR For backward compatibility this parameter specifies that when reading messages or file objects the attribute is expected to have the old ST value representation DEFAULT NO When using the MC_Register_Callback_Function call to store large data such as pixel data this option specifies the minimum size of value for which the callback function should be used This option was specifically added so pixel data contained in icons are not managed with a callback function DEFAULT 1 innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 COMPRESSION_ALLOW_FRAGS COMPRESSION_CHROM_FACTOR COMPRESSION_J2K_LOSSY_QUALITY COMPRESSION_J2K_LOSSY_RATIO COMPRESSION_J2K_LOSSY_USE_QUALITY COMPRESSION_LUM_FACTOR Description Configuration Parameter for MC_Standard_Compressor The Pegasus libraries allow compressed image data to be returned as it continues to compress more image data This may result in an image frame having one or more fragments This is perfectly legal however some viewers may not be able to display the image if they do not support multiple fragments per frame DEFAULT YES Configuration Parameter for Mc_Standard_Compressor Values 0 through 255 The chrominance compression factor is used to adjust the default chrominance quantization table values When ChromFactor is 32 the default chrominance quantization table values are used as is A value
227. ful DICOM Association innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 MCdimseMessage MCcommandSet MCdataSet MCitem MCfile MCdir MCsopClass MCattributeSet MCattribute MCdataElement MCtag MCdicom MCtag GroupNumber MCtag ElementNumber Value Representation MCvr Messages Once an association is established services are performed by AE s through the exchange of DICOM Messages A message is the combination of a DICOM command request or response and its associated object instance see Figure 6 Messages containing command requests will be referred to as request messages while messages containing command responses will be referred to as response messages When a DICOM service is stored to interchangeable media in a DICOM File the structure of a DICOM File is a slightly specialized class of DICOM message Media interchange is discussed in detail later the only important thing to realize for now is that much of what is discussed relating to DICOM Messages also applies to DICOM Files DICOM specifies the required message structure for each service command pair For example the Patient Root Find C FIND RQ service command pair has a specific message structure The command portion of a message is specified in Part 7 of the standard while the object instance portion is specified in Parts 3 and 4 The DICOM data dictionary defines many data elements An attribute is a data element with
228. g Callbacks MCattributeContainer Performance Tuning Message info Files once then only the first five will be accepted by TCP and passed to Merge DICOM Toolkit the others would be refused at the TCP level TRANSPORT_PARMS TCPIP_LISTEN_PORT 104 Max number of open listen channels MAX_PENDING_CONNECTIONS 5 An important section of the System Profile is the MESSAGE_PARMS section MESSAGE_PARMS AARGE_DATA_STORE FILE MEM Default FILE ARGE_DATA SIZE 200 OBOW_BUFFER_SIZE 4096 DICTIONARY_FILE users mc3adv mrgcom3 dct TEMP_FILE DIRECTORY users mc3adv tmp_files SG_INFO_FILE users mc3adv mrgcom3 msg The LARGE_DATA_STORE parameter informs the toolkit where it should store large data either in memory or in temporary files on disk Large data is defined as a value for an attribute larger than LARGE_DATA_SIZE bytes Pixel data associated with a medical image would most certainly be considered large data If you are running your process on a resource rich system that supplies plenty of physical and virtual memory you should select LARGE_DATA_STORE MEM to improve your performance If your process is not so fortunate or you are dealing with messages with very large data values you will want to use LARGE_DATA_STORE FILE In this case the DICOM Toolkit will manage the large data in temporary files located in the
229. g these services so that they can be supported by the toolkit innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual Using the Merge DICOM Toolkit You can use the Merge DICOM Toolkit out of the box by using its supplied utility programs and sample applications In this section we discuss how to configure the toolkit and to use the utility programs Later we discuss how to develop your own DICOM applications using the Merge DICOM NET Assembly Configuration Merge DICOM is highly configurable and understanding its configuration files is critical to using the library effectively Four configuration files are used by Merge DICOM an initialization file an application profile a system profile and a service profile The pound sign begins comment lines Section H eader ee HEADER PARAMETER_1 Section Parameters _ PARAMETER_2 PARAMETER_3 12345 This is some text 1 243 456 7868 HEADER2 PARAMETER_1 PARAMETER_2 4382 More text Figure 9 Format of a configuration file Each of the four toolkit initialization files follow the same format The format of the initialization files is the same format that is used by others in the industry Configuration files are broken down into sections for easier organization and grouping of parameters Each section has a section heading enclosed in square brackets Next parameters are defined by putting the par
230. ge MCdimseMessage msq public void sendRequestMessage MCdimseMessage msg String affectedSopInstanceUID public void sendRequestMessage String metaServiceName MCdimseMessage msg public void sendRequestMessage String metaServiceName MCdimseMessage msg String affectedSopInstanceUID At minimum the sendRequestMessage Call must provide a reference to an MCdimseMessage object that encapsulates the message to be sent the msg parameter Some DICOM SOP Classes require that you assign an Affected SOP Instance UID to the composite message object being sent in those cases you must use the affectedSopInstanceUID parameter providing the UID The metaServiceName parameter is also optional If it is null or it if is an empty string it will be ignored Some DICOM services e g the Basic Print Service allow you to support multiple meta services Each meta service consists of a set of basiC C DICOM services In some cases a DICOM application may support multiple meta services over the same association When two of the meta services include the same basic service this metaServiceName parameter is used to tell Merge DICOM which meta service to use when sending the message Using the sendResponseMessage method Responding toa There are two forms of the MCdimseService sendResponseMessage method DICOM service request public void sendResponseMessage MCdimseMessage requestMsg short statusCode public void sendResponseMessage
231. ge The XML buffer will be written to the stream identified by the stream object provided The following example shows how the writeTOXMLNative method is utilized at a high level MCfile myFile a non null file reference MCxmlOptions xmlOptions MCxmlOptions XmlOptIncludeBulks XmlOptExcludeSequences StreamWriter writer new StreamWriter myFile convert DICOM file to an XML file myFile writeToXMLNative writer xmlOptions writer Close The following configuration flags are defined in the MCxmlOptions enumeration and are available for the MCabstractMessage to XML conversion Use the default settings XmlOptDefault 0x0 Store bulk attributes VR is OB or OW in the XML XmlOptIncludeBulks 0x1 Store Pixel Data buffer in the XML XmlOpt IncludePixelData 0x2 Do not store Sequence attributes in the XML XmLOptExcludeSequences 0x4 Do not store Private attributes in the XML XmlOptExcludePrivateAttributes 0x8 The Native DICOM Model provisions that bulk data can be replaced by a URI string instead of the actual data To allow the substitution at run time a new interface MCbulkDataUriHandler is introduced public interface MCbulkUriHandler object provideData MCattributeSet attrSet unit tag MCvr vr string uri innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual Converting an XML string into a message readFromXMLNative method
232. ge clear method in MCattributeSet and removeFileValues method in MCfile This option will disable functionality within the toolkit that causes the toolkit to search all currently open message objects for references to an item that is being freed by one of these calls This call is especially useful when your application uses very large DICOMDIR files PDU_MAXIMUM_LENGTH This option sets the maximum sized PDU that the toolkit will receive If during association negotiation the maximum sized PDU of the system negotiating with the toolkit application is larger than this value the PDU size will be limited to this value Increasing this value increases the amount of data that is passed to the TCP IP level This may increase network performance of the library WORK_BUFFER_SIZE This option specifies how the toolkit buffers data before storing it or passing it to a user s callback class Setting higher values for this option will increase performance TCPIP_RECEIVE_BUFFER_SIZE This option sets the TCP IP receive buffer size Higher values for this buffer generally will increase the network performance of the toolkit for server SCP applications This value should also be slightly larger than the PDU_MAXIMUM_LENGTH to increase performance Setting this value to an even multiple of the MSS 1460 bytes will help increase performance on most platforms TCPIP_SEND_BUFFER_SIZE This option sets the TCP IP send buffer size Higher values fo
233. ges They are not intended to represent real world medical data The messages generated can be validated or listed with the mc3list and mc3valid utilities The command syntax for mc file is the following mc3file lt serv gt lt cmd gt lt num gt g lt file gt c lt file gt 1 m q t lt syntax gt f lt file gt These two options are always used together They specify the service name and command for the message to be generated Thes names can be either upper or lower case If the exact names for a service command pair are not known the 1l option can be used instead to specify the service nam and command If the service name and command are improperly specified mc3file will act as if the l option was used and ask the user to input the correct servic name and command lt num gt This option specifies the number of messag files to be generated by mc3file If the g option is used this option is not needed on the command line If the c option is used mc3file assumes the number is 1 although a higher number can be specified on the command line mc3file will vary any fields that have a value representation of time when multiple files are generated although when the c option is used the utility will use the time fields as specified in the configuration file Thus multiple message files generated with the c option are identical g lt filename gt This option causes mc3file to generate an ASCII conf
234. gt portion of the UID uniquely identifies an organization while the lt suffix gt portion is used to uniquely identify a specific object within the scope of the organization While the lt root gt component of the UID stays constant the lt suffix gt portion will change in a manner that will provide uniqueness for objects that need UIDs Note This implies that the organization is responsible for maintaining the uniqueness of the lt suffix gt For example using the UID above lt root gt 1 2 840 10008 and lt suffix gt 2 45 1 12345 Where the organization ID portion of the lt root gt 10008 distinguishes organizations from each other Note The above example is typical for UIDs obtained by ANSI during the time when the DICOM standard was first released The organization ID of 10008 has actually been assigned to NEMA and is used as part of the lt root gt for DICOM standard UIDs such as SOP Classes Transfer Syntaxes etc For example vendors creating images need to obtain their own organization ID and cannot use 10008 For future UIDs ISO has developed a joint relationship with CCITT and has changed the lt root gt structure Therefore new UIDs from ANSI will no longer be of the form 1 2 840 xxxxx but are currently assigned using the form lt root gt 2 16 840 1 10008 Where of course 10008 is the organization ID innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 Obtaining a U
235. guration options PRIVATE_SYNTAX_2 Private transfer syntax 2 with the characteristics specified by the PRIVATE_SYNTAX_2_LITTLE_ENDIAN PRIVATE_SYNTAX_2_EXPLICIT_VR and PRIVATE_SYNTAX_2_ ENCAPSULATED configuration options System Profile The System Profile is used to define system wide parameters These parameters apply across all associations with other DICOM application entities The location of this file is provided by the MERGECOM_3_PROFILE parameter of the MergeCOM3 section of the MERGE INT file The following are a few notes to keep in mind concerning the System Profile e You must specify your own unique DICOM Implementation Class UID and place it in this file along with an optional Implementation Version These need to be documented in your DICOM conformance statement e There are several exception options specified at both the association and DIMSE levels of DICOM communication You should not have to modify these options in normal circumstances and doing so could make your application non DICOM conformant e The DICOM Upper Layer section network time outs can be modified This is useful on slower or less predictable networks e g WAN s e The section of the System Profile dealing with transport parameters is important This is where you specify the TCP IP listen port for a DICOM server SCP application along with the number of simultaneous associations your server will support over this port Table 33 thro
236. h public void receiveData MCattributeSet attribSet MCtag tag MCdata data bool isFirst innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 public void receiveMediaDataLength MCattributeSet attribSet MCtag tag uint dataLength uint dataOffset How to declarean The MCattributeContainerEx interface extends MCattributeContainer interface MCattributeContainer adding a new provideData method which allows to provide data from a seekable class data stream with a specified offset A sample class declaration follows public class MyContainer MCattributeContainerEx public uint provideDataLength MCattributeSet attribSet Ctag tag public MCdata provideData MCattributeSet attribSet Ctag tag bool isFirst public MCdata provideData MCattributeSet attribSet Ctag tag uint offset bool isFirst public void receiveDataLength MCattributeSet attribSet Ctag tag uint dataLength public void receiveData MCattributeSet attribSet MCtag tag MCdata data bool isFirst public void receiveMediaDataLength MCattributeSet attribSet MCtag tag uint dataLength uint dataOffset Writing the provideDataLength method Merge DICOM Toolkit The provideDataLength method is called by the library to request the data length eae a of the attribute identified by the tag parameter The attribute set containing the pelle Nl attribute is identified by the att ribSet parameter
237. here they are used Initialization File The following parameters are recognized by Merge DICOM in the initialization file Table 28 Initialization file parameters Name Section Description BLANK_FILL_LOG_FILE MergeCOM3 This parameter informs the toolkit whether or not to expand the log file to its maximum size on initialization Setting this value to NO will decrease the time spent in the MC mclnitialization call but increase the time spent doing actual logging while the application is running DEFAULT YES ERROR_MESSAGE MergeCOM3 This parameter informs the toolkit to log error messages INFO_MESSAGE MergeCOMs3 This parameter informs the toolkit to log error messages LOG_FILE MergeCOM3 This is the name of the Merge DICOM message log The file will be re created by Merge DICOM Toolkit This parameter is ignored by embedded toolkits DEFAULT merge log LOG_FILE_BACKUP MergeCOMs This is a Boolean parameter that tells Merge DICOM to create a backup of the log file before starting a new log If ON any existing log file is renamed with a file extension of Lnn where nnis an integer number between 01 and 99 DEFAULT OFF innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 Name Section Description LOG_FILE_LINE_LENGTH MergeCOM83 This option specifies the number of characters that occur on a line within the merge log file DEFAULT 78 MINIMUM
238. hildren is a set of child attributes in case the attribute is a DICOM sequence In case of a sequence attribute the Values property naturally is empty The code fragment below shows how to create an MCrequestParameter with MCrequestAttribute describing a WADO studyInstanceUid request parameter string keyword MCwado DicomKeywords MCdicom STUDY_INSTANCE_UID MCrequestAttribute attr new MCrequestAttribute Item keyword Tag MCdicom STUDY_INSTANCE_UID Keyword keyword Values new string studyInstanceUid J MCrequestParameter parm new MCrequestParameter Name keyword RequestRequirement MCrequestParameter Requirements REQUIRED Attributes new List lt MCrequestAttribute gt attr J Implementing IMCservice and IMCcache Interfaces Mergecom WADO framework provides a mechanism to convert DICOM WADO Http requests into Mergecom DIMSE request messages for a DICOM service Howerver the implementation of the DICOM service itself is out of the scope of the framework To access a user DICOM service the Mergecom WADO framework provides interfaces which will have to be registered through corresponding static properties of the MCwado singleton object lt summary gt Defines the methods of DICOM service to retrieve and store DICOM objects lt summary gt public interface IMCservice lt summary gt Retrieves DICOM response from DICOM service storage for WADO QIDO request lt summary gt lt par
239. hose different types e MCcommandsSet contains the attributes of a DIMSE message command set e MCdataSet contains the attributes of a DICOM information object e MCitem contains the attributes of a DICOM item e MCfileMetalnfo contains the attributes of a DICOM file s meta information Your applications deal with network messages in Merge DICOM using MCdimseMessage objects and DICOM files using MCfile objects MCdimseMessage objects contain command information attributes MCcommandSet and data set attributes MCdataSet MCfile objects contain meta information attributes MCfileMetalnfo and data set attributes MCdataSet Constructing Message Objects Network messages are encapsulated in MCdimseMessage objects When you call the MCassociation read method Merge DICOM returns a newly constructed and populated MCdimseMessage object When you use the MCdimseService class to send network messages as opposed to using one of the MCdimseService sub classes provided by Merge DICOM Toolkit you must construct an MCdimseMessage object You have several options available when you construct the new MCdimseMessage Construct a message using a pre populated data set One form of the constructor creates a MCdataSet object and a MCcommandSet object that contain all of the attributes of a DICOM message that will be used for the given serviceName and command References to the created attribute sets may be retrieved using the DataSet and CommandSet
240. iaStorageService Class 0 eee eeeeeeeete eee ereeneenaees 149 Constructing an MCmediaStorageService object eee 150 Reading Files x sic cchice cc nntte ee enned tateees ited capetie gained sd E T 150 Creating and Writing Files ccccccseeeeseeceeeeeceeeeeeeaeeeeeeeseeeesaeeeeaaeeeeeeeeeas 152 Saving Raw Unparsed Messages as DICOM Files n 153 The DICOMDIR file siiin padinten padena eeina a Paaren eieiei eaae 154 StrUctUrS ccvedincidadi pts oveaseetceshytpsnvadentSesscuyysnsedtatleesstph athe anadai anaid id dsan eadi 154 Constructing a new MCdir INStance ceccccceeeeeeeeceeeeeeeeeeeseaeeeeeeeeeeeeeeas 155 The MCdirRecord class cccccccceeeeeseeceeeee seer eeeeaeeeeaeeseneeeseaeeesaeeteaeeseeeeess 155 Navigating the DICOMDIR uu eee eens cene eens sees eeeeeseeeteeeteeeeeeaeeaee 156 Adding and Deleting DICOMDIR Records ccsccceeceeeeeeeeeeeeeeeneeteeeeees 157 Memory Managemen itt cccscccceeseeceeeeeseceeeeneeceeeeaeeeeeeneeaeeesnneeeeeenneaeenenaes 157 ASSIGNING Pixel Data ssi iesnas inaa Aaa a a Ba aaa 158 Using Attribute Containers s ssssseseresessrsensrirenereusnnenuranenasnnsensnunennnenennenena 158 Replacing Merge DICOM Toolkits Memory Management Functions 159 Accessing Data When Needed ssssssssssesssrresserneesnnnnseenneennnnnnnnnneennnnnnnenne 159 Saving Received Images Directly to DiSk ccccecceeeeeeesseeeeeseeeeeeeeeees 160 DICOM Structured
241. iation startListening myAE myContext myHandler To listen on a specific port e g 1114 port MCassociation startListening myAE 1114 myContext myHandler To listen on a specific network interface and port number TPEndPoint ep new IPEndPoint localAddress 1114 Mcassociation startListening scpApp ep false myContext myHandler If your application wants to stop listening for association requests on a given port it must call the stopListening method of the MCassociation class This simply requests that the library no longer accept connection requests on the port that are directed to this Application Entity A server program may call this when it is about to shut down and then wait for any active threads to finish MCapplication myAE MCassociation getApplication ACME_Query_SCP MCassociation stopListening myAE port Accepting or Rejecting the Association Before DICOM messages can be exchanged across the association the association acceptor must either accept or reject the association request from the association requestor When the Merge DICOM library calls the start method of your MCacceptor class it has already determined that both the local and remote applications wish to perform at least one common service The FirstAcceptableContext and NextAcceptableContext properties of the MCassociation class may be used to examine the services that are agreeable to both sides The Nu
242. ications Sample client and server applications are supplied for several DICOM services Merge DICOM Message Database Manual and Tools Merge OEM has a DICOM Database Management System in which the DICOM standard is maintained This database along with a few additional tools is used to generate the binary message info and dictionary files accessed by the DICOM Toolkit As the DICOM standard is updated or extended by simply maintaining this database we can generate new binary files and keep the toolkit current This also reduces the number of changes that must be made in the core DICOM Toolkit library over time A number of tools are included with Merge DICOM NET C Toolkit for maintaining the data dictionary A Message Database Manual is distributed with Merge DICOM and describes the use of these tools This manual describes the use of the various tools and text files supplied with Merge DICOM Toolkit Users can add definitions for private services and private attributes Please reference this manual for further information on extending the Merge DICOM data dictionary innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual Documentation Roadmap The Merge DICOM Toolkit documentation is structured as pictured in Figure 4 Read Me FIRST The User s Manual is the foundation for all other documentation because it explains the concepts of DICOM and the NET C DICOM Toolkit Before plunging into the Windows Help F
243. ida sbiedals EASA 203 PAV AUT GLENS sass canis sieve cic areurtad wished die ocala un dished E EE E E 204 System Profile senina inina dais lind die 216 Service Profile seserapan aroa eir eaa AE ei E 238 Appendix E Proprietary Schema XML structure 2c ccceeeceeeeeeeeseeeeeeeeeaees 240 Base64 encoding of bulks and attributes with VR UN ccscceesseeeeeeees 240 The default encoding of bulks and attributes with VR UN c ccs 241 Appendix F Mergecom ApiController Classes 0 cccccsceceeeeesceeeesseeeeeeesaees 243 Appendix G JSon NET License cccceeesceeeeeeeeeeeeeeaeeeeneeseeeesaaeeeeaaesseneeesaees 255 innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual Overview This User s Manual is targeted toward the developer of medical imaging applications using the Merge DICOM Toolkit to supply DICOM network or media functionality Merge DICOM Toolkit NET supplies you with a powerful and simplified interface to DICOM It lets you focus on the important details of your application and immediate needs of your end users rather than the often complex and confusing details of the DICOM Standard The goal of this manual is to give you basic understanding of DICOM and a clear understanding of the Merge DICOM Toolkit The DICOM Standard The DICOM Digital Imaging and Communications in Medicine Standard was originally developed by a joint committee of the American C
244. iguration and path names for the other configuration files mergecom pro Merge DICOM system profile This file contains general run time configuration options mergecom app Merge DICOM application profile This file contains configuration information about the services supported by the Merge DICOM application and information about remote DICOM applications mergecom srv Merge DICOM services file This file contains information about the services supported by Merge DICOM Toolkit mrgcom3 msg Merge DICOM message information file This file contains validation information for DICOM messages This file is required if a non empty MCdataSet MCitem MCdimseMessage or MCfile object is constructed by the application or if any validate or validateAttribute is called or if an MCdir object is constructed Merge DICOM data dictionary file innovative Imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual Configuration Options The majority of Merge DICOM Toolkit s configuration options can be used to solve interoperability problems in the field There are some options however that can be set before deploying a Merge DICOM application to help reduce potential problems These options are listed in Table 26 with descriptions of how they can be set Table 26 Configuration options to consider when deploying an application Configuration Option Description ACCEPT_ANY_APPLICATION_TITLE When set to NO Merge DICOM requir
245. iguration file The file contains a listing of all the valid attributes for the specified message Th utility also adds sequences contained in the message along with their attributes Each attribute in the file contains the tag value representation and the default lt serv gt lt cmd gt innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual value MC3File uses for the attribute If a given attribute has more than one value the character is used to delimit the values A default value listed as NULL means the attribute is set to NULL If the filename specified already exists it will be written over my MC3File The configuration file can be modified and reloaded into MC3File with the c option to generate a DICOM message c lt filename gt This option reads in a configuration file previously generated by mc3file The service name and command for the message need not be specified on the command line because they are contained in lt filename gt Because multiple files generated with this option are identical mc3file assume only one file should be generated This assumption can be overridden by specifying a number on the command line 1 This option lists all the service command pairs supported by mc3file When generating a message this option can be used instead of explicitly specifying the service name and command on the command line When spe
246. ile you should be comfortable with the material in the User Manual Assembly Reference The Windows Help File serves as a reference manual for the NET Assembly This help file contains detailed information on the classes provided by the NET C DICOM Toolkit The Release Notes contain a complete release history of the Merge DICOM Toolkit It also contains a description of the software distribution and information on contacting Merge OEM for support The DICOM Message Database Manual is an optional manual that describes the Extension DB Manual organization of the Merge DICOM Database and how to use it to extend standard services and define your own private services Tools are supplied to integrate your changes and create a new binary runtime object database User s Manual Windows Help File Reference Manual DICOM Message Database Manual Release Notes Figure 4 Merge DICOM Toolkit Documentation Roadmap Conventions This manual follows a few formatting conventions Terms that are being defined are presented in boldface Sample Margin Note Margin notes in the left margin are used to highlight important points or sections of the document ClassName When the descriptive text applies to one of the NET classes provided by the DICOM Toolkit Library the appropriate class name is listed in the left margin using Lucida Sans font se Portions of the document that can relate directly to the performance of your Z applicatio
247. ing the setServiceCommand method The service and command must be set if you wish to use the validate method The Command and ServiceName properties can be used to retrieve these properties myFile setServiceCommand STANDARD_CT MCdimseService C_STORE_RQ String serviceName myFile ServiceName ushort command myFile Command innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual File Meta Information Attribute Set MCfileMetalnfo MetalInfo File Meta Information Attribute Set MCfileMetalnfo MetalInfo Preamble property The Data Set MCdataSet DataSet removeFileValues Starting Over removeFileValues Working with the contained file meta information The File Meta Information MCfileMetalnfo encapsulated in the MCfile class contains identifying information about the data set also encapsulated in a DICOM file The meta information consists of a fixed length 128 byte file Preamble a DICOM Prefix DICM followed by several DICOM attributes providing the properties of the encapsulated data set Refer to Part 10 of the DICOM standard for more details The contents of this object are maintained automatically by Merge DICOM Toolkit although the MetaInfo property of the MCfile class returns a reference to its contained MCfileMetalnfo object Using that reference you can call the methods it inherits from MCattributeSet Get the file meta info attribute set MCfileMet
248. ini file by accessing the MERGE_INI environment variable You must set the MERGE_INI environmental variable to point to the Initialization File This variable can be set within a command shell for example In DOS command shell set MERGE_INI mc3adv merge ini See the Platform notes for your platform if none of these methods apply Merge DICOM applications written in NET do not use the MERGE_INI environment variable Instead they determine the location of the Initialization File in any way that is appropriate and then pass the location to the Assembly using the static mclnitialization method of the MC class The initialization file contains one MergeCOM3 section that points to the location of the other three Merge DICOM initialization files specifies characteristics of the message error log kept by the DICOM Toolkit library turns particular types of logging on and off and specifies where the messages are logged file screen both or neither In most cases the INFO WARNING and ERROR messages will be sufficient The Tn_MESSAGE settings where nis an integer between 1 and 9 turns on lower level protocol tracing capabilities These capabilities can prove useful when running into difficulties communicating with other implementations of DICOM over a network and can be used by Merge OEM service engineers in diagnosing lower level network problems Application Profile The Merge DICOM Application Profile usually called
249. innovative imaging Merge DICOM Toolkit V 5 1 0 NET C USER S MANUAL Merge Healthcare 900 Walnut Ridge Drive Hartland WI 53029 USA W MergeHealthcare 877 44 MERGE merge com M linkedin com company merge healthcare f facebook com MergeHealthcare Copyright 2015 Merge Healthcare Incorporated Unauthorized use reproduction or disclosure is prohibited This document has been prepared by Merge Healthcare Incorporated for its customers The content of this document is confidential It may be reproduced only with written permission from Merge Healthcare Specifications contained herein are subject to change and these changes will be reported in subsequent revisions or editions Merge Healthcare is a registered trademark of Merge Healthcare Incorporated DICOM is a registered trademark of National Electrical Manufacturers Association NEMA Merge DICOM Toolkit is a trademark of Merge Healthcare The names of other products mentioned in this document may be the trademarks or registered trademarks of their respective companies For assistance please contact Merge Healthcare Customer Support e In North America call toll free 1 800 668 7990 then select option 2 e International call Merge Healthcare in Canada 1 905 672 7990 then select option 2 e Email MDTsupport merge com Part Date Revision Description COM 1676 June 2015 1 0 Updated bi annually Merge DICOM Toolkit V 5 1 0 NET C User s Man
250. input for IMChttpConverter Convert method IMCHttpConverter Interface and Constructing HttpResponseMessage Constructing the HttpResponseMessage object from a rendered binary data returned by IMChttpConverter Convert is the final stage of the workflow Mergecom WADO framework uses the IMCHttpConverter interface to convert an array of Stream into an HttpResponseMessage The interface itself has only one method to implement lt summary gt Defines the conversion operation of rendered DICOM streams into an array of lt see cref HttpContent gt objects lt summary gt public interface IMChttpConverter lt summary gt Converts an arrays of rendered DICOM stream into array of lt see cref HttpContent gt objects based on request parameters lt summary gt lt param name streams gt DICOM streams lt param gt lt param name xmlRequestParameters gt XML string of lt see cref MCparameter gt used for WADO request lt param gt lt param name xmlResponseParameters gt XML string of lt see cref MCparameter gt returned from DICOM service lt param gt lt returns gt A lt see cref HttpResponseMessage gt object generated from DICOM service response lt returns gt HttpContent Convert Stream streams String xmlRequestParameters ref String xmlResponseParameters Based on DICOM service architecture details the user might implement his own rendering and conversion classes and register them as an IMCdico
251. is also provided in the MCfile class to return the actual length of the streamed file object And the streamIn streamOut and streamLength methods are also provided by the MCattributeSet class so any attribute set may be used to create a stream The streamIn methods return the byte offset from the beginning of the stream to the next attribute after the stop tag parameter innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual DICOM Message Stream MCdimseMessage or MCattributeSet Object Figure 13 Relationship between an Attribute Set Object and a Message Stream Creating a message stream A streamOut call could look like the following MCstreamOutCallback class MyStreamHandler MCdataSink MCdata o receiveData method public void receiveData MCdata data System Object origin Store the data described in data as appropriate if errorOccured throw new MCcallbackCannotComplyException MCdimseMessage msg non null referenc MyStreamHandler streamHandler new MyStreamHandler try msg streamOut 0x00080000 Ox7FDFFFFF MCtransferSyntax ExplicitLittleEndian streamHandler catch MCnoAttributesException e catch MCillegalArgumentException e catch MCcallbackCannotComplyException e This call converts the attributes from 0008 0000 through 7FDF FFFF in the MCdimseMessage object identified by msg into a DICOM m
252. is parameter is used only if LARGE_DATA_STORE FILE An absolute or relative path may be specified DEFAULT This parameter specifies if non ASCII characters are to be tolerated in the default repertoire When set to Yes the validation of the attribute message will not be enforced but a warning message will still be logged DEFAULT Yes VR Code to use for attributes with unknown VRs This may be set to OB if an implementation does not understand UN DEFAULT UN VALID VALUES UN OB When set to Yes the group 0028 attributes within a message will be updated when duplicating a message or file with MC_Duplicate_Message and the standard compressor or decompressor The Photometric Interpretation will be updated as appropriate and the Lossy Image Compression Lossy Image Compression Ratio and Lossy Image Compression Method tags will be updated if Lossy Image Compression was applied to the image DEFAULT No When set to Yes all registered callback functions registered with MC_Register_Callback_Function are called with the FREE_DATA callback type when the memory associated with the callback is to be freed because the enclosing message file or item is being freed DEFAULT No innovative maging Merge DICOM Toolkit V 5 1 0 NET C User s Manual Description WORK_BUFFER_SIZE This parameter specifies the amount of data that is buffered in the toolkit before being stored internally or passed t
253. is value defines the UID for JPEG Extended Process 2 amp 4 transfer syntax DEFAULT 1 2 840 10008 1 2 4 51 This value defines the UID for JPEG Extended Process 3 amp 5 transfer syntax DEFAULT 1 2 840 10008 1 2 4 52 This value defines the UID for JPEG Extended Hierarchical Process 16 amp 18 transfer syntax DEFAULT 1 2 840 10008 1 2 4 59 This value defines the UID for JPEG Extended Hierarchical Process 17 amp 19 transfer syntax DEFAULT 1 2 840 10008 1 2 4 60 This value defines the UID for JPEG Full Progression Hierarchical Process 24 amp 26 transfer syntax DEFAULT 1 2 840 10008 1 2 4 63 innovative imaging NET C User s Manual Merge DICOM Toolkit v 5 1 0 JPEG _FULL_PROG_HIER_25_ 27 SYNTAX JPEG _FULL_PROG_NON_HIER_10_12 SYNTAX JPEG _FULL_PROG_NON_HIER_11_13_ SYNTAX JPEG_LOSSLESS_HIER_14_ SYNTAX JPEG_LOSSLESS_HIER_28 SYNTAX JPEG_LOSSLESS_HIER_29 SYNTAX JPEG_LOSSLESS_NON_HIER_14 SYNTAX JPEG_LOSSLESS_NON_HIER_15_SYNTAX JPEG_LS LOSSLESS _ SYNTAX JPEG_LS_LOSSY_SYNTAX JPEG_SPEC_HIER_20_22_ SYNTAX JPEG_SPEC_HIER_21_23_SYNTAX Description This value defines the UID for JPEG Full Progression Hierarchical Process 25 amp 27 transfer syntax DEFAULT 1 2 840 10008 1 2 4 64 This value defines the UID for JPEG Full Progression Non Hierarchical Process 10 amp 12 transfer syntax DEFAULT 1 2 840 10008 1 2 4 55 This value defines the UID for JPEG
254. it relationship to each child or target Content Item and is conveyed by the Relationship Type Figure 79 illustrates the relationship of SR Documents to Content Items and the relationships of Content Items to other Content Items as well as to the Observation Context innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual SR Document 1 lt n gt 1 Content Item Note A Content Item may contain either Observation Context or other content related to 0 n Figure 19 SR Information Model Each Content Item contains the following e A name value pair consisting of a single Concept Name Code that is the name of a name value pair or a heading and O o avalue text numeric code etc e References to images waveforms or other composite objects with or without coordinates and e Relationships to other Items either by value through nested Content Sequences or by reference Note Some Content Item Types can have multiple values innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 Content Item Types Table 21 defines all possible Content Item Types that can be used in the SR Document Content Module The choice of which may be constrained by the IOD in which this Module is contained The Merge DICOM Toolkit Class column specifies the enumerated value used in the Toolkit to identify the Content Item Type
255. k Only We have discussed how associations are managed as well as how messages objects are populated and parsed Now we discuss how these DICOM messages are exchanged with other application entities over the network The exchange of DICOM messages between AE s only occurs over an open association After the DICOM client SCU application opens an association with a DICOM server SCP the client sends request messages to the server application For each request message the client receives back a corresponding response from the server The server waits for a request message performs the desired service and sends back some form of status to the client in a response message This process along with the corresponding Merge DICOM Toolkit method calls are pictured in Figure 14 Request Message MCdimseService sendRequestMessage MCassociation read DICOM DICOM Client Open Association Server MCassociation read MCdimseService sendResponseMessage ETS Response Message Figure 14 Message Exchange in Merge DICOM Toolkit Applications Reading Network Messages The read method of the MCassociation class is always used to retrieve the next message available on the network connection It returns an MCdimseMessage object that encapsulates the DICOM message Its only parameter is a timeout value public MCdimseMessage read long timeout The timeout parameter specifies in milliseconds how long your process will wait for a messag
256. l use a separate thread to call your class s start method Everything you need to know about the association is provided in the MCassociation object When your start method returns Merge DICOM will end the thread In this case you must not only supply the Remote Application Title of the server you wish to connect to but you must also provide an instance of your MCrequester class class MyAssocHandler MCrequester void start MCassociation assoc MyAssocHandler myHandler new MyAssocHandler MCremoteApplication remoteApp MCremoteApplication getObject ACME_Query_SCP MCassociation myAssoc myAssoc myAE requestAssociation ACME_Query_SCP remoteApp myHandler innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual If the requestAssociation call returns without throwing an exception the new thread has been started and your myHand1er instance is called to process the association DEFAULT Note that in the last two examples we only specified the Application Entity Title of is to proposed the services the remote server In this case the Library retrieves three important pieces of defined in mergecom app information from the information in the Application Profile mergecom app file The list of services to be proposed is obtained from your application s entry in the Application Profile The name of the host the remote server is running on is obtained from the
257. lass has two static methods getSopClassByName and getSopClassByUid which can be used to retrieve these Merge DICOM managed instances These two methods take either the service name or a DICOM SOP Class UID Both of these are defined in the System Profile mergecom srv The MCsopClass has the following get methods BaseClasses Commands Name Number Uid BaseClass MetaClass plus an overridden Equals method See the sample code below MCsopClass sopl MCsopClass getSopClassByUid 1 2 840 10008 5 1 1 1 MCsopClass sop2 MCsopClass getSopClassByName BASIC_FILM_SESSION if sopl Equals sop2 System Console Out WriteLine They should be equal System Collections IList baseClasses sopl BaseClasses if baseClasses null System Console Out WriteLine Not a meta sop System Collections BitArray commands sopl Commands if sopl Name Equals sop2 Name System Console Out WriteLine Should be equal Ef sop1 Uid equals sop2 Uid System Console Out WriteLine Should be equal if sopl Number sop2 Number System Console Out WriteLine Should be equal if sopl BaseClass System Console Out WriteLine That s right if sopl MetaClass System Console Out WriteLine That s right innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 Earlier we saw how MCsopClass instances are
258. lass to retrieve the series of images When the images are exported to the workstation with an explicit VR transfer syntax the workstation fails to parse the first image received when it encounters the first UN VR attribute and the association is automatically aborted by the workstation We have added several methods to solve this interoperability problem through the Merge DICOM toolkits configuration files For SCU systems that are exporting UN VR tags to systems that cannot handle them the following can be done SCU application strategy Configure the SCU to only use the Implicit VR Little Endian transfer syntax when exporting objects This can be done through the use of transfer syntax lists within the mergecom app file or through commenting out the UID definitions for the other transfer syntaxes within the mergecom pro file Set the UNKNOWN_VR_CODE configuration option in the mergecom pro file to OB This forces unknown VR attributes to be encoded as OB instead of as UN All implementations can handle OB encoding There are several drawbacks to this option If the attributes are encoded as OB it is harder for these attributes to be converted back to their normal VR Secondly this option changes all instances of the UN VR into OB Systems that can handle the UN VR will now also receive these attributes as OB Set the EXPORT_UN_VR_TO_NETWORK configuration option to No This will cause the Merge DICOM toolkit to not export attribu
259. lback The user must write the attribute tag value representation if needed and the length of the image data attribute to the file The image data is written to the file in subsequent calls to the user s registered callback method When read is parsing a message being received it will notify the user s registered callback class when it has parsed the header information and determines the image data s length The registered callback s receiveDataLength method will be called providing the length of the registered attribute s value as well as a reference to the MCattributeSet being populated At this point the user can stream the header file to disk using the MCattributeSet st reamOut method As the image data is received it can be added to the end of this file Data can also be stored as DICOM files with this method The message cannot be converted into a file object at this point using the special form of the MCfile constructor as would normally done So a separate MCfile object must be constructed to add the DICOM Part 10 Meta Header information This header can be written out from within the callback by using the st reamOut method on the contained MCfileMetalnfo object After the end of the meta header the message can be streamed to disk with a call to st reamOut in the transfer syntax specified in the Meta Header As subsequent image data is passed to the user s callback class the data can be written to file Because the endian
260. lowing shows how to implement this task class BulkDataUriHandler MCbulkUriHandler public object provideData MCattributeSet attrSet unit tag MCvr vr string uri if tag MCdicom PIXEL_DATA use parameter uri to retrieve your data based on your data create an array of datasize innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 byte data new byte datasize populate your data array return data call an overloaded method of readFromXMLNative file readFromXMLNative reader new BulkDataUriHandler By default if no bulk URI handler is supplied and a bulk URI attribute is encountered in the XML file the toolkit will generate an empty attribute tag with zero length for the encountered tag toa JSON string The MCabstractMessage provides a writeToJSON method which can be utilized writeToJSON method to convert its derived classes MCfile and MCdimseMessage to a DICOM JSON Model string PS3 18 You can convert a list of attributes of an MCfile or MCdimseMessage along with their values into a DICOM JSON Model string by using the writeToJSON method of the MCabstractMessage The writeToJSON method creates a JSON string describing the contents of the MCfile or MCdimseMessage The JSON buffer will be written to the stream identified by the stream object provided The following example shows how the writeTOJSON method is utilized at a high level MCfile myFile
261. lt xml version 1 0 encoding utf 8 gt lt DemFile gt lt FileMetaInfo Service STANDARD_SEC_CAPTURE Command C_STORE_RQ gt lt Attribute Tag 00020001 VR 0OB Name File Meta Information Version Length 2 gt 00 01 lt Attribute gt lt Attribute Tag 00020016 VR A Application Entity Title Length 15 gt MERGE_STORE_SCP lt Attribute gt lt FileMetaInfo gt lt DataSet Service STANDARD_SEC_CAPTURE Command C_STORE_RQ TransferSyntax 1 2 840 10008 1 2 1 gt lt Attribute Tag 00080008 VR CS Name Image Type Length 24 gt ORIGINAL SECONDARY OTHER lt Attribute gt lt Attribute Tag 00080016 VR UI Name SOP Class UID Length 25 gt 1 2 840 10008 5 1 4 1 1 7 lt Attribute gt lt Attribute Tag 00081111 VR SQ Name Referenced Performed Procedure Step Sequence Length 1 gt lt Item gt lt Attribute Tag 00081150 VR UI SOP Class UID Length 23 gt 1 2 840 10008 3 1 2 3 3 lt Attribute gt lt Attribute Tag 00081155 VR UI Name Referenced SOP Instance UID Length 44 gt 2 16 840 1 113669 4 960070 844 1026926027 44 lt Attribute gt lt Item gt lt Attribute gt lt Attribute Tag 00090010 VR LO Name Private Creator Code PCode PrivateCode Length 11 gt SAMPLE PCODE lt Attribute gt lt Attribute Tag 00091010 VR LO Name Private PCode SAMPLE PCODE Length 6 gt Valuel lt Attribute gt lt Attribute Tag 00091015 VR UN Name Private PCode SAMPLE PCODE Length 6 gt
262. mRenderer and IMCHttpConverter interfaces using the MCwado singleton class For instance public class DicomRenderer IMCdicomRenderer IMCdicomRenderer renderer new DicomRenderer MCwado DicomRenderer renderer public class HttpConverter IMChttpConverter IMChttpConverter converter new HttpConverter MCwado HttpConverter converter innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual On receiving the DICOM service response the Mergecom WADO framework would create a MCdicomResponse object and executes GetHttpResponseMessage method which would first call the Render method of the registered IMCDicomRenderer interface and then the Convert method of IMChttpConverter interface If an IMCDicomRenderer or IMCHttpConverter interfaces are not registered the Mergecom WADO framework would use its own MCdicomRenderer and MChttpConverter public classes As the MCdicomRenderer and MChttpConverter classes imply some restrictions on the DICOM service implementation the user is encouraged to implement his own IMCdicomRenderer rendering and IMChttpConverter conversion based on the knowledge of DICOM service architecture Deploying Applications There are several issues to consider when deploying a Merge DICOM based application These include deciding which Merge DICOM files are needed for your application how to set important configuration options to reduce problems in the field and how to deal
263. mberOfAcceptableContexts property retrieves the number of contexts that is acceptable to both sides Each of these calls returns an MCresultContext object that can be interrogated to determine the properties of each acceptable service The NextAcceptableContext property can be called multiple times to traverse through the acceptable contexts A null will be returned by the property when the end of the list has been reached The FirstAcceptableContext method can be called to reset the list and traverse through it again Several other methods are available in MCassociation class to innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual inquire about the proposed association Please refer to the MCassociation and MCresultContext classes in the Windows Help File Note that many applications don t have a need to call the FirstAcceptableContext or NextAcceptableContext methods since it is acceptable that any of the services it negotiated were agreeable to both sides If this application agrees with the acceptable services it calls the accept method of MCassociation to establish an association between the two applications If it disagrees for some reason it calls the reject method The acceptor decides class MyAssocHandler MCacceptor void start MCassociation assoc try MCresultContext ac assoc FirstAcceptableContext while ac null Insert your check here ac assoc NextAcceptableContext
264. mmary gt MCWADORSCONTROLLER lt summary gt public static readonly String MCWADORSCONTROLLER MCWADORSCONTROLLER lt summary gt MCWADOURICONTROLLER lt summary gt public static readonly String MCWADOURICONTROLLER MCWADOURICONTROLLER lt summary gt MCWADOWSCONTROLLER lt summary gt public static readonly String MCWADOWSCONTROLLER MCWADOWSCONTROLLER lt summary gt Gets lt see cref MCcontroller gt name might be MCCONTROLLER MCQIDOCONTROLLER MCSTOWCONTROLLER MCWADORSCONTROLLER MCWADOURICONTROLLER or MCWADOWSCONTROLLER lt summary gt public String Name get protected set lt summary gt Class constructor lt summary gt public MCcontroller base Name MCCONTROLLER MCwadoRsController using System using System Collections Generic using System Ling using System Net Http using System Text using System Threading Tasks using System Web Http using System Web Http ModelBinding using Mergecom using Mergecomws Dicom innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 namespace Mergecomws Web lt summary gt Implements Http Get methods for DICOM WADO RS requests lt summary gt public class MCwadoRsController MCcontroller lt summary gt Class constructor lt summary gt public MCwadoRsController base lt summary gt Http Get method lt summary gt lt param name request gt
265. move speed Hierarchical Process 14 can be compressed or decompressed at a maximum limitations rate of 3 images or frames per second For JPEG 2000 Lossless and Lossy a dialog will be displayed each time the compressor or decompressor is used Full licenses can be purchased from Pegasus and configured in Merge DICOM to remove these compression and decompression limits The licenses can be configured in the mergecom pro configuration file The MCtransferSyntax JpegBaseline transfer syntax is UID 1 2 840 10008 1 2 4 50 JPEG Baseline Process 1 Default Transfer Syntax for Lossy JPEG 8 Bit Image Compression and uses Pegasus libraries 6420 6520 Table 15 details the photometric interpretation and bit depths supported by the standard compressor and decompressor for this transfer syntax When lossy compressing RGB data the standard compressor by default compresses the data into YBR_FULL_422 format The compressor can also compress in YBR_FULL format if the COMPRESSITON_RGB_TRANSFORM_FORMAT configuration option is set to YBR_FULL The Photometric Interpretation tag must be changed by the application after compressing RGB data Similarly the Photometric Interpretation tag should be changed back to RGB before decompressing YBR_FULL Or YBR_FULL_422 data Table 15 JPEG Baseline Supported Photometric Interpretations and Bit Depths JPEG Baseline MONOCHROME 1 MONOCHROME2 Photometric Interpretation Bits Stored Bits Allocated
266. must contain an even number of bytes and may be empty The IsLast property of the returned MCdata object must be set to t rue if this is the last portion of the value that will be provided Merge DICOM will no longer call provideData for this instance of the attribute after TsLast is returned true The Length property must be set to the number of significant bytes in the data buffer isFirst is set by the library to t rue if this is the first request for the attribute s value If the method cannot comply with the request it must throw an MCcallbackCannotComplyException If the exception is thrown Merge DICOM will make no further calls for this instance of the attribute public MCdata provideData MCattributeSet attribSet tag uint offset bool isFirst MCtag Stream stream null byte array new byte 4096 bool isLast false uint size 0 if unableToProvideData throw new MCcallbackCannotComplyException if isFirst stream new FileStream this fname FileMode Open FileAccess Read FileShare Read stream Seek offset SeekOrigin Begin Read the next portion of the value into array put length read into size if thereIsNoMoreData isLast true MCdata data new MCdata array size data IsLast isLast return data innovative Imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 Merge DICOM Toolkit calls to provide the attribute s data length
267. n PS3 7 of DICOM states The Implementation Class UID is intended to provide respective each network node knows the other s implementation identity and non ambiguous identification in the event of communication problems encountered between two nodes PS3 7 of DICOM further defines how this UID should be defined different equipment of the same type or product line but having different serial numbers shall use the same Implementation Class UID if they share the same implementation environment i e software IMPLEMENTATION_VERSION The Implementation Version is intended to distinguish between software versions of an implementation It should be set to the version of the Merge DICOM application UN VR DICOM Supplement 14 Unknown Value Representation became a part of the DICOM standard on June 3 1997 This supplement added a new value representation UN to the DICOM standard It was developed to fix two related holes in the DICOM standard When standard or private attributes were received in an implicit value representation VR transfer syntax and the user does not have a knowledge of the VR of the attributes there is no way to represent the VR for these attributes in an explicit VR transfer syntax Every time a new VR is added to the standard there is no way to determine if the length field in explicit value representation transfer syntaxes should be encoded as 2 bytes or 4 bytes so a general parser could not
268. n are marked with the special margin note Performance Tuning Sample commands appear in bold courier font while sample output source Performance Tuning code and method calls appear in standard courier font innovative imaging NET C User s Manual Merge DICOM Toolkit v 5 1 0 MCapplication Client Server MCdimseService and it s subclasses MCfileService and it s subclasses MCsopClass Hexadecimal numbers are written with a trailing H For example 16 decimal is equivalent to 10H hexadecimal Understanding DICOM The many separate parts of the DICOM Standard can seem overwhelming and most would agree that they are difficult to read Part of what makes a successful standard is precision and detail Our goal here is to explain the key concepts without delving too far into the detail most of which is handled automatically for you by the DICOM Toolkit General Concepts Some key concepts that must be understood to use the DICOM Toolkit wisely are common across both DICOM networking and interchangeable media applications These concepts are discussed first Application Entities The DICOM Standard refers extensively to Application Entities AE s An application entity is simply a DICOM application If your application interacts with other applications on a network or with interchangeable media using the DICOM protocol it is an application entity DICOM also refers to Service Class Users SCU s
269. n during MCstorageNegotiation the association creation process The Toolkit provides the MCnegotiationInfo MCqueryRetrieve abstract class to represent this process Classes that extend the Negotiation MCnegotiationInfo class must supply a decode method and a toByteArray method The Library calls the decode method when it receives a buffer of extended negotiation information and it calls the toByteArray method to request that negotiation information be placed in a byte array for transmission Merge DICOM provides two sub classes to the MCnegotiationInfo class the MCstorageNegotiation class and the MCqueryRetrieveNegotiation class Refer to the Merge DICOM NET Assembly Windows Help File for details If you will be using extended negotiation you will use the setNegotiationInfo method of the MCproposedContextList class to register your MCnegotiationInfo object For example MCnegotiationInfo myInfo MyContextList setNegotiationInfo myInfo Note that if you use the MCstorageService or MCqueryRetrieveService classes this negotiation processing is handled for you automatically innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 Association startup for a client application MCrequester Processing the association in the same thread Processing the association in the another thread MCassociation Starting an Association Requester If your application will be an association requester
270. n the Row 8 item item3 setValue MCdicom REFERENCED_SOP_CLASS_UID 1 2 3 4 1 item3 setValue MCdicom REFERENCED_SOP_INSTANCE_UID 1 2 3 4 5 1 item2 setValue MCdicom REFERENCED_SOP_SEQUENCE item3 j iteml setValue MCdicom REFERENCED_SERIES_SEQUENCE item2 dataSet setValue MCdicom CURRENT_REQUESTED_PROCEDURE_EVIDENCE_SEQUENCE iteml1 return dataSet Reading SR Documents Reading SR Documents is done in a similar way to encoding but in reverse sequence 1 Reading a File or receiving a message object 2 Reading root level attributes 3 Creating a new MCstructuredReport object 4 Reading SR Content from the dataset 5 Traversing SR content tree and accessing Content Node attributes The following code illustrates a reading sequence for the Key Object Document generated above private void ReadKO MCdataSet dataset Create a new SR instance and fill it from the dataset MCsructuredReport sr new MCstructuredReport sr Read dataset Print information from the root CONTAINER item Console WriteLine Document Title sr RootItem ConceptName CodeMeaning Console WriteLine Template Id sr RootItem Templateld Reading the first children as a CODE item if sr RootItem Children 0 is MCcodeItem MCcodeItem codeItem sr RootItem Children 0 as MCcodeItem Console Write codeItem ContentItemType Console WriteLine codeItem ConceptName CodeMeaning cod
271. n this case the SCU_SR_General service list contains the related general SOP Classes for the STANDARD_BASIC_TEXT_SR service The REL_GENERAL_1 option points to the service list to use as the related general services for SERVICE_1 The above example also shows how the service class can be defined for each SOP Class within a service list For instance SERVICE_CLASS_3 in the above example specifies the service class for SERVICE_3 In this case the UID for the Storage Service Class as defined in Supplement 90 is used The service lists above are only utilized by SCU applications For SCP applications there are several configuration options that define how Merge DICOM will negotiate an association when related general SOP Classes are included or the Service Class is included for a SOP Class When the ACCEPT_STORAGE_SERVICE_CONTEXTS configuration option is set to Yes Merge DICOM will accept any proposed SOP class that is defined as supporting the Storage Service Class When the ACCEPT_RELATED_GENERAL_SERVICES configuration option is set to Yes Merge DICOM will accept any SOP class proposed if the SCP supports in its service list any of the related general SOP Classes defined for a SOP Class proposed innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual System Profile The Merge DICOM System Profile usually called mergecom pro contains configuration parameters for the DICOM Toolkit Library itself
272. n1 while the query retrieve server runs on an HP workstation with the host name acme_hp2 Both servers listen on port 104 the standard DICOM listen port The host name and port combined make up the TCP IP network address for a listening server application See Figure 10 Besides entering a hostname for the HOST_NAME parameter it is also possible to simply enter an IP address Both IPv4 addresses and IPv6 addresses are allowed in this field Service List The SERVICE_LIST is set to the name of another section in the application profile that lists the DICOM services that will be negotiated with that application entity For example in this case these sections might look like Storage_Service_List SERVICES_SUPPORTED 11 Services in list SERVICE_1 STANDARD_MR SERVICE_2 STANDARD_CR SERVICE_3 STANDARD_CT SERVICE_4 STANDARD_CURVE SERVICE_5 STANDARD _MODALITY_LUT SERVICE _6 STANDARD_OVERLAY SERVICE_7 STANDARD _SEC_CAPTURE SERVICE_8 STANDARD_US SERVICE 9 STANDARD_US_MF SERVICE_10 STANDARD _VOI_LUT SERVICE_11 STANDARD_NM Query_Service_List SERVICES_SUPPORTED 2 Services in list SERVICE_1 STUDY_ROOT_FIND SERVICE_2 STUDY_ROOT_MOVE Storage_Service_List lists the storage services that will be requested while Query_Service_List lists the type of query retrieve that will be r
273. nal is specified in the Requirement and Condition fields The number of times the included Template may be repeated is specified in the VM field We recommend that you implement templates as a subroutine or function call In that case the inclusion of the template will be implemented as a call to that template with passing parameters Some of the templates defined in DICOM Part 16 already have predefined parameters and they are indicated by aname beginning with the character innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual Overview of the Merge DICOM Toolkit SR Classes MCserializableToDataSet C MCserializableToDataSet Mccontentitem MCserializableToDataSet Abstract Class H Totartace H H E elds i 3 Methods i H Properties i Read i SF Children Write F FactoryMap i SF Conceptvame i F Rootltem i SF CantentitemType pna H DataContext 2 NodeName i SF ObservationDate i MCrelationshiptype io S Parent i RelationshioType Enum i A References E Methods H CONTAINS F HAS_OBS CONTEXT HAS_ACQ_CONTEXT HAS CONCEPT MOD HAS PROPERTIES INFERRED_FROM SELECTED_FROM UNDEFINED MCcontaineritem 2 Class PMCcontentiten MCuidReferenceltem 2 Class gt MCcontentitem MCpersonNameltem Chass b MCcontentitem MCdateltem 2 Chess MCcontertiten ti Fields ti
274. nd MCdimseMessage to a proprietary writeTOoXML method schema XML string You can convert a list of attributes of an MCfile or MCdimseMessage along with their values into an XML string by using the writeTOXML method of the MCabstractMessage The writeTOXML method creates an XML string describing the contents of the MCfile or MCdimseMessage The XML buffer will be written to the stream identified by the stream object provided Note If MCfile or MCdimseMessage objects contain an attribute with a Value Representation of SQ sequence of items each item in the sequence is converted into its XML representation The following example shows how the writeTOXML method is utilized at a high level MCfile myFile a non null file reference MCxmlOptions xmlOptions MCxmlOptions XmlOptIncludeBulks XmlOptExcludeSequences StreamWriter writer new StreamWriter myFile convert DICOM file to an XML file myFile writeToXML writer xmlOptions writer Close The following configuration flags are defined in the MCxmlOptions enumeration and are available for the MCabstractMessage to XML conversion Use the default settings XmlOptDefault 0x0 Store bulk attributes VR is OB or OW in the XML XmlOptIncludeBulks 0x1 Store Pixel Data buffer in the XML XmlOptIncludePixelData 0x2 Do not store Sequence attributes in the XML XmlOptExcludeSequences 0x4 Do not store Private attributes in the X
275. nd command to the message MCdimseMessage Command Set Properties Normalized DICOM service classes make use of the N ACTION DIMSE service That service requests that a specific action be performed by the peer DIMSE service user Each SOP class using the N ACTION service defines Action Type IDs that identify a specific service The ActionTypeId property can be used to get or set the Action Type ID that was specified in the DIMSE message This for attribute 0000 1008 The AffectedSopClassUid property sets or gets the DICOM Affected SOP Class UID associated with the DIMSE message It is retrieved from attribute 0000 0002 in the message s command set The AffectedSopInstanceUid property sets or gets the DICOM Affected SOP Instance UID associated with this DIMSE message It is retrieved from attribute 0000 1000 in the message s command set DIMSE services using N GET operations use a command set field to provide an attribute tag for each of the attributes applicable to the N GET operation The AttributeIdentifiers property sets or gets an array of unsigned integer values each of which is an attribute tag number This will set or get attribute 0000 1005 in the command set innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual CompletedSubOperations The DIMSE services that use C GET or C MOVE operations place the number of C STORE sub operations completed in their response messages The CompletedSubO
276. nd uses Pegasus libraries 6220 6320 Table 17 details the photometric interpretation and bit depths supported by the standard compressor and decompressor for this transfer syntax The standard compressor does not do a color transformation to RGB data when compressing with JPEG_LOSSLESS_HTER_14 The Photometric Interpretation tag should be left as RGB in this case Table 17 JPEG Lossless Supported Photometric Interpretations and Bit Depths JPEG Lossless Non Hierarchical Process 14 Photometric MONOCHROME1 Interpretation MONOCHROME2 se fes Skies for srona The MCtransferSyntax Jpeg2000 transfer syntax is UID 1 2 840 10008 1 2 4 91 JPEG 2000 Image Compression and uses Pegasus libraries 6820 6920 for lossy or lossless Table 18 details the photometric interpretation and bit depths innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual SPECIAL NOTES supported by the standard compressor and decompressor for this transfer syntax Table 18 JPEG 2000 Lossy Supported Photometric Interpretations and Bit Depths JPEG 2000 When used for Lossy Photometric MONOCHROME 1 YBR_ICT RGB Interpretation MONOCHROME2 ws fe fw e o fe seme fo fe fs es fo The MCtransferSyntax Jpeg2000LosslessOnly transfer syntax is UID 1 2 840 10008 1 2 4 90 JPEG 2000 Image Compression Lossless Only and uses Pegasus libraries 6820 6920 for lossless Table 19 details the photometric interpretation and bit de
277. ndards and provides interfaces for DICOM storage retrieve services It is built on top of Mergecom DICOM Toolkit and re uses its architecture and base classes As an upper layer of Mergecom Dicom Toolkit the WADO framework is released as a separate Mergecomws dll assembly which requires Mergecom DICOM Toolkit assemblies and configuration files It is built using Windows NET Framework 4 5 Configuring Wado Http Controllers and MCwado Services Mergecom WADO framework uses Microsoft ASP NET Web API 2 2 framework to handle Http clients requests There are four different types of MCcontrollers derived from System Web Http ApiController class Each MCcontroller is designed to handle a specific type of WADO request WADO RS WADO URI WADO WS QIDO RS or STOW RS Each of MCcontrollers is used for a specific Http service and has to be registered in System Web Http HttpConfiguration in HttpRoute collections with multiple URI templates The ASP NET Web API framework will then route all the GET or POST requests to the specific methods of MCcontroller The source code for MCcontrollers as well as an examples of URI templates are provided in Appendix F innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual The user is encouraged to implement their own ApiController classes that would match the requirements of their Web service application Mergecom WADO framework uses a singleton MCwado class for initializing Mergecom
278. nerated will have this maximum size If a value less than 1 is specified only one capture file of unlimited length will be generated DEFAULT 0 IP_TYPE This parameter specifies the preferred IP type for network communications When set to IPV4 Merge DICOM Toolkit will attempt to utilize only IPV4 network connections When set to IPV6 Merge DICOM Toolkit will attempt to use only IPV6 network connections When set to AVAILABLE in an SCP Merge DICOM Toolkit will prefer IPV6 if it is enabled in the operating system over IPV4 If IPV6 is used the socket is put into dual stack mode if supported by the operating system to accept connections from both IPV4 and IPV6 When set to AVAILABLE in an SCU Merge DICOM Toolkit will use the available type of IP networking DEFAULT AVAILABLE VALID VALUES AVAILABLE IPV4 IPV6 MAX_PENDING_CONNECTIONS This parameter specifies the maximum number of open listen channels Its value is used as the second argument of aTCP listen call DEFAULT 5 NETWORK_CAPTURE This parameter specifies whether or not network data should be captured in files suitable to be read by the MergeDPM utility Use these parameters to customize the network capture CAPTURE_FILE CAPTURE_FILE_SIZE NUMBER_OF_CAP_FILES REWRITE_CAPTURE_FILES DEFAULT No NUMBER_OF_CAP_FILES This parameter specifies the number of capture files to generate capture files are generated if the NETWORK_CAPTURE value is set to Yes Each capture file gene
279. next column contains the date and the time when the message was generated The toolkit synchronizes the logging internally Each call to log a message will block the calling thread until other pending calls are completed See Using the Merge DICOM log file section for more details on logging Utility Programs The Merge DICOM Toolkit supplies several useful utility programs These utilities can be used to help you validate your own implementations and better understand the standard All these utilities use the Merge DICOM Toolkit C Run time Library and require that you set your MERGE_INI environmental variable to point to the proper configuration files as described earlier innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual mc3comp Do a DICOM diff The mc3comp utility can be used to compare the differences between two DICOM objects The objects can be encoded in either the DICOM file or stream format and do not have to be encoded in the same format The utility will output differences in tags between the messages taking into account differences in byte ordering and encoding The syntax for the utility is the following mc3comp tl lt syntax gt t2 lt syntax gt file o m1 m2 filel file2 tl lt syntax gt Optional specify transfer syntax of filel message where lt syntax gt il for implicit little endian default el for explicit little endian eb
280. nformance statement innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual IMPLICIT _BIG_ENDIAN_ SYNTAX IMPLICIT _LITTLE_ENDIAN_SYNTAX JPEG_2000_LOSSLESS_ONLY_SYNTAX JPEG_2000_ MC LOSSLESS _ONLY_SYNTAX JPEG_2000_MC SYNTAX JPEG_2000_SYNTAX JPEG _BASELINE_SYNTAX JPEG _EXTENDED_2_ 4 SYNTAX JPEG _EXTENDED_3_5 SYNTAX JPEG_EXTENDED_HIER_16_18 SYNTAX JPEG_EXTENDED_HIER_17_19 SYNTAX JPEG _FULL_PROG_HIER_24 26 SYNTAX Description The implicit big endian transfer syntax is not defined by the DICOM standard This value is provided to supply compatibility with private implementations DEFAULT lt none gt The implicit little endian transfer syntax is the default network transfer syntax of the DICOM standard The implicit little endian transfer syntax must always be defined DEFAULT 1 2 840 10008 1 2 This value defines the UID for JPEG 2000 Lossless transfer syntax DEFAULT 1 2 840 10008 1 2 4 90 This value defines the UID for JPEG 2000 Part 2 Multi component Image Compression Lossless Only transfer syntax DEFAULT 1 2 840 10008 1 2 4 92 This value defines the UID for JPEG 2000 Part 2 Multi component Image Compression transfer syntax DEFAULT 1 2 840 10008 1 2 4 93 This value defines the UID for JPEG 2000 transfer syntax DEFAULT 1 2 840 10008 1 2 4 91 This value defines the UID for JPEG Baseline Process 1 transfer syntax DEFAULT 1 2 840 10008 1 2 4 50 Th
281. ng an existing data set A third form of the constructor creates a new MCdimseMessage object that references an existing MCdataSet object for its data set and constructs a new MCcommandSet object If the data set has not yet been assigned a service and command the setServiceCommand method should be used to do so before using this object to send a message to a network partner or if the validate method is to be called MCdimseMessage dm MCdataSet ds A non null referenc dm new MCdimseMessage ds A common programming technique is to construct an empty MCdataSet object se and use it when setting attribute values see below MCdimseMessage dm MCdataSet ds new MCdataSet empty data set Peformance Tuning dm new MCdimseMessage ds In this case the message info and data dictionary files are not accessed when the MCdataSet object is constructed The MCdataSet object contains no attributes and the setServiceCommand method must be called to set the service and command for this data set before it can be used in a message sent over the network Since this approach avoids accessing the message info files it is more efficient However this approach also penalizes you in terms of runtime error checking This is discussed further later Convert an MCfile object A fourth form of the constructor creates a new MCdimseMessage object that shares the same MCdataSet object as that contained in a specified fi 1e object MC
282. ng of sequences If No attributes with Unknown VR will not be listed by MC_List_Message and T2 logging option DEFAULT Yes Limit the size of listed values by MC_List_Message orT2 logging option This parameter should be set to the maximum number of lines to be printed for any attribute in the list DEFAULT 0 means show the whole value This parameter allows the tracking of the creation referencing and freeing of message file and item objects This option can be used if the user suspects a memory leak in their application from not freeing one of these object types The logging is done at the T1 trace level which must be enabled in the merge ini file DEFAULT NO This parameter specifies the name path of the DICOM message information file An absolute or relative path may be specified DEFAULT mc3msg mrgcom3 msg This parameter specifies how the toolkit will validate a single NULL value in a type 3 attribute with VM gt 1 Valid values are ERR WARN and INFO DEFAULT ERR This parameter specifies the number of bytes of Large Data that should be buffered before they are written to disk This value is only used when the parameter LARGE_DATA_STORE is set to FILE DEFAULT 4096 When using your own Pegasus license to remove the 3 frames second limitation this should have the company name that was used to generate your Pegasus license innovative imaging Merge DICOM Toolkit V 5 1 0 NET C Use
283. ng to Table 21 The class factory is implemented in the MCstructuredReport class and can be updated by calling the following function public void UpdateItemFactory ContentItemType itemType Type classType Note The class factory registration is not global and the registration shall be done per instance of the MCstructuredReport class Encoding SR Documents The creation of the SR document involves following steps 1 Creating a new MCstructuredReport object Adding Content Items nodes to the tree based on the templates definition 2 3 Creating a new dataset 4 Saving SR Content to the dataset 5 Adding Patient Study Series and other attributes required by the IOD definition 6 Saving the result dataset object to a file To create a new SR you need to know the IOD type you are creating and the templates that will be used to generate the SR Document Content innovative maging Merge DICOM Toolkit V 5 1 0 NET C User s Manual Key Object Selection Example The Key Object Selection document is constrained by a single template The following template is taken from the DICOM Part 16 TID 2010 KEY OBJECT SELECTION Type Non Extensible NL Rel with Parent VT Concept Name VM Req Condition Value Set Typ Constraint 1 CONTAI DCID 7010 Key Object NER Selection Document Titles Root node 2 gt HAS CONCEPT MOD CODE EV 113011 DCM d n U Document Title Modifier 3 gt HAS
284. nnovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual Name Section Description T3_MESSAGE MergeCOMS This logging level parameter informs the toolkit to log messages relating to association negotiation T4_MESSAGE MergeCOMs This logging level parameter informs the toolkit to log messages when incoming associations are automatically rejected T5_MESSAGE MergeCOMs This logging level parameter informs the toolkit to log messages relating to regular and extended validation T6_MESSAGE MergeCOMS This logging level parameter informs the toolkit to log messages relating to configuration T7_MESSAGE MergeCOM3 This logging level parameter informs the toolkit to log messages relating to logging of command level attributes in messages sent or received T8_MESSAGE MergeCOMS This logging level parameter informs the toolkit to log messages relating to the streaming in and out of messages and file objects T9_ MESSAGE MergeCOM3 This logging level parameter informs the toolkit to log messages relating to PDU s sent and received NOTE Receipt and transmission of P PDATA PDU s are logged not the actual PDU itself WARNING_MESSAGE MergeCOM3 This parameter informs the toolkit to log warning messages Application Profile The application profile is a configuration file that is application dependent The application profile does not set specific parameters It sets parameters rel
285. ns a special file meta information attribute set the MCfileMetalnfo class and a data set MCdataSet Figure 16 demonstrates the attribute sets contained in DICOM network messages and DICOM file objects innovative Imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual Network Message DICOM file object MCdim seMessage MCfile MCcommandSet MCfileMetalnfo MCdataSet MCdataSet MCattributeS et sub classes MCattributeS et sub classes Figure 16 Attribute Sets Contained in DICOM objects Constructing a new MCfile Instance Several ways to construct The Media Storage Service manipulates MCfile objects There are several i ii options available to construct new instances of the MCfile class As mentioned before each MCfile instance contains an MCdataSet object and an MCfileMetalnfo object The MCfile may be constructed with a pre populated data set or with an empty data set It is important to realize that constructing an MCfile object does not create the physical DICOM file out on the media the write method of the MCmediaStorageService class described later does that Construct an MCfile object with a pre populated data set Populating the file Two forms of the constructor create an MCfile object that contains all of the with a service s attributes attributes of a DICOM file that will be used for the given service and command The attributes are maintained in a MCfileMetalnfo object and an MCdataSet object Norm
286. ntaxList MYSYNS mySynArray Creating Your Own Proposed Context List For each service you want to include in your MCproposedContextList you must have an MCsopClass object You can only get MCsopClass objects for services known to the Toolkit You must either identify the service by its name or you must identify it by its DICOM Unique Identifier UID Valid service names and UIDs are configured in the Service Profile mergecom srv file MCsopClass myServicel MCsopClass getSopClassByName STANDARD_CT MCsopClass myService2 MCsopClass getSopClassByUid 1 2 840 10008 5 1 4 1 1 1 For each service you want to include in your MCproposedContextList you must specify what roles your application is prepared to play for the service Your application may indicate whether it is willing to perform the Service Class User SCU role and or Service Class Provider SCP role It may support either role or both roles If these parameters are not specified the default role of the association requester is SCU only and the default role of the association acceptor is SCP only Now you are ready to create an array of MCproposedContext objects that will be used in your new MCproposedContextList MCproposedContext myCtxArray new MCproposedContext 2 myCtxArray 0 new MCproposedContext myServicel myTSL bool scuRole true scpRole true myCtxArray 1 new MCproposedContext myService2 myTSL scuRole scpRole
287. nvert a DICOM message file or attribute set into a proprietary schema XML string The following displays the basic structure of the XML string Base64 encoding of bulks and attributes with VR UN lt xml version 1 0 encoding utf 8 gt lt DemFile gt lt FileMetaInfo Service STANDARD_SEC_CAPTURE Command C_STORE_RQ gt lt Attribute Tag 00020001 VR 0OB Name File Meta Information Version Length 2 gt AAE lt Attribute gt lt Attribute Tag 00020002 VR UI Name Media Storage SOP Class UID Length 25 gt lt Attribute gt lt Attribute Tag 00020003 VR UI Name Media Storage SOP Instance UID Length 29 gt lt Attribute gt lt Attribute Tag 00020010 VR UI Name Transfer Syntax UID Length 19 gt 1 2 840 10008 1 2 1 lt Attribute gt lt Attribute Tag 00020016 VR AE Name Source Application Entity Title Length 15 gt MERGE_STORE_SCP lt Attribute gt lt FileMetaInfo gt lt DataSet Service STANDARD_SEC_CAPTURE Command C_STORE_RQ TransferSyntax 1 2 840 10008 1 2 1 gt lt Attribute Tag 00080008 VR CS Name Image Type Length 24 gt ORIGINAL SECONDARY OTHER lt Attribute gt lt Attribute Tag 00080016 VR UI Name SOP Class UID Length 25 gt 1 2 840 10008 5 1 4 1 1 7 lt Attribute gt lt Attribute Tag 00080020 VR DA Name Study Date Length 8 gt 20020717 lt Attribute gt lt Attribute T
288. o a user s callback function This option impacts the MC_Message_To_Stream MC_Stream_To_Message MC_Send_Request_Message MC_Send_Request MC_Send_Response_Message MC_Send_Response MC_Read_Message MC_Read_To_Stream MC_Open_File MC_Open_File_Bypass_OBOW MC_Open_File_Upto_Tag MC_Write_File and MC_Write_File_By_Callback functions Setting this option to values larger than 28K will in most cases cause the toolkit to use the operating system s memory management scheme instead of the toolkit s internal mechanism DEFAULT 28K Performance tuning innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 Table 38 TRANSPORT_PARMS section of system profile parameters Name Description CAPTURE_FILE This parameter specifies the base name to use for capture files Capture files are generated if the NETWORK_CAPTURE value is set to Yes If only one capture file is requested see NUMBER_OF_CAP_FILES the capture file will have the name specified If more than one is requested nnn will be appended to the base file name specified e g merge001 cap DEFAULT merge cap in the current directory CAPTURE_FILE_SIZE This parameter specifies the maximum size in kilobytes that capture files are allowed to grow capture files are generated if the NETWORK_CAPTURE value is set to Yes If more than one capture file is requested see NUMBER_OF_CAP_FILES each file ge
289. of lt see cref MCabstractMessage gt lt param gt lt param name response gt DICOM service response encoded as an array of lt see cref MCabstractMessage lt returns gt Returns lt c gt True lt c gt if the operation was successful lt returns gt bool Put MCabstractMessage request MCabstractMessage response lt summary gt Retrieves DICOM service response for given WADO request lt summary gt lt param name request gt WADO request encoded as an array of lt see cref MCabstractMessage gt lt param gt lt param name response gt DICOM service response encoded as an array of lt see cref MCabstractMessage lt returns gt Returns lt c gt True lt c gt if the operation was successful lt returns gt bool Get MCabstractMessage request out MCabstractMessage response Implementing Mergecom WADO interfaces allows to re use Mergecom DICOM Toolkit architecture for DICOM store find and retrieve operations IMCservice and IMCcache methods require MCabstractMessage objects as a request parameter In addition the IMCservice methods have a String xmlRequestParameters parameter which is an XML string encoded from the list of MCrequestParameter for that specific request including both DICOM and non DICOM request parameters The xmlParameters string could be decoded back to the list of MCrequestParameter objects using the static MCrequestParameter method TEnumerable lt MCrequestParameter gt ParseXmlToPa
290. of 255 corresponds to high compression low quality DEFAULT 32 Configuration Parameter for MC_Standard_Compressor When JPEG_2000 with COMPRESSION _WHEN_J2K_USE_LOSSY Yes and COMPRESSION_J2K_LOSSY_USE_QUALITY Yes a quality can be specified Valid values are 1 to 10 1 being highest quality image DEFAULT 1 Configuration Parameter for MC_Standard_Compressor When JPEG_2000 with COMPRESSION_WHEN_J2K_USE_LOSSY Yes and COMPRESSION_J2K_LOSSY_USE_ QUALITY No a ratio can be specified The compressor attempts to reduce the image size to 1 COMPRESSION_J2K_LOSSY_RATIO DEFAULT 10 Configuration Parameter for MC_Standard_Compressor When JPEG_2000 with COMPRESSION_WHEN_J2K_USE_LOSSY Yes this indicates which metric should be used for lossy compression ratio or quality DEFAULT YES Configuration Parameter for MC_Standard_Compressor Values 0 through 255 0 is the highest quality giving a quantization table of all 1 s 32 corresponds to the standard quantization tables For values between 0 and 128 the standard tables are scaled linearly For values between 128 and 255 the standard tables are scaled non linearly and the compression increases and the quality decreases by a very large amount DEFAULT 32 innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual COMPRESSION_RGB_TRANSFORM_FORMAT COMPRESSION_USE_HEADER_QUERY COMPRESSION_WHEN_J2K_USE_LOSSY CREATE_
291. of a DICOMDIR file has a special structure that is described in Part 3 PS 3 3 of the DICOM Standard We described the this structure earlier in this document see Figure 8 on page 38 as a hierarchy of directory records where each directory record may contain a set of related directory records These directory records can have a one to one relationship to a DICOM file within the file set described by the DICOMDIR Directory records do not have to reference a DICOM file they can be used solely to contain information that helps an application navigate down the directory hierarchy to locate the desired DICOM file As an example the Root directory record might contain two Patient directory records and a Topic directory record One of the Patient directory records references multiple Series records and a Film Session record for that Patient Each of these Series records reference Image records for that patient It is these Image records that reference the DICOM file containing the image objects acquired for the Patient whose directory hierarchy we have traversed See above on page 39 for a description of the allowed entity hierarchies This directory record hierarchy is encoded within the DICOMDIR as a single potentially very complex sequence of items where each item is a directory record Byte offset attributes within the directory records are used to point to other directory records at the same level in the hierarchy as well as lower level direc
292. of seconds to wait in between packets of data received over the network after the initial packet of data in a message is received Used by the MC_Read_Message and MC_Read_To_Stream functions DEFAULT 15 innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual Description INSURE_EVEN_UID_LENGTH Set to NO if odd length UIDs in PDU s should NOT be padded with a NULL to ensure even length unique Ids Set to YES to ensure even UIDs in PDUs DEFAULT NO RELEASE_TIMEOUT The number of seconds to wait for a reply to an associate release DEFAULT 15 The number of seconds to wait for a network write to be accepted DEFAULT 15 These options allow for non standard DICOM operations Such exceptions if used should be noted in your DICOM conformance statement innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 Table 36 MEDIA_PARMS section of system profile parameters Description DICOMDIR_STREAM STORAGE When set to yes DICOMDIRs read in leave their directory records internally in stream format and are not parsed until the directory record is referenced This can greatly reduce memory usage when reading in large DICOMDIRs when the entire DICOMDIR is not referenced Default NO EXPORT_GROUP_LENGTHS_TO_MEDIA When set to NO do not write group length attributes with MC_Write_File and MC_Write_File_By_Callback DEFAULT YES EXPORT_PRI
293. of the transfer syntax being written may be different than the endian of the system being used there may be a need for byte swapping of the pixel data in this implementation There is a potential risk with this implementation Although the data elements after the pixel data in the current definition of the DICOM image types are not widely used future versions may add data elements that will get wider acceptance among implementors DICOM Structured Reporting The Merge DICOM Toolkit provides high level functionality to handle DICOM Structured Report SR Documents This functionality provides a simple way for encoding and decoding SR Document content by manipulating content items and their attributes instead of tags and values Structured Report Structure and Modules The DICOM standard Part 3 defines the following generic types of SR Information Object Definitions IODs innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual e Basic Text SR Information Object Definition The Basic Text Structured Report SR IOD is intended for the representation of reports with minimal usage of coded entries typically used in Document Title and headings and a hierarchical tree of headings under which may appear text and subheadings Reference to SOP Instances e g images or waveforms or other SR Documents is restricted to appear at the level of the leaves of this primarily textual tree This structure simplifies the en
294. olkit V 5 1 0 defaults new controller MCcontroller MCWADORSCONTROLLER action bulkdata 3 config Routes MapHttpRoute name MCwadoRsStudy routeTemplate api controller studies studyInstanceUid defaults new controller MCcontroller MCWADORSCONTROLLER action study 3 config Routes MapHttpRoute name MCwadoRsMetaData routeTemplate api controller studies studyInstanceUid metadata defaults new controller MCcontroller MCWADORSCONTROLLER action 3 metadata config Routes MapHttpRoute name MCwadoRsSeries routeTemplate api controller studies studyInstanceUid series seriesInstanceUid defaults new controller MCcontroller MCWADORSCONTROLLER action series 3 config Routes MapHttpRoute name MCwadoRsInstance routeTemplate api controller studies studyInstanceUid series seriesInstanceUid instances sopInstanceUid defaults new controller MCcontroller MCWADORSCONTROLLER action instance 3 config Routes MapHttpRoute name MCwadoRsFrames routeTemplate api controller studies studyInstanceUid series seriesInstanceUid instances sopInstanceUid frames FrameList defaults new controller MCcontroller MCWADORSCONTROLLER action frames 3 config Routes MapHttpRoute name MCwadoRsGet routeTemplate api controller wadors defaults new controller MCcontroller MCWADORSCONT
295. olkit V 5 1 0 NET C User s Manual Library Initialization Before anything else Your first call to the Assembly should be the static melnitialization method of the MC class Using the library without an explicit initialization results in automatic initialization using the default configuration The melnitialization method provides the location of the Initialization File merge ini and allows Merge DICOM to perform essential startup tasks FileInfo mergeIniFile new FileInfo Path to merge ini try MC mcInitialization mergelIniFile catch MCalreadyInitializedException e catch MCinvalidLicenseInfoError e catch MCruntimeException e DLL Not Found The melnitialization method allows the Toolkit to perform the following critical processing The dynamic library First the Merge DICOM C C toolkit dynamic link library Mergecom Native dll Is loaded is loaded The NET CLR searches for the library using the platform s normal search path If the library cannot be located an MCruntimeException exception will be thrown Configuration files located After the dynamic library is loaded the C toolkit is initialized If an error occurs during initialization the MCnotInitializedError exception is returned This may include errors accessing the Merge DICOM Data Dictionary or Message info files This could happen if you have not specified or incorrectly specified the DICTIONARY_FILE or MSG
296. ollege of Radiology ACR and the National Electrical Manufacturers Association NEMA to facilitate the open exchange of information between digital imaging computer systems in medical environments Since its initial completion in 1993 the standard has taken hold More and more products are advertising DICOM conformance and more customers are requiring it DICOM has also been incorporated as part of a developing European standard by CEN as a Japanese standard by JIRA and is increasingly becoming an International Standard DICOM Version 3 0 is composed of several hundreds of pages over sixteen separate parts Each part of the standard focuses on a different aspect of the DICOM protocol Part 1 Introduction and Overview Part 2 Conformance Part 3 Information Object Definitions Part 4 Service Class Specifications Part 5 Data Structures and Encoding Part 6 Data Dictionary Part 7 Message Exchange Part 8 Network Communication Support for Message Exchange Part 9 Point to Point Communication Support for Message Exchange retired Part 10 Common Media Storage Functions for Data Interchange NEMA Standards Publication No PS 3 5 1993 DICOM Part 5 Data Structures and Encoding p 4 innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 A quick walk through DICOM Part 11 Media Storage Application Profiles Part 12 Media Formats and Physical Media for Data Interchange Part 13
297. ommand group attributes as possible automatically In some services your application may need to set command set attributes if you do not use one of the sub classes of the MCdimseService class An excerpt of message txt follows for the service command pair DETACHED_PATIENT_MANAGEMENT N_GET_RSP as an illustration For each attribute in the message at least one line of data is specified This first line includes the tag attribute name value representation and value type Additional lines may be included for the attribute to list conditions enumerated values defined terms and item names for attributes with a VR of SQ You should refer to the DICOM Standard parts 3 and 4 for a detailed description of particular conditions and their meanings innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual DETACHED_PATIENT_MANAGEMENT N_GET_RSP 0008 0005 Specific Character set CS LC Condition EXPANDED_OR_REPLACEMENT_CHARACTER_SET_USED Defined Terms ISO IR 100 ISO IR 101 ISO IR 109 ISO IR 110 ISO IR144 ISO IR 127 ISO IR 126 ISO IR 138 ISO IR 148 0008 1110 Referenced Study Sequence SQ 2 Item Name s REF_STUDY 0008 1125 Referenced Visit Sequence SQ 2 Item Name s 0010 0010 Patient s Name PN 2 0010 0020 Patient IDLO2 0010 0021 Issuer of Patient ID LO 3 0010 0030 Patient s Birth Date DA 2 0010 0
298. on When reading messages or file objects this parameter specifies if private attributes encoded in an invalid format should be ignored or parsed DEFAULT NO When reading messages or file objects this parameter specifies if private creator codes encoded with invalid characters should be ignored or parsed DEFAULT NO In the 2014b edition of the DICOM Standard the value representation of attribute 0008 1190 Retrieve URL was changed from UT to the newly introduced UR For backward compatibility this parameter specifies that when reading messages or file objects the attribute is expected to have the old UT value representation DEFAULT NO In the 2014b edition of the DICOM Standard the value representation of attribute 0028 7FE0 Pixel Data Provider URL was changed from UT to the newly introduced UR For backward compatibility this parameter specifies that when reading messages or file objects the attribute is expected to have the old UT value representation DEFAULT NO In the 2014b edition of the DICOM Standard the value representation of attribute 0040 E010 Retrieve URI was changed from UT to the newly introduced UR For backward compatibility this parameter specifies that when reading messages or file objects the attribute is expected to have the old UT value representation DEFAULT NO In the 2014b edition of the DICOM Standard the value representation of attribute 0074 100A Contact URI was changed
299. on entity through file system calls because they are file system dependent operations File Management Roles DICOM AE s that that perform file interchange functionality are in turn classified into three roles File Set Creator FSC uses M WRITE operations to create a DICOMDIR file and one or more DICOM files File Set Reader FSR uses M READ operations to access one or more files in a DICOM file set An FSR shall not modify any files of the file set including the DICOMDIR file File Set Updater FSU performs M READ M WRITE and M DELETE operations It reads but shall not modify the content of any DICOM files other than the DICOMDIR file It may create additional files by means of an M WRITE or delete existing files by means of an M DELETE The concept of these roles is used within the DICOM conformance statement of an application entity that supports media interchange to more precisely express the capabilities of the implementation Conforming applications shall support one of the capability sets specified in Table 8 DICOM conformance is described in greater detail in the next section innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 Table 8 Media Application Operations and Roles Media Roles M WRITE M READ M DELETE M INQUIRE M INQUIRE FILE SET FILE not required Mandatory Mandatory Mandatory Mandatory FSU Fsu o Mandatory Mandatory Mandatory Mandatory Mandatory Mandator
300. on is thrown Merge DICOM will make no further calls for this instance of the attribute public void receiveMediaDataLength MCattributeSet attribSet MCtag tag uint dataLength uint dataOffset if anyProblemOccurs throw new MCcallbackCannotComplyException Perhaps save the dataOffset and dataLength so they can be used later to access the data Registering Your MCattributeContainer How to register an Each Application Entity registers its own MCattributeContainer objects The MCattributeContainer object MCapplication class registerAttributeContainer method is used to r gisterAttributecontainer register an MCattributeContainer object to be used with the Application Entity MCapplication myApp a non null referenc MyContainer myContainer new MyContainer MCattributeContainer oldContainer oldContainer myApp registerAttributeContainer new MCtag MCdicom PIXEL_DATA myContainer This call registers myContainer an instance of the MyContainer class which must implement the MCattributeContainer interface myContainer will handle the pixel data 7FE0 0010 attribute for myApp A single MCattributeContainer object can be multiply registered to handle many tags Also a single MCattributeContainer object will handle both transmittal and reception of the data associated with the tag s If the return value is nu11 you know that there was not a previously registered attribute container for the attribute
301. operations which may lead to crashes DEFAULT No If set to NO existing item IDs will not be freed when setting a null value or an empty value or a new value to a sequence attribute Setting it to YES will allow sequence items that have no other references to be freed DEFAULT No When set to Yes Merge DICOM Toolkit will remove space padding characters from all text based attributes This removal will occur when the attribute is encoded with one of the Mc_Set_Value functions or when the attribute is read with one of the streaming or network read functions DEFAULT No If set to YES the toolkit will strip a single trailing padding space character from an attribute value of string type Otherwise it will not DEFAULT YES innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 RETURN_COMMA_IN DS FL _FD_STRINGS TEMP_FILE_ DIRECTORY TOLERATE_INVALID_IN_DEFAULT_CHARSET UPDATE_GROUP_0028 ON DUPLICATE USE_FREE_DATA_CALLBACK Description When set to Yes Merge DICOM Toolkit will return a comma character as a decimal separator in a value when MC_Get_Value_To_String is called for an attribute with a VR of DS FL or FD When set to No a period will always be returned for the decimal separator Note that DS values will always be properly encoded with a period in DICOM message objects DEFAULT No This parameter specifies the directory in which temporary files should be created Th
302. ord Values frames parms Add new MCrequestParameter Name keyword RequestRequirement MCrequestParameter Requirements REQUIRED Attributes new List lt MCrequestAttribute gt attr 3 3 return new MCrequest request MCrequestType WadoRS parms ToArray lt MCrequestParameter gt Submit lt summary gt Http Get method lt summary gt innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual lt param name request gt lt see cref HttpRequestMessage gt object lt param gt lt param name uri gt URI for bulk data lt param gt lt returns gt lt see cref HttpResponseMessage gt object lt returns gt ActionName bulkdata public HttpResponseMessage Get HttpRequestMessage request Uri uri List lt MCrequestParameter gt parms new List lt MCrequestParameter gt MCrequestParameter parm new MCrequestParameter Name bulkdata RequestRequirement MCrequestParameter Requirements REQUIRED Values new string uri OriginalString 33 parms Add parm return new MCrequest request MCrequestType WadoRS parms ToArray lt MCrequestParameter gt Submit lt summary gt Http Get method lt summary gt lt param name request gt lt see cref HttpRequestMessage gt object lt param gt lt param name studyInstanceUid gt StudyInstanceUID parameter lt param gt lt param name metadata gt Metadata parameter might be null
303. ormance Before modifying any parameters such as time out be sure to have a backup of the originally supplied mergecom pro file Also before modifying other parameters you should consider contacting Merge Healthcare for advice innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 PDU size The maximum PDU size is configurable with a minimum of 4 096 bytes Application conformance statements specify the chosen PDU Protocol Data Units size and any general rules governing the initiation of associations Please see the System Profile section of the Merge DICOM Reference Manual for further information about configuring the PDU size Extensions Specializations Privatizations Standard Extended Specialized Private SOPs Application conformance statements list extended specialized or private SOPs that are supported Private Transfer Syntaxes This section describes private transfer syntaxes that are listed in the Transfer Syntax Tables See the System Profile section in Appendix B Configuration Parameters for details innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual Appendix D Configuration Parameters This appendix describes each configuration parameter in detail Information contained in these tables is the parameter names descriptions and sections where it is contained The parameters are listed alphabetically and organized by the initialization file w
304. ot want to generate such an attribute specify NO DEFAULT NO SEND_RESPONSE_PRIORITY The DICOM standard has retired the message priority attribute in response messages To generate such an attribute in response messages specify YES To NOT use message priority in response messages specify NO DEFAULT NO SEND_SOP_CLASS_UID Certain DICOM service classes demand that the affected SOP class UID be present in the message To prevent the library from ensuring that this is done specify NO To ensure that Affected SOP class UID is present specify YES DEFAULT YES SEND_SOP_INSTANCE_UID Certain DICOM service classes demand that the affected SOP instance UID be present in the message To prevent the library from ensuring that this is done specify NO To ensure that Affected SOP instance UID is present specify YES DEFAULT YES These options allow for non standard DICOM operations Such exceptions if used should be noted in your DICOM conformance statement Table 35 DUL_PARMS section of system profile parameters Name Description ARTIM_TIMEOUT The number of seconds to use as a time out waiting for an association request or waiting for the peer to shut down an association DEFAULT 30 ASSOC_REPLY_TIMEOUT The number of seconds to wait for a reply to an associate request DEFAULT 15 CONNECT_TIMEOUT The number of seconds to wait for a network connect to be accepted DEFAULT 15 INACTIVITY_TIMEOUT The number
305. otComplyException the library will fail its current operation Supplying Pixel Data a block at a time is especially useful for very large Pixel Data and or on platforms with resource e g memory limitations In this case you would also want to set LARGE_DATA_STORE to the value FILE in the Service Profile and Merge DICOM Toolkit will store the Pixel Data value in a temporary file It is recommended that you re use the same buffer in provideData to reduce memory consumption before garbage collection is due Also keeping the previous data supplied to the toolkit allows user to control the prompt disposal of the data as shown in the example above After the pixel data has been streamed out it is recommended that you dispose MyPDSupplyCallback object using Dispose method to release the last MCdata object With this callback mechanism the memory usage in both native and managed code can be minimized for large pixel data If your application runs on a resource rich system you should set LARGE_DATA_STORE to the value MEM in the Service Profile and Merge DICOM Toolkit will keep the Pixel Data values in the message object stored in memory rather than using temporary files This should improve performance Also in this case you may want your callback class to supply the Pixel Data in fewer big blocks or one large block Merge DICOM provides several implementations to the MCdataSource interface The MCfileDataSource class implements a
306. pedagogical reasons but you should refer to the DICOM Standard for the most up to date and accurate specification Table 6 Allowed Directory Entity Directory Record Type Record Types which may be included in the next lower level Directory Entity Root Directory Entity PATIENT TOPIC PRINT QUEUE HANGING PROTOCOL PRIVATE PATIENT STUDY PRIVATE STUDY SERIES VISIT RESULTS STUDY COMPONENT FILM SESSION PRIVATE SERIES IMAGE STORED PRINT RT DOSE RT STRUCTURE SET RT PLAN RT TREAT RECORD OVERLAY MODALITY LUT VOI LUT CURVE SR DOCUMENT PRESENTATION KEY OBJECT DOC SPECTROSCOPY RAW DATA WAVEFORM REGISTRATION FIDUCIAL VALUE MAP ENCAP DOC PRIVATE HANGING PROTOCOL PRIVATE IMAGE PRIVATE STORED PRINT PRIVATE RT DOSE PRIVATE RT STRUCTURE SET PRIVATE RT PLAN PRIVATE RT TREAT RECORD PRIVATE OVERLAY PRIVATE MODALITY LUT PRIVATE VOI LUT PRIVATE CURVE PRIVATE innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 Directory Record Type Record Types which may be included in the next lower level Directory Entity SR DOCUMENT PRIVATE PRESENTATION PRIVATE KEY OBJECT DOC PRIVATE SPECTROSCOPY PRIVATE RAW DATA PRIVATE WAVEFORM PRIVATE REGISTRATION PRIVATE FIDUCIAL PRIVATE VALUE MAP PRIVATE ENCAP DOC PRIVATE TOPIC STUDY SERIES IMAGE OVERLAY MODALITY LUT VOI LUT CURVE FILM SESSION PRIVATE VISIT PRIVATE RESULTS INTERPRETATION PRIVATE INTERPRETATION PRIVATE
307. perations property gets or sets that value from attribute 0000 1021 ErrorComment Many DIMSE services provide for a field to be returned in response messages that describes an error that may occur while servicing a DIMSE request The ErrorComment property sets or gets that field from the command set attribute 0000 0902 Usually the use of this attribute is optional Errorld Certain DIMSE services provide for sending an application specific error code in response messages The ErrorId property sets or gets that value from the 0000 0903 attribute in the command set Normalized DICOM service classes reference events that are identified by application specific event IDs The Event Typeld property sets or gets the Event Type ID from the command set for attribute 0000 1002 EventTypeld The DIMSE services that use C GET or C MOVE operations place the number of C STORE sub operations that failed in their response messages The FailedSubOperations property gets or sets that value from attribute 0000 1022 FailedSubOperations Messageld The DIMSE service provider for example Merge DICOM Toolkit assigns a number to each DIMSE request message The MessageId property sets or gets that identifying number from the command set attribute 0000 0110 MessageldBeingRespondedto DIMSE response messages set an attribute in the command set that identifies which request message is being responded to The MessageIdBeingRespondedTo property gets tha
308. plies a method to allow the user to manage image data through the use of registered callback methods The MCapplication class registerAttributeContainer method associates a callback class with a DICOM attribute such as pixel data These callbacks are limited to attributes with the value representations of OB OW OD or OF When encountered the attribute s data is passed to a method of the registered callback class instead of being stored within Merge DICOM Toolkit The callback is also used to supply the attribute s data The size of data elements to use in callbacks can also be specified The CALLBACK_MIN_DATA_SI1ZE configuration option can specify the minimum size or length required for the use of a registered callback class There are three models in which registerAttributeContainer canbe used First it can be used to seamlessly replace Merge DICOM Toolkit s memory management functions Use of this method can for the most part be innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual hidden from the application Secondly the method can be used as an interface to receive or supply data only when it is needed When writing a network application the image data can be supplied to the user directly as it is read off the network The data can also be supplied when it is about to be written to the network This functionality can also be used when creating and reading DICOM files Finally registerAttributeContainer c
309. ponseMessage gt object lt returns gt HttpPost public HttpResponseMessage Post HttpRequestMessage request lt summary gt Http Get method lt summary gt lt param name request gt lt see cref MCrequest gt oject lt param gt lt returns gt lt see cref HttpResponseMessage gt object lt returns gt ActionName bind public HttpResponseMessage Post ModelBinder typeof MCrequestBinder MCrequest request Name MCcontroller MCWADOWSCONTROLLER return new MCrequest request MCrequestType WadoWS Submit return request Submit MCwadoWsController URI route templates HttpConfiguration config new HttpConfiguration config Routes MapHttpRoute name MCwadoWsRoute routeTemplate api controller wadows defaults new controller MCcontroller MCWADOWSCONTROLLER action post 3 config Routes MapHttpRoute name MCwadoWsBind routeTemplate api controller action wadows defaults new controller MCcontroller MCWADOWSCONTROLLER action bind 3 config Services Add typeof ModelBinderProvider new MCrequestBinderProvider MCqidoController using System using System Collections Generic using System Ling using System Net Http using System Text using System Threading Tasks using System Web Http using System Web Http ModelBinding using Mergecom using Mergecomws Dicom namespace Mergecomws Web lt summary
310. pplication Profile mc3list Display Message Contents mc3list displays the contents of binary DICOM message files in an easy to read manner The message files could have been generated by mc3file see below or written out by your application mc3list is a useful educational tool as well as a tool that can be used for off line display of the DICOM messages your application generates or receives The command syntax follows mc3list lt filename gt t lt syntax gt m filename Filename containing message to display t Specify transfer syntax of message where syntax il implicit little endian el explicit little endian or eb explicit big endian m Optional display a DICOM file object If the DICOM service and or command cannot be found in the message file a warning will be displayed but the message will still be listed The default transfer syntax is implicit little endian the DICOM default transfer syntax If the transfer syntax is incorrectly specified the message will not be displayed correctly innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual mc3valid DICOM Message The mc3valid utility validates binary message files according to the DICOM Validation tool standard and notifies you of missing attributes improper data types illegal values and other problems with a message mc3valid is a powerful educational and validation tool that can b
311. procedures and the advancement of storage media and file system technology Part 10 should remain quite stable since it specifies file formats independent of medical application or storage technology Part 13 details a point to point protocol for doing print management services This part has been retired from the DICOM standard Part 14 specifies a standardized display function for display of grayscale images Part 15 specifies Security Profiles to which implementations may claim conformance Profiles are defined for secure network transfers and secure media Part 16 specifies the DICOM Content Mapping Resource DCMR which defines the templates and context groups used elsewhere in the standard Part 17 consolidates informative information previously contained in other parts of the standard It is composed of several annexes describing the use of the standard Part 18 specifies a web based service for accessing and presenting DICOM persistent objects e g images medical imaging reports Part 19 defines an API such that a plug in Hosted Application written to the API would be able run in any environment provided by a Hosting System implementing the API Part 20 specifies transformations of DICOM data to and from HL7 standards Figure 1 maps portions of the DICOM Standard dealing with networking to the ISO Open Systems Interconnection OSI basic reference model The organization and terminology of the DICOM Standard correspond
312. pths supported by the standard compressor and decompressor for this transfer syntax Table 19 JPEG 2000 Lossless Supported Photometric Interpretations and Bit Depths JPEG 2000 Lossless Photometric MONOCHROME 1 ma RC RGB Interpretation MONOCHROME2 Oc ama e fefe fee When using the standard compressor all data needs to be right justified i e bit O contains data but the highest bits may not RGB and YBR must be non planar R1G1B1 R2G2B2 or Y1Y2B1R1 Y3Y4B3R3 MCtransferSyntax Jpeg2000 and MCtransferSyntax Jpeg2000LosslessOnly will cause a irreversible or reversible color transformation when compressing RGB data The Photometric Interpretation MUST be changed from RGB to e YBR_ICT if MCtransferSyntax Jpeg2000 is used with COMPRESSION_WHEN_J2K_USE_LOSSY Yes Lossy color transform for lossy compression e YBR_RCT if MCtransferSyntax Jpeg2000LosslessOnly or MCtransferSyntax Jpeg2000 with COMPRESSION_WHEN_J2K_USE_LOSSY No Lossless color transform for lossless compression innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 Similarly on the decompression end the Photometric Interpretation should be changed back to RGB but the Lossy Image Compression attribute should indicate it has been lossy compressed Validating Attribute Sets You can validate MCdimseMessage Once your application has a populated message object either one that you have MCfile and MCdataSet b
313. ptions are being thrown by the MCattributeSet attribute encoding methods This code worked before the upgrade What is causing these problems The Merge DICOM data dictionary changes from release to release In some cases the identification number for a particular message type changes When upgrading if you do not change all of the data dictionary files this error will occur The following files should be upgraded with each release mergecom srv mrgcom3 msg mrgcom3 dct innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual Appendix B Unique Identifiers UIDs UIDs provide the capability to identify many different types of items The purpose of UIDs are to guarantee the uniqueness of the these different types of items DICOM uses UIDs to uniquely identify items such as SOP classes image instances and network negotiation parameters Part 5 Section 9 along with Annexes B and C of the DICOM Standard discusses how UIDs are composed encoded and registered Summary of UID Composition A UID is composed of a number of numeric values as defined by ISO 8824 The following is a typical example of a UID 1 2 840 10008 2 45 1 12345 A UID is composed of two parts a lt root gt and a lt suffix gt and has the following form UID lt root gt lt suffix gt where lt root gt is assigned by a registration authority e g ANSI with the distinguishing component being the organization ID The lt root
314. quires a provideData method that retrieves the stream data a block at a time and returns it to the Merge DICOM library This call converts only the attributes in group 0008 of the stream supplied by your MyStreamHandler callback class and places them in the message identified by msg It is important that the transfer syntax specified in this call is identical to that used to create the stream or the call will fail with an error The same kind of performance issues apply in the callback classes discussed when retrieving pixel data Namely your settings of LARGE_DATA_STORE and OBOW_BUFFER_SIZE should take into consideration the capabilities of your platform Message streams can be very valuable to your application for debugging and validation purposes By writing DICOM message streams out to a binary file you have a compact and reproducible representation of a message You can directly examine the binary message stream to see how the data would be sent over the network Also you can read this binary file in again later to reconstruct the original message object Once you have the message object you can use the usual toolkit methods to examine or alter its contents innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual Message to Proprietary Schema XML Conversion Converting message data to an XML string The MCabstractMessage provides a writeTOXML method which can be utilized to convert its derived classes MCfile a
315. r s Manual PEGASUS_DISP_REGISTRATION PEGASUS_OP_ _NAME PEGASUS_OP_ _REGISTRATION PEGASUS_OPCODE_PATH REJECT_INVALID_VR RELEASE_SQ_ ITEMS REMOVE_PADDING_CHARS REMOVE_SINGLE_TRAILING_SPACE Description When using your own Pegasus license to remove the 3 frames second limitation this should have the registration code that goes with the Pegasus dispatcher When using your own Pegasus license to remove the 3 frames second limitation this should have the company name that was used to generate your Pegasus license When using your own Pegasus license to remove the 3 frames second limitation this should have the registration code that goes with its respective PEGASUS_OP_ _NAME This parameter specifies the directory where Pegasus opcode DLLs are to be loaded from The opcode DLL refers to files like picn6220 and not the dispatcher DLL picn20 If the option is empty the SSM DLL is loaded from the same directory as the dispatcher DLL If these files are not found opcode SSM DLL is loaded using the directory order Windows uses when loading DLLs The SSM DLL is loaded from the current directory if is specified DEFAULT empty This parameter specifies whether or not to reject invalid VR values in DICOM messages If set to Yes the parsing is aborted and the data set is rejected with a status of MC_INVALID_VR This is useful in some scenarios when invalid attribute VR and length can result in runaway read copy
316. r try tag new MCtag 0x0008 0x0010 catch MCillegalArgumentException e The group and element numbers may be specified as two unsigned integers An MCillegalArgumentException will be thrown if the group number portion of the tag number is odd Private Tags Constructing private tags Tags for private attributes are constructed by providing a private group code string in addition to the private group number and element number MCtag tag try tag new MCtag Groupl uint 0x0009 uint 0x10 catch MCillegalArgumentException e or try tag new MCtag 0x00091010U Groupi catch MCillegalArgumentException e The numbers may be specified as two unsigned integers An MCillegalArgumentException will be thrown if the group number was an even number if the element number was greater than OxFF or if the private group code string was empty Using the MCdataElement class MCdataElement The MCdataElement class is used to define DICOM data elements This is most often used to define data elements that are not defined in the data dictionary DICOM data elements may be standard i e they are defined in the data dictionary or non standard those not defined in the data dictionary Merge DICOM allows you to define both private and non private data elements by simply using a private or non private MCtag object to identify the data element Constructing standard data elem
317. r gt string keyword MCwado DicomKeywords MCdicom STUDY_INSTANCE_UID MCrequestAttribute attr new MCrequestAttribute Item keyword Tag MCdicom STUDY_INSTANCE_UID Keyword keyword Values new string studyInstanceUid parms Add new MCrequestParameter Name keyword RequestRequirement MCrequestParameter Requirements REQUIRED Attributes new List lt MCrequestAttribute gt attr H keyword MCwado DicomKeywords MCdicom SERIES_INSTANCE_UID attr new MCrequestAttribute Item keyword Tag MCdicom SERIES_INSTANCE_UID Keyword keyword Values new string seriesInstanceUid parms Add new MCrequestParameter Name keyword RequestRequirement MCrequestParameter Requirements REQUIRED Attributes new List lt MCrequestAttribute gt attr H keyword MCwado DicomKeywords MCdicom SOP_INSTANCE_UID attr new MCrequestAttribute Item keyword Tag MCdicom SOP_INSTANCE_UID Keyword keyword Values new string sopInstanceUid parms Add new MCrequestParameter Name keyword RequestRequirement MCrequestParameter Requirements REQUIRED Attributes new List lt MCrequestAttribute gt attr H keyword MCwado DicomKeywords MCdicom SIMPLE_FRAME_LIST string frames String IsNullOrEmpty frameList frameList Split new char null attr new MCrequestAttribute Item keyword Tag MCdicom SIMPLE_FRAME_LIST Keyword keyw
318. r revisions of an application entity These configuration values are used during association negotiation by Merge DICOM and are intended to aid in tracking versions of applications in the field The ACCEPT_MULTIPLE_PRES_CONTEXTS configuration value is used by server SCP applications This value determines if multiple presentation contexts can be negotiated for a single DICOM Service This option is discussed below As mentioned earlier a listen port must be identified for your server AE Port 104 is the standard DICOM listen port This along with the number of simultaneous TCP connection requests that can be queued up for acceptance pending for Merge DICOM toolkit is specified in the TRANSPORT_PARMS section The MAX_PENDING_CONNECTIONS setting in the mergecom pro file refers to the maximum number of outstanding connection requests per listener socket The value of this configuration is passed by the toolkit to the listen call on the socket as the backlog parameter and it specifies how many pending connections can be queued at any given time The MAX_PENDING_CONNECTIONS configuration option affects the accepting of associations but not the requesting of associations and it affects the behavior at the TCP level In the default case if more than five association requests arrive at innovative imaging NET C User s Manual Merge DICOM Toolkit v 5 1 0 Dealing with large data Performance Tunin
319. r this buffer generally will increase the network performance of the toolkit for client SCU applications This value should also be slightly larger than the PDU_MAXIMUM_LENGTH to increase performance Setting this value to an even multiple of the MSS 1460 bytes will help increase performance on most platforms innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 5 Which of the options listed above have the greatest impact on network performance The TCPIP_RECEIVE_BUFFER_SIZE and TCPIP_SEND_BUFFER_SIZE configuration options have the greatest impact on network performance Setting these properly directly increases the network performance of Merge DICOM Toolkit 6 lam sending 8 bit images with Merge DICOM Toolkit however after sending the data to another system the pixel data is byte swapped incorrectly What is causing this problem The Merge DICOM Toolkit Users Manual contains the section 8 bit Pixel Data page 114 which describes this problem This is typically only a problem on Big Endian machines To summarize the problem on big endian machines we expect 8 bit data to be byte swapped We do not look at the bits allocated and bits stored tags to determine that the pixel data itself is 8 bit data we always treat pixel data 7fe0 0010 as OW The pixel data must be assigned as byte swapped 7 recently upgraded to a new release of the Merge DICOM Toolkit Since this upgrade exce
320. rackets Value Multiplicity VM The VM field indicates the number of times that a Content Item of the specified pattern or an included Template may appear in this position Table 24 specifies the values that are permitted in this field Table 24 Permitted Values for VM Expression Definition i where i represents Exactly i occurrences where i gt 1 e g when i 1 there shall be an integer one occurrence of the Content Item in this position From i to j occurrences where i and j are gt 1 and j gt i One or more occurrences Requirement Type The Requirement Type field specifies the requirements on the presence or absence of the Content Item or included Template The following symbols are used e M Mandatory Shall be present e MC Mandatory Conditional Shall be present if the specified condition is satisfied e U User Option May or may not be present e UC User Option Conditional May not be present May be present according to the specified condition Condition The Condition field specifies any conditions upon which presence or absence of the Content Item or its values depends This field specifies any Concept Name s or Values upon which there are dependencies References may also be made to row numbers e g to specify exclusive OR conditions that span multiple rows of a Template table innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0
321. rage C STORE Encapsulated PDF Storage C STORE Enhanced CT Image Storage C STORE Enhanced MR Color Image Storage C STORE Enhanced MR Image Storage C STORE Enhanced PET Image Storage C STORE Enhanced Structured Reporting C STORE Enhanced US Volume Storage C STORE Enhanced XA Image Storage C STORE Enhanced XRF Image Storage C STORE General Audio Waveform Storage C STORE General ECG Waveform Storage C STORE Generic implant Template Storage C STORE Grayscale Softcopy Presentation State Storage C STORE Hanging Protocol Storage C STORE Hemodynamic Waveform Storage C STORE Implant Assembly Template Storage C STORE Implant Template Group Storage C STORE Implantation Plan SR Document Storage C STORE Intraocular Lens Calculations Storage C STORE Intravascular Optical Coherence Tomography Image Storage C STORE For Presentation Intravascular Optical Coherence Tomography Image Storage C STORE For Processing Keratometry Measurements Storage C STORE Key Object Selection C STORE Lensometry Measurements Storage C STORE innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual Service Macular Grid Thickness and Volume Report Mammography CAD SR Media Storage Directory Storage MR Image Storage MR Spectroscopy Storage Multi frame Grayscale Byte Secondary Capture Image Storage Multi frame Grayscale Word Secondary Capture Image Storage Multi frame Single Bit Secondary Capture Image Storage Multi frame True
322. rameters String xml DICOM service response is represented by an array of MCabstractMessage objects and xmlResponseParameters String which is used if necessary to describe the list of MCrequestParameter returned for that specific service response innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual The user is advised to look into the Mergecom WADO framework samples code as an examples of DICOM client and service implementation Using MCdicomResponse Class MCdicomResponse encapsulates the results of the service response and converts itinto an HttpResponseMessage sent to Http client On service response Mergecom WADO framework instantiates an MCdicomResponse object using a public static method MCdicomResponse CreateInstance MCrequestType type MCabstractMessage response string xmlRequestParameters string xmlResponseParameters where the parameters are MCrequestType DICOM service response messages xmlRequestParameters string and xmlResponseParameters string To create the HttpResponseMessage object MCdicomResponse exposes the public method HttpResponseMessage GetHttpResponseMessage which renders the DICOM service data and converts the rendered data into a HttpResponseMessage object using the methods of IMCdicomRenderer and IMChttpConverter interfaces The following figure shows the corrsponding workflow implemented in Mergecom WADO framework HttpClient iMCservice DICOM query
323. ransfer syntaxes are specified in a transfer syntax list dictates the priority Merge DICOM places on them during association negotiation In this case Merge DICOM would select JPEG_BASELINE if proposed followed by EXPLICIT_LITTLE_ENDIAN IMPLICIT_LITTLE_ENDIAN and EXPLICIT_BIG_ENDIAN Network message exchange is discussed further in one of the following sections Merge DICOM Message Classes Before we discuss the process of transferring messages we must discuss some basic Merge DICOM classes used to represent a DICOM message DICOM data elements MCdataElement class are identified by a unique number MCtag class A DICOM attribute MCattribute class contains the value of a DICOM data element An attribute has assigned to it a value representation MCvr class a value multiplicity n n and a value type 1 1C 2 2C 3 DICOM messages sent across a network connection on an association are represented by the MCdimseMessage class DICOM supports different sets of attributes MCattributeSet class A DIMSE message contains a command set MCcommandSet class containing header information used by the DICOM DIMSE service plus optionally a data set MCdataSet class containing DICOM data being exchanged The value of a Sequence of Items SQ attribute is zero or more DICOM items where each item is a set of attributes These DICOM items are represented by the MCitem class See figure below MCdimseMessage MCcommandSet MCdata
324. rated will have maximum size specified by CAPTURE_FILE_SIZE If CAPTURE_FILE_SIZE is less than 1 unlimited size this parameter s value is ignored DEFAULT 1 innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual REWRITE_CAPTURE_FILES TCPIP_DISABLE_NAGLE TCPIP_LISTEN_PORT TCPIP_RECEIVE_BUFFER_SIZE Description This parameter specifies whether or not the capture files should be rewritten when all files have reached the maximum size specified by CAPTURE_FILE_SIZE capture files are generated if the NETWORK_CAPTURE value is set to Yes If Yes is specified the oldest file will be rewritten If No is specified and all requested files have been written see NUMBER_OF_CAP_FILES no more data will be captured DEFAULT Yes This parameter specifies if the Nagle Algorithm should be used when sending packets at the TCP IP level Most operating systems enable this by default It allows small segments of data to delay sending a fixed amount of time to possibly be combined with other small segments and be sent as one larger packet Disabling this may cause high network traffic DEFAULT No This parameter specifies the TCP IP port on which server applications are to listen for associate requests DEFAULT 104 This parameter specifies the TCP IP receive buffer size for each connection Note that the maximum values for this constant and TCPIP_SEND_BUFFER_SIZE are operating system dependent
325. real world activities For example a Storage Service Class SCP might perform the following real world activities store an image modify it in some defined manner act as a Storage Service Class SCU and forward the modified image somewhere AE Specifications The next section in the DICOM Conformance Statement is a set of Application Entity specifications There is one specification for the AE Each individual AE specification has a subsection There are as many of these subsections as there are different AE s in the implementation That is if there are two distinct AEs then there are two subsections The Merge DICOM Toolkit uses the mergecom app configuration file to read configuration parameters for each AE The following subsections are filled in for each AE Application Entity o SOP Classes o Association Policies General Number of Associations Asynchronous Nature Implementation Identifying Information o Association Initiation Policy Activity Description and Sequencing of Activities Proposed Presentation Contexts SOP Specific Conformance for SOP Class es o Association Acceptance Policy Activity Description and sequencing of Activities Accepted Presentation Contexts SOP Specific Conformance for SOP Class es innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual SOP Classes Application conformance statements specify the DICOM SOPs which are supported by each Application En
326. rectory records contained within them are also freed The deleteChildren deletes all children for the current directory record The delete method deletes the current record and all of the children of the directory record The Merge DICOM Toolkit updates and maintains all the byte offsets that are part of the DICOMDIR structure automatically But one important note All the changes to a DICOMDIR are made in memory and are not committed to media until a writeFile call is made Memory Management The Merge DICOM C library contains its own memory management routines that are optimized for how it uses memory They have been adapted to manage specific data structures that are frequently allocated by the Merge DICOM C toolkit These include but are not limited to data structures for associations messages and tags The memory management routines have the characteristic that they do not actually free the memory that has been acquired Instead they mark the data as being free and place the memory in a list for reuse later These routines have been optimized to quickly acquire and free memory being used by Merge DICOM Toolkit They also allow Merge DICOM to not depend on the memory management of a particular operating system These memory routines have also been extended for use with variable sized memory buffers Merge DICOM uses these routines to allocate buffers in sizes between 4 bytes and 28K When an allocation is requested Merge DICOM will
327. red The above example in this case will look as following try service readFileUpToTag fileObj MCdicom PIXEL_DATA true source catch Exception e You might use a callback mechanism to retrieve the attribute s value upon request later see Using a Callback Class to Retrieve an Attribute s Value section for details See the Assembly Windows Help File for a detailed description of the use of these read methods Creating and Writing Files When you have a populated MCfile object you can create a DICOM file stream by using the writeFile method of the MCmediaStorageService class This method utilizes the MCdataSink class to present the file stream for writing to media If your application has one or more MCattributeContainer objects registered for OB OW OF attributes the writeFile method retrieve an attribute s value from a callback if an MCattributeContainer callback is registered for it The second parameter of writeFile specifies a byte padding number The attribute FFFC FFFC will be added to the MCfile object and given a length such that the total length of the streamed file is a multiple of the byte padding number If 0 is specified there will be no padding of the file stream The parameter must be an even number If the file contains group length attributes i e attributes with tags of the form gggg0000 any group element zero this method will automatically calculate the group length val
328. remote application entity s entry in the Application Profile The TCP IP port number the remote server is listening on is obtained from the remote application entity s entry in the Application Profile Starting an Association Acceptor If your application will be an association acceptor a server the MCassociation class provides the startListening method to start up a thread that will listen Association startup for and process requests from remote DICOM Application Entities that wish to for a server application start an association with your local Application Entity MCacceptor Merge DICOM handles every association request that is received in a separate MCassociation thread You must supply an instance of a class that implements the MCacceptor interface When the new association request is received Merge DICOM calls the start method of your MCacceptor class instance to process the association passing it a reference to a newly created MCassociation object NOTE the widely known Three forms of the startListening method exist One allows you to specify DICOM listen port is 104 which TCP IP port is to be listened on other will wait for association connections on the port specified by the TCPIP_LISTEN_PORT configuration parameter or on port 104 if the TCPIP_LISTEN_PORT configuration parameter is missing from the System Profile mergecom pro The third form allows an application to specify an IPEndPoint object representing the specific ad
329. requestAttribute gt attr return new MCrequest request MCrequestType Qido parms ToArray lt MCrequestParameter gt Submit lt summary gt Http Get method lt summary gt lt param name request gt lt see cref MCrequest gt oject lt param gt lt returns gt lt see cref HttpResponseMessage gt object lt returns gt ActionName bind public HttpResponseMessage Get ModelBinder typeof MCrequestBinder MCrequest request return request Submit innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 MCqidoController URI route templates HttpConfiguration config new HttpConfiguration config Routes MapHttpRoute name MCqidoRoute routeTemplate api controller defaults new controller MCcontroller MCQIDOCONTROLLER action get 3 config Routes MapHttpRoute name MCqidoStudies routeTemplate api controller studies defaults new controller MCcontroller MCQIDOCONTROLLER action get 3 config Routes MapHttpRoute name MCqidoSeriesA routeTemplate api controller series defaults new controller MCcontroller MCQIDOCONTROLLER action get 3 config Routes MapHttpRoute name MCqidoSeriesB routeTemplate api controller studies studyInstanceUid series defaults new controller MCcontroller MCQIDOCONTROLLER action studyinstanceuid 3 config Routes MapHttpRo
330. requestParameter gt Submit lt summary gt Http Get method lt summary gt lt param name request gt lt see cref HttpRequestMessage gt object lt param gt lt param name studyInstanceUid gt StudyInstanceUID parameter lt param gt lt param name seriesInstanceUid gt SeriesInstanceUID parameter lt param gt lt param name sopInstanceUid gt SopInstanceUID parameter lt param gt lt returns gt lt see cref HttpResponseMessage gt object lt returns gt ActionName instance public HttpResponseMessage Get HttpRequestMessage request String studyInstanceUid String seriesInstanceUid String sopInstanceUid List lt MCrequestParameter gt parms new List lt MCrequestParameter gt string keyword MCwado DicomKeywords MCdicom STUDY_INSTANCE_UID MCrequestAttribute attr new MCrequestAttribute Item keyword Tag MCdicom STUDY_INSTANCE_UID Keyword keyword Values new string studyInstanceUid parms Add new MCrequestParameter Name keyword RequestRequirement MCrequestParameter Requirements REQUIRED Attributes new List lt MCrequestAttribute gt attr H keyword MCwado DicomKeywords MCdicom SERIES_INSTANCE_UID attr new MCrequestAttribute Item keyword Tag MCdicom SERIES_INSTANCE_UID Keyword keyword Values new string seriesInstanceUid parms Add new MCrequestParameter Name keyword RequestRequirement MCrequestPar
331. resentation String keyword myAt getKeyword Adding Attributes to an Attribute Set Attributes may be added to an attribute set in two ways The first method is by using the add method of the MCattributeSet class The second method is through the use of an indexer The use of the indexer is defined in the next section When using the add method of MCattributeSet the attribute to be added can be identified by 1 an uint reference or 2 by an MCtag reference All forms of the add method return the MCattribute added to the set If the attribute already exists in the set this attribute is returned MCattributeSet myAttrSet non null referenc MCtag tag new MCtag 0x0008 0x0010 MCattribute myAttr All of the following accomplish the same thing myAttr myAttrSet add tag myAttr myAttrSet add 0x00080010 If you are attempting to add a private attribute and there are already 240 private blocks in the attribute s private group an MCinvalidEncodingException will be thrown If the MCtag parameter does not identify an element in the data dictionary or the MCdataElement parameter is not defined in the data dictionary an MCnotStandardElementException will be thrown Using the MCattributeSet indexer to access MCattribute instances The MCattributeSet contains a number of indexers for access attributes and values within an attribute set Two forms of the indexer are specifically for getting and setting MCattribute instances
332. ributes only if the attribute s value representation is a text type that allows the backslash character as a field delimiter in streamed messages Attributes with the following Value Representations may call this method to set values subsequent to the first value AE AS CS DA DS DT IS LO LT PN SH TM UI An MCincompatibleVrException is thrown if an attempt is made to set a value NULL and the attribute s Value Representation does not allow it Assigning a Non NULL Attribute You can use the addValue or set Value method to assign non NULL values We will discuss setValue below As discussed above these methods are implemented in the MCattribute class and the MCattributeSet class where you must identify the tag that you re working on This can be done using an MCtag object or by supplying the actual DICOM tag as a uint The MCattributeSet implementation finds the appropriate MCattribute within the set and then calls the corresponding setValue or addValue method in the MCattribute class for convenience All three methods allow you to identify the attribute using an MCtag object innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual Polymorphic values While these methods allow you to specify the value using a variety of data types the attribute s Value Representation restricts the data type of the value parameter Table 11 details which data type may be used with each Value Representation Ta
333. rm Requirements Based on the version of the NET Framework required the Merge DICOM Toolkit is built and distributed in two packages 1 Requires version 2 0 of the NET Framework The toolkit requires the Merge DICOM C C Toolkit run time library and currently supports the 2 0 NET Framework on 32 bit or 64 bit Microsoft Windows platforms 2 Requires version 4 5 of the NET Framework The toolkit requires the Merge DICOM C C Toolkit run time library and currently supports the 4 5 NET Framework on 64 bit Microsoft Windows platforms Your development environment or at a minimum your target environment should run on a machine with a network interface over which you can run the TCP IP protocol The DICOM Toolkit library supplies you with the DICOM protocol that runs on top of TCP IP If your application will write DICOM files to interchangeable media you will need a device driver for the media storage device and a programming interface between your operating system and the file system on that device Assembly Structure Understanding the organization and components of the Merge DICOM Assembly is important to developing an efficient and capable DICOM application see Figure 3 Following is a description of the library s structure and the external components it uses at runtime to provide DICOM functionality innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual other sample applications e o
334. rogram with a batch file this option can be shut off with the q flag The default transfer syntax is implicit little endian the DICOM default transfer syntax If the transfer syntax is incorrectly specified the message cannot be validated limitations While mc3valid s message validation is quite comprehensive it does have limitations These limitations are discussed in detail in the description of the validate method of the MCdimseMessage class in the Assembly Windows Help File The DICOM Standard should be always be considered the final authority innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 mc3file DICOM Message Sample DICOM messages can be generated with the mc3file utility You Generation Tool specify the service command and transfer syntax and mc3file generates a reasonable sample message that is written to a binary file The contents of this file are generated in DICOM file format or in exactly the format as the message would be streamed over the network The program fills in default values for all the required attributes within the message You can also use this utility to generate its own configuration file which you can then modify to specify your own values for attributes in generated messages These generated messages are purely meant as useful examples that can be used to test message exchange or give the application developer a feel for the structure of DICOM messa
335. romJSON method MCabstractMessage s derived classes MCfile and MCdimseMessage The content of the message is not cleared before processing JSON attributes The existing attributes in the message are overridden if they are present in the JSON string The following example shows how the readFromJSON method is utilized at a high level StreamReader reader new StreamReader myXMLFile MCfile file new MCfile file readFromJSON reader To handle bulk URI from a DICOM JSON Model file the MCbulkDataUriHandler interface is used Following shows how to implement this task class BulkDataUriHandler MCbulkUriHandler public object provideData MCattributeSet attrSet unit tag MCvr vr string uri if tag MCdicom PIXEL_DATA use parameter uri to retrieve your data based on your data create an array of datasize byte data new byte datasize populate your data array return data call an overloaded method of readFromJSON file readFromJSON reader new BulkDataUriHandler By default if no bulk URI handler is supplied and a bulk URI attribute is encountered in the JSON file the toolkit will generate an empty attribute tag with zero length for the encountered tag innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 Reading messages MCassociation read Sending messages sendRequestMessage sendResponseMessage Message Exchange Networ
336. s Storage C STORE Basic Color Image Box N SET innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual Service Command Basic Film Box N CREATE Basic Film Session N CREATE Basic Grayscale Image Box N SET Basic Structured Display Storage C STORE Basic Text Structured Reporting C STORE Basic Voice Audio Waveform Storage C STORE Blending Softcopy Presentation State Storage C STORE Breast Tomosynthesis Image Storage C STORE Cardiac Electrophysiology Waveform Storage C STORE Color Softcopy Presentation State Storage C STORE Comprehensive Structured Reporting C STORE Computed Radiography Image Storage C STORE CT Image Storage C STORE Chest CAD SR C STORE Colon CAD SR C STORE Deformable Spatial Registration Storage C STORE Detached Interpretation Management N GET Detached Patient Management N GET Detached Results Management N GET Detached Study Management N GET Detached Study Component Management N GET Detached Visit Management N GET Digital X Ray Image Storage For Presentation C STORE Digital X Ray Image Storage For Processing C STORE Digital Intra oral X Ray Image Storage For Presentation C STORE Digital Intra oral X Ray Image Storage For Processing C STORE Digital Mammography Image Storage For Presentation C STORE innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 Service Command Digital Mammography Image Storage For Processing C STORE Encapsulated CDA Sto
337. s closely with that used in the OSI Standard innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 Where to get the DICOM Standard Special Note ISO OSI Layers DICOM Parts Application E eee Parts 3 amp 4 ee ot Encoding Parts 5 amp 6 Session amp Presentation DICOM Upper Layer Tese Protocol Pares Network Data Link amp Physical Network Figure 1 The DICOM Protocol Stack As a user of this toolkit you should have access to the DICOM Standard Merge DICOM Toolkit takes care of most of the details of DICOM for you However the standard is the final word You will probably find Parts 2 6 most useful The DICOM Standard can be ordered from NEMA 1300 N 17 Street Suite 1847 Rosslyn VA 22209 USA http medical nema org The DICOM Standard is typically published every year Each version includes approved changes since the last publishing The most recent version of the standard is available in PDF format and can be downloaded from NEMA s public ftp site at ftp medical nema org medical Dicom 201 1 Please note that the DICOM Standard is evolving so rapidly that additions to the Standard are published as supplements For example the media extensions have been incorporated into the DICOM Standard as a supplement that contains addenda to various parts of the standard e g PS3 3 PS3 4 If you find that this document references a part of the Standard an
338. s to Size establish an association with another DICOM application using this toArray MCproposedContextList list This method call is treated as a no op if no negotiation information is registered for the service The setNegotiationInfo method is used to provide extended negotiation information for one or more services in the list The extended negotiation information will be used during association negotiation by Merge DICOM Toolkit The existence of extended negotiation information is dependent on the service and must be documented in the application s DICOM Conformance Statement The negotiation information is provided by the toByteArray method of the specified MCnegotiationInfo instance If a null pointer or an empty byte array is provided by the toByteArray method this call is treated as if it were a clearNegotiationInfo method call The contains method determines if the proposed context list contains an MCproposedContext element or if it contains an element that has a specified service name The getContext method uses a service name to identify and return an MCproposedContext object from those encapsulated in the proposed context list The ListName property retrieves the name that uniquely identifies this list among all proposed context service lists used by the library The GetEnumerator method creates and returns an enumerator for all of the MCproposedContext objects encapsulated in the proposed context list The iterator will pres
339. sFromGroup0 in samples StorageSCP StorageSCP cs if addGroup2ElementsFromGroup0 msg fileOb error Create file sink with a file name to write MCfileDataSink sink new MCfileDataSink file ToString Stream out the dummy fileObj that contains only metalInfo Transfer syntax must be ExplicitLittleEndian fileObj MetaInfo streamOut MCtransferSyntax ExplicitLittleEndian sink innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 Review what are directory entities directory records fileObj dispose Continue to read data set from original message and stream out directly MCReadError error assoc continueReadToStream sink msg Close file sink sink close Dispose received messag msg dispose Note Due to the raw saving technique non DICOM compliant message will be saved as is and no warning will be issued due to no parsing of message The DICOMDIR file As discussed earlier in each DICOM File Set containing many DICOM files their must exist a single DICOM File with the reserved File ID DICOMDIR This file contains identifying information for the file set that most often includes a directory of the file sets contents A media interchange application would make use of and maintain the DICOMDIR to locate a particular file within the file set for processing Structure A information object portion
340. sage handling arena DICOM specifies the required contents of each message in Parts 3 4 and 7 of the standard For each attribute included in a message additional characteristics of the attribute are defined that only apply within the context of a service These characteristics are Enumerated Values Defined Terms and Value Type Enumerated values vs DICOM specifies that some attributes should have values from a specified set of defined terms values If the attribute is an enumerated value it shall have a value taken from the specified set of values A good example of enumerated values are M F O for Patient s Sex 0010 0040 in Storage services If the attribute is a defined term it may take its value from the specified set or the set may be extended with additional values An example of defined terms are CREATED RECORDED TRANSCRIBED APPROVED for Interpretation Status ID 4008 0212 in Results Management services If this set is extended by an application with another term such as IN PROCESS it should be documented in that application s conformance statement Value type The most important characteristic of an attribute that is specified on a message by message basis is the Value Type VT The VT of an attribute specifies whether or not that attribute needs to be included in a message and if it needs to have a value Attributes can be required optional or only required under certain conditions conditional attributes Con
341. sage object The message object still contains a link to the registered callback class This link can be removed by calling the MCattributeSet removeValues method for the registered attribute The header data can then be examined and later written to disk Performance Tuning When sending data over the network the MCdimseService class sendRequestMessage method or the equivalent method from one of the MCdimseService subclasses will call the user s registered callback class for the image data The data can be supplied to Merge DICOM in any length as required by the user s application The data is typically read from disk at this point and directly passed to Merge DICOM Toolkit After sendRequestMessage receives the data it byte swaps the data if needed and then writes it to the network This functionality is conducive to storing a message s header data separately from its image data Depending on system requirements this may be an aid in quickly loading image data while bypassing Merge DICOM Toolkit The complete image file can be reassembled later using Merge DICOM Toolkit innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 Performance Tuning Read streamOut Saving Received Images Directly to Disk In conjunction with the registered callback class data can also be stored directly to disk when it is being read The image s header data can be written to disk from within the registered cal
342. sed above can be modified to include these transfer syntax lists The following is an example service list that has transfer syntaxes specified for each service Storage_Service_List SERVICES_SUPPORTED 3 Number of Services SERVICE 1 STANDARD_MR SYNTAX_LIST_1 MR_Syntax_List SERVICE_2 STANDARD_US SYNTAX_LIST_2 US_Syntax_List SERVICE_3 STANDARD_CT SYNTAX_LIST_3 CT_Syntax_List MR_Syntax_List SYNTAXES_ SUPPORTED 4 Number of Syntaxes SYNTAX_1 JPEG BASELINE SYNTAX_2 EXPLICIT_BIG_ENDIAN SYNTAX_3 EXPLICIT LITTLE _ENDIAN SYNTAX_4 IMPLICIT LITTLE _ENDIAN US_Syntax_List SYNTAXES_ SUPPORTED 2 Number of Syntaxes SYNTAX_1 RLE SYNTAX_2 IMPLICIT _LITTLE_ENDIAN CT_Syntax_List SYNTAXES_ SUPPORTED 2 Number of Syntaxes SYNTAX_1 EXPLICIT LITTLE _ENDIAN SYNTAX_2 IMPLICIT _LITTLE_ENDIAN innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual Storage_Service_List lists some standard storage service class services used by Merge DICOM Toolkit The SYNTAX_LIST_N parameter has been added to this example to specify a transfer syntax list for each service This optional parameter is set to the name of another section in the application profile which lists a group of DICOM transfer syntaxes to be n
343. sfer syntax list When a transfer syntax list is not specified in a service list the priority Merge DICOM Toolkit places on transfer syntaxes during association negotiation is dependent on the hardware platform On little endian machines Intel based systems the priority order is Explicit VR Little Endian Implicit VR Little Endian and Explicit VR Big Endian Merge DICOM also supports DICOM role negotiation through its service lists Whereas in previous examples the same service list could be used for both client SCU and server SCP these service lists are specific to the role to be negotiated for each service SCU_Service_List SERVICES_SUPPORTED SERVICE_1 ROLE_1 1 Number of Services STORAGE_COMMITMENT_PUSH SCU SCP_Service_List SERVICES_SUPPORTED SERVICE_1 ROLE_1 1 Number of Services STORAGE_COMMITMENT_PUSH SCP In this case the SCU_Service_List supports the Storage Commitment Push SOP class as an SCU and the SCP_Service_List supports the Storage Commitment Push SOP class as an SCP Merge DICOM will negotiate the association based on the settings for these roles innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 The role for a service can be defined as SCU SCP BOTH or be undefined Table 9 contains a complete listing of configurable roles for both requestors and acceptors along with the resultant negoti
344. st use a class that implements the MCdataSource interface If your application will write DICOM files you must use a class that implements the MCdataSink interface These interfaces have been discussed in detail in previous sections You will find that the DICOM Toolkit provides powerful DICOM media functionality by supplying your application with e agreatly simplified way to deal with the complex encoding and decoding required within a DICOM file e anAPI that is very consistent with that used for the maintenance of DICOM messages used in network functionality many of the encoding and decoding methods already described apply equally to DICOM file attribute sets To perform all this functionality on your medium of choice you need only supply the two file system interface implementation just discussed and use the methods of the MCmediaStorageService class innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 A Media Storage Service is associated with your application Three ways To read a media file Pass OB OW OD OF data to registered callbacks if any readFile MCmediaStorageService File System Interface writeFile MCdataSink DICOM Media Application DICOM Media DICOM File Figure 17 Classes and Methods Used for Handling DICOM Media Files readFile readFileUpToTag readFileBypassLargeData MCdataSource Constructing an MCmediaStorageService o
345. t V 5 1 0 NET C User s Manual The IOD may specify Templates that offer or restrict patterns and content in Observation Context Structured Reporting Templates Templates are patterns that specify the Concept Names Requirements Conditions Value Types Value Multiplicity Value Set restrictions Relationship Types and other attributes of Content Items for a particular application SR Document templates are defined in the Part 16 of the DICOM Standard Part 17 of the DICOM also has some explanatory information on encoding SR Documents The Merge DICOM Toolkit SR Functions follow DICOM Templates structures and allow straightforward encoding based on template tables SR Templates are described using tables of the form shown on Table 23 Table 23 SR Template Definition NL Rel with VT Concept VM Req Type Condition Value Set Parent Name Constraint 1 2 3 Row Number Each row of a Template Table is denoted by a row number The first row is numbered 1 and subsequent rows are numbered in ascending order with increments of 1 This number denotes a row for convenient description as well as reference in conditions The Row Number of a Content Item in a Template may or may not be the same as the ordinal position of the corresponding node in the encoded document The Merge DICOM Toolkit does not use this number in any way Nesting Level NL
346. t services inherited from the ACR NEMA Version 2 x Standard are composite services operate on composite object instances for reasons of backward compatibility Newly introduced services such as the HIS RIS and Print Management Services tend to be normalized services operate on normalized object instances Networking Certain aspects of DICOM only apply to networking when using the DICOM Toolkit This includes networking commands and association negotiation Commands DICOM defines a set of networking commands Each service uses a subset of these DICOM commands to perform the service over a network These commands usually act on object instances The C commands operate on composite object instances while the N commands operate on normalized object instances The DICOM commands and brief descriptions of their actions are listed in Table 2 Table 2 DICOM Commands DICOM Commands Description C STORE Transfer an object instance to a remote AE C GET Retrieve object instance s from a remote AE whose attributes match a specified set of attributes C MOVE Move object instance s from a remote AE whose attributes match a specified set of attributes to yet another remote AE or possibly your own AE which would be another form of retrieval C FIND Match a set of attributes to the attributes of a set of object instances on a remote AE object instances are referred to as SOP Instances or managed SOP s in the DICOM standard
347. t the local application is willing to perform If no MCproposedContextList was provided Merge DICOM created an MCproposedContextList from information defined in the mergecom app file The ProposedContextList property returns a reference to the MCproposedContextList object used During association negotiation the DICOM association requestor proposes the services it wishes to use The association acceptor can then reject or accept each of the proposed services The NumberOfProposedContexts property returns the number of services proposed by the association requestor The Read Timeout Value The ReadTimeout property returns the timeout value specified by the timeout parameter of the last read method call for this association If no read has been called yet zero 0 will be returned The Remote Host s Name and Address Merge DICOM applications communicate with each other using TCP IP The RemoteHostName property returns the IP name of the remote application s host computer and the RemoteIpAddress property returns the IP address of the remote application s host computer and the RemotePort property retrieves the port number that the remote system is using to listen for TCP IP connections Association Role MCassociation objects may be constructed as acceptors those waiting for and responding to DICOM association requests or as requesters those making DICOM association requests The Acceptor property returns t rue if this MCassociation o
348. t value from attribute 0000 0120 MessagePriority The MessagePriority property gets or sets the DICOM Message Priority of this DIMSE message It is retrieved from attribute 0000 0700 in the message s command set MoveDestination DIMSE C MOVE request messages contain an attribute that provides the destination DICOM Application Entity for which C STORE sub operations are being performed The MoveDestination property sets or gets that value from attribute 0000 0600 MoveOriginator C STORE request messages contain an attribute the provides the DICOM AE Title of the DICOM AE which invoked the C MOVE operation from which a C STORE sub operation is being performed The MoveOriginator property sets or gets that value from attribute 0000 1030 MoveOriginatorMessageld C STORE request messages contain an attribute that provides the Message ID of the C MOVE request message from which the C STORE sub operation is being performed The MoveOriginatorMessagelId property gets or sets that value from attribute 0000 1031 OffendingElements Some DIMSE services place the data element tag number of the element or elements involved in an error in their response messages The OffendingElements property gets or sets these tag numbers as an array of unsigned integers from the command set attribute 0000 0901 innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 RemainingSubOperations RequestedSopClassUid
349. tBinder MCrequest request Name MCcontroller MCWADOURICONTROLLER return new MCrequest request MCrequestType WadoURI Submit return request Submit MCwadouUriController URI route templates HttpConfiguration config new HttpConfiguration config Routes MapHttpRoute name MCwadoUriRoute routeTemplate api controller defaults new controller MCcontroller MCWADOURICONTROLLER action get 3 config Routes MapHttpRoute name MCwadoUriBind routeTemplate api controller bind wadouri defaults new controller MCcontroller MCWADOURICONTROLLER action bind 3 config Services Add typeof ModelBinderProvider new MCrequestBinderProvider MCwadoWsController using System using System Net Http using System Text using System Threading Tasks using System Web Http using System Web Http ModelBinding using Mergecomws Dicom namespace Mergecomws Web lt summary gt Implements Http Get methods for DICOM WADO WS requests lt summary gt public class MCwadoWsController MCcontroller lt summary gt Class constructor lt summary gt public MCwadoWsController base innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 lt summary gt Http Get method lt summary gt lt param name request gt lt see cref HttpRequestMessage gt object lt param gt lt returns gt lt see cref HttpRes
350. taSet object and an MCfileMetalnfo object The MCfile may be constructed with a pre populated data set or with an empty data set Construct with a pre populated data set Two forms of the MCfile constructor create a MCdataSet object and a MCfileMetalnfo object that contain all of the attributes of a DICOM file that will be used for the given serviceName and command References to the created attribute sets may be retrieved using the DataSet and Metalnfo properties Normally you will only deal with the data set and the file meta information attributes will be set automatically by Merge DICOM Toolkit MCfile myFile ushort command MCdimseService C_STORE_RQ String serviceName STANDARD_CT myFile new MCfile command serviceName or String file MyFileName myFile new MCfile file command serviceName j innovative Imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual serviceName and command are used to access configuration information that describes the attributes of the message If such configuration information is not available an empty file object is created and a warning message is logged An exception is thrown if the command parameter is invalid The file parameter if used associates this object with a specific operating system file Construct with an empty data set Remember Two forms of the constructor are used if the service and command are not yet Service and command are
351. tack on any physical interconnection media supporting the TCP IP stack IPv4 and IPv6 Support Merge DICOM Toolkit supports both IPv4 and IPV6 protocols and is configurable in the system profile Configuration Refer to the Appendix B Configuration Parameters for complete configuration information Applications reference four 4 configuration files The first merge ini is found through the MERGE_INI environment variable They are as follows e merge ini Specifies the names of the other three 3 configuration files and also contains message logging parameters e mergecom pro Specifies run time parameters for the application e mergecom app Defines service lists and applications on other network nodes to which connections are possible e mergecom srv Service and sequence definitions AE Title Presentation Address Mapping Presentation address mapping is configured in the mergecom app file The Presentation Address of an SCU SCP application is specified by configuring the Listen Port in the mergecom pro file and specifying the AE title for the SCU SCP within the application itself Configurable Parameters The mergecom pro configuration file can be used to set or modify other lower level communication parameters This includes time outs and other parameters Some information about supported SOP classes is also stored here Most parameters in this file should NEVER be changed Doing so may compromise DICOM conf
352. take the smallest buffer that will fit the bytes requested These buffers will be kept in Merge DICOM Toolkit s internal memory pool and never freed For allocations larger than 28K Merge DICOM will simply use the C functions malloc and free The end result of these routines is that applications using Merge DICOM expand to the maximum amount of memory used at one time The total memory allocation will not shrink from this point In applications that repeatedly perform a consistent operation the memory being used by Merge DICOM should stabilize and not increase in size As a result of these routines the first time an application performs a DICOM operation is typically slower than subsequent operations innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 Performance Tuning setValueFromMethod When developing a DICOM application with Merge DICOM Toolkit the most memory intensive operation is dealing with image data The following sections discuss various Merge DICOM methods A description is given of how these methods manage memory in conjunction with various Merge DICOM configuration settings Assigning Pixel Data The MCattribute setValue method is used in conjunction with the MCdataSource interface to assign OB OW OD or OF data to a DICOM attribute These value representations are used to store image data or other large data elements set Value is described in further detail elsewhere in
353. te in the file s contained MCdataSet and MCfileMetalnfo objects This method is useful for applications that reuse an MCfile object and want to insure there are no attribute values remaining from the last use of the object Attributes with no values are skipped when streaming the collection for network transfer or for writing a DICOM file innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 Data Set Validation validate validateAttribute How big is the file stream streamLength The transfer syntax UID TransferSyntax property The file s name FileName property myFile removeFileValues File validation You can validate that the data set meets the requirements of the service command pair associated with the file by using the validate method of the MCfile object You could also use the validate method of the contained MCdataSet object You can also validate an individual attribute within the data set using the validateAttribute method MCfile myFile non null referenc bool validates validates myFile validateAttribute MCdicom PATIENTS_NAME MCvalidateLevel Errors_Only if validates MCvalidationError err myFile g etNextValidationError while err null System Console Out WriteLine err ToString rr msg getNextValidationError To understand the overhead involved in file validation please refer to The Overhe
354. teTime D MCtime M MCage AS String AE DS IS UI CS LO LT SH ST UT MCpersonName P float double innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 Have Merge DICOM Toolkit give a callback the value MCdataSink receiveData method Data Types Returned Value Representations UL AT int S short SS ushort U MCdataSink OB OD OF OW UNKNOWN _VR MCitem Note Ifa value is retrieved which is not set the indexer will throw an MCnoSuchValueException MCdimseMessage dm non null referenc MCattributeSet as dm getDataSet try Cdate value MCdate as MCdicom INSTANCE_CREATION_DATE 0 catch MCnoAttributesException e catch MCattributeNotFoundException e catch MCincompatibleValueException e catch MCnoSuchValueException e The MCattribute class contains a number of routines that can do explicit conversion from the internal encoding for VRs into other data types These MCattribute methods are get IntValue getStringValue getUIntValue and getDoubleValue These routines will convert the internal Merge DICOM representation into the types specified in the routine name See the Assembly Windows Help File for further details on these methods Using a Callback Class to Retrieve an Attribute s Value You shall use the IsBulk attribute s property to identify if the value is bulk To retrive the b
355. ted by DICOM and by Merge DICOM Toolkit This is termed the DICOM Upper Layer Protocol DICOM UL Part 9 is rarely of interest as it describes how DICOM messages shall be exchanged using the old 50 pin point to point connection originally specified in the predecessor to DICOM ACR NEMA Version 2 This part has been retired from the DICOM standard Part 10 describes the DICOM model for the storage of medical imaging information on removable media It specifies the contents of a DICOM File Set the format of a DICOM File and the policies associated with the maintenance of a DICOM Media Storage Directory DICOMDIR structure innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual Part 11 specifies Media Storage Application Profiles that standardizes a number of choices related to a specific clinical need modality or application This includes the specification of a specific physical medium and media format e g CD ROM 3 5 high density floppy as well as the types of information objects that can be stored within the DICOM File Set Part 11 also includes useful templates to provide guidance in authoring media application conformance statements Part 12 details the characteristics of various physical medium and media formats that are referenced by the Media Storage Application Profiles of Part 11 While parts 11 and 12 of DICOM are expected to evolve along with the introduction of new clinical
356. tes encoded as UN VR to the network SCP application strategy For SCP systems receiving UN VR tags when they cannot handle them the following can be done Configure the SCP to only negotiate the Implicit VR Little Endian transfer syntax when receiving objects With the help of these options most UN VR problems in the field can be fixed simply by changing configuration values with the Merge DICOM toolkit innovative Imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 Appendix A Frequently Asked Questions This appendix lists some frequently asked questions by toolkit users 1 It is inconvenient to set absolute paths for the various configuration options in the merge ini and mergecom pro files that need them Is there a way to make these pathnames be configurable at run time Merge DICOM allows the placement of environment variables in these pathnames This allows setting of a root directory for these pathnames The following is an example of how this functionality is used in our configuration files MERGECOM_PRO MERGE_ROOT mc3apps mergecom pro In this example MERGE_ROOT would be an environment variable A special macro MC3INIDIR is used to represent the directory where merge ini is It is used like the environment variable with the difference that it is automatically resolved and does not need to be set If MERGECOM_3_PROFILE MERGECOM_3_SERVICES or MERGECOM_3_APPLICATI
357. the MCapplication class provides several options you can use to request an association with a network partner First you must decide how you will process the new association If your current thread will process the association you will use the following form of the MCassociation requestAssociation method providing the Remote Application Title of the server you wish to connect to through the use of the MCremoteApplication class MCapplication myAE MCapplication getApplication ACME_Query_SCU MCremoteApplication remoteApp MCremoteApplication getObject ACME_Query_SCP MCassociation myAssoc myAssoc MCassociation requestAssociation myAE remoteApp The getObject static method of MCremoteApplication allows you to load configuration information about the remote application from the Application profile It is also possible to use the constructor from MCremoteApplication to supply all of the connection information for the remote application See the Merge DICOM NET Windows Help File description of MCremoteApplication for the format of these constructors If you want a separate thread to process the association you must first provide a class that will process the new association The class must implement the MCrequesier interface That interface requires that your class have a start method that will be passed a newly created MCassociation object When Merge DICOM has successfully started an association it wil
358. this manual The MCdat aSource implementation can pass data to the library ina single call or in several smaller chunks When passed data the library will allocate a buffer the size of the chunk passed to it and copy the data into this buffer for storage The size of data returned by provideData will dictate how the image data is stored If the data is passed in chunks smaller than 28K Merge DICOM Toolkits internal memory management code will be used If the chunks are larger than 28K malloc will be used to allocate storage for the buffers If large images are being dealt with it may be desirable to pass this data in chunks larger than 28K so the memory is freed after processing has been completed for the image This will keep the nominal memory usage of Merge DICOM lower When passing data in chunks less than 28K it is recommended that sizes of 16K 20K 24K or 28K be used Using these size chunks will reduce the overhead in storing the data The library can also be directed to store data in temporary files The LARGE_DATA_STORE and LARGE_DATA_SIZE configuration options in the mergecom pro file dictate when data is stored in temporary files When the LARGE_DATA_STORE option is set to FILE data elements that are larger than configured by the LARGE_DATA_SIZE option are stored in temporary files The size of buffer returned by provideData does not have an effect on memory usage Using Attribute Containers Merge DICOM also sup
359. tity For SCP Entities the initiation of associations Please see the System Profile section in ANNEX B CONFIGURATION PARAMETERS and the MC_Wait_For_Association or MC_Wait_For_Secure_Association definition in this Reference Manual For SCU Entities the list of supported SOP classes will correspond to the services specified in mergecom app for any SCPs to which the SCU wishes to connect Number of Associations The Merge DICOM Toolkit does not impose any limit on the number of simultaneous associations that can be requested or accepted The only limitation on the number of simultaneous associations is imposed by the operating system and available resources However if your application enforces this limit it is defined here The MAX_PENDING_CONNECTIONSsetting in the mergecom pro file refers to the maximum number of outstanding connection requests per listener socket It does not limit the maximum number of simultaneous associations Asynchronous Nature Merge DICOM Toolkit does not currently support multiple outstanding transactions over a single association Implementation Identifying Information Application conformance statements specify the Implementation Class Unique Identifier UID for the application as well as the Implementation version name These identifiers are taken from the mergecom pro configuration file under the following keys IMPLEMENTATION_CLASS_UID IMPLE
360. to retrieve attribute values The library also provides a System Object reference to the instance that is calling provideData The provideData method is required to return portions of the attribute s value using an instance of the MCdata class For example your application could define a MCdataSource class called MyPDSupplyCallback whose purpose is to supply Pixel Data The pseudo code for this class follows class MyPDSupplyCallback MCdataSource IDisposable implements IDisposable recommended public String file null private MCdata prevData null private byte chunk new byte 4096 re use the same buffer to supply data for more efficient usage of memory public MCdata provideData bool isFirst Object origin If prevData was previously returned dispose it before supplying next chunk Due to garbage collection policy you may see large amount of innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual memory usage if not dispose the previous data promptly if prevData null prevData Dispose prevData null if isFirst Open pixel data source e g a file here if openFailed throw new MCcallbackCannotComplyException Read next chunk of pixel data from source and return it and its size in a MCdata object if readFailed throw new MCcallbackCannotComplyException Data is read into chunk chunk read in your data here put num
361. tography Image Storage Ophthalmic Tomography Image Storage Spectacle Prescription Report Storage Stereometric Relationship Storage Real World Value Mapping Storage Wide Field Ophthalmic Photography 3D Coordinates Image Storage Wide Field Ophthalmic Photography Stereographic Projection Image Storage Storage Commitment Push Storage Commitment Pull DICOM Basic Directory Storage and storage of various italicized services from the other Service Classes Patient Root Find Patient Root Move Patient Root Get Study Root Find Study Root Move Study Root Get Patient Study Only Find Patient Study Only Move Patient Study Only Get Modality Worklist Find Basic Film Session Basic Film Box Basic Grayscale Image Box Basic Color Image Box Printer Description Ensures that SOP Instances stored with the storage service class will not be deleted after reception but will be stored safely and can be retrieved again at a later point Exists as a member of every DICOM File Set and contains general information about the file set and a hierarchical directory of the DICOM files contained in the file set Management of images through a query and retrieval mechanism based on a small number of key attributes Supports the exchange of any type of worklist from one AE to another Printing or filming of medical images and image related data ona hard copy medium Also storage of print related innovative imaging
362. tory records DICOM File ID s are encoded in the directory record if the record references a particular DICOM file in the file set innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual DICOMDIR s are ugly The key observation here is that rather than using nested Sequences of Items to encode the DICOMDIR hierarchy the standard chose to use a single potentially very large sequence of items and byte offsets The standard defines these byte offsets as being measured from the first byte of the file meta information As you might well imagine the complexity of maintaining these byte offsets accurately as directory records are added to or removed from directory entities within the DICOMDIR file is very great and can be very cumbersome But we pretty them up Fortunately the Merge DICOM Toolkit supplies methods that make DICOMDIR maintenance much simpler for your application These methods are now described Constructing a new MCdir Instance MCdir extends the MCfile To create a special type of DICOM file that contains a DICOMDIR directory class construct a new MCdir object The MCdir class is a subclass of the MCfile class MCdir since it is simply a form of a DICOM file The file name provided MUST refer to a file named DICOMDIR MCdir myDICOMDIR MCdir HERE DICOMDIR When you construct an MCdir object Merge DICOM creates an instance of the MCfile class that has a servic
363. ttleEndian property determines if the transfer syntax uses little endian encoding or not innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual The Encapsulated property determines if the transfer syntax uses encapsulation or not The ExplicitVR property determines if the transfer syntax explicitly specifies the DICOM Value Representation Otherwise the VR is known implicitly according to each attribute tag MCtransferSyntaxList properties The MCtransferSyntaxList class provides methods to retrieve properties of the i Satanei DICOM transfer syntax list encapsulated by class instances ListName GetEnumerator The contains method determines if the list contains a specified transfer syntax Size The getSyntax method retrieves a reference to a specific MCtransferSyntax POANTA object in the list The ListName property retrieves the name that uniquely identifies this list among all transfer syntax lists used by the library The GetEnumerator method creates and returns an Iterator for all of the MCtransferSyntax objects encapsulated in the list The iterator will present the elements in the order they were presented when this object was created The Size property returns the number of elements in the list and the toArray method returns a reference to the encapsulated MCtransferSyntax object array Using Extended Negotiation Information MCnegotiationInfo Some DICOM services allow you to use extended negotiation informatio
364. ual Contents OVGIVIOW ci sevetsndeviivess a ad a a avs 11 The DICOM Standard ccccecccceesceceeeeeceeeeeeaeeeeeeeseeeesaaeeeeaeeseeeeeseaeeeeaeeeeneeeeas 11 The Merge DICOM ToolKit ccccececceceeeceeeeeeeeeeeceeeeeeaeseeaeeeeeeeseaeeeeaaesseneeeeas 15 Development Platform Requirement c ccccccceeseeeeeseeeeeeeeseeeeseaeeeeneeesaees 16 Assembly SUUCTUIG eet eciecsseethtsbecnrrierecds ieecnnt aiaia akaa aaa ag 16 Merge DICOM C C Toolkit Dynamic Library seesessseeseesseeseereeereene 17 Binary Message Information and Data Dictionary Files eceeeeee 18 SAMPIS APP CALONS sssrini iae anaa aa aad aaa a 18 Merge DICOM Message Database Manual and TOols 0 c csccceseeeeeees 18 Documentation Roadmap ecese E 19 CONVENON S wou tasatiegeshecedeanesctey sesh Uebel sadanev edhe cadutpealeendha ta dedeesnediaea ated ateeeedenes 19 Understanding DICOM ccccccesceceeeeceeeeeeeeeceeeeeseaeeesaaeseeaaeseeeeseaeeesaeeseneeenaees 20 General Concepts ssdri aai haea anaia aa e aa aasa aan aaa 20 Application EMttieS sssisiaops a an AN A E emesis 20 Services and Meta Services cccceesceceeeeeceeeeeeaeeeeeeeseeeeeceaeeeeeaeseaneeesaees 20 Information MOdelssisas sanan aiana weenie tecneavesneeiadienevdendtiosiaetears 24 INGIWOMKING esse a E E 25 COMIMANGS vi sisia na osana a E a a a Aa aa seascape 25 Association Negotiation issivecccccincccivee dette dniies eee eeniiee denier 26 MOSS
365. ue and that value is not null e That all value type 2 attributes have a value and that value may be null innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 e That a specified set of conditional attributes value type 1C or 2C are validated as value type 1 or 2 attributes when the specified condition is satisfied Merge DICOM supports a number of conditional functions that are straightforward to validate Not all conditions can be validated by the toolkit and those that cannot need to be checked by the application itself e That an attribute does not have too many or too few values for its specified value multiplicity e That an attribute that has enumerated values does not have a value that is not one of the enumerated values A warning is also issued if an attribute that has defined terms has a value that is not one of those defined terms e That a non private attribute is not included in the message that is not defined for that DICOM message service command pair and what validation cannot As mentioned Merge DICOM Toolkit does not capture all standard violations do for you and the DICOM Standard itself should be considered the final word when validating a message Important limitations of Merge DICOM validation include e DICOM Part 3 specifies Information Object Definitions IOD s as being composed of modules Each module contains attributes Only in the case of composite IOD s may an attrib
366. ue when supply it to the callback The byte stream will be formatted in the transfer syntax specified by the attribute transfer syntax UID specified by the MCdicom TRANSFER_SYNTAX_UID 0002 0010 attribute in the file s Meta Information set You can set this value using the TransferSyntax property of the MCfile class Two group 2 attributes within the file meta information will be automatically filled in if you have not set them yourself e The Implementation Class UID 0002 0012 will be filled in with the value set for the IMPLEMENTATION _CLASS_UID configuration value in the mergecom pro file e The Implementation Version Name 0002 0013 will be filled in with the value set for the IMPLEMENTATION_VERSION configuration value in the mergecom pro file innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual Sample media write snippet The following example is taken from the StorageSCP sample application Capplication myApp non null referenc CdimseMessage msg a network message just received Cfile fileObj new MCfile msg MyFileName CdataSink destination new MCfileDataSink fileObj FileName CmediaStorageService mediaService new MCmediaStorageService myApp try mediaService writeFile fileObj 0 destination catch Exception e System Console Out WriteLine writeFile failed Saving Raw Unparsed Messages as DICOM Files Re A common
367. ugh innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual Table 38 define how each parameter should be defined within the system profile Table 33 ASSOC_PARMS section of system profile parameters ACCEPT_ANY APPLICATION TITLE ACCEPT_ANY CONTEXT _NAME ACCEPT_ANY_HOSTNAME ACCEPT_ANY_PRESENTATION_CONTEXT u ACCEPT _DIFFERENT_IC_UID ACCEPT_DIFFERENT_VERSION i ACCEPT_MULTIPLE_PRES_ CONTEXTS Description If set to YES the remote system need not specify a correct DICOM application title when requesting an association If set to NO a correct application title must be used When this value is set to YES the toolkit will report the remote application as connecting to the first application registered DEFAULT NO If set to YES the remote system need not specify the LOCAL_APPL_CONTEXT_NAME when requesting an association If set to NO the correct context name must be used DEFAULT NO If set to YES the toolkit will not check if applications connecting to an SCP can have their hostname resolved through the SCP s hostfile or domain name server If set to NO the toolkit will automatically reject associations from unknown hosts DEFAULT NO If set to YES the toolkit will not validate that the presentation context ID contained in a message s PDU header information matches the ID of the presentation context negotiated for the type of message contained in the PDU If set to NO the
368. uilt or one that you have received and are about to parse Merge DICOM Toolkit instances supplies DICOM Toolkit DICOM message validation functionality The MCabstractMessage derived classes MCdimseMessage and MCfile and the MCdataSet class each provide a validate method that will validate the attribute sets it contains against the DICOM Standard s specification for its service command pair Validate method message txt canbe very One of the files supplied with Merge DICOM Toolkit is the message txt file useful This file contains a listing of all the messages supported by the toolkit and the parameters they are validated against message txt is a useful guide in your application development because it specifies the attributes that can make up the object instance portion of each message type service command pair and is often easier to use as a quick reference than paging through two or three parts of the DICOM Standard message txt also specifies the contents of items and files See discussions of Sequence of Items and DICOM Files later in this document Remember though that the DICOM Standard is the final word and that message txt has its limitations as described further below The validate methods do not validate the attributes that make up the command portion of a DICOM message Command set attributes attributes with a group number less than 0008 are also not specified in message t xt The Merge DICOM Toolkit Library sets as many of the c
369. ulk value you must use the readBulkData method or the readNextFrame method of MCattribute In most of the cases it is a value representation of OB OW OD or OF e g Pixel Data Pixel Data tends to be very large and normally you use this method to read the data value a chunk or block at a time This method is the complement to the set Value method described previously You must construct a callback class that implements the MCdataSink interface and then call readBulkData to retrieve the attribute s value The callback class you provide must provide a receiveData method that is called by the library to provide portions of the attribute s value The library calls the receiveData method passing an instance of the MCdata class that innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual contains a reference to the data being provided and a System Object reference to the origin of the data As an example your application could define a MCdataSink class called MyPDStoreCallback whose purpose is to store Pixel Data to an external data sink so that your application uses less primary memory Pseudo code for this class follows class MyPDStoreCallback MCdataSink public String file null public bool isFirst true public void receiveData MCdata data System Object origin if isFirst isFirst false Open pixel data sink e g file here if openFailed throw new MCcallbackCannotComplyE
370. ull System Console Out WriteLine err ToString rr msg getNextValidationError Streaming Attribute Sets When DICOM messages are exchanged over a network they are in an encoded format specified by the DICOM standard and the negotiated transfer syntax Merge DICOM Toolkit calls this encoded format a message stream and supplies powerful methods that allow your applications to work directly with message streams When your application builds or parses attribute sets as described earlier it works with the MCattributeSet objects contained in MCdimseMessage or MCfile objects These MCattributeSet objects abstract and encapsulate the DICOM message and hides its details from the developer When you send a DICOM message over the network Merge DICOM internally creates a DICOM message stream that is passed over the network This message stream is an encoded stream of bytes that follows all the rules of DICOM Merge DICOM Toolkit also supplies methods to generate and read DICOM message streams directly see Figure 13 The methods are available in the MCdimseMessage class and the MCattributeSet class The streamOut method creates a message stream from the contents of an MCdimseMessage object while the streamIn method populates an MCdimseMessage object from a message stream Also streamLength method is supplied to calculate the length of the DICOM stream that would result from using the streamOut call The streamLength method
371. usage of the Merge DICOM Toolkit is to save incoming received from network messages When reading a DICOM message from network attributes in a message are parsed validated before storing them in memory and then later written out from memory objects to a DICOM file With a message that has is a many level of nested items the parsing creating of DICOM attributes in memory have a significant impact in performance Very often the intention of the Storage Raw Unparsed SCP application is to write out the received message content to a DICOM file Messages without the need to modify the attributes of the message When such a case is needed it is best to just save the raw streamed content as quickly and efficiently as possible The following code snippet shows how to save an incoming message into a DICOM file without parsing For detail implementation please refer to samples StorageSCP StorageSCP cs in the distribution folder To read message from the association and save the raw content without parsing the message s dataset use MCassociation readToTag to read only the group 0 part of the message instead of using MCassociation read to read th ntire message content msg assoc readToTag 30000 0x00010000 0001 000 tag is just after group 0 out error Add DICOM Group 2 elements to a new dummy MCfile object using the group 0 elements of msg MCfile fileObj new MCfile Refer to addGroup2Element
372. used when creating new MCproposedContext objects Using the MCvr class The MCvr class encapsulates a DICOM Value Representation VR DICOM defines a set of valid value representations for data elements encoded to the standard The MCvr class contains a number of staticly defined MCvr instances for each of the valid VRs The static field names are MCvr name Value Representation used for Application Entity Attribute Tag Decimal String Floating Point Single Floating Point Double Integer String Other Byte String Other Float String Other Long String Note this was a VR defined in a draft supplement for DICOM that was never adopted Other Word String Person Name Short Sting Sequence of Items innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual MCvr name Value Representation used for Unique Identifier Unsigned Long Unsigned Short Unlimited Text Several Merge DICOM class methods make use of MCvr class references Most often you will be using one of the static values in the MCvr class which encapsulate each of the standard DICOM Value Representations MCvr The MCvr class provides some convenient methods The ToString method is overridden to return a 2 character string that represents this Value ToString Representation For example using the MCvr field vrSQ vrSQ toString returns validateValue SQ The validateValue method can be used to validate the encoding of
373. ust a warning the value is encoded Note that each time the addValue method is called for an attribute another value is added to the attribute s list of values A default string encoder is implemented that will convert between Unicode and many of the DICOM defined character sets If you want to define a string encoder or decoder that is different than the default implementation you must use the MC mcSetStringEncoder method to set your own string encoder and decoder To set values for attributes with value representations of OB OW OD OF use the set Value call which includes MCdataSource as a parameter The MCdataSource class is described further in the following section The setValue may also be used to set values for attributes of types SL SS UL US AT FL and FD Using an MCdataSource Class to Assign an Attribute Value When setting the value of an attribute with a value representation of OB OW OD or OF e g Pixel Data you can create a class that implements the MCdataSource interface and then call the setValue MCdataSource uint method of MCattribute to assign the attribute s value Pixel Data can be very large and you can use this method to supply the data value a block at a time The callback class must provide a provideData method that is called by the library to retrieve portions of the attribute s value The library provides the provideData method which is a bool that is true the first time the method is called
374. ute name MCqidoInstancesA routeTemplate api controller instances defaults new controller MCcontroller MCQIDOCONTROLLER action get 3 config Routes MapHttpRoute name MCqidoInstancesB routeTemplate api controller studies studyInstanceUid instances defaults new controller MCcontroller MCQIDOCONTROLLER action studyinstanceuid 3 config Routes MapHttpRoute name MCqidoInstancesC routeTemplate api controller studies studyInstanceUid series seriesInstanceUid instances defaults new controller MCcontroller MCQIDOCONTROLLER action seriesinstanceuid 3 config Routes MapHttpRoute name MCqidoBind routeTemplate api controller bind qido defaults new controller MCcontroller MCQIDOCONTROLLER action bind 3 config Services Add typeof ModelBinderProvider new MCrequestBinderProvider MCstowController using System using System Collections Generic using System Ling innovative Imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual using System Net Http using System Text using System Threading Tasks using System Web Http using System Web Http ModelBinding using Mergecom using Mergecomws Dicom namespace Mergecomws Web lt summary gt Implements Http Post methods for DICOM STOW RS requests lt summary gt public class MCstowController MCcontroller lt summary gt Class constru
375. ute be specified in DICOM Part 3 as being contained in either a User Optional or Conditional Module Merge DICOM Toolkit treats all such attributes as being value type 3 optional e Also certain modules may be mutually exclusive e g curve and overlay modules in the case of some composite IOD s e g Ultrasound Image Object used in storage services e For normalized services using the N EVENT REPORT command the actual contents of an N EVENT REPORT message are dependent on the Event Type ID being communicated Merge DICOM Toolkit treats all Event Type ID s identically when performing message validation namely it treats all attributes as type 3 An example of the use of the validate method follows The example assumes a An example MCdimseMessage msg was just received and the intent is to validate the message MCdimseMessage msg non null referenc bool validates validates msg validate MCvalidationLevel Errors_Only if validates MCvalidationError err msg getNextValidationError while err null System Console Out WriteLine err ToString rr msg getNextValidationError innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual MCvalidationLevel In this example the application validates the MCdimseMessage object msg at enum the MCvalidationLevel Errors_Only level MCvalidationError MCval idationLevel Errors_And_Warnings could be
376. within the MCattributSet These forms require a uint or MCtag instance to indentify the attribute The following are the two forms of the indexer setting and getting MCattribute instances public MCattribute this uint tag public MCattribute this MCtag tag The following example shows how the indexers can be used to set and get MCattribute instances from the attribute set MCtag tag new MCtag 0x00080010 MCattribute attrib new MCattribute tag MCattributeSet myAttrSet non null referenc myAttrSet tag attrib attrib myAttrSet 0x00080010 innovative imaging Merge DICOM Toolkit V 5 1 0 NET C User s Manual Removing Attributes from an Attribute Set Removing a specific A specific attribute may be removed from an attribute set using the attribute from the set removeAttribute method of the MCattributeSet class The attribute to be removed can be identified by 1 a uint tag reference or 2 by an MCtag reference The removeAttribute methods do not return a value MCattributeSet myAttrSet non null referenc MCtag tag new MCtag 0x0008 0Ox0010 Both of the following accomplish the same thing myAttrSet removeAttribute tag myAttrSet removeAttribute 0x00080010 The second form of the call will throw an MCattributeNotFoundException if the attribute is not in the set Attribute Properties Getting setting The MCattribute class provides three methods to retrieve or set properties of the
377. xception byte array data ManagedBuffer int size data Length Store size bytes of the array in the pixel data sink if storeFailed throw new MCcallbackCannotComplyException if data IsLast close the data sink here return This callback is called by the Merge DICOM NET Library only when triggered by your application For example your application might use MyPDStoreCallback to retrieve the value of the TAG_PIXEL_DATA attribute 7FE0 0010 as follows MCdataSet ds non null referenc MyPDStoreCallback cb new MyPDStoreCallback cb file MypixelDataFile try MCattribute attrib ds MCdicom PIXEL_DATA attrib readBulkData cb catch MCexception e On making this call the toolkit library will repetitively call the receiveData method of the MyPDStoreCallback class until all the pixel data has been retrieved from the attribute without any errors Storing or setting aside Pixel Data a block at a time is especially useful for very large Pixel Data and or on platforms with resource e g memory limitations In this case you would also want to set LARGE_DATA_STORE to the value FILE in the Service Profile so that Merge DICOM Toolkit will also maintain the pixel data value stored in the attribute set in a temporary file innovative imaging NET C User s Manual Merge DICOM Toolkit V 5 1 0 MCfileDataSink MCstreamDataSink MCmemoryData
378. xist In the DICOM Standard Finally the DICOM file can be padded at the end with the Data Set Trailing Padding attribute FFFC FFFC whose value is specified by the standard to have no significance File Sets DICOM Files must be stored on removable media in a DICOM File Set A DICOM file set is defined as a collection of DICOM files sharing a common naming space within which file ID s are unique e g a file system partition A DICOM File Set ID is a string of up to 16 characters that provides a name for the file set A File ID is a name given to a DICOM file that is mapped to each media format specification in Part 12 of DICOM A file ID consists of an ordered sequence of one to eight components where each component is a string of one to eight characters One can certainly imagine mapping such a file ID to a hierarchical file system and this is done for several media formats in Part 12 It is important to note that DICOM states that no semantic relationship between DICOM files shall be conveyed by the contents or structure of file ID s e g the hierarchy This helps insure that DICOM files can be stored in a media format and file system independent manner The allowed characters in both a file ID s and file set ID s are a subset of the ASCII character set consisting of the uppercase characters A Z the numerals 0 9 and the underscore _ innovative imaging NET C User s Manual Merge DICOM Toolkit V
379. y Conformance Part 2 of DICOM discusses conformance and is important to any AE developer For an application to be DICOM conformant it must e meet the minimum general conformance requirements specified in Part 2 and service specific conformance requirements specified in Part 4 Network Services and or Parts 10 and 11 Media Services e have a published DICOM conformance statement detailing the above conformance and any optional extensions Conformance also applies to aspects of the communications protocol that are managed by the DICOM Toolkit Most parameters are configurable by your application The conformance statement for the Merge DICOM Toolkit in Appendix C DICOM Conformance Statement lists all these protocol parameters and how they can be configured Part 2 also deals with private extensions to the DICOM Standard by defining Standard Extended Services Standard Extended Services give your application a little more flexibility by allowing you to add private attributes as long as they are of value type 3 optional and are documented in the conformance statement DICOM also allows you to define your own Specialized and Private Services These should be avoided by most applications since they are non standard add complexity to your application and limit interoperability If you are significantly extending services or creating your own private services you may need the Merge DICOM Toolkit Extended Toolkit to assist in definin
Download Pdf Manuals
Related Search
Related Contents
Conditions d`occupation du personnel agricole Massive Suspension light 40147/17/10 Model 321 - Lake Shore Cryotronics, Inc. Page 4 Excalibur electronic Docker 976 User's Manual Gants de protection dans les garages automobiles - Carsat Nord-Est Copyright © All rights reserved.
Failed to retrieve file