Which media objects are defined in Oracle mode?

Source: Internet
Author: User

Some media objects and procedures provided in Oracle are defined in Oracle mode to create a table containing the ORDDicom column. If you have any questions about Oracle-related operations, you can read the following articles to understand them.

This tutorial uses a simple table that contains four columns: an integer identifier (id) and an ORDSYS. ORDDicom object (dicom), an ORDSYS. ORDImage object (imageThumb) and another ORDSYS. ORDDicom object (anonDicom ). Note that all multimedia objects and processes provided by Oracle are defined in Oracle mode. Perform the following steps:

1. In the SQL * Plus session, run the following command:

 
 
  1. @create_dicom_table  

The create_dicom_table. SQL code is as follows:

Java code

 
 
  1. set echo on;   
  2. drop table medical_image_table;   
  3. create table medical_image_table   
  4. (id integer primary key,   
  5. dicom ordsys.orddicom,   
  6. imageThumb ordsys.ordimage,   
  7. anonDicom ordsys.orddicom);   
  8. set echo on;  
  9. drop table medical_image_table;  
  10. create table medical_image_table  
  11. (id integer primary key,  
  12. dicom ordsys.orddicom,  
  13. imageThumb ordsys.ordimage,  
  14. anonDicom ordsys.orddicom);  

Import Medical Images

This topic describes how to load medical images in the database file system to a newly created table named "medical_image_table. Note: In most cases, you want to use SQL * Loader instead of the Oracle mode defined in this example to load data.

Create a PL/SQL process image_import (), which inserts a new row into the medical_image_table, and imports the DICOM data in the file name into the newly created ORDDICOM object, the DICOM attributes are extracted to the metadata attributes based on the default ing document) and the UID attributes of the ORDDICOM object. Note that the default ing document ordcmmp. xml is loaded during installation.

You can create a custom ing document and extract attributes to a separate XML document, but this topic is not covered in this tutorial.

Perform the following steps:

1. In the SQL * Plus session, enter the following command:

 
 
  1. @create_import_procedure  

The create_import_procedure. SQL code is as follows:

Java code

 
 
  1. -- Set Data Model Repository   
  2. execute ordsys.ord_dicom.setDataModel();   
  3. create or replace procedure image_import
    (dest_id number, filename varchar2) is   
  4. dcm ordsys.orddicom;   
  5. begin   
  6. delete from medical_image_table where id 
    = dest_id;   
  7. insert into medical_image_table 
    (id, dicom, imageThumb, anonDicom)   
  8. values (dest_id, ordsys.orddicom
    (‘file’, ‘IMAGEDIR’, filename, 0),   
  9. ordsys.ordimage.init(), ordsys.orddicom())   
  10. returning dicom into dcm;   
  11. dcm.import(1);   
  12. update medical_image_table set dicom=
    dcm where id=dest_id;   
  13. commit;   
  14. end;   
  15. /   
  16. show errors;   
  17. -- Set Data Model Repository  
  18. execute ordsys.ord_dicom.setDataModel();  
  19. create or replace procedure image_import
    (dest_id number, filename varchar2) is  
  20. dcm ordsys.orddicom;  
  21. begin  
  22. delete from medical_image_table where id
     = dest_id;  
  23. insert into medical_image_table
     (id, dicom, imageThumb, anonDicom)  
  24. values (dest_id, ordsys.orddicom
    (‘file’, ‘IMAGEDIR’, filename, 0),  
  25. ordsys.ordimage.init(), ordsys.orddicom())  
  26. returning dicom into dcm;  
  27. dcm.import(1);  
  28. update medical_image_table set dicom=
    dcm where id=dest_id;  
  29. commit;  
  30. end;  
  31. /  
  32. show errors;  

2. Now, you can execute the new creation process to import the sample DICOM file. In the SQL * Plus session, enter the following command:

Java code

 
 
  1. execute image_import(1,'179.dcm');   
  2. execute image_import(1,'179.dcm');  

The above is an introduction to all the multimedia objects and processes provided by Oracle that are defined in the Oracle mode. We hope you will gain some benefits.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.