Skip to content

Instantly share code, notes, and snippets.

@sween
Created June 15, 2010 02:40
Show Gist options
  • Save sween/438629 to your computer and use it in GitHub Desktop.
Save sween/438629 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'dicom'
require 'ruby-growl'
# For Flavor for the Recording
g = Growl.new("localhost", "ruby-growl", ["ruby-growl Notification"], ["ruby-growl Notification"], nil)
g.notify("ruby-growl Notification", "Example C-MOVE with Ruby DICOM", "Starting the Script", 1, true)
sleep(3)
# Stack up some DICOM Nodes
g.notify("ruby-growl Notification", "Setting up the DICOM Nodes", "OsiriX and DCM4CHEE", 1, true)
pacs = DICOM::DClient.new("127.0.0.1", 11112, :host_ae => "DCM4CHEE", :max_package_size => 1500, :timeout => 10)
pacs = DICOM::DClient.new("127.0.0.1", 4096, :host_ae => "OSIRIX", :max_package_size => 1500, :timeout => 10)
sleep(5)
# Echo the latest one, OsiriX
#gar = pacs.test
#g.notify("ruby-growl Notification", "Sent Echo Request to OsiriX", gar.to_s, 1, true)
#sleep(3)
# Simple DICOM Send
g.notify("ruby-growl Notification", "Sending a DICOM Image to OSIRIX", "Good 'Ol internet.dcm from osirix-viewer.com", 1, true)
pacs.send("/Users/sween/Desktop/internet.dcm")
sleep(4)
g.notify("ruby-growl Notification", "Attempting a CMOVE to DCM4CHEE", "From Osirix", 1, true)
pacs.move_study("DCM4CHEE", "0010,0020" => "3369309")
sleep(3)
g.notify("ruby-growl Notification", "Example C-MOVE with Ruby DICOM", "Golf Clap", 1, true)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment