Skip Headers
Oracle® Multimedia DICOM Developer's Guide
11g Release 1 (11.1)

B28416-03
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

6 DICOM Relational Interface Reference

Application developers, who create medical imaging applications without using the Oracle Multimedia ORDDicom object type to store and manage medical image data in relational tables, and who do not want to migrate their existing medical image applications to use Oracle Multimedia ORDDicom objects, can use the Oracle Multimedia DICOM relational interface for managing their medical image data.

The DICOM relational interface defines the ORD_DICOM PL/SQL package. This package provides the same features as those provided by the ORDDicom object interface in the relational environment. The DICOM relational interface adds Oracle Multimedia support to medical image data stored in BLOBs and BFILEs rather than in the ORDDicom object type.

The ORD_DICOM package is defined in the ordcpksp.sql file. After installation, this file is available in the Oracle home directory at:

<ORACLE_HOME>/ord/im/admin (on Linux and UNIX)

<ORACLE_HOME>\ord\im\admin (on Windows)

Oracle Multimedia contains the following information about the DICOM relational interface:

This chapter describes the functions and procedures in the DICOM relational interface. For information about other DICOM application programming interfaces (APIs), see the following chapters:

See Oracle Multimedia DICOM Java API Reference for information about the DICOM Java API.

6.1 DICOM Relational Example Media Table and Directory Definition

The functions and procedures described in this reference chapter show examples based on the MEDICAL_IMAGE_REL table, which these examples create in the Product Media (PM) sample schema. Refer to the MEDICAL_IMAGE_REL table definition that follows when reading through the examples. See Oracle Database Sample Schemas for information about the sample schemas.

Before using DICOM relational interface functions and procedures, you must load some data into the table. For example, you can use SQL*Loader or the importFrom( ) method. Substitute DICOM files you have for the ones shown in the examples.

6.1.1 Directory Definition

The following statements must be issued before executing the examples, where /mydir/work is the directory where the user pm can find the DICOM files:

CREATE OR REPLACE DIRECTORY DICOMDIR as '/mydir/work';
GRANT READ, WRITE ON DIRECTORY DICOMDIR TO pm;

6.1.2 MEDICAL_IMAGE_REL Table Definition

Before loading data into the table, you must create the table and columns where the data is to be stored. The following PL/SQL code segment creates the MEDICAL_IMAGE_REL table with five columns.

CONNECT pm

Enter password: password

CREATE TABLE MEDICAL_IMAGE_REL
(
 id            integer primary key,
 blob_src      blob,
 bfile_src     bfile,
 image_src     ordsys.ordimage,
 blob_dest     blob
);
COMMIT;

where:

  • blob_src: the source DICOM content in the BLOB.

  • bfile_src: the source DICOM content in the BFILE.

  • image_src: the source DICOM content in the ORDImage object.

  • blob_dest: the destination DICOM content in the BLOB.


DICOM Relational Functions

The ORD_DICOM package defines the following DICOM relational functions:


extractMetadata( ) for BFILEs

Format

extractMetadata ( data IN BFILE, extractOption IN VARCHAR2 DEFAULT 'ALL', docName IN VARCHAR2 DEFAULT 'ordcmmp.xml') RETURN SYS.XMLTYPE

Description

Returns the DICOM metadata as XML code for a specified mapping document. The default mapping document refers to the default metadata namespace http://xmlns.oracle.com/ord/dicom/metadata_1_0.

Parameters

data

The input DICOM content stored in a BFILE.

extractOption

A string that specifies the types of metadata to extract from the DICOM content. Valid values are: 'ALL', 'MAPPED', and 'STANDARD'. The default is 'ALL'.

When the value of the extractOption parameter is 'ALL', all the attributes in the DICOM content are extracted. When the value is set to 'MAPPED', only mapped attributes are extracted. And, when the value is set to 'STANDARD', only attributes that conform to the DICOM standard and mapped attributes are extracted.

docName

The name of the mapping document. The default mapping document 'ordcmmp.xml' is loaded during installation. This document refers to the default metadata namespace http://xmlns.oracle.com/ord/dicom/metadata_1_0.

Pragmas

None.

Exceptions

None.

Usage Notes

None.

Examples

Extract metadata from the DICOM content stored in a BFILE:

declare
  src bfile;
  metadata xmltype;
begin
  select bfile_src into src from medical_image_rel where id = 1 for update;
  metadata := ord_dicom.extractMetadata(src, 'all', 'ordcmmp.xml');
end;
/

extractMetadata( ) for BLOBs

Format

extractMetadata ( data IN BLOB, extractOption IN VARCHAR2 DEFAULT 'ALL', docName IN VARCHAR2 DEFAULT 'ordcmmp.xml') RETURN SYS.XMLTYPE

Description

Returns the DICOM metadata as XML code for a specified mapping document. The default mapping document refers to the default metadata namespace http://xmlns.oracle.com/ord/dicom/metadata_1_0.

Parameters

data

The input DICOM content stored in a BLOB.

extractOption

A string that specifies the types of metadata to extract from the DICOM content. Valid values are: 'ALL', 'MAPPED', and 'STANDARD'. The default is 'ALL'.

When the value of the extractOption parameter is 'ALL', all the attributes in the DICOM content are extracted. When the value is set to 'MAPPED', only mapped attributes are extracted. And, when the value is set to 'STANDARD', only attributes that conform to the DICOM standard and mapped attributes are extracted.

docName

The name of the mapping document. The default mapping document 'ordcmmp.xml' is loaded during installation. This document refers to the default metadata namespace http://xmlns.oracle.com/ord/dicom/metadata_1_0.

Pragmas

None.

Exceptions

None.

Usage Notes

None.

Examples

Extract metadata from the DICOM content stored in a BLOB:

declare
  src blob;
  metadata xmltype;
begin
  select blob_src into src from medical_image_rel where id = 1 for update;
  metadata := ord_dicom.extractMetadata(src, 'all', 'ordcmmp.xml');
end;

extractMetadata( ) for ORDImage

Format

extractMetadata ( data IN ORDSYS.ORDImage, extractOption IN VARCHAR2 DEFAULT 'ALL', docName IN VARCHAR2 DEFAULT 'ordcmmp.xml') RETURN SYS.XMLTYPE

Description

Returns the DICOM metadata as XML code for a specified mapping document. The default mapping document refers to the default metadata namespace http://xmlns.oracle.com/ord/dicom/metadata_1_0.

Parameters

data

The input DICOM content stored in an ORDImage object.

extractOption

A string that specifies the types of metadata to extract from the DICOM content. Valid values are: 'ALL', 'MAPPED', and 'STANDARD'. The default is 'ALL'.

When the value of the extractOption parameter is 'ALL', all the attributes in the DICOM content are extracted. When the value is set to 'MAPPED', only mapped attributes are extracted. And, when the value is set to 'STANDARD', only attributes that conform to the DICOM standard and mapped attributes are extracted.

docName

The name of the mapping document. The default mapping document 'ordcmmp.xml' is loaded during installation. This document refers to the default metadata namespace http://xmlns.oracle.com/ord/dicom/metadata_1_0.

Pragmas

None.

Exceptions

None.

Usage Notes

None.

Examples

Extract metadata from the DICOM content stored in an ORDImage object:

declare
  src ordimage;
  metadata xmltype;
begin
  select image_src into src from medical_image_rel where id = 1 for update;
  metadata := ord_dicom.extractMetadata(src, 'all', 'ordcmmp.xml');
end;
/

isAnonymous( ) for BFILEs

Format

isAnonymous( src IN BFILE, anonymityDocName IN VARCHAR2 DEFAULT 'ordcman.xml') RETURN INTEGER

Description

Determines whether or not the input DICOM content is anonymous, using a specified anonymity document. This function returns a value of 1 if the data is anonymous, otherwise it returns a value of 0.

Parameters

src

The input DICOM content stored in a BFILE.

anonymityDocName

The name of the anonymity document. The default name is'ordcman.xml'.

Pragmas

None.

Exceptions

None.

Usage Notes

None.

Examples

Check if the DICOM content stored in a BFILE is anonymous:

select ord_dicom.isAnonymous(t.bfile_src, 'ordcman.xml') 
  from medical_image_rel t where id = 1;

isAnonymous( ) for BLOBs

Format

isAnonymous( src IN BLOB, anonymityDocName IN VARCHAR2 DEFAULT 'ordcman.xml') RETURN INTEGER

Description

Determines whether or not the input DICOM content is anonymous, using a specified anonymity document. This function returns a value of 1 if the data is anonymous, otherwise it returns a value of 0.

Parameters

src

The input DICOM content stored in a BLOB.

anonymityDocName

The name of the anonymity document. The default name is 'ordcman.xml'.

Pragmas

None.

Exceptions

None.

Usage Notes

None.

Examples

Check if the DICOM content stored in a BLOB is anonymous:

select ord_dicom.isAnonymous(t.blob_src, 'ordcman.xml') 
  from medical_image_rel t where id = 1;

isAnonymous( ) for ORDImage

Format

isAnonymous( src IN ORDSYS.ORDImage, anonymityDocName IN VARCHAR2 DEFAULT 'ordcman.xml') RETURN INTEGER

Description

Determines whether or not the input DICOM content is anonymous, using a specified anonymity document. This function returns a value of 1 if the data is anonymous, otherwise it returns a value of 0.

Parameters

src

The input DICOM content stored in an ORDImage object.

anonymityDocName

The name of the anonymity document. The default name is 'ordcman.xml'.

Pragmas

None.

Exceptions

None.

Usage Notes

None.

Examples

Check if the DICOM content stored in an ORDImage object is anonymous:

select ord_dicom.isAnonymous(t.image_src, 'ordcman.xml') 
  from medical_image_rel t where id = 1;

isConformanceValid( ) for BFILEs

Format

isConformanceValid ( src IN BFILE, constraintName IN VARCHAR2 ) RETURN INTEGER

Description

Performs a conformance validation check to determine whether or not the input DICOM content conforms to a specified set of constraints identified by the constraintName parameter. This method returns a value of 1 if conformance is valid, otherwise it returns a value of 0. This method also logs error messages from the constraint documents, which can be viewed by querying the public information view orddcm_conformance_vld_msgs (see Chapter 4).

Parameters

src

The input DICOM content stored in a BFILE.

constraintName

The name of the constraint to be used for conformance validation checking.

Pragmas

None.

Exceptions

None.

Usage Notes

If this method is called from a SQL query, ensure that the constraint rule definition does not contain any <ACTION> elements.

Examples

Delete any existing conformance validation messages. Check if the DICOM content stored in a BFILE is conformance valid. Then, show any new conformance validation messages that are generated.

 -- clear the previous conformance validation messages
delete from orddcm_conformance_vld_msgs;

-- conformance validate the DICOM content
    declare
      src bfile;
    begin
      select bfile_src into src from medical_image_rel where id = 1;
      dbms_output.put_line('isConformanceValid(PatientModule) ' ||
        ord_dicom.isConformanceValid(src, 'PatientModule'));
    end;
    /

-- get the logged conformance validation messages
select message, msg_time time from orddcm_conformance_vld_msgs
  where rule_name='PatientModule';

isConformanceValid( ) for BLOBs

Format

isConformanceValid ( src IN BLOB, constraintName IN VARCHAR2 ) RETURN INTEGER

Description

Performs a conformance validation check to determine whether or not the input DICOM content conforms to a specified set of constraints identified by the constraintName parameter. This method returns a value of 1 if conformance is valid, otherwise it returns a value of 0. This method also logs error messages from the constraint documents, which can be viewed by querying the public information view orddcm_conformance_vld_msgs (see Chapter 4).

Parameters

src

The input DICOM content stored in a BLOB.

constraintName

The name of the constraint to be used for conformance validation checking.

Pragmas

None.

Exceptions

None.

Usage Notes

If this method is called from a SQL query, ensure that the constraint rule definition does not contain any <ACTION> elements.

Examples

Delete any existing conformance validation messages. Check if the DICOM content stored in a BLOB is conformance valid. Then, show any new conformance validation messages that are generated.

-- clear the previous conformance validation messages
delete from orddcm_conformance_vld_msgs;

-- conformance validate the DICOM content
    declare
      src blob;
    begin
      select blob_src into src from medical_image_rel where id = 1;
      dbms_output.put_line('isConformanceValid(PatientModule) ' ||
       ord_dicom.isConformanceValid(src, 'PatientModule'));
    end;
    /

-- get the logged conformance validation messages
select message, msg_time time from orddcm_conformance_vld_msgs
  where rule_name='PatientModule';

isConformanceValid( ) for ORDImage

Format

isConformanceValid ( src IN ORDSYS.ORDImage, constraintName IN VARCHAR2 ) RETURN INTEGER

Description

Performs a conformance validation check to determine whether or not the input DICOM content conforms to a specified set of constraints identified by the constraintName parameter. This method returns a value of 1 if conformance is valid, otherwise it returns a value of 0. This method also logs error messages from the constraint documents, which can be viewed by querying the public information view orddcm_conformance_vld_msgs (see Chapter 4).

Parameters

src

The input DICOM content stored in an ORDImage object.

constraintName

The name of the constraint to be used for conformance validation checking.

Pragmas

None.

Exceptions

None.

Usage Notes

If this method is called from a SQL query, ensure that the constraint rule definition does not contain any <ACTION> elements.

Examples

Delete any existing conformance validation messages. Check if the DICOM content stored in an ORDImage object is conformance valid. Then, show any new conformance validation messages that are generated.

-- clear the previous conformance validation messages
delete from orddcm_conformance_vld_msgs;

-- conformance validate the DICOM content
    declare
      src ordimage;
    begin
      select image_src into src from medical_image_rel where id = 1;
      dbms_output.put_line('isConformanceValid(PatientModule) ' ||
       ord_dicom.isConformanceValid(src, 'PatientModule'));
    end;
    / 

-- get the logged conformance validation messages
select message, msg_time time from orddcm_conformance_vld_msgs
  where rule_name='PatientModule';

DICOM Relational Procedures

The ORD_DICOM package defines the following DICOM relational procedures:


createDICOMImage( ) for BFILEs

Format

createDICOMImage ( src IN BFILE, metadata IN SYS.XMLTYPE, dest IN OUT NOCOPY BLOB)

Description

Creates a DICOM image from a source image and DICOM metadata.

Parameters

src

The source raster image stored in a BFILE.

metadata

DICOM metadata stored in data type XMLType. The metadata must include all the standard and private attributes. It must include a new SOP instance UID for the destination DICOM image, ensuring that the destination DICOM content is globally unique.

dest

An empty BLOB in which to store the DICOM image created from the source image and metadata.

Pragmas

None.

Exceptions

None.

Usage Notes

See Appendix C for information about the encoding rules that support image content processing.

Examples

Create a DICOM image from a source BFILE and DICOM metadata:

declare
  src bfile;
  dest blob;
  metadata xmltype;
begin
  metadata := xmltype(bfilename('DICOMDIR', 'wm_meta.xml'), 
                      nls_charset_id('AL32UTF8'), 
                      'http://xmlns.oracle.com/ord/dicom/metadata_1_0');
 
  select bfile_src, blob_dest into src, dest from medical_image_rel 
    where id = 1 for update;
 
  ord_dicom.createDicomImage(src, metadata, dest);
end;
/

createDICOMImage( ) for BLOBs

Format

createDICOMImage ( src IN BLOB, metadata IN SYS.XMLTYPE, dest IN OUT NOCOPY BLOB)

Description

Creates a DICOM image from a source image and DICOM metadata.

Parameters

src

The source raster image stored in a BLOB.

metadata

DICOM metadata stored in data type XMLType. The metadata must include all the standard and private attributes. It must include a new SOP instance UID for the destination DICOM image, ensuring that the destination DICOM content is globally unique.

dest

An empty BLOB in which to store the DICOM image created from the source image and metadata.

Pragmas

None.

Exceptions

None.

Usage Notes

See Appendix C for information about the encoding rules that support image content processing.

Examples

Create a DICOM image from a source BLOB and DICOM metadata:

declare
  src blob;
  dest blob;
  metadata xmltype;
begin
  metadata := xmltype(bfilename('DICOMDIR', 'wm_meta.xml'), 
                      nls_charset_id('AL32UTF8'), 
                      'http://xmlns.oracle.com/ord/dicom/metadata_1_0');
 
  select blob_src, blob_dest into src, dest from medical_image_rel 
    where id = 1 for update;
 
  ord_dicom.createDicomImage(src, metadata, dest);
end;
/

createDICOMImage( ) for ORDImage

Format

createDICOMImage ( src IN ORDSYS.ORDImage, metadata IN SYS.XMLTYPE, dest IN OUT NOCOPY BLOB)

Description

Creates a DICOM image from a source image and DICOM metadata.

Parameters

src

The source raster image stored in an ORDImage object.

metadata

DICOM metadata stored in data type XMLType. The metadata must include all the standard and private attributes. It must include a new SOP instance UID for the destination DICOM image, ensuring that the destination DICOM content is globally unique.

dest

An empty BLOB in which to store the DICOM image created from the source image and metadata.

Pragmas

None.

Exceptions

None.

Usage Notes

See Appendix C for information about the encoding rules that support image content processing.

Examples

Create a DICOM image from a source ORDImage object and DICOM metadata:

declare
  src ordimage;
  dest blob;
  metadata xmltype;
begin
  metadata := xmltype(bfilename('DICOMDIR', 'wm_meta.xml'), 
                      nls_charset_id('AL32UTF8'), 
                      'http://xmlns.oracle.com/ord/dicom/metadata_1_0');
 
  select image_src, blob_dest into src, dest from medical_image_rel 
    where id = 1 for update;
 
  ord_dicom.createDicomImage(src, metadata, dest);
end;
/

export( )

Format

export( src IN BLOB, dest_type IN VARCHAR2, dest_location IN VARCHAR2, dest_name IN VARCHAR2)

Description

Exports DICOM content in a BLOB to a specified destination. The data remains in the source BLOB when it is copied to the destination.

Parameters

src

The source location of the DICOM content.

dest_type

The type of the destination (only 'FILE' is supported).

dest_location

The location of the destination (must be a valid Oracle directory object).

dest_name

The name of the destination file.

Pragmas

None.

Exceptions

None.

Usage Notes

None.

Examples

Export DICOM content from a BLOB to a specified file:

declare
  src blob;
begin
  select blob_src into src from medical_image_rel where id = 1;
  ord_dicom.export(src, 'FILE', 'DICOMDIR', 'exported.dcm');
end;
/

importFrom( )

Format

importFrom( dest IN OUT NOCOPY BLOB, source_type IN VARCHAR2, source_location IN VARCHAR2, source_name IN VARCHAR2)

Description

Imports DICOM content from a specified source into a BLOB.

Parameters

dest

The storage destination of the imported DICOM file.

source_type

The type of the source (only 'FILE' is supported).

source_location

The location of the source (must be a valid Oracle directory object).

source_name

The name of the source file.

Pragmas

None.

Exceptions

None.

Usage Notes

None.

Examples

Import the DICOM content into a BLOB:

declare
  dest blob;
begin
  select blob_dest into dest from medical_image_rel where id = 1 for update;
  ord_dicom.importFrom(dest, 'file', 'DICOMDIR', 'example.dcm');
end;
/

makeAnonymous( ) for BFILEs

Format

makeAnonymous ( src IN BFILE, dest_sop_instance_uid IN VARCHAR2, dest IN OUT NOCOPY BLOB, anonymityDocName IN VARCHAR2 DEFAULT 'ordcman.xml')

Description

Removes patient identifying information from the source DICOM content after copying it into another DICOM content BLOB, based on a specified anonymity document.

Parameters

src

The input DICOM content stored in a BFILE.

dest_sop_instance_uid

The SOP instance UID of the destination DICOM content. It must ensure that the destination DICOM content is globally unique.

dest

An empty BLOB in which to store the anonymous DICOM content.

anonymityDocName

The name of the anonymity document. The default name is "ordcman.xml".

Pragmas

None.

Exceptions

None.

Usage Notes

None.

Examples

Remove patient identifying information from the embedded DICOM content stored in a BFILE:

declare
  src bfile;
  dest blob;
  dest_sop_instance_uid varchar2(128) := '<unique-UID>';
begin
  select bfile_src, blob_dest into src, dest from medical_image_rel
    where id = 1 for update;
  ord_dicom.makeAnonymous(src, dest_sop_instance_uid, dest, 'ordcman.xml');
end;
/

where:


makeAnonymous( ) for BLOBs

Format

makeAnonymous ( src IN BLOB, dest_sop_instance_uid IN VARCHAR2, dest IN OUT NOCOPY BLOB, anonymityDocName IN VARCHAR2 DEFAULT 'ordcman.xml')

Description

Removes patient identifying information from the source DICOM content after copying it into another DICOM content BLOB, based on a specified anonymity document.

Parameters

src

The input DICOM content stored in a BLOB.

dest_sop_instance_uid

The SOP instance UID of the destination DICOM content. It must ensure that the destination DICOM content is globally unique.

dest

An empty BLOB in which to store the anonymous DICOM content.

anonymityDocName

The name of the anonymity document. The default name is "ordcman.xml".

Pragmas

None.

Exceptions

None.

Usage Notes

None.

Examples

Remove patient identifying information from the embedded DICOM content stored in a BLOB:

declare
  src blob;
  dest blob;
  dest_sop_instance_uid varchar2(128) := '<unique-UID>';
begin
  select blob_src, blob_dest into src, dest from medical_image_rel
    where id = 1 for update;
  ord_dicom.makeAnonymous(src, dest_sop_instance_uid, dest, 'ordcman.xml');
end;
/

where:


makeAnonymous( ) for ORDImage

Format

makeAnonymous ( src IN ORDSYS.ORDImage, dest_sop_instance_uid IN VARCHAR2, dest IN OUT NOCOPY BLOB, anonymityDocName IN VARCHAR2 DEFAULT 'ordcman.xml')

Description

Removes patient identifying information from the source DICOM content after copying it into another DICOM content BLOB, based on a specified anonymity document.

Parameters

src

The input DICOM content stored in an ORDImage object.

dest_sop_instance_uid

The SOP instance UID of the destination DICOM content. It must ensure that the destination DICOM content is globally unique.

dest

An empty BLOB in which to store the anonymous DICOM content.

anonymityDocName

The name of the anonymity document. The default name is "ordcman.xml".

Pragmas

None.

Exceptions

None.

Usage Notes

None.

Examples

Remove patient identifying information from the embedded DICOM content stored in an ORDImage object:

declare
  src ordimage;
  dest blob;
  dest_sop_instance_uid varchar2(128) := '<unique-UID>';
begin
  select image_src, blob_dest into src, dest from medical_image_rel
    where id = 1 for update;
  ord_dicom.makeAnonymous(src, dest_sop_instance_uid, dest, 'ordcman.xml');
end;
/

where:


processCopy( ) for BFILEs

Format

processCopy ( src IN BFILE, command IN VARCHAR2, dest IN OUT NOCOPY BLOB)

Description

Processes and copies the input DICOM image into a new raster image. The input DICOM image remains unchanged.

Parameters

src

The input DICOM image stored in the source BFILE.

command

A command string that accepts an image processing operator as input. Valid values include: fileFormat, frame, contentFormat, compressionFormat, cut, scale, and rotate. See the description for the process( ) method in Oracle Multimedia Reference for a complete list of image processing operators and details on each operator.

dest

An empty BLOB in which to store the destination image.

Pragmas

None.

Exceptions

None.

Usage Notes

See Appendix C for information about the encoding rules that support image content processing.

Examples

Copy the DICOM image from a BFILE into a BLOB and then process it:

declare
  src bfile;
  dest blob;
begin
  select bfile_src, blob_dest into src, dest from medical_image_rel
    where id = 1 for update;
  ord_dicom.processCopy(src, 'fileFormat=jpeg maxScale=100 100', dest);
end;
/

processCopy( ) for BLOBs

Format

processCopy ( src IN BLOB, command IN VARCHAR2, dest IN OUT NOCOPY BLOB)

Description

Processes and copies the input DICOM image into a new raster image. The input DICOM image remains unchanged.

Parameters

src

The input DICOM image stored in the source BLOB.

command

A command string that accepts an image processing operator as input. Valid values include: fileFormat, frame, contentFormat, compressionFormat, cut, scale, and rotate. See the description for the process( ) method in Oracle Multimedia Reference for a complete list of image processing operators and details on each operator.

dest

An empty BLOB in which to store the destination image.

Pragmas

None.

Exceptions

None.

Usage Notes

See Appendix C for information about the encoding rules that support image content processing.

Examples

Copy the DICOM image from a BLOB into another BLOB and then process it:

  src blob;
  dest blob;
begin
  select blob_src, blob_dest into src, dest from medical_image_rel
    where id = 1 for update;
  ord_dicom.processCopy(src, 'fileFormat=jpeg maxScale=100 100' dest);
end;
/

processCopy( ) for ORDImage

Format

processCopy ( src IN ORDSYS.ORDImage, command IN VARCHAR2, dest IN OUT NOCOPY BLOB)

Description

Processes and copies the input DICOM image into a new raster image. The input DICOM image remains unchanged.

Parameters

src

The input DICOM image stored in the source ORDImage object.

command

A command string that accepts an image processing operator as input. Valid values include: fileFormat, frame, contentFormat, compressionFormat, cut, scale, and rotate. See the description for the process( ) method in Oracle Multimedia Reference for a complete list of image processing operators and details on each operator.

dest

An empty BLOB in which to store the destination image.

Pragmas

None.

Exceptions

None.

Usage Notes

See Appendix C for information about the encoding rules that support image content processing.

Examples

Copy the DICOM image from an ORDImage object into a BLOB and then process it:

declare
  src ordimage;
  dest blob;
begin
  select image_src, blob_dest into src, dest from medical_image_rel
    where id = 1 for update;
  ord_dicom.processCopy(src, 'fileFormat=jpeg maxScale=100 100' dest);
end;
/

processCopy( ) for BFILEs with SOP instance UID

Format

processCopy (src IN BFILE, command IN VARCHAR2, dest_sop_instance_uid IN VARCHAR2, dest IN OUT NOCOPY BLOB, metadata IN SYS.XMLTYPE DEFAULT NULL)

Description

Processes and copies the input DICOM image into a new DICOM image or raster image. The input DICOM image remains unchanged.

Parameters

src

The input DICOM image stored in the source BFILE.

command

A command string that accepts an image processing operator as input. Valid values include: frame, contentFormat, compressionFormat, cut, scale, and rotate. See the description for the process( ) method in Oracle Multimedia Reference for a complete list of image processing operators and details on each operator.

dest_sop_instance_uid

The SOP instance UID of the destination DICOM image. It must ensure that the destination DICOM content is globally unique.

dest

An empty BLOB in which to store the destination image.

metadata

The new metadata to be written into the new DICOM image.

Pragmas

None.

Exceptions

None.

Usage Notes

See Appendix C for information about the encoding rules that support image content processing.

Examples

Copy the DICOM image from a BFILE into a BLOB with a specified SOP instance UID and then process it:

  src bfile;
  dest blob;
  dest_sop_instance_uid varchar2(128) := '<unique-UID>';
begin
  select bfile_src, blob_dest into src, dest from medical_image_rel
    where id = 1 for update;
  ord_dicom.processCopy(
    src, 'CompressionFormat=jpeg', dest_sop_instance_uid, dest);
end;
/

where:


processCopy( ) for BLOBs with SOP instance UID

Format

processCopy (src IN BLOB, command IN VARCHAR2, dest_sop_instance_uid IN VARCHAR2, dest IN OUT NOCOPY BLOB, metadata IN SYS.XMLTYPE DEFAULT NULL)

Description

Processes and copies the input DICOM image into a new DICOM image or raster image. The input DICOM image remains unchanged.

Parameters

src

The input DICOM image stored in the source BLOB.

command

A command string that accepts an image processing operator as input. Valid values include: frame, contentFormat, compressionFormat, cut, scale, and rotate. See the description for the process( ) method in Oracle Multimedia Reference for a complete list of image processing operators and details on each operator.

dest_sop_instance_uid

The SOP instance UID of the destination DICOM image. It must ensure that the destination DICOM content is globally unique.

dest

An empty BLOB in which to store the destination image.

metadata

The new metadata to be written into the new DICOM image.

Pragmas

None.

Exceptions

None.

Usage Notes

See Appendix C for information about the encoding rules that support image content processing.

Examples

Copy the DICOM image from a BLOB into another BLOB with a specified SOP instance UID and then process it:

declare
  src blob;
  dest blob;
  dest_sop_instance_uid varchar2(128) := '<unique-UID>';
begin
  select blob_src, blob_dest into src, dest from medical_image_rel
    where id = 1 for update;
  ord_dicom.processCopy(
    src, 'CompressionFormat=jpeg', dest_sop_instance_uid, dest);
end;
/

where:


processCopy( ) for ORDImage with SOP instance UID

Format

processCopy (src IN ORDSYS.ORDImage, command IN VARCHAR2, dest_sop_instance_uid IN VARCHAR2, dest IN OUT NOCOPY BLOB, metadata IN SYS.XMLTYPE DEFAULT NULL)

Description

Processes and copies the input DICOM image into a new DICOM image or raster image. The input DICOM image remains unchanged.

Parameters

src

The input DICOM image stored in the source ORDImage object.

command

A command string that accepts an image processing operator as input. Valid values include: frame, contentFormat, compressionFormat, cut, scale, and rotate. See the description for the process( ) method in Oracle Multimedia Reference for a complete list of image processing operators and details on each operator.

dest_sop_instance_uid

The SOP instance UID of the destination DICOM image. It must ensure that the destination DICOM content is globally unique.

dest

An empty BLOB in which to store the destination image.

metadata

The new metadata to be written into the new DICOM image.

Pragmas

None.

Exceptions

None.

Usage Notes

See Appendix C for information about the encoding rules that support image content processing.

Examples

Copy the DICOM image from an ORDImage object into a BLOB with a specified SOP instance UID and then process it:

declare
  src ordimage;
  dest blob;
  dest_sop_instance_uid varchar2(128) := '<unique-UID>';
begin
  select image_src, blob_dest into src, dest from medical_image_rel
    where id = 1 for update;
  ord_dicom.processCopy(
    src, 'CompressionFormat=jpeg', dest_sop_instance_uid, dest);
end;
/

where:


writeMetadata( ) for BFILEs

Format

writeMetadata ( src IN BFILE, metadata IN SYS.XMLTYPE, dest IN OUT NOCOPY BLOB),

Description

Writes or modifies the current DICOM content with the metadata provided by making a copy of the existing DICOM content in the destination BLOB, and then modifying the metadata. The original DICOM content remains unchanged. The attributes in the destination DICOM content are copied from the metadata that was input.

Parameters

src

The input DICOM content stored in a BFILE.

metadata

The input metadata stored in data type XMLType. In the destination DICOM content, the input metadata is used to update the values for attributes that are identical to attributes in the source DICOM content or to add any new attributes. The metadata must conform to the default metadata schema with the namespace http://xmlns.oracle.com/ord/dicom/metadata_1_0. The SOP instance UID in the metadata must ensure that the destination DICOM content is globally unique.

dest

An empty BLOB in which to store the new DICOM content with the new metadata.

Pragmas

None.

Exceptions

None.

Usage Notes

See Appendix C for information about the encoding rules that support metadata extraction.

Examples

Write the new metadata to the copy of the DICOM content in the destination BLOB:

declare
  src bfile;
  dest blob;
  metadata xmltype;
begin
  metadata := xmltype(bfilename('DICOMDIR', 'wm_meta.xml'), 
                      nls_charset_id('AL32UTF8'), 
                      'http://xmlns.oracle.com/ord/dicom/metadata_1_0');
 
  select bfile_src, blob_dest into src, dest from medical_image_rel
    where id = 1 for update;
 
  ord_dicom.writeMetadata(src, metadata, dest);
 
end;
/

writeMetadata( ) for BLOBs

Format

writeMetadata ( src IN BLOB, metadata IN SYS.XMLTYPE, dest IN OUT NOCOPY BLOB),

Description

Writes or modifies the current DICOM content with the metadata provided by making a copy of the existing DICOM content in the destination BLOB, and then modifying the metadata. The original DICOM content remains unchanged. The attributes in the destination DICOM content are copied from the metadata that was input.

Parameters

src

The input DICOM content stored in a BLOB.

metadata

The input metadata stored in data type XMLType. In the destination DICOM content, the input metadata is used to update the values for attributes that are identical to attributes in the source DICOM content or to add any new attributes. The metadata must conform to the default metadata schema with the namespace http://xmlns.oracle.com/ord/dicom/metadata_1_0. The SOP instance UID in the metadata must ensure that the destination DICOM content is globally unique.

dest

An empty BLOB in which to store the new DICOM content with the new metadata.

Pragmas

None.

Exceptions

None.

Usage Notes

See Appendix C for information about the encoding rules that support metadata extraction.

Examples

Write the new metadata to the copy of the DICOM content in the destination BLOB:

declare
  src blob;
  dest blob;
  metadata xmltype;
begin
  metadata := xmltype(bfilename('DICOMDIR', 'wm_meta.xml'), 
                      nls_charset_id('AL32UTF8'), 
                      'http://xmlns.oracle.com/ord/dicom/metadata_1_0');
 
  select blob_src, blob_dest into src, dest from medical_image_rel
    where id = 1 for update;
 
  ord_dicom.writeMetadata(src, metadata, dest);
 
end;
/

writeMetadata( ) for ORDImage

Format

writeMetadata ( src IN ORDSYS.ORDImage, metadata IN SYS.XMLTYPE, dest IN OUT NOCOPY BLOB),

Description

Writes or modifies the current DICOM content with the metadata provided by making a copy of the existing DICOM content in the destination BLOB, and then modifying the metadata. The original DICOM content remains unchanged. The attributes in the destination DICOM content are copied from the metadata that was input.

Parameters

src

The input DICOM content stored in an ORDImage object.

metadata

The input metadata stored in data type XMLType. In the destination DICOM content, the input metadata is used to update the values for attributes that are identical to attributes in the source DICOM content or to add any new attributes. The metadata must conform to the default metadata schema with the namespace http://xmlns.oracle.com/ord/dicom/metadata_1_0. The SOP instance UID in the metadata must ensure that the destination DICOM content is globally unique.

dest

An empty BLOB in which to store the new DICOM content with the new metadata.

Pragmas

None.

Exceptions

None.

Usage Notes

See Appendix C for information about the encoding rules that support metadata extraction.

Examples

Write the new metadata to the copy of the DICOM content in the destination BLOB:

declare
  src ordimage;
  dest blob;
  metadata xmltype;
begin
  metadata := xmltype(bfilename('DICOMDIR', 'wm_meta.xml'), 
                      nls_charset_id('AL32UTF8'), 
                      'http://xmlns.oracle.com/ord/dicom/metadata_1_0');
 
  select image_src, blob_dest into src, dest from medical_image_rel
    where id = 1 for update;
 
  ord_dicom.writeMetadata(src, metadata, dest);
 
end;
/