The script below will look in the directory you specify in $temp_dir and send any images it finds to a DICOM host. When it is done sending it will move the DICOM file to a back up directory.

#!/usr/bin/php
<!--?PHP 

require_once('class_dicom.php');

# WHERE YOUR DICOM FILES ARE
$temp_dir = '../temp';

# WHERE YOU ARE SENDING THEM
$target_host = 'some IP address';
$target_port = '105';
$target_ae = 'BK';
$my_ae = 'BK';

if(!file_exists('bk')) {
  mkdir('bk');
}

$d = new dicom_net;

if($handle = opendir($temp_dir)) {
  while(false !== ($file = readdir($handle))) {
    if($file != "." &#038;& $file != "..") {

      print "Sending $file...\n";

      $d--->file = "$temp_dir/$file";
      $ret = $d-&gt;send_dcm($target_host, $target_port, $my_ae, $target_ae);
      if($ret) {
        print "Send Error: $ret\n";
        continue;
      }
      else {
        print "Good Send\n";
        print "Moving $temp_dir/$file\n";
        rename("$temp_dir/$file", "bk/$file");
      }

    }
  }
  closedir($handle);
}

?&gt;

I had the opportunity today to help someone get class_dicom.php working under windows. I was pretty surprised to learn that you do not have to modify the class much, but it does take some time to install the other prerequisite software.

If you’re using IIS, you can skip step #1. You will need to get a copy of PHP installed under IIS. PHP on IIS (http://php.iis.net/) will allow you to do that easily. If you are using IIS, change the file locations below as appropriate for your enviroment.

1. You’ll need a copy of PHP.

Since you’ll probably want to run your PHP scripts under a web server you might as well kill two (three) birds with one stone.  The Wamp (http://www.wampserver.com/)  package is an easy as pie installer that will install and configure Apache, mySQL, PHP, and several other handy tools at once.

Once installed, be sure to find it in the system tray, left click it, and then select Put Online to start it up.

You can then go to http://localhost to test your install out.

The files you’re serving are all under C:\wamp\www\

2. You’ll need the Windows binaries of the DCMTK.

Head on over to the DCMTK website (http://dicom.offis.de/dcmtk.php.en/) and under executable binaries, grab the zip file for Windows.

Unzip it an copy the result to C:\dcmtk so it’s easy to find.

3. Get a copy class_dicom.php.

You can download a zipped version from GitHub (https://github.com/vedicveko/class_dicom.php/zipball/master). Once downloaded unzip it to C:\wamp\www\class_dicom.

You should be able to visit your web server at http://localhost/class_dicom and see a directory listing.

We’re going to need to make some modifications to the class. Open C:/wamp/www/class_dicom/class_dicom.php in an editor.

Near the top of a file is a line that looks like this:

define('TOOLKIT_DIR', '/usr/local/bin');

We need to change that to point to where we installed DCMTK. Change the line to look like this:

define('TOOLKIT_DIR', 'C:/dcmtk/bin');

Save class_dicom.php and you’re done with it.

4. Finishing up

All of the scripts in the examples directory for class_dicom.php are meant to run on the UNIX command line. This won’t work out too well when you try to run them under a web server on Windows. We need to change up one of the examples to run in this environment so you can see that it works. Take the code below and copy it into the C:\wamp\www\class_dicom\examples\get_tags.php file.

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

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

$file = 'dean.dcm';

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

$d = new dicom_tag;
$d->file = $file;
print "TEST: " . $d->load_tags();

print "<pre>";

print_r($d->tags);

$name = $d->get_tag('0010', '0010');
print "Name: $name\n";

?>

Once that is done go to http://localhost/class_dicom/examples/get_tags.php. You’ll see a header dump of the dean.dcm sample DICOM file.

(Or skip all of that and open get_tags_webbased.php in your browser instead.)

You now have a functional install of class_dicom.php to work with!

For the first time ten months I’ve decided to update my DICOM PHP class (class_dicom.php).

I’ve added two new functions:

is_dcm(): This function will return true if the provided file is a DICOM file, false otherwise.

multiframe_to_video():  Convert a DICOM multi-frame file into a video (.mp4, .avi, .mpg, ect)

multiframe_to_video() is the big one. This functionality is driven by ffmpeg and is easily extendable and modifiable. Think of it as DICOM to AVI or DICOM to MPG.

Check it out!

 

Dibrova was a MUD (Multi-user Dungeon) I worked on, first as a builder and then as a coder from 2000-2005. Myself and many others put a lot of time into Dibrova and I feel it really shows.

A MUD is text based MMORPG. They were incredibly popular until graphical MMORPGs began to show up.

We had features that were revolutionary for their time, a strong clan/guild system, unlimited levels, automated questing, mob classes, and so on. These are features you see touted in modern MMORPGs that were not available in other games during the same the time period.

Here are some of the features at a glance:

–    243 Zones
–    19105 Rooms
–    6417 Objects
–    5687 Mobiles
–    Limited/Unlimited Levels.
–    Clans
–    Clan run stores, zones, clan halls, tollbooths, mini-bars, ect
–    Automated quest system
–    More classes and races than you can shake a stick at
–    Multi-classing
–    Immortal classing
–    Mob classes, races, skills, semi-intelligent combat

Honestly, Dibrova has been around for so long and has had so many people contributing to it that we do not have a complete feature list.

Through some turn of events I have become the keeper of the source code for Dibrova. For a long time I had it hosted on my own site, the Mud Emporium, but general laziness forced me to close the site down several years ago.

The source is currently hosted on Github.

Dibrova on Guthub

Direct link to download Dibrova