DICOM PHP Class

class_dicom.php is a PHP class that lets you work with DICOM files within PHP programs. class_dicom.php enables you to retrieve tags, write tags, convert to JPEG, make thumbnails, convert JPEG to DICOM, compress DICOM, uncompress DICOM, receive DICOM files over the network, and send DICOM files over the network. It even comes with several example programs so you can get started writing your own code right away!

This PHP DICOM class has good support for running under Windows and Linux.

As of 2012-06-11 class_dicom.php can convert multi-frame DICOM files into normal video files such as .mp4, .mpg, or .avi. This functionality is driven by ffmpeg and is easily extendable and modifiable. Think of it as DICOM to AVI or DICOM to MPG.

class_dicom.php uses the excellent Offis DICOM Toolkit for it’s nitty gritty DICOM work. Your system will need a reasonably recent version of the DICOM Toolkit in order to use class_dicom.php.

Downloading

You can download class_dicom.php directly from this site or from GitHub.

Tutorials

Specifics

class_dicom.php is made up three classes that handle tags, conversions, and network.

class dicom_tag

  • load_tags(): Loads all of the tags from a DICOM file into an associative array. Example: examples/get_tags.php
  • get_tag(): Returns the value of the group and element you specify. Example: examples/get_tags.php
  • write_tags(): Writes the tags contained in an array you specify to a DICOM file. Example: examples/write_tags.php

class dicom_convert

  • dcm_to_jpg(): DICOM to JPG. Converts a DICOM file into a JPEG file. Example: examples/dcm_to_jpg.php
  • dcm_to_tn(): DICOM to JPG thumbnail. Converts a DICOM file into a JPEG thumb nail. Example: examples/dcm_to_jpg.php
  • jpg_to_dcm(): JPG to DICOM. Takes the demographic info in an array you specify and a JPEG file, produces a DICOM file. Example: examples/jpg_to_dcm.php
  • compress(): Performs a lossless JPEG compression on a DICOM file. Example: examples/compress.php
  • uncompress(): Uncompresses a compressed DICOM file. Example: examples/uncompress.php
  • multiframe_to_video():  Convert a DICOM multi-frame file into a video (.mp4, .avi, .mpg, ect)

class dicom_net

  • store_server(): Starts a DICOM receive network service. Example: examples/store_server.php
  • echoscu(): Sends a DICOM ping (echoscu).
  • send_dcm(): Sends a DICOM file to the host you specify. Example: examples/send_dcm.php

Examples of Examples

These examples and many more are included in the download packages above.

#
# Prints out the DICOM tags in a file specified on the command line
#

require_once('../class_dicom.php');

$file = (isset($argv[1]) ? $argv[1] : '');

if(!$file) {
  print "USAGE: ./get_tags.php \n";
  exit;
}

if(!file_exists($file)) {
  print "$file: does not exist\n";
  exit;
}

$d = new dicom_tag;
$d->file = $file;
$d->load_tags();

print_r($d->tags); // PRINT ALL OF THE TAGS

$name = $d->get_tag('0010', '0010'); // GET A SPECIFIC TAG
print "Name: $name\n";

#
# Creates a jpeg and jpeg thumbnail of a DICOM file
#

require_once('../class_dicom.php');

$file = (isset($argv[1]) ? $argv[1] : '');

if(!$file) {
  print "USAGE: ./dcm_to_jpg.php \n";
  exit;
}

if(!file_exists($file)) {
  print "$file: does not exist\n";
  exit;
}

$d = new dicom_convert;
$d->file = $file;
$d->dcm_to_tn(); // CONVERT TO JPEG AND A JPEG THUMBNAIL
system("ls -lsh $file*"); // List the files we just created

24 comments

  1. Ubuntu 12.04TLS works like a charm.
    Simple to install, instructions were right on.
    Have not yet sent studies to it but will be very soon.
    Great work!!!!
    thank you

  2. Hi seems to be a great work thank you for that
    I am working on a simple dicom viewer via PHP connecting to RIS database , in your wrapper
    DICOM PHP Clas can you create a new function like dcm to jpg($read_dir,$temp_dir)
    read_dir is the datastorage of dicom files , tem_dir is a directory that i can read and write *.jpg
    and displaying on my web page and next delete temp_dir when am finish…this is the scenario
    Thank you Vagelis from Greece

    1. Hi,

      The class won’t do that as is, you could pretty easily write a function to loop through a directory, convert any DICOM files it finds to jpeg, and move those jpegs into another directory.

  3. Thanks for creating this. I used this class to help me sort through and organize about 1TB of images.

    Here’s the code I used.

    <?php
    
    require_once('class_dicom.php');
    
    define('STORAGE', 'X:/sorted');
    
    get_directory("X:/unsorted");
    
    function process_file($file) {
    
      if(!is_dcm($file)) {
        print("Not a DICOM file: $file\n");
        unlink($file);
        return(0);
      }
    
      $d = new dicom_tag;
      $d->file = $file;
      $d->load_tags();
    
      $name = $d->get_tag('0010', '0010');
      $id = $d->get_tag('0010', '0020');
      $modality = $d->get_tag('0008', '0060');
      $appt_date = $d->get_tag('0008', '0020');
      $sop_id = $d->get_tag('0002', '0003');
    
      $year = date('Y', strtotime($appt_date));
      $month = date('m', strtotime($appt_date));
      $day = date('d', strtotime($appt_date));
    
      $storage = STORAGE . "/$year";
      if(!file_exists($storage)) {
        mkdir($storage);
      }
      $storage = $storage . "/$month";
      if(!file_exists($storage)) {
        mkdir($storage);
      }
      $storage = $storage . "/$day";
      if(!file_exists($storage)) {
        mkdir($storage);
      }
    
      $name = str_replace('^', '_', $name);
      $arr_replace = array('^', "'", '"', '`', '/', '\\', '?', ':', ';');
      foreach($arr_replace as $replace) {
        $name = str_replace($replace, '', $name);
        $id = str_replace($replace, '', $id);
      }
    
      $storage = $storage . "/$name" . "_$id";
      if(!file_exists($storage)) {
        mkdir($storage);
      }
    
      $new_file = $modality . "_" . $sop_id . ".dcm";
    
      if(file_exists("$storage/$new_file")) {
        $new_file = $modality . "_" . $sop_id . "_" . rand(1, 1000) . ".dcm";
      }
    
    //  print "$storage/$new_file\n";
    
      if(!rename($file, "$storage/$new_file")) {
        print "Failed $file -> $storage/$new_file";
        exit;
      }
      print ".";
    
    //  print "$name - $storage\n";
      //exit;
    }
    
    function is_dir_empty($dir) {
      if (!is_readable($dir)) return NULL;
      return (count(scandir($dir)) == 2);
    }
    
    function get_directory($dir, $level = 0) {
      $ignore = array( 'cgi-bin', '.', '..' );
      $dh = @opendir($dir);
      while( false !== ( $file = readdir($dh))){
        if( !in_array( $file, $ignore ) ){
          if(is_dir("$dir/$file")) {
            echo "\n$file\n";
            get_directory("$dir/$file", ($level+1));
          }
          else {
            //echo "$spaces $file\n";
            process_file("$dir/$file");
          }
        }
      }
    
      closedir( $dh );
    
      if(is_dir_empty($dir) && $dir != "X:/unsorted") {
        //print "\n-= Removing $dir =-\n";
        rmdir($dir);
    
      }
    
    }
    
    ?>
    
  4. Hello Dean, I’m reading and using your tutorial in the last days. I would like to congratulate you for the work. I’m having some difficulties and would like to take some questions. When I run the file store_server.php the browser does not return response if this running successfully or not. How can I test if I am getting a device Dicom? Another doubt is that I see in the tutorial you talk about the file import.php but found this file to download. If you have more details on how to mount a Dicom server I thank you very much. My email is: [email protected]

    1. Hello,

      store_server.php is meant to be run from the command line. If it is returning immediately you may not have the OFFIS DCMTK installed or your class_dicom.php is not pointing to the location of the DCMTK.

  5. hi DEAN.

    we are impement web-based pacs viewer and view dcm image easily with convert dcm to jpg, but can we view dcm images directly without convert to jpg in php.

    1. I don’t know of a web browser that can natively view DICOM images. I do know there have been some commercial products to view DICOM files via Flash or HTML5, so that’s possible.

  6. I’ve said it before… great work! Below is the DICOM Class rewritten in C# for .Net Developers. I only did not rewrite the Convert From JPEG and XML as well as DICOM TO Movie. I don’t use these ones. I tried to follow your methods, with minor changes. I also added some support to grow the library into supporting JPEG2000 via the use of GDCM or some other tool. Hope you all like!

    using System;
    using System.Collections.Generic;
    using System.Diagnostics;
    using System.IO;
    using System.Linq;
    using System.Text;
    using System.Text.RegularExpressions;
    using System.Threading.Tasks;
    
    namespace DataMover
    {
        public class DicomToolkit
        {
    //        const string TOOLKIT_DIR = @"dcmtk\bin";
            const string TOOLKIT_DIR = @"C:\Visual Studio 2013\Projects\DataMigration\DataMover\DCMTK";
            const string BIN_DCMDUMP = TOOLKIT_DIR + @"\dcmdump.exe";
            const string BIN_STORESCU = TOOLKIT_DIR + @"\storescu.exe";
            const string BIN_STORESCP = TOOLKIT_DIR + @"\storescp.exe";
            const string BIN_ECHOSCU = TOOLKIT_DIR + @"\echoscu.exe";
            const string BIN_DCMJ2PNM = TOOLKIT_DIR + @"\dcmj2pnm.exe";
            const string BIN_DCMODIFY = TOOLKIT_DIR + @"\dcmodify.exe";
            const string BIN_DCMCJPEG = TOOLKIT_DIR + @"\dcmdjpeg.exe";
            const string BIN_DCMDJPEG = TOOLKIT_DIR + @"\dcmcjpeg.exe";
            const string BIN_XML2DCM = TOOLKIT_DIR + @"\xml2dcm.exe";
            const string BIN_IMG2DCM = TOOLKIT_DIR + @"\img2dcm.exe";
    
            /// 
            /// Out function to allow us to run new processes.
            /// 
            /// 
            /// 
            /// String of the output
            public static string Execute(string fileName, string command)
            {
                string log = "";
    
                //Create process
                Process p = new System.Diagnostics.Process();
                p.StartInfo.FileName = fileName;
                p.StartInfo.Arguments = command;
                p.StartInfo.RedirectStandardOutput = true;
                p.StartInfo.RedirectStandardError = true;
                p.StartInfo.UseShellExecute = false;
                p.StartInfo.CreateNoWindow = true;
                p.Start();
                log = p.StandardOutput.ReadToEnd();
                p.WaitForExit();
    
                return log;
            }
    
            /// 
            /// This is being left out of the classes so it is easier to access
            /// 
            /// Required string representation of the file in question
            /// Boolean
            public static bool is_dcm(string file)
            {
                string dump_cmd = " -M +L +Qn " + file;
    
                string dump = Execute(BIN_DCMDUMP, dump_cmd);
    
                if (dump.IndexOf("error") &gt; -1)
                {
                    return false;
                }
                else if (dump.IndexOf("Modality") &gt; -1)
                {
                    return true;
                }
                return false;
            }
    
            //var d = new DicomToolkit.dicom_tag();
            //d.file = "SOME_IMAGE.dcm";
            //d.load_tags();
            //string name = d.get_tag('0010', '0010');
            
            /// 
            /// Class for working with DICOM Header information.
            /// 
            public class dicom_tag
            {
                public Dictionary tags = new Dictionary();
                public string file = "-1";
    
                /// 
                /// Constructor class for dicom_tag
                /// 
                /// required string representation of DICOM file
                public dicom_tag(string file = "")
                {
                    this.file = file;
                    if (File.Exists(this.file))
                    {
                        if (is_dcm(this.file))
                        {
                            this.load_tags();
                        }
                    }
                }
    
                /// 
                /// Load tags from a DICOM file into an array (this.tags). (this.file) is the filename of the image.
                /// 
                public void load_tags()
                {
                    string file = this.file;
                    string dump_cmd = " -M +L +Qn " + file;
    
                    string dump = Execute(BIN_DCMDUMP, dump_cmd);
    
                    if (dump == "")
                    {
                        throw new ApplicationException("DICOM Dump returned empty, this cannot be!");
                    }
    
                    //this.tags = new string[0,2];
                    this.tags = new Dictionary();
    
                    string[] split_dump = dump.Split(new Char[] {'\n'});
    
                    foreach (string line in split_dump)
                    {
                        string ge = "";
    
                        Match match = Regex.Match(line, @"\((.*)\) [A-Z][A-Z]");
                        if (match.Success)
                        {
                            ge = match.Groups[1].Value;
    
                            string retValue;
                            if (this.tags.TryGetValue(ge, out retValue))
                            {
                                this.tags[ge] = "";
                            }
                        }
                        
                        string val = "";
                        int found = 0;
    
                        match = Regex.Match(line, @"\[(.*)\]");
                        if (match.Success)
                        {
                            found = 1;
                            val = match.Groups[1].Value;
                            this.tags[ge] = val;
                        }
    
                        if (found == 0)
                        {
                            match = Regex.Match(line, @"\=(.*)\#");
                            if (match.Success)
                            {
                                found = 1;
                                val = match.Groups[1].Value;
                                
                                this.tags[ge] = val.TrimEnd();
                            }
                        }
    
                        if (found == 0)
                        {
                            match = Regex.Match(line, @"[A-Z][A-Z] (.*)\#");
                            if (match.Success)
                            {
                                found = 1;
                                val = match.Groups[1].Value;
    
                                if (val.IndexOf("(no value available)") != -1)
                                {
                                    val = "";
                                }
                                this.tags[ge] = val.TrimEnd();
                            }
                        }
                    }
                }
    
                /// 
                /// Returns value from tag in image once load_tags() has been called.
                /// 
                /// String value for Group Number
                /// String Value for Element Number
                /// String value of requested element
                public string get_tag(string group, string element)
                {
                    string ge = group + "," + element;
                    string val = "";
                    string retValue;
                    if (this.tags.TryGetValue(ge, out retValue))
                    {
                        val = this.tags[ge];
                    }
                    return val;
                }
    
                /// 
                /// This will write tags into a dicom file, it will overwrite existing tags with no backup. Be careful!
                /// 
                /// C# Disctionary of key (group) and value (element)
                /// 
                public string write_tags(Dictionary tag_dic)
                {
                    string str = "";
    
                    foreach (KeyValuePair entry in tag_dic)
                    {
                        str += "-i \"(" + entry.Key + ")=" + entry.Value + "\" ";
                    }
    
                    string write_cmd = " " + str + " " + " -nb \"" + this.file + "\"";
    
                    string output = Execute(BIN_DCMODIFY, write_cmd);
    
                    if(output == "")
                    {
                        return "";
                    }
                    else{
                        return output;
                    }
                }
            }
    
            /// 
            /// Class to work with converting DICOM files into and out of other forms.
            /// 
            public class dicom_convert
            {
                public string file = "";
                public string jpg_file = "";
                public string tn_file = "";
                public string transfer_syntax = "";
                public int jpg_quality = 100;
                public int tn_size = 125;
    
                /// 
                /// Constructor class for dicom_convert
                /// 
                /// Required string representation of the DICOM file
                public dicom_convert(string file = "")
                {
                    this.file = file;
                }
    
                /// 
                /// Convert a DICOM image to JPEG. this.file is the filename of the image.
                /// this.jpg_quality is an optional value (0-100) that will set the quality of the JPEG produced
                /// 
                /// String output of JPEG file location
                public string dcm_to_jpg()
                {
                    long filesize = 0;
    
                    this.jpg_file = this.file + ".jpg";
    
                    string convert_cmd = " +oj +Jq " + this.jpg_quality + " --use-window 1 \"" + this.file + "\" \"" + this.jpg_file + "\"";
    
                    string output = Execute(BIN_DCMJ2PNM, convert_cmd);
    
                    if(File.Exists(this.jpg_file))
                    {
                        FileInfo f = new FileInfo(this.jpg_file);
                        filesize = f.Length;
                    }
                    if(filesize &lt; 10)
                    {
                        convert_cmd = &quot; +Wm +oj +Jq &quot; + this.jpg_quality + &quot; \&quot;&quot; + this.file + &quot;\&quot; \&quot;&quot; + this.jpg_file + &quot;\&quot;&quot;;
    
                        output = Execute(BIN_DCMJ2PNM, convert_cmd);
                    }
    
                    return this.jpg_file;
                }
    
                /// 
                /// Convert this.file into a JPEG thumbnail
                /// Optional this.tn_size will let you change the width of the thumbnail produced
                /// 
                /// String output of JPEG Thumbnail file location
                public string dcm_to_tn()
                {
                    long filesize = 0;
    
                    this.tn_file = this.file + "_tn.jpg";
    
                    string convert_cmd = " +oj +Jq 75 +Sxy" + this.tn_size + " --use-window 1 \"" + this.file + "\" \"" + this.tn_file + "\"";
    
                    string output = Execute(BIN_DCMJ2PNM, convert_cmd);
    
                    if (File.Exists(this.tn_file))
                    {
                        FileInfo f = new FileInfo(this.tn_file);
                        filesize = f.Length;
                    }
                    if (filesize &lt; 10)
                    {
                        convert_cmd = &quot; +Wm +oj +Jq 75 +Sxy&quot; + this.tn_size + &quot; \&quot;&quot; + this.file + &quot;\&quot; \&quot;&quot; + this.jpg_file + &quot;\&quot;&quot;;
    
                        output = Execute(BIN_DCMJ2PNM, convert_cmd);
                    }
    
                    return this.tn_file;
                }
    
                /// 
                /// This will uncompress this.file
                /// Optionally, you can give the output file a different name than the original by passing new_file
                /// 
                /// String representation of output file name.
                /// String output of uncomressed DICOM file location
                public string uncompress(string new_file = "")
                {
                    if(this.transfer_syntax == "")
                    {
                        dicom_tag tags = new dicom_tag();
                        tags.file = this.file;
                        tags.load_tags();
                        this.transfer_syntax = tags.get_tag("0002", "0010");
                    }
                    if(new_file == "")
                    {
                        new_file = this.file;
                    }
    
                    string write_cmd = "";
                    switch (this.transfer_syntax)
    	            {
                        case "JPEG2000LosslessOnly": //Still need to change this command to work with GDCM when the .90 or .91 TS is used.
                            write_cmd = " \"" + this.file + "\"  \""+ new_file + "\"";
                            break;
                        case "JPEG2000": //Still need to change this command to work with GDCM when the .90 or .91 TS is used.
                            write_cmd = " \"" + this.file + "\"  \""+ new_file + "\"";
                            break;
    		            default:
                            write_cmd = " \"" + this.file + "\"  \""+ new_file + "\"";
                            break;
    	            }
    
                    string output = Execute(BIN_DCMDJPEG, write_cmd);
    
                    return new_file;
                }
    
                /// 
                /// This will need to be expanded to allow more than one compression type.
                /// This will JPEG losslessly compress this.file
                /// Optionally, you can give the output file a different name than the original by passing new_file
                /// 
                /// Optional String output file name.
                /// String output of compressed DICOM file location
                public string compress(string new_file = "")
                {
                    if (new_file == "")
                    {
                        new_file = this.file;
                    }
    
    
                    string write_cmd = " \"" + this.file + "\"  \"" + new_file + "\"";
    
                    string output = Execute(BIN_DCMCJPEG, write_cmd);
    
                    return new_file;
                }
    
                /*
                ### See examples/jpg_to_dcm.php for an example, it'll help things make sense. 
                
                $this-&gt;jpg_file is the JPEG you plan on turning into a DICOM file.
    
                Make an array that maps the values to the tags you want your DICOM file to contain. Like this:
                $arr_info = array(
                  '0010,0010' =&gt; 'VAUGHAN^DEAN', // Patient Name 
                  '0008,0080' =&gt; 'DEANLAND, AR'  // Institution
                );
                You'll actually need to map more fields out to get a usable DICOM file. examples/jpg_to_dcm.php has an example of what's
                probably the minimum you need to keep most other DICOM software happy with the files you're producing.
    
                Point $this-&gt;template towards examples/jpg_to_dcm.xml You'll notice it's a shortened output of dcm2xml. I've put the tag 
                name in () where I want the value to go.
    
                */
    
                /// 
                /// This will convert a JPEG file into a DICOM file. 
                /// This is currently not complete.
                /// 
                /// 
                /// 
                public string jpg_to_dcm(Dictionary tag_dic)
                {
                    //We need to make an XML file from the data in the dictionary. This will be used by DCMTK.
                    string xml = "";
    
                    return this.file;
                }
    
                //This is not currently implemented either.... TODO
                public string multiframe_to_video(string format = "mp4", int framerate = 24, string temp_dir = "./video_temp")
                {
                    return "";
                }
    
                //Some day...
                public string pdf_to_dcm(Dictionary tag_dic)
                {
                    return "";
                }
    
                public string pdf_to_dcmcr(Dictionary tag_dic)
                {
                    return "";
                }
            }
    
            public class dicom_net
            {
                public string transfer_syntax = "";
                public string file = "";
    
                /// 
                /// Will start the DICOM Storage server part of PACS. Will provide SCP services for DICOM C-Store Operations.
                /// 
                /// the TCP port to listen on
                /// Where the DICOM files go after being received
                /// A program that will be ran after each DICOM file is received. The DICOM image'e filename, dcm_dir, and AE Titles will be passed via the command line.
                /// the Storescp config file. File provided will work for most common ways of doing things.
                /// Debug on or off
                public void store_server(int port, string dcm_dir, string handler_script, string config_file = @"config\store_server_config.cfg", bool myDebug = false)
                {
                    string dflag = "";
    
                    if(myDebug)
                    {
                        dflag = "-v -d ";
                    }
    
                    string server_cmd = " " + dflag + "-dhl -td 20 -ta 20 --fork -xf " + config_file + " -od " + dcm_dir + " -xcr \"" + handler_script + " \"#p\" \"#f\" \"#c\" \"#a\"\" " + port;
    
                    Execute(BIN_STORESCP, server_cmd);
                }
    
                /// 
                /// Performs a DICOM ping on host port
                /// 
                /// String representation of remote server. Can be IP or hostname.
                /// Integer representation of remote port
                /// String Representation of Calling AE Title
                /// String Representation of Called AE Title
                /// 
                public string echoscu(string host, int port, string my_ae = "CUATTRO", string remote_ae = "YOU")
                {
                    string ping_cmd = " -ts 5 -td 5 -to 5 -aet \"" + my_ae + "\" -aec \"" + remote_ae + "\" " + host + " " + port;
    
                    string output = Execute(BIN_ECHOSCU, ping_cmd);
    
                    return output;
                }
    
                /// 
                /// C-Store this.file to host port
                /// 
                /// String representation of remote server. Can be IP or hostname.
                /// Integer representation of remote port
                /// String Representation of Calling AE Title
                /// String Representation of Called AE Title
                /// Boolean value for sending all files in a directory or just a single file in one association
                /// 
                public string send_dcm(string host, int port, string my_ae="CUATTRO", string remote_ae="YOU", bool send_batch = false)
                {
                    if(this.transfer_syntax == "")
                    {
                        dicom_tag tags = new dicom_tag();
                        tags.file = this.file;
                        tags.load_tags();
                        this.transfer_syntax = tags.get_tag("0002", "0010");
                    }
    
                    string ts_flag = "";
    
                    switch (this.transfer_syntax)
    	            {
                        case "JPEGBaseline":
                            ts_flag = "-xy";
                            break;
                        case "JPEGExtended:Process2+4":
                            ts_flag = "-xx";
                            break;
                        case "JPEGLossless:Non-hierarchical-1stOrderPrediction":
                            ts_flag = "-xs";
                            break;
                        case "JPJPEG2000LosslessOnlyEG2000": //Still need to change this command to work with GDCM when the .90 or .91 TS is used.
                            ts_flag = "-xv";
                            break;
    		            default:
                            break;
    	            }
    
                    string to_send = this.file;
                    string send_cmd = "";
    
                    if(send_batch)
                    {
                        string parentFolder = "";
                        if(File.Exists(to_send))
                        {
                            FileInfo f = new FileInfo(to_send);
                            DirectoryInfo d = f.Directory;
                            parentFolder = d.FullName;
                        }
                        to_send = parentFolder;
                        send_cmd = " -ts 10 -td 10 -to 10 " + ts_flag + " -aet \"" + my_ae + "\" -aec \"" + remote_ae + "\" " + port + " +sd \"" + to_send + "\"";
                    }
                    else{
                        send_cmd = " -ts 10 -td 10 -to 10 " + ts_flag + " -aet \"" + my_ae + "\" -aec \"" + remote_ae + "\" " + port + "  \"" + to_send + "\"";
                    }
    
                    string output = Execute(BIN_STORESCU, send_cmd);
    
                    if(output == "")
                    {
                        return "";
                    }
                    else{
                        return output;
                    }
                }
            }
        }
    }
    
    
  7. When i am running this jpg_to_dcm.php i am getting below error.Anyone please help

    #!/usr/bin/php New file is ‘C:/dcmtk/bin/xml2dcm.exe’ is not recognized as an internal or external command, operable program or batch file.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>