Internal Use
PRIDE and XML data format
MR ACD / PRIDE
AUTHOR: Helga van Vroonhoven
DOC. ID: XJS155-9835
REV. LEVEL: 1.0
DATE: 2008-09-25
Philips Medical Systems
RAD Philips’ proprietary, 2008 Philips Electronics N.V. All rights reserved
XJS155-9835 / 1.0 PRIDE and XML data format Page 2 of 10
MR ACD 2008-09-25
Table of Contents
1. Introduction..............................................................................................................3
1.1. Purpose.........................................................................................................................................3
1.2. Scope............................................................................................................................................3
1.3. History..........................................................................................................................................3
1.4. Definition of terms and abbreviations..........................................................................................3
2. Why Update PRIDE PAR/REC.............................................................................4
2.1. Note on DRIN..............................................................................................................................4
3. PAR/REC XML Format....................................................................................5
3.1. PRIDE PC software......................................................................................................................5
3.2. Host software...............................................................................................................................6
3.2.1. Packman tools..............................................................................................................................6
4. Conversion of PRIDE Applications......................................................................8
4.1. Differences between the PAR and XML parameter files..............................................................8
4.2. Other code adaptation...................................................................................................................9
4.3. Converting PAR files to the XML format....................................................................................9
5. Adding new parameters to the XML file.................................................................10
RAD Philips’ proprietary, © 2008 Philips Electronics N.V. All rights reserved
XJS155-9835 / 1.0 PRIDE and XML data format Page 3 of 10
MR ACD 2008-09-25
1. Introduction
PRIDE is proving to be rather intensive to maintain.
Also, small changes, especially to the data format, end up being completely un-understandable and
confusing to end-users (and developers). For instance the many different versions of tools that exist
out there.
1.1. Purpose
Make PRIDE a little more future-proof, easy to maintain and easy to install.
Especially when the direct patient database connection is not required.
PRIDE should be a very compact library in this case.
Make it as less dependent of the product SW as possible.
Get rid of the various PAR/REC file versions.
1.2. Scope
Involves all users, currently running PRIDE.
The IDL platform at present is a given.
1.3. History
Date Leve Editor Description
l
2008-02-14 0.1 Helga van Vroonhoven First Draft.
2008-09-25 1.0 Helga van Vroonhoven Revised after implementation
1.4. Definition of terms and abbreviations
Term Description
PRIDE Philips Research Imaging Development Environment
DRIN Direct Reconstruction INterface
*.PAR The parameter file, describing the dataset parameters (ASCII)
*.REC The binary image data file.
XML Extensible Markup Language
IDL Interactive Data Language
RAD Philips’ proprietary, © 2008 Philips Electronics N.V. All rights reserved
XJS155-9835 / 1.0 PRIDE and XML data format Page 4 of 10
MR ACD 2008-09-25
2. Why Update PRIDE PAR/REC
Since PRIDE was created (for scanner R7) it hasn’t seen any really significant updates except for
some data model changes. It’s time to investigate what PRIDE needs to be able to do at present and in
the future to stay useful and easier to maintain.
Below is a list of items which have been raised at one time or another regarding the functionality of
PRIDE:
Every time the data model has been updated, it has caused chaos.
One of the most important things is to have the data format changeable without causing this
chaos, currently found between V3, V4 and V4.1
Requests have been made regarding the PAR/REC data format:
the most important issue was to make the parameter file customizable.
The scanner will migrate to an IRC database to replace Sybase. Choose a solution where it is
no longer needed to install Sybase or in the future IRC on the PRIDE PC.
Make PRIDE simpler to use, especially for just end users trying to evaluate tools.
2.1. Note on DRIN.
The dll’s, needed on the PRIDE PC to facilitate PRIDE applications to use the Direct Recon Interface,
will still be release dependant. By the build of these dll’s product release software is included.
DRIN itself is included in the reconstruction software under a Clinical Science key.
The 6 dll’s involved are:
awdll_nu.dll dbclientdll_nu.dll dbclientutility_nu.dll
dmicom_nu.dll p_prfr_pfclient_nu.dll p_objs_objectstreamer_nu.dll
In the future the required set of these dll’s for a certain release will be avalaible on the PRIDE Intranet
site.
RAD Philips’ proprietary, © 2008 Philips Electronics N.V. All rights reserved
XJS155-9835 / 1.0 PRIDE and XML data format Page 5 of 10
MR ACD 2008-09-25
3. PAR/REC XML Format
3.1. PRIDE PC software.
Instead of the so-called rw_common convenient files to access PAR/REC files and to make the
connection to the patient database a new set of files called PRIDE_data_funcs have been implemented
to handle XML files.
These new set of files will fill the series and image attributes for the application to be used in the same
way as before. There is also an executable available that can retrieve data from the scanner’s patient
database. This executable is started whenever the application requests data from the patient database
and it will write a temporary XML file in the directory DBIEX_Data on the PRIDE PC for further
automatic processing.
Standard MS Windows Remoting is used to accomplish the connection between the client on the
PRIDE PC and the server on the scanner. A TCL/IP connection is needed for the data transfer, using
port 6555.
The following software is required on the PRIDE PC:
PRIDE\bin\:
PRIDE_DataSelectionModel.xml - XML definition file
PRIDE_Series_Template.xml - XML definition file
philips.pmsmr.viewingprocessing.pridexml.dbaccess_cs.dll
- For connection with the patient database
PrideDBSelector.exe - Client for connection with the server on the host to select
and retrieve patient data.
Pride_ic.dll, Pride_ic_idl.dll and Pride_ic_utils.dll are required in order to still be able to read PAR
V4.* files.
In order to implement the reading of PAR/REC and XML files plus the ability to connect to the
patient database in the IDL application the following software is requires:
PRIDE\PRIDE_data_funcs:
pride_compare_struct.pro
pride_define_symbols.pro
pride_enum_definitions.pro
pride_file_browser__define.pro
pride_image__define.pro
pride_series__define.pro
pride_xml_access__define.pro
In order to read a PAR V 4.* file:
rw_file_browser__define.pro
rw_image__define.pro
rw_mr_datamodel__define.pro
rw_standard_functions.pro
RAD Philips’ proprietary, © 2008 Philips Electronics N.V. All rights reserved
XJS155-9835 / 1.0 PRIDE and XML data format Page 6 of 10
MR ACD 2008-09-25
3.2. Host software.
This software is needed for the connection to the host, to select the required series and to compose a
proper XML file. The PRIDE client creates a standard remote connection with the host with the
server, running there. The server is created after the user has allowed access via the Packman tool
Pride_XS_XML. The interfaces are registered and the connection is ready for use. The client uses the
interfaces to make data selection from the patient database possible (IPrideDbWalker).
The data selection is handled via ROIDS. A hash table is filled with strings, because it is used for
display only. The second interface called IPrideExport is created via .NET Remoting for the actual
retrieval of the data. This interface accepts a XML template and returns a version of the XML with the
required data included.
There are 4 dll’s implemented that should be stored on the host in the directory:
C:\Program Files (x86)\PMS\Mipnet42
The software will be stored in the development SW archive in the viewingprocessing\pride\pridexml
building block. This software implements the server on the host.
The needed dll’s will be targeted like any other product software dll.
The dll’s involved are:
philips.pmsmr.viewingprocessing.pridexml.dbaccess_cs.dll:
includes the data model to identify the database items, also stored on the PRIDE PC.
implements the IPrideExport interface.
philips.pmsmr.viewingprocessing.pridexml.dbconnection_cs.dll:
wrapper class to access the patient database
philips.pmsmr.viewingprocessing.pridexml.dbwalker_cs.dll:
makes data selection possible by walking through the database and showing to the user the
available options.
philips.pmsmr.viewingprocessing.pridexml.xmlwriter_cs.dll:
writes the actual XML file
Advantage: these dll’s are automatically with every next scanner release since they are going to
targeted from the product SW archive.
The XML definition files PRIDE_DataSelectionModel.xml and PRIDE_Series_Template.XML
also need to be present and they have to be the same as on the PRIDE PC.
3.2.1. Packman tools.
General remarks:
the Packman tools and the needed dll’s will be targeted as if it is product SW.
So they will always be available on the scanner from R 2.6.1 and up.
The existing tool dbimexp is still being able to export PAR/REC V 4.2 files.
The existing tool pridexs to facilitate the access of a PRIDE R2.5 to the patient database will still be
present.
Two new Packman tools are added, namely PrideXS_XML and writeXML.
1. Allowing the PRIDE PC access to the patient database: PrideXS_XML.
On the nmr\gyroscan\addons directory a new version of the Pride access tool is needed, called
PrideXS_XML.exe. This tool allows and facilitates the connection between the scanner and the
PRIDE PC. The check on SW key 39 is included as before.
The files pridexsproc_win_cs.exe and pridexsproc_win_cs.exe.config are needed in the directory
RAD Philips’ proprietary, © 2008 Philips Electronics N.V. All rights reserved
XJS155-9835 / 1.0 PRIDE and XML data format Page 7 of 10
MR ACD 2008-09-25
C:\Program Files (x86)\PMS\Mipnet42 to make this SW key checking possible. The needed product
SW dll’s are stored here, so must these files be in order to run properly.
2. Export patient data from the database to be stored in a XML and REC file: writeXML.
This tool is called writeXML.exe. In order to extract XML/REC files from the patient database on the
scanner a version of the PrideDBSelector.exe, also present on the PRIDE PC and here named
pridedbselector_win_cs.exe, is available on the scanner.
Instead of retrieving the data via a remote connection the connection only lives on “localhost”. This
makes it possible to use the same executable for retrieving data via the remote connection as well as
writing a XML and REC file locally.
Besides the mentioned executable pridedbselector_win_cs.exe and its accompanying file
pridedbselector_win_cs.exe.config the file pridedbselectproc_win_cs.exe and its accompanying file
pridedbselectproc_win_cs.exe.config are also needed and stored in the directory C:\Program Files
(x86)\PMS\Mipnet42. The executable pridedbselectproc_win_cs.exe takes care of the SW key check
(SW key 43). These files need to be sited here because they use dll’s (both PRIDE specific as general
dll’s), stored in this directory.
Mind that also SW key 39 must be available, due to the fact that the same mechanism is used as in the
remote database access.
Note: In case the PrideXS tool is running an error pops up, because the same executable is started to
allow database access. You can ignore this error message. The tool will perform correctly.
RAD Philips’ proprietary, © 2008 Philips Electronics N.V. All rights reserved
XJS155-9835 / 1.0 PRIDE and XML data format Page 8 of 10
MR ACD 2008-09-25
4. Conversion of PRIDE Applications.
Here the steps are described to modify a PRIDE V4.* tool to a tool that can read both PAR V 4.* files
as well as XML files. Convenient files are present to facilitate the conversion.
NOTE: Since the Packman tool dbimexp is still available it is possible to create PAR/REC V 4.2 files
on a R 2.6 scanner. So previously developed PRIDE tools that accept PAR/REC V4.2 as input can still
be used to process patient data from a R 2.6 scanner.
4.1. Differences between the PAR and XML parameter files.
First of all the differences between the parameter files that might affect the code.
1. The following derived series attribute is no longer present: experimental_data indicator.
The following derived series attributes are no longer present, but can be retrieved in a different way:
2. no_image_sequence_types and image_sequence_types_array:
this information is present in the image key element type.
Below you will find example code on how to establish whether or not we have complex data.
Old way:
general_attributes = *(info.series_object->get_attributes())
imtype_r_ok = 0
imtype_i_ok = 0
dataiscomplex = 0
IF(general_attributes.no_image_seq_types GT 1) THEN BEGIN
FOR k=0,general_attributes.no_image_seq_types-1 DO BEGIN
IF(general_attributes.image_seq_types[k].type EQ 1 ) THEN imtype_r_ok = 1
IF(general_attributes.image_seq_types[k].type EQ 2 ) THEN imtype_i_ok = 1
ENDFOR
IF(imtype_r_ok > 0) AND (imtype_i_ok > 0) THEN dataiscomplex = 1
New way:
keys = *(info.series_object->get_image_key_list())
size_keys = size(keys)
; Then examine the image keys list.
IF(size_keys[1] GT 1) THEN BEGIN
k=0
WHILE((dataiscomplex NE 1) AND (k LT size_keys[1])) DO BEGIN
IF(keys[k].type EQ 1 ) THEN imtype_r_ok = 1
IF(keys[k].type EQ 2 ) THEN imtype_i_ok = 1
IF(imtype_r_ok > 0) AND (imtype_i_ok > 0) THEN dataiscomplex = 1
k=k+1
ENDWHILE
3. pixel_spacing_x and pixel_spacing_y:
in the database these parameters are stored as an array called pixel_spacing[x,y].
In the XML parameter file it will be transferred as such.
So make the following change:
pixel_spacing_x -> pixel_spacing[0]
RAD Philips’ proprietary, © 2008 Philips Electronics N.V. All rights reserved
XJS155-9835 / 1.0 PRIDE and XML data format Page 9 of 10
MR ACD 2008-09-25
pixel_spacing_y -> pixel_spacing[1]
4.2. Other code adaptation.
1. Please change the line in which the general data interface library initialization is performed:
rw_define_symbols in pride_define_symbols.
2. Make sure that the following parameters are present in the info structure:
a. DB_connection: 0, $; Is there a database connection
b. input_data_type: 1, $; 0 = PAR, 1 = XML
3. Replace the code where you read in the input data by the following lines:
new_parrec_wid = WIDGET_BUTTON(data_menu, $
VALUE='Select Series From Disk: PAR file', $
EVENT_PRO='rw_select_new_seriesPAR_cb')
new_xmlrec_wid = WIDGET_BUTTON(data_menu, $
VALUE='Select Series From Disk: XML file', $
EVENT_PRO='rw_select_new_seriesXML_cb')
new_DBseries_wid = WIDGET_BUTTON(data_menu, $
VALUE='Select Series From Database', $
EVENT_PRO='rw_select_new_seriesDB_cb')
Please notice that these are new callback functions, implemented in the source file
rw_standard_functions.pro (in the directory C:\PRIDE\PRIDE_data_funcs).
If you have written your own function to read the data you can examine the rw_read_data function in
the source file rw_standard_functions.pro for the differences.
Example tools are available on the PRIDE Installation CD, like the application ProcFrameExample.
4.3. Converting PAR files to the XML format.
If you want to convert a PAR parameter file to XML, please do the following:
Run the ex_subtraction.sav file in the directory C:\PRIDE\Applications\ex_sample\mak.
Read in the PAR file and then push the button <Save Current Series to Disk: FileName>.
A XML/REC file pair will be stored in the entered directory.
Remember: the REC file will be identical.
RAD Philips’ proprietary, © 2008 Philips Electronics N.V. All rights reserved
XJS155-9835 / 1.0 PRIDE and XML data format Page 10 of 10
MR ACD 2008-09-25
5. Adding new parameters to the XML file.
The file, in which the contents of the xml file is defined, is called PRIDE_Series_Template.xml.
There are 2 sections: Series_Info and Image_array containing Image_Info. The last one has 1 sub
section, called Key.
One example line of a series attribute:
<Attribute Name="Max No Slices" Tag="0x20011018" Level="MRSeries" Type="Int32"/>
One example line of an image attribute:
<Attribute Name="Slice Thickness" Tag="0x00180050" Type="Double"/>
So if you want to add an attribute you must know to what section that attribute belongs and for the
series attributes you must know the level: Patient, Study, Examination, MRSeries, etc.
In most cases you just want to add a MR series or an image attribute.
Then you need to know the PIIM data attribute tag and the type.
.Example:
You want to export the calculated whole body Specific Absorption Rate for proton in Watts/kg.
Add in the Series_Info section the following line:
<Attribute Name="Proton SAR" Tag="0x2005142F" Level="MRSeries" Type="Float"/>
Or you want to add to the Image_Info an image attribute:
<Attribute Name="Spacing Between Slices" Tag="0x00180088" Type="Double"/>
There are two GOLDEN rules:
1. Only add parameters, never remove one.
2. Make sure that the file PRIDE_Series_Template.xml on the PRIDE PC in the directory
C:\PRIDE\bin and on the scanner in the directory C:\Program Files (x86)\PMS\Mipnet42
are identical !
If you add parameters it will not interfere with your colleagues work.
They might not use these parameters, but they will also not be bothered by it.
<<< END OF DOCUMENT >>>
RAD Philips’ proprietary, © 2008 Philips Electronics N.V. All rights reserved